@dynamic-labs-sdk/client 1.33.1 → 1.33.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{apiClient-BbjPoAwE.native.esm.js → apiClient-CpfEx6Uc.native.esm.js} +3 -3
- package/dist/{apiClient-BbjPoAwE.native.esm.js.map → apiClient-CpfEx6Uc.native.esm.js.map} +1 -1
- package/dist/core.cjs +5 -78
- package/dist/core.cjs.map +1 -1
- package/dist/core.esm.js +8 -79
- package/dist/core.esm.js.map +1 -1
- package/dist/core.native.esm.js +6 -77
- package/dist/core.native.esm.js.map +1 -1
- package/dist/exports/core.d.ts +0 -2
- package/dist/exports/core.d.ts.map +1 -1
- package/dist/exports/waas.d.ts +13 -1
- package/dist/exports/waas.d.ts.map +1 -1
- package/dist/{getNetworkProviderFromNetworkId-BXoTukxv.cjs → getNetworkProviderFromNetworkId-Cez8TM-n.cjs} +9 -2
- package/dist/getNetworkProviderFromNetworkId-Cez8TM-n.cjs.map +1 -0
- package/dist/{getNetworkProviderFromNetworkId-D_Hg6kP7.esm.js → getNetworkProviderFromNetworkId-Cf-CfYM4.esm.js} +9 -8
- package/dist/getNetworkProviderFromNetworkId-Cf-CfYM4.esm.js.map +1 -0
- package/dist/{getNetworkProviderFromNetworkId-Cs3hLqBS.native.esm.js → getNetworkProviderFromNetworkId-CuTEQ9dg.native.esm.js} +5 -4
- package/dist/getNetworkProviderFromNetworkId-CuTEQ9dg.native.esm.js.map +1 -0
- package/dist/{getSignedSessionId-Bk-8is5J.native.esm.js → getSignedSessionId-Bt4obN3w.native.esm.js} +3 -3
- package/dist/{getSignedSessionId-Bk-8is5J.native.esm.js.map → getSignedSessionId-Bt4obN3w.native.esm.js.map} +1 -1
- package/dist/{getSignedSessionId-D_TknHwX.esm.js → getSignedSessionId-Cx7WP4ZJ.esm.js} +3 -3
- package/dist/{getSignedSessionId-D_TknHwX.esm.js.map → getSignedSessionId-Cx7WP4ZJ.esm.js.map} +1 -1
- package/dist/{getSignedSessionId-2O_cJtIV.cjs → getSignedSessionId-DiVxv0qz.cjs} +3 -3
- package/dist/{getSignedSessionId-2O_cJtIV.cjs.map → getSignedSessionId-DiVxv0qz.cjs.map} +1 -1
- package/dist/{getVerifiedCredentialForWalletAccount-BmsHgXbj.esm.js → getVerifiedCredentialForWalletAccount-DfKRbqco.esm.js} +2 -2
- package/dist/{getVerifiedCredentialForWalletAccount-BmsHgXbj.esm.js.map → getVerifiedCredentialForWalletAccount-DfKRbqco.esm.js.map} +1 -1
- package/dist/{getVerifiedCredentialForWalletAccount-upiwolAi.cjs → getVerifiedCredentialForWalletAccount-UIcOv7IN.cjs} +2 -2
- package/dist/{getVerifiedCredentialForWalletAccount-upiwolAi.cjs.map → getVerifiedCredentialForWalletAccount-UIcOv7IN.cjs.map} +1 -1
- package/dist/index.cjs +56 -69
- package/dist/index.cjs.map +1 -1
- package/dist/index.esm.js +50 -63
- package/dist/index.esm.js.map +1 -1
- package/dist/index.native.esm.js +48 -61
- package/dist/index.native.esm.js.map +1 -1
- package/dist/{isMfaRequiredForAction-D7b7mUT9.native.esm.js → isMfaRequiredForAction-CxYft5KR.native.esm.js} +2 -2
- package/dist/{isMfaRequiredForAction-D7b7mUT9.native.esm.js.map → isMfaRequiredForAction-CxYft5KR.native.esm.js.map} +1 -1
- package/dist/{isMfaRequiredForAction-DF65MJNN.cjs → isMfaRequiredForAction-Czx-uPFY.cjs} +2 -2
- package/dist/{isMfaRequiredForAction-DF65MJNN.cjs.map → isMfaRequiredForAction-Czx-uPFY.cjs.map} +1 -1
- package/dist/{isMfaRequiredForAction-CHqeZeTS.esm.js → isMfaRequiredForAction-DS8fcwxO.esm.js} +2 -2
- package/dist/{isMfaRequiredForAction-CHqeZeTS.esm.js.map → isMfaRequiredForAction-DS8fcwxO.esm.js.map} +1 -1
- package/dist/{isUserOnboardingComplete-CpHVw8ee.esm.js → isUserOnboardingComplete-COmYFW26.esm.js} +3 -3
- package/dist/{isUserOnboardingComplete-CpHVw8ee.esm.js.map → isUserOnboardingComplete-COmYFW26.esm.js.map} +1 -1
- package/dist/{isUserOnboardingComplete-CYpgo52t.native.esm.js → isUserOnboardingComplete-DYnRDLep.native.esm.js} +3 -3
- package/dist/{isUserOnboardingComplete-CYpgo52t.native.esm.js.map → isUserOnboardingComplete-DYnRDLep.native.esm.js.map} +1 -1
- package/dist/{isUserOnboardingComplete-BAL-3zu7.cjs → isUserOnboardingComplete-FbjleMQm.cjs} +3 -3
- package/dist/{isUserOnboardingComplete-BAL-3zu7.cjs.map → isUserOnboardingComplete-FbjleMQm.cjs.map} +1 -1
- package/dist/{logoutWithReason-CFjm8dbR.cjs → logoutWithReason-BKwWBsCT.cjs} +73 -55
- package/dist/logoutWithReason-BKwWBsCT.cjs.map +1 -0
- package/dist/{logoutWithReason-CX9hGTPw.esm.js → logoutWithReason-DO0kP7nf.esm.js} +62 -50
- package/dist/logoutWithReason-DO0kP7nf.esm.js.map +1 -0
- package/dist/{logoutWithReason-Bd1qUh7l.native.esm.js → logoutWithReason-DWkIKoLk.native.esm.js} +61 -49
- package/dist/logoutWithReason-DWkIKoLk.native.esm.js.map +1 -0
- package/dist/{migrateFromFireblocks-BLz9aHOY.native.esm.js → migrateFromFireblocks-BwYnNAAh.native.esm.js} +2 -2
- package/dist/{migrateFromFireblocks-BLz9aHOY.native.esm.js.map → migrateFromFireblocks-BwYnNAAh.native.esm.js.map} +1 -1
- package/dist/{migrateFromFireblocks-C8KXMXk-.esm.js → migrateFromFireblocks-C_cap--b.esm.js} +2 -2
- package/dist/{migrateFromFireblocks-C8KXMXk-.esm.js.map → migrateFromFireblocks-C_cap--b.esm.js.map} +1 -1
- package/dist/{migrateFromFireblocks-BiZmnKp9.cjs → migrateFromFireblocks-ycJIYcrm.cjs} +2 -2
- package/dist/{migrateFromFireblocks-BiZmnKp9.cjs.map → migrateFromFireblocks-ycJIYcrm.cjs.map} +1 -1
- package/dist/modules/initializeClient/consts.d.ts +1 -0
- package/dist/modules/initializeClient/consts.d.ts.map +1 -1
- package/dist/modules/initializeClient/initializeClient.d.ts.map +1 -1
- package/dist/modules/projectSettings/fetchProjectSettings/fetchProjectSettings.d.ts +4 -5
- package/dist/modules/projectSettings/fetchProjectSettings/fetchProjectSettings.d.ts.map +1 -1
- package/dist/modules/sessionKeys/canonicalizeJson/canonicalizeJson.d.ts +20 -0
- package/dist/modules/sessionKeys/canonicalizeJson/canonicalizeJson.d.ts.map +1 -0
- package/dist/modules/sessionKeys/canonicalizeJson/index.d.ts +2 -0
- package/dist/modules/sessionKeys/canonicalizeJson/index.d.ts.map +1 -0
- package/dist/modules/sessionKeys/signBusinessAccountIntent/signBusinessAccountIntent.d.ts +39 -6
- package/dist/modules/sessionKeys/signBusinessAccountIntent/signBusinessAccountIntent.d.ts.map +1 -1
- package/dist/modules/waas/businessAccounts/addBusinessAccountMember/addBusinessAccountMember.d.ts +9 -3
- package/dist/modules/waas/businessAccounts/addBusinessAccountMember/addBusinessAccountMember.d.ts.map +1 -1
- package/dist/modules/waas/businessAccounts/addWalletToBusinessAccount/addWalletToBusinessAccount.d.ts +10 -3
- package/dist/modules/waas/businessAccounts/addWalletToBusinessAccount/addWalletToBusinessAccount.d.ts.map +1 -1
- package/dist/modules/waas/businessAccounts/approveBusinessAccountProposal/approveBusinessAccountProposal.d.ts +43 -0
- package/dist/modules/waas/businessAccounts/approveBusinessAccountProposal/approveBusinessAccountProposal.d.ts.map +1 -0
- package/dist/modules/waas/businessAccounts/approveBusinessAccountProposal/index.d.ts +2 -0
- package/dist/modules/waas/businessAccounts/approveBusinessAccountProposal/index.d.ts.map +1 -0
- package/dist/modules/waas/businessAccounts/businessAccounts.types.d.ts +249 -0
- package/dist/modules/waas/businessAccounts/businessAccounts.types.d.ts.map +1 -1
- package/dist/modules/waas/businessAccounts/defineBusinessAccountRole/defineBusinessAccountRole.d.ts +45 -0
- package/dist/modules/waas/businessAccounts/defineBusinessAccountRole/defineBusinessAccountRole.d.ts.map +1 -0
- package/dist/modules/waas/businessAccounts/defineBusinessAccountRole/index.d.ts +2 -0
- package/dist/modules/waas/businessAccounts/defineBusinessAccountRole/index.d.ts.map +1 -0
- package/dist/modules/waas/businessAccounts/deleteBusinessAccountRole/deleteBusinessAccountRole.d.ts +41 -0
- package/dist/modules/waas/businessAccounts/deleteBusinessAccountRole/deleteBusinessAccountRole.d.ts.map +1 -0
- package/dist/modules/waas/businessAccounts/deleteBusinessAccountRole/index.d.ts +2 -0
- package/dist/modules/waas/businessAccounts/deleteBusinessAccountRole/index.d.ts.map +1 -0
- package/dist/modules/waas/businessAccounts/executeBusinessAccountProposal/executeBusinessAccountProposal.d.ts +39 -0
- package/dist/modules/waas/businessAccounts/executeBusinessAccountProposal/executeBusinessAccountProposal.d.ts.map +1 -0
- package/dist/modules/waas/businessAccounts/executeBusinessAccountProposal/index.d.ts +2 -0
- package/dist/modules/waas/businessAccounts/executeBusinessAccountProposal/index.d.ts.map +1 -0
- package/dist/modules/waas/businessAccounts/getBusinessAccountGovernance/getBusinessAccountGovernance.d.ts +30 -0
- package/dist/modules/waas/businessAccounts/getBusinessAccountGovernance/getBusinessAccountGovernance.d.ts.map +1 -0
- package/dist/modules/waas/businessAccounts/getBusinessAccountGovernance/index.d.ts +2 -0
- package/dist/modules/waas/businessAccounts/getBusinessAccountGovernance/index.d.ts.map +1 -0
- package/dist/modules/waas/businessAccounts/listBusinessAccountProposals/index.d.ts +2 -0
- package/dist/modules/waas/businessAccounts/listBusinessAccountProposals/index.d.ts.map +1 -0
- package/dist/modules/waas/businessAccounts/listBusinessAccountProposals/listBusinessAccountProposals.d.ts +26 -0
- package/dist/modules/waas/businessAccounts/listBusinessAccountProposals/listBusinessAccountProposals.d.ts.map +1 -0
- package/dist/modules/waas/businessAccounts/listBusinessAccountProposalsAwaitingMyApproval/index.d.ts +2 -0
- package/dist/modules/waas/businessAccounts/listBusinessAccountProposalsAwaitingMyApproval/index.d.ts.map +1 -0
- package/dist/modules/waas/businessAccounts/listBusinessAccountProposalsAwaitingMyApproval/listBusinessAccountProposalsAwaitingMyApproval.d.ts +21 -0
- package/dist/modules/waas/businessAccounts/listBusinessAccountProposalsAwaitingMyApproval/listBusinessAccountProposalsAwaitingMyApproval.d.ts.map +1 -0
- package/dist/modules/waas/businessAccounts/listBusinessAccountRoles/index.d.ts +2 -0
- package/dist/modules/waas/businessAccounts/listBusinessAccountRoles/index.d.ts.map +1 -0
- package/dist/modules/waas/businessAccounts/listBusinessAccountRoles/listBusinessAccountRoles.d.ts +26 -0
- package/dist/modules/waas/businessAccounts/listBusinessAccountRoles/listBusinessAccountRoles.d.ts.map +1 -0
- package/dist/modules/waas/businessAccounts/removeBusinessAccountMember/removeBusinessAccountMember.d.ts +11 -2
- package/dist/modules/waas/businessAccounts/removeBusinessAccountMember/removeBusinessAccountMember.d.ts.map +1 -1
- package/dist/modules/waas/businessAccounts/removeBusinessAccountSigner/removeBusinessAccountSigner.d.ts +11 -2
- package/dist/modules/waas/businessAccounts/removeBusinessAccountSigner/removeBusinessAccountSigner.d.ts.map +1 -1
- package/dist/modules/waas/businessAccounts/removeBusinessAccountWallet/removeBusinessAccountWallet.d.ts +12 -4
- package/dist/modules/waas/businessAccounts/removeBusinessAccountWallet/removeBusinessAccountWallet.d.ts.map +1 -1
- package/dist/modules/waas/businessAccounts/resendFields.d.ts +39 -0
- package/dist/modules/waas/businessAccounts/resendFields.d.ts.map +1 -0
- package/dist/modules/waas/businessAccounts/setBusinessAccountGovernance/index.d.ts +2 -0
- package/dist/modules/waas/businessAccounts/setBusinessAccountGovernance/index.d.ts.map +1 -0
- package/dist/modules/waas/businessAccounts/setBusinessAccountGovernance/setBusinessAccountGovernance.d.ts +49 -0
- package/dist/modules/waas/businessAccounts/setBusinessAccountGovernance/setBusinessAccountGovernance.d.ts.map +1 -0
- package/dist/modules/waas/businessAccounts/transferBusinessAccountOwnership/transferBusinessAccountOwnership.d.ts +11 -2
- package/dist/modules/waas/businessAccounts/transferBusinessAccountOwnership/transferBusinessAccountOwnership.d.ts.map +1 -1
- package/dist/modules/waas/businessAccounts/updateBusinessAccountMemberRole/updateBusinessAccountMemberRole.d.ts +11 -2
- package/dist/modules/waas/businessAccounts/updateBusinessAccountMemberRole/updateBusinessAccountMemberRole.d.ts.map +1 -1
- package/dist/modules/waas/businessAccounts/vetoBusinessAccountProposal/index.d.ts +2 -0
- package/dist/modules/waas/businessAccounts/vetoBusinessAccountProposal/index.d.ts.map +1 -0
- package/dist/modules/waas/businessAccounts/vetoBusinessAccountProposal/vetoBusinessAccountProposal.d.ts +29 -0
- package/dist/modules/waas/businessAccounts/vetoBusinessAccountProposal/vetoBusinessAccountProposal.d.ts.map +1 -0
- package/dist/modules/waas/businessAccounts/withdrawBusinessAccountProposalApproval/index.d.ts +2 -0
- package/dist/modules/waas/businessAccounts/withdrawBusinessAccountProposalApproval/index.d.ts.map +1 -0
- package/dist/modules/waas/businessAccounts/withdrawBusinessAccountProposalApproval/withdrawBusinessAccountProposalApproval.d.ts +29 -0
- package/dist/modules/waas/businessAccounts/withdrawBusinessAccountProposalApproval/withdrawBusinessAccountProposalApproval.d.ts.map +1 -0
- package/dist/tsconfig.lib.tsbuildinfo +1 -1
- package/dist/{waas-oKD6ZDP9.native.esm.js → waas-C4jtRxx1.native.esm.js} +688 -26
- package/dist/waas-C4jtRxx1.native.esm.js.map +1 -0
- package/dist/{waas-G-4JvdgJ.cjs → waas-CioG-_yp.cjs} +764 -24
- package/dist/waas-CioG-_yp.cjs.map +1 -0
- package/dist/{waas-DjgZ-ghV.esm.js → waas-DjivkzyT.esm.js} +688 -26
- package/dist/waas-DjivkzyT.esm.js.map +1 -0
- package/dist/waas.cjs +18 -5
- package/dist/waas.esm.js +5 -5
- package/dist/waas.native.esm.js +5 -5
- package/dist/waasCore.cjs +5 -5
- package/dist/waasCore.esm.js +5 -5
- package/dist/waasCore.native.esm.js +5 -5
- package/package.json +3 -4
- package/dist/getNetworkProviderFromNetworkId-BXoTukxv.cjs.map +0 -1
- package/dist/getNetworkProviderFromNetworkId-Cs3hLqBS.native.esm.js.map +0 -1
- package/dist/getNetworkProviderFromNetworkId-D_Hg6kP7.esm.js.map +0 -1
- package/dist/logoutWithReason-Bd1qUh7l.native.esm.js.map +0 -1
- package/dist/logoutWithReason-CFjm8dbR.cjs.map +0 -1
- package/dist/logoutWithReason-CX9hGTPw.esm.js.map +0 -1
- package/dist/modules/projectSettings/fetchProjectSettings/projectSettingsExpirationScheme.d.ts +0 -5
- package/dist/modules/projectSettings/fetchProjectSettings/projectSettingsExpirationScheme.d.ts.map +0 -1
- package/dist/waas-DjgZ-ghV.esm.js.map +0 -1
- package/dist/waas-G-4JvdgJ.cjs.map +0 -1
- package/dist/waas-oKD6ZDP9.native.esm.js.map +0 -1
|
@@ -8,6 +8,17 @@ import type { DynamicClient } from '../../../client/types';
|
|
|
8
8
|
* There is deliberately no `expiresAt`. How long an intent stays redeemable is
|
|
9
9
|
* the account's governance to decide, measured from `createdAt` — an
|
|
10
10
|
* initiator-chosen expiry would be an initiator-chosen authorization lifetime.
|
|
11
|
+
*
|
|
12
|
+
* @example
|
|
13
|
+
* ```ts
|
|
14
|
+
* const result = await addBusinessAccountMember({ businessAccountId, targetIdentity, role: 'admin' });
|
|
15
|
+
* if (isBusinessAccountActionRequired(result)) {
|
|
16
|
+
* const intent: BusinessAccountIntent = result.intent;
|
|
17
|
+
* }
|
|
18
|
+
* ```
|
|
19
|
+
*
|
|
20
|
+
* @see {@link signBusinessAccountIntent} for signing one of these.
|
|
21
|
+
* @see {@link BusinessAccountActionRequired} for where an unsigned intent is returned.
|
|
11
22
|
*/
|
|
12
23
|
export type BusinessAccountIntent = {
|
|
13
24
|
actionType: string;
|
|
@@ -22,7 +33,17 @@ export type BusinessAccountIntent = {
|
|
|
22
33
|
type SignBusinessAccountIntentParams = {
|
|
23
34
|
intent: BusinessAccountIntent;
|
|
24
35
|
};
|
|
25
|
-
/**
|
|
36
|
+
/**
|
|
37
|
+
* The signed intent and the signature over its canonical form.
|
|
38
|
+
*
|
|
39
|
+
* @example
|
|
40
|
+
* ```ts
|
|
41
|
+
* const signed: SignBusinessAccountIntentResult = await signBusinessAccountIntent({ intent });
|
|
42
|
+
* ```
|
|
43
|
+
*
|
|
44
|
+
* @see {@link signBusinessAccountIntent} for producing this shape.
|
|
45
|
+
* @see {@link SignedBusinessAccountIntent} for resending it to a governed mutation.
|
|
46
|
+
*/
|
|
26
47
|
export type SignBusinessAccountIntentResult = {
|
|
27
48
|
intent: BusinessAccountIntent;
|
|
28
49
|
intentSignature: string;
|
|
@@ -40,7 +61,7 @@ export type SignBusinessAccountIntentResult = {
|
|
|
40
61
|
* WebCrypto verify expects.
|
|
41
62
|
*
|
|
42
63
|
* @param params.intent - The intent to sign.
|
|
43
|
-
* @param client - The Dynamic client instance.
|
|
64
|
+
* @param [client] - The Dynamic client instance. Only required when using multiple Dynamic clients.
|
|
44
65
|
* @returns The intent alongside the P1363 hex signature over its canonical form.
|
|
45
66
|
*
|
|
46
67
|
* @example
|
|
@@ -50,16 +71,27 @@ export type SignBusinessAccountIntentResult = {
|
|
|
50
71
|
*
|
|
51
72
|
* @see {@link signBusinessAccountApproval} for a co-signer approving this intent.
|
|
52
73
|
* @see {@link BusinessAccountIntent} for the shape being signed.
|
|
74
|
+
* @noHook A local crypto step inside a larger flow, not a standalone server mutation a component would drive loading/error state around.
|
|
53
75
|
* @notInstrumented
|
|
54
76
|
*/
|
|
55
|
-
export declare const signBusinessAccountIntent: ({ intent }: SignBusinessAccountIntentParams, client
|
|
77
|
+
export declare const signBusinessAccountIntent: ({ intent }: SignBusinessAccountIntentParams, client?: DynamicClient) => Promise<SignBusinessAccountIntentResult>;
|
|
56
78
|
type SignBusinessAccountApprovalParams = {
|
|
57
79
|
/** Defaults to now. Accepted for tests and for a caller that has already
|
|
58
80
|
* recorded when the human consented. */
|
|
59
81
|
approvedAt?: string;
|
|
60
82
|
intent: BusinessAccountIntent;
|
|
61
83
|
};
|
|
62
|
-
/**
|
|
84
|
+
/**
|
|
85
|
+
* An approval's signature and the timestamp it was signed over.
|
|
86
|
+
*
|
|
87
|
+
* @example
|
|
88
|
+
* ```ts
|
|
89
|
+
* const { approvedAt, signature }: SignBusinessAccountApprovalResult = await signBusinessAccountApproval({ intent });
|
|
90
|
+
* ```
|
|
91
|
+
*
|
|
92
|
+
* @see {@link signBusinessAccountApproval} for producing this shape.
|
|
93
|
+
* @see {@link approveBusinessAccountProposal} for the usual way to approve a proposal instead.
|
|
94
|
+
*/
|
|
63
95
|
export type SignBusinessAccountApprovalResult = {
|
|
64
96
|
approvedAt: string;
|
|
65
97
|
signature: string;
|
|
@@ -78,7 +110,7 @@ export type SignBusinessAccountApprovalResult = {
|
|
|
78
110
|
*
|
|
79
111
|
* @param params.intent - The intent being approved.
|
|
80
112
|
* @param params.approvedAt - When the approver consented. Defaults to now.
|
|
81
|
-
* @param client - The Dynamic client instance.
|
|
113
|
+
* @param [client] - The Dynamic client instance. Only required when using multiple Dynamic clients.
|
|
82
114
|
* @returns The timestamp signed over, alongside the P1363 hex signature.
|
|
83
115
|
*
|
|
84
116
|
* @example
|
|
@@ -88,8 +120,9 @@ export type SignBusinessAccountApprovalResult = {
|
|
|
88
120
|
*
|
|
89
121
|
* @see {@link signBusinessAccountIntent} for the initiator's own signature over the intent.
|
|
90
122
|
* @see {@link BusinessAccountIntent} for the shape being approved.
|
|
123
|
+
* @noHook A local crypto step inside a larger flow — {@link approveBusinessAccountProposal} already wraps it for the normal approve-a-proposal case.
|
|
91
124
|
* @notInstrumented
|
|
92
125
|
*/
|
|
93
|
-
export declare const signBusinessAccountApproval: ({ intent, approvedAt, }: SignBusinessAccountApprovalParams, client
|
|
126
|
+
export declare const signBusinessAccountApproval: ({ intent, approvedAt, }: SignBusinessAccountApprovalParams, client?: DynamicClient) => Promise<SignBusinessAccountApprovalResult>;
|
|
94
127
|
export {};
|
|
95
128
|
//# sourceMappingURL=signBusinessAccountIntent.d.ts.map
|
package/dist/modules/sessionKeys/signBusinessAccountIntent/signBusinessAccountIntent.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"signBusinessAccountIntent.d.ts","sourceRoot":"","sources":["../../../../src/modules/sessionKeys/signBusinessAccountIntent/signBusinessAccountIntent.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"signBusinessAccountIntent.d.ts","sourceRoot":"","sources":["../../../../src/modules/sessionKeys/signBusinessAccountIntent/signBusinessAccountIntent.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AAG3D;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,MAAM,MAAM,qBAAqB,GAAG;IAClC,UAAU,EAAE,MAAM,CAAC;IACnB,iBAAiB,EAAE,MAAM,CAAC;IAC1B,SAAS,EAAE,MAAM,CAAC;IAClB,eAAe,EAAE,MAAM,CAAC;IACxB,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,EAAE;QAAE,SAAS,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,CAAA;KAAE,CAAC;CACnD,CAAC;AAEF,KAAK,+BAA+B,GAAG;IACrC,MAAM,EAAE,qBAAqB,CAAC;CAC/B,CAAC;AAEF;;;;;;;;;;GAUG;AACH,MAAM,MAAM,+BAA+B,GAAG;IAC5C,MAAM,EAAE,qBAAqB,CAAC;IAC9B,eAAe,EAAE,MAAM,CAAC;CACzB,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,eAAO,MAAM,yBAAyB,eACxB,+BAA+B,WACnC,aAAa,KACpB,OAAO,CAAC,+BAA+B,CASzC,CAAC;AAEF,KAAK,iCAAiC,GAAG;IACvC;6CACyC;IACzC,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,MAAM,EAAE,qBAAqB,CAAC;CAC/B,CAAC;AAEF;;;;;;;;;;GAUG;AACH,MAAM,MAAM,iCAAiC,GAAG;IAC9C,UAAU,EAAE,MAAM,CAAC;IACnB,SAAS,EAAE,MAAM,CAAC;CACnB,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AAEH,eAAO,MAAM,2BAA2B,4BAInC,iCAAiC,WAC5B,aAAa,KACpB,OAAO,CAAC,iCAAiC,CAY3C,CAAC"}
|
package/dist/modules/waas/businessAccounts/addBusinessAccountMember/addBusinessAccountMember.d.ts
CHANGED
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import type { DynamicClient } from '../../../../client/types';
|
|
2
|
-
import type { BusinessAccountActionRequired, BusinessAccountMember, BusinessAccountMemberRole, TargetIdentity } from '../businessAccounts.types';
|
|
2
|
+
import type { BusinessAccountActionRequired, BusinessAccountMember, BusinessAccountMemberRole, SignedBusinessAccountIntent, TargetIdentity } from '../businessAccounts.types';
|
|
3
3
|
type AddMemberParams = {
|
|
4
|
+
autoExecute?: boolean;
|
|
4
5
|
businessAccountId: string;
|
|
5
6
|
role?: BusinessAccountMemberRole;
|
|
7
|
+
signed?: SignedBusinessAccountIntent;
|
|
6
8
|
targetIdentity: TargetIdentity;
|
|
7
9
|
};
|
|
8
10
|
/**
|
|
@@ -16,18 +18,22 @@ type AddMemberParams = {
|
|
|
16
18
|
*
|
|
17
19
|
* When the account governs `addMember`, nothing is written and the 202 body is
|
|
18
20
|
* returned instead — first the intent to sign, then the proposal collecting
|
|
19
|
-
* approvals. Narrow it with `isBusinessAccountActionRequired`.
|
|
21
|
+
* approvals. Narrow it with `isBusinessAccountActionRequired`. Resend with
|
|
22
|
+
* `signed` (from `signBusinessAccountIntent`) to move past `INTENT_REQUIRED`.
|
|
20
23
|
*
|
|
21
24
|
* @param params.businessAccountId - The ID of the business account.
|
|
22
25
|
* @param params.targetIdentity - The member to add (userId, or identifier + identifierType).
|
|
23
26
|
* @param [params.role] - The member role: a built-in (`admin`, `viewer`) or a
|
|
24
27
|
* role this account defined. Defaults to `viewer`. `owner` is rejected — use
|
|
25
28
|
* `transferBusinessAccountOwnership`.
|
|
29
|
+
* @param [params.autoExecute] - Whether to apply on the completing approval.
|
|
30
|
+
* Only meaningful on the first call.
|
|
31
|
+
* @param [params.signed] - A previously-signed intent, to resend past `INTENT_REQUIRED`.
|
|
26
32
|
* @param [client] - The Dynamic client instance. Only required when using multiple Dynamic clients.
|
|
27
33
|
* @returns The created business account member, or the outstanding action required.
|
|
28
34
|
* @throws {UnexpectedConsentResponseError} When a governed account answers 202 with an unrecognized body.
|
|
29
35
|
* @notInstrumented
|
|
30
36
|
*/
|
|
31
|
-
export declare const addBusinessAccountMember: ({ businessAccountId, targetIdentity, role }: AddMemberParams, client?: DynamicClient) => Promise<BusinessAccountActionRequired | BusinessAccountMember>;
|
|
37
|
+
export declare const addBusinessAccountMember: ({ businessAccountId, targetIdentity, role, autoExecute, signed }: AddMemberParams, client?: DynamicClient) => Promise<BusinessAccountActionRequired | BusinessAccountMember>;
|
|
32
38
|
export {};
|
|
33
39
|
//# sourceMappingURL=addBusinessAccountMember.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"addBusinessAccountMember.d.ts","sourceRoot":"","sources":["../../../../../src/modules/waas/businessAccounts/addBusinessAccountMember/addBusinessAccountMember.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AAI9D,OAAO,KAAK,EACV,6BAA6B,EAC7B,qBAAqB,EACrB,yBAAyB,EACzB,cAAc,EACf,MAAM,2BAA2B,CAAC;
|
|
1
|
+
{"version":3,"file":"addBusinessAccountMember.d.ts","sourceRoot":"","sources":["../../../../../src/modules/waas/businessAccounts/addBusinessAccountMember/addBusinessAccountMember.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AAI9D,OAAO,KAAK,EACV,6BAA6B,EAC7B,qBAAqB,EACrB,yBAAyB,EACzB,2BAA2B,EAC3B,cAAc,EACf,MAAM,2BAA2B,CAAC;AAInC,KAAK,eAAe,GAAG;IACrB,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,iBAAiB,EAAE,MAAM,CAAC;IAC1B,IAAI,CAAC,EAAE,yBAAyB,CAAC;IACjC,MAAM,CAAC,EAAE,2BAA2B,CAAC;IACrC,cAAc,EAAE,cAAc,CAAC;CAChC,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,eAAO,MAAM,wBAAwB,qEAC+B,eAAe,WACzE,aAAa,KACpB,OAAO,CAAC,6BAA6B,GAAG,qBAAqB,CAsC/D,CAAC"}
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import type { DynamicClient } from '../../../../client/types';
|
|
2
|
-
import type { BusinessAccountActionRequired, BusinessAccountDetail } from '../businessAccounts.types';
|
|
2
|
+
import type { BusinessAccountActionRequired, BusinessAccountDetail, SignedBusinessAccountIntent } from '../businessAccounts.types';
|
|
3
3
|
type AddWalletParams = {
|
|
4
|
+
autoExecute?: boolean;
|
|
4
5
|
businessAccountId?: string;
|
|
6
|
+
signed?: SignedBusinessAccountIntent;
|
|
5
7
|
walletId: string;
|
|
6
8
|
};
|
|
7
9
|
/**
|
|
@@ -15,14 +17,19 @@ type AddWalletParams = {
|
|
|
15
17
|
*
|
|
16
18
|
* When the account governs `linkWallet`, nothing is written and the 202 body is
|
|
17
19
|
* returned instead — first the intent to sign, then the proposal collecting
|
|
18
|
-
* approvals. Narrow it with `isBusinessAccountActionRequired`.
|
|
20
|
+
* approvals. Narrow it with `isBusinessAccountActionRequired`. Resend with
|
|
21
|
+
* `signed` (from `signBusinessAccountIntent`) to move past `INTENT_REQUIRED`.
|
|
19
22
|
*
|
|
20
23
|
* @param [params.businessAccountId] - The business account to link to; found-or-created when omitted.
|
|
21
24
|
* @param params.walletId - The ID of the wallet to link.
|
|
25
|
+
* @param [params.autoExecute] - Whether to apply on the completing approval.
|
|
26
|
+
* Only meaningful on the first call.
|
|
27
|
+
* @param [params.signed] - A previously-signed intent, to resend past `INTENT_REQUIRED`.
|
|
22
28
|
* @param [client] - The Dynamic client instance. Only required when using multiple Dynamic clients.
|
|
23
29
|
* @returns The updated business account detail, or the outstanding action required.
|
|
30
|
+
* @throws {UnexpectedConsentResponseError} When a governed account answers 202 with an unrecognized body.
|
|
24
31
|
* @notInstrumented
|
|
25
32
|
*/
|
|
26
|
-
export declare const addWalletToBusinessAccount: ({ businessAccountId, walletId }: AddWalletParams, client?: DynamicClient) => Promise<BusinessAccountActionRequired | BusinessAccountDetail>;
|
|
33
|
+
export declare const addWalletToBusinessAccount: ({ businessAccountId, walletId, autoExecute, signed }: AddWalletParams, client?: DynamicClient) => Promise<BusinessAccountActionRequired | BusinessAccountDetail>;
|
|
27
34
|
export {};
|
|
28
35
|
//# sourceMappingURL=addWalletToBusinessAccount.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"addWalletToBusinessAccount.d.ts","sourceRoot":"","sources":["../../../../../src/modules/waas/businessAccounts/addWalletToBusinessAccount/addWalletToBusinessAccount.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;
|
|
1
|
+
{"version":3,"file":"addWalletToBusinessAccount.d.ts","sourceRoot":"","sources":["../../../../../src/modules/waas/businessAccounts/addWalletToBusinessAccount/addWalletToBusinessAccount.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AAG9D,OAAO,KAAK,EACV,6BAA6B,EAC7B,qBAAqB,EACrB,2BAA2B,EAC5B,MAAM,2BAA2B,CAAC;AAInC,KAAK,eAAe,GAAG;IACrB,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,MAAM,CAAC,EAAE,2BAA2B,CAAC;IACrC,QAAQ,EAAE,MAAM,CAAC;CAClB,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,eAAO,MAAM,0BAA0B,yDACiB,eAAe,WAC7D,aAAa,KACpB,OAAO,CAAC,6BAA6B,GAAG,qBAAqB,CAkC/D,CAAC"}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import type { DynamicClient } from '../../../../client/types';
|
|
2
|
+
import type { BusinessAccountProposal } from '../businessAccounts.types';
|
|
3
|
+
type ApproveProposalParams = {
|
|
4
|
+
businessAccountId: string;
|
|
5
|
+
proposal: BusinessAccountProposal;
|
|
6
|
+
};
|
|
7
|
+
/**
|
|
8
|
+
* Signs and records this session's approval of a pending proposal.
|
|
9
|
+
*
|
|
10
|
+
* The signature is over the intent AS STORED on `proposal`, which is why it's
|
|
11
|
+
* read off the proposal rather than rebuilt — a re-derived intent would carry
|
|
12
|
+
* a different `intentId` and fail verification. Run this signed in as the
|
|
13
|
+
* approver: the session key that signs is theirs, and the enclave reads who
|
|
14
|
+
* they are from the bearer token, not from any field here. An initiator can
|
|
15
|
+
* never approve their own proposal.
|
|
16
|
+
*
|
|
17
|
+
* With `autoExecute` on, the approval that completes the quorum also applies
|
|
18
|
+
* the change and the returned proposal reads `status: 'executed'` — the
|
|
19
|
+
* caller's cue to refresh the account rather than inferring readiness from
|
|
20
|
+
* the tally.
|
|
21
|
+
*
|
|
22
|
+
* @param params.businessAccountId - The business account the proposal belongs to.
|
|
23
|
+
* @param params.proposal - The proposal to approve, as returned by
|
|
24
|
+
* `listBusinessAccountProposals` or `getBusinessAccount`.
|
|
25
|
+
* @param [client] - The Dynamic client instance. Only required when using multiple Dynamic clients.
|
|
26
|
+
* @returns The proposal after recording this approval.
|
|
27
|
+
*
|
|
28
|
+
* @example
|
|
29
|
+
* ```ts
|
|
30
|
+
* const pending = await listBusinessAccountProposals({ businessAccountId, status: 'pending' });
|
|
31
|
+
* const updated = await approveBusinessAccountProposal({ businessAccountId, proposal: pending[0] });
|
|
32
|
+
* if (updated.status === 'executed') {
|
|
33
|
+
* // refresh the account — the change is live
|
|
34
|
+
* }
|
|
35
|
+
* ```
|
|
36
|
+
*
|
|
37
|
+
* @see {@link vetoBusinessAccountProposal} for refusing a proposal instead.
|
|
38
|
+
* @see {@link executeBusinessAccountProposal} for applying a satisfied one with `autoExecute` off.
|
|
39
|
+
* @notInstrumented
|
|
40
|
+
*/
|
|
41
|
+
export declare const approveBusinessAccountProposal: ({ businessAccountId, proposal }: ApproveProposalParams, client?: DynamicClient) => Promise<BusinessAccountProposal>;
|
|
42
|
+
export {};
|
|
43
|
+
//# sourceMappingURL=approveBusinessAccountProposal.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"approveBusinessAccountProposal.d.ts","sourceRoot":"","sources":["../../../../../src/modules/waas/businessAccounts/approveBusinessAccountProposal/approveBusinessAccountProposal.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AAG9D,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,2BAA2B,CAAC;AAEzE,KAAK,qBAAqB,GAAG;IAC3B,iBAAiB,EAAE,MAAM,CAAC;IAC1B,QAAQ,EAAE,uBAAuB,CAAC;CACnC,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AACH,eAAO,MAAM,8BAA8B,oCACR,qBAAqB,WAC9C,aAAa,KACpB,OAAO,CAAC,uBAAuB,CAwBjC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/modules/waas/businessAccounts/approveBusinessAccountProposal/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,8BAA8B,EAAE,MAAM,kCAAkC,CAAC"}
|
|
@@ -280,6 +280,255 @@ export type BusinessAccountActionRequired = {
|
|
|
280
280
|
proposalId?: string;
|
|
281
281
|
reason: 'APPROVALS_REQUIRED' | 'INTENT_REQUIRED';
|
|
282
282
|
};
|
|
283
|
+
/**
|
|
284
|
+
* A previously-signed intent, ready to resend so a governed mutation can move
|
|
285
|
+
* past `INTENT_REQUIRED` to `APPROVALS_REQUIRED`. Build it with
|
|
286
|
+
* `signBusinessAccountIntent({ intent: actionRequired.intent })`, then pass it
|
|
287
|
+
* back into the same mutation call as `signed`.
|
|
288
|
+
*
|
|
289
|
+
* @example
|
|
290
|
+
* ```ts
|
|
291
|
+
* const first = await addBusinessAccountMember({ businessAccountId, targetIdentity, role: 'admin' });
|
|
292
|
+
* if (isBusinessAccountActionRequired(first) && first.reason === 'INTENT_REQUIRED') {
|
|
293
|
+
* const signed = await signBusinessAccountIntent({ intent: first.intent });
|
|
294
|
+
* const second = await addBusinessAccountMember({ businessAccountId, targetIdentity, role: 'admin', signed });
|
|
295
|
+
* }
|
|
296
|
+
* ```
|
|
297
|
+
*
|
|
298
|
+
* @see {@link signBusinessAccountIntent} for producing this shape.
|
|
299
|
+
* @see {@link BusinessAccountActionRequired} for the `intent` a fresh attempt returns.
|
|
300
|
+
*/
|
|
301
|
+
export type SignedBusinessAccountIntent = {
|
|
302
|
+
intent: BusinessAccountMutationIntent;
|
|
303
|
+
intentSignature: string;
|
|
304
|
+
};
|
|
305
|
+
/**
|
|
306
|
+
* The new document version after a governance-configuration change applies
|
|
307
|
+
* immediately (ungoverned, or the completing approval of a governed one).
|
|
308
|
+
* Distinct from the domain objects other mutations return (a member, a
|
|
309
|
+
* detail) because `setGovernance`/`defineRole`/`deleteRole` change the
|
|
310
|
+
* account's authorization document itself, which has no separate summary
|
|
311
|
+
* shape of its own.
|
|
312
|
+
*
|
|
313
|
+
* @example
|
|
314
|
+
* ```ts
|
|
315
|
+
* const result = await setBusinessAccountGovernance({ businessAccountId, governance });
|
|
316
|
+
* if (!isBusinessAccountActionRequired(result)) {
|
|
317
|
+
* console.log(result.version);
|
|
318
|
+
* }
|
|
319
|
+
* ```
|
|
320
|
+
*
|
|
321
|
+
* @see {@link setBusinessAccountGovernance}
|
|
322
|
+
* @see {@link defineBusinessAccountRole}
|
|
323
|
+
* @see {@link deleteBusinessAccountRole}
|
|
324
|
+
*/
|
|
325
|
+
export type BusinessAccountMutationVersion = {
|
|
326
|
+
version: number;
|
|
327
|
+
};
|
|
328
|
+
/**
|
|
329
|
+
* A role this account has defined, and the built-in role it inherits
|
|
330
|
+
* authority from. Inheriting is real: a holder of a role inheriting `admin`
|
|
331
|
+
* passes every admin-gated check, under the role's own name rather than
|
|
332
|
+
* `admin` itself.
|
|
333
|
+
*
|
|
334
|
+
* @example
|
|
335
|
+
* ```ts
|
|
336
|
+
* const roles = await listBusinessAccountRoles({ businessAccountId });
|
|
337
|
+
* console.log(roles.cfo?.inherits); // 'admin'
|
|
338
|
+
* ```
|
|
339
|
+
*
|
|
340
|
+
* @see {@link listBusinessAccountRoles}
|
|
341
|
+
* @see {@link defineBusinessAccountRole}
|
|
342
|
+
*/
|
|
343
|
+
export type BusinessAccountRoleDefinition = {
|
|
344
|
+
inherits: BuiltInBusinessAccountMemberRole;
|
|
345
|
+
};
|
|
346
|
+
/**
|
|
347
|
+
* Roles this account has defined, keyed by role name. Empty when none are —
|
|
348
|
+
* that's an answer, not a missing resource.
|
|
349
|
+
*
|
|
350
|
+
* @example
|
|
351
|
+
* ```ts
|
|
352
|
+
* const roles = await listBusinessAccountRoles({ businessAccountId });
|
|
353
|
+
* const cfoInherits = roles.cfo?.inherits;
|
|
354
|
+
* ```
|
|
355
|
+
*
|
|
356
|
+
* @see {@link listBusinessAccountRoles}
|
|
357
|
+
* @see {@link BusinessAccountRoleDefinition} for one role's shape.
|
|
358
|
+
*/
|
|
359
|
+
export type BusinessAccountRoleDefinitions = Record<string, BusinessAccountRoleDefinition>;
|
|
360
|
+
/**
|
|
361
|
+
* Scopes a governance requirement to a subset of the changes it would
|
|
362
|
+
* otherwise match. A field only takes effect on the action(s) whose change
|
|
363
|
+
* actually carries it — `newRole` never matches `addMember`, for
|
|
364
|
+
* example, since nothing about adding a member names a role being left. Leave
|
|
365
|
+
* a requirement's `when` unset to apply it to every change of that action.
|
|
366
|
+
*
|
|
367
|
+
* `initiatorRoles` and `initiatorUserIds` describe the proposer rather than
|
|
368
|
+
* the change, so they apply everywhere regardless of action.
|
|
369
|
+
*
|
|
370
|
+
* @example
|
|
371
|
+
* ```ts
|
|
372
|
+
* const when: BusinessAccountRequirementCondition = { role: 'admin' };
|
|
373
|
+
* ```
|
|
374
|
+
*
|
|
375
|
+
* @see {@link BusinessAccountGovernanceRequirement} for where this is embedded.
|
|
376
|
+
* @see {@link setBusinessAccountGovernance} for writing a requirement with one.
|
|
377
|
+
*/
|
|
378
|
+
export type BusinessAccountRequirementCondition = {
|
|
379
|
+
initiatorRoles?: string[];
|
|
380
|
+
initiatorUserIds?: string[];
|
|
381
|
+
newRole?: string;
|
|
382
|
+
role?: string;
|
|
383
|
+
targetUserIds?: string[];
|
|
384
|
+
walletIds?: string[];
|
|
385
|
+
};
|
|
386
|
+
/**
|
|
387
|
+
* A governance rule: how many approvals a governed action needs, from whom,
|
|
388
|
+
* and under what condition it applies. This is the definition shape —
|
|
389
|
+
* `getBusinessAccountGovernance` returns it, `setBusinessAccountGovernance`
|
|
390
|
+
* takes it back. Distinct from `BusinessAccountApprovalRequirement`, which is
|
|
391
|
+
* the read-only tally of how close a specific proposal is to meeting one of
|
|
392
|
+
* these.
|
|
393
|
+
*
|
|
394
|
+
* @example
|
|
395
|
+
* ```ts
|
|
396
|
+
* const requirement: BusinessAccountGovernanceRequirement = {
|
|
397
|
+
* id: 'one-admin',
|
|
398
|
+
* schemaVersion: 1,
|
|
399
|
+
* requiredApprovals: 1,
|
|
400
|
+
* eligibleApproverRoles: ['admin'],
|
|
401
|
+
* };
|
|
402
|
+
* ```
|
|
403
|
+
*
|
|
404
|
+
* @see {@link BusinessAccountGovernance} for how these are keyed by action.
|
|
405
|
+
* @see {@link BusinessAccountApprovalRequirement} for the read-only tally shape.
|
|
406
|
+
* @see {@link setBusinessAccountGovernance}
|
|
407
|
+
*/
|
|
408
|
+
export type BusinessAccountGovernanceRequirement = {
|
|
409
|
+
approverCapabilities?: string[];
|
|
410
|
+
/** Seconds from the signed intent in which the change must be BOTH
|
|
411
|
+
* approved and executed — one deadline, not separate approve-by and
|
|
412
|
+
* execute-by clocks. Absent defaults to 24 hours; capped at 30 days. */
|
|
413
|
+
completeWithinSeconds?: number;
|
|
414
|
+
eligibleApproverRoles?: string[];
|
|
415
|
+
eligibleInitiatorRoles?: string[];
|
|
416
|
+
id: string;
|
|
417
|
+
mandatoryApproverRoles?: string[];
|
|
418
|
+
requiredApprovals: number;
|
|
419
|
+
schemaVersion: number;
|
|
420
|
+
when?: BusinessAccountRequirementCondition;
|
|
421
|
+
};
|
|
422
|
+
/**
|
|
423
|
+
* The governance rules in force, keyed by governed action, exactly as
|
|
424
|
+
* `getBusinessAccountGovernance` returns it and `setBusinessAccountGovernance`
|
|
425
|
+
* accepts it back. Empty when the account governs nothing — that is an
|
|
426
|
+
* answer, not a missing resource.
|
|
427
|
+
*
|
|
428
|
+
* @example
|
|
429
|
+
* ```ts
|
|
430
|
+
* const governance = await getBusinessAccountGovernance({ businessAccountId });
|
|
431
|
+
* const addMemberRules = governance.addMember ?? [];
|
|
432
|
+
* ```
|
|
433
|
+
*
|
|
434
|
+
* @see {@link getBusinessAccountGovernance}
|
|
435
|
+
* @see {@link setBusinessAccountGovernance}
|
|
436
|
+
*/
|
|
437
|
+
export type BusinessAccountGovernance = Record<string, BusinessAccountGovernanceRequirement[]>;
|
|
438
|
+
/**
|
|
439
|
+
* One recorded consent on a proposal: who approved, when, and whether they
|
|
440
|
+
* later withdrew it. A withdrawal sets `revokedAt` rather than deleting the
|
|
441
|
+
* row — consent is recorded as given and taken back, not erased.
|
|
442
|
+
*
|
|
443
|
+
* @example
|
|
444
|
+
* ```ts
|
|
445
|
+
* const stillCounts = proposal.approvals.filter((a) => !a.revokedAt);
|
|
446
|
+
* ```
|
|
447
|
+
*
|
|
448
|
+
* @see {@link BusinessAccountProposal} for where this is embedded.
|
|
449
|
+
* @see {@link withdrawBusinessAccountProposalApproval} for what sets `revokedAt`.
|
|
450
|
+
*/
|
|
451
|
+
export type BusinessAccountProposalApprovalRecord = {
|
|
452
|
+
approvedAt: string;
|
|
453
|
+
approverUserId: string;
|
|
454
|
+
revokedAt: string | null;
|
|
455
|
+
};
|
|
456
|
+
/**
|
|
457
|
+
* A user a proposed change is about — the member being added, the signer
|
|
458
|
+
* being removed, the new owner — resolved for display. Empty for a change
|
|
459
|
+
* that names no user, such as `setGovernance`.
|
|
460
|
+
*
|
|
461
|
+
* @example
|
|
462
|
+
* ```ts
|
|
463
|
+
* const names = proposal.subjects?.map((s) => s.email ?? s.userId);
|
|
464
|
+
* ```
|
|
465
|
+
*
|
|
466
|
+
* @see {@link BusinessAccountProposal} for where this is embedded.
|
|
467
|
+
* @see {@link listBusinessAccountProposals} for where proposals are fetched.
|
|
468
|
+
*/
|
|
469
|
+
export type BusinessAccountProposalSubject = {
|
|
470
|
+
email: string | null;
|
|
471
|
+
userId: string;
|
|
472
|
+
};
|
|
473
|
+
/**
|
|
474
|
+
* A governed mutation waiting on consent: what was proposed, who has signed,
|
|
475
|
+
* and how each governance requirement is tracking. Untrusted workflow state —
|
|
476
|
+
* the enclave verifies every signature when the proposal is executed, and the
|
|
477
|
+
* signature on file is over `intent` exactly as stored, so an approver must
|
|
478
|
+
* sign these bytes verbatim rather than re-derive the intent.
|
|
479
|
+
*
|
|
480
|
+
* `approvalRequirements` is authoritative for readiness — do not infer it
|
|
481
|
+
* from counting `approvals`, which includes approvers outside a rule's pool
|
|
482
|
+
* and approvers demoted since they signed.
|
|
483
|
+
*
|
|
484
|
+
* @example
|
|
485
|
+
* ```ts
|
|
486
|
+
* const pending = await listBusinessAccountProposals({ businessAccountId, status: 'pending' });
|
|
487
|
+
* const ready = pending.filter((p) => p.approvalRequirements?.every((r) => r.satisfied));
|
|
488
|
+
* ```
|
|
489
|
+
*
|
|
490
|
+
* @see {@link listBusinessAccountProposals}
|
|
491
|
+
* @see {@link approveBusinessAccountProposal}
|
|
492
|
+
* @see {@link executeBusinessAccountProposal}
|
|
493
|
+
*/
|
|
494
|
+
export type BusinessAccountProposal = {
|
|
495
|
+
actionType: string;
|
|
496
|
+
approvalRequirements?: BusinessAccountApprovalRequirement[];
|
|
497
|
+
approvals: BusinessAccountProposalApprovalRecord[];
|
|
498
|
+
autoExecute?: boolean;
|
|
499
|
+
businessAccountId: string;
|
|
500
|
+
completeBy: string;
|
|
501
|
+
consumedAt: string | null;
|
|
502
|
+
createdAt: string;
|
|
503
|
+
id: string;
|
|
504
|
+
initiatorUserId: string;
|
|
505
|
+
intent: BusinessAccountMutationIntent;
|
|
506
|
+
status: 'executed' | 'expired' | 'pending' | 'vetoed';
|
|
507
|
+
subjects?: BusinessAccountProposalSubject[];
|
|
508
|
+
};
|
|
509
|
+
/**
|
|
510
|
+
* A proposal's tally when execution is attempted before its quorum is met.
|
|
511
|
+
* Not a failure: the caller may try again once more approvals land.
|
|
512
|
+
* `intent` is echoed back so a caller who executed too early can hand
|
|
513
|
+
* remaining approvers the exact bytes to sign, without a separate fetch.
|
|
514
|
+
*
|
|
515
|
+
* @example
|
|
516
|
+
* ```ts
|
|
517
|
+
* const result = await executeBusinessAccountProposal({ businessAccountId, proposalId });
|
|
518
|
+
* if ('reason' in result) {
|
|
519
|
+
* console.log(result.approvalRequirements.map((r) => r.satisfied));
|
|
520
|
+
* }
|
|
521
|
+
* ```
|
|
522
|
+
*
|
|
523
|
+
* @see {@link executeBusinessAccountProposal}
|
|
524
|
+
* @see {@link BusinessAccountApprovalRequirement} for what each entry in `approvalRequirements` means.
|
|
525
|
+
*/
|
|
526
|
+
export type BusinessAccountProposalStillPending = {
|
|
527
|
+
approvalRequirements: BusinessAccountApprovalRequirement[];
|
|
528
|
+
intent: BusinessAccountMutationIntent;
|
|
529
|
+
proposalId: string;
|
|
530
|
+
reason: 'APPROVALS_REQUIRED';
|
|
531
|
+
};
|
|
283
532
|
export type BusinessAccountsApi = {
|
|
284
533
|
addMember: (params: {
|
|
285
534
|
businessAccountId: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"businessAccounts.types.d.ts","sourceRoot":"","sources":["../../../../src/modules/waas/businessAccounts/businessAccounts.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AAE3D;;;;;;;;;;;;;;;;;;GAkBG;AACH,MAAM,MAAM,eAAe,GAAG;IAC5B,SAAS,CAAC,EAAE,IAAI,CAAC;IACjB,WAAW,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC5B,EAAE,EAAE,MAAM,CAAC;IACX,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,IAAI,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,oBAAoB,EAAE,MAAM,CAAC;IAC7B,SAAS,CAAC,EAAE,IAAI,CAAC;CAClB,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,MAAM,MAAM,qBAAqB,GAAG;IAClC,aAAa,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC9B,iBAAiB,EAAE,MAAM,CAAC;IAC1B,SAAS,CAAC,EAAE,IAAI,CAAC;IACjB,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;CAChB,CAAC;AAEF;;;;;;;;;;;;;;;;;;;GAmBG;AACH,MAAM,MAAM,qBAAqB,GAAG;IAClC,iBAAiB,EAAE,MAAM,CAAC;IAC1B,SAAS,CAAC,EAAE,IAAI,CAAC;IACjB,EAAE,EAAE,MAAM,CAAC;IACX,UAAU,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3B,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACvB,QAAQ,EAAE,MAAM,CAAC;CAClB,CAAC;AAEF;;;;;;;;;;;;;;;;;GAiBG;AACH,MAAM,MAAM,4BAA4B,GAAG;IACzC,KAAK,EAAE,MAAM,CA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AC,EAAE,yBAAyB,CAAC;QACvC,cAAc,EAAE,cAAc,CAAC;QAC/B,QAAQ,EAAE,MAAM,CAAC;KAClB,KAAK,OAAO,CAAC,qBAAqB,CAAC,CAAC;IACrC,0BAA0B,EAAE,CAAC,MAAM,EAAE;QACnC,iBAAiB,CAAC,EAAE,MAAM,CAAC;QAC3B,QAAQ,EAAE,MAAM,CAAC;KAClB,KAAK,OAAO,CAAC,6BAA6B,GAAG,qBAAqB,CAAC,CAAC;IACrE,qBAAqB,EAAE,CAAC,IAAI,CAAC,EAAE;QAC7B,OAAO,CAAC,EAAE;YAAE,IAAI,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;SAAE,CAAC;KACpC,KAAK,OAAO,CAAC,eAAe,CAAC,CAAC;IAC/B,kBAAkB,EAAE,CAAC,MAAM,EAAE;QAC3B,iBAAiB,EAAE,MAAM,CAAC;KAC3B,KAAK,OAAO,CAAC,qBAAqB,CAAC,CAAC;IACrC,oBAAoB,EAAE,MAAM,OAAO,CAAC,mBAAmB,CAAC,CAAC;CAC1D,CAAC"}
|
|
1
|
+
{"version":3,"file":"businessAccounts.types.d.ts","sourceRoot":"","sources":["../../../../src/modules/waas/businessAccounts/businessAccounts.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AAE3D;;;;;;;;;;;;;;;;;;GAkBG;AACH,MAAM,MAAM,eAAe,GAAG;IAC5B,SAAS,CAAC,EAAE,IAAI,CAAC;IACjB,WAAW,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC5B,EAAE,EAAE,MAAM,CAAC;IACX,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,IAAI,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,oBAAoB,EAAE,MAAM,CAAC;IAC7B,SAAS,CAAC,EAAE,IAAI,CAAC;CAClB,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,MAAM,MAAM,qB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AAE,MAAM,OAAO,CAAC,mBAAmB,CAAC,CAAC;CAC1D,CAAC"}
|
package/dist/modules/waas/businessAccounts/defineBusinessAccountRole/defineBusinessAccountRole.d.ts
ADDED
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import type { DynamicClient } from '../../../../client/types';
|
|
2
|
+
import type { BuiltInBusinessAccountMemberRole, BusinessAccountActionRequired, BusinessAccountMutationVersion, SignedBusinessAccountIntent } from '../businessAccounts.types';
|
|
3
|
+
type DefineRoleParams = {
|
|
4
|
+
autoExecute?: boolean;
|
|
5
|
+
businessAccountId: string;
|
|
6
|
+
inherits: Exclude<BuiltInBusinessAccountMemberRole, 'owner'>;
|
|
7
|
+
role: string;
|
|
8
|
+
signed?: SignedBusinessAccountIntent;
|
|
9
|
+
};
|
|
10
|
+
/**
|
|
11
|
+
* Defines a custom role that inherits the authority of a built-in one.
|
|
12
|
+
* Inheriting is real: a holder passes every check gated on the base role,
|
|
13
|
+
* under the custom name rather than the base name itself. A role cannot
|
|
14
|
+
* inherit `owner` — use `transferBusinessAccountOwnership` to grant ownership.
|
|
15
|
+
*
|
|
16
|
+
* When the account governs `defineRole`, nothing is written and the 202 body
|
|
17
|
+
* is returned instead. Resend with `signed` (from `signBusinessAccountIntent`)
|
|
18
|
+
* to move past `INTENT_REQUIRED`.
|
|
19
|
+
*
|
|
20
|
+
* @param params.businessAccountId - The business account defining the role.
|
|
21
|
+
* @param params.role - The new role's name.
|
|
22
|
+
* @param params.inherits - The built-in role (`admin` or `viewer`) this role inherits.
|
|
23
|
+
* @param [params.autoExecute] - Whether to apply on the completing approval.
|
|
24
|
+
* Only meaningful on the first call.
|
|
25
|
+
* @param [params.signed] - A previously-signed intent, to resend past `INTENT_REQUIRED`.
|
|
26
|
+
* @param [client] - The Dynamic client instance. Only required when using multiple Dynamic clients.
|
|
27
|
+
* @returns The new document version, or the outstanding action required.
|
|
28
|
+
*
|
|
29
|
+
* @example
|
|
30
|
+
* ```ts
|
|
31
|
+
* await defineBusinessAccountRole({
|
|
32
|
+
* businessAccountId,
|
|
33
|
+
* role: 'cfo',
|
|
34
|
+
* inherits: 'admin',
|
|
35
|
+
* });
|
|
36
|
+
* ```
|
|
37
|
+
*
|
|
38
|
+
* @see {@link deleteBusinessAccountRole}
|
|
39
|
+
* @see {@link listBusinessAccountRoles}
|
|
40
|
+
* @throws {UnexpectedConsentResponseError} When a governed account answers 202 with an unrecognized body.
|
|
41
|
+
* @notInstrumented
|
|
42
|
+
*/
|
|
43
|
+
export declare const defineBusinessAccountRole: ({ businessAccountId, role, inherits, autoExecute, signed }: DefineRoleParams, client?: DynamicClient) => Promise<BusinessAccountActionRequired | BusinessAccountMutationVersion>;
|
|
44
|
+
export {};
|
|
45
|
+
//# sourceMappingURL=defineBusinessAccountRole.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"defineBusinessAccountRole.d.ts","sourceRoot":"","sources":["../../../../../src/modules/waas/businessAccounts/defineBusinessAccountRole/defineBusinessAccountRole.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AAE9D,OAAO,KAAK,EACV,gCAAgC,EAChC,6BAA6B,EAC7B,8BAA8B,EAC9B,2BAA2B,EAC5B,MAAM,2BAA2B,CAAC;AAInC,KAAK,gBAAgB,GAAG;IACtB,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,iBAAiB,EAAE,MAAM,CAAC;IAC1B,QAAQ,EAAE,OAAO,CAAC,gCAAgC,EAAE,OAAO,CAAC,CAAC;IAC7D,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,CAAC,EAAE,2BAA2B,CAAC;CACtC,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AACH,eAAO,MAAM,yBAAyB,+DACwB,gBAAgB,WACpE,aAAa,KACpB,OAAO,CAAC,6BAA6B,GAAG,8BAA8B,CA4BxE,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/modules/waas/businessAccounts/defineBusinessAccountRole/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,yBAAyB,EAAE,MAAM,6BAA6B,CAAC"}
|
package/dist/modules/waas/businessAccounts/deleteBusinessAccountRole/deleteBusinessAccountRole.d.ts
ADDED
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import type { DynamicClient } from '../../../../client/types';
|
|
2
|
+
import type { BusinessAccountActionRequired, BusinessAccountMutationVersion, SignedBusinessAccountIntent } from '../businessAccounts.types';
|
|
3
|
+
type DeleteRoleParams = {
|
|
4
|
+
autoExecute?: boolean;
|
|
5
|
+
businessAccountId: string;
|
|
6
|
+
role: string;
|
|
7
|
+
signed?: SignedBusinessAccountIntent;
|
|
8
|
+
};
|
|
9
|
+
/**
|
|
10
|
+
* Deletes a custom role definition. Holders are not removed and keep every
|
|
11
|
+
* capability they had — they're demoted to the role's inherited base (e.g. a
|
|
12
|
+
* deleted `cfo` role that inherited `admin` leaves its holders reading
|
|
13
|
+
* `admin`), since only the name goes away, not the authority. Refused with
|
|
14
|
+
* `ROLE_REFERENCED_BY_GOVERNANCE` while a governance requirement still names
|
|
15
|
+
* the role — remove it from governance first.
|
|
16
|
+
*
|
|
17
|
+
* When the account governs `deleteRole`, nothing is written and the 202 body
|
|
18
|
+
* is returned instead. Resend with `signed` (from `signBusinessAccountIntent`)
|
|
19
|
+
* to move past `INTENT_REQUIRED`.
|
|
20
|
+
*
|
|
21
|
+
* @param params.businessAccountId - The business account the role belongs to.
|
|
22
|
+
* @param params.role - The role's name.
|
|
23
|
+
* @param [params.autoExecute] - Whether to apply on the completing approval.
|
|
24
|
+
* Only meaningful on the first call.
|
|
25
|
+
* @param [params.signed] - A previously-signed intent, to resend past `INTENT_REQUIRED`.
|
|
26
|
+
* @param [client] - The Dynamic client instance. Only required when using multiple Dynamic clients.
|
|
27
|
+
* @returns The new document version, or the outstanding action required.
|
|
28
|
+
*
|
|
29
|
+
* @example
|
|
30
|
+
* ```ts
|
|
31
|
+
* await deleteBusinessAccountRole({ businessAccountId, role: 'cfo' });
|
|
32
|
+
* ```
|
|
33
|
+
*
|
|
34
|
+
* @see {@link defineBusinessAccountRole}
|
|
35
|
+
* @see {@link listBusinessAccountRoles}
|
|
36
|
+
* @throws {UnexpectedConsentResponseError} When a governed account answers 202 with an unrecognized body.
|
|
37
|
+
* @notInstrumented
|
|
38
|
+
*/
|
|
39
|
+
export declare const deleteBusinessAccountRole: ({ businessAccountId, role, autoExecute, signed }: DeleteRoleParams, client?: DynamicClient) => Promise<BusinessAccountActionRequired | BusinessAccountMutationVersion>;
|
|
40
|
+
export {};
|
|
41
|
+
//# sourceMappingURL=deleteBusinessAccountRole.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"deleteBusinessAccountRole.d.ts","sourceRoot":"","sources":["../../../../../src/modules/waas/businessAccounts/deleteBusinessAccountRole/deleteBusinessAccountRole.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AAE9D,OAAO,KAAK,EACV,6BAA6B,EAC7B,8BAA8B,EAC9B,2BAA2B,EAC5B,MAAM,2BAA2B,CAAC;AAInC,KAAK,gBAAgB,GAAG;IACtB,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,iBAAiB,EAAE,MAAM,CAAC;IAC1B,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,CAAC,EAAE,2BAA2B,CAAC;CACtC,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AACH,eAAO,MAAM,yBAAyB,qDACc,gBAAgB,WAC1D,aAAa,KACpB,OAAO,CAAC,6BAA6B,GAAG,8BAA8B,CA4BxE,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/modules/waas/businessAccounts/deleteBusinessAccountRole/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,yBAAyB,EAAE,MAAM,6BAA6B,CAAC"}
|