@dfns/sdk 0.1.0-beta.2 → 0.1.0-beta.4
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/codegen/Auth/AuthClient.d.ts +1 -0
- package/codegen/Auth/AuthClient.js +12 -0
- package/codegen/Auth/DelegatedAuthClient.d.ts +2 -0
- package/codegen/Auth/DelegatedAuthClient.js +27 -0
- package/codegen/Auth/types.d.ts +4 -0
- package/codegen/datamodel/Auth/responses.d.ts +5 -0
- package/codegen/datamodel/Auth/types.d.ts +4 -0
- package/codegen/datamodel/PolicyManagement/types.d.ts +27 -3
- package/codegen/datamodel/PolicyManagement/types.js +2 -0
- package/codegen/datamodel/Wallets/types.d.ts +3 -0
- package/codegen/datamodel/Wallets/types.js +6 -0
- package/package.json +1 -1
|
@@ -46,4 +46,5 @@ export declare class AuthClient {
|
|
|
46
46
|
deactivateApplication(request: T.DeactivateApplicationRequest): Promise<T.DeactivateApplicationResponse>;
|
|
47
47
|
createUserRecovery(request: T.CreateUserRecoveryRequest): Promise<T.CreateUserRecoveryResponse>;
|
|
48
48
|
restartDelegatedUserRegistration(request: T.RestartDelegatedUserRegistrationRequest): Promise<T.RestartDelegatedUserRegistrationResponse>;
|
|
49
|
+
createDelegatedUserRecovery(request: T.CreateDelegatedUserRecoveryRequest): Promise<T.CreateDelegatedUserRecoveryResponse>;
|
|
49
50
|
}
|
|
@@ -502,5 +502,17 @@ class AuthClient {
|
|
|
502
502
|
});
|
|
503
503
|
return response.json();
|
|
504
504
|
}
|
|
505
|
+
async createDelegatedUserRecovery(request) {
|
|
506
|
+
const path = (0, url_1.buildPathAndQuery)('/auth/recover/user/delegated', {
|
|
507
|
+
path: {},
|
|
508
|
+
query: {},
|
|
509
|
+
});
|
|
510
|
+
const response = await (0, fetch_1.userActionFetch)(path, {
|
|
511
|
+
method: 'POST',
|
|
512
|
+
body: request.body,
|
|
513
|
+
apiOptions: this.apiOptions,
|
|
514
|
+
});
|
|
515
|
+
return response.json();
|
|
516
|
+
}
|
|
505
517
|
}
|
|
506
518
|
exports.AuthClient = AuthClient;
|
|
@@ -73,4 +73,6 @@ export declare class DelegatedAuthClient {
|
|
|
73
73
|
createUserRecovery(request: T.CreateUserRecoveryRequest): Promise<T.CreateUserRecoveryResponse>;
|
|
74
74
|
restartDelegatedUserRegistrationInit(request: T.RestartDelegatedUserRegistrationRequest): Promise<UserActionChallengeResponse>;
|
|
75
75
|
restartDelegatedUserRegistrationComplete(request: T.RestartDelegatedUserRegistrationRequest, signedChallenge: SignUserActionChallengeRequest): Promise<T.RestartDelegatedUserRegistrationResponse>;
|
|
76
|
+
createDelegatedUserRecoveryInit(request: T.CreateDelegatedUserRecoveryRequest): Promise<UserActionChallengeResponse>;
|
|
77
|
+
createDelegatedUserRecoveryComplete(request: T.CreateDelegatedUserRecoveryRequest, signedChallenge: SignUserActionChallengeRequest): Promise<T.CreateDelegatedUserRecoveryResponse>;
|
|
76
78
|
}
|
|
@@ -905,5 +905,32 @@ class DelegatedAuthClient {
|
|
|
905
905
|
});
|
|
906
906
|
return response.json();
|
|
907
907
|
}
|
|
908
|
+
async createDelegatedUserRecoveryInit(request) {
|
|
909
|
+
const path = (0, url_1.buildPathAndQuery)('/auth/recover/user/delegated', {
|
|
910
|
+
path: {},
|
|
911
|
+
query: {},
|
|
912
|
+
});
|
|
913
|
+
const challenge = await baseAuthApi_1.BaseAuthApi.createUserActionChallenge({
|
|
914
|
+
userActionHttpMethod: 'POST',
|
|
915
|
+
userActionHttpPath: path,
|
|
916
|
+
userActionPayload: JSON.stringify(request.body),
|
|
917
|
+
userActionServerKind: 'Api',
|
|
918
|
+
}, this.apiOptions);
|
|
919
|
+
return challenge;
|
|
920
|
+
}
|
|
921
|
+
async createDelegatedUserRecoveryComplete(request, signedChallenge) {
|
|
922
|
+
const path = (0, url_1.buildPathAndQuery)('/auth/recover/user/delegated', {
|
|
923
|
+
path: {},
|
|
924
|
+
query: {},
|
|
925
|
+
});
|
|
926
|
+
const { userAction } = await baseAuthApi_1.BaseAuthApi.signUserActionChallenge(signedChallenge, this.apiOptions);
|
|
927
|
+
const response = await (0, fetch_1.simpleFetch)(path, {
|
|
928
|
+
method: 'POST',
|
|
929
|
+
body: request.body,
|
|
930
|
+
headers: { 'x-dfns-useraction': userAction },
|
|
931
|
+
apiOptions: this.apiOptions,
|
|
932
|
+
});
|
|
933
|
+
return response.json();
|
|
934
|
+
}
|
|
908
935
|
}
|
|
909
936
|
exports.DelegatedAuthClient = DelegatedAuthClient;
|
package/codegen/Auth/types.d.ts
CHANGED
|
@@ -171,3 +171,7 @@ export type RestartDelegatedUserRegistrationRequest = {
|
|
|
171
171
|
body: Auth.CreateUserInput;
|
|
172
172
|
};
|
|
173
173
|
export type RestartDelegatedUserRegistrationResponse = Auth.UserRegistrationChallenge;
|
|
174
|
+
export type CreateDelegatedUserRecoveryRequest = {
|
|
175
|
+
body: Auth.CreateDelegatedUserRecoveryInput;
|
|
176
|
+
};
|
|
177
|
+
export type CreateDelegatedUserRecoveryResponse = Auth.UserRecoveryChallenge;
|
|
@@ -351,3 +351,8 @@ export type RestartDelegatedUserRegistrationError = {
|
|
|
351
351
|
error: UnauthorizedError | ForbiddenError | BadRequestError | EntityNotFoundError;
|
|
352
352
|
};
|
|
353
353
|
export type RestartDelegatedUserRegistrationResponse = RestartDelegatedUserRegistrationSuccess | RestartDelegatedUserRegistrationError;
|
|
354
|
+
export type CreateDelegatedUserRecoverySuccess = UserRecoveryChallenge;
|
|
355
|
+
export type CreateDelegatedUserRecoveryError = {
|
|
356
|
+
error: UnauthorizedError | ForbiddenError | BadRequestError | EntityNotFoundError;
|
|
357
|
+
};
|
|
358
|
+
export type CreateDelegatedUserRecoveryResponse = CreateDelegatedUserRecoverySuccess | CreateDelegatedUserRecoveryError;
|
|
@@ -539,6 +539,10 @@ export type CreateUserRecoveryChallengeInput = {
|
|
|
539
539
|
orgId: EntityId;
|
|
540
540
|
credentialId: string;
|
|
541
541
|
};
|
|
542
|
+
export type CreateDelegatedUserRecoveryInput = {
|
|
543
|
+
username: string;
|
|
544
|
+
credentialId: string;
|
|
545
|
+
};
|
|
542
546
|
export type CreateUserCredentialInput = CreateUserCredentialTotpInput | CreateUserCredentialPasswordInput | CreateUserCredentialPublicKeyInput | CreateUserCredentialFido2Input | CreateUserCredentialRecoveryKeyInput;
|
|
543
547
|
export type UserCredentialChallenge = Fido2Options | PublicKeyOptions | TotpCredential | PasswordCredential;
|
|
544
548
|
export type SignedAuthAttestation = LegacyAuthAttestation | AuthV2SignedAuthAttestation;
|
|
@@ -92,6 +92,25 @@ export type TransferLimitPrConf = {
|
|
|
92
92
|
limit: Amount;
|
|
93
93
|
currency: Currency;
|
|
94
94
|
};
|
|
95
|
+
export type CreateOutgoingVelocityPrConf = {
|
|
96
|
+
kind: PolicyRuleKind.PaymentAmountOutgoingVelocity;
|
|
97
|
+
velocity: Amount;
|
|
98
|
+
assetSymbol: AssetSymbol;
|
|
99
|
+
intervalInMinutes: number;
|
|
100
|
+
shouldIgnoreAssetsWithoutMarketValue: boolean;
|
|
101
|
+
};
|
|
102
|
+
export type UpdateOutgoingVelocityPrConf = {
|
|
103
|
+
velocity?: Amount;
|
|
104
|
+
assetSymbol?: AssetSymbol;
|
|
105
|
+
intervalInMinutes: number;
|
|
106
|
+
shouldIgnoreAssetsWithoutMarketValue?: boolean;
|
|
107
|
+
};
|
|
108
|
+
export type OutgoingVelocityPrConf = {
|
|
109
|
+
velocity: Amount;
|
|
110
|
+
assetSymbol: AssetSymbol;
|
|
111
|
+
intervalInMinutes: number;
|
|
112
|
+
shouldIgnoreAssetsWithoutMarketValue: boolean;
|
|
113
|
+
};
|
|
95
114
|
export type CreateRequestApprovalPcConf = {
|
|
96
115
|
kind: PolicyControlKind.RequestApproval;
|
|
97
116
|
approverUsernames?: string[];
|
|
@@ -119,6 +138,10 @@ export type PolicyManagementPreferences = {
|
|
|
119
138
|
* Sets default `AssetSymbol` for the policy rules that use it, such as Limit, Velocity, Siphoning, and others.
|
|
120
139
|
*/
|
|
121
140
|
policyRuleAssetSymbol?: boolean;
|
|
141
|
+
/**
|
|
142
|
+
* Sets default interval in minutes for policy rules that use intervals, such as Velocity and Siphoning. \n\nThis setting does not update existing rules. This will only impact rules that are created after this setting is set.
|
|
143
|
+
*/
|
|
144
|
+
policyRuleVelocityIntervalInMinutes: number;
|
|
122
145
|
};
|
|
123
146
|
export type Create = {};
|
|
124
147
|
export type EmptyConfiguration = {};
|
|
@@ -180,11 +203,11 @@ export type UpdatePolicyRuleInput = {
|
|
|
180
203
|
name?: string;
|
|
181
204
|
configuration: UpdatePolicyRuleConfiguration;
|
|
182
205
|
};
|
|
183
|
-
export type CreatePolicyRuleConfiguration = CreateAmountLimitPrConf | CreateTransferLimitPrConf | CreateAlwaysActivatedPrConf;
|
|
184
|
-
export type UpdatePolicyRuleConfiguration = UpdateAmountLimitPrConf | UpdateTransferLimitPrConf | UpdateAlwaysActivatedPrConf;
|
|
206
|
+
export type CreatePolicyRuleConfiguration = CreateAmountLimitPrConf | CreateTransferLimitPrConf | CreateOutgoingVelocityPrConf | CreateAlwaysActivatedPrConf;
|
|
207
|
+
export type UpdatePolicyRuleConfiguration = UpdateAmountLimitPrConf | UpdateTransferLimitPrConf | UpdateOutgoingVelocityPrConf | UpdateAlwaysActivatedPrConf;
|
|
185
208
|
export type UpdatePolicyControlConfiguration = UpdateRequestApprovalPcConf | UpdateNotifyAndAuditPcConf;
|
|
186
209
|
export type CreatePolicyControlConfiguration = CreateRequestApprovalPcConf | CreateNotifyAndAuditPcConf;
|
|
187
|
-
export type PolicyRuleConfiguration = AmountLimitPrConf | TransferLimitPrConf | EmptyConfiguration;
|
|
210
|
+
export type PolicyRuleConfiguration = AmountLimitPrConf | TransferLimitPrConf | OutgoingVelocityPrConf | EmptyConfiguration;
|
|
188
211
|
export type PolicyControlConfiguration = NotifyAndAuditPcConf | RequestApprovalPcConf;
|
|
189
212
|
export type PolicyObjectFilter = AssetAccountFilter | PublicKeyFilter | WalletFilter;
|
|
190
213
|
export declare enum PolicyActivityKind {
|
|
@@ -212,6 +235,7 @@ export declare enum PolicyControlKind {
|
|
|
212
235
|
export declare enum PolicyRuleKind {
|
|
213
236
|
AlwaysActivated = "AlwaysActivated",
|
|
214
237
|
PaymentAmountLimit = "PaymentAmountLimit",
|
|
238
|
+
PaymentAmountOutgoingVelocity = "PaymentAmountOutgoingVelocity",
|
|
215
239
|
TransferAmountLimit = "TransferAmountLimit"
|
|
216
240
|
}
|
|
217
241
|
export declare enum Currency {
|
|
@@ -46,6 +46,8 @@ var PolicyRuleKind;
|
|
|
46
46
|
PolicyRuleKind["AlwaysActivated"] = "AlwaysActivated";
|
|
47
47
|
// FIXME: Missing documentation for PaymentAmountLimit
|
|
48
48
|
PolicyRuleKind["PaymentAmountLimit"] = "PaymentAmountLimit";
|
|
49
|
+
// FIXME: Missing documentation for PaymentAmountOutgoingVelocity
|
|
50
|
+
PolicyRuleKind["PaymentAmountOutgoingVelocity"] = "PaymentAmountOutgoingVelocity";
|
|
49
51
|
// FIXME: Missing documentation for TransferAmountLimit
|
|
50
52
|
PolicyRuleKind["TransferAmountLimit"] = "TransferAmountLimit";
|
|
51
53
|
})(PolicyRuleKind = exports.PolicyRuleKind || (exports.PolicyRuleKind = {}));
|
|
@@ -286,6 +286,7 @@ export declare enum TransferDirection {
|
|
|
286
286
|
}
|
|
287
287
|
export declare enum TransferStatus {
|
|
288
288
|
Pending = "Pending",
|
|
289
|
+
Executing = "Executing",
|
|
289
290
|
Broadcasted = "Broadcasted",
|
|
290
291
|
Confirmed = "Confirmed",
|
|
291
292
|
Failed = "Failed",
|
|
@@ -293,6 +294,7 @@ export declare enum TransferStatus {
|
|
|
293
294
|
}
|
|
294
295
|
export declare enum TransactionStatus {
|
|
295
296
|
Pending = "Pending",
|
|
297
|
+
Executing = "Executing",
|
|
296
298
|
Broadcasted = "Broadcasted",
|
|
297
299
|
Confirmed = "Confirmed",
|
|
298
300
|
Failed = "Failed",
|
|
@@ -300,6 +302,7 @@ export declare enum TransactionStatus {
|
|
|
300
302
|
}
|
|
301
303
|
export declare enum SignatureStatus {
|
|
302
304
|
Pending = "Pending",
|
|
305
|
+
Executing = "Executing",
|
|
303
306
|
Signed = "Signed",
|
|
304
307
|
Confirmed = "Confirmed",
|
|
305
308
|
Failed = "Failed",
|
|
@@ -80,6 +80,8 @@ var TransferStatus;
|
|
|
80
80
|
(function (TransferStatus) {
|
|
81
81
|
// FIXME: Missing documentation for Pending
|
|
82
82
|
TransferStatus["Pending"] = "Pending";
|
|
83
|
+
// FIXME: Missing documentation for Executing
|
|
84
|
+
TransferStatus["Executing"] = "Executing";
|
|
83
85
|
// FIXME: Missing documentation for Broadcasted
|
|
84
86
|
TransferStatus["Broadcasted"] = "Broadcasted";
|
|
85
87
|
// FIXME: Missing documentation for Confirmed
|
|
@@ -94,6 +96,8 @@ var TransactionStatus;
|
|
|
94
96
|
(function (TransactionStatus) {
|
|
95
97
|
// FIXME: Missing documentation for Pending
|
|
96
98
|
TransactionStatus["Pending"] = "Pending";
|
|
99
|
+
// FIXME: Missing documentation for Executing
|
|
100
|
+
TransactionStatus["Executing"] = "Executing";
|
|
97
101
|
// FIXME: Missing documentation for Broadcasted
|
|
98
102
|
TransactionStatus["Broadcasted"] = "Broadcasted";
|
|
99
103
|
// FIXME: Missing documentation for Confirmed
|
|
@@ -108,6 +112,8 @@ var SignatureStatus;
|
|
|
108
112
|
(function (SignatureStatus) {
|
|
109
113
|
// FIXME: Missing documentation for Pending
|
|
110
114
|
SignatureStatus["Pending"] = "Pending";
|
|
115
|
+
// FIXME: Missing documentation for Executing
|
|
116
|
+
SignatureStatus["Executing"] = "Executing";
|
|
111
117
|
// FIXME: Missing documentation for Signed
|
|
112
118
|
SignatureStatus["Signed"] = "Signed";
|
|
113
119
|
// FIXME: Missing documentation for Confirmed
|