@capxul/observability 4.20.0-beta.2 → 4.20.0-beta.21

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.
@@ -1,748 +0,0 @@
1
- //#region ../errors/src/secret-material.ts
2
- const CREDENTIAL_FIELDS = /* @__PURE__ */ new Set([
3
- "password",
4
- "passwd",
5
- "pwd",
6
- "pass",
7
- "passphrase",
8
- "currentpassword",
9
- "newpassword",
10
- "confirmpassword",
11
- "passwordconfirmation",
12
- "passwordhash",
13
- "hashedpassword",
14
- "pin",
15
- "privatekey",
16
- "walletprivatekey",
17
- "secretkey",
18
- "signingkey",
19
- "signingsecret",
20
- "seed",
21
- "seedphrase",
22
- "mnemonic",
23
- "recoveryphrase",
24
- "recovery",
25
- "recoverycode",
26
- "recoverycodes",
27
- "keyshare",
28
- "signingmaterial",
29
- "recoverymaterial",
30
- "privatekeybytes",
31
- "signingprivatekey",
32
- "encryptionkey",
33
- "decryptionkey",
34
- "authtoken",
35
- "apitoken",
36
- "bearertoken",
37
- "oauthtoken",
38
- "csrftoken",
39
- "clientassertion",
40
- "token",
41
- "accesstoken",
42
- "refreshtoken",
43
- "idtoken",
44
- "sessiontoken",
45
- "session",
46
- "sessionkey",
47
- "sessionsecret",
48
- "authsessionid",
49
- "sessioncredential",
50
- "sessioncredentials",
51
- "sessioncookie",
52
- "auth",
53
- "authentication",
54
- "authorization",
55
- "proxyauthorization",
56
- "cookie",
57
- "cookies",
58
- "setcookie",
59
- "apikey",
60
- "xapikey",
61
- "xauthtoken",
62
- "clientsecret",
63
- "secret",
64
- "secrets",
65
- "credential",
66
- "credentials",
67
- "signature",
68
- "otp",
69
- "otpcode",
70
- "totpsecret",
71
- "onetimecode",
72
- "onetimepassword",
73
- "verificationcode",
74
- "authcode",
75
- "authorizationcode",
76
- "oauthcode",
77
- "codeverifier"
78
- ]);
79
- /** Match credential fields by meaning, without hiding token addresses or replay IDs. */
80
- function isCredentialField(name, context) {
81
- const normalized = name.toLowerCase().replace(/[^a-z0-9]/gu, "");
82
- return CREDENTIAL_FIELDS.has(normalized) || /(?:password(?:hash)?|passwd|passphrase|privatekey|signingkey|apikey|clientsecret|accesstoken|refreshtoken|sessiontoken)$/u.test(normalized) || context === "authentication" && (normalized === "code" || normalized === "sessionid") || context === "header" && /(?:token|secret|apikey|privatekey|signingkey|password|authorization|cookie|session)$/u.test(normalized);
83
- }
84
- function decodeUrlComponent(text) {
85
- try {
86
- return decodeURIComponent(text);
87
- } catch {
88
- return text;
89
- }
90
- }
91
- /** Preserve URL diagnostics while removing credentials from their declared components. */
92
- function redactUrlSecrets(value, source) {
93
- try {
94
- const absolute = /^[a-z][a-z0-9+.-]*:/iu.test(value);
95
- const protocolRelative = value.startsWith("//");
96
- const url = new URL(value, "https://redaction.invalid");
97
- if (url.protocol !== "https:" && url.protocol !== "http:") return maskText(value);
98
- let changed = url.username.length > 0 || url.password.length > 0;
99
- const maskParams = (params) => new URLSearchParams(Array.from(params, ([name, entry]) => {
100
- const safeName = maskText(name);
101
- const safeEntry = isCredentialField(name) || /^(?:code|draft|__posthog)$/iu.test(name) ? "[REDACTED]" : maskText(entry);
102
- changed ||= safeName !== name || safeEntry !== entry;
103
- return [safeName, safeEntry];
104
- })).toString();
105
- const provider = source === "alchemy" || source === "infura" || /(?:^|\.)(?:alchemy\.com|alchemyapi\.io|infura\.io)$/iu.test(url.hostname);
106
- const rawPath = absolute || protocolRelative ? url.pathname : value.split(/[?#]/u)[0] ?? "";
107
- const segments = rawPath.split("/");
108
- let path = segments.map((segment, index) => {
109
- const decoded = decodeUrlComponent(segment);
110
- const masked = provider && /^v[23]$/u.test(decodeUrlComponent(segments[index - 1] ?? "")) && decoded.length > 0 ? "[REDACTED]" : maskText(decoded);
111
- changed ||= masked !== decoded;
112
- return masked === decoded ? segment : encodeURIComponent(masked);
113
- }).join("/");
114
- if (source === "gateway" && rawPath.length > 0) {
115
- path = `${rawPath.startsWith("/") ? "/" : ""}${encodeURIComponent("[REDACTED]")}`;
116
- changed = true;
117
- }
118
- const query = maskParams(url.searchParams);
119
- const fragment = url.hash.slice(1);
120
- const decodedFragment = decodeUrlComponent(fragment);
121
- const maskedFragment = maskText(decodedFragment);
122
- changed ||= maskedFragment !== decodedFragment;
123
- const fragmentQuery = fragment.indexOf("?");
124
- const fragmentPath = fragment.slice(0, fragmentQuery);
125
- const maskedFragmentPath = maskText(decodeUrlComponent(fragmentPath));
126
- changed ||= maskedFragmentPath !== decodeUrlComponent(fragmentPath);
127
- const hash = fragmentQuery >= 0 ? `${maskedFragmentPath === decodeUrlComponent(fragmentPath) ? fragmentPath : encodeURIComponent(maskedFragmentPath)}?${maskParams(new URLSearchParams(fragment.slice(fragmentQuery + 1)))}` : fragment.includes("=") ? maskParams(new URLSearchParams(fragment)) : maskedFragment === decodedFragment ? fragment : encodeURIComponent(maskedFragment);
128
- const origin = absolute ? url.origin : protocolRelative ? `//${url.host}` : "";
129
- if (!changed) return value;
130
- return `${origin}${path}${query ? `?${query}` : ""}${hash ? `#${hash}` : ""}`;
131
- } catch {
132
- if (source === "gateway") return "[REDACTED]";
133
- return maskText(value.replace(/(https?:\/\/)[^/\s@]+@/giu, "$1[REDACTED]@").replace(/([?&#])([^=&#]+)=([^&#]*)/gu, (whole, separator, name) => isCredentialField(decodeUrlComponent(name)) || /^(?:code|draft|__posthog)$/iu.test(decodeUrlComponent(name)) ? `${separator}${name}=[REDACTED]` : whole));
134
- }
135
- }
136
- const JSON_FIELD = /("(?:[^"\\]|\\.)*")(\s*:\s*)("(?:[^"\\]|\\.)*"|-?\d+(?:\.\d+)?(?:[eE][+-]?\d+)?|true|false|null)/gu;
137
- const PROSE_FIELD = /(?=(\b([A-Za-z][A-Za-z0-9_-]*(?:[ \t]+[A-Za-z][A-Za-z0-9_-]*){0,3})\s*[:=]\s*((?:Bearer|Basic)[ \t]+[^\s,;"']+|"(?:[^"\\]|\\.)*"|'(?:[^'\\]|\\.)*'|[^\s,;&"']+)))/gu;
138
- const EMBEDDED_URL = /(https?:\/\/[^\s"<>]*)/giu;
139
- function isSecretLabel(name) {
140
- return isCredentialField(name) || /^request[ _-]?body$/iu.test(name);
141
- }
142
- const JSON_ENCODING_MAX = 8;
143
- const JSON_NESTING_MAX = 64;
144
- const JSON_KEY = /("(?:[^"\\]|\\.)*")\s*:/gu;
145
- const JSON_CONTAINER_START = /(?:\{\s*["}]|\[\s*[[\]{}"0-9tfn-])/uy;
146
- function hasSecretJsonKey(value) {
147
- for (const match of value.matchAll(JSON_KEY)) try {
148
- if (match[1] !== void 0 && isSecretLabel(JSON.parse(match[1]))) return true;
149
- } catch {}
150
- return false;
151
- }
152
- /** Project a complete fragment once. Never retry all of its nested substrings. */
153
- function projectJsonFragment(value, encodingDepth, overDepth) {
154
- if (overDepth || encodingDepth >= JSON_ENCODING_MAX) return "[REDACTED]";
155
- let parsed;
156
- try {
157
- parsed = JSON.parse(value);
158
- } catch {
159
- return hasSecretJsonKey(value) ? "[REDACTED]" : value;
160
- }
161
- try {
162
- let changed = false;
163
- const masked = JSON.stringify(parsed, (name, nested) => {
164
- if (isSecretLabel(name)) {
165
- changed ||= nested !== "[REDACTED]";
166
- return "[REDACTED]";
167
- }
168
- if (typeof nested === "string") {
169
- const projected = maskJsonFragments(nested, encodingDepth + 1);
170
- changed ||= projected !== nested;
171
- return projected;
172
- }
173
- return nested;
174
- });
175
- return changed ? masked : value;
176
- } catch {
177
- return "[REDACTED]";
178
- }
179
- }
180
- /** Scan balanced object/array fragments once, respecting JSON quotes and escapes. */
181
- function maskJsonFragments(value, encodingDepth = 0) {
182
- if (value.trimStart().startsWith("\"")) try {
183
- const decoded = JSON.parse(value);
184
- if (typeof decoded === "string") {
185
- if (encodingDepth >= JSON_ENCODING_MAX) return "\"[REDACTED]\"";
186
- const masked = maskJsonFragments(decoded, encodingDepth + 1);
187
- return masked === decoded ? value : JSON.stringify(masked);
188
- }
189
- } catch {}
190
- let output = "";
191
- let cursor = 0;
192
- let start = -1;
193
- let depth = 0;
194
- let overDepth = false;
195
- let quoted = false;
196
- let escaped = false;
197
- for (let index = 0; index < value.length; index++) {
198
- const character = value[index];
199
- if (start < 0) {
200
- JSON_CONTAINER_START.lastIndex = index;
201
- if (!JSON_CONTAINER_START.test(value)) continue;
202
- start = index;
203
- depth = 1;
204
- overDepth = false;
205
- continue;
206
- }
207
- if (quoted) {
208
- if (escaped) escaped = false;
209
- else if (character === "\\") escaped = true;
210
- else if (character === "\"") quoted = false;
211
- continue;
212
- }
213
- if (character === "\"") quoted = true;
214
- else if (character === "{" || character === "[") {
215
- depth++;
216
- overDepth ||= depth > JSON_NESTING_MAX;
217
- } else if (character === "}" || character === "]") {
218
- depth--;
219
- if (depth !== 0) continue;
220
- output += value.slice(cursor, start) + projectJsonFragment(value.slice(start, index + 1), encodingDepth, overDepth);
221
- cursor = index + 1;
222
- start = -1;
223
- }
224
- }
225
- if (start >= 0) {
226
- const fragment = value.slice(start);
227
- output += value.slice(cursor, start) + (overDepth || hasSecretJsonKey(fragment) ? "[REDACTED]" : fragment);
228
- cursor = value.length;
229
- }
230
- return output + value.slice(cursor);
231
- }
232
- function maskLabelledText(value) {
233
- const jsonMasked = maskJsonFragments(value).replace(JSON_FIELD, (whole, quotedName, separator) => {
234
- try {
235
- return isSecretLabel(JSON.parse(quotedName)) ? `${quotedName}${separator}"[REDACTED]"` : whole;
236
- } catch {
237
- return whole;
238
- }
239
- });
240
- let output = "";
241
- let cursor = 0;
242
- for (const match of jsonMasked.matchAll(PROSE_FIELD)) {
243
- const [, whole, label, entry] = match;
244
- if (whole === void 0 || label === void 0 || entry === void 0 || match.index < cursor || /^Bearer[ \t]+/iu.test(entry)) continue;
245
- const words = label.split(/[ \t]+/u);
246
- for (let index = 0; index < words.length; index++) {
247
- const name = words.slice(index).join(" ");
248
- if (isSecretLabel(name)) {
249
- const prefix = words.slice(0, index).join(" ");
250
- output += jsonMasked.slice(cursor, match.index) + `${prefix ? `${prefix} ` : ""}${name}=[REDACTED]`;
251
- cursor = match.index + whole.length;
252
- break;
253
- }
254
- }
255
- }
256
- return output + jsonMasked.slice(cursor);
257
- }
258
- const TOKEN_MASKS = [
259
- [/\bBearer\s+(?!(?:realm|error|error_description|scope|authorization_uri|resource|claims)\s*=)[^\s,;"']+/giu, "Bearer [REDACTED]"],
260
- [/\beyJ[A-Za-z0-9_-]+\.[A-Za-z0-9_-]+\.[A-Za-z0-9_-]+\b/gu, "[REDACTED]"],
261
- [/(^|[^a-fA-F0-9])(?<!0[xX])[a-fA-F0-9]{64}(?=$|[^a-fA-F0-9])/gu, "$1[REDACTED]"],
262
- [/(?:(?:sk|pk|rk)_(?:live|test)|(?:phc|phx|ghp|gho|ghu|ghs|ghr|whsec)_|github_pat_|xox[baprs]-|AKIA[0-9A-Z]{16}|AIza)[A-Za-z0-9_-]*/giu, "[REDACTED]"]
263
- ];
264
- /** URL components and malformed URLs use this non-recursive masking layer. */
265
- function maskText(value) {
266
- let text = maskLabelledText(value);
267
- for (const [pattern, replacement] of TOKEN_MASKS) text = text.replace(pattern, replacement);
268
- return text;
269
- }
270
- /** Mask credential fields and embedded URLs while preserving surrounding evidence. */
271
- function redactSecrets(value, source) {
272
- return maskLabelledText(value).split(EMBEDDED_URL).map((part, index) => index % 2 === 1 ? redactUrlSecrets(part, source).replaceAll("%5BREDACTED%5D", "[REDACTED]") : maskText(part)).join("");
273
- }
274
- //#endregion
275
- //#region ../errors/src/chain-cause.ts
276
- /**
277
- * Why an operation failed — the one flat vocabulary. The first four are the
278
- * auth/provider diagnoses that predate this file. The rest name the chain
279
- * path. `FailureMode` is derived from this list so a runtime membership check
280
- * (the SDK's `$exception` projection, the observability schema) and the type
281
- * can never drift apart.
282
- */
283
- const FAILURE_MODES = [
284
- "auth-origin-mismatch",
285
- "stale-openfort-cache",
286
- "app-env-allowlist",
287
- "no-secure-context",
288
- "signer-not-ready",
289
- "rate-limited",
290
- "timeout",
291
- "upstream-down",
292
- "revert",
293
- "insufficient-balance",
294
- "insufficient-allowance",
295
- "rejected",
296
- "unauthorized",
297
- "forbidden",
298
- "bad-request",
299
- "method-unsupported",
300
- "unknown"
301
- ];
302
- /** Who answered. `alto` is the bundler; `gateway` is the AA gateway's own logic. */
303
- const CHAIN_UPSTREAMS = [
304
- "alchemy",
305
- "infura",
306
- "public",
307
- "alto",
308
- "gateway"
309
- ];
310
- //#endregion
311
- //#region ../errors/src/errors.ts
312
- const CAPXUL_ERROR_CODES = [
313
- "NOT_AUTHENTICATED",
314
- "EMAIL_DELIVERY_FAILED",
315
- "PROFILE_NOT_FOUND",
316
- "SMART_ACCOUNT_MISSING",
317
- "PLAYER_NOT_FOUND",
318
- "ACCOUNT_NOT_FOUND",
319
- "ACCOUNT_CLAIMED_BY_OTHER_SIGNER",
320
- "PROVIDER_ERROR",
321
- "CAPABILITY_UNAVAILABLE",
322
- "INVALID_INPUT",
323
- "ENV_MISSING",
324
- "NOT_IMPLEMENTED",
325
- "VERIFICATION_REQUIRED",
326
- "INSUFFICIENT_BALANCE",
327
- "INVALID_RECIPIENT",
328
- "ROLE_PERMISSION_DENIED",
329
- "TRANSACTION_FAILED",
330
- "RATE_LIMITED",
331
- "NETWORK_ERROR",
332
- "UNKNOWN",
333
- "OTP_EXPIRED",
334
- "SIGNER_REJECTED",
335
- "CANCELLED",
336
- "WRONG_STATE",
337
- "STALE_EPOCH",
338
- "SUPERSEDED",
339
- "WORK_DIED",
340
- "ACTOR_STOPPED"
341
- ];
342
- new Set(CAPXUL_ERROR_CODES);
343
- //#endregion
344
- //#region src/operations.ts
345
- const CAPXUL_OPERATIONS = {
346
- account: {
347
- addressBook: {
348
- add: "account.addressBook.add",
349
- get: "account.addressBook.get",
350
- hide: "account.addressBook.hide",
351
- label: "account.addressBook.label",
352
- list: "account.addressBook.list",
353
- unhide: "account.addressBook.unhide"
354
- },
355
- balance: "account.balance",
356
- faucetMint: "account.faucetMint",
357
- getLifecycle: "account.getLifecycle",
358
- readBalance: "account.readBalance",
359
- retrySetup: "account.retrySetup",
360
- status: "account.status",
361
- profile: {
362
- depositInstructions: "account.profile.depositInstructions",
363
- get: "account.profile.get"
364
- },
365
- inbox: {
366
- approve: "account.inbox.approve",
367
- decline: "account.inbox.decline",
368
- list: "account.inbox.list"
369
- },
370
- requests: {
371
- cancel: "account.requests.cancel",
372
- get: "account.requests.get",
373
- issue: "account.requests.issue",
374
- list: "account.requests.list"
375
- }
376
- },
377
- accounts: {
378
- fund: "accounts.fund",
379
- read: "accounts.read"
380
- },
381
- activity: {
382
- annotate: "activity.annotate",
383
- emitAnnotationSaved: "activity.emitAnnotationSaved",
384
- get: "activity.get",
385
- list: "activity.list",
386
- /** The SDK's live Activity read over the indexer's SSE stream. */
387
- subscribe: "activity.subscribe",
388
- summary: "activity.summary"
389
- },
390
- addressBook: {
391
- add: "addressBook.add",
392
- emitRelationshipChanged: "addressBook.emitRelationshipChanged",
393
- get: "addressBook.get",
394
- hide: "addressBook.hide",
395
- label: "addressBook.label",
396
- list: "addressBook.list",
397
- unhide: "addressBook.unhide"
398
- },
399
- applications: { create: "applications.create" },
400
- auth: {
401
- canSendOtp: "auth.canSendOtp",
402
- getSession: "auth.getSession",
403
- signIn: "auth.signIn",
404
- signOut: "auth.signOut",
405
- sendVerificationOtp: "auth.sendVerificationOTP",
406
- verifyOtp: "auth.verifyOtp"
407
- },
408
- client: {
409
- createOrg: "createOrg",
410
- orgs: "orgs"
411
- },
412
- credentials: {
413
- bootstrapClient: "credentials.bootstrapClient",
414
- mintQuickstartKey: "credentials.mintQuickstartKey"
415
- },
416
- currentUser: { get: "currentUser.get" },
417
- devIdentity: { seedFinancialOpsOrg: "devIdentity.seedFinancialOpsOrg" },
418
- dev: { browserSeed: "dev.browserSeed" },
419
- destinations: {
420
- add: "destinations.add",
421
- list: "destinations.list",
422
- remove: "destinations.remove"
423
- },
424
- faucetSafe: { deploy: "FaucetSafe.deploy" },
425
- financialOps: {
426
- addDestination: "financialOps.addDestination",
427
- approveRequest: "financialOps.approveRequest",
428
- cancelRequest: "financialOps.cancelRequest",
429
- createPayee: "financialOps.createPayee",
430
- declineRequest: "financialOps.declineRequest",
431
- emitInvoiceIssued: "financialOps.emitInvoiceIssued",
432
- emitInvoiceRequestTransitioned: "financialOps.emitInvoiceRequestTransitioned",
433
- emitPaymentWriterTelemetry: "financialOps.emitPaymentWriterTelemetry",
434
- issueRequest: "financialOps.issueRequest",
435
- migrateEvidenceIdentity: "financialOps.migrateEvidenceIdentity",
436
- planEvidenceIdentity: "financialOps.planEvidenceIdentity",
437
- recoverSettlementVerification: "financialOps.recoverSettlementVerification",
438
- removeDestination: "financialOps.removeDestination",
439
- verifySettlement: "financialOps.verifySettlement"
440
- },
441
- holdings: {
442
- current: "holdings.current",
443
- primary: "holdings.primary"
444
- },
445
- indexer: { reconcile: "indexer.reconcile" },
446
- identity: {
447
- accountAt: "identity.AccountAt",
448
- accountClaimed: "identity.AccountClaimed",
449
- accountClaiming: "identity.AccountClaiming",
450
- accountDerived: "identity.AccountDerived",
451
- accountFailed: "identity.AccountFailed",
452
- attachOrganization: "identity.AttachOrganization",
453
- claimAccount: "identity.ClaimAccount",
454
- completeOnboarding: "identity.completeOnboarding",
455
- completeProfile: "identity.completeProfile",
456
- create: "identity.create",
457
- createOrganization: "identity.CreateOrganization",
458
- ensureAccount: "identity.EnsureAccount",
459
- leaveOrganization: "identity.LeaveOrganization",
460
- loadByAuthUserId: "identity.loadByAuthUserId",
461
- loadCurrent: "identity.loadCurrent",
462
- orgAt: "identity.OrgAt",
463
- orgFailed: "identity.OrgFailed",
464
- orgReady: "identity.OrgReady",
465
- otpFailed: "identity.OtpFailed",
466
- otpSent: "identity.OtpSent",
467
- readSession: "identity.ReadSession",
468
- requestOtp: "identity.RequestOtp",
469
- reset: "identity.Reset",
470
- restoreSession: "identity.RestoreSession",
471
- resumeOtpEntry: "identity.ResumeOtpEntry",
472
- retryAccount: "identity.RetryAccount",
473
- retryOrganization: "identity.RetryOrganization",
474
- sessionAbsent: "identity.SessionAbsent",
475
- sessionRead: "identity.SessionRead",
476
- sessionReadFailed: "identity.SessionReadFailed",
477
- sessionRestored: "identity.SessionRestored",
478
- signedOut: "identity.SignedOut",
479
- signOut: "identity.SignOut",
480
- signOutFailed: "identity.SignOutFailed",
481
- update: "identity.update",
482
- handleAvailable: "identity.handleAvailable",
483
- verified: "identity.Verified",
484
- verifyFailed: "identity.VerifyFailed",
485
- verifyOtp: "identity.VerifyOtp"
486
- },
487
- media: {
488
- generateUploadUrl: "media.generateUploadUrl",
489
- setOrgLogo: "media.setOrgLogo",
490
- setProfileImage: "media.setProfileImage",
491
- uploadImage: "media.uploadImage"
492
- },
493
- me: {
494
- depositInstructions: "me.depositInstructions",
495
- get: "me.get"
496
- },
497
- moneyExecution: {
498
- abandonPaymentExecution: "moneyExecution.abandonPaymentExecution",
499
- prepareOrganizationPaymentExecution: "moneyExecution.prepareOrganizationPaymentExecution",
500
- preparePaymentExecution: "moneyExecution.preparePaymentExecution",
501
- preparePaymentLifecycleExecution: "moneyExecution.preparePaymentLifecycleExecution",
502
- preparePermissionExecution: "moneyExecution.preparePermissionExecution",
503
- recoverSubmissionClaims: "moneyExecution.recoverSubmissionClaims",
504
- submit: "moneyExecution.submit",
505
- submitPaymentCommandExecution: "moneyExecution.submitPaymentCommandExecution",
506
- submitPaymentExecution: "moneyExecution.submitPaymentExecution",
507
- submitPermissionExecution: "moneyExecution.submitPermissionExecution"
508
- },
509
- movement: {
510
- emitDepositSettled: "movement.emitDepositSettled",
511
- scan: "movement.scan"
512
- },
513
- inbox: {
514
- approve: "inbox.approve",
515
- decline: "inbox.decline",
516
- list: "inbox.list"
517
- },
518
- offramp: {
519
- quote: "offramp.quote",
520
- status: "offramp.status"
521
- },
522
- onboarding: {
523
- completeOrganization: "onboarding.completeOrganization",
524
- completePerson: "onboarding.completePerson"
525
- },
526
- org: {
527
- acceptInvitations: "org.acceptInvitations",
528
- account: { get: "org.account.get" },
529
- activateMember: "org.activateMember",
530
- auditLog: "org.auditLog",
531
- confirmBootstrap: "org.confirmBootstrap",
532
- createOrg: "org.createOrg",
533
- create: "org.create",
534
- detectAndAcceptPendingInvitations: "org.detectAndAcceptPendingInvitations",
535
- emitInviteProgressed: "org.emitInviteProgressed",
536
- expireInvitations: "org.expireInvitations",
537
- getLifecycle: "org.getLifecycle",
538
- getProofReceipt: "org.getProofReceipt",
539
- invite: "org.invite",
540
- inviteMember: "org.inviteMember",
541
- list: "org.list",
542
- load: "org.load",
543
- me: "org.me",
544
- members: "org.members",
545
- orgs: "org.orgs",
546
- payment: "org.payment",
547
- permissions: {
548
- assign: "org.permissions.assign",
549
- change: "org.permissions.change",
550
- create: "org.permissions.create",
551
- get: "org.permissions.get",
552
- list: "org.permissions.list",
553
- replace: "org.permissions.replace",
554
- revoke: "org.permissions.revoke"
555
- },
556
- payments: {
557
- pay: "org.payments.pay",
558
- payBatch: "org.payments.payBatch"
559
- },
560
- payroll: {
561
- authorizeRun: "org.payroll.authorizeRun",
562
- groups: {
563
- list: "org.payroll.groups.list",
564
- remove: "org.payroll.groups.remove",
565
- save: "org.payroll.groups.save"
566
- },
567
- runs: "org.payroll.runs",
568
- terms: "org.payroll.terms"
569
- },
570
- addressBook: {
571
- add: "org.addressBook.add",
572
- get: "org.addressBook.get",
573
- hide: "org.addressBook.hide",
574
- label: "org.addressBook.label",
575
- list: "org.addressBook.list",
576
- unhide: "org.addressBook.unhide"
577
- },
578
- inbox: {
579
- approve: "org.inbox.approve",
580
- decline: "org.inbox.decline",
581
- list: "org.inbox.list"
582
- },
583
- lifecycle: { startOrResume: "org.lifecycle.startOrResume" },
584
- prepareBootstrap: "org.prepareBootstrap",
585
- prepareFounderAccount: "org.prepareFounderAccount",
586
- profile: {
587
- depositInstructions: "org.profile.depositInstructions",
588
- get: "org.profile.get"
589
- },
590
- readTreasury: "org.readTreasury",
591
- requests: {
592
- cancel: "org.requests.cancel",
593
- get: "org.requests.get",
594
- issue: "org.requests.issue",
595
- list: "org.requests.list"
596
- },
597
- recordFailure: "org.recordFailure",
598
- recordProgress: "org.recordProgress",
599
- resendInviteToken: "org.resendInviteToken",
600
- resumeBootstrapSubmission: "org.resumeBootstrapSubmission",
601
- retry: "org.retry",
602
- retrySetup: "org.retrySetup",
603
- roles: "org.roles",
604
- startOrResume: "org.startOrResume",
605
- submitBootstrap: "org.submitBootstrap",
606
- treasury: "org.treasury"
607
- },
608
- organization: { setup: "organization.setup" },
609
- organizationPayments: {
610
- pay: "organizationPayments.pay",
611
- payBatch: "organizationPayments.payBatch",
612
- prepareExecution: "organizationPayments.prepareExecution",
613
- retry: "organizationPayments.retry"
614
- },
615
- organizationSetup: { getProofReceipt: "organizationSetup.getProofReceipt" },
616
- organizations: { detectAndAcceptPendingInvitations: "orgs.detectAndAcceptPendingInvitations" },
617
- payments: {
618
- cancel: "payments.cancel",
619
- claim: "payments.claim",
620
- createCommitment: "payments.createCommitment",
621
- get: "payments.get",
622
- ledger: "payments",
623
- list: "payments.list",
624
- pay: "payments.pay",
625
- prepareExecution: "payments.prepareExecution",
626
- prepareLifecycleExecution: "payments.prepareLifecycleExecution",
627
- redirect: "payments.redirect",
628
- retry: "payments.retry",
629
- submitCommandExecution: "payments.submitCommandExecution",
630
- submitExecution: "payments.submitExecution"
631
- },
632
- paymentDocuments: {
633
- render: "paymentDocuments.render",
634
- verify: "paymentDocuments.verify"
635
- },
636
- recipient: { resolve: "recipient.resolve" },
637
- payroll: {
638
- authorizeRun: "payroll.authorizeRun",
639
- emitGroupChanged: "payroll.emitGroupChanged",
640
- emitRunTransitioned: "payroll.emitRunTransitioned",
641
- groups: {
642
- access: "payroll.groups",
643
- list: "payroll.groups.list",
644
- remove: "payroll.groups.remove",
645
- save: "payroll.groups.save"
646
- },
647
- removeGroup: "payroll.removeGroup",
648
- runs: "payroll.runs",
649
- saveGroup: "payroll.saveGroup",
650
- terms: "payroll.terms"
651
- },
652
- permission: {
653
- command: "permission.command",
654
- retryVerification: "permission.retryVerification",
655
- verify: "permission.verify",
656
- verifySubmitted: "permission.verifySubmitted"
657
- },
658
- permissions: {
659
- assign: "permissions.assign",
660
- change: "permissions.change",
661
- create: "permissions.create",
662
- get: "permissions.get",
663
- list: "permissions.list",
664
- prepareExecution: "permissions.prepareExecution",
665
- replace: "permissions.replace",
666
- revoke: "permissions.revoke",
667
- submitExecution: "permissions.submitExecution"
668
- },
669
- publishableKeys: {
670
- mint: "publishableKeys.mint",
671
- revoke: "publishableKeys.revoke",
672
- rotate: "publishableKeys.rotate"
673
- },
674
- requests: {
675
- cancel: "requests.cancel",
676
- get: "requests.get",
677
- issue: "requests.issue",
678
- list: "requests.list"
679
- },
680
- runtime: {
681
- assign: "assign",
682
- canSendOtp: "canSendOtp",
683
- cancelCommitment: "cancel_commitment",
684
- change: "change",
685
- claimCommitment: "claim_commitment",
686
- create: "create",
687
- createCapxulClient: "createCapxulClient",
688
- createCapxulClientWithOrgDeploymentSeams: "createCapxulClientWithOrgDeploymentSeams",
689
- createCommitment: "create_commitment",
690
- getConvexJwt: "getConvexJwt",
691
- getSession: "getSession",
692
- initialize: "initialize",
693
- mutation: "mutation",
694
- now: "now",
695
- port: "port",
696
- query: "query",
697
- redirectCommitment: "redirect_commitment",
698
- replace: "replace",
699
- resolve: "resolve",
700
- revoke: "revoke",
701
- send: "send",
702
- sendOtp: "sendOtp",
703
- signIn: "signIn",
704
- signOut: "signOut",
705
- sleep: "sleep",
706
- verifyOtp: "verifyOtp",
707
- wallet: "wallet"
708
- },
709
- smartAccount: {
710
- claim: "smartAccount.claim",
711
- confirmDeployment: "smartAccount.confirmDeployment",
712
- loadByAuthUserId: "smartAccount.loadByAuthUserId",
713
- loadCurrent: "smartAccount.loadCurrent",
714
- provision: "smartAccount.provision"
715
- },
716
- system: {
717
- health: "system.health",
718
- ping: "system.ping",
719
- runtimeChain: "system.runtimeChain"
720
- },
721
- testUsdc: { mint: "TestUSDC.mint" },
722
- _internal: {
723
- accounts: { fund: "_internal.accounts.fund" },
724
- close: "_internal.close",
725
- identity: {
726
- completeProfile: "_internal.identity.completeProfile",
727
- runFacade: "_internal.identity.runFacade",
728
- send: "_internal.identity.send"
729
- },
730
- organizationSetup: { getProofReceipt: "_internal.organizationSetup.getProofReceipt" }
731
- },
732
- tenancy: {
733
- revokeBackendTenancyConsent: "tenancy.revokeBackendTenancyConsent",
734
- seedBackendTenancy: "tenancy.seedBackendTenancy"
735
- }
736
- };
737
- function collectOperations(tree) {
738
- return Object.values(tree).flatMap((value) => typeof value === "string" ? [value] : collectOperations(value));
739
- }
740
- const operations = new Set(collectOperations(CAPXUL_OPERATIONS));
741
- function isCapxulOperation(value) {
742
- return typeof value === "string" && operations.has(value);
743
- }
744
- function normalizeCapxulOperation(value) {
745
- return isCapxulOperation(value) ? value : "unknown";
746
- }
747
- //#endregion
748
- export { CHAIN_UPSTREAMS as a, redactSecrets as c, CAPXUL_ERROR_CODES as i, redactUrlSecrets as l, isCapxulOperation as n, FAILURE_MODES as o, normalizeCapxulOperation as r, isCredentialField as s, CAPXUL_OPERATIONS as t };