@platforma-sdk/ui-vue 1.30.11 → 1.30.13

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@platforma-sdk/ui-vue",
3
- "version": "1.30.11",
3
+ "version": "1.30.13",
4
4
  "type": "module",
5
5
  "main": "dist/lib.umd.cjs",
6
6
  "module": "dist/lib.js",
@@ -45,8 +45,8 @@
45
45
  "semver": "^7.6.3",
46
46
  "@types/semver": "^7.5.8",
47
47
  "rollup-plugin-sourcemaps2": "^0.5.0",
48
- "@milaboratories/helpers": "^1.6.11",
49
- "@milaboratories/eslint-config": "^1.0.4"
48
+ "@milaboratories/eslint-config": "^1.0.4",
49
+ "@milaboratories/helpers": "^1.6.11"
50
50
  },
51
51
  "scripts": {
52
52
  "test": "vitest run --passWithNoTests",
@@ -52,14 +52,20 @@ const options = computed(() => {
52
52
 
53
53
  const statusText = computed(() => {
54
54
  switch (status.value) {
55
+ case 'active':
56
+ return '';
55
57
  case 'limits_exceeded':
56
58
  return 'Usage limits exceeded for the current billing period.';
57
59
  case 'payment_required':
58
60
  return 'Payment required to continue using the service.';
59
61
  case 'select-tariff':
60
62
  return 'Select a subscription plan in the Scientist Cabinet.';
63
+ case 'inactive':
64
+ return 'Not found billing period.';
65
+ case 'awaiting':
66
+ return 'Waiting for monetization information';
61
67
  default:
62
- return '';
68
+ return 'Unknown status: ' + status.value;
63
69
  }
64
70
  });
65
71
 
@@ -10,9 +10,11 @@ export function useInfo() {
10
10
 
11
11
  const hasMonetization = computed(() => '__mnzDate' in (app.value?.model?.args as Record<string, unknown>));
12
12
 
13
- const mnzInfo = computed(() => Response.safeParse(app.value?.model.outputs['__mnzInfo']));
13
+ const parsed = computed(() => Response.safeParse(app.value?.model.outputs['__mnzInfo']));
14
14
 
15
- const currentInfo = computed<Response | undefined>(() => mnzInfo.value?.data);
15
+ const currentInfo = computed<Response | undefined>(() => parsed.value?.data);
16
+
17
+ const error = computed(() => parsed.value?.error ?? info.value?.response?.error);
16
18
 
17
19
  const info = ref<Response | undefined>(undefined);
18
20
 
@@ -20,8 +22,6 @@ export function useInfo() {
20
22
 
21
23
  const version = ref(0);
22
24
 
23
- const error = computed(() => mnzInfo.value?.error ?? info.value?.response?.error);
24
-
25
25
  watch([currentInfo], ([i]) => {
26
26
  if (i) {
27
27
  info.value = i;
@@ -38,7 +38,7 @@ export function useInfo() {
38
38
 
39
39
  const canRun = computed(() => !!result.value?.canRun);
40
40
 
41
- const status = computed(() => result.value?.status);
41
+ const status = computed(() => currentInfo.value ? result.value?.status : 'awaiting');
42
42
 
43
43
  const customerEmail = computed(() => result.value?.customerEmail);
44
44
 
@@ -28,12 +28,7 @@ const DryRunResult = z.object({
28
28
  productName: z.string().default('Unknown product'),
29
29
  customerEmail: z.string().optional(),
30
30
  canRun: z.boolean(),
31
- status: z.union([
32
- z.literal('select-tariff'),
33
- z.literal('active'),
34
- z.literal('payment_required'),
35
- z.literal('limits_exceeded'),
36
- ]),
31
+ status: z.string(), // 'select-tariff', 'active', 'payment_required', 'limits_exceeded', 'inactive', 'unknown',
37
32
  mnz: z.object({
38
33
  type: MonetizationType.optional(),
39
34
  endOfBillingPeriod: z.string().nullable().optional(),