2021-01-29 01:33:29 +03:00
|
|
|
/- sur=metadata-store
|
2021-01-12 07:26:19 +03:00
|
|
|
/+ resource
|
2021-01-13 07:05:22 +03:00
|
|
|
^?
|
2021-01-29 01:33:29 +03:00
|
|
|
=< [. sur]
|
|
|
|
=, sur
|
2020-02-26 00:23:07 +03:00
|
|
|
|%
|
2021-01-29 01:33:29 +03:00
|
|
|
++ enjs
|
2020-02-26 00:23:07 +03:00
|
|
|
=, enjs:format
|
2021-01-29 01:33:29 +03:00
|
|
|
|%
|
2021-02-01 09:27:38 +03:00
|
|
|
::
|
|
|
|
++ initial-group
|
|
|
|
|= [group=resource assocs=^associations]
|
|
|
|
%- pairs
|
|
|
|
:~ group+s+(enjs-path:resource group)
|
|
|
|
associations+(associations assocs)
|
|
|
|
==
|
|
|
|
::
|
2021-01-29 01:33:29 +03:00
|
|
|
++ associations
|
|
|
|
|= =^associations
|
|
|
|
=, enjs:format
|
|
|
|
^- json
|
|
|
|
%- pairs
|
|
|
|
%+ turn ~(tap by associations)
|
|
|
|
|= [=md-resource [group=resource =^metadatum]]
|
|
|
|
^- [cord json]
|
|
|
|
:-
|
|
|
|
%- crip
|
|
|
|
;: weld
|
|
|
|
(trip (spat (en-path:resource group)))
|
|
|
|
(weld "/" (trip app-name.md-resource))
|
|
|
|
(trip (spat (en-path:resource resource.md-resource)))
|
|
|
|
==
|
|
|
|
%- pairs
|
|
|
|
:~ [%group s+(enjs-path:resource group)]
|
|
|
|
[%app-name s+app-name.md-resource]
|
|
|
|
[%resource s+(enjs-path:resource resource.md-resource)]
|
|
|
|
[%metadata (^metadatum metadatum)]
|
|
|
|
==
|
|
|
|
::
|
|
|
|
++ metadatum
|
|
|
|
|= met=^metadatum
|
|
|
|
^- json
|
|
|
|
%- pairs
|
|
|
|
:~ [%title s+title.met]
|
|
|
|
[%description s+description.met]
|
|
|
|
[%color s+(scot %ux color.met)]
|
|
|
|
[%date-created s+(scot %da date-created.met)]
|
|
|
|
[%creator s+(scot %p creator.met)]
|
2021-03-05 23:28:46 +03:00
|
|
|
::
|
|
|
|
:- %module
|
|
|
|
?: ?=(%& -.module.met)
|
|
|
|
s+p.module.met
|
|
|
|
?~ p.module.met
|
|
|
|
~
|
|
|
|
?~ u.p.module.met
|
|
|
|
o+~
|
|
|
|
%- pairs
|
|
|
|
:~ [%app-name s+app-name.u.u.p.module.met]
|
|
|
|
[%resource s+(enjs-path:resource resource.u.u.p.module.met)]
|
|
|
|
==
|
|
|
|
::
|
2021-01-29 01:33:29 +03:00
|
|
|
[%picture s+picture.met]
|
|
|
|
[%preview b+preview.met]
|
|
|
|
[%vip s+`@t`vip.met]
|
|
|
|
==
|
|
|
|
::
|
|
|
|
++ update
|
|
|
|
|= upd=^update
|
|
|
|
^- json
|
|
|
|
%+ frond %metadata-update
|
|
|
|
%- pairs
|
2021-02-01 09:27:38 +03:00
|
|
|
:~ ?- -.upd
|
2021-01-29 01:33:29 +03:00
|
|
|
%add
|
|
|
|
:- %add
|
|
|
|
%- pairs
|
|
|
|
:~ [%group s+(enjs-path:resource group.upd)]
|
|
|
|
[%app-name s+app-name.resource.upd]
|
|
|
|
[%resource s+(enjs-path:resource resource.resource.upd)]
|
|
|
|
[%metadata (metadatum metadatum.upd)]
|
|
|
|
==
|
|
|
|
%updated-metadata
|
|
|
|
:- %add
|
|
|
|
%- pairs
|
|
|
|
:~ [%group s+(enjs-path:resource group.upd)]
|
|
|
|
[%app-name s+app-name.resource.upd]
|
|
|
|
[%resource s+(enjs-path:resource resource.resource.upd)]
|
|
|
|
[%metadata (metadatum metadatum.upd)]
|
|
|
|
==
|
|
|
|
::
|
|
|
|
%remove
|
|
|
|
:- %remove
|
|
|
|
%- pairs
|
|
|
|
:~ [%group s+(enjs-path:resource group.upd)]
|
|
|
|
[%app-name s+app-name.resource.upd]
|
|
|
|
[%resource s+(enjs-path:resource resource.resource.upd)]
|
|
|
|
==
|
|
|
|
::
|
|
|
|
%associations
|
|
|
|
[%associations (associations associations.upd)]
|
2021-02-01 09:27:38 +03:00
|
|
|
::
|
|
|
|
%initial-group
|
|
|
|
[%initial-group (initial-group +.upd)]
|
2021-01-29 01:33:29 +03:00
|
|
|
::
|
|
|
|
== ==
|
|
|
|
::
|
|
|
|
++ hook-update
|
|
|
|
|= upd=^hook-update
|
|
|
|
%+ frond %metadata-hook-update
|
|
|
|
%+ frond -.upd
|
|
|
|
%- pairs
|
|
|
|
?- -.upd
|
|
|
|
%preview
|
|
|
|
:~ [%group s+(enjs-path:resource group.upd)]
|
|
|
|
[%channels (associations channels.upd)]
|
|
|
|
[%members (numb members.upd)]
|
|
|
|
[%channel-count (numb channel-count.upd)]
|
|
|
|
[%metadata (metadatum metadatum.upd)]
|
|
|
|
==
|
|
|
|
%req-preview
|
|
|
|
~[group+s+(enjs-path:resource group.upd)]
|
|
|
|
==
|
|
|
|
--
|
2020-02-26 00:23:07 +03:00
|
|
|
::
|
2021-01-29 01:33:29 +03:00
|
|
|
++ dejs
|
2020-03-03 04:03:56 +03:00
|
|
|
=, dejs:format
|
|
|
|
|%
|
2021-01-29 01:33:29 +03:00
|
|
|
++ action
|
2020-03-03 04:03:56 +03:00
|
|
|
%- of
|
|
|
|
:~ [%add add]
|
|
|
|
[%remove remove]
|
2021-01-29 01:33:29 +03:00
|
|
|
[%initial-group initial-group]
|
2020-03-03 04:03:56 +03:00
|
|
|
==
|
|
|
|
::
|
2021-01-29 01:33:29 +03:00
|
|
|
++ initial-group
|
|
|
|
|= json
|
2021-02-01 10:54:37 +03:00
|
|
|
[*resource *associations]
|
2021-01-29 01:33:29 +03:00
|
|
|
::
|
2020-03-03 04:03:56 +03:00
|
|
|
++ add
|
|
|
|
%- ot
|
2021-01-12 07:26:19 +03:00
|
|
|
:~ [%group dejs-path:resource]
|
2020-06-08 10:53:16 +03:00
|
|
|
[%resource md-resource]
|
2021-01-28 09:13:57 +03:00
|
|
|
[%metadata metadatum]
|
2020-03-03 04:03:56 +03:00
|
|
|
==
|
|
|
|
++ remove
|
|
|
|
%- ot
|
2021-01-12 07:26:19 +03:00
|
|
|
:~ [%group dejs-path:resource]
|
2020-06-08 10:53:16 +03:00
|
|
|
[%resource md-resource]
|
2020-03-03 04:03:56 +03:00
|
|
|
==
|
|
|
|
::
|
|
|
|
++ nu
|
|
|
|
|= jon=json
|
2020-11-26 17:09:31 +03:00
|
|
|
?> ?=([%s *] jon)
|
2020-03-03 04:03:56 +03:00
|
|
|
(rash p.jon hex)
|
|
|
|
::
|
2021-01-26 04:46:06 +03:00
|
|
|
++ vip
|
2021-01-20 04:51:07 +03:00
|
|
|
%- su
|
2021-02-10 11:54:46 +03:00
|
|
|
%- perk
|
|
|
|
:~ %reader-comments
|
|
|
|
%member-metadata
|
|
|
|
%$
|
2021-01-20 04:51:07 +03:00
|
|
|
==
|
|
|
|
::
|
2021-01-28 09:13:57 +03:00
|
|
|
++ metadatum
|
2021-01-29 01:33:29 +03:00
|
|
|
^- $-(json ^metadatum)
|
2020-03-03 04:03:56 +03:00
|
|
|
%- ot
|
|
|
|
:~ [%title so]
|
|
|
|
[%description so]
|
|
|
|
[%color nu]
|
|
|
|
[%date-created (se %da)]
|
|
|
|
[%creator (su ;~(pfix sig fed:ag))]
|
2021-03-05 23:28:46 +03:00
|
|
|
[%module module]
|
2021-01-14 04:12:48 +03:00
|
|
|
[%picture so]
|
2021-01-18 05:02:18 +03:00
|
|
|
[%preview bo]
|
2021-01-26 04:46:06 +03:00
|
|
|
[%vip vip]
|
2020-03-03 04:03:56 +03:00
|
|
|
==
|
2021-01-12 07:26:19 +03:00
|
|
|
::
|
2021-03-05 23:28:46 +03:00
|
|
|
++ module
|
|
|
|
|= jon=^json
|
|
|
|
^- (each term (unit (unit ^md-resource)))
|
|
|
|
?~ jon
|
|
|
|
[%| ~]
|
|
|
|
?: ?=(%s -.jon)
|
|
|
|
[%& p.jon]
|
|
|
|
?> ?=(%o -.jon)
|
|
|
|
:+ %| ~
|
|
|
|
?. ?& (~(has by p.jon) 'app-name')
|
|
|
|
(~(has by p.jon) 'resource')
|
|
|
|
==
|
|
|
|
~
|
|
|
|
=/ app-name=^json (~(got by p.jon) 'app-name')
|
|
|
|
?> ?=(%s -.app-name)
|
|
|
|
:+ ~
|
|
|
|
p.app-name
|
|
|
|
=/ res=^json (~(got by p.jon) 'resource')
|
|
|
|
(dejs-path:resource res)
|
|
|
|
::
|
2020-06-08 10:53:16 +03:00
|
|
|
++ md-resource
|
2021-01-12 07:26:19 +03:00
|
|
|
^- $-(json ^md-resource)
|
2020-03-03 04:03:56 +03:00
|
|
|
%- ot
|
|
|
|
:~ [%app-name so]
|
2021-01-12 07:26:19 +03:00
|
|
|
[%resource dejs-path:resource]
|
2020-03-03 04:03:56 +03:00
|
|
|
==
|
|
|
|
--
|
2020-02-26 00:23:07 +03:00
|
|
|
--
|