@dryvcode/author 0.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (286) hide show
  1. package/README.md +341 -0
  2. package/dist/behavior/duration.d.ts +7 -0
  3. package/dist/behavior/duration.d.ts.map +1 -0
  4. package/dist/behavior/duration.js +20 -0
  5. package/dist/behavior/duration.js.map +1 -0
  6. package/dist/behavior/event.d.ts +23 -0
  7. package/dist/behavior/event.d.ts.map +1 -0
  8. package/dist/behavior/event.js +57 -0
  9. package/dist/behavior/event.js.map +1 -0
  10. package/dist/behavior/failure.d.ts +19 -0
  11. package/dist/behavior/failure.d.ts.map +1 -0
  12. package/dist/behavior/failure.js +48 -0
  13. package/dist/behavior/failure.js.map +1 -0
  14. package/dist/behavior/index.d.ts +6 -0
  15. package/dist/behavior/index.d.ts.map +1 -0
  16. package/dist/behavior/index.js +6 -0
  17. package/dist/behavior/index.js.map +1 -0
  18. package/dist/behavior/operation.d.ts +72 -0
  19. package/dist/behavior/operation.d.ts.map +1 -0
  20. package/dist/behavior/operation.js +193 -0
  21. package/dist/behavior/operation.js.map +1 -0
  22. package/dist/behavior/policy.d.ts +29 -0
  23. package/dist/behavior/policy.d.ts.map +1 -0
  24. package/dist/behavior/policy.js +80 -0
  25. package/dist/behavior/policy.js.map +1 -0
  26. package/dist/composition/application.d.ts +28 -0
  27. package/dist/composition/application.d.ts.map +1 -0
  28. package/dist/composition/application.js +64 -0
  29. package/dist/composition/application.js.map +1 -0
  30. package/dist/composition/feature.d.ts +37 -0
  31. package/dist/composition/feature.d.ts.map +1 -0
  32. package/dist/composition/feature.js +82 -0
  33. package/dist/composition/feature.js.map +1 -0
  34. package/dist/composition/index.d.ts +3 -0
  35. package/dist/composition/index.d.ts.map +1 -0
  36. package/dist/composition/index.js +3 -0
  37. package/dist/composition/index.js.map +1 -0
  38. package/dist/contracts/behavior.d.ts +106 -0
  39. package/dist/contracts/behavior.d.ts.map +1 -0
  40. package/dist/contracts/behavior.js +2 -0
  41. package/dist/contracts/behavior.js.map +1 -0
  42. package/dist/contracts/composition.d.ts +20 -0
  43. package/dist/contracts/composition.d.ts.map +1 -0
  44. package/dist/contracts/composition.js +2 -0
  45. package/dist/contracts/composition.js.map +1 -0
  46. package/dist/contracts/definitions.d.ts +286 -0
  47. package/dist/contracts/definitions.d.ts.map +1 -0
  48. package/dist/contracts/definitions.js +35 -0
  49. package/dist/contracts/definitions.js.map +1 -0
  50. package/dist/contracts/expressions.d.ts +44 -0
  51. package/dist/contracts/expressions.d.ts.map +1 -0
  52. package/dist/contracts/expressions.js +2 -0
  53. package/dist/contracts/expressions.js.map +1 -0
  54. package/dist/contracts/foundation.d.ts +141 -0
  55. package/dist/contracts/foundation.d.ts.map +1 -0
  56. package/dist/contracts/foundation.js +2 -0
  57. package/dist/contracts/foundation.js.map +1 -0
  58. package/dist/contracts/index.d.ts +10 -0
  59. package/dist/contracts/index.d.ts.map +1 -0
  60. package/dist/contracts/index.js +10 -0
  61. package/dist/contracts/index.js.map +1 -0
  62. package/dist/contracts/interaction.d.ts +52 -0
  63. package/dist/contracts/interaction.d.ts.map +1 -0
  64. package/dist/contracts/interaction.js +2 -0
  65. package/dist/contracts/interaction.js.map +1 -0
  66. package/dist/contracts/interfaces.d.ts +73 -0
  67. package/dist/contracts/interfaces.d.ts.map +1 -0
  68. package/dist/contracts/interfaces.js +2 -0
  69. package/dist/contracts/interfaces.js.map +1 -0
  70. package/dist/contracts/orchestration.d.ts +56 -0
  71. package/dist/contracts/orchestration.d.ts.map +1 -0
  72. package/dist/contracts/orchestration.js +2 -0
  73. package/dist/contracts/orchestration.js.map +1 -0
  74. package/dist/contracts/project.d.ts +70 -0
  75. package/dist/contracts/project.d.ts.map +1 -0
  76. package/dist/contracts/project.js +2 -0
  77. package/dist/contracts/project.js.map +1 -0
  78. package/dist/data/index.d.ts +2 -0
  79. package/dist/data/index.d.ts.map +1 -0
  80. package/dist/data/index.js +2 -0
  81. package/dist/data/index.js.map +1 -0
  82. package/dist/data/storage.d.ts +23 -0
  83. package/dist/data/storage.d.ts.map +1 -0
  84. package/dist/data/storage.js +93 -0
  85. package/dist/data/storage.js.map +1 -0
  86. package/dist/definitions/expressions/expression.d.ts +49 -0
  87. package/dist/definitions/expressions/expression.d.ts.map +1 -0
  88. package/dist/definitions/expressions/expression.js +181 -0
  89. package/dist/definitions/expressions/expression.js.map +1 -0
  90. package/dist/definitions/expressions/index.d.ts +2 -0
  91. package/dist/definitions/expressions/index.d.ts.map +1 -0
  92. package/dist/definitions/expressions/index.js +2 -0
  93. package/dist/definitions/expressions/index.js.map +1 -0
  94. package/dist/definitions/index.d.ts +7 -0
  95. package/dist/definitions/index.d.ts.map +1 -0
  96. package/dist/definitions/index.js +7 -0
  97. package/dist/definitions/index.js.map +1 -0
  98. package/dist/definitions/properties/advanced.d.ts +27 -0
  99. package/dist/definitions/properties/advanced.d.ts.map +1 -0
  100. package/dist/definitions/properties/advanced.js +95 -0
  101. package/dist/definitions/properties/advanced.js.map +1 -0
  102. package/dist/definitions/properties/base.d.ts +29 -0
  103. package/dist/definitions/properties/base.d.ts.map +1 -0
  104. package/dist/definitions/properties/base.js +60 -0
  105. package/dist/definitions/properties/base.js.map +1 -0
  106. package/dist/definitions/properties/composite.d.ts +14 -0
  107. package/dist/definitions/properties/composite.d.ts.map +1 -0
  108. package/dist/definitions/properties/composite.js +41 -0
  109. package/dist/definitions/properties/composite.js.map +1 -0
  110. package/dist/definitions/properties/enumeration.d.ts +17 -0
  111. package/dist/definitions/properties/enumeration.d.ts.map +1 -0
  112. package/dist/definitions/properties/enumeration.js +48 -0
  113. package/dist/definitions/properties/enumeration.js.map +1 -0
  114. package/dist/definitions/properties/generic.d.ts +22 -0
  115. package/dist/definitions/properties/generic.d.ts.map +1 -0
  116. package/dist/definitions/properties/generic.js +61 -0
  117. package/dist/definitions/properties/generic.js.map +1 -0
  118. package/dist/definitions/properties/index.d.ts +12 -0
  119. package/dist/definitions/properties/index.d.ts.map +1 -0
  120. package/dist/definitions/properties/index.js +3 -0
  121. package/dist/definitions/properties/index.js.map +1 -0
  122. package/dist/definitions/properties/metadata.d.ts +6 -0
  123. package/dist/definitions/properties/metadata.d.ts.map +1 -0
  124. package/dist/definitions/properties/metadata.js +4 -0
  125. package/dist/definitions/properties/metadata.js.map +1 -0
  126. package/dist/definitions/properties/primitive.d.ts +66 -0
  127. package/dist/definitions/properties/primitive.d.ts.map +1 -0
  128. package/dist/definitions/properties/primitive.js +266 -0
  129. package/dist/definitions/properties/primitive.js.map +1 -0
  130. package/dist/definitions/properties/property.d.ts +171 -0
  131. package/dist/definitions/properties/property.d.ts.map +1 -0
  132. package/dist/definitions/properties/property.js +211 -0
  133. package/dist/definitions/properties/property.js.map +1 -0
  134. package/dist/definitions/properties/temporal.d.ts +37 -0
  135. package/dist/definitions/properties/temporal.d.ts.map +1 -0
  136. package/dist/definitions/properties/temporal.js +115 -0
  137. package/dist/definitions/properties/temporal.js.map +1 -0
  138. package/dist/definitions/schemas/field.d.ts +123 -0
  139. package/dist/definitions/schemas/field.d.ts.map +1 -0
  140. package/dist/definitions/schemas/field.js +329 -0
  141. package/dist/definitions/schemas/field.js.map +1 -0
  142. package/dist/definitions/schemas/index.d.ts +6 -0
  143. package/dist/definitions/schemas/index.d.ts.map +1 -0
  144. package/dist/definitions/schemas/index.js +6 -0
  145. package/dist/definitions/schemas/index.js.map +1 -0
  146. package/dist/definitions/schemas/projection.d.ts +90 -0
  147. package/dist/definitions/schemas/projection.d.ts.map +1 -0
  148. package/dist/definitions/schemas/projection.js +146 -0
  149. package/dist/definitions/schemas/projection.js.map +1 -0
  150. package/dist/definitions/schemas/relation.d.ts +12 -0
  151. package/dist/definitions/schemas/relation.d.ts.map +1 -0
  152. package/dist/definitions/schemas/relation.js +27 -0
  153. package/dist/definitions/schemas/relation.js.map +1 -0
  154. package/dist/definitions/schemas/schema.d.ts +46 -0
  155. package/dist/definitions/schemas/schema.d.ts.map +1 -0
  156. package/dist/definitions/schemas/schema.js +134 -0
  157. package/dist/definitions/schemas/schema.js.map +1 -0
  158. package/dist/definitions/schemas/source.d.ts +30 -0
  159. package/dist/definitions/schemas/source.d.ts.map +1 -0
  160. package/dist/definitions/schemas/source.js +73 -0
  161. package/dist/definitions/schemas/source.js.map +1 -0
  162. package/dist/definitions/types/expressions.d.ts +28 -0
  163. package/dist/definitions/types/expressions.d.ts.map +1 -0
  164. package/dist/definitions/types/expressions.js +81 -0
  165. package/dist/definitions/types/expressions.js.map +1 -0
  166. package/dist/definitions/types/index.d.ts +4 -0
  167. package/dist/definitions/types/index.d.ts.map +1 -0
  168. package/dist/definitions/types/index.js +4 -0
  169. package/dist/definitions/types/index.js.map +1 -0
  170. package/dist/definitions/types/parameter.d.ts +9 -0
  171. package/dist/definitions/types/parameter.d.ts.map +1 -0
  172. package/dist/definitions/types/parameter.js +24 -0
  173. package/dist/definitions/types/parameter.js.map +1 -0
  174. package/dist/definitions/types/spec.d.ts +26 -0
  175. package/dist/definitions/types/spec.d.ts.map +1 -0
  176. package/dist/definitions/types/spec.js +74 -0
  177. package/dist/definitions/types/spec.js.map +1 -0
  178. package/dist/foundation/declaration.d.ts +24 -0
  179. package/dist/foundation/declaration.d.ts.map +1 -0
  180. package/dist/foundation/declaration.js +43 -0
  181. package/dist/foundation/declaration.js.map +1 -0
  182. package/dist/foundation/group.d.ts +55 -0
  183. package/dist/foundation/group.d.ts.map +1 -0
  184. package/dist/foundation/group.js +199 -0
  185. package/dist/foundation/group.js.map +1 -0
  186. package/dist/foundation/index.d.ts +7 -0
  187. package/dist/foundation/index.d.ts.map +1 -0
  188. package/dist/foundation/index.js +7 -0
  189. package/dist/foundation/index.js.map +1 -0
  190. package/dist/foundation/metadata.d.ts +22 -0
  191. package/dist/foundation/metadata.d.ts.map +1 -0
  192. package/dist/foundation/metadata.js +43 -0
  193. package/dist/foundation/metadata.js.map +1 -0
  194. package/dist/foundation/ref.d.ts +200 -0
  195. package/dist/foundation/ref.d.ts.map +1 -0
  196. package/dist/foundation/ref.js +230 -0
  197. package/dist/foundation/ref.js.map +1 -0
  198. package/dist/foundation/scope.d.ts +13 -0
  199. package/dist/foundation/scope.d.ts.map +1 -0
  200. package/dist/foundation/scope.js +63 -0
  201. package/dist/foundation/scope.js.map +1 -0
  202. package/dist/foundation/value-declaration.d.ts +9 -0
  203. package/dist/foundation/value-declaration.d.ts.map +1 -0
  204. package/dist/foundation/value-declaration.js +2 -0
  205. package/dist/foundation/value-declaration.js.map +1 -0
  206. package/dist/index.d.ts +16 -0
  207. package/dist/index.d.ts.map +1 -0
  208. package/dist/index.js +15 -0
  209. package/dist/index.js.map +1 -0
  210. package/dist/interaction/index.d.ts +3 -0
  211. package/dist/interaction/index.d.ts.map +1 -0
  212. package/dist/interaction/index.js +3 -0
  213. package/dist/interaction/index.js.map +1 -0
  214. package/dist/interaction/part.d.ts +58 -0
  215. package/dist/interaction/part.d.ts.map +1 -0
  216. package/dist/interaction/part.js +178 -0
  217. package/dist/interaction/part.js.map +1 -0
  218. package/dist/interaction/view.d.ts +34 -0
  219. package/dist/interaction/view.d.ts.map +1 -0
  220. package/dist/interaction/view.js +109 -0
  221. package/dist/interaction/view.js.map +1 -0
  222. package/dist/interfaces/facet.d.ts +6 -0
  223. package/dist/interfaces/facet.d.ts.map +1 -0
  224. package/dist/interfaces/facet.js +2 -0
  225. package/dist/interfaces/facet.js.map +1 -0
  226. package/dist/interfaces/http.d.ts +39 -0
  227. package/dist/interfaces/http.d.ts.map +1 -0
  228. package/dist/interfaces/http.js +109 -0
  229. package/dist/interfaces/http.js.map +1 -0
  230. package/dist/interfaces/index.d.ts +7 -0
  231. package/dist/interfaces/index.d.ts.map +1 -0
  232. package/dist/interfaces/index.js +7 -0
  233. package/dist/interfaces/index.js.map +1 -0
  234. package/dist/interfaces/representation.d.ts +14 -0
  235. package/dist/interfaces/representation.d.ts.map +1 -0
  236. package/dist/interfaces/representation.js +25 -0
  237. package/dist/interfaces/representation.js.map +1 -0
  238. package/dist/interfaces/schedule.d.ts +14 -0
  239. package/dist/interfaces/schedule.d.ts.map +1 -0
  240. package/dist/interfaces/schedule.js +46 -0
  241. package/dist/interfaces/schedule.js.map +1 -0
  242. package/dist/interfaces/surface.d.ts +22 -0
  243. package/dist/interfaces/surface.d.ts.map +1 -0
  244. package/dist/interfaces/surface.js +44 -0
  245. package/dist/interfaces/surface.js.map +1 -0
  246. package/dist/interfaces/websocket.d.ts +11 -0
  247. package/dist/interfaces/websocket.d.ts.map +1 -0
  248. package/dist/interfaces/websocket.js +25 -0
  249. package/dist/interfaces/websocket.js.map +1 -0
  250. package/dist/orchestration/index.d.ts +4 -0
  251. package/dist/orchestration/index.d.ts.map +1 -0
  252. package/dist/orchestration/index.js +4 -0
  253. package/dist/orchestration/index.js.map +1 -0
  254. package/dist/orchestration/steps.d.ts +41 -0
  255. package/dist/orchestration/steps.d.ts.map +1 -0
  256. package/dist/orchestration/steps.js +105 -0
  257. package/dist/orchestration/steps.js.map +1 -0
  258. package/dist/orchestration/value-source.d.ts +8 -0
  259. package/dist/orchestration/value-source.d.ts.map +1 -0
  260. package/dist/orchestration/value-source.js +10 -0
  261. package/dist/orchestration/value-source.js.map +1 -0
  262. package/dist/orchestration/workflow.d.ts +38 -0
  263. package/dist/orchestration/workflow.d.ts.map +1 -0
  264. package/dist/orchestration/workflow.js +116 -0
  265. package/dist/orchestration/workflow.js.map +1 -0
  266. package/dist/project/index.d.ts +2 -0
  267. package/dist/project/index.d.ts.map +1 -0
  268. package/dist/project/index.js +2 -0
  269. package/dist/project/index.js.map +1 -0
  270. package/dist/project/project.d.ts +27 -0
  271. package/dist/project/project.d.ts.map +1 -0
  272. package/dist/project/project.js +161 -0
  273. package/dist/project/project.js.map +1 -0
  274. package/dist/project/registry.d.ts +33 -0
  275. package/dist/project/registry.d.ts.map +1 -0
  276. package/dist/project/registry.js +58 -0
  277. package/dist/project/registry.js.map +1 -0
  278. package/dist/project/snapshot.d.ts +4 -0
  279. package/dist/project/snapshot.d.ts.map +1 -0
  280. package/dist/project/snapshot.js +15 -0
  281. package/dist/project/snapshot.js.map +1 -0
  282. package/dist/version.d.ts +3 -0
  283. package/dist/version.d.ts.map +1 -0
  284. package/dist/version.js +3 -0
  285. package/dist/version.js.map +1 -0
  286. package/package.json +49 -0
@@ -0,0 +1,27 @@
1
+ import type { AuthorSourceLocation, AuthorState } from "../contracts/index.js";
2
+ import { ApplicationDeclaration, type ApplicationOptions } from "../composition/application.js";
3
+ import { type GroupDeclaration, type GroupOptions } from "../foundation/group.js";
4
+ export declare const DRYV_APP_BRAND: unique symbol;
5
+ export interface AppOptions extends ApplicationOptions {
6
+ readonly name: string;
7
+ }
8
+ export declare class AppDeclaration extends ApplicationDeclaration {
9
+ #private;
10
+ readonly [DRYV_APP_BRAND]: true;
11
+ private _info;
12
+ private _infoOrigin;
13
+ constructor(options: AppOptions);
14
+ info(value: {
15
+ readonly title: string;
16
+ readonly version?: string;
17
+ readonly description?: string;
18
+ }, origin?: AuthorSourceLocation): this;
19
+ groups(...values: readonly GroupDeclaration[]): this;
20
+ snapshot(): AuthorState;
21
+ }
22
+ export declare function isDryvApp(value: unknown): value is AppDeclaration;
23
+ export declare const dryv: Readonly<{
24
+ group: (options: GroupOptions) => GroupDeclaration;
25
+ app: (options: AppOptions) => AppDeclaration;
26
+ }>;
27
+ //# sourceMappingURL=project.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"project.d.ts","sourceRoot":"","sources":["../../src/project/project.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAKV,oBAAoB,EACpB,WAAW,EAEZ,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EACL,sBAAsB,EACtB,KAAK,kBAAkB,EACxB,MAAM,2BAA2B,CAAC;AACnC,OAAO,EAEL,KAAK,gBAAgB,EACrB,KAAK,YAAY,EAClB,MAAM,oBAAoB,CAAC;AAQ5B,eAAO,MAAM,cAAc,eAA2C,CAAC;AAEvE,MAAM,WAAW,UAAW,SAAQ,kBAAkB;IACpD,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;CACvB;AAyCD,qBAAa,cAAe,SAAQ,sBAAsB;;IACxD,QAAQ,CAAC,CAAC,cAAc,CAAC,OAAiB;IAE1C,OAAO,CAAC,KAAK,CAAkB;IAC/B,OAAO,CAAC,WAAW,CAAmC;IAGtD,YAAY,OAAO,EAAE,UAAU,EAQ9B;IAED,IAAI,CACF,KAAK,EAAE;QACL,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;QACvB,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,CAAC;QAC1B,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,CAAC;KAC/B,EACD,MAAM,CAAC,EAAE,oBAAoB,GAC5B,IAAI,CAUN;IAEQ,MAAM,CAAC,GAAG,MAAM,EAAE,SAAS,gBAAgB,EAAE,GAAG,IAAI,CAU5D;IAED,QAAQ,IAAI,WAAW,CAyGtB;CACF;AAED,wBAAgB,SAAS,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,cAAc,CAOjE;AAED,eAAO,MAAM,IAAI;qBACE,YAAY,KAAG,gBAAgB;mBACjC,UAAU,KAAG,cAAc;EAC1C,CAAC"}
@@ -0,0 +1,161 @@
1
+ import { AUTHOR_REPRESENTATION_VERSION, AUTHOR_VERSION } from "../version.js";
2
+ import { ApplicationDeclaration, } from "../composition/application.js";
3
+ import { group, } from "../foundation/group.js";
4
+ import { groupRegistryNames, requireKey, requireScopedKey, } from "./registry.js";
5
+ export const DRYV_APP_BRAND = Symbol.for("dryv.author.typescript.app");
6
+ function emptyScopedStates() {
7
+ return Object.fromEntries(groupRegistryNames.map((name) => [name, {}]));
8
+ }
9
+ function emptyScopedOrigins() {
10
+ return Object.fromEntries(groupRegistryNames.map((name) => [name, {}]));
11
+ }
12
+ function sorted(value) {
13
+ return Object.fromEntries(Object.entries(value).sort(([a], [b]) => a.localeCompare(b)));
14
+ }
15
+ function sortedScoped(value) {
16
+ return Object.fromEntries(Object.entries(value)
17
+ .sort(([a], [b]) => a.localeCompare(b))
18
+ .map(([groupName, items]) => [groupName, sorted(items)]));
19
+ }
20
+ export class AppDeclaration extends ApplicationDeclaration {
21
+ [DRYV_APP_BRAND] = true;
22
+ #key;
23
+ _info;
24
+ _infoOrigin;
25
+ #groups = new Map();
26
+ constructor(options) {
27
+ super(options.description === undefined
28
+ ? {}
29
+ : { description: options.description });
30
+ this.#key = requireScopedKey(options.name, "app name");
31
+ this._info = { title: this.#key, version: "0.1.0" };
32
+ }
33
+ info(value, origin) {
34
+ this._info = {
35
+ title: requireKey(value.title, "info title"),
36
+ version: requireKey(value.version ?? "0.1.0", "info version"),
37
+ ...(value.description === undefined
38
+ ? {}
39
+ : { description: value.description }),
40
+ };
41
+ this._infoOrigin = origin;
42
+ return this;
43
+ }
44
+ groups(...values) {
45
+ for (const value of values) {
46
+ const name = value.groupName();
47
+ if (this.#groups.has(name)) {
48
+ throw new TypeError(`duplicate app group name: ${name}`);
49
+ }
50
+ this.#groups.set(name, value);
51
+ }
52
+ super.groups(...this.#groups.values());
53
+ return this;
54
+ }
55
+ snapshot() {
56
+ const groups = {};
57
+ const groupOrigins = {};
58
+ const states = emptyScopedStates();
59
+ const origins = emptyScopedOrigins();
60
+ const identities = new Map();
61
+ const remember = (identity, location) => {
62
+ const prior = identities.get(identity);
63
+ if (prior !== undefined) {
64
+ throw new TypeError(`declaration already composed as ${prior}; cannot also compose as ${location}`);
65
+ }
66
+ identities.set(identity, location);
67
+ };
68
+ remember(this.identity, `application.${this.#key}`);
69
+ for (const [groupName, groupValue] of [...this.#groups].sort(([a], [b]) => a.localeCompare(b))) {
70
+ remember(groupValue.identity, `groups.${groupName}`);
71
+ const groupState = groupValue.toState();
72
+ groups[groupName] = groupState;
73
+ if (groupState.origin !== undefined) {
74
+ groupOrigins[groupName] = groupState.origin;
75
+ }
76
+ for (const registry of groupRegistryNames) {
77
+ const entries = groupValue._entries(registry);
78
+ if (entries.length === 0)
79
+ continue;
80
+ const groupStates = {};
81
+ const groupStateOrigins = {};
82
+ for (const [name, declaration] of entries) {
83
+ remember(declaration.identity, `${registry}.${groupName}.${name}`);
84
+ const state = declaration.toState();
85
+ groupStates[name] = state;
86
+ if (state.origin !== undefined) {
87
+ groupStateOrigins[name] = state.origin;
88
+ }
89
+ }
90
+ states[registry][groupName] = groupStates;
91
+ if (Object.keys(groupStateOrigins).length > 0) {
92
+ origins[registry][groupName] = groupStateOrigins;
93
+ }
94
+ }
95
+ }
96
+ const authorOrigins = {
97
+ ...(this._infoOrigin === undefined ? {} : { info: this._infoOrigin }),
98
+ groups: sorted(groupOrigins),
99
+ primitives: sortedScoped(origins.primitives),
100
+ enums: sortedScoped(origins.enums),
101
+ composites: sortedScoped(origins.composites),
102
+ literals: sortedScoped(origins.literals),
103
+ unions: sortedScoped(origins.unions),
104
+ records: sortedScoped(origins.records),
105
+ tuples: sortedScoped(origins.tuples),
106
+ generics: sortedScoped(origins.generics),
107
+ temporal: sortedScoped(origins.temporal),
108
+ schemas: sortedScoped(origins.schemas),
109
+ expressions: sortedScoped(origins.expressions),
110
+ policies: sortedScoped(origins.policies),
111
+ failures: sortedScoped(origins.failures),
112
+ events: sortedScoped(origins.events),
113
+ operations: sortedScoped(origins.operations),
114
+ views: sortedScoped(origins.views),
115
+ workflows: sortedScoped(origins.workflows),
116
+ surfaces: sortedScoped(origins.surfaces),
117
+ features: sortedScoped(origins.features),
118
+ applications: sortedScoped(origins.applications),
119
+ };
120
+ return {
121
+ representationVersion: AUTHOR_REPRESENTATION_VERSION,
122
+ authorVersion: AUTHOR_VERSION,
123
+ key: this.#key,
124
+ info: { ...this._info },
125
+ application: this.toState(),
126
+ groups: sorted(groups),
127
+ primitives: sortedScoped(states.primitives),
128
+ enums: sortedScoped(states.enums),
129
+ composites: sortedScoped(states.composites),
130
+ literals: sortedScoped(states.literals),
131
+ unions: sortedScoped(states.unions),
132
+ records: sortedScoped(states.records),
133
+ tuples: sortedScoped(states.tuples),
134
+ generics: sortedScoped(states.generics),
135
+ temporal: sortedScoped(states.temporal),
136
+ schemas: sortedScoped(states.schemas),
137
+ expressions: sortedScoped(states.expressions),
138
+ policies: sortedScoped(states.policies),
139
+ failures: sortedScoped(states.failures),
140
+ events: sortedScoped(states.events),
141
+ operations: sortedScoped(states.operations),
142
+ views: sortedScoped(states.views),
143
+ workflows: sortedScoped(states.workflows),
144
+ surfaces: sortedScoped(states.surfaces),
145
+ features: sortedScoped(states.features),
146
+ applications: sortedScoped(states.applications),
147
+ origins: authorOrigins,
148
+ };
149
+ }
150
+ }
151
+ export function isDryvApp(value) {
152
+ return (typeof value === "object" &&
153
+ value !== null &&
154
+ DRYV_APP_BRAND in value &&
155
+ value[DRYV_APP_BRAND] === true);
156
+ }
157
+ export const dryv = Object.freeze({
158
+ group: (options) => group(options),
159
+ app: (options) => new AppDeclaration(options),
160
+ });
161
+ //# sourceMappingURL=project.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"project.js","sourceRoot":"","sources":["../../src/project/project.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,6BAA6B,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC;AAU1E,OAAO,EACL,sBAAsB,GAEvB,MAAM,2BAA2B,CAAC;AACnC,OAAO,EACL,KAAK,GAGN,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EACL,kBAAkB,EAClB,UAAU,EACV,gBAAgB,GAEjB,MAAM,oBAAoB,CAAC;AAE5B,MAAM,CAAC,MAAM,cAAc,GAAG,MAAM,CAAC,GAAG,CAAC,4BAA4B,CAAC,CAAC;AAevE,SAAS,iBAAiB;IACxB,OAAO,MAAM,CAAC,WAAW,CACvB,kBAAkB,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC,CACtB,CAAC;AAC3B,CAAC;AAED,SAAS,kBAAkB;IACzB,OAAO,MAAM,CAAC,WAAW,CACvB,kBAAkB,CAAC,GAAG,CAAC,CAAC,IAAI,E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,KAAK,CAAC,OAAO,CAAC;IAClE,GAAG,EAAE,CAAC,OAAmB,EAAkB,EAAE,CAAC,IAAI,cAAc,CAAC,OAAO,CAAC;CAC1E,CAAC,CAAC"}
@@ -0,0 +1,33 @@
1
+ import type { DeclarationKind } from "../contracts/index.js";
2
+ import type { Declaration } from "../foundation/declaration.js";
3
+ export interface RegistrySpec {
4
+ readonly groups: Declaration<"group">;
5
+ readonly primitives: Declaration<"primitive">;
6
+ readonly enums: Declaration<"enum">;
7
+ readonly composites: Declaration<"composite">;
8
+ readonly literals: Declaration<"literal">;
9
+ readonly unions: Declaration<"union">;
10
+ readonly records: Declaration<"record">;
11
+ readonly tuples: Declaration<"tuple">;
12
+ readonly generics: Declaration<"generic">;
13
+ readonly temporal: Declaration<"temporal">;
14
+ readonly schemas: Declaration<"schema">;
15
+ readonly expressions: Declaration<"expression">;
16
+ readonly policies: Declaration<"policy">;
17
+ readonly failures: Declaration<"failure">;
18
+ readonly events: Declaration<"event">;
19
+ readonly operations: Declaration<"operation">;
20
+ readonly views: Declaration<"view">;
21
+ readonly workflows: Declaration<"workflow">;
22
+ readonly surfaces: Declaration<"surface">;
23
+ readonly features: Declaration<"feature">;
24
+ readonly applications: Declaration<"application">;
25
+ }
26
+ export type RegistryName = keyof RegistrySpec;
27
+ export type GroupRegistryName = Exclude<RegistryName, "groups">;
28
+ export type RegistryMap<R extends RegistryName> = Readonly<Record<string, RegistrySpec[R]>>;
29
+ export declare const groupRegistryNames: readonly ["primitives", "enums", "composites", "literals", "unions", "records", "tuples", "generics", "temporal", "schemas", "expressions", "policies", "failures", "events", "operations", "views", "workflows", "surfaces", "features", "applications"];
30
+ export declare const expectedKinds: Readonly<Record<RegistryName, DeclarationKind>>;
31
+ export declare function requireKey(value: string, field: string): string;
32
+ export declare function requireScopedKey(value: string, field: string): string;
33
+ //# sourceMappingURL=registry.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"registry.d.ts","sourceRoot":"","sources":["../../src/project/registry.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CAAC,SAAS,EAAE,WAAW,CAAC,UAAU,CAAC,CAAC;IAC5C,QAAQ,CAAC,QAAQ,EAAE,WAAW,CAAC,SAAS,CAAC,CAAC;IAC1C,QAAQ,CAAC,QAAQ,EAAE,WAAW,CAAC,SAAS,CAAC,CAAC;IAC1C,QAAQ,CAAC,YAAY,EAAE,WAAW,CAAC,aAAa,CAAC,CAAC;CACnD;AAED,MAAM,MAAM,YAAY,GAAG,MAAM,YAAY,CAAC;AAC9C,MAAM,MAAM,iBAAiB,GAAG,OAAO,CAAC,YAAY,EAAE,QAAQ,CAAC,CAAC;AAChE,MAAM,MAAM,WAAW,CAAC,CAAC,SAAS,YAAY,IAAI,QAAQ,CACxD,MAAM,CAAC,MAAM,EAAE,YAAY,CAAC,CAAC,CAAC,CAAC,CAChC,CAAC;AAEF,eAAO,MAAM,kBAAkB,2PAqBkB,CAAC;AAElD,eAAO,MAAM,aAAa,EAAE,QAAQ,CAAC,MAAM,CAAC,YAAY,EAAE,eAAe,CAAC,CAsBzE,CAAC;AAEF,wBAAgB,UAAU,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,MAAM,CAG/D;AAED,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,MAAM,CAMrE"}
@@ -0,0 +1,58 @@
1
+ export const groupRegistryNames = [
2
+ "primitives",
3
+ "enums",
4
+ "composites",
5
+ "literals",
6
+ "unions",
7
+ "records",
8
+ "tuples",
9
+ "generics",
10
+ "temporal",
11
+ "schemas",
12
+ "expressions",
13
+ "policies",
14
+ "failures",
15
+ "events",
16
+ "operations",
17
+ "views",
18
+ "workflows",
19
+ "surfaces",
20
+ "features",
21
+ "applications",
22
+ ];
23
+ export const expectedKinds = {
24
+ groups: "group",
25
+ primitives: "primitive",
26
+ enums: "enum",
27
+ composites: "composite",
28
+ literals: "literal",
29
+ unions: "union",
30
+ records: "record",
31
+ tuples: "tuple",
32
+ generics: "generic",
33
+ temporal: "temporal",
34
+ schemas: "schema",
35
+ expressions: "expression",
36
+ policies: "policy",
37
+ failures: "failure",
38
+ events: "event",
39
+ operations: "operation",
40
+ views: "view",
41
+ workflows: "workflow",
42
+ surfaces: "surface",
43
+ features: "feature",
44
+ applications: "application",
45
+ };
46
+ export function requireKey(value, field) {
47
+ if (!value.trim())
48
+ throw new TypeError(`${field} must not be empty`);
49
+ return value;
50
+ }
51
+ export function requireScopedKey(value, field) {
52
+ const result = requireKey(value, field);
53
+ if (result.includes(".")) {
54
+ throw new TypeError(`${field} must not contain '.'`);
55
+ }
56
+ return result;
57
+ }
58
+ //# sourceMappingURL=registry.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"registry.js","sourceRoot":"","sources":["../../src/project/registry.ts"],"names":[],"mappings":"AAiCA,MAAM,CAAC,MAAM,kBAAkB,GAAG;IAChC,YAAY;IACZ,OAAO;IACP,YAAY;IACZ,UAAU;IACV,QAAQ;IACR,SAAS;IACT,QAAQ;IACR,UAAU;IACV,UAAU;IACV,SAAS;IACT,aAAa;IACb,UAAU;IACV,UAAU;IACV,QAAQ;IACR,YAAY;IACZ,OAAO;IACP,WAAW;IACX,UAAU;IACV,UAAU;IACV,cAAc;CACiC,CAAC;AAElD,MAAM,CAAC,MAAM,aAAa,GAAoD;IAC5E,MAAM,EAAE,OAAO;IACf,UAAU,EAAE,WAAW;IACvB,KAAK,EAAE,MAAM;IACb,UAAU,EAAE,WAAW;IACvB,QAAQ,EAAE,SAAS;IACnB,MAAM,EAAE,OAAO;IACf,OAAO,EAAE,QAAQ;IACjB,MAAM,EAAE,OAAO;IACf,QAAQ,EAAE,SAAS;IACnB,QAAQ,EAAE,UAAU;IACpB,OAAO,EAAE,QAAQ;IACjB,WAAW,EAAE,YAAY;IACzB,QAAQ,EAAE,QAAQ;IAClB,QAAQ,EAAE,SAAS;IACnB,MAAM,EAAE,OAAO;IACf,UAAU,EAAE,WAAW;IACvB,KAAK,EAAE,MAAM;IACb,SAAS,EAAE,UAAU;IACrB,QAAQ,EAAE,SAAS;IACnB,QAAQ,EAAE,SAAS;IACnB,YAAY,EAAE,aAAa;CAC5B,CAAC;AAEF,MAAM,UAAU,UAAU,CAAC,KAAa,EAAE,KAAa;IACrD,IAAI,CAAC,KAAK,CAAC,IAAI,EAAE;QAAE,MAAM,IAAI,SAAS,CAAC,GAAG,KAAK,oBAAoB,CAAC,CAAC;IACrE,OAAO,KAAK,CAAC;AACf,CAAC;AAED,MAAM,UAAU,gBAAgB,CAAC,KAAa,EAAE,KAAa;IAC3D,MAAM,MAAM,GAAG,UAAU,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC;IACxC,IAAI,MAAM,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE,CAAC;QACzB,MAAM,IAAI,SAAS,CAAC,GAAG,KAAK,uBAAuB,CAAC,CAAC;IACvD,CAAC;IACD,OAAO,MAAM,CAAC;AAChB,CAAC"}
@@ -0,0 +1,4 @@
1
+ import type { AuthorDeclarationState, AuthorSourceLocation } from "../contracts/index.js";
2
+ export declare function sortedObject<T>(values: ReadonlyMap<string, T>): Record<string, T>;
3
+ export declare function originMap(map: ReadonlyMap<string, AuthorDeclarationState>): Record<string, AuthorSourceLocation>;
4
+ //# sourceMappingURL=snapshot.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"snapshot.d.ts","sourceRoot":"","sources":["../../src/project/snapshot.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,sBAAsB,EACtB,oBAAoB,EACrB,MAAM,mBAAmB,CAAC;AAE3B,wBAAgB,YAAY,CAAC,CAAC,EAC5B,MAAM,EAAE,WAAW,CAAC,MAAM,EAAE,CAAC,CAAC,GAC7B,MAAM,CAAC,MAAM,EAAE,CAAC,CAAC,CAInB;AAED,wBAAgB,SAAS,CACvB,GAAG,EAAE,WAAW,CAAC,MAAM,EAAE,sBAAsB,CAAC,GAC/C,MAAM,CAAC,MAAM,EAAE,oBAAoB,CAAC,CAQtC"}
@@ -0,0 +1,15 @@
1
+ export function sortedObject(values) {
2
+ const result = {};
3
+ for (const key of [...values.keys()].sort())
4
+ result[key] = values.get(key);
5
+ return result;
6
+ }
7
+ export function originMap(map) {
8
+ const result = {};
9
+ for (const [name, value] of [...map.entries()].sort(([a], [b]) => a.localeCompare(b))) {
10
+ if (value.origin !== undefined)
11
+ result[name] = value.origin;
12
+ }
13
+ return result;
14
+ }
15
+ //# sourceMappingURL=snapshot.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"snapshot.js","sourceRoot":"","sources":["../../src/project/snapshot.ts"],"names":[],"mappings":"AAKA,MAAM,UAAU,YAAY,CAC1B,MAA8B;IAE9B,MAAM,MAAM,GAAsB,EAAE,CAAC;IACrC,KAAK,MAAM,GAAG,IAAI,CAAC,GAAG,MAAM,CAAC,IAAI,EAAE,CAAC,CAAC,IAAI,EAAE;QAAE,MAAM,CAAC,GAAG,CAAC,GAAG,MAAM,CAAC,GAAG,CAAC,GAAG,CAAE,CAAC;IAC5E,OAAO,MAAM,CAAC;AAChB,CAAC;AAED,MAAM,UAAU,SAAS,CACvB,GAAgD;IAEhD,MAAM,MAAM,GAAyC,EAAE,CAAC;IACxD,KAAK,MAAM,CAAC,IAAI,EAAE,KAAK,CAAC,IAAI,CAAC,GAAG,GAAG,CAAC,OAAO,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,EAAE,CAC/D,CAAC,CAAC,aAAa,CAAC,CAAC,CAAC,CACnB,EAAE,CAAC;QACF,IAAI,KAAK,CAAC,MAAM,KAAK,SAAS;YAAE,MAAM,CAAC,IAAI,CAAC,GAAG,KAAK,CAAC,MAAM,CAAC;IAC9D,CAAC;IACD,OAAO,MAAM,CAAC;AAChB,CAAC"}
@@ -0,0 +1,3 @@
1
+ export declare const AUTHOR_VERSION: "0.0.1";
2
+ export declare const AUTHOR_REPRESENTATION_VERSION: "dryv.author.typescript/v1alpha1";
3
+ //# sourceMappingURL=version.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"version.d.ts","sourceRoot":"","sources":["../src/version.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,cAAc,EAAG,OAAgB,CAAC;AAC/C,eAAO,MAAM,6BAA6B,EACxC,iCAA0C,CAAC"}
@@ -0,0 +1,3 @@
1
+ export const AUTHOR_VERSION = "0.0.1";
2
+ export const AUTHOR_REPRESENTATION_VERSION = "dryv.author.typescript/v1alpha1";
3
+ //# sourceMappingURL=version.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"version.js","sourceRoot":"","sources":["../src/version.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,cAAc,GAAG,OAAgB,CAAC;AAC/C,MAAM,CAAC,MAAM,6BAA6B,GACxC,iCAA0C,CAAC"}
package/package.json ADDED
@@ -0,0 +1,49 @@
1
+ {
2
+ "name": "@dryvcode/author",
3
+ "version": "0.0.1",
4
+ "description": "Strongly typed TypeScript authoring SDK for Dryv",
5
+ "type": "module",
6
+ "packageManager": "bun@1.3.14",
7
+ "engines": {
8
+ "node": ">=22.18",
9
+ "bun": ">=1.3.14"
10
+ },
11
+ "imports": {
12
+ "#/*": "./src/*.ts"
13
+ },
14
+ "exports": {
15
+ ".": {
16
+ "types": "./dist/index.d.ts",
17
+ "import": "./dist/index.js"
18
+ }
19
+ },
20
+ "scripts": {
21
+ "build": "bunx --bun tsc -p tsconfig.build.json && bunx --bun tsc-alias -p tsconfig.build.json",
22
+ "typecheck": "bunx --bun tsc --noEmit -p tsconfig.json",
23
+ "test": "bun test",
24
+ "smoke": "bun -e \"import('./dist/index.js').then((m) => { if (typeof m.dryv !== 'object' || m.dryv === null || typeof m.dryv.group !== 'function' || typeof m.dryv.app !== 'function') throw new Error('invalid dist export'); })\"",
25
+ "format": "prettier --write \"src/**/*.ts\" \"tests/**/*.ts\"",
26
+ "format:check": "prettier --check \"src/**/*.ts\" \"tests/**/*.ts\"",
27
+ "check": "bun run format:check && bun run typecheck && bun test && bun run build && bun run smoke",
28
+ "prepare": "bun run build"
29
+ },
30
+ "devDependencies": {
31
+ "@types/bun": "1.4.1",
32
+ "prettier": "3.6.2",
33
+ "tsc-alias": "1.9.4",
34
+ "typescript": "7.0.2"
35
+ },
36
+ "license": "Apache-2.0",
37
+ "files": [
38
+ "dist",
39
+ "README.md"
40
+ ],
41
+ "repository": {
42
+ "type": "git",
43
+ "url": "https://github.com/dryvcode/dryv.git",
44
+ "directory": "plugins/authoring/typescript/author"
45
+ },
46
+ "publishConfig": {
47
+ "access": "public"
48
+ }
49
+ }