@dfns/sdk 0.1.0-beta.5 → 0.1.0-beta.6
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/baseAuthApi.d.ts +14 -1
- package/baseAuthApi.js +11 -0
- package/codegen/Signers/DelegatedSignersClient.d.ts +7 -0
- package/codegen/Signers/DelegatedSignersClient.js +22 -0
- package/codegen/Signers/SignersClient.d.ts +7 -0
- package/codegen/Signers/SignersClient.js +22 -0
- package/codegen/Signers/index.d.ts +3 -0
- package/codegen/Signers/index.js +19 -0
- package/codegen/Signers/types.d.ts +2 -0
- package/codegen/Signers/types.js +2 -0
- package/codegen/Wallets/DelegatedWalletsClient.d.ts +2 -0
- package/codegen/Wallets/DelegatedWalletsClient.js +27 -0
- package/codegen/Wallets/WalletsClient.d.ts +1 -0
- package/codegen/Wallets/WalletsClient.js +12 -0
- package/codegen/Wallets/types.d.ts +4 -0
- package/codegen/datamodel/ApiKeys/errors.d.ts +6 -0
- package/codegen/datamodel/ApiKeys/errors.js +15 -0
- package/codegen/datamodel/ApiKeys/index.d.ts +3 -0
- package/codegen/datamodel/ApiKeys/index.js +19 -0
- package/codegen/datamodel/ApiKeys/responses.d.ts +25 -0
- package/codegen/datamodel/ApiKeys/responses.js +2 -0
- package/codegen/datamodel/ApiKeys/types.d.ts +32 -0
- package/codegen/datamodel/ApiKeys/types.js +11 -0
- package/codegen/datamodel/Auth/errors.d.ts +0 -0
- package/codegen/datamodel/Auth/errors.js +1 -0
- package/codegen/datamodel/BlockchainIndexing/errors.d.ts +0 -0
- package/codegen/datamodel/BlockchainIndexing/errors.js +1 -0
- package/codegen/datamodel/BlockchainIndexing/index.d.ts +1 -0
- package/codegen/datamodel/BlockchainIndexing/index.js +17 -0
- package/codegen/datamodel/BlockchainIndexing/responses.d.ts +6 -0
- package/codegen/datamodel/BlockchainIndexing/responses.js +2 -0
- package/codegen/datamodel/BlockchainIndexing/types.d.ts +0 -0
- package/codegen/datamodel/BlockchainIndexing/types.js +1 -0
- package/codegen/datamodel/Blockchains/errors.d.ts +0 -0
- package/codegen/datamodel/Blockchains/errors.js +1 -0
- package/codegen/datamodel/Callbacks/errors.d.ts +0 -0
- package/codegen/datamodel/Callbacks/errors.js +1 -0
- package/codegen/datamodel/Foundations/responses.d.ts +0 -0
- package/codegen/datamodel/Foundations/responses.js +1 -0
- package/codegen/datamodel/Orgs/errors.d.ts +0 -0
- package/codegen/datamodel/Orgs/errors.js +1 -0
- package/codegen/datamodel/Orgs/index.d.ts +2 -0
- package/codegen/datamodel/Orgs/index.js +18 -0
- package/codegen/datamodel/Orgs/responses.d.ts +45 -0
- package/codegen/datamodel/Orgs/responses.js +2 -0
- package/codegen/datamodel/Orgs/types.d.ts +240 -0
- package/codegen/datamodel/Orgs/types.js +39 -0
- package/codegen/datamodel/Permissions/errors.d.ts +0 -0
- package/codegen/datamodel/Permissions/errors.js +1 -0
- package/codegen/datamodel/PolicyManagement/errors.d.ts +0 -0
- package/codegen/datamodel/PolicyManagement/errors.js +1 -0
- package/codegen/datamodel/PolicyManagement/types.d.ts +21 -3
- package/codegen/datamodel/PolicyManagement/types.js +12 -0
- package/codegen/datamodel/PublicKeys/errors.d.ts +0 -0
- package/codegen/datamodel/PublicKeys/errors.js +1 -0
- package/codegen/datamodel/PublicKeys/types.d.ts +1 -0
- package/codegen/datamodel/Signers/errors.d.ts +0 -0
- package/codegen/datamodel/Signers/errors.js +1 -0
- package/codegen/datamodel/Signers/index.d.ts +2 -0
- package/codegen/datamodel/Signers/index.js +18 -0
- package/codegen/datamodel/Signers/responses.d.ts +7 -0
- package/codegen/datamodel/Signers/responses.js +2 -0
- package/codegen/datamodel/Signers/types.d.ts +12 -0
- package/codegen/datamodel/Signers/types.js +2 -0
- package/codegen/datamodel/Wallets/errors.d.ts +0 -0
- package/codegen/datamodel/Wallets/errors.js +1 -0
- package/codegen/datamodel/Wallets/responses.d.ts +5 -0
- package/codegen/datamodel/Wallets/types.d.ts +23 -1
- package/codegen/datamodel/Wallets/types.js +9 -1
- package/dfnsApiClient.d.ts +2 -0
- package/dfnsApiClient.js +4 -0
- package/dfnsDelegatedApiClient.d.ts +2 -0
- package/dfnsDelegatedApiClient.js +4 -0
- package/package.json +1 -1
- package/signer.d.ts +10 -0
package/baseAuthApi.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { FirstFactorAttestation, RecoveryFactorAttestation, SecondFactorAttestation, UserRegistrationChallenge } from './store';
|
|
2
|
-
import { AllowCredential, CredentialKind, FirstFactorAssertion, SecondFactorAssertion } from './signer';
|
|
2
|
+
import { AllowCredential, CredentialKind, FirstFactorAssertion, RecoveryKeyAssertion, SecondFactorAssertion } from './signer';
|
|
3
3
|
import { HttpMethod } from './utils/fetch';
|
|
4
4
|
export type DfnsBaseApiOptions = {
|
|
5
5
|
appId: string;
|
|
@@ -68,6 +68,15 @@ export type UserRegistrationResponse = {
|
|
|
68
68
|
orgId: string;
|
|
69
69
|
};
|
|
70
70
|
};
|
|
71
|
+
export type CreateUserRecoveryRequest = {
|
|
72
|
+
recovery: RecoveryKeyAssertion;
|
|
73
|
+
newCredentials: {
|
|
74
|
+
firstFactorCredential: FirstFactorAttestation;
|
|
75
|
+
secondFactorCredential?: SecondFactorAttestation;
|
|
76
|
+
recoveryCredential?: RecoveryFactorAttestation;
|
|
77
|
+
};
|
|
78
|
+
};
|
|
79
|
+
export type UserRecoveryResponse = UserRegistrationResponse;
|
|
71
80
|
export declare class BaseAuthApi {
|
|
72
81
|
/**
|
|
73
82
|
* Creates a user action challenge
|
|
@@ -93,4 +102,8 @@ export declare class BaseAuthApi {
|
|
|
93
102
|
* Completes Registration by sending the signed registration challenge, containing the new Credential identity created.
|
|
94
103
|
*/
|
|
95
104
|
static createUserRegistration(request: CreateUserRegistrationRequest, options: DfnsBaseApiOptions): Promise<UserRegistrationResponse>;
|
|
105
|
+
/**
|
|
106
|
+
* Completes Recovery by sending the signed recovery challenge, containing the new Credential identity created.
|
|
107
|
+
*/
|
|
108
|
+
createUserRecovery(request: CreateUserRecoveryRequest, options: DfnsBaseApiOptions): Promise<UserRecoveryResponse>;
|
|
96
109
|
}
|
package/baseAuthApi.js
CHANGED
|
@@ -69,5 +69,16 @@ class BaseAuthApi {
|
|
|
69
69
|
});
|
|
70
70
|
return response.json();
|
|
71
71
|
}
|
|
72
|
+
/**
|
|
73
|
+
* Completes Recovery by sending the signed recovery challenge, containing the new Credential identity created.
|
|
74
|
+
*/
|
|
75
|
+
async createUserRecovery(request, options) {
|
|
76
|
+
const response = await (0, fetch_1.simpleFetch)('/auth/recover/user', {
|
|
77
|
+
method: 'POST',
|
|
78
|
+
body: request,
|
|
79
|
+
apiOptions: options,
|
|
80
|
+
});
|
|
81
|
+
return response.json();
|
|
82
|
+
}
|
|
72
83
|
}
|
|
73
84
|
exports.BaseAuthApi = BaseAuthApi;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { DfnsDelegatedApiClientOptions } from '../../dfnsDelegatedApiClient';
|
|
2
|
+
import * as T from './types';
|
|
3
|
+
export declare class DelegatedSignersClient {
|
|
4
|
+
private apiOptions;
|
|
5
|
+
constructor(apiOptions: DfnsDelegatedApiClientOptions);
|
|
6
|
+
listSigners(): Promise<T.ListSignersResponse>;
|
|
7
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.DelegatedSignersClient = void 0;
|
|
4
|
+
const fetch_1 = require("../../utils/fetch");
|
|
5
|
+
const url_1 = require("../../utils/url");
|
|
6
|
+
class DelegatedSignersClient {
|
|
7
|
+
constructor(apiOptions) {
|
|
8
|
+
this.apiOptions = apiOptions;
|
|
9
|
+
}
|
|
10
|
+
async listSigners() {
|
|
11
|
+
const path = (0, url_1.buildPathAndQuery)('/signers', {
|
|
12
|
+
path: {},
|
|
13
|
+
query: {},
|
|
14
|
+
});
|
|
15
|
+
const response = await (0, fetch_1.simpleFetch)(path, {
|
|
16
|
+
method: 'GET',
|
|
17
|
+
apiOptions: this.apiOptions,
|
|
18
|
+
});
|
|
19
|
+
return response.json();
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
exports.DelegatedSignersClient = DelegatedSignersClient;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.SignersClient = void 0;
|
|
4
|
+
const fetch_1 = require("../../utils/fetch");
|
|
5
|
+
const url_1 = require("../../utils/url");
|
|
6
|
+
class SignersClient {
|
|
7
|
+
constructor(apiOptions) {
|
|
8
|
+
this.apiOptions = apiOptions;
|
|
9
|
+
}
|
|
10
|
+
async listSigners() {
|
|
11
|
+
const path = (0, url_1.buildPathAndQuery)('/signers', {
|
|
12
|
+
path: {},
|
|
13
|
+
query: {},
|
|
14
|
+
});
|
|
15
|
+
const response = await (0, fetch_1.simpleFetch)(path, {
|
|
16
|
+
method: 'GET',
|
|
17
|
+
apiOptions: this.apiOptions,
|
|
18
|
+
});
|
|
19
|
+
return response.json();
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
exports.SignersClient = SignersClient;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./DelegatedSignersClient"), exports);
|
|
18
|
+
__exportStar(require("./SignersClient"), exports);
|
|
19
|
+
__exportStar(require("./types"), exports);
|
|
@@ -23,4 +23,6 @@ export declare class DelegatedWalletsClient {
|
|
|
23
23
|
generateSignatureComplete(request: T.GenerateSignatureRequest, signedChallenge: SignUserActionChallengeRequest): Promise<T.GenerateSignatureResponse>;
|
|
24
24
|
getSignature(request: T.GetSignatureRequest): Promise<T.GetSignatureResponse>;
|
|
25
25
|
listSignatures(request: T.ListSignaturesRequest): Promise<T.ListSignaturesResponse>;
|
|
26
|
+
importWalletInit(request: T.ImportWalletRequest): Promise<UserActionChallengeResponse>;
|
|
27
|
+
importWalletComplete(request: T.ImportWalletRequest, signedChallenge: SignUserActionChallengeRequest): Promise<T.ImportWalletResponse>;
|
|
26
28
|
}
|
|
@@ -245,5 +245,32 @@ class DelegatedWalletsClient {
|
|
|
245
245
|
});
|
|
246
246
|
return response.json();
|
|
247
247
|
}
|
|
248
|
+
async importWalletInit(request) {
|
|
249
|
+
const path = (0, url_1.buildPathAndQuery)('/wallets/import', {
|
|
250
|
+
path: {},
|
|
251
|
+
query: {},
|
|
252
|
+
});
|
|
253
|
+
const challenge = await baseAuthApi_1.BaseAuthApi.createUserActionChallenge({
|
|
254
|
+
userActionHttpMethod: 'POST',
|
|
255
|
+
userActionHttpPath: path,
|
|
256
|
+
userActionPayload: JSON.stringify(request.body),
|
|
257
|
+
userActionServerKind: 'Api',
|
|
258
|
+
}, this.apiOptions);
|
|
259
|
+
return challenge;
|
|
260
|
+
}
|
|
261
|
+
async importWalletComplete(request, signedChallenge) {
|
|
262
|
+
const path = (0, url_1.buildPathAndQuery)('/wallets/import', {
|
|
263
|
+
path: {},
|
|
264
|
+
query: {},
|
|
265
|
+
});
|
|
266
|
+
const { userAction } = await baseAuthApi_1.BaseAuthApi.signUserActionChallenge(signedChallenge, this.apiOptions);
|
|
267
|
+
const response = await (0, fetch_1.simpleFetch)(path, {
|
|
268
|
+
method: 'POST',
|
|
269
|
+
body: request.body,
|
|
270
|
+
headers: { 'x-dfns-useraction': userAction },
|
|
271
|
+
apiOptions: this.apiOptions,
|
|
272
|
+
});
|
|
273
|
+
return response.json();
|
|
274
|
+
}
|
|
248
275
|
}
|
|
249
276
|
exports.DelegatedWalletsClient = DelegatedWalletsClient;
|
|
@@ -18,4 +18,5 @@ export declare class WalletsClient {
|
|
|
18
18
|
generateSignature(request: T.GenerateSignatureRequest): Promise<T.GenerateSignatureResponse>;
|
|
19
19
|
getSignature(request: T.GetSignatureRequest): Promise<T.GetSignatureResponse>;
|
|
20
20
|
listSignatures(request: T.ListSignaturesRequest): Promise<T.ListSignaturesResponse>;
|
|
21
|
+
importWallet(request: T.ImportWalletRequest): Promise<T.ImportWalletResponse>;
|
|
21
22
|
}
|
|
@@ -184,5 +184,17 @@ class WalletsClient {
|
|
|
184
184
|
});
|
|
185
185
|
return response.json();
|
|
186
186
|
}
|
|
187
|
+
async importWallet(request) {
|
|
188
|
+
const path = (0, url_1.buildPathAndQuery)('/wallets/import', {
|
|
189
|
+
path: {},
|
|
190
|
+
query: {},
|
|
191
|
+
});
|
|
192
|
+
const response = await (0, fetch_1.userActionFetch)(path, {
|
|
193
|
+
method: 'POST',
|
|
194
|
+
body: request.body,
|
|
195
|
+
apiOptions: this.apiOptions,
|
|
196
|
+
});
|
|
197
|
+
return response.json();
|
|
198
|
+
}
|
|
187
199
|
}
|
|
188
200
|
exports.WalletsClient = WalletsClient;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ApiKeyActionNotAllowed = void 0;
|
|
4
|
+
const Foundations_1 = require("../Foundations");
|
|
5
|
+
class ApiKeyActionNotAllowed extends Foundations_1.DfnsError {
|
|
6
|
+
constructor() {
|
|
7
|
+
super(...arguments);
|
|
8
|
+
this.name = 'ApiKeyActionNotAllowed';
|
|
9
|
+
// FIXME: Missing documentation for httpStatus
|
|
10
|
+
this.httpStatus = 403;
|
|
11
|
+
// FIXME: Missing documentation for errorName
|
|
12
|
+
this.errorName = 'Forbidden';
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
exports.ApiKeyActionNotAllowed = ApiKeyActionNotAllowed;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./errors"), exports);
|
|
18
|
+
__exportStar(require("./responses"), exports);
|
|
19
|
+
__exportStar(require("./types"), exports);
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { BadRequestError, EntityNotFoundError, ForbiddenError, UnauthorizedError } from '../Foundations';
|
|
2
|
+
import { ApiKeyActionNotAllowed } from './errors';
|
|
3
|
+
import { ApiKeyRecord, ApiKeyRecordWithToken } from './types';
|
|
4
|
+
export type CreateApiKeySuccess = ApiKeyRecordWithToken;
|
|
5
|
+
export type CreateApiKeyError = {
|
|
6
|
+
error: ApiKeyActionNotAllowed | UnauthorizedError | ForbiddenError | BadRequestError | EntityNotFoundError;
|
|
7
|
+
};
|
|
8
|
+
export type CreateApiKeyResponse = CreateApiKeySuccess | CreateApiKeyError;
|
|
9
|
+
export type ListApiKeysSuccess = {
|
|
10
|
+
items: ApiKeyRecord[];
|
|
11
|
+
};
|
|
12
|
+
export type ListApiKeysError = {
|
|
13
|
+
error: UnauthorizedError | ForbiddenError | BadRequestError | EntityNotFoundError;
|
|
14
|
+
};
|
|
15
|
+
export type ListApiKeysResponse = ListApiKeysSuccess | ListApiKeysError;
|
|
16
|
+
export type RevokeApiKeySuccess = ApiKeyRecord;
|
|
17
|
+
export type RevokeApiKeyError = {
|
|
18
|
+
error: ApiKeyActionNotAllowed | UnauthorizedError | ForbiddenError | BadRequestError | EntityNotFoundError;
|
|
19
|
+
};
|
|
20
|
+
export type RevokeApiKeyResponse = RevokeApiKeySuccess | RevokeApiKeyError;
|
|
21
|
+
export type GetApiKeyByIdSuccess = ApiKeyRecord;
|
|
22
|
+
export type GetApiKeyByIdError = {
|
|
23
|
+
error: UnauthorizedError | ForbiddenError | BadRequestError | EntityNotFoundError;
|
|
24
|
+
};
|
|
25
|
+
export type GetApiKeyByIdResponse = GetApiKeyByIdSuccess | GetApiKeyByIdError;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { EntityId, IsoDatetime } from '../Foundations';
|
|
2
|
+
export type ApiKeyRecord = {
|
|
3
|
+
id: EntityId;
|
|
4
|
+
status: ApiKeyStatus;
|
|
5
|
+
externalId?: string;
|
|
6
|
+
orgId: EntityId;
|
|
7
|
+
dateCreated: IsoDatetime;
|
|
8
|
+
name?: string;
|
|
9
|
+
authorId: EntityId;
|
|
10
|
+
scopes: string[];
|
|
11
|
+
};
|
|
12
|
+
export type ApiKeyRecordWithToken = {
|
|
13
|
+
id: EntityId;
|
|
14
|
+
status: ApiKeyStatus;
|
|
15
|
+
externalId?: string;
|
|
16
|
+
orgId: EntityId;
|
|
17
|
+
dateCreated: IsoDatetime;
|
|
18
|
+
name?: string;
|
|
19
|
+
authorId: EntityId;
|
|
20
|
+
scopes: string[];
|
|
21
|
+
token: ApiKeyValue;
|
|
22
|
+
};
|
|
23
|
+
export type ApiKeyValue = string;
|
|
24
|
+
export type CreateApiKeyInput = {
|
|
25
|
+
scopes: string[];
|
|
26
|
+
externalId?: string;
|
|
27
|
+
name: string;
|
|
28
|
+
};
|
|
29
|
+
export declare enum ApiKeyStatus {
|
|
30
|
+
Active = "Active",
|
|
31
|
+
Archived = "Archived"
|
|
32
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ApiKeyStatus = void 0;
|
|
4
|
+
// FIXME: Missing documentation for ApiKeyStatus
|
|
5
|
+
var ApiKeyStatus;
|
|
6
|
+
(function (ApiKeyStatus) {
|
|
7
|
+
// FIXME: Missing documentation for Active
|
|
8
|
+
ApiKeyStatus["Active"] = "Active";
|
|
9
|
+
// FIXME: Missing documentation for Archived
|
|
10
|
+
ApiKeyStatus["Archived"] = "Archived";
|
|
11
|
+
})(ApiKeyStatus = exports.ApiKeyStatus || (exports.ApiKeyStatus = {}));
|
|
File without changes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";
|
|
File without changes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './responses';
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./responses"), exports);
|
|
File without changes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";
|
|
File without changes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";
|
|
File without changes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";
|
|
File without changes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";
|
|
File without changes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./responses"), exports);
|
|
18
|
+
__exportStar(require("./types"), exports);
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { BadRequestError, EntityNotFoundError, ForbiddenError, UnauthorizedError } from '../Foundations';
|
|
2
|
+
import { Org, OrgEmployee } from './types';
|
|
3
|
+
export type GetEmployeeByIdSuccess = OrgEmployee;
|
|
4
|
+
export type GetEmployeeByIdError = {
|
|
5
|
+
error: EntityNotFoundError | ForbiddenError | UnauthorizedError | ForbiddenError | BadRequestError | EntityNotFoundError;
|
|
6
|
+
};
|
|
7
|
+
export type GetEmployeeByIdResponse = GetEmployeeByIdSuccess | GetEmployeeByIdError;
|
|
8
|
+
export type ListEmployeesSuccess = {
|
|
9
|
+
items: OrgEmployee[];
|
|
10
|
+
};
|
|
11
|
+
export type ListEmployeesError = {
|
|
12
|
+
error: ForbiddenError | UnauthorizedError | ForbiddenError | BadRequestError | EntityNotFoundError;
|
|
13
|
+
};
|
|
14
|
+
export type ListEmployeesResponse = ListEmployeesSuccess | ListEmployeesError;
|
|
15
|
+
export type CreateOrgSuccess = Org;
|
|
16
|
+
export type CreateOrgError = {
|
|
17
|
+
error: ForbiddenError | BadRequestError | EntityNotFoundError;
|
|
18
|
+
};
|
|
19
|
+
export type CreateOrgResponse = CreateOrgSuccess | CreateOrgError;
|
|
20
|
+
export type ListOrgsSuccess = {
|
|
21
|
+
items: Org[];
|
|
22
|
+
};
|
|
23
|
+
export type ListOrgsError = {
|
|
24
|
+
error: ForbiddenError | BadRequestError | EntityNotFoundError;
|
|
25
|
+
};
|
|
26
|
+
export type ListOrgsResponse = ListOrgsSuccess | ListOrgsError;
|
|
27
|
+
export type ListPackageVersionsSuccess = {
|
|
28
|
+
items: Org[];
|
|
29
|
+
};
|
|
30
|
+
export type ListPackageVersionsError = {
|
|
31
|
+
error: ForbiddenError | BadRequestError | EntityNotFoundError;
|
|
32
|
+
};
|
|
33
|
+
export type ListPackageVersionsResponse = ListPackageVersionsSuccess | ListPackageVersionsError;
|
|
34
|
+
export type CreateOrgSettingSuccess = Org;
|
|
35
|
+
export type CreateOrgSettingError = {
|
|
36
|
+
error: ForbiddenError | BadRequestError | EntityNotFoundError;
|
|
37
|
+
};
|
|
38
|
+
export type CreateOrgSettingResponse = CreateOrgSettingSuccess | CreateOrgSettingError;
|
|
39
|
+
export type ListOrgSettingsSuccess = {
|
|
40
|
+
items: Org[];
|
|
41
|
+
};
|
|
42
|
+
export type ListOrgSettingsError = {
|
|
43
|
+
error: ForbiddenError | BadRequestError | EntityNotFoundError;
|
|
44
|
+
};
|
|
45
|
+
export type ListOrgSettingsResponse = ListOrgSettingsSuccess | ListOrgSettingsError;
|
|
@@ -0,0 +1,240 @@
|
|
|
1
|
+
import { Countries, Email, EntityId, IdentityIssuer, IsoDate, IsoDatetime } from '../Foundations';
|
|
2
|
+
/**
|
|
3
|
+
* `Org` encapsulates information about a Dfns’s customer .
|
|
4
|
+
*/
|
|
5
|
+
export type Org = {
|
|
6
|
+
/**
|
|
7
|
+
* Unique organisation identifier.
|
|
8
|
+
*/
|
|
9
|
+
id: EntityId;
|
|
10
|
+
/**
|
|
11
|
+
* Full legal name of the organisation, including suffixes such as LLC, Limited, etc.
|
|
12
|
+
*/
|
|
13
|
+
legalName: string;
|
|
14
|
+
/**
|
|
15
|
+
* Trading name by which company is known. For example "Panasonic" instead of "Panasonic Holdings Corporation".
|
|
16
|
+
*/
|
|
17
|
+
tradingName?: string;
|
|
18
|
+
/**
|
|
19
|
+
* Country where organisation is head quartered, and default jurisdiction if applies.
|
|
20
|
+
*/
|
|
21
|
+
country: Countries;
|
|
22
|
+
/**
|
|
23
|
+
* Date when organisation was incorporated.
|
|
24
|
+
*/
|
|
25
|
+
dateOfIncorporation: IsoDate;
|
|
26
|
+
/**
|
|
27
|
+
* Date when organisation was onboarded in Dfns.
|
|
28
|
+
*/
|
|
29
|
+
dateOnboarded: IsoDatetime;
|
|
30
|
+
/**
|
|
31
|
+
* Status of the organisation. Indicates whether organisation is currently operational. See `OrgStatus` for details.
|
|
32
|
+
*/
|
|
33
|
+
status: OrgStatus;
|
|
34
|
+
/**
|
|
35
|
+
* List of employee users that are onboarded within organisation
|
|
36
|
+
*/
|
|
37
|
+
employees: OrgEmployee[];
|
|
38
|
+
/**
|
|
39
|
+
* List of groups available within organisation, to which users (i.e. employees) can belong to.
|
|
40
|
+
*/
|
|
41
|
+
groups?: EmployeeGroup[];
|
|
42
|
+
};
|
|
43
|
+
/**
|
|
44
|
+
* `OrgEmployee` is a type of `User` that has access to Dfns API. `OrgEmployee` always maps to a given Natural Person (i.e. human). There are other users such as service accounts, that can be mapped to servers and other technical entities.
|
|
45
|
+
*/
|
|
46
|
+
export type OrgEmployee = {
|
|
47
|
+
/**
|
|
48
|
+
* Unique employee identifier.
|
|
49
|
+
*/
|
|
50
|
+
id: EntityId;
|
|
51
|
+
/**
|
|
52
|
+
* Status of the employee. Identifies if given user can perform any actions or not. See `OrgEmployeeStatus` for more details.
|
|
53
|
+
*/
|
|
54
|
+
status: OrgEmployeeStatus;
|
|
55
|
+
/**
|
|
56
|
+
* Indicates organisation to which employee belongs to.
|
|
57
|
+
*/
|
|
58
|
+
orgId: string;
|
|
59
|
+
/**
|
|
60
|
+
* Employee's username. Usually it is an email.
|
|
61
|
+
*/
|
|
62
|
+
username: string;
|
|
63
|
+
/**
|
|
64
|
+
* Employee email.
|
|
65
|
+
*/
|
|
66
|
+
email: Email;
|
|
67
|
+
/**
|
|
68
|
+
* Identity issuer (eg Auth0). Empty if it's the default one (Dfns one). The issuer will be filled for non-Dfns issuers.
|
|
69
|
+
*/
|
|
70
|
+
issuer: IdentityIssuer;
|
|
71
|
+
/**
|
|
72
|
+
* Date when employee was created.
|
|
73
|
+
*/
|
|
74
|
+
dateCreated: IsoDatetime;
|
|
75
|
+
/**
|
|
76
|
+
* Date when employee record was last updated.
|
|
77
|
+
*/
|
|
78
|
+
dateUpdated: IsoDatetime;
|
|
79
|
+
/**
|
|
80
|
+
* Employee's full legal name.
|
|
81
|
+
*/
|
|
82
|
+
fullName: string;
|
|
83
|
+
/**
|
|
84
|
+
* Employee's date of birth.
|
|
85
|
+
*/
|
|
86
|
+
dateOfBirth?: IsoDate;
|
|
87
|
+
/**
|
|
88
|
+
* List of groups to which employee belongs to.
|
|
89
|
+
*/
|
|
90
|
+
groups?: EmployeeGroup[];
|
|
91
|
+
};
|
|
92
|
+
/**
|
|
93
|
+
* Used to group `OrgEmployees` by various criteria. Such as jurisdiction, department, access rights.
|
|
94
|
+
*/
|
|
95
|
+
export type EmployeeGroup = {
|
|
96
|
+
/**
|
|
97
|
+
* Name of the `Group`
|
|
98
|
+
*/
|
|
99
|
+
name: string;
|
|
100
|
+
};
|
|
101
|
+
/**
|
|
102
|
+
* Operation Payload used to create new `OrgEmployee` record.
|
|
103
|
+
*/
|
|
104
|
+
export type CreateOrgEmployeePayload = {
|
|
105
|
+
/**
|
|
106
|
+
* Employee’s username.
|
|
107
|
+
*/
|
|
108
|
+
username: string;
|
|
109
|
+
/**
|
|
110
|
+
* Employee’s email.
|
|
111
|
+
*/
|
|
112
|
+
email: Email;
|
|
113
|
+
/**
|
|
114
|
+
* Identity issuer (eg Auth0). Empty if it's the default one (Dfns one). The issuer will be filled for non-Dfns issuers.
|
|
115
|
+
*/
|
|
116
|
+
issuer?: string;
|
|
117
|
+
/**
|
|
118
|
+
* Employee's full legal name.
|
|
119
|
+
*/
|
|
120
|
+
fullName: string;
|
|
121
|
+
/**
|
|
122
|
+
* Employee's date of birth.
|
|
123
|
+
*/
|
|
124
|
+
dateOfBirth?: IsoDate;
|
|
125
|
+
};
|
|
126
|
+
export type OrgApiKey = {
|
|
127
|
+
apiKeyId: EntityId;
|
|
128
|
+
orgId: EntityId;
|
|
129
|
+
};
|
|
130
|
+
export type CreateEmployee = {
|
|
131
|
+
/**
|
|
132
|
+
* Employee’s username.
|
|
133
|
+
*/
|
|
134
|
+
username: string;
|
|
135
|
+
/**
|
|
136
|
+
* Employee’s email.
|
|
137
|
+
*/
|
|
138
|
+
email: Email;
|
|
139
|
+
/**
|
|
140
|
+
* Identity issuer (eg Auth0). Empty if it's the default one (Dfns one). The issuer will be filled for non-Dfns issuers.
|
|
141
|
+
*/
|
|
142
|
+
issuer?: string;
|
|
143
|
+
/**
|
|
144
|
+
* Employee's full legal name.
|
|
145
|
+
*/
|
|
146
|
+
fullName: string;
|
|
147
|
+
/**
|
|
148
|
+
* Employee's date of birth.
|
|
149
|
+
*/
|
|
150
|
+
dateOfBirth?: IsoDate;
|
|
151
|
+
authVersionToUse?: AuthSystemVersion;
|
|
152
|
+
};
|
|
153
|
+
export type UpdateEmployee = {
|
|
154
|
+
/**
|
|
155
|
+
* Employee's full legal name.
|
|
156
|
+
*
|
|
157
|
+
*/
|
|
158
|
+
fullName?: string;
|
|
159
|
+
/**
|
|
160
|
+
* Employee's date of birth.
|
|
161
|
+
*/
|
|
162
|
+
dateOfBirth?: IsoDate;
|
|
163
|
+
/**
|
|
164
|
+
* Status of the employee. Identifies if given user can perform any actions or not. See `OrgEmployeeStatus` for more details.
|
|
165
|
+
*/
|
|
166
|
+
status?: OrgEmployeeStatus;
|
|
167
|
+
};
|
|
168
|
+
export type UpdateOrg = {
|
|
169
|
+
/**
|
|
170
|
+
* Full legal name of the organisation, including suffixes such as LLC, Limited, etc.
|
|
171
|
+
*/
|
|
172
|
+
legalName?: string;
|
|
173
|
+
/**
|
|
174
|
+
* Trading name by which company is known. For example "Panasonic" instead of "Panasonic Holdings Corporation".
|
|
175
|
+
*/
|
|
176
|
+
tradingName?: string;
|
|
177
|
+
/**
|
|
178
|
+
* Date when organisation was incorporated.
|
|
179
|
+
*/
|
|
180
|
+
dateOfIncorporation?: IsoDate;
|
|
181
|
+
/**
|
|
182
|
+
* Country where organisation is head quartered, and default jurisdiction if applies.
|
|
183
|
+
*/
|
|
184
|
+
country?: Countries;
|
|
185
|
+
/**
|
|
186
|
+
* Date when organisation was onboarded in Dfns.
|
|
187
|
+
*/
|
|
188
|
+
dateOnboarded?: IsoDate;
|
|
189
|
+
};
|
|
190
|
+
export type CreateOrg = {
|
|
191
|
+
/**
|
|
192
|
+
* Full legal name of the organisation, including suffixes such as LLC, Limited, etc.
|
|
193
|
+
*/
|
|
194
|
+
legalName: string;
|
|
195
|
+
/**
|
|
196
|
+
* Trading name by which company is known. For example "Panasonic" instead of "Panasonic Holdings Corporation".
|
|
197
|
+
*/
|
|
198
|
+
tradingName: string;
|
|
199
|
+
/**
|
|
200
|
+
* Date when organisation was incorporated.
|
|
201
|
+
*/
|
|
202
|
+
dateOfIncorporation: IsoDate;
|
|
203
|
+
/**
|
|
204
|
+
* Country where organisation is head quartered, and default jurisdiction if applies.
|
|
205
|
+
*/
|
|
206
|
+
country: Countries;
|
|
207
|
+
/**
|
|
208
|
+
* Date when organisation was onboarded in Dfns.
|
|
209
|
+
*/
|
|
210
|
+
dateOnboarded?: IsoDate;
|
|
211
|
+
/**
|
|
212
|
+
* List of `CreateOrgEmpoyeePayload` for the organisations. These employees will be created for this org.
|
|
213
|
+
*/
|
|
214
|
+
employees?: CreateOrgEmployeePayload[];
|
|
215
|
+
authVersionToUse?: AuthSystemVersion;
|
|
216
|
+
/**
|
|
217
|
+
* Indicates signing cluster identifier.
|
|
218
|
+
*/
|
|
219
|
+
clusterId?: string;
|
|
220
|
+
};
|
|
221
|
+
/**
|
|
222
|
+
* Indicates customer’s status within a lifecycle.
|
|
223
|
+
*/
|
|
224
|
+
export declare enum OrgStatus {
|
|
225
|
+
Archived = "Archived",
|
|
226
|
+
Disabled = "Disabled",
|
|
227
|
+
Enabled = "Enabled",
|
|
228
|
+
Creating = "Creating",
|
|
229
|
+
Approved = "Approved"
|
|
230
|
+
}
|
|
231
|
+
export declare enum OrgEmployeeStatus {
|
|
232
|
+
Enabled = "Enabled",
|
|
233
|
+
Disabled = "Disabled",
|
|
234
|
+
Archived = "Archived"
|
|
235
|
+
}
|
|
236
|
+
export declare enum AuthSystemVersion {
|
|
237
|
+
AuthV1 = "AuthV1",
|
|
238
|
+
AuthV2 = "AuthV2",
|
|
239
|
+
All = "All"
|
|
240
|
+
}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.AuthSystemVersion = exports.OrgEmployeeStatus = exports.OrgStatus = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* Indicates customer’s status within a lifecycle.
|
|
6
|
+
*/
|
|
7
|
+
var OrgStatus;
|
|
8
|
+
(function (OrgStatus) {
|
|
9
|
+
//Customer is archived and no longer functional. Customer will have to go through re-onboarding to be enabled again.
|
|
10
|
+
OrgStatus["Archived"] = "Archived";
|
|
11
|
+
//Customer is disabled. Usually temporary action, in case something goes wrong.
|
|
12
|
+
OrgStatus["Disabled"] = "Disabled";
|
|
13
|
+
//Customer is enabled and operational.
|
|
14
|
+
OrgStatus["Enabled"] = "Enabled";
|
|
15
|
+
//Customer is being created at the moment.
|
|
16
|
+
OrgStatus["Creating"] = "Creating";
|
|
17
|
+
//Customer is approved to be created and initialized.
|
|
18
|
+
OrgStatus["Approved"] = "Approved";
|
|
19
|
+
})(OrgStatus = exports.OrgStatus || (exports.OrgStatus = {}));
|
|
20
|
+
// FIXME: Missing documentation for OrgEmployeeStatus
|
|
21
|
+
var OrgEmployeeStatus;
|
|
22
|
+
(function (OrgEmployeeStatus) {
|
|
23
|
+
//OrgEmployee is enabled and active.
|
|
24
|
+
OrgEmployeeStatus["Enabled"] = "Enabled";
|
|
25
|
+
//OrgEmployee is temporary disabled.
|
|
26
|
+
OrgEmployeeStatus["Disabled"] = "Disabled";
|
|
27
|
+
//OrgEmployee is deleted, and archived for audit purposes.
|
|
28
|
+
OrgEmployeeStatus["Archived"] = "Archived";
|
|
29
|
+
})(OrgEmployeeStatus = exports.OrgEmployeeStatus || (exports.OrgEmployeeStatus = {}));
|
|
30
|
+
// FIXME: Missing documentation for AuthSystemVersion
|
|
31
|
+
var AuthSystemVersion;
|
|
32
|
+
(function (AuthSystemVersion) {
|
|
33
|
+
// FIXME: Missing documentation for AuthV1
|
|
34
|
+
AuthSystemVersion["AuthV1"] = "AuthV1";
|
|
35
|
+
// FIXME: Missing documentation for AuthV2
|
|
36
|
+
AuthSystemVersion["AuthV2"] = "AuthV2";
|
|
37
|
+
// FIXME: Missing documentation for All
|
|
38
|
+
AuthSystemVersion["All"] = "All";
|
|
39
|
+
})(AuthSystemVersion = exports.AuthSystemVersion || (exports.AuthSystemVersion = {}));
|
|
File without changes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";
|
|
File without changes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";
|
|
@@ -164,6 +164,18 @@ export type WalletFilter = {
|
|
|
164
164
|
kind: PolicyObjectFilterKind.Wallet;
|
|
165
165
|
walletIds?: EntityId[];
|
|
166
166
|
};
|
|
167
|
+
export type PolicyFilter = {
|
|
168
|
+
kind: PolicyObjectFilterKind.Policy;
|
|
169
|
+
policyIds?: EntityId[];
|
|
170
|
+
};
|
|
171
|
+
export type PolicyControlFilter = {
|
|
172
|
+
kind: PolicyObjectFilterKind.PolicyControl;
|
|
173
|
+
policyControlIds?: EntityId[];
|
|
174
|
+
};
|
|
175
|
+
export type PolicyRuleFilter = {
|
|
176
|
+
kind: PolicyObjectFilterKind.PolicyRule;
|
|
177
|
+
policyRuleIds?: EntityId[];
|
|
178
|
+
};
|
|
167
179
|
export type CreatePolicyInput = {
|
|
168
180
|
activityKind: PolicyActivityKind;
|
|
169
181
|
description: string;
|
|
@@ -209,14 +221,17 @@ export type UpdatePolicyControlConfiguration = UpdateRequestApprovalPcConf | Upd
|
|
|
209
221
|
export type CreatePolicyControlConfiguration = CreateRequestApprovalPcConf | CreateNotifyAndAuditPcConf;
|
|
210
222
|
export type PolicyRuleConfiguration = AmountLimitPrConf | TransferLimitPrConf | OutgoingVelocityPrConf | EmptyConfiguration;
|
|
211
223
|
export type PolicyControlConfiguration = NotifyAndAuditPcConf | RequestApprovalPcConf;
|
|
212
|
-
export type PolicyObjectFilter = AssetAccountFilter | PublicKeyFilter | WalletFilter;
|
|
224
|
+
export type PolicyObjectFilter = AssetAccountFilter | PublicKeyFilter | WalletFilter | PolicyFilter | PolicyControlFilter | PolicyRuleFilter;
|
|
213
225
|
export declare enum PolicyActivityKind {
|
|
214
226
|
CreatingSignature = "CreatingSignature",
|
|
215
227
|
TransactionInitiation = "TransactionInitiation",
|
|
216
228
|
PaymentInitiation = "PaymentInitiation",
|
|
217
229
|
WalletsTransferAsset = "WalletsTransferAsset",
|
|
218
230
|
WalletsBroadcastTransaction = "WalletsBroadcastTransaction",
|
|
219
|
-
WalletsGenerateSignature = "WalletsGenerateSignature"
|
|
231
|
+
WalletsGenerateSignature = "WalletsGenerateSignature",
|
|
232
|
+
PoliciesArchive = "PoliciesArchive",
|
|
233
|
+
PolicyRulesArchive = "PolicyRulesArchive",
|
|
234
|
+
PolicyControlsArchive = "PolicyControlsArchive"
|
|
220
235
|
}
|
|
221
236
|
export declare enum PolicyStatus {
|
|
222
237
|
Enabled = "Enabled",
|
|
@@ -253,5 +268,8 @@ export declare enum PolicyRuleStatus {
|
|
|
253
268
|
export declare enum PolicyObjectFilterKind {
|
|
254
269
|
AssetAccount = "AssetAccount",
|
|
255
270
|
PublicKey = "PublicKey",
|
|
256
|
-
Wallet = "Wallet"
|
|
271
|
+
Wallet = "Wallet",
|
|
272
|
+
Policy = "Policy",
|
|
273
|
+
PolicyControl = "PolicyControl",
|
|
274
|
+
PolicyRule = "PolicyRule"
|
|
257
275
|
}
|
|
@@ -16,6 +16,12 @@ var PolicyActivityKind;
|
|
|
16
16
|
PolicyActivityKind["WalletsBroadcastTransaction"] = "WalletsBroadcastTransaction";
|
|
17
17
|
// FIXME: Missing documentation for WalletsGenerateSignature
|
|
18
18
|
PolicyActivityKind["WalletsGenerateSignature"] = "WalletsGenerateSignature";
|
|
19
|
+
// FIXME: Missing documentation for PoliciesArchive
|
|
20
|
+
PolicyActivityKind["PoliciesArchive"] = "PoliciesArchive";
|
|
21
|
+
// FIXME: Missing documentation for PolicyRulesArchive
|
|
22
|
+
PolicyActivityKind["PolicyRulesArchive"] = "PolicyRulesArchive";
|
|
23
|
+
// FIXME: Missing documentation for PolicyControlsArchive
|
|
24
|
+
PolicyActivityKind["PolicyControlsArchive"] = "PolicyControlsArchive";
|
|
19
25
|
})(PolicyActivityKind = exports.PolicyActivityKind || (exports.PolicyActivityKind = {}));
|
|
20
26
|
// FIXME: Missing documentation for PolicyStatus
|
|
21
27
|
var PolicyStatus;
|
|
@@ -84,4 +90,10 @@ var PolicyObjectFilterKind;
|
|
|
84
90
|
PolicyObjectFilterKind["PublicKey"] = "PublicKey";
|
|
85
91
|
// FIXME: Missing documentation for Wallet
|
|
86
92
|
PolicyObjectFilterKind["Wallet"] = "Wallet";
|
|
93
|
+
// FIXME: Missing documentation for Policy
|
|
94
|
+
PolicyObjectFilterKind["Policy"] = "Policy";
|
|
95
|
+
// FIXME: Missing documentation for PolicyControl
|
|
96
|
+
PolicyObjectFilterKind["PolicyControl"] = "PolicyControl";
|
|
97
|
+
// FIXME: Missing documentation for PolicyRule
|
|
98
|
+
PolicyObjectFilterKind["PolicyRule"] = "PolicyRule";
|
|
87
99
|
})(PolicyObjectFilterKind = exports.PolicyObjectFilterKind || (exports.PolicyObjectFilterKind = {}));
|
|
File without changes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";
|
|
File without changes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./responses"), exports);
|
|
18
|
+
__exportStar(require("./types"), exports);
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { BadRequestError, ForbiddenError, UnauthorizedError } from '../Foundations';
|
|
2
|
+
import { ClusterList } from './types';
|
|
3
|
+
export type ListSignersSuccess = ClusterList;
|
|
4
|
+
export type ListSignersError = {
|
|
5
|
+
error: ForbiddenError | UnauthorizedError | BadRequestError;
|
|
6
|
+
};
|
|
7
|
+
export type ListSignersResponse = ListSignersSuccess | ListSignersError;
|
|
File without changes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";
|
|
@@ -75,3 +75,8 @@ export type ListSignaturesError = {
|
|
|
75
75
|
error: ForbiddenError | UnauthorizedError | ForbiddenError | BadRequestError | EntityNotFoundError;
|
|
76
76
|
};
|
|
77
77
|
export type ListSignaturesResponse = ListSignaturesSuccess | ListSignaturesError;
|
|
78
|
+
export type ImportWalletSuccess = Wallet;
|
|
79
|
+
export type ImportWalletError = {
|
|
80
|
+
error: BadRequestError | ForbiddenError | UnauthorizedError | ForbiddenError | BadRequestError | EntityNotFoundError;
|
|
81
|
+
};
|
|
82
|
+
export type ImportWalletResponse = ImportWalletSuccess | ImportWalletError;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Amount, BlockchainAddress, EntityId, IsoDatetime, Tag } from '../Foundations';
|
|
1
|
+
import { Amount, BlockchainAddress, EntityId, IntegerPositiveStrict, IsoDatetime, Tag } from '../Foundations';
|
|
2
2
|
export type TransferNativeAsset = {
|
|
3
3
|
kind: TransferKind.Native;
|
|
4
4
|
to: BlockchainAddress;
|
|
@@ -63,6 +63,10 @@ export type SignEip712TypedData = {
|
|
|
63
63
|
domain: Eip712Domain;
|
|
64
64
|
message: Record<string, unknown>;
|
|
65
65
|
};
|
|
66
|
+
export type EncryptedKeyShare = {
|
|
67
|
+
signerId: string;
|
|
68
|
+
encryptedKeyShare: string;
|
|
69
|
+
};
|
|
66
70
|
export type Wallet = {
|
|
67
71
|
id: EntityId;
|
|
68
72
|
network: BlockchainNetwork;
|
|
@@ -73,6 +77,10 @@ export type Wallet = {
|
|
|
73
77
|
externalId?: string;
|
|
74
78
|
tags: Tag[];
|
|
75
79
|
dateCreated: IsoDatetime;
|
|
80
|
+
/**
|
|
81
|
+
* Whether the wallet was imported, or if it was generated on Dfns side.
|
|
82
|
+
*/
|
|
83
|
+
imported?: boolean;
|
|
76
84
|
};
|
|
77
85
|
export type SigningKey = {
|
|
78
86
|
scheme: KeyScheme;
|
|
@@ -243,6 +251,16 @@ export type CreateWalletBody = {
|
|
|
243
251
|
tags?: Tag[];
|
|
244
252
|
name?: string;
|
|
245
253
|
};
|
|
254
|
+
export type ImportWalletBody = {
|
|
255
|
+
network: BlockchainNetwork;
|
|
256
|
+
externalId?: string;
|
|
257
|
+
tags?: Tag[];
|
|
258
|
+
name?: string;
|
|
259
|
+
minSigners: IntegerPositiveStrict;
|
|
260
|
+
protocol: KeyProtocol;
|
|
261
|
+
curve: KeyCurve;
|
|
262
|
+
encryptedKeyShares: EncryptedKeyShare[];
|
|
263
|
+
};
|
|
246
264
|
export type TransferAssetBody = TransferNativeAsset | TransferErc20Asset | TransferErc721Asset;
|
|
247
265
|
export type BroadcastTransactionBody = BroadcastEvmTransaction | BroadcastEip1559Transaction | BroadcastEvmLegacyTransaction;
|
|
248
266
|
export type GenerateSignatureBody = SignHash | SignMessage | SignEip712TypedData;
|
|
@@ -275,6 +293,10 @@ export declare enum KeyCurve {
|
|
|
275
293
|
ed25519 = "ed25519",
|
|
276
294
|
secp256k1 = "secp256k1"
|
|
277
295
|
}
|
|
296
|
+
export declare enum KeyProtocol {
|
|
297
|
+
CGGMP21 = "CGGMP21",
|
|
298
|
+
BINANCE_EDDSA = "BINANCE_EDDSA"
|
|
299
|
+
}
|
|
278
300
|
export declare enum EventKind {
|
|
279
301
|
NativeTransfer = "NativeTransfer",
|
|
280
302
|
Erc20Transfer = "Erc20Transfer",
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.BlockchainNetwork = exports.SignatureStatus = exports.TransactionStatus = exports.TransferStatus = exports.TransferDirection = exports.EventKind = exports.KeyCurve = exports.KeyScheme = exports.WalletStatus = exports.SignatureKind = exports.TransactionKind = exports.TransferKind = void 0;
|
|
3
|
+
exports.BlockchainNetwork = exports.SignatureStatus = exports.TransactionStatus = exports.TransferStatus = exports.TransferDirection = exports.EventKind = exports.KeyProtocol = exports.KeyCurve = exports.KeyScheme = exports.WalletStatus = exports.SignatureKind = exports.TransactionKind = exports.TransferKind = void 0;
|
|
4
4
|
// FIXME: Missing documentation for TransferKind
|
|
5
5
|
var TransferKind;
|
|
6
6
|
(function (TransferKind) {
|
|
@@ -57,6 +57,14 @@ var KeyCurve;
|
|
|
57
57
|
// FIXME: Missing documentation for secp256k1
|
|
58
58
|
KeyCurve["secp256k1"] = "secp256k1";
|
|
59
59
|
})(KeyCurve = exports.KeyCurve || (exports.KeyCurve = {}));
|
|
60
|
+
// FIXME: Missing documentation for KeyProtocol
|
|
61
|
+
var KeyProtocol;
|
|
62
|
+
(function (KeyProtocol) {
|
|
63
|
+
// FIXME: Missing documentation for CGGMP21
|
|
64
|
+
KeyProtocol["CGGMP21"] = "CGGMP21";
|
|
65
|
+
// FIXME: Missing documentation for BINANCE_EDDSA
|
|
66
|
+
KeyProtocol["BINANCE_EDDSA"] = "BINANCE_EDDSA";
|
|
67
|
+
})(KeyProtocol = exports.KeyProtocol || (exports.KeyProtocol = {}));
|
|
60
68
|
// FIXME: Missing documentation for EventKind
|
|
61
69
|
var EventKind;
|
|
62
70
|
(function (EventKind) {
|
package/dfnsApiClient.d.ts
CHANGED
|
@@ -8,6 +8,7 @@ import { PolicyExecutionClient } from './codegen/PolicyExecution';
|
|
|
8
8
|
import { PolicyManagementClient } from './codegen/PolicyManagement';
|
|
9
9
|
import { PublicKeysClient } from './codegen/PublicKeys';
|
|
10
10
|
import { WalletsClient } from './codegen/Wallets';
|
|
11
|
+
import { SignersClient } from './codegen/Signers';
|
|
11
12
|
import { CredentialSigner } from './signer';
|
|
12
13
|
export type DfnsApiClientOptions = DfnsBaseApiOptions & {
|
|
13
14
|
signer: CredentialSigner;
|
|
@@ -24,4 +25,5 @@ export declare class DfnsApiClient {
|
|
|
24
25
|
get policyManagement(): PolicyManagementClient;
|
|
25
26
|
get publicKeys(): PublicKeysClient;
|
|
26
27
|
get wallets(): WalletsClient;
|
|
28
|
+
get signers(): SignersClient;
|
|
27
29
|
}
|
package/dfnsApiClient.js
CHANGED
|
@@ -10,6 +10,7 @@ const PolicyExecution_1 = require("./codegen/PolicyExecution");
|
|
|
10
10
|
const PolicyManagement_1 = require("./codegen/PolicyManagement");
|
|
11
11
|
const PublicKeys_1 = require("./codegen/PublicKeys");
|
|
12
12
|
const Wallets_1 = require("./codegen/Wallets");
|
|
13
|
+
const Signers_1 = require("./codegen/Signers");
|
|
13
14
|
class DfnsApiClient {
|
|
14
15
|
constructor(apiOptions) {
|
|
15
16
|
this.apiOptions = apiOptions;
|
|
@@ -41,5 +42,8 @@ class DfnsApiClient {
|
|
|
41
42
|
get wallets() {
|
|
42
43
|
return new Wallets_1.WalletsClient(this.apiOptions);
|
|
43
44
|
}
|
|
45
|
+
get signers() {
|
|
46
|
+
return new Signers_1.SignersClient(this.apiOptions);
|
|
47
|
+
}
|
|
44
48
|
}
|
|
45
49
|
exports.DfnsApiClient = DfnsApiClient;
|
|
@@ -7,6 +7,7 @@ import { DelegatedPermissionsClient } from './codegen/Permissions';
|
|
|
7
7
|
import { DelegatedPolicyExecutionClient } from './codegen/PolicyExecution';
|
|
8
8
|
import { DelegatedPolicyManagementClient } from './codegen/PolicyManagement';
|
|
9
9
|
import { DelegatedPublicKeysClient } from './codegen/PublicKeys';
|
|
10
|
+
import { DelegatedSignersClient } from './codegen/Signers';
|
|
10
11
|
import { DelegatedWalletsClient } from './codegen/Wallets';
|
|
11
12
|
export type DfnsDelegatedApiClientOptions = DfnsBaseApiOptions & {
|
|
12
13
|
authToken: string;
|
|
@@ -23,4 +24,5 @@ export declare class DfnsDelegatedApiClient {
|
|
|
23
24
|
get policyManagement(): DelegatedPolicyManagementClient;
|
|
24
25
|
get publicKeys(): DelegatedPublicKeysClient;
|
|
25
26
|
get wallets(): DelegatedWalletsClient;
|
|
27
|
+
get signers(): DelegatedSignersClient;
|
|
26
28
|
}
|
|
@@ -9,6 +9,7 @@ const Permissions_1 = require("./codegen/Permissions");
|
|
|
9
9
|
const PolicyExecution_1 = require("./codegen/PolicyExecution");
|
|
10
10
|
const PolicyManagement_1 = require("./codegen/PolicyManagement");
|
|
11
11
|
const PublicKeys_1 = require("./codegen/PublicKeys");
|
|
12
|
+
const Signers_1 = require("./codegen/Signers");
|
|
12
13
|
const Wallets_1 = require("./codegen/Wallets");
|
|
13
14
|
class DfnsDelegatedApiClient {
|
|
14
15
|
constructor(apiOptions) {
|
|
@@ -41,5 +42,8 @@ class DfnsDelegatedApiClient {
|
|
|
41
42
|
get wallets() {
|
|
42
43
|
return new Wallets_1.DelegatedWalletsClient(this.apiOptions);
|
|
43
44
|
}
|
|
45
|
+
get signers() {
|
|
46
|
+
return new Signers_1.DelegatedSignersClient(this.apiOptions);
|
|
47
|
+
}
|
|
44
48
|
}
|
|
45
49
|
exports.DfnsDelegatedApiClient = DfnsDelegatedApiClient;
|
package/package.json
CHANGED
package/signer.d.ts
CHANGED
|
@@ -11,6 +11,7 @@ export type KeyAssertion = {
|
|
|
11
11
|
credId: string;
|
|
12
12
|
clientData: string;
|
|
13
13
|
signature: string;
|
|
14
|
+
algorithm?: string;
|
|
14
15
|
};
|
|
15
16
|
};
|
|
16
17
|
export type Fido2Assertion = {
|
|
@@ -31,6 +32,15 @@ export type TotpAssertion = {
|
|
|
31
32
|
kind: 'Totp';
|
|
32
33
|
otpCode: string;
|
|
33
34
|
};
|
|
35
|
+
export type RecoveryKeyAssertion = {
|
|
36
|
+
kind: 'RecoveryKey';
|
|
37
|
+
credentialAssertion: {
|
|
38
|
+
credId: string;
|
|
39
|
+
clientData: string;
|
|
40
|
+
signature: string;
|
|
41
|
+
algorithm?: string;
|
|
42
|
+
};
|
|
43
|
+
};
|
|
34
44
|
export type FirstFactorAssertion = KeyAssertion | Fido2Assertion | PasswordAssertion;
|
|
35
45
|
export type SecondFactorAssertion = KeyAssertion | Fido2Assertion | TotpAssertion;
|
|
36
46
|
export type CredentialAssertion = KeyAssertion | Fido2Assertion | PasswordAssertion | TotpAssertion;
|