@getpara/shared 1.24.0 → 1.25.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 +2 -0
- package/dist/cjs/schemas/permissionsV2.js +188 -0
- package/dist/cjs/types/auth.js +4 -0
- package/dist/cjs/types/index.js +1 -0
- package/dist/cjs/types/permissions.js +2 -0
- package/dist/esm/index.js +2 -0
- package/dist/esm/schemas/permissionsV2.js +185 -0
- package/dist/esm/types/auth.js +4 -0
- package/dist/esm/types/index.js +1 -0
- package/dist/esm/types/permissions.js +1 -0
- package/dist/types/index.d.ts +2 -0
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/schemas/permissionsV2.d.ts +1642 -0
- package/dist/types/schemas/permissionsV2.d.ts.map +1 -0
- package/dist/types/types/auth.d.ts +2 -2
- package/dist/types/types/auth.d.ts.map +1 -1
- package/dist/types/types/authState.d.ts +11 -0
- package/dist/types/types/authState.d.ts.map +1 -1
- package/dist/types/types/index.d.ts +1 -0
- package/dist/types/types/index.d.ts.map +1 -1
- package/dist/types/types/partner.d.ts +1 -0
- package/dist/types/types/partner.d.ts.map +1 -1
- package/dist/types/types/permissions.d.ts +96 -0
- package/dist/types/types/permissions.d.ts.map +1 -0
- package/package.json +4 -1
package/dist/cjs/index.js
CHANGED
|
@@ -38,6 +38,8 @@ var __importStar = (this && this.__importStar) || (function () {
|
|
|
38
38
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
39
|
exports.transactionTypes = void 0;
|
|
40
40
|
__exportStar(require("./types/index.js"), exports);
|
|
41
|
+
__exportStar(require("./types/permissions.js"), exports);
|
|
42
|
+
__exportStar(require("./schemas/permissionsV2.js"), exports);
|
|
41
43
|
__exportStar(require("./utils/index.js"), exports);
|
|
42
44
|
const transactionTypes = __importStar(require("./types/transaction.js"));
|
|
43
45
|
exports.transactionTypes = transactionTypes;
|
|
@@ -0,0 +1,188 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.permissionsV2ValidationErrorSchema = exports.permissionsV2DelegationConsentDiscoveryResponseSchema = exports.permissionsV2DelegationConsentRequestSchema = exports.permissionsV2DelegationConsentViewSchema = exports.permissionsV2DelegationConsentStandingMutationSchema = exports.permissionsV2DelegationConsentMutationSchema = exports.permissionsV2DelegationConsentApiStatusSchema = exports.permissionsV2DelegationPolicyDefinitionSchema = exports.permissionsV2PartnerAuthoredPolicyDefinitionSchema = exports.permissionsV2PartnerPolicyCandidateSchema = exports.permissionsV2PolicyRuleSchema = exports.permissionsV2PartnerPolicyMetadataSchema = exports.permissionsV2PolicyMetadataSchema = exports.permissionsV2PartnerAuthoredPolicySelectorSchema = exports.permissionsV2ConditionSchema = exports.policyAuthoringJsonObjectSchema = exports.policyAuthoringJsonValueSchema = exports.policyAuthoringJsonPrimitiveSchema = exports.permissionsV2SigningRequestTypeSchema = exports.permissionsV2SigningRequestRouteSchema = exports.permissionsV2SigningWalletTypeSchema = exports.permissionsV2AggregateOperatorSchema = exports.permissionsV2CompareOperatorSchema = exports.permissionsV2PolicyEffectSchema = exports.permissionsV2PolicyModeSchema = exports.permissionsV2PolicyLayerSchema = exports.permissionsV2SigningRequestTypes = exports.policyAuthoringSigningRequestRoutes = exports.policyAuthoringSigningWalletTypes = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
exports.policyAuthoringSigningWalletTypes = ['EVM'];
|
|
6
|
+
exports.policyAuthoringSigningRequestRoutes = [
|
|
7
|
+
'evm.sign_transaction',
|
|
8
|
+
'evm.sign_raw',
|
|
9
|
+
'evm.sign_typed_data',
|
|
10
|
+
'evm.sign_authorization',
|
|
11
|
+
'evm.sign_message',
|
|
12
|
+
'smart_account.user_operation',
|
|
13
|
+
];
|
|
14
|
+
exports.permissionsV2SigningRequestTypes = [
|
|
15
|
+
'evm_transaction',
|
|
16
|
+
'evm_message',
|
|
17
|
+
'evm_raw',
|
|
18
|
+
'evm_typed_data',
|
|
19
|
+
'evm_authorization',
|
|
20
|
+
'smart_account_user_operation',
|
|
21
|
+
];
|
|
22
|
+
const nonEmptyStringSchema = zod_1.z.string().min(1);
|
|
23
|
+
const uniqueNonEmptyStringsSchema = zod_1.z
|
|
24
|
+
.array(nonEmptyStringSchema)
|
|
25
|
+
.min(1)
|
|
26
|
+
.refine((values) => new Set(values).size === values.length, 'values must be unique');
|
|
27
|
+
exports.permissionsV2PolicyLayerSchema = zod_1.z.enum(['para', 'partner']);
|
|
28
|
+
exports.permissionsV2PolicyModeSchema = zod_1.z.enum(['guardrail', 'delegation']);
|
|
29
|
+
exports.permissionsV2PolicyEffectSchema = zod_1.z.enum(['allow', 'deny', 'require_approval']);
|
|
30
|
+
exports.permissionsV2CompareOperatorSchema = zod_1.z.enum(['eq', 'ne', 'lt', 'lte', 'gt', 'gte', 'in']);
|
|
31
|
+
exports.permissionsV2AggregateOperatorSchema = zod_1.z.enum(['lt', 'lte', 'gt', 'gte']);
|
|
32
|
+
exports.permissionsV2SigningWalletTypeSchema = zod_1.z.enum(exports.policyAuthoringSigningWalletTypes);
|
|
33
|
+
exports.permissionsV2SigningRequestRouteSchema = zod_1.z.enum(exports.policyAuthoringSigningRequestRoutes);
|
|
34
|
+
exports.permissionsV2SigningRequestTypeSchema = zod_1.z.enum(exports.permissionsV2SigningRequestTypes);
|
|
35
|
+
exports.policyAuthoringJsonPrimitiveSchema = zod_1.z.union([
|
|
36
|
+
zod_1.z.string(),
|
|
37
|
+
zod_1.z.number(),
|
|
38
|
+
zod_1.z.boolean(),
|
|
39
|
+
zod_1.z.null(),
|
|
40
|
+
]);
|
|
41
|
+
exports.policyAuthoringJsonValueSchema = zod_1.z.lazy(() => zod_1.z.union([
|
|
42
|
+
exports.policyAuthoringJsonPrimitiveSchema,
|
|
43
|
+
zod_1.z.array(exports.policyAuthoringJsonValueSchema),
|
|
44
|
+
zod_1.z.record(exports.policyAuthoringJsonValueSchema),
|
|
45
|
+
]));
|
|
46
|
+
exports.policyAuthoringJsonObjectSchema = zod_1.z.record(exports.policyAuthoringJsonValueSchema);
|
|
47
|
+
exports.permissionsV2ConditionSchema = zod_1.z.lazy(() => zod_1.z.discriminatedUnion('kind', [
|
|
48
|
+
zod_1.z
|
|
49
|
+
.object({
|
|
50
|
+
kind: zod_1.z.literal('compare'),
|
|
51
|
+
fact: nonEmptyStringSchema,
|
|
52
|
+
op: exports.permissionsV2CompareOperatorSchema,
|
|
53
|
+
value: exports.policyAuthoringJsonValueSchema,
|
|
54
|
+
})
|
|
55
|
+
.strict(),
|
|
56
|
+
zod_1.z
|
|
57
|
+
.object({
|
|
58
|
+
kind: zod_1.z.literal('aggregate'),
|
|
59
|
+
fact: nonEmptyStringSchema,
|
|
60
|
+
op: exports.permissionsV2AggregateOperatorSchema,
|
|
61
|
+
value: nonEmptyStringSchema,
|
|
62
|
+
window: nonEmptyStringSchema,
|
|
63
|
+
asset: nonEmptyStringSchema.optional(),
|
|
64
|
+
})
|
|
65
|
+
.strict(),
|
|
66
|
+
zod_1.z
|
|
67
|
+
.object({
|
|
68
|
+
kind: zod_1.z.literal('all'),
|
|
69
|
+
of: zod_1.z.array(exports.permissionsV2ConditionSchema).min(1),
|
|
70
|
+
})
|
|
71
|
+
.strict(),
|
|
72
|
+
zod_1.z
|
|
73
|
+
.object({
|
|
74
|
+
kind: zod_1.z.literal('any'),
|
|
75
|
+
of: zod_1.z.array(exports.permissionsV2ConditionSchema).min(1),
|
|
76
|
+
})
|
|
77
|
+
.strict(),
|
|
78
|
+
zod_1.z
|
|
79
|
+
.object({
|
|
80
|
+
kind: zod_1.z.literal('not'),
|
|
81
|
+
of: exports.permissionsV2ConditionSchema,
|
|
82
|
+
})
|
|
83
|
+
.strict(),
|
|
84
|
+
]));
|
|
85
|
+
exports.permissionsV2PartnerAuthoredPolicySelectorSchema = zod_1.z
|
|
86
|
+
.object({
|
|
87
|
+
walletId: nonEmptyStringSchema.optional(),
|
|
88
|
+
chainId: zod_1.z.union([nonEmptyStringSchema, uniqueNonEmptyStringsSchema]).optional(),
|
|
89
|
+
walletType: exports.permissionsV2SigningWalletTypeSchema.optional(),
|
|
90
|
+
requestRoute: exports.permissionsV2SigningRequestRouteSchema.optional(),
|
|
91
|
+
requestType: exports.permissionsV2SigningRequestTypeSchema.optional(),
|
|
92
|
+
})
|
|
93
|
+
.strict();
|
|
94
|
+
exports.permissionsV2PolicyMetadataSchema = zod_1.z
|
|
95
|
+
.object({
|
|
96
|
+
label: zod_1.z.string().optional(),
|
|
97
|
+
productMode: exports.permissionsV2PolicyModeSchema.optional(),
|
|
98
|
+
description: zod_1.z.string().optional(),
|
|
99
|
+
annotations: exports.policyAuthoringJsonObjectSchema.optional(),
|
|
100
|
+
})
|
|
101
|
+
.strict();
|
|
102
|
+
exports.permissionsV2PartnerPolicyMetadataSchema = exports.permissionsV2PolicyMetadataSchema.extend({
|
|
103
|
+
productMode: exports.permissionsV2PolicyModeSchema,
|
|
104
|
+
});
|
|
105
|
+
exports.permissionsV2PolicyRuleSchema = zod_1.z
|
|
106
|
+
.object({
|
|
107
|
+
id: nonEmptyStringSchema,
|
|
108
|
+
effect: exports.permissionsV2PolicyEffectSchema,
|
|
109
|
+
when: exports.permissionsV2ConditionSchema,
|
|
110
|
+
})
|
|
111
|
+
.strict();
|
|
112
|
+
const partnerPolicyCandidateFields = {
|
|
113
|
+
id: nonEmptyStringSchema,
|
|
114
|
+
schemaVersion: zod_1.z.literal('permissions.policy.v1'),
|
|
115
|
+
version: nonEmptyStringSchema,
|
|
116
|
+
selector: exports.permissionsV2PartnerAuthoredPolicySelectorSchema,
|
|
117
|
+
rules: zod_1.z.array(exports.permissionsV2PolicyRuleSchema).min(1),
|
|
118
|
+
metadata: exports.permissionsV2PolicyMetadataSchema.optional(),
|
|
119
|
+
};
|
|
120
|
+
exports.permissionsV2PartnerPolicyCandidateSchema = zod_1.z.object(partnerPolicyCandidateFields).strict();
|
|
121
|
+
exports.permissionsV2PartnerAuthoredPolicyDefinitionSchema = exports.permissionsV2PartnerPolicyCandidateSchema.extend({
|
|
122
|
+
metadata: exports.permissionsV2PartnerPolicyMetadataSchema,
|
|
123
|
+
});
|
|
124
|
+
exports.permissionsV2DelegationPolicyDefinitionSchema = exports.permissionsV2PartnerAuthoredPolicyDefinitionSchema.extend({
|
|
125
|
+
layer: zod_1.z.literal('partner'),
|
|
126
|
+
selector: exports.permissionsV2PartnerAuthoredPolicySelectorSchema.extend({
|
|
127
|
+
partnerId: nonEmptyStringSchema,
|
|
128
|
+
appId: nonEmptyStringSchema,
|
|
129
|
+
}),
|
|
130
|
+
metadata: exports.permissionsV2PartnerPolicyMetadataSchema.extend({
|
|
131
|
+
productMode: zod_1.z.literal('delegation'),
|
|
132
|
+
}),
|
|
133
|
+
});
|
|
134
|
+
exports.permissionsV2DelegationConsentApiStatusSchema = zod_1.z.enum([
|
|
135
|
+
'pending',
|
|
136
|
+
'standing',
|
|
137
|
+
'manual_review',
|
|
138
|
+
'revoked',
|
|
139
|
+
'expired',
|
|
140
|
+
]);
|
|
141
|
+
exports.permissionsV2DelegationConsentMutationSchema = zod_1.z
|
|
142
|
+
.object({
|
|
143
|
+
partnerId: nonEmptyStringSchema,
|
|
144
|
+
appId: nonEmptyStringSchema,
|
|
145
|
+
walletId: nonEmptyStringSchema,
|
|
146
|
+
policyVersion: nonEmptyStringSchema,
|
|
147
|
+
policyHash: nonEmptyStringSchema,
|
|
148
|
+
expiresAt: zod_1.z.string().datetime().optional(),
|
|
149
|
+
})
|
|
150
|
+
.strict();
|
|
151
|
+
exports.permissionsV2DelegationConsentStandingMutationSchema = exports.permissionsV2DelegationConsentMutationSchema
|
|
152
|
+
.extend({
|
|
153
|
+
pendingTransactionId: nonEmptyStringSchema,
|
|
154
|
+
})
|
|
155
|
+
.strict();
|
|
156
|
+
exports.permissionsV2DelegationConsentViewSchema = zod_1.z
|
|
157
|
+
.object({
|
|
158
|
+
status: exports.permissionsV2DelegationConsentApiStatusSchema,
|
|
159
|
+
userId: nonEmptyStringSchema,
|
|
160
|
+
partnerId: nonEmptyStringSchema,
|
|
161
|
+
appId: nonEmptyStringSchema,
|
|
162
|
+
walletId: nonEmptyStringSchema,
|
|
163
|
+
policyId: nonEmptyStringSchema,
|
|
164
|
+
policyVersion: nonEmptyStringSchema,
|
|
165
|
+
policyHash: nonEmptyStringSchema,
|
|
166
|
+
grantedAt: zod_1.z.string().datetime().optional(),
|
|
167
|
+
expiresAt: zod_1.z.string().datetime().optional(),
|
|
168
|
+
revokedAt: zod_1.z.string().datetime().optional(),
|
|
169
|
+
})
|
|
170
|
+
.strict();
|
|
171
|
+
exports.permissionsV2DelegationConsentRequestSchema = zod_1.z
|
|
172
|
+
.object({
|
|
173
|
+
policy: exports.permissionsV2DelegationPolicyDefinitionSchema,
|
|
174
|
+
consent: exports.permissionsV2DelegationConsentViewSchema,
|
|
175
|
+
})
|
|
176
|
+
.strict();
|
|
177
|
+
exports.permissionsV2DelegationConsentDiscoveryResponseSchema = zod_1.z
|
|
178
|
+
.object({
|
|
179
|
+
requests: zod_1.z.array(exports.permissionsV2DelegationConsentRequestSchema),
|
|
180
|
+
})
|
|
181
|
+
.strict();
|
|
182
|
+
exports.permissionsV2ValidationErrorSchema = zod_1.z
|
|
183
|
+
.object({
|
|
184
|
+
code: zod_1.z.string(),
|
|
185
|
+
path: zod_1.z.string(),
|
|
186
|
+
message: zod_1.z.string(),
|
|
187
|
+
})
|
|
188
|
+
.strict();
|
package/dist/cjs/types/auth.js
CHANGED
|
@@ -57,6 +57,10 @@ exports.OAUTH_METHODS = [
|
|
|
57
57
|
'FARCASTER',
|
|
58
58
|
'TELEGRAM',
|
|
59
59
|
'CUSTOM_OIDC',
|
|
60
|
+
// A partner-configured OAuth2 provider Para ships no first-party adapter for (e.g. Spotify). The specific
|
|
61
|
+
// connection rides on the flow's providerConfigHandle; the generic OAuth2 client uses the connection's
|
|
62
|
+
// stored endpoints. (ENG-7008)
|
|
63
|
+
'CUSTOM_OAUTH',
|
|
60
64
|
];
|
|
61
65
|
exports.LINKED_ACCOUNT_TYPES = [
|
|
62
66
|
'EMAIL',
|
package/dist/cjs/types/index.js
CHANGED
|
@@ -24,6 +24,7 @@ __exportStar(require("./params.js"), exports);
|
|
|
24
24
|
__exportStar(require("./partner.js"), exports);
|
|
25
25
|
__exportStar(require("./partnerAppConfig.js"), exports);
|
|
26
26
|
__exportStar(require("./pending-transaction.js"), exports);
|
|
27
|
+
__exportStar(require("./permissions.js"), exports);
|
|
27
28
|
__exportStar(require("./signing.js"), exports);
|
|
28
29
|
__exportStar(require("./theme.js"), exports);
|
|
29
30
|
__exportStar(require("./transaction.js"), exports);
|
package/dist/esm/index.js
CHANGED
|
@@ -0,0 +1,185 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export const policyAuthoringSigningWalletTypes = ['EVM'];
|
|
3
|
+
export const policyAuthoringSigningRequestRoutes = [
|
|
4
|
+
'evm.sign_transaction',
|
|
5
|
+
'evm.sign_raw',
|
|
6
|
+
'evm.sign_typed_data',
|
|
7
|
+
'evm.sign_authorization',
|
|
8
|
+
'evm.sign_message',
|
|
9
|
+
'smart_account.user_operation',
|
|
10
|
+
];
|
|
11
|
+
export const permissionsV2SigningRequestTypes = [
|
|
12
|
+
'evm_transaction',
|
|
13
|
+
'evm_message',
|
|
14
|
+
'evm_raw',
|
|
15
|
+
'evm_typed_data',
|
|
16
|
+
'evm_authorization',
|
|
17
|
+
'smart_account_user_operation',
|
|
18
|
+
];
|
|
19
|
+
const nonEmptyStringSchema = z.string().min(1);
|
|
20
|
+
const uniqueNonEmptyStringsSchema = z
|
|
21
|
+
.array(nonEmptyStringSchema)
|
|
22
|
+
.min(1)
|
|
23
|
+
.refine((values) => new Set(values).size === values.length, 'values must be unique');
|
|
24
|
+
export const permissionsV2PolicyLayerSchema = z.enum(['para', 'partner']);
|
|
25
|
+
export const permissionsV2PolicyModeSchema = z.enum(['guardrail', 'delegation']);
|
|
26
|
+
export const permissionsV2PolicyEffectSchema = z.enum(['allow', 'deny', 'require_approval']);
|
|
27
|
+
export const permissionsV2CompareOperatorSchema = z.enum(['eq', 'ne', 'lt', 'lte', 'gt', 'gte', 'in']);
|
|
28
|
+
export const permissionsV2AggregateOperatorSchema = z.enum(['lt', 'lte', 'gt', 'gte']);
|
|
29
|
+
export const permissionsV2SigningWalletTypeSchema = z.enum(policyAuthoringSigningWalletTypes);
|
|
30
|
+
export const permissionsV2SigningRequestRouteSchema = z.enum(policyAuthoringSigningRequestRoutes);
|
|
31
|
+
export const permissionsV2SigningRequestTypeSchema = z.enum(permissionsV2SigningRequestTypes);
|
|
32
|
+
export const policyAuthoringJsonPrimitiveSchema = z.union([
|
|
33
|
+
z.string(),
|
|
34
|
+
z.number(),
|
|
35
|
+
z.boolean(),
|
|
36
|
+
z.null(),
|
|
37
|
+
]);
|
|
38
|
+
export const policyAuthoringJsonValueSchema = z.lazy(() => z.union([
|
|
39
|
+
policyAuthoringJsonPrimitiveSchema,
|
|
40
|
+
z.array(policyAuthoringJsonValueSchema),
|
|
41
|
+
z.record(policyAuthoringJsonValueSchema),
|
|
42
|
+
]));
|
|
43
|
+
export const policyAuthoringJsonObjectSchema = z.record(policyAuthoringJsonValueSchema);
|
|
44
|
+
export const permissionsV2ConditionSchema = z.lazy(() => z.discriminatedUnion('kind', [
|
|
45
|
+
z
|
|
46
|
+
.object({
|
|
47
|
+
kind: z.literal('compare'),
|
|
48
|
+
fact: nonEmptyStringSchema,
|
|
49
|
+
op: permissionsV2CompareOperatorSchema,
|
|
50
|
+
value: policyAuthoringJsonValueSchema,
|
|
51
|
+
})
|
|
52
|
+
.strict(),
|
|
53
|
+
z
|
|
54
|
+
.object({
|
|
55
|
+
kind: z.literal('aggregate'),
|
|
56
|
+
fact: nonEmptyStringSchema,
|
|
57
|
+
op: permissionsV2AggregateOperatorSchema,
|
|
58
|
+
value: nonEmptyStringSchema,
|
|
59
|
+
window: nonEmptyStringSchema,
|
|
60
|
+
asset: nonEmptyStringSchema.optional(),
|
|
61
|
+
})
|
|
62
|
+
.strict(),
|
|
63
|
+
z
|
|
64
|
+
.object({
|
|
65
|
+
kind: z.literal('all'),
|
|
66
|
+
of: z.array(permissionsV2ConditionSchema).min(1),
|
|
67
|
+
})
|
|
68
|
+
.strict(),
|
|
69
|
+
z
|
|
70
|
+
.object({
|
|
71
|
+
kind: z.literal('any'),
|
|
72
|
+
of: z.array(permissionsV2ConditionSchema).min(1),
|
|
73
|
+
})
|
|
74
|
+
.strict(),
|
|
75
|
+
z
|
|
76
|
+
.object({
|
|
77
|
+
kind: z.literal('not'),
|
|
78
|
+
of: permissionsV2ConditionSchema,
|
|
79
|
+
})
|
|
80
|
+
.strict(),
|
|
81
|
+
]));
|
|
82
|
+
export const permissionsV2PartnerAuthoredPolicySelectorSchema = z
|
|
83
|
+
.object({
|
|
84
|
+
walletId: nonEmptyStringSchema.optional(),
|
|
85
|
+
chainId: z.union([nonEmptyStringSchema, uniqueNonEmptyStringsSchema]).optional(),
|
|
86
|
+
walletType: permissionsV2SigningWalletTypeSchema.optional(),
|
|
87
|
+
requestRoute: permissionsV2SigningRequestRouteSchema.optional(),
|
|
88
|
+
requestType: permissionsV2SigningRequestTypeSchema.optional(),
|
|
89
|
+
})
|
|
90
|
+
.strict();
|
|
91
|
+
export const permissionsV2PolicyMetadataSchema = z
|
|
92
|
+
.object({
|
|
93
|
+
label: z.string().optional(),
|
|
94
|
+
productMode: permissionsV2PolicyModeSchema.optional(),
|
|
95
|
+
description: z.string().optional(),
|
|
96
|
+
annotations: policyAuthoringJsonObjectSchema.optional(),
|
|
97
|
+
})
|
|
98
|
+
.strict();
|
|
99
|
+
export const permissionsV2PartnerPolicyMetadataSchema = permissionsV2PolicyMetadataSchema.extend({
|
|
100
|
+
productMode: permissionsV2PolicyModeSchema,
|
|
101
|
+
});
|
|
102
|
+
export const permissionsV2PolicyRuleSchema = z
|
|
103
|
+
.object({
|
|
104
|
+
id: nonEmptyStringSchema,
|
|
105
|
+
effect: permissionsV2PolicyEffectSchema,
|
|
106
|
+
when: permissionsV2ConditionSchema,
|
|
107
|
+
})
|
|
108
|
+
.strict();
|
|
109
|
+
const partnerPolicyCandidateFields = {
|
|
110
|
+
id: nonEmptyStringSchema,
|
|
111
|
+
schemaVersion: z.literal('permissions.policy.v1'),
|
|
112
|
+
version: nonEmptyStringSchema,
|
|
113
|
+
selector: permissionsV2PartnerAuthoredPolicySelectorSchema,
|
|
114
|
+
rules: z.array(permissionsV2PolicyRuleSchema).min(1),
|
|
115
|
+
metadata: permissionsV2PolicyMetadataSchema.optional(),
|
|
116
|
+
};
|
|
117
|
+
export const permissionsV2PartnerPolicyCandidateSchema = z.object(partnerPolicyCandidateFields).strict();
|
|
118
|
+
export const permissionsV2PartnerAuthoredPolicyDefinitionSchema = permissionsV2PartnerPolicyCandidateSchema.extend({
|
|
119
|
+
metadata: permissionsV2PartnerPolicyMetadataSchema,
|
|
120
|
+
});
|
|
121
|
+
export const permissionsV2DelegationPolicyDefinitionSchema = permissionsV2PartnerAuthoredPolicyDefinitionSchema.extend({
|
|
122
|
+
layer: z.literal('partner'),
|
|
123
|
+
selector: permissionsV2PartnerAuthoredPolicySelectorSchema.extend({
|
|
124
|
+
partnerId: nonEmptyStringSchema,
|
|
125
|
+
appId: nonEmptyStringSchema,
|
|
126
|
+
}),
|
|
127
|
+
metadata: permissionsV2PartnerPolicyMetadataSchema.extend({
|
|
128
|
+
productMode: z.literal('delegation'),
|
|
129
|
+
}),
|
|
130
|
+
});
|
|
131
|
+
export const permissionsV2DelegationConsentApiStatusSchema = z.enum([
|
|
132
|
+
'pending',
|
|
133
|
+
'standing',
|
|
134
|
+
'manual_review',
|
|
135
|
+
'revoked',
|
|
136
|
+
'expired',
|
|
137
|
+
]);
|
|
138
|
+
export const permissionsV2DelegationConsentMutationSchema = z
|
|
139
|
+
.object({
|
|
140
|
+
partnerId: nonEmptyStringSchema,
|
|
141
|
+
appId: nonEmptyStringSchema,
|
|
142
|
+
walletId: nonEmptyStringSchema,
|
|
143
|
+
policyVersion: nonEmptyStringSchema,
|
|
144
|
+
policyHash: nonEmptyStringSchema,
|
|
145
|
+
expiresAt: z.string().datetime().optional(),
|
|
146
|
+
})
|
|
147
|
+
.strict();
|
|
148
|
+
export const permissionsV2DelegationConsentStandingMutationSchema = permissionsV2DelegationConsentMutationSchema
|
|
149
|
+
.extend({
|
|
150
|
+
pendingTransactionId: nonEmptyStringSchema,
|
|
151
|
+
})
|
|
152
|
+
.strict();
|
|
153
|
+
export const permissionsV2DelegationConsentViewSchema = z
|
|
154
|
+
.object({
|
|
155
|
+
status: permissionsV2DelegationConsentApiStatusSchema,
|
|
156
|
+
userId: nonEmptyStringSchema,
|
|
157
|
+
partnerId: nonEmptyStringSchema,
|
|
158
|
+
appId: nonEmptyStringSchema,
|
|
159
|
+
walletId: nonEmptyStringSchema,
|
|
160
|
+
policyId: nonEmptyStringSchema,
|
|
161
|
+
policyVersion: nonEmptyStringSchema,
|
|
162
|
+
policyHash: nonEmptyStringSchema,
|
|
163
|
+
grantedAt: z.string().datetime().optional(),
|
|
164
|
+
expiresAt: z.string().datetime().optional(),
|
|
165
|
+
revokedAt: z.string().datetime().optional(),
|
|
166
|
+
})
|
|
167
|
+
.strict();
|
|
168
|
+
export const permissionsV2DelegationConsentRequestSchema = z
|
|
169
|
+
.object({
|
|
170
|
+
policy: permissionsV2DelegationPolicyDefinitionSchema,
|
|
171
|
+
consent: permissionsV2DelegationConsentViewSchema,
|
|
172
|
+
})
|
|
173
|
+
.strict();
|
|
174
|
+
export const permissionsV2DelegationConsentDiscoveryResponseSchema = z
|
|
175
|
+
.object({
|
|
176
|
+
requests: z.array(permissionsV2DelegationConsentRequestSchema),
|
|
177
|
+
})
|
|
178
|
+
.strict();
|
|
179
|
+
export const permissionsV2ValidationErrorSchema = z
|
|
180
|
+
.object({
|
|
181
|
+
code: z.string(),
|
|
182
|
+
path: z.string(),
|
|
183
|
+
message: z.string(),
|
|
184
|
+
})
|
|
185
|
+
.strict();
|
package/dist/esm/types/auth.js
CHANGED
|
@@ -54,6 +54,10 @@ export const OAUTH_METHODS = [
|
|
|
54
54
|
'FARCASTER',
|
|
55
55
|
'TELEGRAM',
|
|
56
56
|
'CUSTOM_OIDC',
|
|
57
|
+
// A partner-configured OAuth2 provider Para ships no first-party adapter for (e.g. Spotify). The specific
|
|
58
|
+
// connection rides on the flow's providerConfigHandle; the generic OAuth2 client uses the connection's
|
|
59
|
+
// stored endpoints. (ENG-7008)
|
|
60
|
+
'CUSTOM_OAUTH',
|
|
57
61
|
];
|
|
58
62
|
export const LINKED_ACCOUNT_TYPES = [
|
|
59
63
|
'EMAIL',
|
package/dist/esm/types/index.js
CHANGED
|
@@ -8,6 +8,7 @@ export * from './params.js';
|
|
|
8
8
|
export * from './partner.js';
|
|
9
9
|
export * from './partnerAppConfig.js';
|
|
10
10
|
export * from './pending-transaction.js';
|
|
11
|
+
export * from './permissions.js';
|
|
11
12
|
export * from './signing.js';
|
|
12
13
|
export * from './theme.js';
|
|
13
14
|
export * from './transaction.js';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/dist/types/index.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,kBAAkB,CAAC;AACjC,cAAc,kBAAkB,CAAC;AAEjC,OAAO,KAAK,gBAAgB,MAAM,wBAAwB,CAAC;AAE3D,OAAO,EAAE,gBAAgB,EAAE,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,kBAAkB,CAAC;AACjC,cAAc,wBAAwB,CAAC;AACvC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,kBAAkB,CAAC;AAEjC,OAAO,KAAK,gBAAgB,MAAM,wBAAwB,CAAC;AAE3D,OAAO,EAAE,gBAAgB,EAAE,CAAC"}
|