2020-02-26 00:23:07 +03:00
|
|
|
/- *metadata-store
|
2021-01-12 07:26:19 +03:00
|
|
|
/+ resource
|
2021-01-13 07:05:22 +03:00
|
|
|
^?
|
2020-02-26 00:23:07 +03:00
|
|
|
|%
|
|
|
|
++ associations-to-json
|
|
|
|
|= =associations
|
|
|
|
=, enjs:format
|
|
|
|
^- json
|
|
|
|
%- pairs
|
|
|
|
%+ turn ~(tap by associations)
|
2021-01-13 06:50:04 +03:00
|
|
|
|= [=md-resource [group=resource =metadata]]
|
2020-02-26 00:23:07 +03:00
|
|
|
^- [cord json]
|
2020-03-03 04:03:56 +03:00
|
|
|
:-
|
2020-02-26 00:23:07 +03:00
|
|
|
%- crip
|
|
|
|
;: weld
|
2021-01-12 07:26:19 +03:00
|
|
|
(trip (spat (en-path:resource group)))
|
2020-06-08 10:53:16 +03:00
|
|
|
(weld "/" (trip app-name.md-resource))
|
2021-01-12 07:26:19 +03:00
|
|
|
(trip (spat (en-path:resource resource.md-resource)))
|
2020-02-26 00:23:07 +03:00
|
|
|
==
|
|
|
|
%- pairs
|
2021-01-12 07:26:19 +03:00
|
|
|
:~ [%group s+(enjs-path:resource group)]
|
2020-06-08 10:53:16 +03:00
|
|
|
[%app-name s+app-name.md-resource]
|
2021-01-12 07:26:19 +03:00
|
|
|
[%resource s+(enjs-path:resource resource.md-resource)]
|
2020-02-26 00:23:07 +03:00
|
|
|
[%metadata (metadata-to-json metadata)]
|
|
|
|
==
|
|
|
|
::
|
2020-03-03 04:03:56 +03:00
|
|
|
++ json-to-action
|
|
|
|
|= jon=json
|
|
|
|
^- metadata-action
|
|
|
|
=, dejs:format
|
|
|
|
=< (parse-json jon)
|
|
|
|
|%
|
|
|
|
++ parse-json
|
|
|
|
%- of
|
|
|
|
:~ [%add add]
|
|
|
|
[%remove remove]
|
|
|
|
==
|
|
|
|
::
|
|
|
|
++ 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]
|
2020-03-03 04:03:56 +03:00
|
|
|
[%metadata metadata]
|
|
|
|
==
|
|
|
|
++ 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)
|
|
|
|
::
|
|
|
|
++ metadata
|
|
|
|
%- ot
|
|
|
|
:~ [%title so]
|
|
|
|
[%description so]
|
|
|
|
[%color nu]
|
|
|
|
[%date-created (se %da)]
|
|
|
|
[%creator (su ;~(pfix sig fed:ag))]
|
2020-09-22 20:26:19 +03:00
|
|
|
[%module so]
|
2021-01-14 04:12:48 +03:00
|
|
|
[%picture so]
|
2020-03-03 04:03:56 +03:00
|
|
|
==
|
2021-01-12 07:26:19 +03:00
|
|
|
::
|
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
|
|
|
++ metadata-to-json
|
|
|
|
|= met=metadata
|
|
|
|
^- json
|
|
|
|
=, enjs:format
|
|
|
|
%- 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)]
|
2020-09-22 20:26:19 +03:00
|
|
|
[%module s+module.met]
|
2021-01-14 04:12:48 +03:00
|
|
|
[%picture s+picture.met]
|
2020-02-26 00:23:07 +03:00
|
|
|
==
|
|
|
|
::
|
|
|
|
++ update-to-json
|
|
|
|
|= upd=metadata-update
|
|
|
|
^- json
|
2020-09-22 20:26:19 +03:00
|
|
|
=, enjs:format
|
2020-02-26 00:23:07 +03:00
|
|
|
%+ frond %metadata-update
|
|
|
|
%- pairs
|
2021-01-13 06:50:04 +03:00
|
|
|
:~ ?+ -.upd *[cord json]
|
2020-02-26 00:23:07 +03:00
|
|
|
%add
|
|
|
|
:- %add
|
|
|
|
%- pairs
|
2021-01-12 07:26:19 +03:00
|
|
|
:~ [%group s+(enjs-path:resource group.upd)]
|
2020-02-26 00:23:07 +03:00
|
|
|
[%app-name s+app-name.resource.upd]
|
2021-01-12 07:26:19 +03:00
|
|
|
[%resource s+(enjs-path:resource resource.resource.upd)]
|
2020-02-26 00:23:07 +03:00
|
|
|
[%metadata (metadata-to-json metadata.upd)]
|
|
|
|
==
|
|
|
|
::
|
|
|
|
%remove
|
|
|
|
:- %remove
|
|
|
|
%- pairs
|
2021-01-12 07:26:19 +03:00
|
|
|
:~ [%group s+(enjs-path:resource group.upd)]
|
2020-02-26 00:23:07 +03:00
|
|
|
[%app-name s+app-name.resource.upd]
|
2021-01-12 07:26:19 +03:00
|
|
|
[%resource s+(enjs-path:resource resource.resource.upd)]
|
2020-02-26 00:23:07 +03:00
|
|
|
==
|
|
|
|
::
|
|
|
|
%associations
|
|
|
|
[%associations (associations-to-json associations.upd)]
|
2021-01-15 08:45:51 +03:00
|
|
|
::
|
|
|
|
%preview
|
|
|
|
:- %preview
|
|
|
|
%- pairs
|
|
|
|
:~ [%group s+(enjs-path:resource group.upd)]
|
|
|
|
[%channels (associations-to-json channels.upd)]
|
|
|
|
[%members (numb members.upd)]
|
|
|
|
[%channel-count (numb channel-count.upd)]
|
|
|
|
[%metadata (metadata-to-json metadata.upd)]
|
|
|
|
==
|
2020-02-26 00:23:07 +03:00
|
|
|
== ==
|
|
|
|
--
|