@milaboratories/pl-middle-layer 1.10.12

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 (179) hide show
  1. package/dist/block_registry/index.d.ts +4 -0
  2. package/dist/block_registry/index.d.ts.map +1 -0
  3. package/dist/block_registry/registry.d.ts +37 -0
  4. package/dist/block_registry/registry.d.ts.map +1 -0
  5. package/dist/block_registry/registry_spec.d.ts +12 -0
  6. package/dist/block_registry/registry_spec.d.ts.map +1 -0
  7. package/dist/block_registry/watcher.d.ts +15 -0
  8. package/dist/block_registry/watcher.d.ts.map +1 -0
  9. package/dist/block_registry/well_known_registries.d.ts +4 -0
  10. package/dist/block_registry/well_known_registries.d.ts.map +1 -0
  11. package/dist/cfg_render/executor.d.ts +8 -0
  12. package/dist/cfg_render/executor.d.ts.map +1 -0
  13. package/dist/cfg_render/operation.d.ts +29 -0
  14. package/dist/cfg_render/operation.d.ts.map +1 -0
  15. package/dist/cfg_render/renderer.d.ts +6 -0
  16. package/dist/cfg_render/renderer.d.ts.map +1 -0
  17. package/dist/cfg_render/traverse.d.ts +3 -0
  18. package/dist/cfg_render/traverse.d.ts.map +1 -0
  19. package/dist/cfg_render/util.d.ts +5 -0
  20. package/dist/cfg_render/util.d.ts.map +1 -0
  21. package/dist/dev/index.d.ts +21 -0
  22. package/dist/dev/index.d.ts.map +1 -0
  23. package/dist/dev/util.d.ts +3 -0
  24. package/dist/dev/util.d.ts.map +1 -0
  25. package/dist/index.d.ts +13 -0
  26. package/dist/index.d.ts.map +1 -0
  27. package/dist/index.js +2 -0
  28. package/dist/index.js.map +1 -0
  29. package/dist/index.mjs +3587 -0
  30. package/dist/index.mjs.map +1 -0
  31. package/dist/js_render/context.d.ts +68 -0
  32. package/dist/js_render/context.d.ts.map +1 -0
  33. package/dist/js_render/index.d.ts +6 -0
  34. package/dist/js_render/index.d.ts.map +1 -0
  35. package/dist/middle_layer/active_cfg.d.ts +6 -0
  36. package/dist/middle_layer/active_cfg.d.ts.map +1 -0
  37. package/dist/middle_layer/block.d.ts +9 -0
  38. package/dist/middle_layer/block.d.ts.map +1 -0
  39. package/dist/middle_layer/block_ctx.d.ts +20 -0
  40. package/dist/middle_layer/block_ctx.d.ts.map +1 -0
  41. package/dist/middle_layer/block_ctx_unsafe.d.ts +16 -0
  42. package/dist/middle_layer/block_ctx_unsafe.d.ts.map +1 -0
  43. package/dist/middle_layer/driver_kit.d.ts +31 -0
  44. package/dist/middle_layer/driver_kit.d.ts.map +1 -0
  45. package/dist/middle_layer/frontend_path.d.ts +6 -0
  46. package/dist/middle_layer/frontend_path.d.ts.map +1 -0
  47. package/dist/middle_layer/index.d.ts +5 -0
  48. package/dist/middle_layer/index.d.ts.map +1 -0
  49. package/dist/middle_layer/middle_layer.d.ts +78 -0
  50. package/dist/middle_layer/middle_layer.d.ts.map +1 -0
  51. package/dist/middle_layer/navigation_states.d.ts +10 -0
  52. package/dist/middle_layer/navigation_states.d.ts.map +1 -0
  53. package/dist/middle_layer/ops.d.ts +64 -0
  54. package/dist/middle_layer/ops.d.ts.map +1 -0
  55. package/dist/middle_layer/project.d.ts +110 -0
  56. package/dist/middle_layer/project.d.ts.map +1 -0
  57. package/dist/middle_layer/project_list.d.ts +11 -0
  58. package/dist/middle_layer/project_list.d.ts.map +1 -0
  59. package/dist/middle_layer/project_overview.d.ts +8 -0
  60. package/dist/middle_layer/project_overview.d.ts.map +1 -0
  61. package/dist/middle_layer/render.d.ts +6 -0
  62. package/dist/middle_layer/render.d.ts.map +1 -0
  63. package/dist/middle_layer/types.d.ts +11 -0
  64. package/dist/middle_layer/types.d.ts.map +1 -0
  65. package/dist/middle_layer/util.d.ts +3 -0
  66. package/dist/middle_layer/util.d.ts.map +1 -0
  67. package/dist/model/args.d.ts +12 -0
  68. package/dist/model/args.d.ts.map +1 -0
  69. package/dist/model/block_pack.d.ts +8 -0
  70. package/dist/model/block_pack.d.ts.map +1 -0
  71. package/dist/model/block_pack_spec.d.ts +40 -0
  72. package/dist/model/block_pack_spec.d.ts.map +1 -0
  73. package/dist/model/frontend.d.ts +10 -0
  74. package/dist/model/frontend.d.ts.map +1 -0
  75. package/dist/model/index.d.ts +3 -0
  76. package/dist/model/index.d.ts.map +1 -0
  77. package/dist/model/project_model.d.ts +67 -0
  78. package/dist/model/project_model.d.ts.map +1 -0
  79. package/dist/model/project_model_util.d.ts +29 -0
  80. package/dist/model/project_model_util.d.ts.map +1 -0
  81. package/dist/model/template_spec.d.ts +16 -0
  82. package/dist/model/template_spec.d.ts.map +1 -0
  83. package/dist/mutator/block-pack/block_pack.d.ts +17 -0
  84. package/dist/mutator/block-pack/block_pack.d.ts.map +1 -0
  85. package/dist/mutator/block-pack/frontend.d.ts +4 -0
  86. package/dist/mutator/block-pack/frontend.d.ts.map +1 -0
  87. package/dist/mutator/context_export.d.ts +9 -0
  88. package/dist/mutator/context_export.d.ts.map +1 -0
  89. package/dist/mutator/project.d.ts +121 -0
  90. package/dist/mutator/project.d.ts.map +1 -0
  91. package/dist/mutator/template/render_block.d.ts +32 -0
  92. package/dist/mutator/template/render_block.d.ts.map +1 -0
  93. package/dist/mutator/template/render_template.d.ts +12 -0
  94. package/dist/mutator/template/render_template.d.ts.map +1 -0
  95. package/dist/mutator/template/template_loading.d.ts +13 -0
  96. package/dist/mutator/template/template_loading.d.ts.map +1 -0
  97. package/dist/pool/data.d.ts +24 -0
  98. package/dist/pool/data.d.ts.map +1 -0
  99. package/dist/pool/driver.d.ts +22 -0
  100. package/dist/pool/driver.d.ts.map +1 -0
  101. package/dist/pool/index.d.ts +3 -0
  102. package/dist/pool/index.d.ts.map +1 -0
  103. package/dist/pool/p_object_collection.d.ts +29 -0
  104. package/dist/pool/p_object_collection.d.ts.map +1 -0
  105. package/dist/pool/ref_count_pool.d.ts +25 -0
  106. package/dist/pool/ref_count_pool.d.ts.map +1 -0
  107. package/dist/pool/result_pool.d.ts +25 -0
  108. package/dist/pool/result_pool.d.ts.map +1 -0
  109. package/dist/test/block_packs.d.ts +6 -0
  110. package/dist/test/block_packs.d.ts.map +1 -0
  111. package/dist/test/explicit_templates.d.ts +3 -0
  112. package/dist/test/explicit_templates.d.ts.map +1 -0
  113. package/dist/test/known_templates.d.ts +6 -0
  114. package/dist/test/known_templates.d.ts.map +1 -0
  115. package/package.json +55 -0
  116. package/src/block_registry/index.ts +3 -0
  117. package/src/block_registry/registry.test.ts +35 -0
  118. package/src/block_registry/registry.ts +180 -0
  119. package/src/block_registry/registry_spec.ts +13 -0
  120. package/src/block_registry/watcher.ts +72 -0
  121. package/src/block_registry/well_known_registries.ts +13 -0
  122. package/src/cfg_render/executor.test.ts +120 -0
  123. package/src/cfg_render/executor.ts +253 -0
  124. package/src/cfg_render/operation.ts +38 -0
  125. package/src/cfg_render/renderer.ts +540 -0
  126. package/src/cfg_render/traverse.ts +58 -0
  127. package/src/cfg_render/util.ts +29 -0
  128. package/src/dev/index.ts +89 -0
  129. package/src/dev/util.ts +13 -0
  130. package/src/index.ts +21 -0
  131. package/src/js_render/context.ts +768 -0
  132. package/src/js_render/index.ts +41 -0
  133. package/src/middle_layer/active_cfg.ts +56 -0
  134. package/src/middle_layer/block.ts +70 -0
  135. package/src/middle_layer/block_ctx.ts +90 -0
  136. package/src/middle_layer/block_ctx_unsafe.ts +29 -0
  137. package/src/middle_layer/driver_kit.ts +107 -0
  138. package/src/middle_layer/frontend_path.ts +83 -0
  139. package/src/middle_layer/index.ts +4 -0
  140. package/src/middle_layer/middle_layer.test.ts +720 -0
  141. package/src/middle_layer/middle_layer.ts +235 -0
  142. package/src/middle_layer/navigation_states.ts +48 -0
  143. package/src/middle_layer/ops.ts +147 -0
  144. package/src/middle_layer/project.ts +380 -0
  145. package/src/middle_layer/project_list.ts +59 -0
  146. package/src/middle_layer/project_overview.ts +220 -0
  147. package/src/middle_layer/render.test.ts +129 -0
  148. package/src/middle_layer/render.ts +19 -0
  149. package/src/middle_layer/types.ts +16 -0
  150. package/src/middle_layer/util.ts +22 -0
  151. package/src/model/args.ts +62 -0
  152. package/src/model/block_pack.ts +8 -0
  153. package/src/model/block_pack_spec.ts +52 -0
  154. package/src/model/frontend.ts +10 -0
  155. package/src/model/index.ts +2 -0
  156. package/src/model/project_model.test.ts +26 -0
  157. package/src/model/project_model.ts +142 -0
  158. package/src/model/project_model_util.test.ts +88 -0
  159. package/src/model/project_model_util.ts +169 -0
  160. package/src/model/template_spec.ts +18 -0
  161. package/src/mutator/block-pack/block_pack.test.ts +53 -0
  162. package/src/mutator/block-pack/block_pack.ts +187 -0
  163. package/src/mutator/block-pack/frontend.ts +29 -0
  164. package/src/mutator/context_export.ts +25 -0
  165. package/src/mutator/project.test.ts +272 -0
  166. package/src/mutator/project.ts +1112 -0
  167. package/src/mutator/template/render_block.ts +91 -0
  168. package/src/mutator/template/render_template.ts +40 -0
  169. package/src/mutator/template/template_loading.ts +77 -0
  170. package/src/mutator/template/template_render.test.ts +272 -0
  171. package/src/pool/data.ts +239 -0
  172. package/src/pool/driver.ts +325 -0
  173. package/src/pool/index.ts +2 -0
  174. package/src/pool/p_object_collection.ts +122 -0
  175. package/src/pool/ref_count_pool.ts +76 -0
  176. package/src/pool/result_pool.ts +284 -0
  177. package/src/test/block_packs.ts +23 -0
  178. package/src/test/explicit_templates.ts +8 -0
  179. package/src/test/known_templates.ts +24 -0
@@ -0,0 +1 @@
1
+ {"version":3,"file":"block_pack.d.ts","sourceRoot":"","sources":["../../src/model/block_pack.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,sBAAsB,CAAC;AAC5D,OAAO,EAAE,aAAa,EAAE,MAAM,uCAAuC,CAAC;AAEtE,kDAAkD;AAClD,MAAM,WAAW,aAAa;IAC5B,QAAQ,CAAC,MAAM,EAAE,aAAa,CAAC;IAC/B,QAAQ,CAAC,MAAM,EAAE,oBAAoB,CAAC;CACvC"}
@@ -0,0 +1,40 @@
1
+ import { ExplicitTemplate } from './template_spec';
2
+ import { ResourceType } from '@milaboratories/pl-client';
3
+ import { BlockConfig } from '@platforma-sdk/model';
4
+ import { BlockPackSpec } from '@milaboratories/pl-model-middle-layer';
5
+ export type FrontendSpec = FrontendFromUrl | FrontendFromFolder;
6
+ export interface FrontendFromUrlData {
7
+ url: string;
8
+ }
9
+ export declare const FrontendFromUrlResourceType: ResourceType;
10
+ /** Directs user of the block pack to download the contents from the URL
11
+ * outside the pl infrastructure. */
12
+ export interface FrontendFromUrl extends FrontendFromUrlData {
13
+ type: 'url';
14
+ }
15
+ export interface FrontendFromFolderData {
16
+ path: string;
17
+ /** HMAC signature of the path using local secret encoded as hex. */
18
+ signature: string;
19
+ }
20
+ export declare const FrontendFromFolderResourceType: ResourceType;
21
+ /** Directs user of the block pack to load frontend from specific local
22
+ * folder. Signature allows to confirm that this is the same client who
23
+ * added the resource. */
24
+ export interface FrontendFromFolder extends FrontendFromFolderData {
25
+ type: 'local';
26
+ }
27
+ /** Direct instructions to create block-pack from client. Currently, this
28
+ * is the only block-pack spec that can be directly materialized. */
29
+ export interface BlockPackExplicit {
30
+ type: 'explicit';
31
+ template: ExplicitTemplate;
32
+ config: BlockConfig;
33
+ frontend: FrontendSpec;
34
+ source: BlockPackSpec;
35
+ }
36
+ /** Block-pack spec that can be materialized in pl. */
37
+ export type BlockPackSpecPrepared = BlockPackExplicit;
38
+ /** All block-pack specs. */
39
+ export type BlockPackSpecAny = BlockPackSpecPrepared | BlockPackSpec;
40
+ //# sourceMappingURL=block_pack_spec.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"block_pack_spec.d.ts","sourceRoot":"","sources":["../../src/model/block_pack_spec.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AACnD,OAAO,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AACzD,OAAO,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AACnD,OAAO,EAAE,aAAa,EAAE,MAAM,uCAAuC,CAAC;AAEtE,MAAM,MAAM,YAAY,GAAG,eAAe,GAAG,kBAAkB,CAAC;AAEhE,MAAM,WAAW,mBAAmB;IAClC,GAAG,EAAE,MAAM,CAAC;CACb;AAED,eAAO,MAAM,2BAA2B,EAAE,YAAyD,CAAC;AAEpG;oCACoC;AACpC,MAAM,WAAW,eAAgB,SAAQ,mBAAmB;IAC1D,IAAI,EAAE,KAAK,CAAC;CACb;AAED,MAAM,WAAW,sBAAsB;IACrC,IAAI,EAAE,MAAM,CAAC;IACb,oEAAoE;IACpE,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,eAAO,MAAM,8BAA8B,EAAE,YAG5C,CAAC;AAEF;;yBAEyB;AACzB,MAAM,WAAW,kBAAmB,SAAQ,sBAAsB;IAChE,IAAI,EAAE,OAAO,CAAC;CACf;AAED;oEACoE;AACpE,MAAM,WAAW,iBAAiB;IAChC,IAAI,EAAE,UAAU,CAAC;IACjB,QAAQ,EAAE,gBAAgB,CAAC;IAC3B,MAAM,EAAE,WAAW,CAAC;IACpB,QAAQ,EAAE,YAAY,CAAC;IACvB,MAAM,EAAE,aAAa,CAAC;CACvB;AAED,sDAAsD;AACtD,MAAM,MAAM,qBAAqB,GAAG,iBAAiB,CAAC;AAEtD,4BAA4B;AAC5B,MAAM,MAAM,gBAAgB,GAAG,qBAAqB,GAAG,aAAa,CAAC"}
@@ -0,0 +1,10 @@
1
+ /** Middle layer provides information about where frontend for a specific block
2
+ * was unpacked and basic meta information about the enclosed UI
3
+ * (i.e. SDK version). */
4
+ export interface FrontendData {
5
+ /** Path in local file system where frontend was unpacked */
6
+ readonly path: string;
7
+ /** SDK version used by the UI */
8
+ readonly sdkVersion: string;
9
+ }
10
+ //# sourceMappingURL=frontend.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"frontend.d.ts","sourceRoot":"","sources":["../../src/model/frontend.ts"],"names":[],"mappings":"AAAA;;yBAEyB;AACzB,MAAM,WAAW,YAAY;IAC3B,4DAA4D;IAC5D,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IAEtB,iCAAiC;IACjC,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;CAC7B"}
@@ -0,0 +1,3 @@
1
+ export * from './block_pack_spec';
2
+ export { type ProjectListEntry } from './project_model';
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/model/index.ts"],"names":[],"mappings":"AAAA,cAAc,mBAAmB,CAAC;AAClC,OAAO,EAAE,KAAK,gBAAgB,EAAE,MAAM,iBAAiB,CAAC"}
@@ -0,0 +1,67 @@
1
+ import { ResourceId, ResourceType } from '@milaboratories/pl-client';
2
+ import { ProjectListEntry as ProjectListEntryFromModel, ProjectMeta } from '@milaboratories/pl-model-middle-layer';
3
+ import { BlockRenderingMode } from '@platforma-sdk/model';
4
+ export interface ProjectListEntry extends ProjectListEntryFromModel {
5
+ /** Project resource ID. */
6
+ rid: ResourceId;
7
+ }
8
+ /** Entry representing a single block in block structure */
9
+ export interface Block {
10
+ /** Unique block id */
11
+ readonly id: string;
12
+ /** Label shown to the user */
13
+ label: string;
14
+ /** How to approach block rendering */
15
+ renderingMode: BlockRenderingMode;
16
+ }
17
+ /** Block group in block structure */
18
+ export interface BlockGroup {
19
+ /** Unique group id */
20
+ readonly id: string;
21
+ /** Label shown to the user */
22
+ label: string;
23
+ /** Blocks */
24
+ blocks: Block[];
25
+ }
26
+ /** Root of block structure value */
27
+ export interface ProjectStructure {
28
+ /** The structure */
29
+ readonly groups: BlockGroup[];
30
+ }
31
+ export declare const InitialBlockStructure: ProjectStructure;
32
+ /** Root of project rendering state */
33
+ export interface ProjectRenderingState {
34
+ /** Timestamp of last staging rendering event */
35
+ stagingRefreshTimestamp: number;
36
+ /** Blocks with detached production state, i.e. some of the dependencies of
37
+ * such blocks were re-rendered, but their state was left "as is". */
38
+ blocksInLimbo: string[];
39
+ }
40
+ export declare const InitialProjectRenderingState: ProjectRenderingState;
41
+ export declare const InitialBlockMeta: ProjectMeta;
42
+ export declare const ProjectResourceType: ResourceType;
43
+ export declare const SchemaVersionKey = "SchemaVersion";
44
+ export declare const SchemaVersionCurrent = "1";
45
+ export declare const ProjectCreatedTimestamp = "ProjectCreated";
46
+ export declare const ProjectLastModifiedTimestamp = "ProjectLastModified";
47
+ export declare const ProjectMetaKey = "ProjectMeta";
48
+ export declare const ProjectStructureKey = "ProjectStructure";
49
+ export declare const BlockRenderingStateKey = "BlockRenderingState";
50
+ export declare const BlockFrontendStateKeyPrefix = "BlockFrontendState/";
51
+ export declare const BlockFrontendStateKeyPattern: RegExp;
52
+ export declare function blockFrontendStateKey(blockId: string): string;
53
+ export declare const BlockArgsAuthorKeyPrefix = "BlockArgsAuthor/";
54
+ export declare const BlockArgsAuthorKeyPattern: RegExp;
55
+ export declare function blockArgsAuthorKey(blockId: string): string;
56
+ export declare const ProjectStructureAuthorKey = "ProjectStructureAuthor";
57
+ /** Returns block id, or undefined if key does not match the pattern. */
58
+ export declare function parseBlockFrontendStateKey(key: string): string | undefined;
59
+ export declare const ServiceTemplateCacheFieldPrefix = "__serviceTemplate_";
60
+ export declare function getServiceTemplateField(hash: string): string;
61
+ export interface ProjectField {
62
+ blockId: string;
63
+ fieldName: 'blockPack' | 'prodArgs' | 'currentArgs' | 'prodCtx' | 'prodUiCtx' | 'prodOutput' | 'prodCtxPrevious' | 'prodUiCtxPrevious' | 'prodOutputPrevious' | 'stagingCtx' | 'stagingUiCtx' | 'stagingOutput' | 'stagingCtxPrevious' | 'stagingUiCtxPrevious' | 'stagingOutputPrevious';
64
+ }
65
+ export declare function projectFieldName(blockId: string, fieldName: ProjectField['fieldName']): string;
66
+ export declare function parseProjectField(name: string): ProjectField | undefined;
67
+ //# sourceMappingURL=project_model.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"project_model.d.ts","sourceRoot":"","sources":["../../src/model/project_model.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,2BAA2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ClE,eAAO,MAAM,cAAc,gBAAgB,CAAC;AAC5C,eAAO,MAAM,mBAAmB,qBAAqB,CAAC;AACtD,eAAO,MAAM,sBAAsB,wBAAwB,CAAC;AAE5D,eAAO,MAAM,2BAA2B,wBAAwB,CAAC;AACjE,eAAO,MAAM,4BAA4B,QAAyC,CAAC;AAEnF,wBAAgB,qBAAqB,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAE7D;AAED,eAAO,MAAM,wBAAwB,qBAAqB,CAAC;AAC3D,eAAO,MAAM,yBAAyB,QAAsC,CAAC;AAE7E,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAE1D;AAED,eAAO,MAAM,yBAAyB,2BAA2B,CAAC;AAElE,wEAAwE;AACxE,wBAAgB,0BAA0B,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAI1E;AAED,eAAO,MAAM,+BAA+B,uBAAuB,CAAC;AAEpE,wBAAgB,uBAAuB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAE5D;AAED,MAAM,WAAW,YAAY;IAC3B,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,EACL,WAAW,GACX,UAAU,GACV,aAAa,GACb,SAAS,GACT,WAAW,GACX,YAAY,GACZ,iBAAiB,GACjB,mBAAmB,GACnB,oBAAoB,GACpB,YAAY,GACZ,cAAc,GACd,eAAe,GACf,oBAAoB,GACpB,sBAAsB,GACtB,uBAAuB,CAAC;CAC7B;AAED,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,YAAY,CAAC,WAAW,CAAC,GAAG,MAAM,CAE9F;AAKD,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,MAAM,GAAG,YAAY,GAAG,SAAS,CAKxE"}
@@ -0,0 +1,29 @@
1
+ import { Block, ProjectStructure } from './project_model';
2
+ export declare function allBlocks(structure: ProjectStructure): Iterable<Block>;
3
+ export interface BlockGraphNode {
4
+ readonly id: string;
5
+ readonly missingReferences: boolean;
6
+ /** Direct upstreams */
7
+ readonly upstream: Set<string>;
8
+ /** Direct downstreams */
9
+ readonly downstream: Set<string>;
10
+ }
11
+ export declare class BlockGraph {
12
+ /** Nodes are stored in the map in topological order */
13
+ readonly nodes: Map<string, BlockGraphNode>;
14
+ constructor(nodes: Map<string, BlockGraphNode>);
15
+ traverseIds(direction: 'upstream' | 'downstream', ...rootBlockIds: string[]): Set<string>;
16
+ traverseIdsExcludingRoots(direction: 'upstream' | 'downstream', ...rootBlockIds: string[]): Set<string>;
17
+ traverse(direction: 'upstream' | 'downstream', rootBlockIds: string[], cb: (node: BlockGraphNode) => void): void;
18
+ }
19
+ export declare function stagingGraph(structure: ProjectStructure): BlockGraph;
20
+ export declare function productionGraph(structure: ProjectStructure, argsProvider: (blockId: string) => any | undefined): BlockGraph;
21
+ export interface GraphDiff {
22
+ onlyInA: Set<string>;
23
+ /** Nodes that changed the list of their upstreams,
24
+ * and all their downstreams */
25
+ different: Set<string>;
26
+ onlyInB: Set<string>;
27
+ }
28
+ export declare function graphDiff(a: BlockGraph, b: BlockGraph): GraphDiff;
29
+ //# sourceMappingURL=project_model_util.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"project_model_util.d.ts","sourceRoot":"","sources":["../../src/model/project_model_util.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AAI1D,wBAAgB,SAAS,CAAC,SAAS,EAAE,gBAAgB,GAAG,QAAQ,CAAC,KAAK,CAAC,CAMtE;AAED,MAAM,WAAW,cAAc;IAC7B,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,iBAAiB,EAAE,OAAO,CAAC;IACpC,uBAAuB;IACvB,QAAQ,CAAC,QAAQ,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC;IAC/B,yBAAyB;IACzB,QAAQ,CAAC,UAAU,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC;CAClC;AAED,qBAAa,UAAU;IACrB,uDAAuD;IACvD,SAAgB,KAAK,EAAE,GAAG,CAAC,MAAM,EAAE,cAAc,CAAC,CAAC;gBAEvC,KAAK,EAAE,GAAG,CAAC,MAAM,EAAE,cAAc,CAAC;IAIvC,WAAW,CAAC,SAAS,EAAE,UAAU,GAAG,YAAY,EAAE,GAAG,YAAY,EAAE,MAAM,EAAE,GAAG,GAAG,CAAC,MAAM,CAAC;IAMzF,yBAAyB,CAC9B,SAAS,EAAE,UAAU,GAAG,YAAY,EACpC,GAAG,YAAY,EAAE,MAAM,EAAE,GACxB,GAAG,CAAC,MAAM,CAAC;IAMP,QAAQ,CACb,SAAS,EAAE,UAAU,GAAG,YAAY,EACpC,YAAY,EAAE,MAAM,EAAE,EACtB,EAAE,EAAE,CAAC,IAAI,EAAE,cAAc,KAAK,IAAI,GACjC,IAAI;CAmBR;AAED,wBAAgB,YAAY,CAAC,SAAS,EAAE,gBAAgB,cA4BvD;AAED,wBAAgB,eAAe,CAC7B,SAAS,EAAE,gBAAgB,EAC3B,YAAY,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,GAAG,GAAG,SAAS,GACjD,UAAU,CA0BZ;AAcD,MAAM,WAAW,SAAS;IACxB,OAAO,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC;IACrB;mCAC+B;IAC/B,SAAS,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC;IACvB,OAAO,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC;CACtB;AAED,wBAAgB,SAAS,CAAC,CAAC,EAAE,UAAU,EAAE,CAAC,EAAE,UAAU,GAAG,SAAS,CAkBjE"}
@@ -0,0 +1,16 @@
1
+ export interface TemplateFromRegistry {
2
+ readonly type: 'from-registry';
3
+ registry: string;
4
+ path: string;
5
+ }
6
+ export interface ExplicitTemplate {
7
+ readonly type: 'explicit';
8
+ content: Uint8Array;
9
+ }
10
+ export interface TemplateFromFile {
11
+ readonly type: 'from-file';
12
+ path: string;
13
+ }
14
+ export type TemplateSpecPrepared = TemplateFromRegistry | ExplicitTemplate;
15
+ export type TemplateSpecAny = TemplateSpecPrepared | TemplateFromFile;
16
+ //# sourceMappingURL=template_spec.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"template_spec.d.ts","sourceRoot":"","sources":["../../src/model/template_spec.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,oBAAoB;IACnC,QAAQ,CAAC,IAAI,EAAE,eAAe,CAAC;IAC/B,QAAQ,EAAE,MAAM,CAAC;IACjB,IAAI,EAAE,MAAM,CAAC;CACd;AAED,MAAM,WAAW,gBAAgB;IAC/B,QAAQ,CAAC,IAAI,EAAE,UAAU,CAAC;IAC1B,OAAO,EAAE,UAAU,CAAC;CACrB;AAED,MAAM,WAAW,gBAAgB;IAC/B,QAAQ,CAAC,IAAI,EAAE,WAAW,CAAC;IAC3B,IAAI,EAAE,MAAM,CAAC;CACd;AAED,MAAM,MAAM,oBAAoB,GAAG,oBAAoB,GAAG,gBAAgB,CAAC;AAC3E,MAAM,MAAM,eAAe,GAAG,oBAAoB,GAAG,gBAAgB,CAAC"}
@@ -0,0 +1,17 @@
1
+ import { AnyResourceRef, PlTransaction, ResourceType } from '@milaboratories/pl-client';
2
+ import { BlockPackSpecAny, BlockPackSpecPrepared } from '../../model';
3
+ import { Signer } from '@milaboratories/ts-helpers';
4
+ import { Dispatcher } from 'undici';
5
+ import { BlockConfig } from '@platforma-sdk/model';
6
+ export declare const BlockPackCustomType: ResourceType;
7
+ export declare const BlockPackTemplateField = "template";
8
+ export declare const BlockPackFrontendField = "frontend";
9
+ export declare class BlockPackPreparer {
10
+ private readonly signer;
11
+ private readonly http?;
12
+ constructor(signer: Signer, http?: Dispatcher | undefined);
13
+ getBlockConfig(spec: BlockPackSpecAny): Promise<BlockConfig>;
14
+ prepare(spec: BlockPackSpecAny): Promise<BlockPackSpecPrepared>;
15
+ }
16
+ export declare function createBlockPack(tx: PlTransaction, spec: BlockPackSpecPrepared): AnyResourceRef;
17
+ //# sourceMappingURL=block_pack.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"block_pack.d.ts","sourceRoot":"","sources":["../../../src/mutator/block-pack/block_pack.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAS,aAAa,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AAE/F,OAAO,EAAqB,gBAAgB,EAAE,qBAAqB,EAAE,MAAM,aAAa,CAAC;AACzF,OAAO,EAAe,MAAM,EAAE,MAAM,4BAA4B,CAAC;AAEjE,OAAO,EAAE,UAAU,EAAW,MAAM,QAAQ,CAAC;AAE7C,OAAO,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AAMnD,eAAO,MAAM,mBAAmB,EAAE,YAAwD,CAAC;AAC3F,eAAO,MAAM,sBAAsB,aAAa,CAAC;AACjD,eAAO,MAAM,sBAAsB,aAAa,CAAC;AAQjD,qBAAa,iBAAiB;IAE1B,OAAO,CAAC,QAAQ,CAAC,MAAM;IACvB,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAC;gBADL,MAAM,EAAE,MAAM,EACd,IAAI,CAAC,EAAE,UAAU,YAAA;IAGvB,cAAc,CAAC,IAAI,EAAE,gBAAgB,GAAG,OAAO,CAAC,WAAW,CAAC;IAmC5D,OAAO,CAAC,IAAI,EAAE,gBAAgB,GAAG,OAAO,CAAC,qBAAqB,CAAC;CAuG7E;AAYD,wBAAgB,eAAe,CAAC,EAAE,EAAE,aAAa,EAAE,IAAI,EAAE,qBAAqB,GAAG,cAAc,CAO9F"}
@@ -0,0 +1,4 @@
1
+ import { AnyResourceRef, PlTransaction } from '@milaboratories/pl-client';
2
+ import { FrontendSpec } from '../../model';
3
+ export declare function createFrontend(tx: PlTransaction, spec: FrontendSpec): AnyResourceRef;
4
+ //# sourceMappingURL=frontend.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"frontend.d.ts","sourceRoot":"","sources":["../../../src/mutator/block-pack/frontend.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;AAC1E,OAAO,EAKL,YAAY,EACb,MAAM,aAAa,CAAC;AAGrB,wBAAgB,cAAc,CAAC,EAAE,EAAE,aAAa,EAAE,IAAI,EAAE,YAAY,GAAG,cAAc,CAkBpF"}
@@ -0,0 +1,9 @@
1
+ import { AnyRef, PlTransaction } from '@milaboratories/pl-client';
2
+ import { TemplateSpecPrepared } from '../model/template_spec';
3
+ export type TemplateEnvelop = {
4
+ spec: TemplateSpecPrepared;
5
+ hash: string;
6
+ };
7
+ export declare function getPreparedExportTemplateEnvelope(): Promise<TemplateEnvelop>;
8
+ export declare function exportContext(tx: PlTransaction, exportTpl: AnyRef, ctx: AnyRef): AnyRef;
9
+ //# sourceMappingURL=context_export.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"context_export.d.ts","sourceRoot":"","sources":["../../src/mutator/context_export.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;AAIlE,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAG9D,MAAM,MAAM,eAAe,GAAG;IAAE,IAAI,EAAE,oBAAoB,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,CAAC;AAI3E,wBAAsB,iCAAiC,IAAI,OAAO,CAAC,eAAe,CAAC,CASlF;AAED,wBAAgB,aAAa,CAAC,EAAE,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,UAE9E"}
@@ -0,0 +1,121 @@
1
+ import { AnyRef, AnyResourceRef, PlClient, PlTransaction, ResourceId } from '@milaboratories/pl-client';
2
+ import { Block, ProjectStructure, ProjectField, ProjectRenderingState } from '../model/project_model';
3
+ import { BlockPackSpecPrepared } from '../model';
4
+ import { AuthorMarker, ProjectMeta } from '@milaboratories/pl-model-middle-layer';
5
+ type FieldStatus = 'NotReady' | 'Ready' | 'Error';
6
+ interface BlockFieldState {
7
+ modCount: number;
8
+ ref?: AnyRef;
9
+ status?: FieldStatus;
10
+ value?: Uint8Array;
11
+ }
12
+ type BlockFieldStates = Partial<Record<ProjectField['fieldName'], BlockFieldState>>;
13
+ declare class BlockInfo {
14
+ readonly id: string;
15
+ readonly fields: BlockFieldStates;
16
+ constructor(id: string, fields: BlockFieldStates);
17
+ check(): void;
18
+ private readonly currentInputsC;
19
+ private readonly actualProductionInputsC;
20
+ get currentInputs(): any;
21
+ get stagingRendered(): boolean;
22
+ get productionRendered(): boolean;
23
+ private readonly productionStaleC;
24
+ get productionStale(): boolean;
25
+ get requireProductionRendering(): boolean;
26
+ get actualProductionInputs(): any | undefined;
27
+ getTemplate(tx: PlTransaction): AnyRef;
28
+ }
29
+ export interface NewBlockSpec {
30
+ blockPack: BlockPackSpecPrepared;
31
+ args: string;
32
+ }
33
+ export interface SetArgsRequest {
34
+ blockId: string;
35
+ args: string;
36
+ }
37
+ export declare class ProjectMutator {
38
+ readonly rid: ResourceId;
39
+ private readonly tx;
40
+ private readonly author;
41
+ private readonly schema;
42
+ private lastModified;
43
+ private meta;
44
+ private struct;
45
+ private readonly renderingState;
46
+ private readonly blocksInLimbo;
47
+ private readonly blockInfos;
48
+ private readonly blockFrontendStates;
49
+ private readonly ctxExportTplHolder;
50
+ private globalModCount;
51
+ private fieldsChanged;
52
+ private lastModifiedChanged;
53
+ private structureChanged;
54
+ private metaChanged;
55
+ private renderingStateChanged;
56
+ private readonly changedBlockFrontendStates;
57
+ /** Set blocks will be assigned current mutator author marker on save */
58
+ private readonly blocksWithChangedInputs;
59
+ constructor(rid: ResourceId, tx: PlTransaction, author: AuthorMarker | undefined, schema: string, lastModified: number, meta: ProjectMeta, struct: ProjectStructure, renderingState: Omit<ProjectRenderingState, 'blocksInLimbo'>, blocksInLimbo: Set<string>, blockInfos: Map<string, BlockInfo>, blockFrontendStates: Map<string, string>, ctxExportTplHolder: AnyResourceRef);
60
+ private fixProblems;
61
+ get wasModified(): boolean;
62
+ get structure(): ProjectStructure;
63
+ private stagingGraph;
64
+ private pendingProductionGraph;
65
+ private actualProductionGraph;
66
+ private getStagingGraph;
67
+ private getPendingProductionGraph;
68
+ private getActualProductionGraph;
69
+ private getBlockInfo;
70
+ private getBlock;
71
+ private setBlockFieldObj;
72
+ private setBlockField;
73
+ private deleteBlockFields;
74
+ private updateLastModified;
75
+ private resetStagingRefreshTimestamp;
76
+ private resetStaging;
77
+ private resetProduction;
78
+ /** Running blocks are reset, already computed moved to limbo. Returns if
79
+ * either of the actions were actually performed. */
80
+ private resetOrLimboProduction;
81
+ /** Optimally sets inputs for multiple blocks in one go */
82
+ setArgs(requests: SetArgsRequest[]): void;
83
+ setUiState(blockId: string, newState: string | undefined): void;
84
+ /** Update block label */
85
+ setBlockLabel(blockId: string, label: string): void;
86
+ private createCtx;
87
+ private exportCtx;
88
+ private renderStagingFor;
89
+ private renderProductionFor;
90
+ /** Very generic method, better check for more specialized case-specific methods first. */
91
+ updateStructure(newStructure: ProjectStructure, newBlockSpecProvider?: (blockId: string) => NewBlockSpec): void;
92
+ addBlock(block: Block, spec: NewBlockSpec, before?: string): void;
93
+ deleteBlock(blockId: string): void;
94
+ migrateBlockPack(blockId: string, spec: BlockPackSpecPrepared, newArgs?: string): void;
95
+ renderProduction(blockIds: string[], addUpstreams?: boolean): Set<string>;
96
+ /** Stops running blocks from the list and modify states of other blocks
97
+ * accordingly */
98
+ stopProduction(...blockIds: string[]): void;
99
+ private traverseWithStagingLag;
100
+ /** @param stagingRenderingRate rate in blocks per second */
101
+ private refreshStagings;
102
+ /** Updates project metadata */
103
+ setMeta(meta: ProjectMeta): void;
104
+ /** @param stagingRenderingRate rate in blocks per second */
105
+ doRefresh(stagingRenderingRate?: number): void;
106
+ private assignAuthorMarkers;
107
+ save(): void;
108
+ static load(tx: PlTransaction, rid: ResourceId, author?: AuthorMarker): Promise<ProjectMutator>;
109
+ }
110
+ export interface ProjectState {
111
+ schema: string;
112
+ structure: ProjectStructure;
113
+ renderingState: Omit<ProjectRenderingState, 'blocksInLimbo'>;
114
+ blocksInLimbo: Set<string>;
115
+ blockInfos: Map<string, BlockInfo>;
116
+ }
117
+ export declare function createProject(tx: PlTransaction, meta?: ProjectMeta): Promise<AnyResourceRef>;
118
+ export declare function withProject<T>(txOrPl: PlTransaction | PlClient, rid: ResourceId, cb: (p: ProjectMutator) => T | Promise<T>): Promise<T>;
119
+ export declare function withProjectAuthored<T>(txOrPl: PlTransaction | PlClient, rid: ResourceId, author: AuthorMarker | undefined, cb: (p: ProjectMutator) => T | Promise<T>): Promise<T>;
120
+ export {};
121
+ //# sourceMappingURL=project.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"project.d.ts","sourceRoot":"","sources":["../../src/mutator/project.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,MAAM,EACN,cAAc,EASd,QAAQ,EACR,aAAa,EACb,UAAU,EAEX,MAAM,2BAA2B,CAAC;AAEnC,OAAO,EACL,KAAK,EAEL,gBAAgB,EAGhB,YAAY,EAEZ,qBAAqB,EAetB,MAAM,wBAAwB,CAAC;AAShC,OAAO,EAAE,qBAAqB,EAAE,MAAM,UAAU,CAAC;AAEjD,OAAO,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,uCAAuC,CAAC;AAKlF,KAAK,WAAW,GAAG,UAAU,GAAG,OAAO,GAAG,OAAO,CAAC;AAElD,UAAU,eAAe;IACvB,QAAQ,EAAE,MAAM,CAAC;IACjB,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,MAAM,CAAC,EAAE,WAAW,CAAC;IACrB,KAAK,CAAC,EAAE,UAAU,CAAC;CACpB;AAED,KAAK,gBAAgB,GAAG,OAAO,CAAC,MAAM,CAAC,YAAY,CAAC,WAAW,CAAC,EAAE,eAAe,CAAC,CAAC,CAAC;AA2BpF,cAAM,SAAS;aAEK,EAAE,EAAE,MAAM;aACV,MAAM,EAAE,gBAAgB;g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C;IACf,SAAS,EAAE,gBAAgB,CAAC;IAC5B,cAAc,EAAE,IAAI,CAAC,qBAAqB,EAAE,eAAe,CAAC,CAAC;IAC7D,aAAa,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC;IAC3B,UAAU,EAAE,GAAG,CAAC,MAAM,EAAE,SAAS,CAAC,CAAC;CACpC;AAED,wBAAsB,aAAa,CACjC,EAAE,EAAE,aAAa,EACjB,IAAI,GAAE,WAA8B,GACnC,OAAO,CAAC,cAAc,CAAC,CAiBzB;AAED,wBAAsB,WAAW,CAAC,CAAC,EACjC,MAAM,EAAE,aAAa,GAAG,QAAQ,EAChC,GAAG,EAAE,UAAU,EACf,EAAE,EAAE,CAAC,CAAC,EAAE,cAAc,KAAK,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC,GACxC,OAAO,CAAC,CAAC,CAAC,CAEZ;AAED,wBAAsB,mBAAmB,CAAC,CAAC,EACzC,MAAM,EAAE,aAAa,GAAG,QAAQ,EAChC,GAAG,EAAE,UAAU,EACf,MAAM,EAAE,YAAY,GAAG,SAAS,EAChC,EAAE,EAAE,CAAC,CAAC,EAAE,cAAc,KAAK,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC,GACxC,OAAO,CAAC,CAAC,CAAC,CAmBZ"}
@@ -0,0 +1,32 @@
1
+ import { AnyRef, PlTransaction, ResourceRef, ResourceType } from '@milaboratories/pl-client';
2
+ export declare const BContextEnd: ResourceType;
3
+ export declare const BContext: ResourceType;
4
+ export declare const BContextId = "id";
5
+ export declare const BContextParent = "parent";
6
+ export declare const BContextMultiParentPrefix = "parent/";
7
+ export type HeavyBlockInputs = {
8
+ args: AnyRef;
9
+ blockId: AnyRef;
10
+ isProduction: AnyRef;
11
+ context: AnyRef;
12
+ };
13
+ export type HeavyBlockOutputs = {
14
+ context: AnyRef;
15
+ result: AnyRef;
16
+ };
17
+ export declare const HeavyBlockOutputNames: (keyof HeavyBlockOutputs)[];
18
+ export declare function createRenderHeavyBlock(tx: PlTransaction, tpl: AnyRef, inputs: HeavyBlockInputs): HeavyBlockOutputs;
19
+ export type LightBlockInputs = {
20
+ args: AnyRef;
21
+ blockId: AnyRef;
22
+ stagingContext: AnyRef;
23
+ productionContext: AnyRef;
24
+ };
25
+ export type LightBlockOutput = {
26
+ result: AnyRef;
27
+ };
28
+ export declare const LightBlockOutputNames: (keyof LightBlockOutput)[];
29
+ export declare function createRenderLightBlock(tx: PlTransaction, tpl: ResourceRef, inputs: LightBlockInputs): LightBlockOutput;
30
+ export declare function createBContextEnd(tx: PlTransaction): ResourceRef;
31
+ export declare function createBContextFromUpstreams(tx: PlTransaction, upstreamCtxs: AnyRef[]): AnyRef;
32
+ //# sourceMappingURL=render_block.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"render_block.d.ts","sourceRoot":"","sources":["../../../src/mutator/template/render_block.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,MAAM,EAEN,aAAa,EACb,WAAW,EACX,YAAY,EAEb,MAAM,2BAA2B,CAAC;AAInC,eAAO,MAAM,WAAW,EAAE,YAAoD,CAAC;AAC/E,eAAO,MAAM,QAAQ,EAAE,YAAiD,CAAC;AACzE,eAAO,MAAM,UAAU,OAAO,CAAC;AAC/B,eAAO,MAAM,cAAc,WAAW,CAAC;AACvC,eAAO,MAAM,yBAAyB,YAAY,CAAC;AASnD,MAAM,MAAM,gBAAgB,GAAG;IAC7B,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;IAChB,YAAY,EAAE,MAAM,CAAC;IACrB,OAAO,EAAE,MAAM,CAAC;CACjB,CAAC;AAEF,MAAM,MAAM,iBAAiB,GAAG;IAC9B,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,MAAM,CAAC;CAChB,CAAC;AAEF,eAAO,MAAM,qBAAqB,EAAE,CAAC,MAAM,iBAAiB,CAAC,EAA0B,CAAC;AAExF,wBAAgB,sBAAsB,CACpC,EAAE,EAAE,aAAa,EACjB,GAAG,EAAE,MAAM,EACX,MAAM,EAAE,gBAAgB,GACvB,iBAAiB,CAEnB;AAED,MAAM,MAAM,gBAAgB,GAAG;IAC7B,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;IAChB,cAAc,EAAE,MAAM,CAAC;IACvB,iBAAiB,EAAE,MAAM,CAAC;CAC3B,CAAC;AAEF,MAAM,MAAM,gBAAgB,GAAG;IAC7B,MAAM,EAAE,MAAM,CAAC;CAChB,CAAC;AAEF,eAAO,MAAM,qBAAqB,EAAE,CAAC,MAAM,gBAAgB,CAAC,EAAe,CAAC;AAE5E,wBAAgB,sBAAsB,CACpC,EAAE,EAAE,aAAa,EACjB,GAAG,EAAE,WAAW,EAChB,MAAM,EAAE,gBAAgB,GACvB,gBAAgB,CAElB;AAED,wBAAgB,iBAAiB,CAAC,EAAE,EAAE,aAAa,GAAG,WAAW,CAIhE;AAED,wBAAgB,2BAA2B,CAAC,EAAE,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,EAAE,GAAG,MAAM,CAiB7F"}
@@ -0,0 +1,12 @@
1
+ import { AnyRef, Pl, PlTransaction } from '@milaboratories/pl-client';
2
+ /**
3
+ * Creates render template operation, for a given remplate and inputs.
4
+ *
5
+ * @param tx transaction to use during rendering creation
6
+ * @param tpl reference to the template resource (see {@link loadTemplate})
7
+ * @param ephemeral true for ephemeral templates, false for pure templates
8
+ * @param inputs map of inputs pointing to other resources or fields
9
+ * @param outputNames names of the outputs to collect and return from this method
10
+ */
11
+ export declare function createRenderTemplate<O extends string>(tx: PlTransaction, tpl: AnyRef, ephemeral: boolean, inputs: Pl.PlRecord, outputNames: O[]): Record<O, AnyRef>;
12
+ //# sourceMappingURL=render_template.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"render_template.d.ts","sourceRoot":"","sources":["../../../src/mutator/template/render_template.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAS,EAAE,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;AAY7E;;;;;;;;GAQG;AACH,wBAAgB,oBAAoB,CAAC,CAAC,SAAS,MAAM,EACnD,EAAE,EAAE,aAAa,EACjB,GAAG,EAAE,MAAM,EACX,SAAS,EAAE,OAAO,EAClB,MAAM,EAAE,EAAE,CAAC,QAAQ,EACnB,WAAW,EAAE,CAAC,EAAE,GACf,MAAM,CAAC,CAAC,EAAE,MAAM,CAAC,CAYnB"}
@@ -0,0 +1,13 @@
1
+ import { AnyRef, PlTransaction, ResourceType } from '@milaboratories/pl-client';
2
+ import { TemplateSpecAny, TemplateSpecPrepared } from '../../model/template_spec';
3
+ export declare const TengoTemplateGet: ResourceType;
4
+ export declare const TengoTemplateGetRegistry = "registry";
5
+ export declare const TengoTemplateGetTemplateURI = "templateURI";
6
+ export declare const TengoTemplateGetTemplate = "template";
7
+ export declare const TengoTemplatePack: ResourceType;
8
+ export declare const TengoTemplatePackConvert: ResourceType;
9
+ export declare const TengoTemplatePackConvertTemplatePack = "templatePack";
10
+ export declare const TengoTemplatePackConvertTemplate = "template";
11
+ export declare function prepareTemplateSpec(tpl: TemplateSpecAny): Promise<TemplateSpecPrepared>;
12
+ export declare function loadTemplate(tx: PlTransaction, spec: TemplateSpecPrepared): AnyRef;
13
+ //# sourceMappingURL=template_loading.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"template_loading.d.ts","sourceRoot":"","sources":["../../../src/mutator/template/template_loading.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAa,aAAa,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AAE3F,OAAO,EAGL,eAAe,EACf,oBAAoB,EACrB,MAAM,2BAA2B,CAAC;AAOnC,eAAO,MAAM,gBAAgB,EAAE,YAAyD,CAAC;AACzF,eAAO,MAAM,wBAAwB,aAAa,CAAC;AACnD,eAAO,MAAM,2BAA2B,gBAAgB,CAAC;AACzD,eAAO,MAAM,wBAAwB,aAAa,CAAC;AAEnD,eAAO,MAAM,iBAAiB,EAAE,YAA0D,CAAC;AAC3F,eAAO,MAAM,wBAAwB,EAAE,YAGtC,CAAC;AACF,eAAO,MAAM,oCAAoC,iBAAiB,CAAC;AACnE,eAAO,MAAM,gCAAgC,aAAa,CAAC;AAE3D,wBAAsB,mBAAmB,CAAC,GAAG,EAAE,eAAe,GAAG,OAAO,CAAC,oBAAoB,CAAC,CAa7F;AA2BD,wBAAgB,YAAY,CAAC,EAAE,EAAE,aAAa,EAAE,IAAI,EAAE,oBAAoB,GAAG,MAAM,CASlF"}
@@ -0,0 +1,24 @@
1
+ import { PObjectId, PObjectSpec } from '@platforma-sdk/model';
2
+ import { PFrameInternal } from '@milaboratories/pl-model-middle-layer';
3
+ import { PlTreeNodeAccessor, ResourceInfo } from '@milaboratories/pl-tree';
4
+ export declare function allBlobs<B>(data: PFrameInternal.DataInfo<B>): Generator<B>;
5
+ export declare function mapBlobs<B1, B2>(data: PFrameInternal.DataInfo<B1>, mapping: (blob: B1) => B2): PFrameInternal.DataInfo<B2>;
6
+ export declare const PColumnDataJsonPartitioned: import('@milaboratories/pl-client').ResourceType;
7
+ export declare const PColumnDataJsonSuperPartitioned: import('@milaboratories/pl-client').ResourceType;
8
+ export declare const PColumnDataBinaryPartitioned: import('@milaboratories/pl-client').ResourceType;
9
+ export declare const PColumnDataBinarySuperPartitioned: import('@milaboratories/pl-client').ResourceType;
10
+ export declare const PColumnDataJson: import('@milaboratories/pl-client').ResourceType;
11
+ export type PColumnDataJsonResourceValue = {
12
+ keyLength: number;
13
+ data: Record<string, PFrameInternal.JsonDataValue>;
14
+ };
15
+ export type PColumnDataPartitionedResourceValue = {
16
+ partitionKeyLength: number;
17
+ };
18
+ export type PColumnDataSuperPartitionedResourceValue = {
19
+ superPartitionKeyLength: number;
20
+ partitionKeyLength: number;
21
+ };
22
+ export declare function parseDataInfoResource(data: PlTreeNodeAccessor): PFrameInternal.DataInfo<ResourceInfo>;
23
+ export declare function derivePObjectId(spec: PObjectSpec, data: PlTreeNodeAccessor): POb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Ac,CAAC,QAAQ,CAAC,YAAY,CAAC,CA4IvC;AAED,wBAAgB,eAAe,CAAC,IAAI,EAAE,WAAW,EAAE,IAAI,EAAE,kBAAkB,GAAG,SAAS,CAKtF"}
@@ -0,0 +1,22 @@
1
+ import { DownloadDriver } from '@milaboratories/pl-drivers';
2
+ import { PlTreeNodeAccessor } from '@milaboratories/pl-tree';
3
+ import { ComputableCtx } from '@milaboratories/computable';
4
+ import { CalculateTableDataRequest, CalculateTableDataResponse, FindColumnsRequest, FindColumnsResponse, PColumnIdAndSpec, PColumnSpec, PFrameHandle, PObjectId, PTableColumnSpec, PTableHandle, PTableShape, PTableVector, TableRange, UniqueValuesRequest, UniqueValuesResponse, PFrameDriver as SdkPFrameDriver, PColumn, PFrameDef, JoinEntry, PTableDef } from '@platforma-sdk/model';
5
+ export declare class PFrameDriver implements SdkPFrameDriver {
6
+ private readonly blobDriver;
7
+ private readonly pFrames;
8
+ private readonly pTables;
9
+ constructor(blobDriver: DownloadDriver);
10
+ createPFrame(def: PFrameDef<PlTreeNodeAccessor>, ctx: ComputableCtx): PFrameHandle;
11
+ createPTable(def: PTableDef<PColumn<PlTreeNodeAccessor>>, ctx: ComputableCtx): PTableHandle;
12
+ findColumns(handle: PFrameHandle, request: FindColumnsRequest): Promise<FindColumnsResponse>;
13
+ getColumnSpec(handle: PFrameHandle, columnId: PObjectId): Promise<PColumnSpec>;
14
+ listColumns(handle: PFrameHandle): Promise<PColumnIdAndSpec[]>;
15
+ calculateTableData(handle: PFrameHandle, request: CalculateTableDataRequest<PObjectId>): Promise<CalculateTableDataResponse>;
16
+ getUniqueValues(handle: PFrameHandle, request: UniqueValuesRequest): Promise<UniqueValuesResponse>;
17
+ getShape(handle: PTableHandle): Promise<PTableShape>;
18
+ getSpec(handle: PTableHandle): Promise<PTableColumnSpec[]>;
19
+ getData(handle: PTableHandle, columnIndices: number[], range?: TableRange): Promise<PTableVector[]>;
20
+ }
21
+ export declare function extractAllColumns<D>(entry: JoinEntry<P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OAAO,CAAC,gBAAgB,EAAE,CAAC;IAI9D,kBAAkB,CAC7B,MAAM,EAAE,YAAY,EACpB,OAAO,EAAE,yBAAyB,CAAC,SAAS,CAAC,GAC5C,OAAO,CAAC,0BAA0B,CAAC;IAsBzB,eAAe,CAC1B,MAAM,EAAE,YAAY,EACpB,OAAO,EAAE,mBAAmB,GAC3B,OAAO,CAAC,oBAAoB,CAAC;IAQnB,QAAQ,CAAC,MAAM,EAAE,YAAY,GAAG,OAAO,CAAC,WAAW,CAAC;IAKpD,OAAO,CAAC,MAAM,EAAE,YAAY,GAAG,OAAO,CAAC,gBAAgB,EAAE,CAAC;IAK1D,OAAO,CAClB,MAAM,EAAE,YAAY,EACpB,aAAa,EAAE,MAAM,EAAE,EACvB,KAAK,CAAC,EAAE,UAAU,GACjB,OAAO,CAAC,YAAY,EAAE,CAAC;CAI3B;AA+CD,wBAAgB,iBAAiB,CAAC,CAAC,EAAE,KAAK,EAAE,SAAS,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,GAAG,SAAS,CAAC,CAAC,CAAC,CAI/E"}
@@ -0,0 +1,3 @@
1
+ export * from './driver';
2
+ export * from './result_pool';
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/pool/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAC;AACzB,cAAc,eAAe,CAAC"}
@@ -0,0 +1,29 @@
1
+ import { PlTreeNodeAccessor } from '@milaboratories/pl-tree';
2
+ import { PObject, PObjectSpec, ValueOrError } from '@platforma-sdk/model';
3
+ /** Represents specific staging or prod ctx data */
4
+ export interface RawPObjectCollection {
5
+ /** true if no new results are expected */
6
+ readonly locked: boolean;
7
+ /** results by name */
8
+ readonly results: Map<string, RawPObjectEntry>;
9
+ }
10
+ /** Single result in a particular ctx */
11
+ export interface RawPObjectEntry {
12
+ /**
13
+ * true - means this result has data field, however it may still be not ready
14
+ * false - means it can be derived that this result incarnation is spec-only
15
+ * undefined - means that it is not yet known
16
+ * */
17
+ readonly hasData?: boolean;
18
+ /** Result may be added even if there is no data associated with it */
19
+ readonly spec?: PObjectSpec;
20
+ /**
21
+ * Returns data accessor, or error, or undefined if data not yet available.
22
+ * If data fuinction itself is not defined, this means that corresponding context
23
+ * was not rendered.
24
+ * */
25
+ data?(): ValueOrError<PlTreeNodeAccessor, string> | undefined;
26
+ }
27
+ export declare function parseRawPObjectCollection(node: PlTreeNodeAccessor, errorOnUnknownField?: boolean, ignoreFieldErrors?: boolean, prefix?: string): RawPObjectCollection;
28
+ export declare function parseFinalPObjectCollection(node: PlTreeNodeAccessor, errorOnUnknownField?: boolean, prefix?: string): Record<string, PObject<PlTreeNodeAccessor>>;
29
+ //# sourceMappingURL=p_object_collection.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"p_object_collection.d.ts","sourceRoot":"","sources":["../../src/pool/p_object_collection.ts"],"names":[],"mappings":"AAAA,OAAO,EAAW,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AACtE,OAAO,EAAE,OAAO,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AAM1E,mDAAmD;AACnD,MAAM,WAAW,oBAAoB;IACnC,0CAA0C;IAC1C,QAAQ,CAAC,MAAM,EAAE,OAAO,CAAC;IACzB,sBAAsB;IACtB,QAAQ,CAAC,OAAO,EAAE,GAAG,CAAC,MAAM,EAAE,eAAe,CAAC,CAAC;CAChD;AAED,wCAAwC;AACxC,MAAM,WAAW,eAAe;IAC9B;;;;SAIK;IACL,QAAQ,CAAC,OAAO,CAAC,EAAE,OAAO,CAAC;IAE3B,sEAAsE;IACtE,QAAQ,CAAC,IAAI,CAAC,EAAE,WAAW,CAAC;IAE5B;;;;SAIK;IACL,IAAI,CAAC,IAAI,YAAY,CAAC,kBAAkB,EAAE,MAAM,CAAC,GAAG,SAAS,CAAC;CAC/D;AAMD,wBAAgB,yBAAyB,CACvC,IAAI,EAAE,kBAAkB,EACxB,mBAAmB,GAAE,OAAc,EACnC,iBAAiB,GAAE,OAAe,EAClC,MAAM,GAAE,MAAW,GAClB,oBAAoB,CAoDtB;AAED,wBAAgB,2BAA2B,CACzC,IAAI,EAAE,kBAAkB,EACxB,mBAAmB,GAAE,OAAc,EACnC,MAAM,GAAE,MAAW,GAClB,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,kBAAkB,CAAC,CAAC,CAmB7C"}
@@ -0,0 +1,25 @@
1
+ /**
2
+ * Function associated with particular entry from the RefCountResourcePool.
3
+ *
4
+ * Calling the function will release the reference acquired when object was
5
+ * retieved from the pool.
6
+ */
7
+ export type UnrefFn = () => void;
8
+ export interface PollResource<R> {
9
+ /** Resource itself */
10
+ readonly resource: R;
11
+ /** Resource key, calculated using provided */
12
+ readonly key: string;
13
+ /** Callback to be called when requested resource can be disposed. */
14
+ readonly unref: UnrefFn;
15
+ }
16
+ export declare abstract class RefCountResourcePool<P, R> {
17
+ private readonly resources;
18
+ protected abstract createNewResource(params: P): R;
19
+ protected abstract calculateParamsKey(params: P): string;
20
+ private check;
21
+ acquire(params: P): PollResource<R>;
22
+ getByKey(key: string): R;
23
+ tryGetByKey(key: string): R | undefined;
24
+ }
25
+ //# sourceMappingURL=ref_count_pool.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ref_count_pool.d.ts","sourceRoot":"","sources":["../../src/pool/ref_count_pool.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,MAAM,MAAM,OAAO,GAAG,MAAM,IAAI,CAAC;AAEjC,MAAM,WAAW,YAAY,CAAC,CAAC;IAC7B,sBAAsB;IACtB,QAAQ,CAAC,QAAQ,EAAE,CAAC,CAAC;IAErB,+CAA+C;IAC/C,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IAErB,qEAAqE;IACrE,QAAQ,CAAC,KAAK,EAAE,OAAO,CAAC;CACzB;AAED,8BAAsB,oBAAoB,CAAC,CAAC,EAAE,CAAC;IAC7C,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAyC;IACnE,SAAS,CAAC,QAAQ,CAAC,iBAAiB,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC;IAClD,SAAS,CAAC,QAAQ,CAAC,kBAAkB,CAAC,MAAM,EAAE,CAAC,GAAG,MAAM;IAExD,OAAO,CAAC,KAAK;IAaN,OAAO,CAAC,MAAM,EAAE,CAAC,GAAG,YAAY,CAAC,CAAC,CAAC;IAyBnC,QAAQ,CAAC,GAAG,EAAE,MAAM,GAAG,CAAC;IAKxB,WAAW,CAAC,GAAG,EAAE,MAAM,GAAG,CAAC,GAAG,SAAS;CAG/C"}
@@ -0,0 +1,25 @@
1
+ import { ComputableCtx } from '@milaboratories/computable';
2
+ import { PlTreeEntry, PlTreeNodeAccessor } from '@milaboratories/pl-tree';
3
+ import { Option, PObject, PObjectSpec, PSpecPredicate, Ref, ResultCollection, ValueOrError } from '@platforma-sdk/model';
4
+ import { Optional } from 'utility-types';
5
+ /** All exported results are addressed */
6
+ export type ResultKey = Pick<Ref, 'blockId' | 'name'>;
7
+ export interface ExtendedResultCollection<T> extends ResultCollection<T> {
8
+ readonly instabilityMarker: string | undefined;
9
+ }
10
+ export interface ExtendedOption extends Option {
11
+ readonly spec: PObjectSpec;
12
+ }
13
+ export declare class ResultPool {
14
+ private readonly ctx;
15
+ private readonly blocks;
16
+ private readonly allSpecsAvailable;
17
+ private constructor();
18
+ getBlockLabel(blockId: string): string;
19
+ getData(): ExtendedResultCollection<PObject<PlTreeNodeAccessor>>;
20
+ getDataWithErrors(): ExtendedResultCollection<Optional<PObject<ValueOrError<PlTreeNodeAccessor, string>>, 'id'>>;
21
+ getSpecs(): ExtendedResultCollection<PObjectSpec>;
22
+ calculateOptions(predicate: PSpecPredicate): ExtendedOption[];
23
+ static create(ctx: ComputableCtx, prjEntry: PlTreeEntry, rootBlockId: string): ResultPool;
24
+ }
25
+ //# sourceMappingURL=result_pool.d.ts.map