@milaboratories/milaboratories.monetization-test.model 1.0.6 → 1.0.8

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.
package/dist/index.cjs CHANGED
@@ -5,7 +5,7 @@ var model$1 = require('@platforma-sdk/model');
5
5
  const model = model$1.BlockModel.create()
6
6
  .withArgs({
7
7
  // a fake product key so our mnz client response with a fake response without changing prod db.
8
- productKey: "MIFAKEMIFAKEMIFAKE",
8
+ productKey: "PRODUCT:XTOKAYPLQDZWSPPUTFNHPAJQQZKKSPTCDOORHFJIOYICTRDA",
9
9
  inputHandles: [],
10
10
  shouldAddRunPerFile: false,
11
11
  __mnzDate: new Date().toISOString(), // It's OK
@@ -15,7 +15,12 @@ const model = model$1.BlockModel.create()
15
15
  return ctx.args.__mnzCanRun;
16
16
  })
17
17
  .output('__mnzInfo', (ctx) => ctx.prerun?.resolve('info')?.getDataAsJson())
18
- .output('token', (ctx) => ctx.outputs?.resolve('token')?.getDataAsString())
18
+ .output('tokens', (ctx) => ctx.outputs?.resolve('token')?.listInputFields().map((field) => {
19
+ return {
20
+ name: field,
21
+ value: ctx.outputs?.resolve('token', field)?.getDataAsString()
22
+ };
23
+ }))
19
24
  .output('progresses', (ctx) => {
20
25
  const m = ctx.prerun?.resolve('progresses');
21
26
  const progresses = m?.mapFields((name, val) => [name, val?.getImportProgress()]);
@@ -27,7 +32,7 @@ const model = model$1.BlockModel.create()
27
32
  return Object.fromEntries(progresses ?? []);
28
33
  })
29
34
  .sections((_) => [{ type: 'link', href: '/', label: 'Main' }])
30
- .done();
35
+ .done(2);
31
36
 
32
37
  exports.model = model;
33
38
  //# sourceMappingURL=index.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.cjs","sources":["../src/index.ts"],"sourcesContent":["import { BlockModel, ImportFileHandle, ImportProgress, InferOutputsType } from '@platforma-sdk/model';\n\nexport type Handle = {\n handle: ImportFileHandle | undefined;\n fileName: string;\n argName: string;\n options: string[];\n}\n\nexport type BlockArgs = {\n productKey: string;\n inputHandles: Handle[];\n shouldAddRunPerFile: boolean;\n __mnzDate: string;\n __mnzCanRun: boolean;\n};\n\nexport const model = BlockModel.create()\n .withArgs<BlockArgs>({\n // a fake product key so our mnz client response with a fake response without changing prod db.\n productKey: \"MIFAKEMIFAKEMIFAKE\",\n inputHandles: [],\n shouldAddRunPerFile: false,\n __mnzDate: new Date().toISOString(), // It's OK\n __mnzCanRun: false,\n })\n\n .argsValid((ctx) => {\n return ctx.args.__mnzCanRun;\n })\n\n .output('__mnzInfo', (ctx) => ctx.prerun?.resolve('info')?.getDataAsJson<unknown>())\n\n .output('token', (ctx) => ctx.outputs?.resolve('token')?.getDataAsString())\n\n .output('progresses', (ctx) => {\n const m = ctx.prerun?.resolve('progresses');\n const progresses = m?.mapFields((name, val) => [name, val?.getImportProgress()])\n return Object.fromEntries(progresses ?? []);\n })\n\n .output('mainProgresses', (ctx) => {\n const m = ctx.outputs?.resolve('progresses');\n const progresses = m?.mapFields((name, val) => [name, val?.getImportProgress()])\n return Object.fromEntries(progresses ?? []);\n })\n\n .sections((_) => [{ type: 'link', href: '/', label: 'Main' }])\n\n .done();\n\nexport type BlockOutputs = InferOutputsType<typeof model>;\n"],"names":["BlockModel"],"mappings":";;;;AAiBO,MAAM,KAAK,GAAGA,kBAAU,CAAC,MAAM;AACnC,KAAA,QAAQ,CAAY;;AAEnB,IAAA,UAAU,EAAE,oBAAoB;AAChC,IAAA,YAAY,EAAE,EAAE;AAChB,IAAA,mBAAmB,EAAE,KAAK;IAC1B,SAAS,EAAE,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE;AACnC,IAAA,WAAW,EAAE,KAAK;CACnB;AAEA,KAAA,SAAS,CAAC,CAAC,GAAG,KAAI;AACjB,IAAA,OAAO,GAAG,CAAC,IAAI,CAAC,WAAW;AAC7B,CAAC;AAEA,KAAA,MAAM,CAAC,WAAW,EAAE,CAAC,GAAG,KAAK,GAAG,CAAC,MAAM,EAA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AC;IAChF,OAAO,MAAM,CAAC,WAAW,CAAC,UAAU,IAAI,EAAE,CAAC;AAC7C,CAAC;KAEA,QAAQ,CAAC,CAAC,CAAC,KAAK,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,GAAG,EAAE,KAAK,EAAE,MAAM,EAAE,CAAC;KAE5D,IAAI,CAAC,CAAC;;;;"}
package/dist/index.d.ts CHANGED
@@ -12,11 +12,14 @@ export type BlockArgs = {
12
12
  __mnzDate: string;
13
13
  __mnzCanRun: boolean;
14
14
  };
15
- export declare const model: import('@platforma-sdk/model').PlatformaV1<BlockArgs, {
16
- __mnzInfo: import('@milaboratories/pl-model-common').ValueOrErrors<{}>;
17
- token: import('@milaboratories/pl-model-common').ValueOrErrors<string | undefined>;
18
- progresses: import('@milaboratories/pl-model-common').ValueOrErrors<any>;
19
- mainProgresses: import('@milaboratories/pl-model-common').ValueOrErrors<any>;
15
+ export declare const model: import("@platforma-sdk/model").PlatformaV2<BlockArgs, {
16
+ __mnzInfo: import("@platforma-sdk/model").ValueOrErrors<{}>;
17
+ tokens: import("@platforma-sdk/model").ValueOrErrors<{
18
+ name: string;
19
+ value: string | undefined;
20
+ }[] | undefined>;
21
+ progresses: import("@platforma-sdk/model").ValueOrErrors<any>;
22
+ mainProgresses: import("@platforma-sdk/model").ValueOrErrors<any>;
20
23
  }, {
21
24
  [x: string]: never;
22
25
  }, "/">;
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAc,gBAAgB,EAAkB,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AAEtG,MAAM,MAAM,MAAM,GAAG;IACnB,MAAM,EAAE,gBAAgB,GAAG,SAAS,CAAC;IACrC,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,EAAE,CAAC;CACnB,CAAA;AAED,MAAM,MAAM,SAAS,GAAG;IACtB,UAAU,EAAE,MAAM,CAAC;IACnB,YAAY,EAAE,MAAM,EAAE,CAAC;IACvB,mBAAmB,EAAE,OAAO,CAAC;IAC7B,SAAS,EAAE,MAAM,CAAC;IAClB,WAAW,EAAE,OAAO,CAAC;CACtB,CAAC;AAEF,eAAO,MAAM,KAAK;;;;;;;;;;OAqCR,CAAC;AAEX,MAAM,MAAM,YAAY,GAAG,gBAAgB,CAAC,OAAO,KAAK,CAAC,CAAC"}
package/dist/index.js CHANGED
@@ -3,7 +3,7 @@ import { BlockModel } from '@platforma-sdk/model';
3
3
  const model = BlockModel.create()
4
4
  .withArgs({
5
5
  // a fake product key so our mnz client response with a fake response without changing prod db.
6
- productKey: "MIFAKEMIFAKEMIFAKE",
6
+ productKey: "PRODUCT:XTOKAYPLQDZWSPPUTFNHPAJQQZKKSPTCDOORHFJIOYICTRDA",
7
7
  inputHandles: [],
8
8
  shouldAddRunPerFile: false,
9
9
  __mnzDate: new Date().toISOString(), // It's OK
@@ -13,7 +13,12 @@ const model = BlockModel.create()
13
13
  return ctx.args.__mnzCanRun;
14
14
  })
15
15
  .output('__mnzInfo', (ctx) => ctx.prerun?.resolve('info')?.getDataAsJson())
16
- .output('token', (ctx) => ctx.outputs?.resolve('token')?.getDataAsString())
16
+ .output('tokens', (ctx) => ctx.outputs?.resolve('token')?.listInputFields().map((field) => {
17
+ return {
18
+ name: field,
19
+ value: ctx.outputs?.resolve('token', field)?.getDataAsString()
20
+ };
21
+ }))
17
22
  .output('progresses', (ctx) => {
18
23
  const m = ctx.prerun?.resolve('progresses');
19
24
  const progresses = m?.mapFields((name, val) => [name, val?.getImportProgress()]);
@@ -25,7 +30,7 @@ const model = BlockModel.create()
25
30
  return Object.fromEntries(progresses ?? []);
26
31
  })
27
32
  .sections((_) => [{ type: 'link', href: '/', label: 'Main' }])
28
- .done();
33
+ .done(2);
29
34
 
30
35
  export { model };
31
36
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":["../src/index.ts"],"sourcesContent":["import { BlockModel, ImportFileHandle, ImportProgress, InferOutputsType } from '@platforma-sdk/model';\n\nexport type Handle = {\n handle: ImportFileHandle | undefined;\n fileName: string;\n argName: string;\n options: string[];\n}\n\nexport type BlockArgs = {\n productKey: string;\n inputHandles: Handle[];\n shouldAddRunPerFile: boolean;\n __mnzDate: string;\n __mnzCanRun: boolean;\n};\n\nexport const model = BlockModel.create()\n .withArgs<BlockArgs>({\n // a fake product key so our mnz client response with a fake response without changing prod db.\n productKey: \"MIFAKEMIFAKEMIFAKE\",\n inputHandles: [],\n shouldAddRunPerFile: false,\n __mnzDate: new Date().toISOString(), // It's OK\n __mnzCanRun: false,\n })\n\n .argsValid((ctx) => {\n return ctx.args.__mnzCanRun;\n })\n\n .output('__mnzInfo', (ctx) => ctx.prerun?.resolve('info')?.getDataAsJson<unknown>())\n\n .output('token', (ctx) => ctx.outputs?.resolve('token')?.getDataAsString())\n\n .output('progresses', (ctx) => {\n const m = ctx.prerun?.resolve('progresses');\n const progresses = m?.mapFields((name, val) => [name, val?.getImportProgress()])\n return Object.fromEntries(progresses ?? []);\n })\n\n .output('mainProgresses', (ctx) => {\n const m = ctx.outputs?.resolve('progresses');\n const progresses = m?.mapFields((name, val) => [name, val?.getImportProgress()])\n return Object.fromEntries(progresses ?? []);\n })\n\n .sections((_) => [{ type: 'link', href: '/', label: 'Main' }])\n\n .done();\n\nexport type BlockOutputs = InferOutputsType<typeof model>;\n"],"names":[],"mappings":";;AAiBO,MAAM,KAAK,GAAG,UAAU,CAAC,MAAM;AACnC,KAAA,QAAQ,CAAY;;AAEnB,IAAA,UAAU,EAAE,oBAAoB;AAChC,IAAA,YAAY,EAAE,EAAE;AAChB,IAAA,mBAAmB,EAAE,KAAK;IAC1B,SAAS,EAAE,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE;AACnC,IAAA,WAAW,EAAE,KAAK;CACnB;AAEA,KAAA,SAAS,CA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