@polyester/sdk 0.10.0 → 0.12.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/CHANGELOG.md +24 -0
- package/dist/gen/auth/v1/address_book_pb.d.ts +21 -0
- package/dist/gen/auth/v1/address_book_pb.d.ts.map +1 -1
- package/dist/gen/auth/v1/address_book_pb.js +1 -1
- package/dist/gen/auth/v1/address_book_pb.js.map +1 -1
- package/dist/gen/auth/v1/api_keys_pb.d.ts +8 -7
- package/dist/gen/auth/v1/api_keys_pb.d.ts.map +1 -1
- package/dist/gen/auth/v1/api_keys_pb.js.map +1 -1
- package/dist/gen/auth/v1/mfa_pb.d.ts +39 -3
- package/dist/gen/auth/v1/mfa_pb.d.ts.map +1 -1
- package/dist/gen/auth/v1/mfa_pb.js +1 -1
- package/dist/gen/auth/v1/mfa_pb.js.map +1 -1
- package/dist/gen/auth/v1/policies_pb.d.ts +8 -4
- package/dist/gen/auth/v1/policies_pb.d.ts.map +1 -1
- package/dist/gen/auth/v1/policies_pb.js.map +1 -1
- package/dist/gen/auth/v1/subaccounts_pb.d.ts +383 -18
- package/dist/gen/auth/v1/subaccounts_pb.d.ts.map +1 -1
- package/dist/gen/auth/v1/subaccounts_pb.js +253 -38
- package/dist/gen/auth/v1/subaccounts_pb.js.map +1 -1
- package/dist/gen/chain/withdraw/v1/withdraw_pb.d.ts +3 -2
- package/dist/gen/chain/withdraw/v1/withdraw_pb.d.ts.map +1 -1
- package/dist/gen/chain/withdraw/v1/withdraw_pb.js.map +1 -1
- package/dist/gen/orders/v1/orders_pb.d.ts +2 -2
- package/dist/gen/orders/v1/orders_pb.js.map +1 -1
- package/dist/gen/orders/v1/orders_read_pb.d.ts +8 -0
- package/dist/gen/orders/v1/orders_read_pb.d.ts.map +1 -1
- package/dist/gen/orders/v1/orders_read_pb.js +1 -1
- package/dist/gen/orders/v1/orders_read_pb.js.map +1 -1
- package/dist/gen/ratelimit/v1/ratelimit_pb.d.ts +2 -2
- package/dist/gen/ratelimit/v1/ratelimit_pb.js +1 -1
- package/dist/gen/ratelimit/v1/ratelimit_pb.js.map +1 -1
- package/dist/gen/transfer/v1/internal_transfer_pb.d.ts +3 -0
- package/dist/gen/transfer/v1/internal_transfer_pb.d.ts.map +1 -1
- package/dist/gen/transfer/v1/internal_transfer_pb.js.map +1 -1
- package/dist/gen/triggers/v1/triggers_pb.d.ts +351 -9
- package/dist/gen/triggers/v1/triggers_pb.d.ts.map +1 -1
- package/dist/gen/triggers/v1/triggers_pb.js +307 -3
- package/dist/gen/triggers/v1/triggers_pb.js.map +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/services/address-book/address-book.d.ts +3 -1
- package/dist/services/address-book/address-book.d.ts.map +1 -1
- package/dist/services/address-book/address-book.js +3 -1
- package/dist/services/address-book/address-book.js.map +1 -1
- package/dist/services/address-book/address-book.schemas.d.ts +6 -0
- package/dist/services/address-book/address-book.schemas.d.ts.map +1 -1
- package/dist/services/address-book/address-book.schemas.js +10 -5
- package/dist/services/address-book/address-book.schemas.js.map +1 -1
- package/dist/services/candles/candles.schemas.d.ts +10 -10
- package/dist/services/heatmap/heatmap.schemas.d.ts +9 -9
- package/dist/services/market-overview/market-overview.schemas.d.ts +3 -3
- package/dist/services/mfa/mfa.d.ts +2 -2
- package/dist/services/mfa/mfa.js +2 -2
- package/dist/services/mfa/mfa.js.map +1 -1
- package/dist/services/mfa/mfa.schemas.d.ts +132 -4
- package/dist/services/mfa/mfa.schemas.d.ts.map +1 -1
- package/dist/services/mfa/mfa.schemas.js +13 -7
- package/dist/services/mfa/mfa.schemas.js.map +1 -1
- package/dist/services/rate-limits/rate-limits.schemas.d.ts +4 -4
- package/dist/services/rate-limits/rate-limits.schemas.js +1 -1
- package/dist/services/rate-limits/rate-limits.schemas.js.map +1 -1
- package/dist/services/subaccounts/index.d.ts +2 -2
- package/dist/services/subaccounts/subaccounts.codecs.js +29 -1
- package/dist/services/subaccounts/subaccounts.codecs.js.map +1 -1
- package/dist/services/subaccounts/subaccounts.d.ts +9 -1
- package/dist/services/subaccounts/subaccounts.d.ts.map +1 -1
- package/dist/services/subaccounts/subaccounts.js +19 -2
- package/dist/services/subaccounts/subaccounts.js.map +1 -1
- package/dist/services/subaccounts/subaccounts.schemas.d.ts +43 -3
- package/dist/services/subaccounts/subaccounts.schemas.d.ts.map +1 -1
- package/dist/services/subaccounts/subaccounts.schemas.js +28 -3
- package/dist/services/subaccounts/subaccounts.schemas.js.map +1 -1
- package/dist/services/subaccounts/subaccounts.types.d.ts +2 -2
- package/dist/services/trades/trades.d.ts +1 -1
- package/dist/services/trades/trades.js +1 -1
- package/dist/services/trades/trades.js.map +1 -1
- package/dist/services/trades/trades.schemas.d.ts +3 -0
- package/dist/services/trades/trades.schemas.d.ts.map +1 -1
- package/dist/services/trades/trades.schemas.js +2 -1
- package/dist/services/trades/trades.schemas.js.map +1 -1
- package/dist/services/triggers/triggers-output.schemas.d.ts +351 -4
- package/dist/services/triggers/triggers-output.schemas.d.ts.map +1 -1
- package/dist/services/triggers/triggers-output.schemas.js +36 -4
- package/dist/services/triggers/triggers-output.schemas.js.map +1 -1
- package/dist/services/triggers/triggers.codecs.js +51 -1
- package/dist/services/triggers/triggers.codecs.js.map +1 -1
- package/dist/wired-services.d.ts.map +1 -1
- package/dist/wired-services.js +2 -1
- package/dist/wired-services.js.map +1 -1
- package/package.json +1 -1
|
@@ -113,7 +113,7 @@ declare const FinishTotpEnrollmentInputSchema: v.StrictObjectSchema<{
|
|
|
113
113
|
readonly code: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MinLengthAction<string, 1, undefined>]>;
|
|
114
114
|
}, undefined>;
|
|
115
115
|
type FinishTotpEnrollmentInput = v.InferInput<typeof FinishTotpEnrollmentInputSchema>;
|
|
116
|
-
declare const FinishTotpEnrollmentResultSchema: v.ObjectSchema<{
|
|
116
|
+
declare const FinishTotpEnrollmentResultSchema: v.SchemaWithPipe<readonly [v.ObjectSchema<{
|
|
117
117
|
readonly factor: v.OptionalSchema<v.SchemaWithPipe<readonly [v.ObjectSchema<{
|
|
118
118
|
readonly factorId: v.StringSchema<undefined>;
|
|
119
119
|
readonly factorType: v.SchemaWithPipe<readonly [v.EnumSchema<typeof MFAFactorType, undefined>, v.TransformAction<MFAFactorType, "unspecified" | "totp" | "passkey" | "recoveryCode">]>;
|
|
@@ -146,7 +146,71 @@ declare const FinishTotpEnrollmentResultSchema: v.ObjectSchema<{
|
|
|
146
146
|
lastUsedAtMs: number | undefined;
|
|
147
147
|
}>]>, undefined>;
|
|
148
148
|
readonly recoveryCodes: v.OptionalSchema<v.ArraySchema<v.StringSchema<undefined>, undefined>, readonly []>;
|
|
149
|
-
|
|
149
|
+
readonly session: v.OptionalSchema<v.SchemaWithPipe<readonly [v.ObjectSchema<{
|
|
150
|
+
readonly sessionId: v.StringSchema<undefined>;
|
|
151
|
+
readonly sessionLevel: v.SchemaWithPipe<readonly [v.EnumSchema<typeof SessionLevel, undefined>, v.TransformAction<SessionLevel, "unspecified" | "primaryAuthenticated" | "mfaElevated" | "freshStepUp">]>;
|
|
152
|
+
readonly authenticationMethods: v.OptionalSchema<v.ArraySchema<v.StringSchema<undefined>, undefined>, readonly []>;
|
|
153
|
+
readonly authTime: v.SchemaWithPipe<readonly [v.OptionalSchema<v.ObjectSchema<{
|
|
154
|
+
readonly seconds: v.BigintSchema<undefined>;
|
|
155
|
+
readonly nanos: v.OptionalSchema<v.NumberSchema<undefined>, 0>;
|
|
156
|
+
}, undefined>, undefined>, v.TransformAction<{
|
|
157
|
+
seconds: bigint;
|
|
158
|
+
nanos: number;
|
|
159
|
+
} | undefined, number | undefined>]>;
|
|
160
|
+
}, undefined>, v.TransformAction<{
|
|
161
|
+
sessionId: string;
|
|
162
|
+
sessionLevel: "unspecified" | "primaryAuthenticated" | "mfaElevated" | "freshStepUp";
|
|
163
|
+
authenticationMethods: string[];
|
|
164
|
+
authTime?: number | undefined;
|
|
165
|
+
}, {
|
|
166
|
+
sessionId: string;
|
|
167
|
+
sessionLevel: "unspecified" | "primaryAuthenticated" | "mfaElevated" | "freshStepUp";
|
|
168
|
+
authenticationMethods: string[];
|
|
169
|
+
authTimeMs: number | undefined;
|
|
170
|
+
}>]>, undefined>;
|
|
171
|
+
readonly accessToken: v.OptionalSchema<v.StringSchema<undefined>, "">;
|
|
172
|
+
readonly accessTokenExpiresAt: v.SchemaWithPipe<readonly [v.OptionalSchema<v.ObjectSchema<{
|
|
173
|
+
readonly seconds: v.BigintSchema<undefined>;
|
|
174
|
+
readonly nanos: v.OptionalSchema<v.NumberSchema<undefined>, 0>;
|
|
175
|
+
}, undefined>, undefined>, v.TransformAction<{
|
|
176
|
+
seconds: bigint;
|
|
177
|
+
nanos: number;
|
|
178
|
+
} | undefined, number | undefined>]>;
|
|
179
|
+
}, undefined>, v.TransformAction<{
|
|
180
|
+
factor?: {
|
|
181
|
+
factorId: string;
|
|
182
|
+
factorType: "unspecified" | "totp" | "passkey" | "recoveryCode";
|
|
183
|
+
label: string;
|
|
184
|
+
createdAtMs: number | undefined;
|
|
185
|
+
lastUsedAtMs: number | undefined;
|
|
186
|
+
} | undefined;
|
|
187
|
+
recoveryCodes: string[];
|
|
188
|
+
session?: {
|
|
189
|
+
sessionId: string;
|
|
190
|
+
sessionLevel: "unspecified" | "primaryAuthenticated" | "mfaElevated" | "freshStepUp";
|
|
191
|
+
authenticationMethods: string[];
|
|
192
|
+
authTimeMs: number | undefined;
|
|
193
|
+
} | undefined;
|
|
194
|
+
accessToken: string;
|
|
195
|
+
accessTokenExpiresAt?: number | undefined;
|
|
196
|
+
}, {
|
|
197
|
+
factor: {
|
|
198
|
+
factorId: string;
|
|
199
|
+
factorType: "unspecified" | "totp" | "passkey" | "recoveryCode";
|
|
200
|
+
label: string;
|
|
201
|
+
createdAtMs: number | undefined;
|
|
202
|
+
lastUsedAtMs: number | undefined;
|
|
203
|
+
} | undefined;
|
|
204
|
+
recoveryCodes: string[];
|
|
205
|
+
session: {
|
|
206
|
+
sessionId: string;
|
|
207
|
+
sessionLevel: "unspecified" | "primaryAuthenticated" | "mfaElevated" | "freshStepUp";
|
|
208
|
+
authenticationMethods: string[];
|
|
209
|
+
authTimeMs: number | undefined;
|
|
210
|
+
} | undefined;
|
|
211
|
+
accessToken: string | undefined;
|
|
212
|
+
accessTokenExpiresAtMs: number | undefined;
|
|
213
|
+
}>]>;
|
|
150
214
|
type FinishTotpEnrollmentResult = v.InferOutput<typeof FinishTotpEnrollmentResultSchema>;
|
|
151
215
|
declare const BeginPasskeyEnrollmentInputSchema: v.StrictObjectSchema<{
|
|
152
216
|
readonly label: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MinLengthAction<string, 1, undefined>]>;
|
|
@@ -169,7 +233,7 @@ declare const FinishPasskeyEnrollmentInputSchema: v.StrictObjectSchema<{
|
|
|
169
233
|
readonly credential: v.CustomSchema<import("@bufbuild/protobuf").JsonObject, undefined>;
|
|
170
234
|
}, undefined>;
|
|
171
235
|
type FinishPasskeyEnrollmentInput = v.InferInput<typeof FinishPasskeyEnrollmentInputSchema>;
|
|
172
|
-
declare const FinishPasskeyEnrollmentResultSchema: v.ObjectSchema<{
|
|
236
|
+
declare const FinishPasskeyEnrollmentResultSchema: v.SchemaWithPipe<readonly [v.ObjectSchema<{
|
|
173
237
|
readonly factor: v.OptionalSchema<v.SchemaWithPipe<readonly [v.ObjectSchema<{
|
|
174
238
|
readonly factorId: v.StringSchema<undefined>;
|
|
175
239
|
readonly factorType: v.SchemaWithPipe<readonly [v.EnumSchema<typeof MFAFactorType, undefined>, v.TransformAction<MFAFactorType, "unspecified" | "totp" | "passkey" | "recoveryCode">]>;
|
|
@@ -202,7 +266,71 @@ declare const FinishPasskeyEnrollmentResultSchema: v.ObjectSchema<{
|
|
|
202
266
|
lastUsedAtMs: number | undefined;
|
|
203
267
|
}>]>, undefined>;
|
|
204
268
|
readonly recoveryCodes: v.OptionalSchema<v.ArraySchema<v.StringSchema<undefined>, undefined>, readonly []>;
|
|
205
|
-
|
|
269
|
+
readonly session: v.OptionalSchema<v.SchemaWithPipe<readonly [v.ObjectSchema<{
|
|
270
|
+
readonly sessionId: v.StringSchema<undefined>;
|
|
271
|
+
readonly sessionLevel: v.SchemaWithPipe<readonly [v.EnumSchema<typeof SessionLevel, undefined>, v.TransformAction<SessionLevel, "unspecified" | "primaryAuthenticated" | "mfaElevated" | "freshStepUp">]>;
|
|
272
|
+
readonly authenticationMethods: v.OptionalSchema<v.ArraySchema<v.StringSchema<undefined>, undefined>, readonly []>;
|
|
273
|
+
readonly authTime: v.SchemaWithPipe<readonly [v.OptionalSchema<v.ObjectSchema<{
|
|
274
|
+
readonly seconds: v.BigintSchema<undefined>;
|
|
275
|
+
readonly nanos: v.OptionalSchema<v.NumberSchema<undefined>, 0>;
|
|
276
|
+
}, undefined>, undefined>, v.TransformAction<{
|
|
277
|
+
seconds: bigint;
|
|
278
|
+
nanos: number;
|
|
279
|
+
} | undefined, number | undefined>]>;
|
|
280
|
+
}, undefined>, v.TransformAction<{
|
|
281
|
+
sessionId: string;
|
|
282
|
+
sessionLevel: "unspecified" | "primaryAuthenticated" | "mfaElevated" | "freshStepUp";
|
|
283
|
+
authenticationMethods: string[];
|
|
284
|
+
authTime?: number | undefined;
|
|
285
|
+
}, {
|
|
286
|
+
sessionId: string;
|
|
287
|
+
sessionLevel: "unspecified" | "primaryAuthenticated" | "mfaElevated" | "freshStepUp";
|
|
288
|
+
authenticationMethods: string[];
|
|
289
|
+
authTimeMs: number | undefined;
|
|
290
|
+
}>]>, undefined>;
|
|
291
|
+
readonly accessToken: v.OptionalSchema<v.StringSchema<undefined>, "">;
|
|
292
|
+
readonly accessTokenExpiresAt: v.SchemaWithPipe<readonly [v.OptionalSchema<v.ObjectSchema<{
|
|
293
|
+
readonly seconds: v.BigintSchema<undefined>;
|
|
294
|
+
readonly nanos: v.OptionalSchema<v.NumberSchema<undefined>, 0>;
|
|
295
|
+
}, undefined>, undefined>, v.TransformAction<{
|
|
296
|
+
seconds: bigint;
|
|
297
|
+
nanos: number;
|
|
298
|
+
} | undefined, number | undefined>]>;
|
|
299
|
+
}, undefined>, v.TransformAction<{
|
|
300
|
+
factor?: {
|
|
301
|
+
factorId: string;
|
|
302
|
+
factorType: "unspecified" | "totp" | "passkey" | "recoveryCode";
|
|
303
|
+
label: string;
|
|
304
|
+
createdAtMs: number | undefined;
|
|
305
|
+
lastUsedAtMs: number | undefined;
|
|
306
|
+
} | undefined;
|
|
307
|
+
recoveryCodes: string[];
|
|
308
|
+
session?: {
|
|
309
|
+
sessionId: string;
|
|
310
|
+
sessionLevel: "unspecified" | "primaryAuthenticated" | "mfaElevated" | "freshStepUp";
|
|
311
|
+
authenticationMethods: string[];
|
|
312
|
+
authTimeMs: number | undefined;
|
|
313
|
+
} | undefined;
|
|
314
|
+
accessToken: string;
|
|
315
|
+
accessTokenExpiresAt?: number | undefined;
|
|
316
|
+
}, {
|
|
317
|
+
factor: {
|
|
318
|
+
factorId: string;
|
|
319
|
+
factorType: "unspecified" | "totp" | "passkey" | "recoveryCode";
|
|
320
|
+
label: string;
|
|
321
|
+
createdAtMs: number | undefined;
|
|
322
|
+
lastUsedAtMs: number | undefined;
|
|
323
|
+
} | undefined;
|
|
324
|
+
recoveryCodes: string[];
|
|
325
|
+
session: {
|
|
326
|
+
sessionId: string;
|
|
327
|
+
sessionLevel: "unspecified" | "primaryAuthenticated" | "mfaElevated" | "freshStepUp";
|
|
328
|
+
authenticationMethods: string[];
|
|
329
|
+
authTimeMs: number | undefined;
|
|
330
|
+
} | undefined;
|
|
331
|
+
accessToken: string | undefined;
|
|
332
|
+
accessTokenExpiresAtMs: number | undefined;
|
|
333
|
+
}>]>;
|
|
206
334
|
type FinishPasskeyEnrollmentResult = v.InferOutput<typeof FinishPasskeyEnrollmentResultSchema>;
|
|
207
335
|
declare const BeginMfaChallengeInputSchema: v.SchemaWithPipe<readonly [v.StrictObjectSchema<{
|
|
208
336
|
readonly purpose: v.PicklistSchema<readonly ["sessionElevation", "freshStepUp"], undefined>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mfa.schemas.d.ts","names":[],"sources":["../../../src/services/mfa/mfa.schemas.ts"],"mappings":";;;cAWa,sBAAoB,EAAA,yBAAA,EAAA;;;;;;;;;;;;;;;;;;;;;;KAyBrB,iBAAiB,EAAE,mBAAmB;cAErC,iBAAe,EAAA,yBAAA,EAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KA2BhB,YAAY,EAAE,mBAAmB;cAEhC,8BAA4B,EAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KAK7B,uBAAuB,EAAE,mBAAmB;cAE3C,gCAA8B,EAAA;;;KAI/B,2BAA2B,EAAE,kBAAkB;cAE9C,iCAA+B,EAAA;;;;;;;;;;;;KAOhC,4BAA4B,EAAE,mBAAmB;cAEhD,iCAA+B,EAAA;;;;KAKhC,4BAA4B,EAAE,kBAAkB;cAE/C,kCAAgC,EAAA
|
|
1
|
+
{"version":3,"file":"mfa.schemas.d.ts","names":[],"sources":["../../../src/services/mfa/mfa.schemas.ts"],"mappings":";;;cAWa,sBAAoB,EAAA,yBAAA,EAAA;;;;;;;;;;;;;;;;;;;;;;KAyBrB,iBAAiB,EAAE,mBAAmB;cAErC,iBAAe,EAAA,yBAAA,EAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KA2BhB,YAAY,EAAE,mBAAmB;cAEhC,8BAA4B,EAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KAK7B,uBAAuB,EAAE,mBAAmB;cAE3C,gCAA8B,EAAA;;;KAI/B,2BAA2B,EAAE,kBAAkB;cAE9C,iCAA+B,EAAA;;;;;;;;;;;;KAOhC,4BAA4B,EAAE,mBAAmB;cAEhD,iCAA+B,EAAA;;;;KAKhC,4BAA4B,EAAE,kBAAkB;cAE/C,kCAAgC,EAAA,yBAAA,EAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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;;KAM5B,wBAAwB,EAAE,kBAAkB;cAE3C,8BAA4B,EAAA;;;;;;;;;;;KAM7B,yBAAyB,EAAE,mBAAmB;cAE7C,+BAA6B,EAAA;;;;;;;KAQ9B,0BAA0B,EAAE,kBAAkB;cAE7C,+BAA6B,EAAA;;;;;;;;KAS9B,0BAA0B,EAAE,kBAAkB"}
|
|
@@ -43,10 +43,19 @@ const FinishTotpEnrollmentInputSchema = v.strictObject({
|
|
|
43
43
|
enrollmentId: v.pipe(v.string(), v.trim(), v.minLength(1)),
|
|
44
44
|
code: v.pipe(v.string(), v.trim(), v.minLength(1))
|
|
45
45
|
});
|
|
46
|
-
const FinishTotpEnrollmentResultSchema = v.object({
|
|
46
|
+
const FinishTotpEnrollmentResultSchema = v.pipe(v.object({
|
|
47
47
|
factor: v.optional(MfaFactorSchema),
|
|
48
|
-
recoveryCodes: v.optional(v.array(v.string()), [])
|
|
49
|
-
|
|
48
|
+
recoveryCodes: v.optional(v.array(v.string()), []),
|
|
49
|
+
session: v.optional(MfaSessionInfoSchema),
|
|
50
|
+
accessToken: v.optional(v.string(), ""),
|
|
51
|
+
accessTokenExpiresAt: OptionalTimestampMsSchema
|
|
52
|
+
}), v.transform(({ factor, recoveryCodes, session, accessToken, accessTokenExpiresAt }) => ({
|
|
53
|
+
factor,
|
|
54
|
+
recoveryCodes,
|
|
55
|
+
session,
|
|
56
|
+
accessToken: accessToken.trim() || void 0,
|
|
57
|
+
accessTokenExpiresAtMs: accessTokenExpiresAt
|
|
58
|
+
})));
|
|
50
59
|
const BeginPasskeyEnrollmentInputSchema = v.strictObject({ label: v.pipe(v.string(), v.trim(), v.minLength(1)) });
|
|
51
60
|
const BeginPasskeyEnrollmentResultSchema = v.object({
|
|
52
61
|
enrollmentId: v.string(),
|
|
@@ -57,10 +66,7 @@ const FinishPasskeyEnrollmentInputSchema = v.strictObject({
|
|
|
57
66
|
enrollmentId: v.pipe(v.string(), v.trim(), v.minLength(1)),
|
|
58
67
|
credential: JsonObjectSchema
|
|
59
68
|
});
|
|
60
|
-
const FinishPasskeyEnrollmentResultSchema =
|
|
61
|
-
factor: v.optional(MfaFactorSchema),
|
|
62
|
-
recoveryCodes: v.optional(v.array(v.string()), [])
|
|
63
|
-
});
|
|
69
|
+
const FinishPasskeyEnrollmentResultSchema = FinishTotpEnrollmentResultSchema;
|
|
64
70
|
const BeginMfaChallengeInputSchema = v.pipe(v.strictObject({ purpose: v.picklist(MFA_CHALLENGE_PURPOSE_VALUES) }), v.transform((data) => ({ purpose: MfaChallengePurposeCodec.inputToProto[data.purpose] })));
|
|
65
71
|
const BeginMfaChallengeResultSchema = v.object({
|
|
66
72
|
challengeId: v.string(),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mfa.schemas.js","names":["Proto.SessionLevel","Proto.MFAFactorType"],"sources":["../../../src/services/mfa/mfa.schemas.ts"],"sourcesContent":["import * as v from \"valibot\";\nimport * as Proto from \"../../gen/auth/v1/mfa_pb.js\";\nimport { JsonObjectSchema, OptionalTimestampMsSchema } from \"../../shared/schemas.js\";\nimport { requiredEnumLabel } from \"../../shared/proto-enum-codec.js\";\nimport {\n MfaChallengePurposeCodec,\n MfaFactorTypeCodec,\n MFA_CHALLENGE_PURPOSE_VALUES,\n SessionLevelCodec,\n} from \"./mfa.codecs.js\";\n\nexport const MfaSessionInfoSchema = v.pipe(\n v.object({\n sessionId: v.string(),\n sessionLevel: v.pipe(\n v.enum(Proto.SessionLevel),\n v.transform((v) =>\n requiredEnumLabel(\n SessionLevelCodec.protoToOutput,\n v,\n \"PolyesterClient.MfaSessionInfoSchema\",\n \"sessionLevel\",\n ),\n ),\n ),\n authenticationMethods: v.optional(v.array(v.string()), []),\n authTime: OptionalTimestampMsSchema,\n }),\n v.transform(({ sessionId, sessionLevel, authenticationMethods, authTime }) => ({\n sessionId,\n sessionLevel,\n authenticationMethods,\n authTimeMs: authTime,\n })),\n);\n\nexport type MfaSessionInfo = v.InferOutput<typeof MfaSessionInfoSchema>;\n\nexport const MfaFactorSchema = v.pipe(\n v.object({\n factorId: v.string(),\n factorType: v.pipe(\n v.enum(Proto.MFAFactorType),\n v.transform((v) =>\n requiredEnumLabel(\n MfaFactorTypeCodec.protoToOutput,\n v,\n \"PolyesterClient.MfaFactorSchema\",\n \"factorType\",\n ),\n ),\n ),\n label: v.string(),\n createdAt: OptionalTimestampMsSchema,\n lastUsedAt: OptionalTimestampMsSchema,\n }),\n v.transform(({ factorId, factorType, label, createdAt, lastUsedAt }) => ({\n factorId,\n factorType,\n label,\n createdAtMs: createdAt,\n lastUsedAtMs: lastUsedAt,\n })),\n);\n\nexport type MfaFactor = v.InferOutput<typeof MfaFactorSchema>;\n\nexport const ListMfaFactorsResponseSchema = v.object({\n factors: v.optional(v.array(MfaFactorSchema), []),\n hasRecoveryCodes: v.optional(v.boolean(), false),\n});\n\nexport type ListMfaFactorsResult = v.InferOutput<typeof ListMfaFactorsResponseSchema>;\n\nexport const BeginTotpEnrollmentInputSchema = v.strictObject({\n label: v.pipe(v.string(), v.trim(), v.minLength(1)),\n});\n\nexport type BeginTotpEnrollmentInput = v.InferInput<typeof BeginTotpEnrollmentInputSchema>;\n\nexport const BeginTotpEnrollmentResultSchema = v.object({\n enrollmentId: v.string(),\n secret: v.string(),\n otpauthUri: v.string(),\n expiresAt: OptionalTimestampMsSchema,\n});\n\nexport type BeginTotpEnrollmentResult = v.InferOutput<typeof BeginTotpEnrollmentResultSchema>;\n\nexport const FinishTotpEnrollmentInputSchema = v.strictObject({\n enrollmentId: v.pipe(v.string(), v.trim(), v.minLength(1)),\n code: v.pipe(v.string(), v.trim(), v.minLength(1)),\n});\n\nexport type FinishTotpEnrollmentInput = v.InferInput<typeof FinishTotpEnrollmentInputSchema>;\n\nexport const FinishTotpEnrollmentResultSchema = v.object({\n factor: v.optional(MfaFactorSchema),\n recoveryCodes: v.optional(v.array(v.string()), []),\n});\n\nexport type FinishTotpEnrollmentResult = v.InferOutput<typeof FinishTotpEnrollmentResultSchema>;\n\nexport const BeginPasskeyEnrollmentInputSchema = v.strictObject({\n label: v.pipe(v.string(), v.trim(), v.minLength(1)),\n});\n\nexport type BeginPasskeyEnrollmentInput = v.InferInput<typeof BeginPasskeyEnrollmentInputSchema>;\n\nexport const BeginPasskeyEnrollmentResultSchema = v.object({\n enrollmentId: v.string(),\n publicKey: v.optional(JsonObjectSchema),\n expiresAt: OptionalTimestampMsSchema,\n});\n\nexport type BeginPasskeyEnrollmentResult = v.InferOutput<typeof BeginPasskeyEnrollmentResultSchema>;\n\nexport const FinishPasskeyEnrollmentInputSchema = v.strictObject({\n enrollmentId: v.pipe(v.string(), v.trim(), v.minLength(1)),\n credential: JsonObjectSchema,\n});\n\nexport type FinishPasskeyEnrollmentInput = v.InferInput<typeof FinishPasskeyEnrollmentInputSchema>;\n\nexport const FinishPasskeyEnrollmentResultSchema = v.object({\n factor: v.optional(MfaFactorSchema),\n recoveryCodes: v.optional(v.array(v.string()), []),\n});\n\nexport type FinishPasskeyEnrollmentResult = v.InferOutput<\n typeof FinishPasskeyEnrollmentResultSchema\n>;\n\nexport const BeginMfaChallengeInputSchema = v.pipe(\n v.strictObject({\n purpose: v.picklist(MFA_CHALLENGE_PURPOSE_VALUES),\n }),\n v.transform((data) => ({\n purpose: MfaChallengePurposeCodec.inputToProto[data.purpose],\n })),\n);\n\nexport type BeginMfaChallengeInput = v.InferInput<typeof BeginMfaChallengeInputSchema>;\n\nexport const BeginMfaChallengeResultSchema = v.object({\n challengeId: v.string(),\n allowedFactorTypes: v.pipe(\n v.array(v.enum(Proto.MFAFactorType)),\n v.transform((arr) =>\n arr.map((t) =>\n requiredEnumLabel(\n MfaFactorTypeCodec.protoToOutput,\n t,\n \"PolyesterClient.BeginMfaChallengeResultSchema\",\n \"allowed factor type\",\n ),\n ),\n ),\n ),\n publicKey: v.optional(JsonObjectSchema),\n expiresAt: OptionalTimestampMsSchema,\n});\n\nexport type BeginMfaChallengeResult = v.InferOutput<typeof BeginMfaChallengeResultSchema>;\n\nexport const VerifyTotpChallengeInputSchema = v.strictObject({\n challengeId: v.pipe(v.string(), v.trim(), v.minLength(1)),\n code: v.pipe(v.string(), v.trim(), v.minLength(1)),\n});\n\nexport type VerifyTotpChallengeInput = v.InferInput<typeof VerifyTotpChallengeInputSchema>;\n\nexport const FinishPasskeyChallengeInputSchema = v.strictObject({\n challengeId: v.pipe(v.string(), v.trim(), v.minLength(1)),\n credential: JsonObjectSchema,\n});\n\nexport type FinishPasskeyChallengeInput = v.InferInput<typeof FinishPasskeyChallengeInputSchema>;\n\nexport const VerifyRecoveryCodeChallengeInputSchema = v.strictObject({\n challengeId: v.pipe(v.string(), v.trim(), v.minLength(1)),\n recoveryCode: v.pipe(v.string(), v.trim(), v.minLength(1)),\n});\n\nexport type VerifyRecoveryCodeChallengeInput = v.InferInput<\n typeof VerifyRecoveryCodeChallengeInputSchema\n>;\n\nexport const CompleteMfaChallengeResultSchema = v.pipe(\n v.object({\n session: v.optional(MfaSessionInfoSchema),\n accessToken: v.string(),\n accessTokenExpiresAt: OptionalTimestampMsSchema,\n stepUpToken: v.string(),\n stepUpExpiresAt: OptionalTimestampMsSchema,\n }),\n v.transform(({ session, accessToken, accessTokenExpiresAt, stepUpToken, stepUpExpiresAt }) => ({\n session,\n accessToken: accessToken.trim() || undefined,\n accessTokenExpiresAtMs: accessTokenExpiresAt,\n stepUpToken: stepUpToken.trim() || undefined,\n stepUpExpiresAtMs: stepUpExpiresAt,\n })),\n);\n\nexport type CompleteMfaChallengeResult = v.InferOutput<typeof CompleteMfaChallengeResultSchema>;\n\nexport const DeleteMfaFactorInputSchema = v.strictObject({\n factorId: v.pipe(v.string(), v.trim(), v.minLength(1)),\n});\n\nexport type DeleteMfaFactorInput = v.InferInput<typeof DeleteMfaFactorInputSchema>;\n\nexport const UpdateMfaFactorInputSchema = v.strictObject({\n factorId: v.pipe(v.string(), v.trim(), v.minLength(1)),\n label: v.pipe(v.string(), v.maxLength(128)),\n});\n\nexport type UpdateMfaFactorInput = v.InferInput<typeof UpdateMfaFactorInputSchema>;\n\nexport const UpdateMfaFactorResultSchema = v.object({\n factor: v.optional(MfaFactorSchema),\n});\n\nexport type UpdateMfaFactorResult = v.InferOutput<typeof UpdateMfaFactorResultSchema>;\n\nexport const RegenerateRecoveryCodesInputSchema = v.strictObject({});\n\nexport type RegenerateRecoveryCodesInput = v.InferInput<typeof RegenerateRecoveryCodesInputSchema>;\n\nexport const RegenerateRecoveryCodesResultSchema = v.object({\n recoveryCodes: v.optional(v.array(v.string()), []),\n});\n\nexport type RegenerateRecoveryCodesResult = v.InferOutput<\n typeof RegenerateRecoveryCodesResultSchema\n>;\n\nexport const ClaimFreshStepUpInputSchema = v.strictObject({\n requestId: v.pipe(v.string(), v.trim(), v.minLength(1)),\n actionType: v.pipe(v.string(), v.trim(), v.minLength(1)),\n subject: v.pipe(v.string(), v.trim(), v.minLength(1)),\n});\n\nexport type ClaimFreshStepUpInput = v.InferInput<typeof ClaimFreshStepUpInputSchema>;\n\nexport const ClaimFreshStepUpResultSchema = v.object({\n stepUpId: v.string(),\n claimNonce: v.string(),\n claimExpiresAt: OptionalTimestampMsSchema,\n});\n\nexport type ClaimFreshStepUpResult = v.InferOutput<typeof ClaimFreshStepUpResultSchema>;\n\nexport const ConsumeFreshStepUpInputSchema = v.strictObject({\n stepUpId: v.pipe(v.string(), v.trim(), v.minLength(1)),\n requestId: v.pipe(v.string(), v.trim(), v.minLength(1)),\n actionType: v.pipe(v.string(), v.trim(), v.minLength(1)),\n subject: v.pipe(v.string(), v.trim(), v.minLength(1)),\n claimNonce: v.pipe(v.string(), v.trim(), v.minLength(1)),\n});\n\nexport type ConsumeFreshStepUpInput = v.InferInput<typeof ConsumeFreshStepUpInputSchema>;\n\nexport const ReleaseFreshStepUpInputSchema = v.strictObject({\n stepUpId: v.pipe(v.string(), v.trim(), v.minLength(1)),\n requestId: v.pipe(v.string(), v.trim(), v.minLength(1)),\n actionType: v.pipe(v.string(), v.trim(), v.minLength(1)),\n subject: v.pipe(v.string(), v.trim(), v.minLength(1)),\n claimNonce: v.pipe(v.string(), v.trim(), v.minLength(1)),\n reason: v.pipe(v.string(), v.trim(), v.minLength(1)),\n});\n\nexport type ReleaseFreshStepUpInput = v.InferInput<typeof ReleaseFreshStepUpInputSchema>;\n"],"mappings":";;;;;;AAWA,MAAa,uBAAuB,EAAE,KAClC,EAAE,OAAO;CACL,WAAW,EAAE,OAAO;CACpB,cAAc,EAAE,KACZ,EAAE,KAAKA,YAAkB,GACzB,EAAE,WAAW,MACT,kBACI,kBAAkB,eAClB,GACA,wCACA,cACJ,CACJ,CACJ;CACA,uBAAuB,EAAE,SAAS,EAAE,MAAM,EAAE,OAAO,CAAC,GAAG,CAAC,CAAC;CACzD,UAAU;AACd,CAAC,GACD,EAAE,WAAW,EAAE,WAAW,cAAc,uBAAuB,gBAAgB;CAC3E;CACA;CACA;CACA,YAAY;AAChB,EAAE,CACN;AAIA,MAAa,kBAAkB,EAAE,KAC7B,EAAE,OAAO;CACL,UAAU,EAAE,OAAO;CACnB,YAAY,EAAE,KACV,EAAE,KAAKC,aAAmB,GAC1B,EAAE,WAAW,MACT,kBACI,mBAAmB,eACnB,GACA,mCACA,YACJ,CACJ,CACJ;CACA,OAAO,EAAE,OAAO;CAChB,WAAW;CACX,YAAY;AAChB,CAAC,GACD,EAAE,WAAW,EAAE,UAAU,YAAY,OAAO,WAAW,kBAAkB;CACrE;CACA;CACA;CACA,aAAa;CACb,cAAc;AAClB,EAAE,CACN;AAIA,MAAa,+BAA+B,EAAE,OAAO;CACjD,SAAS,EAAE,SAAS,EAAE,MAAM,eAAe,GAAG,CAAC,CAAC;CAChD,kBAAkB,EAAE,SAAS,EAAE,QAAQ,GAAG,KAAK;AACnD,CAAC;AAID,MAAa,iCAAiC,EAAE,aAAa,EACzD,OAAO,EAAE,KAAK,EAAE,OAAO,GAAG,EAAE,KAAK,GAAG,EAAE,UAAU,CAAC,CAAC,EACtD,CAAC;AAID,MAAa,kCAAkC,EAAE,OAAO;C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AG,EAAE,KAAK,GAAG,EAAE,UAAU,CAAC,CAAC;AAC3D,CAAC;AAID,MAAa,gCAAgC,EAAE,aAAa;CACxD,UAAU,EAAE,KAAK,EAAE,OAAO,GAAG,EAAE,KAAK,GAAG,EAAE,UAAU,CAAC,CAAC;CACrD,WAAW,EAAE,KAAK,EAAE,OAAO,GAAG,EAAE,KAAK,GAAG,EAAE,UAAU,CAAC,CAAC;CACtD,YAAY,EAAE,KAAK,EAAE,OAAO,GAAG,EAAE,KAAK,GAAG,EAAE,UAAU,CAAC,CAAC;CACvD,SAAS,EAAE,KAAK,EAAE,OAAO,GAAG,EAAE,KAAK,GAAG,EAAE,UAAU,CAAC,CAAC;CACpD,YAAY,EAAE,KAAK,EAAE,OAAO,GAAG,EAAE,KAAK,GAAG,EAAE,UAAU,CAAC,CAAC;CACvD,QAAQ,EAAE,KAAK,EAAE,OAAO,GAAG,EAAE,KAAK,GAAG,EAAE,UAAU,CAAC,CAAC;AACvD,CAAC"}
|
|
1
|
+
{"version":3,"file":"mfa.schemas.js","names":["Proto.SessionLevel","Proto.MFAFactorType"],"sources":["../../../src/services/mfa/mfa.schemas.ts"],"sourcesContent":["import * as v from \"valibot\";\nimport * as Proto from \"../../gen/auth/v1/mfa_pb.js\";\nimport { JsonObjectSchema, OptionalTimestampMsSchema } from \"../../shared/schemas.js\";\nimport { requiredEnumLabel } from \"../../shared/proto-enum-codec.js\";\nimport {\n MfaChallengePurposeCodec,\n MfaFactorTypeCodec,\n MFA_CHALLENGE_PURPOSE_VALUES,\n SessionLevelCodec,\n} from \"./mfa.codecs.js\";\n\nexport const MfaSessionInfoSchema = v.pipe(\n v.object({\n sessionId: v.string(),\n sessionLevel: v.pipe(\n v.enum(Proto.SessionLevel),\n v.transform((v) =>\n requiredEnumLabel(\n SessionLevelCodec.protoToOutput,\n v,\n \"PolyesterClient.MfaSessionInfoSchema\",\n \"sessionLevel\",\n ),\n ),\n ),\n authenticationMethods: v.optional(v.array(v.string()), []),\n authTime: OptionalTimestampMsSchema,\n }),\n v.transform(({ sessionId, sessionLevel, authenticationMethods, authTime }) => ({\n sessionId,\n sessionLevel,\n authenticationMethods,\n authTimeMs: authTime,\n })),\n);\n\nexport type MfaSessionInfo = v.InferOutput<typeof MfaSessionInfoSchema>;\n\nexport const MfaFactorSchema = v.pipe(\n v.object({\n factorId: v.string(),\n factorType: v.pipe(\n v.enum(Proto.MFAFactorType),\n v.transform((v) =>\n requiredEnumLabel(\n MfaFactorTypeCodec.protoToOutput,\n v,\n \"PolyesterClient.MfaFactorSchema\",\n \"factorType\",\n ),\n ),\n ),\n label: v.string(),\n createdAt: OptionalTimestampMsSchema,\n lastUsedAt: OptionalTimestampMsSchema,\n }),\n v.transform(({ factorId, factorType, label, createdAt, lastUsedAt }) => ({\n factorId,\n factorType,\n label,\n createdAtMs: createdAt,\n lastUsedAtMs: lastUsedAt,\n })),\n);\n\nexport type MfaFactor = v.InferOutput<typeof MfaFactorSchema>;\n\nexport const ListMfaFactorsResponseSchema = v.object({\n factors: v.optional(v.array(MfaFactorSchema), []),\n hasRecoveryCodes: v.optional(v.boolean(), false),\n});\n\nexport type ListMfaFactorsResult = v.InferOutput<typeof ListMfaFactorsResponseSchema>;\n\nexport const BeginTotpEnrollmentInputSchema = v.strictObject({\n label: v.pipe(v.string(), v.trim(), v.minLength(1)),\n});\n\nexport type BeginTotpEnrollmentInput = v.InferInput<typeof BeginTotpEnrollmentInputSchema>;\n\nexport const BeginTotpEnrollmentResultSchema = v.object({\n enrollmentId: v.string(),\n secret: v.string(),\n otpauthUri: v.string(),\n expiresAt: OptionalTimestampMsSchema,\n});\n\nexport type BeginTotpEnrollmentResult = v.InferOutput<typeof BeginTotpEnrollmentResultSchema>;\n\nexport const FinishTotpEnrollmentInputSchema = v.strictObject({\n enrollmentId: v.pipe(v.string(), v.trim(), v.minLength(1)),\n code: v.pipe(v.string(), v.trim(), v.minLength(1)),\n});\n\nexport type FinishTotpEnrollmentInput = v.InferInput<typeof FinishTotpEnrollmentInputSchema>;\n\nexport const FinishTotpEnrollmentResultSchema = v.pipe(\n v.object({\n factor: v.optional(MfaFactorSchema),\n recoveryCodes: v.optional(v.array(v.string()), []),\n session: v.optional(MfaSessionInfoSchema),\n accessToken: v.optional(v.string(), \"\"),\n accessTokenExpiresAt: OptionalTimestampMsSchema,\n }),\n v.transform(({ factor, recoveryCodes, session, accessToken, accessTokenExpiresAt }) => ({\n factor,\n recoveryCodes,\n session,\n accessToken: accessToken.trim() || undefined,\n accessTokenExpiresAtMs: accessTokenExpiresAt,\n })),\n);\n\nexport type FinishTotpEnrollmentResult = v.InferOutput<typeof FinishTotpEnrollmentResultSchema>;\n\nexport const BeginPasskeyEnrollmentInputSchema = v.strictObject({\n label: v.pipe(v.string(), v.trim(), v.minLength(1)),\n});\n\nexport type BeginPasskeyEnrollmentInput = v.InferInput<typeof BeginPasskeyEnrollmentInputSchema>;\n\nexport const BeginPasskeyEnrollmentResultSchema = v.object({\n enrollmentId: v.string(),\n publicKey: v.optional(JsonObjectSchema),\n expiresAt: OptionalTimestampMsSchema,\n});\n\nexport type BeginPasskeyEnrollmentResult = v.InferOutput<typeof BeginPasskeyEnrollmentResultSchema>;\n\nexport const FinishPasskeyEnrollmentInputSchema = v.strictObject({\n enrollmentId: v.pipe(v.string(), v.trim(), v.minLength(1)),\n credential: JsonObjectSchema,\n});\n\nexport type FinishPasskeyEnrollmentInput = v.InferInput<typeof FinishPasskeyEnrollmentInputSchema>;\n\nexport const FinishPasskeyEnrollmentResultSchema = FinishTotpEnrollmentResultSchema;\n\nexport type FinishPasskeyEnrollmentResult = v.InferOutput<\n typeof FinishPasskeyEnrollmentResultSchema\n>;\n\nexport const BeginMfaChallengeInputSchema = v.pipe(\n v.strictObject({\n purpose: v.picklist(MFA_CHALLENGE_PURPOSE_VALUES),\n }),\n v.transform((data) => ({\n purpose: MfaChallengePurposeCodec.inputToProto[data.purpose],\n })),\n);\n\nexport type BeginMfaChallengeInput = v.InferInput<typeof BeginMfaChallengeInputSchema>;\n\nexport const BeginMfaChallengeResultSchema = v.object({\n challengeId: v.string(),\n allowedFactorTypes: v.pipe(\n v.array(v.enum(Proto.MFAFactorType)),\n v.transform((arr) =>\n arr.map((t) =>\n requiredEnumLabel(\n MfaFactorTypeCodec.protoToOutput,\n t,\n \"PolyesterClient.BeginMfaChallengeResultSchema\",\n \"allowed factor type\",\n ),\n ),\n ),\n ),\n publicKey: v.optional(JsonObjectSchema),\n expiresAt: OptionalTimestampMsSchema,\n});\n\nexport type BeginMfaChallengeResult = v.InferOutput<typeof BeginMfaChallengeResultSchema>;\n\nexport const VerifyTotpChallengeInputSchema = v.strictObject({\n challengeId: v.pipe(v.string(), v.trim(), v.minLength(1)),\n code: v.pipe(v.string(), v.trim(), v.minLength(1)),\n});\n\nexport type VerifyTotpChallengeInput = v.InferInput<typeof VerifyTotpChallengeInputSchema>;\n\nexport const FinishPasskeyChallengeInputSchema = v.strictObject({\n challengeId: v.pipe(v.string(), v.trim(), v.minLength(1)),\n credential: JsonObjectSchema,\n});\n\nexport type FinishPasskeyChallengeInput = v.InferInput<typeof FinishPasskeyChallengeInputSchema>;\n\nexport const VerifyRecoveryCodeChallengeInputSchema = v.strictObject({\n challengeId: v.pipe(v.string(), v.trim(), v.minLength(1)),\n recoveryCode: v.pipe(v.string(), v.trim(), v.minLength(1)),\n});\n\nexport type VerifyRecoveryCodeChallengeInput = v.InferInput<\n typeof VerifyRecoveryCodeChallengeInputSchema\n>;\n\nexport const CompleteMfaChallengeResultSchema = v.pipe(\n v.object({\n session: v.optional(MfaSessionInfoSchema),\n accessToken: v.string(),\n accessTokenExpiresAt: OptionalTimestampMsSchema,\n stepUpToken: v.string(),\n stepUpExpiresAt: OptionalTimestampMsSchema,\n }),\n v.transform(({ session, accessToken, accessTokenExpiresAt, stepUpToken, stepUpExpiresAt }) => ({\n session,\n accessToken: accessToken.trim() || undefined,\n accessTokenExpiresAtMs: accessTokenExpiresAt,\n stepUpToken: stepUpToken.trim() || undefined,\n stepUpExpiresAtMs: stepUpExpiresAt,\n })),\n);\n\nexport type CompleteMfaChallengeResult = v.InferOutput<typeof CompleteMfaChallengeResultSchema>;\n\nexport const DeleteMfaFactorInputSchema = v.strictObject({\n factorId: v.pipe(v.string(), v.trim(), v.minLength(1)),\n});\n\nexport type DeleteMfaFactorInput = v.InferInput<typeof DeleteMfaFactorInputSchema>;\n\nexport const UpdateMfaFactorInputSchema = v.strictObject({\n factorId: v.pipe(v.string(), v.trim(), v.minLength(1)),\n label: v.pipe(v.string(), v.maxLength(128)),\n});\n\nexport type UpdateMfaFactorInput = v.InferInput<typeof UpdateMfaFactorInputSchema>;\n\nexport const UpdateMfaFactorResultSchema = v.object({\n factor: v.optional(MfaFactorSchema),\n});\n\nexport type UpdateMfaFactorResult = v.InferOutput<typeof UpdateMfaFactorResultSchema>;\n\nexport const RegenerateRecoveryCodesInputSchema = v.strictObject({});\n\nexport type RegenerateRecoveryCodesInput = v.InferInput<typeof RegenerateRecoveryCodesInputSchema>;\n\nexport const RegenerateRecoveryCodesResultSchema = v.object({\n recoveryCodes: v.optional(v.array(v.string()), []),\n});\n\nexport type RegenerateRecoveryCodesResult = v.InferOutput<\n typeof RegenerateRecoveryCodesResultSchema\n>;\n\nexport const ClaimFreshStepUpInputSchema = v.strictObject({\n requestId: v.pipe(v.string(), v.trim(), v.minLength(1)),\n actionType: v.pipe(v.string(), v.trim(), v.minLength(1)),\n subject: v.pipe(v.string(), v.trim(), v.minLength(1)),\n});\n\nexport type ClaimFreshStepUpInput = v.InferInput<typeof ClaimFreshStepUpInputSchema>;\n\nexport const ClaimFreshStepUpResultSchema = v.object({\n stepUpId: v.string(),\n claimNonce: v.string(),\n claimExpiresAt: OptionalTimestampMsSchema,\n});\n\nexport type ClaimFreshStepUpResult = v.InferOutput<typeof ClaimFreshStepUpResultSchema>;\n\nexport const ConsumeFreshStepUpInputSchema = v.strictObject({\n stepUpId: v.pipe(v.string(), v.trim(), v.minLength(1)),\n requestId: v.pipe(v.string(), v.trim(), v.minLength(1)),\n actionType: v.pipe(v.string(), v.trim(), v.minLength(1)),\n subject: v.pipe(v.string(), v.trim(), v.minLength(1)),\n claimNonce: v.pipe(v.string(), v.trim(), v.minLength(1)),\n});\n\nexport type ConsumeFreshStepUpInput = v.InferInput<typeof ConsumeFreshStepUpInputSchema>;\n\nexport const ReleaseFreshStepUpInputSchema = v.strictObject({\n stepUpId: v.pipe(v.string(), v.trim(), v.minLength(1)),\n requestId: v.pipe(v.string(), v.trim(), v.minLength(1)),\n actionType: v.pipe(v.string(), v.trim(), v.minLength(1)),\n subject: v.pipe(v.string(), v.trim(), v.minLength(1)),\n claimNonce: v.pipe(v.string(), v.trim(), v.minLength(1)),\n reason: v.pipe(v.string(), v.trim(), v.minLength(1)),\n});\n\nexport type ReleaseFreshStepUpInput = v.InferInput<typeof ReleaseFreshStepUpInputSchema>;\n"],"mappings":";;;;;;AAWA,MAAa,uBAAuB,EAAE,KAClC,EAAE,OAAO;CACL,WAAW,EAAE,OAAO;CACpB,cAAc,EAAE,KACZ,EAAE,KAAKA,YAAkB,GACzB,EAAE,WAAW,MACT,kBACI,kBAAkB,eAClB,GACA,wCACA,cACJ,CACJ,CACJ;CACA,uBAAuB,EAAE,SAAS,EAAE,MAAM,EAAE,OAAO,CAAC,GAAG,CAAC,CAAC;CACzD,UAAU;AACd,CAAC,GACD,EAAE,WAAW,EAAE,WAAW,cAAc,uBAAuB,gBAAgB;CAC3E;CACA;CACA;CACA,YAAY;AAChB,EAAE,CACN;AAIA,MAAa,kBAAkB,EAAE,KAC7B,EAAE,OAAO;CACL,UAAU,EAAE,OAAO;CACnB,YAAY,EAAE,KACV,EAAE,KAAKC,aAAmB,GAC1B,EAAE,WAAW,MACT,kBACI,mBAAmB,eACnB,GACA,mCACA,YACJ,CACJ,CACJ;CACA,OAAO,EAAE,OAAO;CAChB,WAAW;CACX,YAAY;AAChB,CAAC,GACD,EAAE,WAAW,EAAE,UAAU,YAAY,OAAO,WAAW,kBAAkB;CACr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{
|
|
6
6
|
readonly policyClass: v.SchemaWithPipe<readonly [v.EnumSchema<typeof TradingRateLimitClass, undefined>, v.TransformAction<TradingRateLimitClass, TradingRateLimitClass$1>]>;
|
|
7
|
-
readonly
|
|
7
|
+
readonly vipTier: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>;
|
|
8
8
|
readonly quotaWeight: v.SchemaWithPipe<readonly [v.BigintSchema<undefined>, v.TransformAction<bigint, string>]>;
|
|
9
9
|
readonly periodMs: v.SchemaWithPipe<readonly [v.BigintSchema<undefined>, v.TransformAction<bigint, string>]>;
|
|
10
10
|
readonly burstWeight: v.SchemaWithPipe<readonly [v.BigintSchema<undefined>, v.TransformAction<bigint, string>]>;
|
|
@@ -21,7 +21,7 @@ declare const RateLimitConfigSchema: v.ObjectSchema<{
|
|
|
21
21
|
}, number>]>;
|
|
22
22
|
readonly rules: v.ArraySchema<v.ObjectSchema<{
|
|
23
23
|
readonly policyClass: v.SchemaWithPipe<readonly [v.EnumSchema<typeof TradingRateLimitClass, undefined>, v.TransformAction<TradingRateLimitClass, TradingRateLimitClass$1>]>;
|
|
24
|
-
readonly
|
|
24
|
+
readonly vipTier: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>;
|
|
25
25
|
readonly quotaWeight: v.SchemaWithPipe<readonly [v.BigintSchema<undefined>, v.TransformAction<bigint, string>]>;
|
|
26
26
|
readonly periodMs: v.SchemaWithPipe<readonly [v.BigintSchema<undefined>, v.TransformAction<bigint, string>]>;
|
|
27
27
|
readonly burstWeight: v.SchemaWithPipe<readonly [v.BigintSchema<undefined>, v.TransformAction<bigint, string>]>;
|
|
@@ -31,7 +31,7 @@ type RateLimitConfig = v.InferOutput<typeof RateLimitConfigSchema>;
|
|
|
31
31
|
declare const TradingRateLimitsSchema: v.ObjectSchema<{
|
|
32
32
|
readonly apiKeyRules: v.OptionalSchema<v.ArraySchema<v.ObjectSchema<{
|
|
33
33
|
readonly policyClass: v.SchemaWithPipe<readonly [v.EnumSchema<typeof TradingRateLimitClass, undefined>, v.TransformAction<TradingRateLimitClass, TradingRateLimitClass$1>]>;
|
|
34
|
-
readonly
|
|
34
|
+
readonly vipTier: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>;
|
|
35
35
|
readonly quotaWeight: v.SchemaWithPipe<readonly [v.BigintSchema<undefined>, v.TransformAction<bigint, string>]>;
|
|
36
36
|
readonly periodMs: v.SchemaWithPipe<readonly [v.BigintSchema<undefined>, v.TransformAction<bigint, string>]>;
|
|
37
37
|
readonly burstWeight: v.SchemaWithPipe<readonly [v.BigintSchema<undefined>, v.TransformAction<bigint, string>]>;
|
|
@@ -46,7 +46,7 @@ declare const TradingRateLimitsSchema: v.ObjectSchema<{
|
|
|
46
46
|
}, number>]>;
|
|
47
47
|
readonly rules: v.ArraySchema<v.ObjectSchema<{
|
|
48
48
|
readonly policyClass: v.SchemaWithPipe<readonly [v.EnumSchema<typeof TradingRateLimitClass, undefined>, v.TransformAction<TradingRateLimitClass, TradingRateLimitClass$1>]>;
|
|
49
|
-
readonly
|
|
49
|
+
readonly vipTier: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>;
|
|
50
50
|
readonly quotaWeight: v.SchemaWithPipe<readonly [v.BigintSchema<undefined>, v.TransformAction<bigint, string>]>;
|
|
51
51
|
readonly periodMs: v.SchemaWithPipe<readonly [v.BigintSchema<undefined>, v.TransformAction<bigint, string>]>;
|
|
52
52
|
readonly burstWeight: v.SchemaWithPipe<readonly [v.BigintSchema<undefined>, v.TransformAction<bigint, string>]>;
|
|
@@ -9,7 +9,7 @@ import * as v from "valibot";
|
|
|
9
9
|
const TradingRateLimitClassOutputSchema = v.pipe(v.enum(TradingRateLimitClass), v.transform((value) => requiredEnumLabel(TradingRateLimitClassCodec.protoToOutput, value, "TradingRateLimitRuleSchema", "policyClass")));
|
|
10
10
|
const TradingRateLimitRuleSchema = v.object({
|
|
11
11
|
policyClass: TradingRateLimitClassOutputSchema,
|
|
12
|
-
|
|
12
|
+
vipTier: VipTierNumberSchema,
|
|
13
13
|
quotaWeight: BigIntStringSchema,
|
|
14
14
|
periodMs: BigIntStringSchema,
|
|
15
15
|
burstWeight: BigIntStringSchema
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rate-limits.schemas.js","names":["Proto.TradingRateLimitClass"],"sources":["../../../src/services/rate-limits/rate-limits.schemas.ts"],"sourcesContent":["import * as v from \"valibot\";\nimport * as Proto from \"../../gen/ratelimit/v1/ratelimit_pb.js\";\nimport {\n AccountScopeInputEntries,\n accountScopeToSubaccountId,\n} from \"../../shared/account-scope.js\";\nimport { requiredEnumLabel } from \"../../shared/proto-enum-codec.js\";\nimport { BigIntStringSchema, TimestampMsSchema } from \"../../shared/schemas.js\";\nimport { VipTierNumberSchema } from \"../vip/vip.schemas.js\";\nimport { TradingRateLimitClassCodec, type TradingRateLimitClass } from \"./rate-limits.codecs.js\";\n\nexport type { TradingRateLimitClass } from \"./rate-limits.codecs.js\";\n\nconst TradingRateLimitClassOutputSchema = v.pipe(\n v.enum(Proto.TradingRateLimitClass),\n v.transform(\n (value): TradingRateLimitClass =>\n requiredEnumLabel(\n TradingRateLimitClassCodec.protoToOutput,\n value,\n \"TradingRateLimitRuleSchema\",\n \"policyClass\",\n ),\n ),\n);\n\nexport const TradingRateLimitRuleSchema = v.object({\n policyClass: TradingRateLimitClassOutputSchema,\n
|
|
1
|
+
{"version":3,"file":"rate-limits.schemas.js","names":["Proto.TradingRateLimitClass"],"sources":["../../../src/services/rate-limits/rate-limits.schemas.ts"],"sourcesContent":["import * as v from \"valibot\";\nimport * as Proto from \"../../gen/ratelimit/v1/ratelimit_pb.js\";\nimport {\n AccountScopeInputEntries,\n accountScopeToSubaccountId,\n} from \"../../shared/account-scope.js\";\nimport { requiredEnumLabel } from \"../../shared/proto-enum-codec.js\";\nimport { BigIntStringSchema, TimestampMsSchema } from \"../../shared/schemas.js\";\nimport { VipTierNumberSchema } from \"../vip/vip.schemas.js\";\nimport { TradingRateLimitClassCodec, type TradingRateLimitClass } from \"./rate-limits.codecs.js\";\n\nexport type { TradingRateLimitClass } from \"./rate-limits.codecs.js\";\n\nconst TradingRateLimitClassOutputSchema = v.pipe(\n v.enum(Proto.TradingRateLimitClass),\n v.transform(\n (value): TradingRateLimitClass =>\n requiredEnumLabel(\n TradingRateLimitClassCodec.protoToOutput,\n value,\n \"TradingRateLimitRuleSchema\",\n \"policyClass\",\n ),\n ),\n);\n\nexport const TradingRateLimitRuleSchema = v.object({\n policyClass: TradingRateLimitClassOutputSchema,\n vipTier: VipTierNumberSchema,\n quotaWeight: BigIntStringSchema,\n periodMs: BigIntStringSchema,\n burstWeight: BigIntStringSchema,\n});\n\nexport type TradingRateLimitRule = v.InferOutput<typeof TradingRateLimitRuleSchema>;\n\nexport const RateLimitConfigSchema = v.object({\n policyVersion: BigIntStringSchema,\n effectiveFrom: TimestampMsSchema,\n rules: v.array(TradingRateLimitRuleSchema),\n});\n\nexport type RateLimitConfig = v.InferOutput<typeof RateLimitConfigSchema>;\n\nexport const GetTradingRateLimitsInputSchema = v.pipe(\n v.strictObject({\n ...AccountScopeInputEntries,\n }),\n v.transform(({ account }) => ({\n subaccountId: accountScopeToSubaccountId(account),\n })),\n);\n\nexport const TradingRateLimitsSchema = v.object({\n ...RateLimitConfigSchema.entries,\n apiKeyRules: v.optional(v.array(TradingRateLimitRuleSchema), []),\n});\n\nexport type TradingRateLimits = v.InferOutput<typeof TradingRateLimitsSchema>;\n"],"mappings":";;;;;;;;AAaA,MAAM,oCAAoC,EAAE,KACxC,EAAE,KAAKA,qBAA2B,GAClC,EAAE,WACG,UACG,kBACI,2BAA2B,eAC3B,OACA,8BACA,aACJ,CACR,CACJ;AAEA,MAAa,6BAA6B,EAAE,OAAO;CAC/C,aAAa;CACb,SAAS;CACT,aAAa;CACb,UAAU;CACV,aAAa;AACjB,CAAC;AAID,MAAa,wBAAwB,EAAE,OAAO;CAC1C,eAAe;CACf,eAAe;CACf,OAAO,EAAE,MAAM,0BAA0B;AAC7C,CAAC;AAID,MAAa,kCAAkC,EAAE,KAC7C,EAAE,aAAa,EACX,GAAG,yBACP,CAAC,GACD,EAAE,WAAW,EAAE,eAAe,EAC1B,cAAc,2BAA2B,OAAO,EACpD,EAAE,CACN;AAEA,MAAa,0BAA0B,EAAE,OAAO;CAC5C,GAAG,sBAAsB;CACzB,aAAa,EAAE,SAAS,EAAE,MAAM,0BAA0B,GAAG,CAAC,CAAC;AACnE,CAAC"}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { CreateSubaccountInput, CreateSubaccountInputSchema, CreateSubaccountResult, CreateSubaccountResultSchema, DeleteSubaccountInputSchema, InviteSubaccountMemberInput, InviteSubaccountMemberInputSchema, ListSubaccountInvitesInput, ListSubaccountInvitesInputSchema, RemoveSubaccountMemberInput, RemoveSubaccountMemberInputSchema, RespondSubaccountInviteInput, RespondSubaccountInviteInputSchema, SetSubaccountMemberMfaRequirementInput, SetSubaccountMemberMfaRequirementInputSchema, Subaccount, SubaccountActivityEventSchema, SubaccountActivityInput, SubaccountActivityInputSchema, SubaccountEvent, SubaccountIdInput, SubaccountIdInputSchema, SubaccountInvite, SubaccountInviteSchema, SubaccountInviteStatus, SubaccountMember, SubaccountMemberSchema, SubaccountMutationResult, SubaccountMutationResultSchema, SubaccountRole, SubaccountRoleSchema, SubaccountSchema, SubaccountStatus, UpdateSubaccountInput, UpdateSubaccountInputSchema, UpdateSubaccountMemberRoleInput, UpdateSubaccountMemberRoleInputSchema } from "./subaccounts.schemas.js";
|
|
1
|
+
import { CreateSubaccountInput, CreateSubaccountInputSchema, CreateSubaccountResult, CreateSubaccountResultSchema, DeleteSubaccountInputSchema, EffectiveSubaccountPermissions, EffectiveSubaccountPermissionsSchema, InviteSubaccountMemberInput, InviteSubaccountMemberInputSchema, ListSubaccountInvitesInput, ListSubaccountInvitesInputSchema, RemoveSubaccountMemberInput, RemoveSubaccountMemberInputSchema, RespondSubaccountInviteInput, RespondSubaccountInviteInputSchema, SetSubaccountMemberMfaRequirementInput, SetSubaccountMemberMfaRequirementInputSchema, Subaccount, SubaccountActivityEventSchema, SubaccountActivityInput, SubaccountActivityInputSchema, SubaccountEvent, SubaccountIdInput, SubaccountIdInputSchema, SubaccountInvite, SubaccountInviteSchema, SubaccountInviteStatus, SubaccountMember, SubaccountMemberSchema, SubaccountMutationResult, SubaccountMutationResultSchema, SubaccountPermission, SubaccountPermissionDefinition, SubaccountPermissionDefinitionSchema, SubaccountRole, SubaccountRoleCatalog, SubaccountRoleCatalogSchema, SubaccountRoleDefinition, SubaccountRoleDefinitionSchema, SubaccountRoleSchema, SubaccountSchema, SubaccountStatus, UpdateSubaccountInput, UpdateSubaccountInputSchema, UpdateSubaccountMemberRoleInput, UpdateSubaccountMemberRoleInputSchema } from "./subaccounts.schemas.js";
|
|
2
2
|
import { SubaccountsService } from "./subaccounts.js";
|
|
3
|
-
export { CreateSubaccountInput, CreateSubaccountInputSchema, CreateSubaccountResult, CreateSubaccountResultSchema, DeleteSubaccountInputSchema, InviteSubaccountMemberInput, InviteSubaccountMemberInputSchema, ListSubaccountInvitesInput, ListSubaccountInvitesInputSchema, RemoveSubaccountMemberInput, RemoveSubaccountMemberInputSchema, RespondSubaccountInviteInput, RespondSubaccountInviteInputSchema, SetSubaccountMemberMfaRequirementInput, SetSubaccountMemberMfaRequirementInputSchema, Subaccount, SubaccountActivityEventSchema, SubaccountActivityInput, SubaccountActivityInputSchema, SubaccountEvent, SubaccountIdInput, SubaccountIdInputSchema, SubaccountInvite, SubaccountInviteSchema, SubaccountInviteStatus, SubaccountMember, SubaccountMemberSchema, SubaccountMutationResult, SubaccountMutationResultSchema, SubaccountRole, SubaccountRoleSchema, SubaccountSchema, SubaccountStatus, SubaccountsService, UpdateSubaccountInput, UpdateSubaccountInputSchema, UpdateSubaccountMemberRoleInput, UpdateSubaccountMemberRoleInputSchema };
|
|
3
|
+
export { CreateSubaccountInput, CreateSubaccountInputSchema, CreateSubaccountResult, CreateSubaccountResultSchema, DeleteSubaccountInputSchema, EffectiveSubaccountPermissions, EffectiveSubaccountPermissionsSchema, InviteSubaccountMemberInput, InviteSubaccountMemberInputSchema, ListSubaccountInvitesInput, ListSubaccountInvitesInputSchema, RemoveSubaccountMemberInput, RemoveSubaccountMemberInputSchema, RespondSubaccountInviteInput, RespondSubaccountInviteInputSchema, SetSubaccountMemberMfaRequirementInput, SetSubaccountMemberMfaRequirementInputSchema, Subaccount, SubaccountActivityEventSchema, SubaccountActivityInput, SubaccountActivityInputSchema, SubaccountEvent, SubaccountIdInput, SubaccountIdInputSchema, SubaccountInvite, SubaccountInviteSchema, SubaccountInviteStatus, SubaccountMember, SubaccountMemberSchema, SubaccountMutationResult, SubaccountMutationResultSchema, SubaccountPermission, SubaccountPermissionDefinition, SubaccountPermissionDefinitionSchema, SubaccountRole, SubaccountRoleCatalog, SubaccountRoleCatalogSchema, SubaccountRoleDefinition, SubaccountRoleDefinitionSchema, SubaccountRoleSchema, SubaccountSchema, SubaccountStatus, SubaccountsService, UpdateSubaccountInput, UpdateSubaccountInputSchema, UpdateSubaccountMemberRoleInput, UpdateSubaccountMemberRoleInputSchema };
|
|
@@ -29,6 +29,34 @@ const SubaccountRoleCodec = {
|
|
|
29
29
|
[1]: "viewer"
|
|
30
30
|
}
|
|
31
31
|
};
|
|
32
|
+
const SubaccountPermissionCodec = { protoToOutput: {
|
|
33
|
+
[0]: "unspecified",
|
|
34
|
+
[1]: "read_subaccount",
|
|
35
|
+
[2]: "update_subaccount",
|
|
36
|
+
[3]: "read_balances",
|
|
37
|
+
[4]: "read_spot",
|
|
38
|
+
[5]: "trade_spot",
|
|
39
|
+
[6]: "read_internal_transfers",
|
|
40
|
+
[7]: "internal_transfer",
|
|
41
|
+
[8]: "external_withdraw",
|
|
42
|
+
[9]: "read_address_book",
|
|
43
|
+
[10]: "manage_address_book",
|
|
44
|
+
[11]: "read_members",
|
|
45
|
+
[12]: "manage_members",
|
|
46
|
+
[13]: "read_invites",
|
|
47
|
+
[14]: "manage_invites",
|
|
48
|
+
[15]: "read_api_keys",
|
|
49
|
+
[16]: "manage_api_keys",
|
|
50
|
+
[17]: "read_subaccount_policy",
|
|
51
|
+
[18]: "manage_subaccount_policy",
|
|
52
|
+
[19]: "read_activity",
|
|
53
|
+
[20]: "read_activity_security_details",
|
|
54
|
+
[21]: "manage_member_mfa_requirement",
|
|
55
|
+
[22]: "create_deposit_address",
|
|
56
|
+
[23]: "read_deposit_addresses",
|
|
57
|
+
[24]: "read_guard_signer_status",
|
|
58
|
+
[25]: "manage_guard_signer"
|
|
59
|
+
} };
|
|
32
60
|
const InviteActionCodec = { inputToProto: {
|
|
33
61
|
accept: 1,
|
|
34
62
|
decline: 2,
|
|
@@ -89,6 +117,6 @@ const ActivityEventSourceCodec = { protoToOutput: {
|
|
|
89
117
|
[3]: "api"
|
|
90
118
|
} };
|
|
91
119
|
//#endregion
|
|
92
|
-
export { ActivityEntityKindCodec, ActivityEventActionCodec, ActivityEventSourceCodec, InviteActionCodec, InviteStatusCodec, SUBACCOUNT_STATUS_VALUES, SubaccountRoleCodec, SubaccountStatusCodec };
|
|
120
|
+
export { ActivityEntityKindCodec, ActivityEventActionCodec, ActivityEventSourceCodec, InviteActionCodec, InviteStatusCodec, SUBACCOUNT_STATUS_VALUES, SubaccountPermissionCodec, SubaccountRoleCodec, SubaccountStatusCodec };
|
|
93
121
|
|
|
94
122
|
//# sourceMappingURL=subaccounts.codecs.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"subaccounts.codecs.js","names":[],"sources":["../../../src/services/subaccounts/subaccounts.codecs.ts"],"sourcesContent":["import * as Proto from \"../../gen/auth/v1/subaccounts_pb.js\";\nimport type { InputToProto, ProtoToOutput } from \"../../utils/types.js\";\n\nexport const SUBACCOUNT_ROLE_VALUES = [\n \"owner\",\n \"admin\",\n \"treasury\",\n \"leveraged_trader\",\n \"trader\",\n \"viewer\",\n] as const;\nexport type SubaccountRoleValue = (typeof SUBACCOUNT_ROLE_VALUES)[number];\n\nexport const SUBACCOUNT_INVITE_ACTION_VALUES = [\"accept\", \"decline\", \"cancel\"] as const;\nexport type SubaccountInviteActionValue = (typeof SUBACCOUNT_INVITE_ACTION_VALUES)[number];\n\nexport const SUBACCOUNT_INVITE_STATUS_VALUES = [\n \"pending\",\n \"accepted\",\n \"declined\",\n \"cancelled\",\n] as const;\nexport type SubaccountInviteStatusValue = (typeof SUBACCOUNT_INVITE_STATUS_VALUES)[number];\n\nexport const SUBACCOUNT_STATUS_VALUES = [\"active\", \"disabled\", \"deleted\"] as const;\nexport type SubaccountStatusValue = (typeof SUBACCOUNT_STATUS_VALUES)[number];\n\nexport const ACTIVITY_ENTITY_KIND_VALUES = [\n \"account\",\n \"session\",\n \"api_key\",\n \"subaccount\",\n \"member\",\n \"policy\",\n \"invite\",\n \"security\",\n \"destination\",\n] as const;\nexport type ActivityEntityKindValue = (typeof ACTIVITY_ENTITY_KIND_VALUES)[number];\n\nexport const ACTIVITY_EVENT_ACTION_VALUES = [\n \"created\",\n \"updated\",\n \"deleted\",\n \"enabled\",\n \"disabled\",\n \"removed\",\n \"role_set\",\n \"received\",\n \"replied\",\n \"failed\",\n \"revoked\",\n \"blocked\",\n \"hold_placed\",\n \"hold_released\",\n] as const;\nexport type ActivityEventActionValue = (typeof ACTIVITY_EVENT_ACTION_VALUES)[number];\n\nexport const ACTIVITY_EVENT_SOURCE_VALUES = [\"web\", \"mobile\", \"api\"] as const;\nexport type ActivityEventSourceValue = (typeof ACTIVITY_EVENT_SOURCE_VALUES)[number];\ntype SubaccountStatusProto = Proto.SubaccountUpdateSpec[\"status\"] & Proto.Subaccount[\"status\"];\n\nconst SubaccountStatusProto = {\n ACTIVE: \"active\",\n DISABLED: \"disabled\",\n DELETED: \"deleted\",\n} as const satisfies Record<string, SubaccountStatusProto>;\n\nexport const SubaccountRoleCodec = {\n inputToProto: {\n owner: Proto.SubaccountRole.OWNER,\n admin: Proto.SubaccountRole.ADMIN,\n treasury: Proto.SubaccountRole.TREASURY,\n leveraged_trader: Proto.SubaccountRole.LEVERAGED_TRADER,\n trader: Proto.SubaccountRole.TRADER,\n viewer: Proto.SubaccountRole.VIEWER,\n } satisfies InputToProto<SubaccountRoleValue, Proto.SubaccountRole>,\n protoToOutput: {\n [Proto.SubaccountRole.SUBACCOUNT_ROLE_UNSPECIFIED]: \"unspecified\",\n [Proto.SubaccountRole.OWNER]: \"owner\",\n [Proto.SubaccountRole.ADMIN]: \"admin\",\n [Proto.SubaccountRole.TREASURY]: \"treasury\",\n [Proto.SubaccountRole.LEVERAGED_TRADER]: \"leveraged_trader\",\n [Proto.SubaccountRole.TRADER]: \"trader\",\n [Proto.SubaccountRole.VIEWER]: \"viewer\",\n } satisfies ProtoToOutput<Proto.SubaccountRole, SubaccountRoleValue>,\n} as const;\n\nexport const InviteActionCodec = {\n inputToProto: {\n accept: Proto.SubaccountInviteAction.ACCEPT,\n decline: Proto.SubaccountInviteAction.DECLINE,\n cancel: Proto.SubaccountInviteAction.CANCEL,\n } satisfies InputToProto<SubaccountInviteActionValue, Proto.SubaccountInviteAction>,\n} as const;\n\nexport const InviteStatusCodec = {\n protoToOutput: {\n [Proto.SubaccountInviteStatus.UNSPECIFIED]: \"unspecified\",\n [Proto.SubaccountInviteStatus.PENDING]: \"pending\",\n [Proto.SubaccountInviteStatus.ACCEPTED]: \"accepted\",\n [Proto.SubaccountInviteStatus.DECLINED]: \"declined\",\n [Proto.SubaccountInviteStatus.CANCELLED]: \"cancelled\",\n } satisfies ProtoToOutput<Proto.SubaccountInviteStatus, SubaccountInviteStatusValue>,\n} as const;\n\nexport const SubaccountStatusCodec = {\n inputToProto: {\n active: SubaccountStatusProto.ACTIVE,\n disabled: SubaccountStatusProto.DISABLED,\n deleted: SubaccountStatusProto.DELETED,\n } satisfies Record<SubaccountStatusValue, SubaccountStatusProto>,\n protoToOutput: {\n [SubaccountStatusProto.ACTIVE]: \"active\",\n [SubaccountStatusProto.DISABLED]: \"disabled\",\n [SubaccountStatusProto.DELETED]: \"deleted\",\n } satisfies Record<SubaccountStatusProto, SubaccountStatusValue>,\n} as const;\n\nexport const ActivityEntityKindCodec = {\n protoToOutput: {\n [Proto.ActivityEntityKind.ACTIVITY_ENTITY_UNSPECIFIED]: \"unspecified\",\n [Proto.ActivityEntityKind.ACTIVITY_ENTITY_ACCOUNT]: \"account\",\n [Proto.ActivityEntityKind.ACTIVITY_ENTITY_SESSION]: \"session\",\n [Proto.ActivityEntityKind.ACTIVITY_ENTITY_API_KEY]: \"api_key\",\n [Proto.ActivityEntityKind.ACTIVITY_ENTITY_SUBACCOUNT]: \"subaccount\",\n [Proto.ActivityEntityKind.ACTIVITY_ENTITY_MEMBER]: \"member\",\n [Proto.ActivityEntityKind.ACTIVITY_ENTITY_POLICY]: \"policy\",\n [Proto.ActivityEntityKind.ACTIVITY_ENTITY_INVITE]: \"invite\",\n [Proto.ActivityEntityKind.ACTIVITY_ENTITY_SECURITY]: \"security\",\n [Proto.ActivityEntityKind.ACTIVITY_ENTITY_DESTINATION]: \"destination\",\n } satisfies ProtoToOutput<Proto.ActivityEntityKind, ActivityEntityKindValue>,\n} as const;\n\nexport const ActivityEventActionCodec = {\n protoToOutput: {\n [Proto.ActivityEventAction.ACTIVITY_ACTION_UNSPECIFIED]: \"unspecified\",\n [Proto.ActivityEventAction.ACTIVITY_ACTION_CREATED]: \"created\",\n [Proto.ActivityEventAction.ACTIVITY_ACTION_UPDATED]: \"updated\",\n [Proto.ActivityEventAction.ACTIVITY_ACTION_DELETED]: \"deleted\",\n [Proto.ActivityEventAction.ACTIVITY_ACTION_ENABLED]: \"enabled\",\n [Proto.ActivityEventAction.ACTIVITY_ACTION_DISABLED]: \"disabled\",\n [Proto.ActivityEventAction.ACTIVITY_ACTION_REMOVED]: \"removed\",\n [Proto.ActivityEventAction.ACTIVITY_ACTION_ROLE_SET]: \"role_set\",\n [Proto.ActivityEventAction.ACTIVITY_ACTION_RECEIVED]: \"received\",\n [Proto.ActivityEventAction.ACTIVITY_ACTION_REPLIED]: \"replied\",\n [Proto.ActivityEventAction.ACTIVITY_ACTION_FAILED]: \"failed\",\n [Proto.ActivityEventAction.ACTIVITY_ACTION_REVOKED]: \"revoked\",\n [Proto.ActivityEventAction.ACTIVITY_ACTION_BLOCKED]: \"blocked\",\n [Proto.ActivityEventAction.ACTIVITY_ACTION_HOLD_PLACED]: \"hold_placed\",\n [Proto.ActivityEventAction.ACTIVITY_ACTION_HOLD_RELEASED]: \"hold_released\",\n } satisfies ProtoToOutput<Proto.ActivityEventAction, ActivityEventActionValue>,\n} as const;\n\nexport const ActivityEventSourceCodec = {\n protoToOutput: {\n [Proto.ActivityEventSource.ACTIVITY_SOURCE_UNSPECIFIED]: \"unspecified\",\n [Proto.ActivityEventSource.ACTIVITY_SOURCE_WEB]: \"web\",\n [Proto.ActivityEventSource.ACTIVITY_SOURCE_MOBILE]: \"mobile\",\n [Proto.ActivityEventSource.ACTIVITY_SOURCE_API]: \"api\",\n } satisfies ProtoToOutput<Proto.ActivityEventSource, ActivityEventSourceValue>,\n} as const;\n"],"mappings":";;AAwBA,MAAa,2BAA2B;CAAC;CAAU;CAAY;AAAS;AAsCxE,MAAM,wBAAwB;CAC1B,QAAQ;CACR,UAAU;CACV,SAAS;AACb;AAEA,MAAa,sBAAsB;CAC/B,cAAc;EACV,OAAA;EACA,OAAA;EACA,UAAA;EACA,kBAAA;EACA,QAAA;EACA,QAAA;CACJ;CACA,eAAe;GACyC,IAAA;GACtB,IAAA;GACA,IAAA;GACG,IAAA;GACQ,IAAA;GACV,IAAA;GACA,IAAA;CACnC;AACJ;AAEA,MAAa,oBAAoB,EAC7B,cAAc;CACV,QAAA;CACA,SAAA;CACA,QAAA;AACJ,EACJ;AAEA,MAAa,oBAAoB,EAC7B,eAAe;EACiC,IAAA;EACJ,IAAA;EACC,IAAA;EACA,IAAA;EACC,IAAA;AAC9C,EACJ;AAEA,MAAa,wBAAwB;CACjC,cAAc;EACV,QAAQ,sBAAsB;EAC9B,UAAU,sBAAsB;EAChC,SAAS,sBAAsB;CACnC;CACA,eAAe;GACV,sBAAsB,SAAS;GAC/B,sBAAsB,WAAW;GACjC,sBAAsB,UAAU;CACrC;AACJ;AAEA,MAAa,0BAA0B,EACnC,eAAe;EAC6C,IAAA;EACJ,IAAA;EACA,IAAA;EACA,IAAA;EACG,IAAA;EACJ,IAAA;EACA,IAAA;EACA,IAAA;EACE,IAAA;EACG,IAAA;AAC5D,EACJ;AAEA,MAAa,2BAA2B,EACpC,eAAe;EAC8C,IAAA;EACJ,IAAA;EACA,IAAA;EACA,IAAA;EACA,IAAA;EACC,IAAA;EACD,IAAA;EACC,IAAA;EACA,IAAA;EACD,IAAA;EACD,KAAA;EACC,KAAA;EACA,KAAA;EACI,KAAA;EACE,KAAA;AAC/D,EACJ;AAEA,MAAa,2BAA2B,EACpC,eAAe;EAC8C,IAAA;EACR,IAAA;EACG,IAAA;EACH,IAAA;AACrD,EACJ"}
|
|
1
|
+
{"version":3,"file":"subaccounts.codecs.js","names":[],"sources":["../../../src/services/subaccounts/subaccounts.codecs.ts"],"sourcesContent":["import * as Proto from \"../../gen/auth/v1/subaccounts_pb.js\";\nimport type { InputToProto, ProtoToOutput } from \"../../utils/types.js\";\n\nexport const SUBACCOUNT_ROLE_VALUES = [\n \"owner\",\n \"admin\",\n \"treasury\",\n \"leveraged_trader\",\n \"trader\",\n \"viewer\",\n] as const;\nexport type SubaccountRoleValue = (typeof SUBACCOUNT_ROLE_VALUES)[number];\n\nexport const SUBACCOUNT_PERMISSION_VALUES = [\n \"read_subaccount\",\n \"update_subaccount\",\n \"read_balances\",\n \"read_spot\",\n \"trade_spot\",\n \"read_internal_transfers\",\n \"internal_transfer\",\n \"external_withdraw\",\n \"read_address_book\",\n \"manage_address_book\",\n \"read_members\",\n \"manage_members\",\n \"read_invites\",\n \"manage_invites\",\n \"read_api_keys\",\n \"manage_api_keys\",\n \"read_subaccount_policy\",\n \"manage_subaccount_policy\",\n \"read_activity\",\n \"read_activity_security_details\",\n \"manage_member_mfa_requirement\",\n \"create_deposit_address\",\n \"read_deposit_addresses\",\n \"read_guard_signer_status\",\n \"manage_guard_signer\",\n] as const;\nexport type SubaccountPermissionValue = (typeof SUBACCOUNT_PERMISSION_VALUES)[number];\n\nexport const SUBACCOUNT_INVITE_ACTION_VALUES = [\"accept\", \"decline\", \"cancel\"] as const;\nexport type SubaccountInviteActionValue = (typeof SUBACCOUNT_INVITE_ACTION_VALUES)[number];\n\nexport const SUBACCOUNT_INVITE_STATUS_VALUES = [\n \"pending\",\n \"accepted\",\n \"declined\",\n \"cancelled\",\n] as const;\nexport type SubaccountInviteStatusValue = (typeof SUBACCOUNT_INVITE_STATUS_VALUES)[number];\n\nexport const SUBACCOUNT_STATUS_VALUES = [\"active\", \"disabled\", \"deleted\"] as const;\nexport type SubaccountStatusValue = (typeof SUBACCOUNT_STATUS_VALUES)[number];\n\nexport const ACTIVITY_ENTITY_KIND_VALUES = [\n \"account\",\n \"session\",\n \"api_key\",\n \"subaccount\",\n \"member\",\n \"policy\",\n \"invite\",\n \"security\",\n \"destination\",\n] as const;\nexport type ActivityEntityKindValue = (typeof ACTIVITY_ENTITY_KIND_VALUES)[number];\n\nexport const ACTIVITY_EVENT_ACTION_VALUES = [\n \"created\",\n \"updated\",\n \"deleted\",\n \"enabled\",\n \"disabled\",\n \"removed\",\n \"role_set\",\n \"received\",\n \"replied\",\n \"failed\",\n \"revoked\",\n \"blocked\",\n \"hold_placed\",\n \"hold_released\",\n] as const;\nexport type ActivityEventActionValue = (typeof ACTIVITY_EVENT_ACTION_VALUES)[number];\n\nexport const ACTIVITY_EVENT_SOURCE_VALUES = [\"web\", \"mobile\", \"api\"] as const;\nexport type ActivityEventSourceValue = (typeof ACTIVITY_EVENT_SOURCE_VALUES)[number];\ntype SubaccountStatusProto = Proto.SubaccountUpdateSpec[\"status\"] & Proto.Subaccount[\"status\"];\n\nconst SubaccountStatusProto = {\n ACTIVE: \"active\",\n DISABLED: \"disabled\",\n DELETED: \"deleted\",\n} as const satisfies Record<string, SubaccountStatusProto>;\n\nexport const SubaccountRoleCodec = {\n inputToProto: {\n owner: Proto.SubaccountRole.OWNER,\n admin: Proto.SubaccountRole.ADMIN,\n treasury: Proto.SubaccountRole.TREASURY,\n leveraged_trader: Proto.SubaccountRole.LEVERAGED_TRADER,\n trader: Proto.SubaccountRole.TRADER,\n viewer: Proto.SubaccountRole.VIEWER,\n } satisfies InputToProto<SubaccountRoleValue, Proto.SubaccountRole>,\n protoToOutput: {\n [Proto.SubaccountRole.SUBACCOUNT_ROLE_UNSPECIFIED]: \"unspecified\",\n [Proto.SubaccountRole.OWNER]: \"owner\",\n [Proto.SubaccountRole.ADMIN]: \"admin\",\n [Proto.SubaccountRole.TREASURY]: \"treasury\",\n [Proto.SubaccountRole.LEVERAGED_TRADER]: \"leveraged_trader\",\n [Proto.SubaccountRole.TRADER]: \"trader\",\n [Proto.SubaccountRole.VIEWER]: \"viewer\",\n } satisfies ProtoToOutput<Proto.SubaccountRole, SubaccountRoleValue>,\n} as const;\n\nexport const SubaccountPermissionCodec = {\n protoToOutput: {\n [Proto.SubaccountPermission.UNSPECIFIED]: \"unspecified\",\n [Proto.SubaccountPermission.READ_SUBACCOUNT]: \"read_subaccount\",\n [Proto.SubaccountPermission.UPDATE_SUBACCOUNT]: \"update_subaccount\",\n [Proto.SubaccountPermission.READ_BALANCES]: \"read_balances\",\n [Proto.SubaccountPermission.READ_SPOT]: \"read_spot\",\n [Proto.SubaccountPermission.TRADE_SPOT]: \"trade_spot\",\n [Proto.SubaccountPermission.READ_INTERNAL_TRANSFERS]: \"read_internal_transfers\",\n [Proto.SubaccountPermission.INTERNAL_TRANSFER]: \"internal_transfer\",\n [Proto.SubaccountPermission.EXTERNAL_WITHDRAW]: \"external_withdraw\",\n [Proto.SubaccountPermission.READ_ADDRESS_BOOK]: \"read_address_book\",\n [Proto.SubaccountPermission.MANAGE_ADDRESS_BOOK]: \"manage_address_book\",\n [Proto.SubaccountPermission.READ_MEMBERS]: \"read_members\",\n [Proto.SubaccountPermission.MANAGE_MEMBERS]: \"manage_members\",\n [Proto.SubaccountPermission.READ_INVITES]: \"read_invites\",\n [Proto.SubaccountPermission.MANAGE_INVITES]: \"manage_invites\",\n [Proto.SubaccountPermission.READ_API_KEYS]: \"read_api_keys\",\n [Proto.SubaccountPermission.MANAGE_API_KEYS]: \"manage_api_keys\",\n [Proto.SubaccountPermission.READ_SUBACCOUNT_POLICY]: \"read_subaccount_policy\",\n [Proto.SubaccountPermission.MANAGE_SUBACCOUNT_POLICY]: \"manage_subaccount_policy\",\n [Proto.SubaccountPermission.READ_ACTIVITY]: \"read_activity\",\n [Proto.SubaccountPermission.READ_ACTIVITY_SECURITY_DETAILS]:\n \"read_activity_security_details\",\n [Proto.SubaccountPermission.MANAGE_MEMBER_MFA_REQUIREMENT]: \"manage_member_mfa_requirement\",\n [Proto.SubaccountPermission.CREATE_DEPOSIT_ADDRESS]: \"create_deposit_address\",\n [Proto.SubaccountPermission.READ_DEPOSIT_ADDRESSES]: \"read_deposit_addresses\",\n [Proto.SubaccountPermission.READ_GUARD_SIGNER_STATUS]: \"read_guard_signer_status\",\n [Proto.SubaccountPermission.MANAGE_GUARD_SIGNER]: \"manage_guard_signer\",\n } satisfies ProtoToOutput<Proto.SubaccountPermission, SubaccountPermissionValue>,\n} as const;\n\nexport const InviteActionCodec = {\n inputToProto: {\n accept: Proto.SubaccountInviteAction.ACCEPT,\n decline: Proto.SubaccountInviteAction.DECLINE,\n cancel: Proto.SubaccountInviteAction.CANCEL,\n } satisfies InputToProto<SubaccountInviteActionValue, Proto.SubaccountInviteAction>,\n} as const;\n\nexport const InviteStatusCodec = {\n protoToOutput: {\n [Proto.SubaccountInviteStatus.UNSPECIFIED]: \"unspecified\",\n [Proto.SubaccountInviteStatus.PENDING]: \"pending\",\n [Proto.SubaccountInviteStatus.ACCEPTED]: \"accepted\",\n [Proto.SubaccountInviteStatus.DECLINED]: \"declined\",\n [Proto.SubaccountInviteStatus.CANCELLED]: \"cancelled\",\n } satisfies ProtoToOutput<Proto.SubaccountInviteStatus, SubaccountInviteStatusValue>,\n} as const;\n\nexport const SubaccountStatusCodec = {\n inputToProto: {\n active: SubaccountStatusProto.ACTIVE,\n disabled: SubaccountStatusProto.DISABLED,\n deleted: SubaccountStatusProto.DELETED,\n } satisfies Record<SubaccountStatusValue, SubaccountStatusProto>,\n protoToOutput: {\n [SubaccountStatusProto.ACTIVE]: \"active\",\n [SubaccountStatusProto.DISABLED]: \"disabled\",\n [SubaccountStatusProto.DELETED]: \"deleted\",\n } satisfies Record<SubaccountStatusProto, SubaccountStatusValue>,\n} as const;\n\nexport const ActivityEntityKindCodec = {\n protoToOutput: {\n [Proto.ActivityEntityKind.ACTIVITY_ENTITY_UNSPECIFIED]: \"unspecified\",\n [Proto.ActivityEntityKind.ACTIVITY_ENTITY_ACCOUNT]: \"account\",\n [Proto.ActivityEntityKind.ACTIVITY_ENTITY_SESSION]: \"session\",\n [Proto.ActivityEntityKind.ACTIVITY_ENTITY_API_KEY]: \"api_key\",\n [Proto.ActivityEntityKind.ACTIVITY_ENTITY_SUBACCOUNT]: \"subaccount\",\n [Proto.ActivityEntityKind.ACTIVITY_ENTITY_MEMBER]: \"member\",\n [Proto.ActivityEntityKind.ACTIVITY_ENTITY_POLICY]: \"policy\",\n [Proto.ActivityEntityKind.ACTIVITY_ENTITY_INVITE]: \"invite\",\n [Proto.ActivityEntityKind.ACTIVITY_ENTITY_SECURITY]: \"security\",\n [Proto.ActivityEntityKind.ACTIVITY_ENTITY_DESTINATION]: \"destination\",\n } satisfies ProtoToOutput<Proto.ActivityEntityKind, ActivityEntityKindValue>,\n} as const;\n\nexport const ActivityEventActionCodec = {\n protoToOutput: {\n [Proto.ActivityEventAction.ACTIVITY_ACTION_UNSPECIFIED]: \"unspecified\",\n [Proto.ActivityEventAction.ACTIVITY_ACTION_CREATED]: \"created\",\n [Proto.ActivityEventAction.ACTIVITY_ACTION_UPDATED]: \"updated\",\n [Proto.ActivityEventAction.ACTIVITY_ACTION_DELETED]: \"deleted\",\n [Proto.ActivityEventAction.ACTIVITY_ACTION_ENABLED]: \"enabled\",\n [Proto.ActivityEventAction.ACTIVITY_ACTION_DISABLED]: \"disabled\",\n [Proto.ActivityEventAction.ACTIVITY_ACTION_REMOVED]: \"removed\",\n [Proto.ActivityEventAction.ACTIVITY_ACTION_ROLE_SET]: \"role_set\",\n [Proto.ActivityEventAction.ACTIVITY_ACTION_RECEIVED]: \"received\",\n [Proto.ActivityEventAction.ACTIVITY_ACTION_REPLIED]: \"replied\",\n [Proto.ActivityEventAction.ACTIVITY_ACTION_FAILED]: \"failed\",\n [Proto.ActivityEventAction.ACTIVITY_ACTION_REVOKED]: \"revoked\",\n [Proto.ActivityEventAction.ACTIVITY_ACTION_BLOCKED]: \"blocked\",\n [Proto.ActivityEventAction.ACTIVITY_ACTION_HOLD_PLACED]: \"hold_placed\",\n [Proto.ActivityEventAction.ACTIVITY_ACTION_HOLD_RELEASED]: \"hold_released\",\n } satisfies ProtoToOutput<Proto.ActivityEventAction, ActivityEventActionValue>,\n} as const;\n\nexport const ActivityEventSourceCodec = {\n protoToOutput: {\n [Proto.ActivityEventSource.ACTIVITY_SOURCE_UNSPECIFIED]: \"unspecified\",\n [Proto.ActivityEventSource.ACTIVITY_SOURCE_WEB]: \"web\",\n [Proto.ActivityEventSource.ACTIVITY_SOURCE_MOBILE]: \"mobile\",\n [Proto.ActivityEventSource.ACTIVITY_SOURCE_API]: \"api\",\n } satisfies ProtoToOutput<Proto.ActivityEventSource, ActivityEventSourceValue>,\n} as const;\n"],"mappings":";;AAqDA,MAAa,2BAA2B;CAAC;CAAU;CAAY;AAAS;AAsCxE,MAAM,wBAAwB;CAC1B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AA;EACD,IAAA;EACD,KAAA;EACC,KAAA;EACA,KAAA;EACI,KAAA;EACE,KAAA;AAC/D,EACJ;AAEA,MAAa,2BAA2B,EACpC,eAAe;EAC8C,IAAA;EACR,IAAA;EACG,IAAA;EACH,IAAA;AACrD,EACJ"}
|
|
@@ -8,7 +8,7 @@ import "../api-keys/index.js";
|
|
|
8
8
|
import { SubaccountPolicy } from "../policies/subaccount-policies/subaccount-policies.schemas.js";
|
|
9
9
|
import { SubaccountPoliciesService } from "../policies/subaccount-policies/subaccount-policies.js";
|
|
10
10
|
import "../policies/subaccount-policies/index.js";
|
|
11
|
-
import { CreateSubaccountInputSchema, CreateSubaccountResult, DeleteSubaccountInputSchema, InviteSubaccountMemberInputSchema, ListSubaccountInvitesInputSchema, RemoveSubaccountMemberInputSchema, RespondSubaccountInviteInputSchema, SetSubaccountMemberMfaRequirementInputSchema, Subaccount, SubaccountActivityInputSchema, SubaccountEvent, SubaccountIdInputSchema, SubaccountInvite, SubaccountMember, SubaccountMutationResult, SubaccountSchema, UpdateSubaccountInputSchema, UpdateSubaccountMemberRoleInputSchema } from "./subaccounts.schemas.js";
|
|
11
|
+
import { CreateSubaccountInputSchema, CreateSubaccountResult, DeleteSubaccountInputSchema, EffectiveSubaccountPermissions, InviteSubaccountMemberInputSchema, ListSubaccountInvitesInputSchema, RemoveSubaccountMemberInputSchema, RespondSubaccountInviteInputSchema, SetSubaccountMemberMfaRequirementInputSchema, Subaccount, SubaccountActivityInputSchema, SubaccountEvent, SubaccountIdInputSchema, SubaccountInvite, SubaccountMember, SubaccountMutationResult, SubaccountRoleCatalog, SubaccountSchema, UpdateSubaccountInputSchema, UpdateSubaccountMemberRoleInputSchema } from "./subaccounts.schemas.js";
|
|
12
12
|
import { Transport } from "@connectrpc/connect";
|
|
13
13
|
import * as v from "valibot";
|
|
14
14
|
//#region src/services/subaccounts/subaccounts.d.ts
|
|
@@ -69,6 +69,14 @@ declare class SubaccountsService {
|
|
|
69
69
|
* Returns incoming, outgoing, or all subaccount invitations for the caller, newest first.
|
|
70
70
|
*/
|
|
71
71
|
listInvites(input: v.InferInput<typeof ListSubaccountInvitesInputSchema>, options?: PolyesterRequestOptions): Promise<SubaccountInvite[]>;
|
|
72
|
+
/**
|
|
73
|
+
* Returns the public built-in role and permission catalog with display metadata and per-role permission sets.
|
|
74
|
+
*/
|
|
75
|
+
listRoles(options?: PolyesterRequestOptions): Promise<SubaccountRoleCatalog>;
|
|
76
|
+
/**
|
|
77
|
+
* Returns the caller's current role, effective role-granted permissions, and attached policy ID for a subaccount.
|
|
78
|
+
*/
|
|
79
|
+
getEffectivePermissions(input: v.InferInput<typeof SubaccountIdInputSchema>, options?: PolyesterRequestOptions): Promise<EffectiveSubaccountPermissions>;
|
|
72
80
|
/**
|
|
73
81
|
* Returns the owner and delegated members for a subaccount, including role and MFA enrollment status.
|
|
74
82
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"subaccounts.d.ts","names":[],"sources":["../../../src/services/subaccounts/subaccounts.ts"],"mappings":";;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"subaccounts.d.ts","names":[],"sources":["../../../src/services/subaccounts/subaccounts.ts"],"mappings":";;;;;;;;;;;;;;UAmDU,kCAAkC,mBAAmB;EAC3D;;UAGM,8BAA8B,mBAAmB;EACvD;;;;;cAMS;;WACA,UAAU;EAOP,YAAA,WAAW,WAAW,UAAU,mBAAmB,WAAW;;;;EAWpE,KAAK,UAAU,0BAA0B;IAC3C;IACA,aAAa,EAAE,mBAAmB;;;;;EAYhC,IACF,OAAO,EAAE,kBAAkB,0BAC3B,UAAU,0BACX,QACC;IACI,SAAS;IACT,QAAQ;IACR,SAAS;IACT,SAAS;;;;;EAmCX,OACF,OAAO,EAAE,kBAAkB,8BAC3B,UAAU,2BACX,QAAQ;;;;EAYL,OACF,OAAO,EAAE,kBAAkB,8BAC3B,UAAU,2BACX,QAAQ;;;;EAaL,aACF,OAAO,EAAE,kBAAkB,oCAC3B,UAAU,2BACX,QAAQ;;;;EAYL,aACF,OAAO,EAAE,kBAAkB,oCAC3B,UAAU,2BACX,QAAQ;;;;EAYL,iBACF,OAAO,EAAE,kBAAkB,wCAC3B,UAAU,2BACX,QAAQ;;;;EAYL,wBACF,OAAO,EAAE,kBAAkB,+CAC3B,UAAU,2BACX,QAAQ;;;;EAYL,YACF,OAAO,EAAE,kBAAkB,mCAC3B,UAAU,0BACX,QAAQ;;;;EAYL,UAAU,UAAU,0BAA0B,QAAQ;;;;EAQtD,wBACF,OAAO,EAAE,kBAAkB,0BAC3B,UAAU,0BACX,QAAQ;;;;EAYL,YACF,OAAO,EAAE,kBAAkB,0BAC3B,UAAU,0BACX,QAAQ;;;;EAYL,cACF,OAAO,EAAE,kBAAkB,qCAC3B,UAAU,2BACX,QAAQ;;;;EAYL,OACF,OAAO,EAAE,kBAAkB,8BAC3B,UAAU,2BACX,QAAQ;;;;EAkBL,WACF,OAAO,EAAE,kBAAkB,gCAC3B,UAAU,0BACX;IAAU,QAAQ;IAAmB;;;;;EAexC,UAAU,OAAO;;;;EAmBjB,iBAAiB,OAAO"}
|
|
@@ -3,10 +3,10 @@ import { parse } from "../../shared/validation.js";
|
|
|
3
3
|
import { toConnectCallOptions } from "../../shared/request-options.js";
|
|
4
4
|
import { ApiKeySchema } from "../../gen/auth/v1/api_keys_pb.js";
|
|
5
5
|
import { ApiKeySchema as ApiKeySchema$1 } from "../api-keys/api-keys.schemas.js";
|
|
6
|
-
import { SubaccountSchema, SubaccountService, SubaccountViewService } from "../../gen/auth/v1/subaccounts_pb.js";
|
|
6
|
+
import { SubaccountRoleService, SubaccountSchema, SubaccountService, SubaccountViewService } from "../../gen/auth/v1/subaccounts_pb.js";
|
|
7
7
|
import { DEFAULT_SUBACCOUNT_POLICY, SubaccountPolicySchema } from "../policies/subaccount-policies/subaccount-policies.schemas.js";
|
|
8
8
|
import { SubaccountPoliciesService } from "../policies/subaccount-policies/subaccount-policies.js";
|
|
9
|
-
import { CreateSubaccountInputSchema, CreateSubaccountResultSchema, DeleteSubaccountInputSchema, InviteSubaccountMemberInputSchema, ListSubaccountInvitesInputSchema, RemoveSubaccountMemberInputSchema, RespondSubaccountInviteInputSchema, SetSubaccountMemberMfaRequirementInputSchema, SubaccountActivityEventSchema, SubaccountActivityInputSchema, SubaccountIdInputSchema, SubaccountInviteSchema, SubaccountMemberSchema, SubaccountMutationResultSchema, SubaccountSchema as SubaccountSchema$1, UpdateSubaccountInputSchema, UpdateSubaccountMemberRoleInputSchema } from "./subaccounts.schemas.js";
|
|
9
|
+
import { CreateSubaccountInputSchema, CreateSubaccountResultSchema, DeleteSubaccountInputSchema, EffectiveSubaccountPermissionsSchema, InviteSubaccountMemberInputSchema, ListSubaccountInvitesInputSchema, RemoveSubaccountMemberInputSchema, RespondSubaccountInviteInputSchema, SetSubaccountMemberMfaRequirementInputSchema, SubaccountActivityEventSchema, SubaccountActivityInputSchema, SubaccountIdInputSchema, SubaccountInviteSchema, SubaccountMemberSchema, SubaccountMutationResultSchema, SubaccountRoleCatalogSchema, SubaccountSchema as SubaccountSchema$1, UpdateSubaccountInputSchema, UpdateSubaccountMemberRoleInputSchema } from "./subaccounts.schemas.js";
|
|
10
10
|
import { createClient } from "@connectrpc/connect";
|
|
11
11
|
import * as v from "valibot";
|
|
12
12
|
//#region src/services/subaccounts/subaccounts.ts
|
|
@@ -17,11 +17,13 @@ var SubaccountsService = class {
|
|
|
17
17
|
policies;
|
|
18
18
|
#client;
|
|
19
19
|
#viewClient;
|
|
20
|
+
#roleClient;
|
|
20
21
|
#realtime;
|
|
21
22
|
constructor(transport, realtime, resolver) {
|
|
22
23
|
this.policies = new SubaccountPoliciesService(transport, realtime, resolver);
|
|
23
24
|
this.#client = createClient(SubaccountService, transport);
|
|
24
25
|
this.#viewClient = createClient(SubaccountViewService, transport);
|
|
26
|
+
this.#roleClient = createClient(SubaccountRoleService, transport);
|
|
25
27
|
this.#realtime = realtime;
|
|
26
28
|
}
|
|
27
29
|
/**
|
|
@@ -116,6 +118,21 @@ var SubaccountsService = class {
|
|
|
116
118
|
return parse(v.array(SubaccountInviteSchema), res.invites);
|
|
117
119
|
}
|
|
118
120
|
/**
|
|
121
|
+
* Returns the public built-in role and permission catalog with display metadata and per-role permission sets.
|
|
122
|
+
*/
|
|
123
|
+
async listRoles(options) {
|
|
124
|
+
const res = await this.#roleClient.listSubaccountRoles({}, toConnectCallOptions(options));
|
|
125
|
+
return parse(SubaccountRoleCatalogSchema, res);
|
|
126
|
+
}
|
|
127
|
+
/**
|
|
128
|
+
* Returns the caller's current role, effective role-granted permissions, and attached policy ID for a subaccount.
|
|
129
|
+
*/
|
|
130
|
+
async getEffectivePermissions(input, options) {
|
|
131
|
+
const validatedInput = parse(SubaccountIdInputSchema, input);
|
|
132
|
+
const res = await this.#roleClient.getEffectiveSubaccountPermissions(validatedInput, toConnectCallOptions(options));
|
|
133
|
+
return parse(EffectiveSubaccountPermissionsSchema, res);
|
|
134
|
+
}
|
|
135
|
+
/**
|
|
119
136
|
* Returns the owner and delegated members for a subaccount, including role and MFA enrollment status.
|
|
120
137
|
*/
|
|
121
138
|
async listMembers(input, options) {
|