@milaboratories/pl-model-backend 1.2.6 → 1.2.7

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.
@@ -6,16 +6,12 @@ var __getOwnPropNames = Object.getOwnPropertyNames;
6
6
  var __getProtoOf = Object.getPrototypeOf;
7
7
  var __hasOwnProp = Object.prototype.hasOwnProperty;
8
8
  var __copyProps = (to, from, except, desc) => {
9
- if (from && typeof from === "object" || typeof from === "function") {
10
- for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
11
- key = keys[i];
12
- if (!__hasOwnProp.call(to, key) && key !== except) {
13
- __defProp(to, key, {
14
- get: ((k) => from[k]).bind(null, key),
15
- enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
16
- });
17
- }
18
- }
9
+ if (from && typeof from === "object" || typeof from === "function") for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
10
+ key = keys[i];
11
+ if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
12
+ get: ((k) => from[k]).bind(null, key),
13
+ enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
14
+ });
19
15
  }
20
16
  return to;
21
17
  };
@@ -23,7 +19,5 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
23
19
  value: mod,
24
20
  enumerable: true
25
21
  }) : target, mod));
26
-
27
22
  //#endregion
28
-
29
- exports.__toESM = __toESM;
23
+ exports.__toESM = __toESM;
package/dist/index.cjs CHANGED
@@ -1,30 +1,29 @@
1
- Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
- const require_serde = require('./serde.cjs');
3
- const require_template_resources_v1 = require('./template_resources_v1.cjs');
4
-
5
- Object.defineProperty(exports, 'PlTemplateLibV1', {
6
- enumerable: true,
7
- get: function () {
8
- return require_template_resources_v1.PlTemplateLibV1;
9
- }
1
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
+ const require_serde = require("./serde.cjs");
3
+ const require_template_resources_v1 = require("./template_resources_v1.cjs");
4
+ Object.defineProperty(exports, "PlTemplateLibV1", {
5
+ enumerable: true,
6
+ get: function() {
7
+ return require_template_resources_v1.PlTemplateLibV1;
8
+ }
10
9
  });
11
- Object.defineProperty(exports, 'PlTemplateOverrideV1', {
12
- enumerable: true,
13
- get: function () {
14
- return require_template_resources_v1.PlTemplateOverrideV1;
15
- }
10
+ Object.defineProperty(exports, "PlTemplateOverrideV1", {
11
+ enumerable: true,
12
+ get: function() {
13
+ return require_template_resources_v1.PlTemplateOverrideV1;
14
+ }
16
15
  });
17
- Object.defineProperty(exports, 'PlTemplateSoftwareV1', {
18
- enumerable: true,
19
- get: function () {
20
- return require_template_resources_v1.PlTemplateSoftwareV1;
21
- }
16
+ Object.defineProperty(exports, "PlTemplateSoftwareV1", {
17
+ enumerable: true,
18
+ get: function() {
19
+ return require_template_resources_v1.PlTemplateSoftwareV1;
20
+ }
22
21
  });
23
- Object.defineProperty(exports, 'PlTemplateV1', {
24
- enumerable: true,
25
- get: function () {
26
- return require_template_resources_v1.PlTemplateV1;
27
- }
22
+ Object.defineProperty(exports, "PlTemplateV1", {
23
+ enumerable: true,
24
+ get: function() {
25
+ return require_template_resources_v1.PlTemplateV1;
26
+ }
28
27
  });
29
28
  exports.parseTemplate = require_serde.parseTemplate;
30
- exports.serializeTemplate = require_serde.serializeTemplate;
29
+ exports.serializeTemplate = require_serde.serializeTemplate;
package/dist/index.js CHANGED
@@ -1,4 +1,3 @@
1
1
  import { parseTemplate, serializeTemplate } from "./serde.js";
2
2
  import { PlTemplateLibV1, PlTemplateOverrideV1, PlTemplateSoftwareV1, PlTemplateV1 } from "./template_resources_v1.js";
3
-
4
- export { PlTemplateLibV1, PlTemplateOverrideV1, PlTemplateSoftwareV1, PlTemplateV1, parseTemplate, serializeTemplate };
3
+ export { PlTemplateLibV1, PlTemplateOverrideV1, PlTemplateSoftwareV1, PlTemplateV1, parseTemplate, serializeTemplate };
package/dist/serde.cjs CHANGED
@@ -1,9 +1,8 @@
1
- const require_runtime = require('./_virtual/_rolldown/runtime.cjs');
1
+ const require_runtime = require("./_virtual/_rolldown/runtime.cjs");
2
2
  let node_zlib = require("node:zlib");
3
3
  let canonicalize = require("canonicalize");
4
4
  canonicalize = require_runtime.__toESM(canonicalize);
5
5
  let zod = require("zod");
6
-
7
6
  //#region src/serde.ts
8
7
  const TypeSchema = zod.z.object({ type: zod.z.string() }).passthrough();
9
8
  const templateArchiveEncoder = new TextEncoder();
@@ -19,8 +18,8 @@ function serializeTemplate(data) {
19
18
  level: 9
20
19
  });
21
20
  }
22
-
23
21
  //#endregion
24
22
  exports.parseTemplate = parseTemplate;
25
23
  exports.serializeTemplate = serializeTemplate;
24
+
26
25
  //# sourceMappingURL=serde.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"serde.cjs","names":["z"],"sources":["../src/serde.ts"],"sourcesContent":["import { gunzipSync, gzipSync } from \"node:zlib\";\nimport canonicalize from \"canonicalize\";\nimport type { TemplateData } from \"./template_data_v2\";\nimport type { CompiledTemplateV3 } from \"./template_data_v3\";\nimport { z } from \"zod\";\n\nconst TypeSchema = z\n .object({\n type: z.string(),\n })\n .passthrough();\n\nconst templateArchiveEncoder = new TextEncoder();\nconst templateArchiveDecoder = new TextDecoder();\n\nexport function parseTemplate(content: Uint8Array): TemplateData | CompiledTemplateV3 {\n const data = TypeSchema.parse(JSON.parse(templateArchiveDecoder.decode(gunzipSync(content))));\n if (data.type !== \"pl.tengo-template.v2\" && data.type !== \"pl.tengo-template.v3\") {\n throw new Error(\"malformed template\");\n }\n\n return data as unknown as TemplateData | CompiledTemplateV3;\n}\n\nexport function serializeTemplate(data: TemplateData | CompiledTemplateV3): Uint8Array {\n return gzipSync(templateArchiveEncoder.encode(canonicalize(data)), {\n chunkSize: 256 * 1024,\n level: 9,\n });\n}\n"],"mappings":";;;;;;;AAMA,MAAM,aAAaA,MAChB,OAAO,EACN,MAAMA,MAAE,QAAQ,EACjB,CAAC,CACD,aAAa;AAEhB,MAAM,yBAAyB,IAAI,aAAa;AAChD,MAAM,yBAAyB,IAAI,aAAa;AAEhD,SAAgB,cAAc,SAAwD;CACpF,MAAM,OAAO,WAAW,MAAM,KAAK,MAAM,uBAAuB,iCAAkB,QAAQ,CAAC,CAAC,CAAC;AAC7F,KAAI,KAAK,SAAS,0BAA0B,KAAK,SAAS,uBACxD,OAAM,IAAI,MAAM,qBAAqB;AAGvC,QAAO;;AAGT,SAAgB,kBAAkB,MAAqD;AACrF,gCAAgB,uBAAuB,iCAAoB,KAAK,CAAC,EAAE;EACjE,WAAW,MAAM;EACjB,OAAO;EACR,CAAC"}
1
+ {"version":3,"file":"serde.cjs","names":["z"],"sources":["../src/serde.ts"],"sourcesContent":["import { gunzipSync, gzipSync } from \"node:zlib\";\nimport canonicalize from \"canonicalize\";\nimport type { TemplateData } from \"./template_data_v2\";\nimport type { CompiledTemplateV3 } from \"./template_data_v3\";\nimport { z } from \"zod\";\n\nconst TypeSchema = z\n .object({\n type: z.string(),\n })\n .passthrough();\n\nconst templateArchiveEncoder = new TextEncoder();\nconst templateArchiveDecoder = new TextDecoder();\n\nexport function parseTemplate(content: Uint8Array): TemplateData | CompiledTemplateV3 {\n const data = TypeSchema.parse(JSON.parse(templateArchiveDecoder.decode(gunzipSync(content))));\n if (data.type !== \"pl.tengo-template.v2\" && data.type !== \"pl.tengo-template.v3\") {\n throw new Error(\"malformed template\");\n }\n\n return data as unknown as TemplateData | CompiledTemplateV3;\n}\n\nexport function serializeTemplate(data: TemplateData | CompiledTemplateV3): Uint8Array {\n return gzipSync(templateArchiveEncoder.encode(canonicalize(data)), {\n chunkSize: 256 * 1024,\n level: 9,\n });\n}\n"],"mappings":";;;;;;AAMA,MAAM,aAAaA,IAAAA,EAChB,OAAO,EACN,MAAMA,IAAAA,EAAE,QAAQ,EACjB,CAAC,CACD,aAAa;AAEhB,MAAM,yBAAyB,IAAI,aAAa;AAChD,MAAM,yBAAyB,IAAI,aAAa;AAEhD,SAAgB,cAAc,SAAwD;CACpF,MAAM,OAAO,WAAW,MAAM,KAAK,MAAM,uBAAuB,QAAA,GAAA,UAAA,YAAkB,QAAQ,CAAC,CAAC,CAAC;AAC7F,KAAI,KAAK,SAAS,0BAA0B,KAAK,SAAS,uBACxD,OAAM,IAAI,MAAM,qBAAqB;AAGvC,QAAO;;AAGT,SAAgB,kBAAkB,MAAqD;AACrF,SAAA,GAAA,UAAA,UAAgB,uBAAuB,QAAA,GAAA,aAAA,SAAoB,KAAK,CAAC,EAAE;EACjE,WAAW,MAAM;EACjB,OAAO;EACR,CAAC"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"serde.d.ts","names":[],"sources":["../src/serde.ts"],"mappings":";;;;iBAegB,aAAA,CAAc,OAAA,EAAS,UAAA,GAAa,YAAA,GAAe,kBAAA;AAAA,iBASnD,iBAAA,CAAkB,IAAA,EAAM,YAAA,GAAe,kBAAA,GAAqB,UAAA"}
package/dist/serde.js CHANGED
@@ -1,7 +1,6 @@
1
1
  import { gunzipSync, gzipSync } from "node:zlib";
2
2
  import canonicalize from "canonicalize";
3
3
  import { z } from "zod";
4
-
5
4
  //#region src/serde.ts
6
5
  const TypeSchema = z.object({ type: z.string() }).passthrough();
7
6
  const templateArchiveEncoder = new TextEncoder();
@@ -17,7 +16,7 @@ function serializeTemplate(data) {
17
16
  level: 9
18
17
  });
19
18
  }
20
-
21
19
  //#endregion
22
20
  export { parseTemplate, serializeTemplate };
21
+
23
22
  //# sourceMappingURL=serde.js.map
package/dist/serde.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"serde.js","names":[],"sources":["../src/serde.ts"],"sourcesContent":["import { gunzipSync, gzipSync } from \"node:zlib\";\nimport canonicalize from \"canonicalize\";\nimport type { TemplateData } from \"./template_data_v2\";\nimport type { CompiledTemplateV3 } from \"./template_data_v3\";\nimport { z } from \"zod\";\n\nconst TypeSchema = z\n .object({\n type: z.string(),\n })\n .passthrough();\n\nconst templateArchiveEncoder = new TextEncoder();\nconst templateArchiveDecoder = new TextDecoder();\n\nexport function parseTemplate(content: Uint8Array): TemplateData | CompiledTemplateV3 {\n const data = TypeSchema.parse(JSON.parse(templateArchiveDecoder.decode(gunzipSync(content))));\n if (data.type !== \"pl.tengo-template.v2\" && data.type !== \"pl.tengo-template.v3\") {\n throw new Error(\"malformed template\");\n }\n\n return data as unknown as TemplateData | CompiledTemplateV3;\n}\n\nexport function serializeTemplate(data: TemplateData | CompiledTemplateV3): Uint8Array {\n return gzipSync(templateArchiveEncoder.encode(canonicalize(data)), {\n chunkSize: 256 * 1024,\n level: 9,\n });\n}\n"],"mappings":";;;;;AAMA,MAAM,aAAa,EAChB,OAAO,EACN,MAAM,EAAE,QAAQ,EACjB,CAAC,CACD,aAAa;AAEhB,MAAM,yBAAyB,IAAI,aAAa;AAChD,MAAM,yBAAyB,IAAI,aAAa;AAEhD,SAAgB,cAAc,SAAwD;CACpF,MAAM,OAAO,WAAW,MAAM,KAAK,MAAM,uBAAuB,OAAO,WAAW,QAAQ,CAAC,CAAC,CAAC;AAC7F,KAAI,KAAK,SAAS,0BAA0B,KAAK,SAAS,uBACxD,OAAM,IAAI,MAAM,qBAAqB;AAGvC,QAAO;;AAGT,SAAgB,kBAAkB,MAAqD;AACrF,QAAO,SAAS,uBAAuB,OAAO,aAAa,KAAK,CAAC,EAAE;EACjE,WAAW,MAAM;EACjB,OAAO;EACR,CAAC"}
1
+ {"version":3,"file":"serde.js","names":[],"sources":["../src/serde.ts"],"sourcesContent":["import { gunzipSync, gzipSync } from \"node:zlib\";\nimport canonicalize from \"canonicalize\";\nimport type { TemplateData } from \"./template_data_v2\";\nimport type { CompiledTemplateV3 } from \"./template_data_v3\";\nimport { z } from \"zod\";\n\nconst TypeSchema = z\n .object({\n type: z.string(),\n })\n .passthrough();\n\nconst templateArchiveEncoder = new TextEncoder();\nconst templateArchiveDecoder = new TextDecoder();\n\nexport function parseTemplate(content: Uint8Array): TemplateData | CompiledTemplateV3 {\n const data = TypeSchema.parse(JSON.parse(templateArchiveDecoder.decode(gunzipSync(content))));\n if (data.type !== \"pl.tengo-template.v2\" && data.type !== \"pl.tengo-template.v3\") {\n throw new Error(\"malformed template\");\n }\n\n return data as unknown as TemplateData | CompiledTemplateV3;\n}\n\nexport function serializeTemplate(data: TemplateData | CompiledTemplateV3): Uint8Array {\n return gzipSync(templateArchiveEncoder.encode(canonicalize(data)), {\n chunkSize: 256 * 1024,\n level: 9,\n });\n}\n"],"mappings":";;;;AAMA,MAAM,aAAa,EAChB,OAAO,EACN,MAAM,EAAE,QAAQ,EACjB,CAAC,CACD,aAAa;AAEhB,MAAM,yBAAyB,IAAI,aAAa;AAChD,MAAM,yBAAyB,IAAI,aAAa;AAEhD,SAAgB,cAAc,SAAwD;CACpF,MAAM,OAAO,WAAW,MAAM,KAAK,MAAM,uBAAuB,OAAO,WAAW,QAAQ,CAAC,CAAC,CAAC;AAC7F,KAAI,KAAK,SAAS,0BAA0B,KAAK,SAAS,uBACxD,OAAM,IAAI,MAAM,qBAAqB;AAGvC,QAAO;;AAGT,SAAgB,kBAAkB,MAAqD;AACrF,QAAO,SAAS,uBAAuB,OAAO,aAAa,KAAK,CAAC,EAAE;EACjE,WAAW,MAAM;EACjB,OAAO;EACR,CAAC"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"template_data_v2.d.ts","names":[],"sources":["../src/template_data_v2.ts"],"mappings":";UAAiB,eAAA;EAAA;EAEf,IAAA;;EAEA,OAAA;EAFA;EAIA,GAAA;AAAA;AAAA,UAGe,oBAAA;EAHZ;EAKH,IAAA;EAFmC;EAInC,OAAA;EAJmC;EAMnC,GAAA;AAAA;AAAA,UAGe,iBAAA;EAHZ;EAKH,IAAA;EAFe;EAIf,OAAA;;EAEA,GAAA;AAAA;AAAA,UAGe,YAAA;EAHf;EAKA,IAAA;EALG;EAQH,IAAA;EAL2B;EAO3B,OAAA;EASqB;;;;EAHrB,YAAA;EAOU;EAJV,IAAA,EAAM,MAAA,SAAe,eAAA;EAMb;EAJR,SAAA,EAAW,MAAA,SAAe,YAAA;EAIZ;EAFd,QAAA,EAAU,MAAA,SAAe,oBAAA;EAfzB;EAiBA,MAAA,EAAQ,MAAA,SAAe,iBAAA;EATvB;EAWA,GAAA;AAAA"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"template_data_v3.d.ts","names":[],"sources":["../src/template_data_v3.ts"],"mappings":";UAAiB,iBAAA;EAAA;EAEf,IAAA;;EAEA,OAAA;EAFA;EAIA,UAAA;AAAA;AAAA,UAGe,sBAAA;EAHL;EAKV,IAAA;EAFqC;EAIrC,OAAA;EAJqC;EAMrC,UAAA;AAAA;AAAA,UAGe,mBAAA;EAHL;EAKV,IAAA;EAFe;EAIf,OAAA;;EAEA,UAAA;AAAA;AAAA,UAGe,cAAA;EAHf;EAKA,IAAA;EALU;EAOV,OAAA;EAJ6B;EAO7B,UAAA;EASqB;;;;EAHrB,YAAA;EAOU;EAJV,IAAA,EAAM,MAAA,SAAe,iBAAA;EAMb;EAJR,SAAA,EAAW,MAAA,SAAe,cAAA;EAIZ;EAFd,QAAA,EAAU,MAAA,SAAe,sBAAA;EAhBzB;EAkBA,MAAA,EAAQ,MAAA,SAAe,mBAAA;AAAA;AAAA,UAGR,kBAAA;EATT;EAWN,IAAA;EATA;EAYA,YAAA,EAAc,MAAA;EAEd,QAAA,EAAU,cAAA;AAAA"}
@@ -1,6 +1,5 @@
1
- const require_runtime = require('./_virtual/_rolldown/runtime.cjs');
1
+ require("./_virtual/_rolldown/runtime.cjs");
2
2
  let _milaboratories_pl_client = require("@milaboratories/pl-client");
3
-
4
3
  //#region src/template_resources_v1.ts
5
4
  let PlTemplateLibV1;
6
5
  (function(_PlTemplateLibV) {
@@ -100,30 +99,30 @@ let PlTemplateOverrideV1;
100
99
  }
101
100
  _PlTemplateOverrideV.fromV3Data = fromV3Data;
102
101
  })(PlTemplateOverrideV1 || (PlTemplateOverrideV1 = {}));
103
-
104
102
  //#endregion
105
- Object.defineProperty(exports, 'PlTemplateLibV1', {
106
- enumerable: true,
107
- get: function () {
108
- return PlTemplateLibV1;
109
- }
103
+ Object.defineProperty(exports, "PlTemplateLibV1", {
104
+ enumerable: true,
105
+ get: function() {
106
+ return PlTemplateLibV1;
107
+ }
110
108
  });
111
- Object.defineProperty(exports, 'PlTemplateOverrideV1', {
112
- enumerable: true,
113
- get: function () {
114
- return PlTemplateOverrideV1;
115
- }
109
+ Object.defineProperty(exports, "PlTemplateOverrideV1", {
110
+ enumerable: true,
111
+ get: function() {
112
+ return PlTemplateOverrideV1;
113
+ }
116
114
  });
117
- Object.defineProperty(exports, 'PlTemplateSoftwareV1', {
118
- enumerable: true,
119
- get: function () {
120
- return PlTemplateSoftwareV1;
121
- }
115
+ Object.defineProperty(exports, "PlTemplateSoftwareV1", {
116
+ enumerable: true,
117
+ get: function() {
118
+ return PlTemplateSoftwareV1;
119
+ }
122
120
  });
123
- Object.defineProperty(exports, 'PlTemplateV1', {
124
- enumerable: true,
125
- get: function () {
126
- return PlTemplateV1;
127
- }
121
+ Object.defineProperty(exports, "PlTemplateV1", {
122
+ enumerable: true,
123
+ get: function() {
124
+ return PlTemplateV1;
125
+ }
128
126
  });
127
+
129
128
  //# sourceMappingURL=template_resources_v1.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"template_resources_v1.cjs","names":[],"sources":["../src/template_resources_v1.ts"],"sourcesContent":["import type { AnyFieldRef, AnyResourceRef } from \"@milaboratories/pl-client\";\nimport { field, resourceType } from \"@milaboratories/pl-client\";\nimport type * as infoV2 from \"./template_data_v2\";\nimport type * as infoV3 from \"./template_data_v3\";\nexport namespace PlTemplateLibV1 {\n export const type = resourceType(\"TengoLib\", \"1\");\n\n export type ResourceStructure = {\n data: Data;\n };\n\n export type Data = {\n /** i.e. @milaboratory/some-package:lib1 */\n Name: string;\n /** i.e. 1.2.3 */\n Version: string;\n /** Full source code encoded with Base64 */\n Code: string;\n };\n\n export function fromV2Data(info: infoV2.TemplateLibData): ResourceStructure {\n return {\n data: {\n Name: info.name,\n Version: info.version,\n Code: Buffer.from(info.src, \"utf8\").toString(\"base64\"),\n },\n };\n }\n\n export function fromV3Data(\n info: infoV3.TemplateLibDataV3,\n sourceCode: string,\n ): ResourceStructure {\n return {\n data: {\n Name: info.name,\n Version: info.version,\n Code: Buffer.from(sourceCode, \"utf8\").toString(\"base64\"),\n },\n };\n }\n}\n\nexport namespace PlTemplateSoftwareV1 {\n export const type = resourceType(\"SoftwareInfo\", \"1\");\n\n export type ResourceStructure = {\n data: Data;\n name: MetaName;\n };\n\n /** Raw entrypoint descriptor encoded with Base64 */\n export type Data = string;\n\n export const metaNameKey = \"ctl/runner/package/name\";\n export type MetaName = {\n /** i.e. @milaboratory/some-package:sw1 */\n Name: string;\n /** i.e. 1.2.3 */\n Version: string;\n };\n\n export function fromV2Data(\n info: infoV2.TemplateSoftwareData | infoV2.TemplateAssetData,\n ): ResourceStructure {\n return {\n data: info.src,\n name: {\n Name: info.name,\n Version: info.version,\n },\n };\n }\n\n export function fromV3Data(\n info: infoV3.TemplateSoftwareDataV3,\n sourceCode: string,\n ): ResourceStructure {\n return {\n data: sourceCode,\n name: {\n Name: info.name,\n Version: info.version,\n },\n };\n }\n}\n\nexport namespace PlTemplateV1 {\n export const type = resourceType(\"TengoTemplate\", \"1\");\n\n export type ResourceStructure = {\n data: Data;\n };\n\n export const libPrefix = \"lib\";\n export const softPrefix = \"soft\";\n export const tplPrefix = \"tpl\";\n\n export function libField(ref: AnyResourceRef, libId: string): AnyFieldRef {\n return field(ref, `${libPrefix}/${libId}`);\n }\n export function tplField(ref: AnyResourceRef, tplId: string): AnyFieldRef {\n return field(ref, `${tplPrefix}/${tplId}`);\n }\n export function swField(ref: AnyResourceRef, softwareId: string): AnyFieldRef {\n return field(ref, `${softPrefix}/${softwareId}`);\n }\n\n export type Data = {\n /** i.e. @milaboratory/some-package:tpl1 */\n Name: string;\n /** i.e. 1.2.3 */\n Version: string;\n /** Full source code encoded with Base64 */\n Code: string;\n };\n\n export function fromV2Data(info: infoV2.TemplateData): ResourceStructure {\n return {\n data: {\n Name: info.name,\n Version: info.version,\n Code: Buffer.from(info.src, \"utf8\").toString(\"base64\"),\n },\n };\n }\n\n export function fromV3Data(info: infoV3.TemplateDataV3, sourceCode: string): ResourceStructure {\n return {\n data: {\n Name: info.name,\n Version: info.version,\n Code: Buffer.from(sourceCode, \"utf8\").toString(\"base64\"),\n },\n };\n }\n}\n\nexport namespace PlTemplateOverrideV1 {\n export const type = resourceType(\"TengoTemplateOverride\", \"1\");\n\n export type ResourceStructure = {\n data: Data;\n };\n\n export function tplField(ref: AnyResourceRef): AnyFieldRef {\n return field(ref, \"tpl\");\n }\n\n export type Data = {\n OverrideUUID: string;\n };\n\n export function fromV2Data(info: infoV2.TemplateData): ResourceStructure {\n if (!info.hashOverride) {\n throw new Error(\n `template tree rendering error: template has no hash override, cannot generate PlTemplateOverrideV1.ResourceStructure from template data`,\n );\n }\n\n return {\n data: {\n OverrideUUID: info.hashOverride,\n },\n };\n }\n\n export function fromV3Data(info: infoV3.TemplateDataV3): ResourceStructure {\n if (!info.hashOverride) {\n throw new Error(\n `template tree rendering error: template has no hash override, cannot generate PlTemplateOverrideV1.ResourceStructure from template data`,\n );\n }\n\n return {\n data: {\n OverrideUUID: info.hashOverride,\n },\n };\n }\n}\n"],"mappings":";;;;AAIO;;oEAC4B,YAAY,IAAI;CAe1C,SAAS,WAAW,MAAiD;AAC1E,SAAO,EACL,MAAM;GACJ,MAAM,KAAK;GACX,SAAS,KAAK;GACd,MAAM,OAAO,KAAK,KAAK,KAAK,OAAO,CAAC,SAAS,SAAS;GACvD,EACF;;;CAGI,SAAS,WACd,MACA,YACmB;AACnB,SAAO,EACL,MAAM;GACJ,MAAM,KAAK;GACX,SAAS,KAAK;GACd,MAAM,OAAO,KAAK,YAAY,OAAO,CAAC,SAAS,SAAS;GACzD,EACF;;;6CAEJ;AAEM;;yEAC4B,gBAAgB,IAAI;oCAU1B;CAQpB,SA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{"version":3,"file":"template_resources_v1.cjs","names":[],"sources":["../src/template_resources_v1.ts"],"sourcesContent":["import type { AnyFieldRef, AnyResourceRef } from \"@milaboratories/pl-client\";\nimport { field, resourceType } from \"@milaboratories/pl-client\";\nimport type * as infoV2 from \"./template_data_v2\";\nimport type * as infoV3 from \"./template_data_v3\";\nexport namespace PlTemplateLibV1 {\n export const type = resourceType(\"TengoLib\", \"1\");\n\n export type ResourceStructure = {\n data: Data;\n };\n\n export type Data = {\n /** i.e. @milaboratory/some-package:lib1 */\n Name: string;\n /** i.e. 1.2.3 */\n Version: string;\n /** Full source code encoded with Base64 */\n Code: string;\n };\n\n export function fromV2Data(info: infoV2.TemplateLibData): ResourceStructure {\n return {\n data: {\n Name: info.name,\n Version: info.version,\n Code: Buffer.from(info.src, \"utf8\").toString(\"base64\"),\n },\n };\n }\n\n export function fromV3Data(\n info: infoV3.TemplateLibDataV3,\n sourceCode: string,\n ): ResourceStructure {\n return {\n data: {\n Name: info.name,\n Version: info.version,\n Code: Buffer.from(sourceCode, \"utf8\").toString(\"base64\"),\n },\n };\n }\n}\n\nexport namespace PlTemplateSoftwareV1 {\n export const type = resourceType(\"SoftwareInfo\", \"1\");\n\n export type ResourceStructure = {\n data: Data;\n name: MetaName;\n };\n\n /** Raw entrypoint descriptor encoded with Base64 */\n export type Data = string;\n\n export const metaNameKey = \"ctl/runner/package/name\";\n export type MetaName = {\n /** i.e. @milaboratory/some-package:sw1 */\n Name: string;\n /** i.e. 1.2.3 */\n Version: string;\n };\n\n export function fromV2Data(\n info: infoV2.TemplateSoftwareData | infoV2.TemplateAssetData,\n ): ResourceStructure {\n return {\n data: info.src,\n name: {\n Name: info.name,\n Version: info.version,\n },\n };\n }\n\n export function fromV3Data(\n info: infoV3.TemplateSoftwareDataV3,\n sourceCode: string,\n ): ResourceStructure {\n return {\n data: sourceCode,\n name: {\n Name: info.name,\n Version: info.version,\n },\n };\n }\n}\n\nexport namespace PlTemplateV1 {\n export const type = resourceType(\"TengoTemplate\", \"1\");\n\n export type ResourceStructure = {\n data: Data;\n };\n\n export const libPrefix = \"lib\";\n export const softPrefix = \"soft\";\n export const tplPrefix = \"tpl\";\n\n export function libField(ref: AnyResourceRef, libId: string): AnyFieldRef {\n return field(ref, `${libPrefix}/${libId}`);\n }\n export function tplField(ref: AnyResourceRef, tplId: string): AnyFieldRef {\n return field(ref, `${tplPrefix}/${tplId}`);\n }\n export function swField(ref: AnyResourceRef, softwareId: string): AnyFieldRef {\n return field(ref, `${softPrefix}/${softwareId}`);\n }\n\n export type Data = {\n /** i.e. @milaboratory/some-package:tpl1 */\n Name: string;\n /** i.e. 1.2.3 */\n Version: string;\n /** Full source code encoded with Base64 */\n Code: string;\n };\n\n export function fromV2Data(info: infoV2.TemplateData): ResourceStructure {\n return {\n data: {\n Name: info.name,\n Version: info.version,\n Code: Buffer.from(info.src, \"utf8\").toString(\"base64\"),\n },\n };\n }\n\n export function fromV3Data(info: infoV3.TemplateDataV3, sourceCode: string): ResourceStructure {\n return {\n data: {\n Name: info.name,\n Version: info.version,\n Code: Buffer.from(sourceCode, \"utf8\").toString(\"base64\"),\n },\n };\n }\n}\n\nexport namespace PlTemplateOverrideV1 {\n export const type = resourceType(\"TengoTemplateOverride\", \"1\");\n\n export type ResourceStructure = {\n data: Data;\n };\n\n export function tplField(ref: AnyResourceRef): AnyFieldRef {\n return field(ref, \"tpl\");\n }\n\n export type Data = {\n OverrideUUID: string;\n };\n\n export function fromV2Data(info: infoV2.TemplateData): ResourceStructure {\n if (!info.hashOverride) {\n throw new Error(\n `template tree rendering error: template has no hash override, cannot generate PlTemplateOverrideV1.ResourceStructure from template data`,\n );\n }\n\n return {\n data: {\n OverrideUUID: info.hashOverride,\n },\n };\n }\n\n export function fromV3Data(info: infoV3.TemplateDataV3): ResourceStructure {\n if (!info.hashOverride) {\n throw new Error(\n `template tree rendering error: template has no hash override, cannot generate PlTemplateOverrideV1.ResourceStructure from template data`,\n );\n }\n\n return {\n data: {\n OverrideUUID: info.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F;;;CAGI,SAAS,WAAW,MAA6B,YAAuC;AAC7F,SAAO,EACL,MAAM;GACJ,MAAM,KAAK;GACX,SAAS,KAAK;GACd,MAAM,OAAO,KAAK,YAAY,OAAO,CAAC,SAAS,SAAS;GACzD,EACF;;;uCAEJ;AAEM,IAAA;;yEAC4B,yBAAyB,IAAI;CAMvD,SAAS,SAAS,KAAkC;AACzD,UAAA,GAAA,0BAAA,OAAa,KAAK,MAAM;;;CAOnB,SAAS,WAAW,MAA8C;AACvE,MAAI,CAAC,KAAK,aACR,OAAM,IAAI,MACR,0IACD;AAGH,SAAO,EACL,MAAM,EACJ,cAAc,KAAK,cACpB,EACF;;;CAGI,SAAS,WAAW,MAAgD;AACzE,MAAI,CAAC,KAAK,aACR,OAAM,IAAI,MACR,0IACD;AAGH,SAAO,EACL,MAAM,EACJ,cAAc,KAAK,cACpB,EACF;;;uDAEJ"}
@@ -1,11 +1,11 @@
1
1
  import { TemplateAssetData, TemplateData, TemplateLibData, TemplateSoftwareData } from "./template_data_v2.js";
2
2
  import { TemplateDataV3, TemplateLibDataV3, TemplateSoftwareDataV3 } from "./template_data_v3.js";
3
- import * as _milaboratories_pl_client0 from "@milaboratories/pl-client";
3
+ import * as _$_milaboratories_pl_client0 from "@milaboratories/pl-client";
4
4
  import { AnyFieldRef, AnyResourceRef } from "@milaboratories/pl-client";
5
5
 
6
6
  //#region src/template_resources_v1.d.ts
7
7
  declare namespace PlTemplateLibV1 {
8
- const type: _milaboratories_pl_client0.ResourceType;
8
+ const type: _$_milaboratories_pl_client0.ResourceType;
9
9
  type ResourceStructure = {
10
10
  data: Data;
11
11
  };
@@ -18,7 +18,7 @@ declare namespace PlTemplateLibV1 {
18
18
  function fromV3Data(info: TemplateLibDataV3, sourceCode: string): ResourceStructure;
19
19
  }
20
20
  declare namespace PlTemplateSoftwareV1 {
21
- const type: _milaboratories_pl_client0.ResourceType;
21
+ const type: _$_milaboratories_pl_client0.ResourceType;
22
22
  type ResourceStructure = {
23
23
  data: Data;
24
24
  name: MetaName;
@@ -34,7 +34,7 @@ declare namespace PlTemplateSoftwareV1 {
34
34
  function fromV3Data(info: TemplateSoftwareDataV3, sourceCode: string): ResourceStructure;
35
35
  }
36
36
  declare namespace PlTemplateV1 {
37
- const type: _milaboratories_pl_client0.ResourceType;
37
+ const type: _$_milaboratories_pl_client0.ResourceType;
38
38
  type ResourceStructure = {
39
39
  data: Data;
40
40
  };
@@ -53,7 +53,7 @@ declare namespace PlTemplateV1 {
53
53
  function fromV3Data(info: TemplateDataV3, sourceCode: string): ResourceStructure;
54
54
  }
55
55
  declare namespace PlTemplateOverrideV1 {
56
- const type: _milaboratories_pl_client0.ResourceType;
56
+ const type: _$_milaboratories_pl_client0.ResourceType;
57
57
  type ResourceStructure = {
58
58
  data: Data;
59
59
  };
@@ -0,0 +1 @@
1
+ {"version":3,"file":"template_resources_v1.d.ts","names":[],"sources":["../src/template_resources_v1.ts"],"mappings":";;;;;;kBAIiB,eAAA;EAAA,MACF,IAAA,EADiB,4BAAA,CACb,YAAA;EAAA,KAEL,iBAAA;IACV,IAAA,EAAM,IAAA;EAAA;EAAA,KAGI,IAAA;IAPkB,2CAS5B,IAAA,UAO+B;IAL/B,OAAA,UAgBM;IAdN,IAAA;EAAA;EAAA,SAGc,UAAA,CAAW,IAAA,EAAM,eAAA,GAAyB,iBAAA;EAAA,SAU1C,UAAA,CACd,IAAA,EAAM,iBAAA,EACN,UAAA,WACC,iBAAA;AAAA;AAAA,kBAWY,oBAAA;EAAA,MACF,IAAA,EADsB,4BAAA,CAClB,YAAA;EAAA,KAEL,iBAAA;IACV,IAAA,EAAM,IAAA;IACN,IAAA,EAAM,QAAA;EAAA;EAhCN;EAAA,KAoCU,IAAA;EAAA,MAEC,WAAA;EAAA,KACD,QAAA;IApCe,0CAsCzB,IAAA,UA5Bc;IA8Bd,OAAA;EAAA;EAAA,SAGc,UAAA,CACd,IAAA,EAAM,oBAAA,GAA8B,iBAAA,GACnC,iBAAA;EAAA,SAUa,UAAA,CACd,IAAA,EAAM,sBAAA,EACN,UAAA,WACC,iBAAA;AAAA;AAAA,kBAWY,YAAA;EAAA,MACF,IAAA,EADc,4BAAA,CACV,YAAA;EAAA,KAEL,iBAAA;IACV,IAAA,EAAM,IAAA;EAAA;EAAA,MAGK,SAAA;EAAA,MACA,UAAA;EAAA,MACA,SAAA;EAAA,SAEG,QAAA,CAAS,GAAA,EAAK,cAAA,EAAgB,KAAA,WAAgB,WAAA;EAAA,SAG9C,QAAA,CAAS,GAAA,EAAK,cAAA,EAAgB,KAAA,WAAgB,WAAA;EAAA,SAG9C,OAAA,CAAQ,GAAA,EAAK,cAAA,EAAgB,UAAA,WAAqB,WAAA;EAAA,KAItD,IAAA;IAhCT,2CAkCD,IAAA,UAlCkB;IAoClB,OAAA,UArEW;IAuEX,IAAA;EAAA;EAAA,SAGc,UAAA,CAAW,IAAA,EAAM,YAAA,GAAsB,iBAAA;EAAA,SAUvC,UAAA,CAAW,IAAA,EAAM,cAAA,EAAuB,UAAA,WAAqB,iBAAA;AAAA;AAAA,kBAW9D,oBAAA;EAAA,MACF,IAAA,EADsB,4BAAA,CAClB,YAAA;EAAA,KAEL,iBAAA;IACV,IAAA,EAAM,IAAA;EAAA;EAAA,SAGQ,QAAA,CAAS,GAAA,EAAK,cAAA,GAAiB,WAAA;EAAA,KAInC,IAAA;IACV,YAAA;EAAA;EAAA,SAGc,UAAA,CAAW,IAAA,EAAM,YAAA,GAAsB,iBAAA;EAAA,SAcvC,UAAA,CAAW,IAAA,EAAM,cAAA,GAAwB,iBAAA;AAAA"}
@@ -1,5 +1,4 @@
1
1
  import { field, resourceType } from "@milaboratories/pl-client";
2
-
3
2
  //#region src/template_resources_v1.ts
4
3
  let PlTemplateLibV1;
5
4
  (function(_PlTemplateLibV) {
@@ -99,7 +98,7 @@ let PlTemplateOverrideV1;
99
98
  }
100
99
  _PlTemplateOverrideV.fromV3Data = fromV3Data;
101
100
  })(PlTemplateOverrideV1 || (PlTemplateOverrideV1 = {}));
102
-
103
101
  //#endregion
104
102
  export { PlTemplateLibV1, PlTemplateOverrideV1, PlTemplateSoftwareV1, PlTemplateV1 };
103
+
105
104
  //# sourceMappingURL=template_resources_v1.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"template_resources_v1.js","names":[],"sources":["../src/template_resources_v1.ts"],"sourcesContent":["import type { AnyFieldRef, AnyResourceRef } from \"@milaboratories/pl-client\";\nimport { field, resourceType } from \"@milaboratories/pl-client\";\nimport type * as infoV2 from \"./template_data_v2\";\nimport type * as infoV3 from \"./template_data_v3\";\nexport namespace PlTemplateLibV1 {\n export const type = resourceType(\"TengoLib\", \"1\");\n\n export type ResourceStructure = {\n data: Data;\n };\n\n export type Data = {\n /** i.e. @milaboratory/some-package:lib1 */\n Name: string;\n /** i.e. 1.2.3 */\n Version: string;\n /** Full source code encoded with Base64 */\n Code: string;\n };\n\n export function fromV2Data(info: infoV2.TemplateLibData): ResourceStructure {\n return {\n data: {\n Name: info.name,\n Version: info.version,\n Code: Buffer.from(info.src, \"utf8\").toString(\"base64\"),\n },\n };\n }\n\n export function fromV3Data(\n info: infoV3.TemplateLibDataV3,\n sourceCode: string,\n ): ResourceStructure {\n return {\n data: {\n Name: info.name,\n Version: info.version,\n Code: Buffer.from(sourceCode, \"utf8\").toString(\"base64\"),\n },\n };\n }\n}\n\nexport namespace PlTemplateSoftwareV1 {\n export const type = resourceType(\"SoftwareInfo\", \"1\");\n\n export type ResourceStructure = {\n data: Data;\n name: MetaName;\n };\n\n /** Raw entrypoint descriptor encoded with Base64 */\n export type Data = string;\n\n export const metaNameKey = \"ctl/runner/package/name\";\n export type MetaName = {\n /** i.e. @milaboratory/some-package:sw1 */\n Name: string;\n /** i.e. 1.2.3 */\n Version: string;\n };\n\n export function fromV2Data(\n info: infoV2.TemplateSoftwareData | infoV2.TemplateAssetData,\n ): ResourceStructure {\n return {\n data: info.src,\n name: {\n Name: info.name,\n Version: info.version,\n },\n };\n }\n\n export function fromV3Data(\n info: infoV3.TemplateSoftwareDataV3,\n sourceCode: string,\n ): ResourceStructure {\n return {\n data: sourceCode,\n name: {\n Name: info.name,\n Version: info.version,\n },\n };\n }\n}\n\nexport namespace PlTemplateV1 {\n export const type = resourceType(\"TengoTemplate\", \"1\");\n\n export type ResourceStructure = {\n data: Data;\n };\n\n export const libPrefix = \"lib\";\n export const softPrefix = \"soft\";\n export const tplPrefix = \"tpl\";\n\n export function libField(ref: AnyResourceRef, libId: string): AnyFieldRef {\n return field(ref, `${libPrefix}/${libId}`);\n }\n export function tplField(ref: AnyResourceRef, tplId: string): AnyFieldRef {\n return field(ref, `${tplPrefix}/${tplId}`);\n }\n export function swField(ref: AnyResourceRef, softwareId: string): AnyFieldRef {\n return field(ref, `${softPrefix}/${softwareId}`);\n }\n\n export type Data = {\n /** i.e. @milaboratory/some-package:tpl1 */\n Name: string;\n /** i.e. 1.2.3 */\n Version: string;\n /** Full source code encoded with Base64 */\n Code: string;\n };\n\n export function fromV2Data(info: infoV2.TemplateData): ResourceStructure {\n return {\n data: {\n Name: info.name,\n Version: info.version,\n Code: Buffer.from(info.src, \"utf8\").toString(\"base64\"),\n },\n };\n }\n\n export function fromV3Data(info: infoV3.TemplateDataV3, sourceCode: string): ResourceStructure {\n return {\n data: {\n Name: info.name,\n Version: info.version,\n Code: Buffer.from(sourceCode, \"utf8\").toString(\"base64\"),\n },\n };\n }\n}\n\nexport namespace PlTemplateOverrideV1 {\n export const type = resourceType(\"TengoTemplateOverride\", \"1\");\n\n export type ResourceStructure = {\n data: Data;\n };\n\n export function tplField(ref: AnyResourceRef): AnyFieldRef {\n return field(ref, \"tpl\");\n }\n\n export type Data = {\n OverrideUUID: string;\n };\n\n export function fromV2Data(info: infoV2.TemplateData): ResourceStructure {\n if (!info.hashOverride) {\n throw new Error(\n `template tree rendering error: template has no hash override, cannot generate PlTemplateOverrideV1.ResourceStructure from template data`,\n );\n }\n\n return {\n data: {\n OverrideUUID: info.hashOverride,\n },\n };\n }\n\n export function fromV3Data(info: infoV3.TemplateDataV3): ResourceStructure {\n if (!info.hashOverride) {\n throw new Error(\n `template tree rendering error: template has no hash override, cannot generate PlTemplateOverrideV1.ResourceStructure from template data`,\n );\n }\n\n return {\n data: {\n OverrideUUID: info.hashOverride,\n },\n };\n }\n}\n"],"mappings":";;;AAIO;;wBACe,aAAa,YAAY,IAAI;CAe1C,SAAS,WAAW,MAAiD;AAC1E,SAAO,EACL,MAAM;GACJ,MAAM,KAAK;GACX,SAAS,KAAK;GACd,MAAM,OAAO,KAAK,KAAK,KAAK,OAAO,CAAC,SAAS,SAAS;GACvD,EACF;;;CAGI,SAAS,WACd,MACA,YACmB;AACnB,SAAO,EACL,MAAM;GACJ,MAAM,KAAK;GACX,SAAS,KAAK;GACd,MAAM,OAAO,KAAK,YAAY,OAAO,CAAC,SAAS,SAAS;GACzD,EACF;;;6CAEJ;AAEM;;6BACe,aAAa,gBAAgB,IAAI;oCAU1B;CAQpB,SAAS,WACd,MACmB;AACnB,SAAO;GACL,MAAM,KAAK;GACX,MAAM;IACJ,MAAM,KAAK;IACX,SAAS,KAAK;IACf;GACF;;;CAGI,SAAS,WACd,MACA,YACmB;AACnB,SAAO;GACL,MAAM;GACN,MAAM;IACJ,MAAM,KAAK;IACX,SAAS,KAAK;IACf;GACF;;;uDAEJ;AAEM;;qBACe,aAAa,iBAAiB,IAAI;CAM/C,MAAM,qCAAY;CAClB,MAAM,uCAAa;CACnB,MAAM,qCAAY;CAElB,SAAS,SAAS,KAAqB,OAA4B;AACxE,SAAO,MAAM,KAAK,GAAG,UAAU,GAAG,QAAQ;;;CAErC,SAAS,SAAS,KAAqB,OAA4B;AACxE,SAAO,MAAM,KAAK,GAAG,UAAU,GAAG,QAAQ;;;CAErC,SAAS,QAAQ,KAAqB,YAAiC;AAC5E,SAAO,MAAM,KAAK,GAAG,WAAW,GAAG,aAAa;;;CAY3C,SAAS,WAAW,MAA8C;AACvE,SAAO,EACL,MAAM;GACJ,MAAM,KAAK;GACX,SAAS,KAAK;GACd,MAAM,OAAO,KAAK,KAAK,KAAK,OAAO,CAAC,SAAS,SAAS;GACvD,EACF;;;CAGI,SAAS,WAAW,MAA6B,YAAuC;AAC7F,SAAO,EACL,MAAM;GACJ,MAAM,KAAK;GACX,SAAS,KAAK;GACd,MAAM,OAAO,KAAK,YAAY,OAAO,CAAC,SAAS,SAAS;GACzD,EACF;;;uCAEJ;AAEM;;6BACe,aAAa,yBAAyB,IAAI;CAMvD,SAAS,SAAS,KAAkC;AACzD,SAAO,MAAM,KAAK,MAAM;;;CAOnB,SAAS,WAAW,MAA8C;AACvE,MAAI,CAAC,KAAK,aACR,OAAM,IAAI,MACR,0IACD;AAGH,SAAO,EACL,MAAM,EACJ,cAAc,KAAK,cACpB,EACF;;;CAGI,SAAS,WAAW,MAAgD;AACzE,MAAI,CAAC,KAAK,aACR,OAAM,IAAI,MACR,0IACD;AAGH,SAAO,EACL,MAAM,EACJ,cAAc,KAAK,cACpB,EACF;;;uDAEJ"}
1
+ {"version":3,"file":"template_resources_v1.js","names":[],"sources":["../src/template_resources_v1.ts"],"sourcesContent":["import type { AnyFieldRef, AnyResourceRef } from \"@milaboratories/pl-client\";\nimport { field, resourceType } from \"@milaboratories/pl-client\";\nimport type * as infoV2 from \"./template_data_v2\";\nimport type * as infoV3 from \"./template_data_v3\";\nexport namespace PlTemplateLibV1 {\n export const type = resourceType(\"TengoLib\", \"1\");\n\n export type ResourceStructure = {\n data: Data;\n };\n\n export type Data = {\n /** i.e. @milaboratory/some-package:lib1 */\n Name: string;\n /** i.e. 1.2.3 */\n Version: string;\n /** Full source code encoded with Base64 */\n Code: string;\n };\n\n export function fromV2Data(info: infoV2.TemplateLibData): ResourceStructure {\n return {\n data: {\n Name: info.name,\n Version: info.version,\n Code: Buffer.from(info.src, \"utf8\").toString(\"base64\"),\n },\n };\n }\n\n export function fromV3Data(\n info: infoV3.TemplateLibDataV3,\n sourceCode: string,\n ): ResourceStructure {\n return {\n data: {\n Name: info.name,\n Version: info.version,\n Code: Buffer.from(sourceCode, \"utf8\").toString(\"base64\"),\n },\n };\n }\n}\n\nexport namespace PlTemplateSoftwareV1 {\n export const type = resourceType(\"SoftwareInfo\", \"1\");\n\n export type ResourceStructure = {\n data: Data;\n name: MetaName;\n };\n\n /** Raw entrypoint descriptor encoded with Base64 */\n export type Data = string;\n\n export const metaNameKey = \"ctl/runner/package/name\";\n export type MetaName = {\n /** i.e. @milaboratory/some-package:sw1 */\n Name: string;\n /** i.e. 1.2.3 */\n Version: string;\n };\n\n export function fromV2Data(\n info: infoV2.TemplateSoftwareData | infoV2.TemplateAssetData,\n ): ResourceStructure {\n return {\n data: info.src,\n name: {\n Name: info.name,\n Version: info.version,\n },\n };\n }\n\n export function fromV3Data(\n info: infoV3.TemplateSoftwareDataV3,\n sourceCode: string,\n ): ResourceStructure {\n return {\n data: sourceCode,\n name: {\n Name: info.name,\n Version: info.version,\n },\n };\n }\n}\n\nexport namespace PlTemplateV1 {\n export const type = resourceType(\"TengoTemplate\", \"1\");\n\n export type ResourceStructure = {\n data: Data;\n };\n\n export const libPrefix = \"lib\";\n export const softPrefix = \"soft\";\n export const tplPrefix = \"tpl\";\n\n export function libField(ref: AnyResourceRef, libId: string): AnyFieldRef {\n return field(ref, `${libPrefix}/${libId}`);\n }\n export function tplField(ref: AnyResourceRef, tplId: string): AnyFieldRef {\n return field(ref, `${tplPrefix}/${tplId}`);\n }\n export function swField(ref: AnyResourceRef, softwareId: string): AnyFieldRef {\n return field(ref, `${softPrefix}/${softwareId}`);\n }\n\n export type Data = {\n /** i.e. @milaboratory/some-package:tpl1 */\n Name: string;\n /** i.e. 1.2.3 */\n Version: string;\n /** Full source code encoded with Base64 */\n Code: string;\n };\n\n export function fromV2Data(info: infoV2.TemplateData): ResourceStructure {\n return {\n data: {\n Name: info.name,\n Version: info.version,\n Code: Buffer.from(info.src, \"utf8\").toString(\"base64\"),\n },\n };\n }\n\n export function fromV3Data(info: infoV3.TemplateDataV3, sourceCode: string): ResourceStructure {\n return {\n data: {\n Name: info.name,\n Version: info.version,\n Code: Buffer.from(sourceCode, \"utf8\").toString(\"base64\"),\n },\n };\n }\n}\n\nexport namespace PlTemplateOverrideV1 {\n export const type = resourceType(\"TengoTemplateOverride\", \"1\");\n\n export type ResourceStructure = {\n data: Data;\n };\n\n export function tplField(ref: AnyResourceRef): AnyFieldRef {\n return field(ref, \"tpl\");\n }\n\n export type Data = {\n OverrideUUID: string;\n };\n\n export function fromV2Data(info: infoV2.TemplateData): ResourceStructure {\n if (!info.hashOverride) {\n throw new Error(\n `template tree rendering error: template has no hash override, cannot generate PlTemplateOverrideV1.ResourceStructure from template data`,\n );\n }\n\n return {\n data: {\n OverrideUUID: info.hashOverride,\n },\n };\n }\n\n export function fromV3Data(info: infoV3.TemplateDataV3): ResourceStructure {\n if (!info.hashOverride) {\n throw new Error(\n `template tree rendering error: template has no hash override, cannot generate PlTemplateOverrideV1.ResourceStructure from template data`,\n );\n }\n\n return {\n data: {\n OverrideUUID: info.hashOverride,\n },\n };\n }\n}\n"],"mappings":";;AAIO,IAAA;;wBACe,aAAa,YAAY,IAAI;CAe1C,SAAS,WAAW,MAAiD;AAC1E,SAAO,EACL,MAAM;GACJ,MAAM,KAAK;GACX,SAAS,KAAK;GACd,MAAM,OAAO,KAAK,KAAK,KAAK,OAAO,CAAC,SAAS,SAAS;GACvD,EACF;;;CAGI,SAAS,WACd,MACA,YACmB;AACnB,SAAO,EACL,MAAM;GACJ,MAAM,KAAK;GACX,SAAS,KAAK;GACd,MAAM,OAAO,KAAK,YAAY,OAAO,CAAC,SAAS,SAAS;GACzD,EACF;;;6CAEJ;AAEM,IAAA;;6BACe,aAAa,gBAAgB,IAAI;oCAU1B;CAQpB,SAAS,WACd,MACmB;AACnB,SAAO;GACL,MAAM,KAAK;GACX,MAAM;IACJ,MAAM,KAAK;IACX,SAAS,KAAK;IACf;GACF;;;CAGI,SAAS,WACd,MACA,YACmB;AACnB,SAAO;GACL,MAAM;GACN,MAAM;IACJ,MAAM,KAA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"description": "Backend model for Platforma.bio",
5
5
  "files": [
6
6
  "./dist/**/*",
@@ -20,14 +20,14 @@
20
20
  "dependencies": {
21
21
  "canonicalize": "~2.1.0",
22
22
  "zod": "~3.23.8",
23
- "@milaboratories/pl-client": "3.0.0"
23
+ "@milaboratories/pl-client": "3.1.0"
24
24
  },
25
25
  "devDependencies": {
26
26
  "@types/node": "~24.5.2",
27
27
  "typescript": "~5.9.3",
28
- "@milaboratories/ts-builder": "1.3.0",
29
- "@milaboratories/ts-configs": "1.2.2",
30
- "@milaboratories/build-configs": "1.5.2"
28
+ "@milaboratories/ts-configs": "1.2.3",
29
+ "@milaboratories/ts-builder": "1.3.1",
30
+ "@milaboratories/build-configs": "2.0.0"
31
31
  },
32
32
  "scripts": {
33
33
  "build": "ts-builder build --target node",