@milaboratories/milaboratories.monetization-test.model 1.0.33 → 1.0.35

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.
@@ -0,0 +1,7 @@
1
+ import { model } from '@platforma-sdk/eslint-config';
2
+
3
+ /** @type {import('eslint').Linter.Config[]} */
4
+ export default [
5
+ { ignores: ['*.d.ts', 'vite.config.mts', '**/dist'] },
6
+ ...model,
7
+ ];
package/package.json CHANGED
@@ -1,23 +1,26 @@
1
1
  {
2
2
  "name": "@milaboratories/milaboratories.monetization-test.model",
3
- "version": "1.0.33",
3
+ "version": "1.0.35",
4
4
  "description": "Block model",
5
5
  "type": "module",
6
6
  "main": "dist/index.cjs",
7
7
  "module": "dist/index.js",
8
8
  "types": "dist/index.d.ts",
9
9
  "dependencies": {
10
- "@platforma-sdk/model": "1.46.0"
10
+ "@platforma-sdk/model": "1.47.5"
11
11
  },
12
12
  "devDependencies": {
13
+ "eslint": "^9.25.1",
13
14
  "typescript": "~5.6.3",
14
- "@platforma-sdk/block-tools": "2.6.25",
15
- "@milaboratories/ts-builder": "1.0.5",
16
- "@milaboratories/ts-configs": "1.0.6",
17
- "@milaboratories/build-configs": "1.0.8"
15
+ "@platforma-sdk/block-tools": "2.6.27",
16
+ "@platforma-sdk/eslint-config": "1.2.0",
17
+ "@milaboratories/ts-builder": "1.2.0",
18
+ "@milaboratories/build-configs": "1.2.0",
19
+ "@milaboratories/ts-configs": "1.2.0"
18
20
  },
19
21
  "scripts": {
20
22
  "build": "ts-builder build --target block-model && block-tools build-model",
21
- "type-check": "ts-builder types --target block-model"
23
+ "type-check": "ts-builder types --target block-model",
24
+ "lint": "eslint ."
22
25
  }
23
26
  }
package/src/index.ts CHANGED
@@ -1,11 +1,12 @@
1
- import { BlockModel, ImportFileHandle, ImportProgress, InferOutputsType } from '@platforma-sdk/model';
1
+ import type { ImportFileHandle, InferOutputsType } from '@platforma-sdk/model';
2
+ import { BlockModel } from '@platforma-sdk/model';
2
3
 
3
4
  export type Handle = {
4
5
  handle: ImportFileHandle | undefined;
5
6
  fileName: string;
6
7
  argName: string;
7
8
  options: string[];
8
- }
9
+ };
9
10
 
10
11
  export type BlockArgs = {
11
12
  productKey: string;
@@ -18,7 +19,7 @@ export type BlockArgs = {
18
19
  export const model = BlockModel.create()
19
20
  .withArgs<BlockArgs>({
20
21
  // a fake product key so our mnz client response with a fake response without changing prod db.
21
- productKey: "PRODUCT:XTOKAYPLQDZWSPPUTFNHPAJQQZKKSPTCDOORHFJIOYICTRDA",
22
+ productKey: 'PRODUCT:XTOKAYPLQDZWSPPUTFNHPAJQQZKKSPTCDOORHFJIOYICTRDA',
22
23
  inputHandles: [],
23
24
  shouldAddRunPerFile: false,
24
25
  __mnzDate: new Date().toISOString(), // It's OK
@@ -30,24 +31,24 @@ export const model = BlockModel.create()
30
31
  })
31
32
 
32
33
  .output('__mnzInfo', (ctx) => ctx.prerun?.resolve('info')?.getDataAsJson<unknown>())
33
-
34
- .output('tokens', (ctx) => ctx.outputs?.resolve('token')?.listInputFields().map((field) => {
34
+
35
+ .output('tokens', (ctx) => ctx.outputs?.resolve('token')?.listInputFields().map((field) => {
35
36
  return {
36
37
  name: field,
37
- value: ctx.outputs?.resolve('token', field)?.getDataAsString()
38
- }
38
+ value: ctx.outputs?.resolve('token', field)?.getDataAsString(),
39
+ };
39
40
  }))
40
41
 
41
42
  .output('progresses', (ctx) => {
42
43
  const m = ctx.prerun?.resolve('progresses');
43
- const progresses = m?.mapFields((name, val) => [name, val?.getImportProgress()])
44
- return Object.fromEntries(progresses ?? []);
44
+ const progresses = m?.mapFields((name, val) => [name, val?.getImportProgress()]);
45
+ return Object.fromEntries(progresses ?? []) as Record<string, unknown>;
45
46
  })
46
47
 
47
48
  .output('mainProgresses', (ctx) => {
48
49
  const m = ctx.outputs?.resolve('progresses');
49
- const progresses = m?.mapFields((name, val) => [name, val?.getImportProgress()])
50
- return Object.fromEntries(progresses ?? []);
50
+ const progresses = m?.mapFields((name, val) => [name, val?.getImportProgress()]);
51
+ return Object.fromEntries(progresses ?? []) as Record<string, unknown>;
51
52
  })
52
53
 
53
54
  .sections((_) => [{ type: 'link', href: '/', label: 'Main' }])
package/tsconfig.json CHANGED
@@ -1,17 +1,10 @@
1
1
  {
2
+ "extends": "@milaboratories/ts-configs/block/model",
2
3
  "compilerOptions": {
3
- "target": "ES2022",
4
- "module": "ESNext",
5
- "lib": ["ESNext"],
6
- "moduleResolution": "node",
7
- "esModuleInterop": true,
8
- "strict": true,
9
- "outDir": "./dist",
10
- "rootDir": "./src",
11
- "sourceMap": true,
12
- "declaration": true
4
+ "outDir": "dist",
5
+ "rootDir": "src",
6
+ "types": ["node"]
13
7
  },
14
- "types": [],
15
8
  "include": ["src/**/*"],
16
9
  "exclude": ["node_modules", "dist"]
17
10
  }