@xkova/sdk 0.1.0-alpha.6 → 0.1.0-alpha.8
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/README.md +174 -0
- package/dist/client.d.ts +4 -0
- package/dist/client.js +59 -1
- package/dist/generated/types.d.ts +8253 -5270
- package/dist/held-approval.d.ts +41 -0
- package/dist/held-approval.js +33 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -0
- package/dist/member-bff.d.ts +46 -2
- package/dist/member-bff.js +59 -2
- package/dist/member-resources.d.ts +7 -0
- package/dist/request-signing.js +6 -0
- package/dist/resources/account-holders.d.ts +7 -0
- package/dist/resources/branding.d.ts +10 -0
- package/dist/resources/branding.js +2 -0
- package/dist/resources/escrows.d.ts +3 -0
- package/dist/resources/payment-requests.d.ts +4 -0
- package/dist/resources/tenant.d.ts +15 -0
- package/dist/resources/tenant.js +6 -1
- package/dist/resources/tokenization.d.ts +15 -0
- package/dist/resources/treasury.d.ts +404 -0
- package/dist/resources/treasury.js +115 -0
- package/dist/resources/wallets.d.ts +2 -0
- package/dist/resources/workforce-wallets.d.ts +34 -0
- package/dist/resources/workforce-wallets.js +19 -0
- package/dist/workforce-bff.d.ts +202 -0
- package/dist/workforce-bff.js +462 -0
- package/examples/postgres-checkpoint-store.mjs +116 -0
- package/examples/postgres-checkpoints.sql +9 -0
- package/llms.txt +5 -0
- package/package.json +7 -2
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Narrow a governance hold before reading a mutation's entity result.
|
|
3
|
+
*
|
|
4
|
+
* On a workspace with a seeded/configured governance requirement, a
|
|
5
|
+
* create-shaped mutation (for example, `createTreasuryCounterparty` or
|
|
6
|
+
* treasury signer changes) may not execute: it returns a `HeldApproval`
|
|
7
|
+
* (`{ status: 'pending_approval', pending_approval_request_id }`) instead of
|
|
8
|
+
* the entity. No entity is created. Independently eligible approvers complete
|
|
9
|
+
* the required approval, then the same call is reissued through normal policy.
|
|
10
|
+
*
|
|
11
|
+
* Narrow BEFORE reading entity fields:
|
|
12
|
+
*
|
|
13
|
+
* const res = await client.treasury.createCounterparty(body, opts);
|
|
14
|
+
* if (isHeldApproval(res)) {
|
|
15
|
+
* await waitForApproval(res.pending_approval_request_id); // your flow
|
|
16
|
+
* return client.treasury.createCounterparty(body, opts); // same request
|
|
17
|
+
* }
|
|
18
|
+
* res.id; // safely the entity now
|
|
19
|
+
*
|
|
20
|
+
* This helper grants no approval, signer authority or permission to retry a
|
|
21
|
+
* changed request. Existing entity-shaped responses are not governance holds.
|
|
22
|
+
*/
|
|
23
|
+
import type { components } from './generated/types.js';
|
|
24
|
+
export type HeldApproval = components['schemas']['HeldApproval'];
|
|
25
|
+
/** True when a mutation response is a governance hold rather than the entity. */
|
|
26
|
+
export declare function isHeldApproval(res: unknown): res is HeldApproval;
|
|
27
|
+
/**
|
|
28
|
+
* Thrown by `assertNotHeld` when a mutation was governance-held. Carries the
|
|
29
|
+
* approval request id so a script that does not implement the attest flow
|
|
30
|
+
* fails loudly with the pointer a human needs.
|
|
31
|
+
*/
|
|
32
|
+
export declare class XKOVAHeldApprovalError extends Error {
|
|
33
|
+
readonly pendingApprovalRequestId: string;
|
|
34
|
+
constructor(held: HeldApproval, action?: string);
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* Unwrap a `entity | HeldApproval` union for callers that treat a hold as
|
|
38
|
+
* exceptional (scripts, one-shot provisioning). Returns the entity, or throws
|
|
39
|
+
* `XKOVAHeldApprovalError` carrying the approval request id.
|
|
40
|
+
*/
|
|
41
|
+
export declare function assertNotHeld<T>(res: T | HeldApproval, action?: string): T;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/** True when a mutation response is a governance hold rather than the entity. */
|
|
2
|
+
export function isHeldApproval(res) {
|
|
3
|
+
return (typeof res === 'object' &&
|
|
4
|
+
res !== null &&
|
|
5
|
+
res.status === 'pending_approval' &&
|
|
6
|
+
typeof res
|
|
7
|
+
.pending_approval_request_id === 'string');
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* Thrown by `assertNotHeld` when a mutation was governance-held. Carries the
|
|
11
|
+
* approval request id so a script that does not implement the attest flow
|
|
12
|
+
* fails loudly with the pointer a human needs.
|
|
13
|
+
*/
|
|
14
|
+
export class XKOVAHeldApprovalError extends Error {
|
|
15
|
+
pendingApprovalRequestId;
|
|
16
|
+
constructor(held, action) {
|
|
17
|
+
super(`${action ?? 'The mutation'} was held for governance approval ` +
|
|
18
|
+
`(approval request ${held.pending_approval_request_id}). Attest the ` +
|
|
19
|
+
`request, then re-issue the same call.`);
|
|
20
|
+
this.name = 'XKOVAHeldApprovalError';
|
|
21
|
+
this.pendingApprovalRequestId = held.pending_approval_request_id;
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Unwrap a `entity | HeldApproval` union for callers that treat a hold as
|
|
26
|
+
* exceptional (scripts, one-shot provisioning). Returns the entity, or throws
|
|
27
|
+
* `XKOVAHeldApprovalError` carrying the approval request id.
|
|
28
|
+
*/
|
|
29
|
+
export function assertNotHeld(res, action) {
|
|
30
|
+
if (isHeldApproval(res))
|
|
31
|
+
throw new XKOVAHeldApprovalError(res, action);
|
|
32
|
+
return res;
|
|
33
|
+
}
|
package/dist/index.d.ts
CHANGED
|
@@ -5,6 +5,7 @@ export { generateIdempotencyKey, withIdempotency } from './idempotency.js';
|
|
|
5
5
|
export { withRetry, type RetryPolicy } from './retry.js';
|
|
6
6
|
export { collectCursor, paginateCursor, type CursorPage, type PaginateCursorOptions, } from './cursor.js';
|
|
7
7
|
export { XKOVAApiError, XKOVAUploadError } from './errors.js';
|
|
8
|
+
export { isHeldApproval, assertNotHeld, XKOVAHeldApprovalError, type HeldApproval, } from './held-approval.js';
|
|
8
9
|
export { type PollOptions } from './resources/workflows.js';
|
|
9
10
|
export { type XKOVAMemberSessionContext } from './resources/account-holders.js';
|
|
10
11
|
export { verifyWebhookSignature, type VerifyWebhookSignatureResult } from './webhook.js';
|
package/dist/index.js
CHANGED
|
@@ -4,5 +4,6 @@ export { generateIdempotencyKey, withIdempotency } from './idempotency.js';
|
|
|
4
4
|
export { withRetry } from './retry.js';
|
|
5
5
|
export { collectCursor, paginateCursor, } from './cursor.js';
|
|
6
6
|
export { XKOVAApiError, XKOVAUploadError } from './errors.js';
|
|
7
|
+
export { isHeldApproval, assertNotHeld, XKOVAHeldApprovalError, } from './held-approval.js';
|
|
7
8
|
export { verifyWebhookSignature } from './webhook.js';
|
|
8
9
|
export { verifyInclusion, verifyConsistency, verifySth, } from './rwa-verify.js';
|
package/dist/member-bff.d.ts
CHANGED
|
@@ -34,6 +34,14 @@ export interface XKOVAMemberSessionMaterial extends XKOVAMemberContext {
|
|
|
34
34
|
/** Confidential refresh credential, BFF storage only. */
|
|
35
35
|
readonly refreshToken: string;
|
|
36
36
|
}
|
|
37
|
+
export interface XKOVAExternalMemberEnrollment {
|
|
38
|
+
readonly accountHolderId: string;
|
|
39
|
+
readonly applicationId: string;
|
|
40
|
+
readonly publishableKey: string;
|
|
41
|
+
readonly applicationConfigVersion: number;
|
|
42
|
+
readonly providerNamespace: string;
|
|
43
|
+
readonly created: boolean;
|
|
44
|
+
}
|
|
37
45
|
export interface XKOVABrowserMemberProjection {
|
|
38
46
|
readonly signedIn: true;
|
|
39
47
|
readonly accountHolderId: string;
|
|
@@ -49,8 +57,12 @@ export interface StoredXKOVAMemberSession<TApplicationData = unknown> extends XK
|
|
|
49
57
|
}
|
|
50
58
|
/**
|
|
51
59
|
* `runExclusive` must serialize refresh and logout for the same reference
|
|
52
|
-
* across all BFF instances. Use a
|
|
53
|
-
* a process-local mutex cannot coordinate multiple instances.
|
|
60
|
+
* across all BFF instances. Use a distributed or session-level database lock;
|
|
61
|
+
* a process-local mutex cannot coordinate multiple instances. This lock is not
|
|
62
|
+
* a surrounding rollback transaction: every awaited put/replace/delete must be
|
|
63
|
+
* durable before resolving and must survive a later error from work(). In
|
|
64
|
+
* particular, a pending refresh-attempt checkpoint cannot roll back after the
|
|
65
|
+
* provider/API has acted. replace is exact-existing-only, never an upsert.
|
|
54
66
|
*/
|
|
55
67
|
export interface XKOVAMemberSessionStore<TApplicationData = unknown> {
|
|
56
68
|
put(reference: string, session: StoredXKOVAMemberSession<TApplicationData>): Promise<void>;
|
|
@@ -169,6 +181,11 @@ export type XKOVAMemberAuthorizationTransaction<TApplicationData = unknown> = {
|
|
|
169
181
|
* every BFF instance. `replace` and `delete` must target that exact state. A
|
|
170
182
|
* production store must encrypt the transaction because it can briefly hold a
|
|
171
183
|
* confidential provider proof while XKOVA session exchange is retried.
|
|
184
|
+
* Every awaited write must commit independently of a later work() exception.
|
|
185
|
+
* Never wrap the entire callback in a rollback transaction: that can erase the
|
|
186
|
+
* staged proof after its one-time provider code has already been consumed.
|
|
187
|
+
* On uncertain write acknowledgement, reconcile the same exact record; never
|
|
188
|
+
* re-exchange the provider code or invent a replacement operation identity.
|
|
172
189
|
*/
|
|
173
190
|
export interface XKOVAMemberAuthorizationTransactionStore<TApplicationData = unknown> {
|
|
174
191
|
put(stateHash: string, transaction: XKOVAMemberAuthorizationTransaction<TApplicationData>): Promise<void>;
|
|
@@ -198,6 +215,10 @@ export type XKOVAMemberProofExchangeTransaction<TApplicationData = unknown> = {
|
|
|
198
215
|
* Durable transaction store for a confidential proof exchange that does not
|
|
199
216
|
* use the browser callback helper. Pending records contain a provider proof
|
|
200
217
|
* and customer application data, so production adapters must encrypt them.
|
|
218
|
+
* Serialize the exact reference across replicas without a surrounding rollback
|
|
219
|
+
* transaction. Awaited put/replace/delete checkpoints must remain committed if
|
|
220
|
+
* the later exchange fails. Reconcile an uncertain acknowledgement against the
|
|
221
|
+
* same reference and attempt identity before retrying.
|
|
201
222
|
*/
|
|
202
223
|
export interface XKOVAMemberProofExchangeTransactionStore<TApplicationData = unknown> {
|
|
203
224
|
put(exchangeHash: string, transaction: XKOVAMemberProofExchangeTransaction<TApplicationData>): Promise<void>;
|
|
@@ -321,6 +342,18 @@ export declare class XKOVAMemberBffClient {
|
|
|
321
342
|
exchangeProof(proofToken: string, options: {
|
|
322
343
|
readonly attemptId: string;
|
|
323
344
|
}): Promise<XKOVAMemberSessionMaterial>;
|
|
345
|
+
/**
|
|
346
|
+
* BFF-only membership provisioning after validating the provider identity or
|
|
347
|
+
* resolving it from a trusted directory. This creates no login session or
|
|
348
|
+
* wallet and does not substitute for genuine provider-proof verification.
|
|
349
|
+
* Save one idempotencyKey before the first attempt and retain the same subject,
|
|
350
|
+
* selector and observed configuration version during response-loss recovery.
|
|
351
|
+
*/
|
|
352
|
+
enrollExternalMember(input: {
|
|
353
|
+
readonly externalSub: string;
|
|
354
|
+
readonly applicationConfigVersion: number;
|
|
355
|
+
readonly idempotencyKey: string;
|
|
356
|
+
}): Promise<XKOVAExternalMemberEnrollment>;
|
|
324
357
|
refresh(refreshToken: string, options: {
|
|
325
358
|
readonly attemptId: string;
|
|
326
359
|
}): Promise<XKOVAMemberSessionMaterial>;
|
|
@@ -426,6 +459,17 @@ export declare class XKOVAMemberBffClient {
|
|
|
426
459
|
readonly transactionStore: XKOVAMemberAuthorizationTransactionStore<TApplicationData>;
|
|
427
460
|
readonly sessionStore: XKOVAMemberSessionStore<TApplicationData>;
|
|
428
461
|
readonly exchangeProviderCode: (input: XKOVAMemberProviderCodeExchangeInput) => XKOVAMemberProviderCodeExchangeResult | Promise<XKOVAMemberProviderCodeExchangeResult>;
|
|
462
|
+
/**
|
|
463
|
+
* Optional OIDC enrollment, invoked only after the validated provider proof
|
|
464
|
+
* is durably staged. Validate/extract its exact subject on your backend and
|
|
465
|
+
* call enrollExternalMember with this stable idempotency key. Do not perform
|
|
466
|
+
* enrollment RPC inside exchangeProviderCode: failure there can otherwise
|
|
467
|
+
* require reusing an already-consumed provider authorization code.
|
|
468
|
+
*/
|
|
469
|
+
readonly ensureMemberEnrollment?: (input: {
|
|
470
|
+
readonly proofToken: string;
|
|
471
|
+
readonly idempotencyKey: string;
|
|
472
|
+
}) => Promise<XKOVAExternalMemberEnrollment>;
|
|
429
473
|
readonly applicationData: TApplicationData;
|
|
430
474
|
readonly applicationSessionSeconds?: number;
|
|
431
475
|
}): Promise<EstablishedXKOVAMemberSession<TApplicationData>>;
|
package/dist/member-bff.js
CHANGED
|
@@ -79,6 +79,48 @@ export class XKOVAMemberBffClient {
|
|
|
79
79
|
proof_token: proofToken,
|
|
80
80
|
}), 'proof exchange');
|
|
81
81
|
}
|
|
82
|
+
/**
|
|
83
|
+
* BFF-only membership provisioning after validating the provider identity or
|
|
84
|
+
* resolving it from a trusted directory. This creates no login session or
|
|
85
|
+
* wallet and does not substitute for genuine provider-proof verification.
|
|
86
|
+
* Save one idempotencyKey before the first attempt and retain the same subject,
|
|
87
|
+
* selector and observed configuration version during response-loss recovery.
|
|
88
|
+
*/
|
|
89
|
+
async enrollExternalMember(input) {
|
|
90
|
+
if (typeof input.externalSub !== 'string' ||
|
|
91
|
+
input.externalSub.length === 0 ||
|
|
92
|
+
input.externalSub.length > 512 ||
|
|
93
|
+
/\u0000/u.test(input.externalSub) ||
|
|
94
|
+
!/\S/u.test(input.externalSub))
|
|
95
|
+
throw new TypeError('externalSub must be an exact nonempty provider subject of at most 512 characters');
|
|
96
|
+
assertPositiveInteger(input.applicationConfigVersion, 'applicationConfigVersion');
|
|
97
|
+
if (!/^[A-Za-z0-9._:-]{1,255}$/u.test(input.idempotencyKey))
|
|
98
|
+
throw new TypeError('idempotencyKey must be a retained opaque operation key of at most 255 characters');
|
|
99
|
+
const value = await this.recoverablePostJson('/member-auth/enrollments', {
|
|
100
|
+
publishable_key: this.options.publishableKey,
|
|
101
|
+
application_config_version: input.applicationConfigVersion,
|
|
102
|
+
external_sub: input.externalSub,
|
|
103
|
+
}, undefined, input.idempotencyKey);
|
|
104
|
+
const result = requireObject(value, 'external member enrollment');
|
|
105
|
+
const applicationId = requireString(result, 'application_id', 'external member enrollment');
|
|
106
|
+
assertUuid(applicationId, 'enrollment application id');
|
|
107
|
+
const publishableKey = requireString(result, 'publishable_key', 'external member enrollment');
|
|
108
|
+
const applicationConfigVersion = requirePositiveInteger(result, 'application_config_version', 'external member enrollment');
|
|
109
|
+
const providerNamespace = requireString(result, 'provider_namespace', 'external member enrollment');
|
|
110
|
+
if (publishableKey !== this.options.publishableKey ||
|
|
111
|
+
applicationConfigVersion !== input.applicationConfigVersion ||
|
|
112
|
+
!providerNamespace.startsWith('oidc:') ||
|
|
113
|
+
typeof result.created !== 'boolean')
|
|
114
|
+
throw new Error('XKOVA external member enrollment returned a different application or configuration');
|
|
115
|
+
return {
|
|
116
|
+
accountHolderId: requireString(result, 'account_holder_id', 'external member enrollment'),
|
|
117
|
+
applicationId,
|
|
118
|
+
publishableKey,
|
|
119
|
+
applicationConfigVersion,
|
|
120
|
+
providerNamespace,
|
|
121
|
+
created: result.created,
|
|
122
|
+
};
|
|
123
|
+
}
|
|
82
124
|
async refresh(refreshToken, options) {
|
|
83
125
|
if (refreshToken.length < 20) {
|
|
84
126
|
throw new TypeError('member refresh token is malformed');
|
|
@@ -759,6 +801,10 @@ export class XKOVAMemberBffClient {
|
|
|
759
801
|
if (transaction.completionMode !== 'provider_proof') {
|
|
760
802
|
throw new Error('member authorization transaction is not a provider-proof flow');
|
|
761
803
|
}
|
|
804
|
+
if (input.ensureMemberEnrollment &&
|
|
805
|
+
transaction.status === 'pending' &&
|
|
806
|
+
transaction.proofKind !== 'oidc')
|
|
807
|
+
throw new Error('external member enrollment is available only for an OIDC proof flow');
|
|
762
808
|
if (!sameCallback(callback, new URL(transaction.redirectUri))) {
|
|
763
809
|
throw new Error('member authorization callback does not match its redirect URI');
|
|
764
810
|
}
|
|
@@ -821,6 +867,14 @@ export class XKOVAMemberBffClient {
|
|
|
821
867
|
},
|
|
822
868
|
});
|
|
823
869
|
}
|
|
870
|
+
const enrollment = input.ensureMemberEnrollment
|
|
871
|
+
? await input.ensureMemberEnrollment({
|
|
872
|
+
proofToken,
|
|
873
|
+
idempotencyKey: `enroll:${transaction.exchangeAttemptId}`,
|
|
874
|
+
})
|
|
875
|
+
: undefined;
|
|
876
|
+
if (enrollment && enrollment.publishableKey !== this.options.publishableKey)
|
|
877
|
+
throw new Error('member enrollment does not belong to this application');
|
|
824
878
|
const established = await this.persistSessionWithAttempt({
|
|
825
879
|
proofToken,
|
|
826
880
|
attemptId: transaction.exchangeAttemptId,
|
|
@@ -828,6 +882,7 @@ export class XKOVAMemberBffClient {
|
|
|
828
882
|
sessionStore: input.sessionStore,
|
|
829
883
|
applicationData,
|
|
830
884
|
applicationExpiresAt,
|
|
885
|
+
...(enrollment !== undefined && { expectedAccountHolderId: enrollment.accountHolderId }),
|
|
831
886
|
});
|
|
832
887
|
await input.transactionStore.replace(stateHash, {
|
|
833
888
|
status: 'completed',
|
|
@@ -1014,6 +1069,9 @@ export class XKOVAMemberBffClient {
|
|
|
1014
1069
|
const material = await this.exchangeProof(input.proofToken, {
|
|
1015
1070
|
attemptId: input.attemptId,
|
|
1016
1071
|
});
|
|
1072
|
+
if (input.expectedAccountHolderId !== undefined &&
|
|
1073
|
+
material.accountHolderId !== input.expectedAccountHolderId)
|
|
1074
|
+
throw new Error('XKOVA proof exchange returned a different member from the enrolled identity');
|
|
1017
1075
|
return this.persistSessionMaterial({
|
|
1018
1076
|
material,
|
|
1019
1077
|
reference: input.reference,
|
|
@@ -1064,8 +1122,7 @@ export class XKOVAMemberBffClient {
|
|
|
1064
1122
|
...(idempotencyKey !== undefined && { idempotencyKey }),
|
|
1065
1123
|
});
|
|
1066
1124
|
}
|
|
1067
|
-
async recoverablePostJson(path, body, sessionId) {
|
|
1068
|
-
const idempotencyKey = generateIdempotencyKey();
|
|
1125
|
+
async recoverablePostJson(path, body, sessionId, idempotencyKey = generateIdempotencyKey()) {
|
|
1069
1126
|
try {
|
|
1070
1127
|
return await this.postJson(path, body, sessionId, idempotencyKey);
|
|
1071
1128
|
}
|
|
@@ -52,6 +52,9 @@ export declare class XKOVAMemberResources {
|
|
|
52
52
|
credit: {
|
|
53
53
|
amount: string;
|
|
54
54
|
token_deployment_id: string;
|
|
55
|
+
token_address: string;
|
|
56
|
+
token_symbol: string;
|
|
57
|
+
chain: import("./generated/types.js").components["schemas"]["ChainDescriptor"];
|
|
55
58
|
status: "pending" | "submitted" | "settled" | "requires_review";
|
|
56
59
|
transaction_hash: string | null;
|
|
57
60
|
} | null;
|
|
@@ -64,6 +67,9 @@ export declare class XKOVAMemberResources {
|
|
|
64
67
|
credit: {
|
|
65
68
|
amount: string;
|
|
66
69
|
token_deployment_id: string;
|
|
70
|
+
token_address: string;
|
|
71
|
+
token_symbol: string;
|
|
72
|
+
chain: import("./generated/types.js").components["schemas"]["ChainDescriptor"];
|
|
67
73
|
status: "pending" | "submitted" | "settled" | "requires_review";
|
|
68
74
|
transaction_hash: string | null;
|
|
69
75
|
} | null;
|
|
@@ -103,6 +109,7 @@ export declare class XKOVAMemberResources {
|
|
|
103
109
|
}>;
|
|
104
110
|
balance: (control?: XKOVARequestControl) => Promise<{
|
|
105
111
|
balances: import("./generated/types.js").components["schemas"]["AccountHolderSelfBalanceEntry"][];
|
|
112
|
+
data_freshness: import("./generated/types.js").components["schemas"]["DataFreshness"][];
|
|
106
113
|
}>;
|
|
107
114
|
wallets: (control?: XKOVARequestControl) => Promise<{
|
|
108
115
|
data: import("./generated/types.js").components["schemas"]["Wallet"][];
|
package/dist/request-signing.js
CHANGED
|
@@ -11,6 +11,10 @@ const CONDITIONAL_HEADERS = [
|
|
|
11
11
|
'idempotency-key',
|
|
12
12
|
'x-member-session-id',
|
|
13
13
|
'x-xkova-publishable-key',
|
|
14
|
+
'x-xkova-workforce-key',
|
|
15
|
+
'x-workforce-session',
|
|
16
|
+
'x-xkova-human-authorization',
|
|
17
|
+
'origin',
|
|
14
18
|
'x-account-holder-id',
|
|
15
19
|
'x-sender-wallet-id',
|
|
16
20
|
'x-sandbox-scenario',
|
|
@@ -78,6 +82,8 @@ export async function signXKOVARequest(input) {
|
|
|
78
82
|
function requiredComponents(headers, bodyPresent) {
|
|
79
83
|
const components = [...BASE_COMPONENTS];
|
|
80
84
|
for (const header of CONDITIONAL_HEADERS) {
|
|
85
|
+
if (header === 'origin' && !headers.has('x-xkova-workforce-key'))
|
|
86
|
+
continue;
|
|
81
87
|
if (headers.has(header) ||
|
|
82
88
|
(bodyPresent && (header === 'content-digest' || header === 'content-type'))) {
|
|
83
89
|
components.push(header);
|
|
@@ -152,6 +152,9 @@ export declare class AccountHoldersResource extends Resource {
|
|
|
152
152
|
credit: {
|
|
153
153
|
amount: string;
|
|
154
154
|
token_deployment_id: string;
|
|
155
|
+
token_address: string;
|
|
156
|
+
token_symbol: string;
|
|
157
|
+
chain: import("../generated/types.js").components["schemas"]["ChainDescriptor"];
|
|
155
158
|
status: "pending" | "submitted" | "settled" | "requires_review";
|
|
156
159
|
transaction_hash: string | null;
|
|
157
160
|
} | null;
|
|
@@ -164,12 +167,16 @@ export declare class AccountHoldersResource extends Resource {
|
|
|
164
167
|
credit: {
|
|
165
168
|
amount: string;
|
|
166
169
|
token_deployment_id: string;
|
|
170
|
+
token_address: string;
|
|
171
|
+
token_symbol: string;
|
|
172
|
+
chain: import("../generated/types.js").components["schemas"]["ChainDescriptor"];
|
|
167
173
|
status: "pending" | "submitted" | "settled" | "requires_review";
|
|
168
174
|
transaction_hash: string | null;
|
|
169
175
|
} | null;
|
|
170
176
|
}>;
|
|
171
177
|
selfBalance(context: XKOVAMemberSessionContext, control?: XKOVARequestControl): Promise<{
|
|
172
178
|
balances: import("../generated/types.js").components["schemas"]["AccountHolderSelfBalanceEntry"][];
|
|
179
|
+
data_freshness: import("../generated/types.js").components["schemas"]["DataFreshness"][];
|
|
173
180
|
}>;
|
|
174
181
|
listSelfWallets(context: XKOVAMemberSessionContext, control?: XKOVARequestControl): Promise<{
|
|
175
182
|
data: import("../generated/types.js").components["schemas"]["Wallet"][];
|
|
@@ -2,6 +2,8 @@ import { Resource, type ReqBody, type Query } from './base.js';
|
|
|
2
2
|
import type { XKOVAMutationOptions } from '../client.js';
|
|
3
3
|
export declare class BrandingResource extends Resource {
|
|
4
4
|
get(): Promise<{
|
|
5
|
+
logo_upload_limits: import("../generated/types.js").components["schemas"]["LogoUploadLimits"];
|
|
6
|
+
has_logo_override: boolean;
|
|
5
7
|
resolved: {
|
|
6
8
|
brand_name: string;
|
|
7
9
|
legal_name: string;
|
|
@@ -28,6 +30,8 @@ export declare class BrandingResource extends Resource {
|
|
|
28
30
|
theme: import("../generated/types.js").components["schemas"]["TenantBrandingTheme"];
|
|
29
31
|
}>;
|
|
30
32
|
upsert(body: ReqBody<'upsertBranding'>, opts?: XKOVAMutationOptions): Promise<{
|
|
33
|
+
logo_upload_limits: import("../generated/types.js").components["schemas"]["LogoUploadLimits"];
|
|
34
|
+
has_logo_override: boolean;
|
|
31
35
|
resolved: {
|
|
32
36
|
brand_name: string;
|
|
33
37
|
legal_name: string;
|
|
@@ -94,12 +98,16 @@ export declare class BrandingResource extends Resource {
|
|
|
94
98
|
last_synced_at: string;
|
|
95
99
|
created_at: string;
|
|
96
100
|
}>;
|
|
101
|
+
/** Upload bytes to the returned URL, then confirm its opaque key as the same tenant. */
|
|
97
102
|
logoUploadUrl(body: ReqBody<'brandingLogoUploadUrl'>, opts?: XKOVAMutationOptions): Promise<{
|
|
98
103
|
upload_url: string;
|
|
99
104
|
object_key: string;
|
|
100
105
|
expires_at: string;
|
|
101
106
|
}>;
|
|
107
|
+
/** Publish a newly issued upload. Saved logo URLs or keys are not upload keys. */
|
|
102
108
|
confirmLogo(body: ReqBody<'confirmBrandingLogo'>, opts?: XKOVAMutationOptions): Promise<{
|
|
109
|
+
logo_upload_limits: import("../generated/types.js").components["schemas"]["LogoUploadLimits"];
|
|
110
|
+
has_logo_override: boolean;
|
|
103
111
|
resolved: {
|
|
104
112
|
brand_name: string;
|
|
105
113
|
legal_name: string;
|
|
@@ -126,6 +134,8 @@ export declare class BrandingResource extends Resource {
|
|
|
126
134
|
theme: import("../generated/types.js").components["schemas"]["TenantBrandingTheme"];
|
|
127
135
|
}>;
|
|
128
136
|
deleteLogo(opts?: XKOVAMutationOptions): Promise<{
|
|
137
|
+
logo_upload_limits: import("../generated/types.js").components["schemas"]["LogoUploadLimits"];
|
|
138
|
+
has_logo_override: boolean;
|
|
129
139
|
resolved: {
|
|
130
140
|
brand_name: string;
|
|
131
141
|
legal_name: string;
|
|
@@ -22,9 +22,11 @@ export class BrandingResource extends Resource {
|
|
|
22
22
|
verifyEmailDomain(id, opts) {
|
|
23
23
|
return this.postJson(`/branding/email-domains/${this.enc(id)}/verify`, undefined, opts);
|
|
24
24
|
}
|
|
25
|
+
/** Upload bytes to the returned URL, then confirm its opaque key as the same tenant. */
|
|
25
26
|
logoUploadUrl(body, opts) {
|
|
26
27
|
return this.postJson('/branding/logo/upload-url', body, opts);
|
|
27
28
|
}
|
|
29
|
+
/** Publish a newly issued upload. Saved logo URLs or keys are not upload keys. */
|
|
28
30
|
confirmLogo(body, opts) {
|
|
29
31
|
return this.postJson('/branding/logo', body, opts);
|
|
30
32
|
}
|
|
@@ -7,6 +7,7 @@ export declare class EscrowsResource extends Resource {
|
|
|
7
7
|
has_more: boolean;
|
|
8
8
|
}>;
|
|
9
9
|
create(body: ReqBody<'createEscrow'>, opts?: XKOVAMutationOptions): Promise<{
|
|
10
|
+
notification_status?: "queued" | "sent" | "failed" | "cancelled";
|
|
10
11
|
escrow: import("../generated/types.js").components["schemas"]["Escrow"];
|
|
11
12
|
claim_token: string;
|
|
12
13
|
claim_url: string;
|
|
@@ -15,6 +16,7 @@ export declare class EscrowsResource extends Resource {
|
|
|
15
16
|
signing_expires_at?: import("../generated/types.js").components["schemas"]["TimestampUtc"] | null;
|
|
16
17
|
}>;
|
|
17
18
|
retrieve(id: string, query?: Query<'getEscrow'>): Promise<{
|
|
19
|
+
notification_status?: "queued" | "sent" | "failed" | "cancelled";
|
|
18
20
|
id: import("../generated/types.js").components["schemas"]["EscrowId"];
|
|
19
21
|
chain: import("../generated/types.js").components["schemas"]["ChainDescriptor"];
|
|
20
22
|
fingerprint: string;
|
|
@@ -28,6 +30,7 @@ export declare class EscrowsResource extends Resource {
|
|
|
28
30
|
on_chain_payment_id?: string | null;
|
|
29
31
|
create_tx_hash?: string | null;
|
|
30
32
|
release_tx_hash?: string | null;
|
|
33
|
+
data_freshness?: import("../generated/types.js").components["schemas"]["DataFreshness"][];
|
|
31
34
|
fee_accruals?: import("../generated/types.js").components["schemas"]["EscrowFeeAccrual"][];
|
|
32
35
|
net_amount?: import("../generated/types.js").components["schemas"]["Money"] | null;
|
|
33
36
|
claimed_at?: import("../generated/types.js").components["schemas"]["TimestampUtc"] | null;
|
|
@@ -11,6 +11,7 @@ export declare class PaymentRequestsResource extends Resource {
|
|
|
11
11
|
has_more: boolean;
|
|
12
12
|
}>;
|
|
13
13
|
create(body: ReqBody<'createPaymentRequest'>, opts?: XKOVAMutationOptions): Promise<{
|
|
14
|
+
notification_status?: "queued" | "sent" | "failed" | "cancelled";
|
|
14
15
|
id?: import("../generated/types.js").components["schemas"]["PaymentRequestId"];
|
|
15
16
|
requester_id?: import("../generated/types.js").components["schemas"]["AccountHolderId"];
|
|
16
17
|
payer_id?: import("../generated/types.js").components["schemas"]["AccountHolderId"] | null;
|
|
@@ -26,6 +27,7 @@ export declare class PaymentRequestsResource extends Resource {
|
|
|
26
27
|
updated_at?: import("../generated/types.js").components["schemas"]["TimestampUtc"];
|
|
27
28
|
}>;
|
|
28
29
|
retrieve(id: string): Promise<{
|
|
30
|
+
notification_status?: "queued" | "sent" | "failed" | "cancelled";
|
|
29
31
|
id?: import("../generated/types.js").components["schemas"]["PaymentRequestId"];
|
|
30
32
|
requester_id?: import("../generated/types.js").components["schemas"]["AccountHolderId"];
|
|
31
33
|
payer_id?: import("../generated/types.js").components["schemas"]["AccountHolderId"] | null;
|
|
@@ -82,6 +84,7 @@ export declare class PaymentRequestsResource extends Resource {
|
|
|
82
84
|
finalized_at: import("../generated/types.js").components["schemas"]["TimestampUtc"] | null;
|
|
83
85
|
}>;
|
|
84
86
|
cancel(id: string, opts?: XKOVAMutationOptions): Promise<{
|
|
87
|
+
notification_status?: "queued" | "sent" | "failed" | "cancelled";
|
|
85
88
|
id?: import("../generated/types.js").components["schemas"]["PaymentRequestId"];
|
|
86
89
|
requester_id?: import("../generated/types.js").components["schemas"]["AccountHolderId"];
|
|
87
90
|
payer_id?: import("../generated/types.js").components["schemas"]["AccountHolderId"] | null;
|
|
@@ -97,6 +100,7 @@ export declare class PaymentRequestsResource extends Resource {
|
|
|
97
100
|
updated_at?: import("../generated/types.js").components["schemas"]["TimestampUtc"];
|
|
98
101
|
}>;
|
|
99
102
|
decline(id: string, body?: ReqBody<'declinePaymentRequest'>, opts?: XKOVAMutationOptions): Promise<{
|
|
103
|
+
notification_status?: "queued" | "sent" | "failed" | "cancelled";
|
|
100
104
|
id?: import("../generated/types.js").components["schemas"]["PaymentRequestId"];
|
|
101
105
|
requester_id?: import("../generated/types.js").components["schemas"]["AccountHolderId"];
|
|
102
106
|
payer_id?: import("../generated/types.js").components["schemas"]["AccountHolderId"] | null;
|
|
@@ -47,6 +47,12 @@ export declare class TenantResource extends Resource {
|
|
|
47
47
|
publishable_key: string;
|
|
48
48
|
name: string;
|
|
49
49
|
provider_kind: "xkova_hosted" | "oidc" | "signed_launch";
|
|
50
|
+
provider_namespace: string;
|
|
51
|
+
issuer: string | null;
|
|
52
|
+
audience: string | null;
|
|
53
|
+
jwks_uri: string | null;
|
|
54
|
+
allowed_jwt_algorithms: ("RS256" | "PS256" | "ES256" | "EdDSA")[];
|
|
55
|
+
proof_binding_mode: "authorization_nonce" | "server_assertion_jti";
|
|
50
56
|
enrollment_mode: import("../generated/types.js").components["schemas"]["MemberAuthEnrollmentMode"];
|
|
51
57
|
is_default: boolean;
|
|
52
58
|
status: "active" | "principal_disabled";
|
|
@@ -73,6 +79,12 @@ export declare class TenantResource extends Resource {
|
|
|
73
79
|
publishable_key: string;
|
|
74
80
|
name: string;
|
|
75
81
|
provider_kind: "xkova_hosted" | "oidc" | "signed_launch";
|
|
82
|
+
provider_namespace: string;
|
|
83
|
+
issuer: string | null;
|
|
84
|
+
audience: string | null;
|
|
85
|
+
jwks_uri: string | null;
|
|
86
|
+
allowed_jwt_algorithms: ("RS256" | "PS256" | "ES256" | "EdDSA")[];
|
|
87
|
+
proof_binding_mode: "authorization_nonce" | "server_assertion_jti";
|
|
76
88
|
enrollment_mode: import("../generated/types.js").components["schemas"]["MemberAuthEnrollmentMode"];
|
|
77
89
|
is_default: boolean;
|
|
78
90
|
status: "active" | "principal_disabled";
|
|
@@ -90,6 +102,9 @@ export declare class TenantResource extends Resource {
|
|
|
90
102
|
created_at: import("../generated/types.js").components["schemas"]["TimestampUtc"];
|
|
91
103
|
updated_at: import("../generated/types.js").components["schemas"]["TimestampUtc"];
|
|
92
104
|
}>;
|
|
105
|
+
/** Disables the exact Hosted Auth or OIDC member application. */
|
|
106
|
+
disableMemberAuthApplication(id: string, opts?: XKOVAMutationOptions): Promise<void>;
|
|
107
|
+
/** Existing Hosted Auth convenience name. */
|
|
93
108
|
disableHostedApplication(id: string, opts?: XKOVAMutationOptions): Promise<void>;
|
|
94
109
|
configureOidcApplication(body: ReqBody<'configureMemberAuthOidcApplication'>, opts?: XKOVAMutationOptions): Promise<{
|
|
95
110
|
id: string;
|
package/dist/resources/tenant.js
CHANGED
|
@@ -15,9 +15,14 @@ export class TenantResource extends Resource {
|
|
|
15
15
|
updateHostedApplication(id, body, opts) {
|
|
16
16
|
return this.patchJson(`/tenant/member-auth/applications/${this.enc(id)}`, body, opts);
|
|
17
17
|
}
|
|
18
|
-
|
|
18
|
+
/** Disables the exact Hosted Auth or OIDC member application. */
|
|
19
|
+
disableMemberAuthApplication(id, opts) {
|
|
19
20
|
return this.deleteJson(`/tenant/member-auth/applications/${this.enc(id)}`, opts);
|
|
20
21
|
}
|
|
22
|
+
/** Existing Hosted Auth convenience name. */
|
|
23
|
+
disableHostedApplication(id, opts) {
|
|
24
|
+
return this.disableMemberAuthApplication(id, opts);
|
|
25
|
+
}
|
|
21
26
|
configureOidcApplication(body, opts) {
|
|
22
27
|
return this.putJson('/tenant/member-auth/application', body, opts);
|
|
23
28
|
}
|
|
@@ -186,6 +186,9 @@ export declare class TokenizationResource extends Resource {
|
|
|
186
186
|
raw_contract: string | null;
|
|
187
187
|
raw_function: string | null;
|
|
188
188
|
raw_args: string[] | null;
|
|
189
|
+
failure_reason_code: string | null;
|
|
190
|
+
failure_reason_detail: string | null;
|
|
191
|
+
failure_retryable: boolean;
|
|
189
192
|
created_at: string;
|
|
190
193
|
updated_at: string;
|
|
191
194
|
}>;
|
|
@@ -222,6 +225,9 @@ export declare class TokenizationResource extends Resource {
|
|
|
222
225
|
raw_contract: string | null;
|
|
223
226
|
raw_function: string | null;
|
|
224
227
|
raw_args: string[] | null;
|
|
228
|
+
failure_reason_code: string | null;
|
|
229
|
+
failure_reason_detail: string | null;
|
|
230
|
+
failure_retryable: boolean;
|
|
225
231
|
created_at: string;
|
|
226
232
|
updated_at: string;
|
|
227
233
|
}>;
|
|
@@ -261,6 +267,9 @@ export declare class TokenizationResource extends Resource {
|
|
|
261
267
|
raw_contract: string | null;
|
|
262
268
|
raw_function: string | null;
|
|
263
269
|
raw_args: string[] | null;
|
|
270
|
+
failure_reason_code: string | null;
|
|
271
|
+
failure_reason_detail: string | null;
|
|
272
|
+
failure_retryable: boolean;
|
|
264
273
|
created_at: string;
|
|
265
274
|
updated_at: string;
|
|
266
275
|
}>;
|
|
@@ -292,6 +301,9 @@ export declare class TokenizationResource extends Resource {
|
|
|
292
301
|
raw_contract: string | null;
|
|
293
302
|
raw_function: string | null;
|
|
294
303
|
raw_args: string[] | null;
|
|
304
|
+
failure_reason_code: string | null;
|
|
305
|
+
failure_reason_detail: string | null;
|
|
306
|
+
failure_retryable: boolean;
|
|
295
307
|
created_at: string;
|
|
296
308
|
updated_at: string;
|
|
297
309
|
}>;
|
|
@@ -323,6 +335,9 @@ export declare class TokenizationResource extends Resource {
|
|
|
323
335
|
raw_contract: string | null;
|
|
324
336
|
raw_function: string | null;
|
|
325
337
|
raw_args: string[] | null;
|
|
338
|
+
failure_reason_code: string | null;
|
|
339
|
+
failure_reason_detail: string | null;
|
|
340
|
+
failure_retryable: boolean;
|
|
326
341
|
created_at: string;
|
|
327
342
|
updated_at: string;
|
|
328
343
|
}>;
|