@getpara/shared 1.29.0 → 1.30.0
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/cjs/index.js +1 -0
- package/dist/cjs/schemas/permissionsV2.js +577 -6
- package/dist/cjs/schemas/permissionsV2UserParameters.js +85 -0
- package/dist/esm/index.js +1 -0
- package/dist/esm/schemas/permissionsV2.js +575 -5
- package/dist/esm/schemas/permissionsV2UserParameters.js +82 -0
- package/dist/types/index.d.ts +1 -0
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/schemas/permissionsV2.d.ts +12646 -503
- package/dist/types/schemas/permissionsV2.d.ts.map +1 -1
- package/dist/types/schemas/permissionsV2UserParameters.d.ts +468 -0
- package/dist/types/schemas/permissionsV2UserParameters.d.ts.map +1 -0
- package/dist/types/types/partner.d.ts +2 -0
- package/dist/types/types/partner.d.ts.map +1 -1
- package/dist/types/types/pending-transaction.d.ts +2 -0
- package/dist/types/types/pending-transaction.d.ts.map +1 -1
- package/dist/types/types/permissions.d.ts +25 -2
- package/dist/types/types/permissions.d.ts.map +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.permissionsV2UserParameterHistorySchema = exports.permissionsV2UserParameterViewSchema = exports.permissionsV2UserParameterReadyViewSchema = exports.permissionsV2UserParameterResetSchema = exports.permissionsV2UserParameterSaveSchema = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const templateRevisionFields = {
|
|
6
|
+
policyVersion: zod_1.z.string().min(1),
|
|
7
|
+
policyHash: zod_1.z.string().min(1),
|
|
8
|
+
expectedRevision: zod_1.z.number().int().nonnegative().max(Number.MAX_SAFE_INTEGER),
|
|
9
|
+
};
|
|
10
|
+
exports.permissionsV2UserParameterSaveSchema = zod_1.z
|
|
11
|
+
.object({
|
|
12
|
+
...templateRevisionFields,
|
|
13
|
+
values: zod_1.z.record(zod_1.z.string()),
|
|
14
|
+
})
|
|
15
|
+
.strict();
|
|
16
|
+
exports.permissionsV2UserParameterResetSchema = zod_1.z.object(templateRevisionFields).strict();
|
|
17
|
+
const storedRevision = zod_1.z.number().int().positive().max(Number.MAX_SAFE_INTEGER);
|
|
18
|
+
const provenance = zod_1.z.enum(['default', 'personal']);
|
|
19
|
+
const parameterDescriptor = zod_1.z
|
|
20
|
+
.object({
|
|
21
|
+
id: zod_1.z.string().min(1),
|
|
22
|
+
label: zod_1.z.string().min(1),
|
|
23
|
+
defaultValue: zod_1.z.string(),
|
|
24
|
+
fact: zod_1.z.string().min(1),
|
|
25
|
+
asset: zod_1.z.string().optional(),
|
|
26
|
+
window: zod_1.z.string().optional(),
|
|
27
|
+
})
|
|
28
|
+
.strict();
|
|
29
|
+
const viewFields = {
|
|
30
|
+
userId: zod_1.z.string().min(1),
|
|
31
|
+
partnerId: zod_1.z.string().min(1),
|
|
32
|
+
appId: zod_1.z.string().min(1),
|
|
33
|
+
policyId: zod_1.z.string().min(1),
|
|
34
|
+
policyVersion: zod_1.z.string().min(1),
|
|
35
|
+
policyHash: zod_1.z.string().min(1),
|
|
36
|
+
parameters: zod_1.z.array(parameterDescriptor),
|
|
37
|
+
};
|
|
38
|
+
exports.permissionsV2UserParameterReadyViewSchema = zod_1.z.union([
|
|
39
|
+
zod_1.z
|
|
40
|
+
.object({
|
|
41
|
+
...viewFields,
|
|
42
|
+
status: zod_1.z.literal('ready'),
|
|
43
|
+
revision: zod_1.z.literal(0),
|
|
44
|
+
provenance: zod_1.z.literal('default'),
|
|
45
|
+
values: zod_1.z.record(zod_1.z.string()),
|
|
46
|
+
})
|
|
47
|
+
.strict(),
|
|
48
|
+
zod_1.z
|
|
49
|
+
.object({
|
|
50
|
+
...viewFields,
|
|
51
|
+
status: zod_1.z.literal('ready'),
|
|
52
|
+
revision: storedRevision,
|
|
53
|
+
provenance,
|
|
54
|
+
values: zod_1.z.record(zod_1.z.string()),
|
|
55
|
+
configurationHash: zod_1.z.string().min(1),
|
|
56
|
+
})
|
|
57
|
+
.strict(),
|
|
58
|
+
]);
|
|
59
|
+
exports.permissionsV2UserParameterViewSchema = zod_1.z.union([
|
|
60
|
+
exports.permissionsV2UserParameterReadyViewSchema,
|
|
61
|
+
zod_1.z
|
|
62
|
+
.object({
|
|
63
|
+
...viewFields,
|
|
64
|
+
status: zod_1.z.literal('needs_confirmation'),
|
|
65
|
+
revision: storedRevision,
|
|
66
|
+
provenance,
|
|
67
|
+
previousValues: zod_1.z.record(zod_1.z.string()),
|
|
68
|
+
})
|
|
69
|
+
.strict(),
|
|
70
|
+
]);
|
|
71
|
+
exports.permissionsV2UserParameterHistorySchema = zod_1.z
|
|
72
|
+
.object({
|
|
73
|
+
revisions: zod_1.z.array(zod_1.z
|
|
74
|
+
.object({
|
|
75
|
+
policyVersion: zod_1.z.string().min(1),
|
|
76
|
+
policyHash: zod_1.z.string().min(1),
|
|
77
|
+
revision: storedRevision,
|
|
78
|
+
provenance,
|
|
79
|
+
values: zod_1.z.record(zod_1.z.string()),
|
|
80
|
+
changedAt: zod_1.z.string().datetime(),
|
|
81
|
+
})
|
|
82
|
+
.strict()),
|
|
83
|
+
nextBeforeRevision: storedRevision.optional(),
|
|
84
|
+
})
|
|
85
|
+
.strict();
|
package/dist/esm/index.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
export * from './types/index.js';
|
|
2
2
|
export * from './types/permissions.js';
|
|
3
3
|
export * from './schemas/permissionsV2.js';
|
|
4
|
+
export * from './schemas/permissionsV2UserParameters.js';
|
|
4
5
|
export * from './utils/index.js';
|
|
5
6
|
import * as transactionTypes from './types/transaction.js';
|
|
6
7
|
export { transactionTypes };
|