@dfns/sdk 0.3.0 → 0.3.2
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/datamodel/Assets/types.d.ts +1 -7
- package/codegen/datamodel/Wallets/types.d.ts +152 -45
- package/codegen/datamodel/Wallets/types.js +34 -4
- package/dfnsApiClient.d.ts +2 -12
- package/dfnsApiClient.js +4 -18
- package/dfnsDelegatedApiClient.d.ts +2 -12
- package/dfnsDelegatedApiClient.js +4 -18
- package/generated/networks/client.d.ts +8 -0
- package/generated/networks/client.js +34 -0
- package/generated/networks/delegatedClient.d.ts +8 -0
- package/generated/networks/delegatedClient.js +34 -0
- package/generated/networks/index.d.ts +3 -0
- package/{codegen/datamodel/Orgs → generated/networks}/index.js +2 -1
- package/generated/networks/types.d.ts +37 -0
- package/generated/permissions/types.d.ts +49 -4
- package/generated/policies/types.d.ts +286 -30
- package/generated/wallets/types.d.ts +94 -33
- package/generated/webhooks/types.d.ts +10 -9
- package/package.json +1 -1
- package/types/networks.d.ts +1 -0
- package/{codegen/datamodel/BlockchainIndexing/index.js → types/networks.js} +1 -1
- package/codegen/Blockchains/BlockchainsClient.d.ts +0 -7
- package/codegen/Blockchains/BlockchainsClient.js +0 -23
- package/codegen/Blockchains/DelegatedBlockchainsClient.d.ts +0 -7
- package/codegen/Blockchains/DelegatedBlockchainsClient.js +0 -23
- package/codegen/Blockchains/index.d.ts +0 -3
- package/codegen/Blockchains/index.js +0 -19
- package/codegen/Blockchains/types.d.ts +0 -6
- package/codegen/PolicyExecution/DelegatedPolicyExecutionClient.d.ts +0 -11
- package/codegen/PolicyExecution/DelegatedPolicyExecutionClient.js +0 -61
- package/codegen/PolicyExecution/PolicyExecutionClient.d.ts +0 -9
- package/codegen/PolicyExecution/PolicyExecutionClient.js +0 -45
- package/codegen/PolicyExecution/index.d.ts +0 -3
- package/codegen/PolicyExecution/index.js +0 -19
- package/codegen/PolicyExecution/types.d.ts +0 -18
- package/codegen/PolicyExecution/types.js +0 -2
- package/codegen/PolicyManagement/DelegatedPolicyManagementClient.d.ts +0 -25
- package/codegen/PolicyManagement/DelegatedPolicyManagementClient.js +0 -240
- package/codegen/PolicyManagement/PolicyManagementClient.d.ts +0 -18
- package/codegen/PolicyManagement/PolicyManagementClient.js +0 -146
- package/codegen/PolicyManagement/index.d.ts +0 -3
- package/codegen/PolicyManagement/index.js +0 -19
- package/codegen/PolicyManagement/types.d.ts +0 -51
- package/codegen/PolicyManagement/types.js +0 -2
- package/codegen/Signers/DelegatedSignersClient.d.ts +0 -7
- package/codegen/Signers/DelegatedSignersClient.js +0 -22
- package/codegen/Signers/SignersClient.d.ts +0 -7
- package/codegen/Signers/SignersClient.js +0 -22
- package/codegen/Signers/index.d.ts +0 -3
- package/codegen/Signers/index.js +0 -19
- package/codegen/Signers/types.d.ts +0 -2
- package/codegen/Signers/types.js +0 -2
- package/codegen/datamodel/ApiKeys/errors.d.ts +0 -6
- package/codegen/datamodel/ApiKeys/errors.js +0 -15
- package/codegen/datamodel/ApiKeys/index.d.ts +0 -3
- package/codegen/datamodel/ApiKeys/index.js +0 -19
- package/codegen/datamodel/ApiKeys/responses.d.ts +0 -25
- package/codegen/datamodel/ApiKeys/responses.js +0 -2
- package/codegen/datamodel/ApiKeys/types.d.ts +0 -32
- package/codegen/datamodel/ApiKeys/types.js +0 -11
- package/codegen/datamodel/BlockchainIndexing/errors.d.ts +0 -0
- package/codegen/datamodel/BlockchainIndexing/errors.js +0 -1
- package/codegen/datamodel/BlockchainIndexing/index.d.ts +0 -1
- package/codegen/datamodel/BlockchainIndexing/responses.d.ts +0 -6
- package/codegen/datamodel/BlockchainIndexing/responses.js +0 -2
- package/codegen/datamodel/BlockchainIndexing/types.d.ts +0 -0
- package/codegen/datamodel/BlockchainIndexing/types.js +0 -1
- package/codegen/datamodel/Blockchains/errors.d.ts +0 -0
- package/codegen/datamodel/Blockchains/errors.js +0 -1
- package/codegen/datamodel/Blockchains/index.d.ts +0 -2
- package/codegen/datamodel/Blockchains/index.js +0 -18
- package/codegen/datamodel/Blockchains/responses.d.ts +0 -12
- package/codegen/datamodel/Blockchains/responses.js +0 -2
- package/codegen/datamodel/Blockchains/types.d.ts +0 -270
- package/codegen/datamodel/Blockchains/types.js +0 -53
- package/codegen/datamodel/Orgs/errors.d.ts +0 -0
- package/codegen/datamodel/Orgs/errors.js +0 -1
- package/codegen/datamodel/Orgs/index.d.ts +0 -2
- package/codegen/datamodel/Orgs/responses.d.ts +0 -45
- package/codegen/datamodel/Orgs/responses.js +0 -2
- package/codegen/datamodel/Orgs/types.d.ts +0 -240
- package/codegen/datamodel/Orgs/types.js +0 -39
- package/codegen/datamodel/Permissions/errors.d.ts +0 -0
- package/codegen/datamodel/Permissions/errors.js +0 -1
- package/codegen/datamodel/Permissions/index.d.ts +0 -2
- package/codegen/datamodel/Permissions/index.js +0 -18
- package/codegen/datamodel/Permissions/responses.d.ts +0 -75
- package/codegen/datamodel/Permissions/responses.js +0 -2
- package/codegen/datamodel/Permissions/types.d.ts +0 -93
- package/codegen/datamodel/Permissions/types.js +0 -43
- package/codegen/datamodel/PolicyExecution/errors.d.ts +0 -11
- package/codegen/datamodel/PolicyExecution/errors.js +0 -17
- package/codegen/datamodel/PolicyExecution/index.d.ts +0 -3
- package/codegen/datamodel/PolicyExecution/index.js +0 -19
- package/codegen/datamodel/PolicyExecution/responses.d.ts +0 -19
- package/codegen/datamodel/PolicyExecution/responses.js +0 -2
- package/codegen/datamodel/PolicyExecution/types.d.ts +0 -60
- package/codegen/datamodel/PolicyExecution/types.js +0 -17
- package/codegen/datamodel/PolicyManagement/errors.d.ts +0 -0
- package/codegen/datamodel/PolicyManagement/errors.js +0 -1
- package/codegen/datamodel/PolicyManagement/index.d.ts +0 -2
- package/codegen/datamodel/PolicyManagement/index.js +0 -18
- package/codegen/datamodel/PolicyManagement/responses.d.ts +0 -83
- package/codegen/datamodel/PolicyManagement/responses.js +0 -2
- package/codegen/datamodel/PolicyManagement/types.d.ts +0 -391
- package/codegen/datamodel/PolicyManagement/types.js +0 -95
- package/codegen/datamodel/Signers/errors.d.ts +0 -0
- package/codegen/datamodel/Signers/errors.js +0 -1
- package/codegen/datamodel/Signers/index.d.ts +0 -2
- package/codegen/datamodel/Signers/index.js +0 -18
- package/codegen/datamodel/Signers/responses.d.ts +0 -27
- package/codegen/datamodel/Signers/responses.js +0 -2
- package/codegen/datamodel/Signers/types.d.ts +0 -21
- package/codegen/datamodel/Signers/types.js +0 -2
- /package/{codegen/Blockchains → generated/networks}/types.js +0 -0
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { DfnsDelegatedApiClientOptions } from '../../dfnsDelegatedApiClient';
|
|
2
|
-
import * as T from './types';
|
|
3
|
-
export declare class DelegatedBlockchainsClient {
|
|
4
|
-
private apiOptions;
|
|
5
|
-
constructor(apiOptions: DfnsDelegatedApiClientOptions);
|
|
6
|
-
callViewFunction(request: T.CallViewFunctionRequest): Promise<T.CallViewFunctionResponse>;
|
|
7
|
-
}
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.DelegatedBlockchainsClient = void 0;
|
|
4
|
-
const fetch_1 = require("../../utils/fetch");
|
|
5
|
-
const url_1 = require("../../utils/url");
|
|
6
|
-
class DelegatedBlockchainsClient {
|
|
7
|
-
constructor(apiOptions) {
|
|
8
|
-
this.apiOptions = apiOptions;
|
|
9
|
-
}
|
|
10
|
-
async callViewFunction(request) {
|
|
11
|
-
const path = (0, url_1.buildPathAndQuery)('/blockchains/:network/call-read-function', {
|
|
12
|
-
path: { network: request.network },
|
|
13
|
-
query: {},
|
|
14
|
-
});
|
|
15
|
-
const response = await (0, fetch_1.simpleFetch)(path, {
|
|
16
|
-
method: 'POST',
|
|
17
|
-
body: request.body,
|
|
18
|
-
apiOptions: this.apiOptions,
|
|
19
|
-
});
|
|
20
|
-
return response.json();
|
|
21
|
-
}
|
|
22
|
-
}
|
|
23
|
-
exports.DelegatedBlockchainsClient = DelegatedBlockchainsClient;
|
|
@@ -1,19 +0,0 @@
|
|
|
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("./BlockchainsClient"), exports);
|
|
18
|
-
__exportStar(require("./DelegatedBlockchainsClient"), exports);
|
|
19
|
-
__exportStar(require("./types"), exports);
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { SignUserActionChallengeRequest, UserActionChallengeResponse } from '../../baseAuthApi';
|
|
2
|
-
import { DfnsDelegatedApiClientOptions } from '../../dfnsDelegatedApiClient';
|
|
3
|
-
import * as T from './types';
|
|
4
|
-
export declare class DelegatedPolicyExecutionClient {
|
|
5
|
-
private apiOptions;
|
|
6
|
-
constructor(apiOptions: DfnsDelegatedApiClientOptions);
|
|
7
|
-
listPolicyControlExecutions(request: T.ListPolicyControlExecutionsRequest): Promise<T.ListPolicyControlExecutionsResponse>;
|
|
8
|
-
getPolicyControlExecutionById(request: T.GetPolicyControlExecutionByIdRequest): Promise<T.GetPolicyControlExecutionByIdResponse>;
|
|
9
|
-
updatePolicyControlExecutionInit(request: T.UpdatePolicyControlExecutionRequest): Promise<UserActionChallengeResponse>;
|
|
10
|
-
updatePolicyControlExecutionComplete(request: T.UpdatePolicyControlExecutionRequest, signedChallenge: SignUserActionChallengeRequest): Promise<T.UpdatePolicyControlExecutionResponse>;
|
|
11
|
-
}
|
|
@@ -1,61 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.DelegatedPolicyExecutionClient = void 0;
|
|
4
|
-
const baseAuthApi_1 = require("../../baseAuthApi");
|
|
5
|
-
const fetch_1 = require("../../utils/fetch");
|
|
6
|
-
const url_1 = require("../../utils/url");
|
|
7
|
-
class DelegatedPolicyExecutionClient {
|
|
8
|
-
constructor(apiOptions) {
|
|
9
|
-
this.apiOptions = apiOptions;
|
|
10
|
-
}
|
|
11
|
-
async listPolicyControlExecutions(request) {
|
|
12
|
-
const path = (0, url_1.buildPathAndQuery)('/policies/policy-control-executions', {
|
|
13
|
-
path: {},
|
|
14
|
-
query: request.query ?? {},
|
|
15
|
-
});
|
|
16
|
-
const response = await (0, fetch_1.simpleFetch)(path, {
|
|
17
|
-
method: 'GET',
|
|
18
|
-
apiOptions: this.apiOptions,
|
|
19
|
-
});
|
|
20
|
-
return response.json();
|
|
21
|
-
}
|
|
22
|
-
async getPolicyControlExecutionById(request) {
|
|
23
|
-
const path = (0, url_1.buildPathAndQuery)('/policies/policy-control-executions/:policyControlExecutionId', {
|
|
24
|
-
path: { policyControlExecutionId: request.policyControlExecutionId },
|
|
25
|
-
query: {},
|
|
26
|
-
});
|
|
27
|
-
const response = await (0, fetch_1.simpleFetch)(path, {
|
|
28
|
-
method: 'GET',
|
|
29
|
-
apiOptions: this.apiOptions,
|
|
30
|
-
});
|
|
31
|
-
return response.json();
|
|
32
|
-
}
|
|
33
|
-
async updatePolicyControlExecutionInit(request) {
|
|
34
|
-
const path = (0, url_1.buildPathAndQuery)('/policies/policy-control-executions/:policyControlExecutionId', {
|
|
35
|
-
path: { policyControlExecutionId: request.policyControlExecutionId },
|
|
36
|
-
query: {},
|
|
37
|
-
});
|
|
38
|
-
const challenge = await baseAuthApi_1.BaseAuthApi.createUserActionChallenge({
|
|
39
|
-
userActionHttpMethod: 'PUT',
|
|
40
|
-
userActionHttpPath: path,
|
|
41
|
-
userActionPayload: JSON.stringify(request.body),
|
|
42
|
-
userActionServerKind: 'Api',
|
|
43
|
-
}, this.apiOptions);
|
|
44
|
-
return challenge;
|
|
45
|
-
}
|
|
46
|
-
async updatePolicyControlExecutionComplete(request, signedChallenge) {
|
|
47
|
-
const path = (0, url_1.buildPathAndQuery)('/policies/policy-control-executions/:policyControlExecutionId', {
|
|
48
|
-
path: { policyControlExecutionId: request.policyControlExecutionId },
|
|
49
|
-
query: {},
|
|
50
|
-
});
|
|
51
|
-
const { userAction } = await baseAuthApi_1.BaseAuthApi.signUserActionChallenge(signedChallenge, this.apiOptions);
|
|
52
|
-
const response = await (0, fetch_1.simpleFetch)(path, {
|
|
53
|
-
method: 'PUT',
|
|
54
|
-
body: request.body,
|
|
55
|
-
headers: { 'x-dfns-useraction': userAction },
|
|
56
|
-
apiOptions: this.apiOptions,
|
|
57
|
-
});
|
|
58
|
-
return response.json();
|
|
59
|
-
}
|
|
60
|
-
}
|
|
61
|
-
exports.DelegatedPolicyExecutionClient = DelegatedPolicyExecutionClient;
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { DfnsApiClientOptions } from '../../dfnsApiClient';
|
|
2
|
-
import * as T from './types';
|
|
3
|
-
export declare class PolicyExecutionClient {
|
|
4
|
-
private apiOptions;
|
|
5
|
-
constructor(apiOptions: DfnsApiClientOptions);
|
|
6
|
-
listPolicyControlExecutions(request: T.ListPolicyControlExecutionsRequest): Promise<T.ListPolicyControlExecutionsResponse>;
|
|
7
|
-
getPolicyControlExecutionById(request: T.GetPolicyControlExecutionByIdRequest): Promise<T.GetPolicyControlExecutionByIdResponse>;
|
|
8
|
-
updatePolicyControlExecution(request: T.UpdatePolicyControlExecutionRequest): Promise<T.UpdatePolicyControlExecutionResponse>;
|
|
9
|
-
}
|
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.PolicyExecutionClient = void 0;
|
|
4
|
-
const fetch_1 = require("../../utils/fetch");
|
|
5
|
-
const url_1 = require("../../utils/url");
|
|
6
|
-
class PolicyExecutionClient {
|
|
7
|
-
constructor(apiOptions) {
|
|
8
|
-
this.apiOptions = apiOptions;
|
|
9
|
-
}
|
|
10
|
-
async listPolicyControlExecutions(request) {
|
|
11
|
-
const path = (0, url_1.buildPathAndQuery)('/policies/policy-control-executions', {
|
|
12
|
-
path: {},
|
|
13
|
-
query: request.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
|
-
async getPolicyControlExecutionById(request) {
|
|
22
|
-
const path = (0, url_1.buildPathAndQuery)('/policies/policy-control-executions/:policyControlExecutionId', {
|
|
23
|
-
path: { policyControlExecutionId: request.policyControlExecutionId },
|
|
24
|
-
query: {},
|
|
25
|
-
});
|
|
26
|
-
const response = await (0, fetch_1.simpleFetch)(path, {
|
|
27
|
-
method: 'GET',
|
|
28
|
-
apiOptions: this.apiOptions,
|
|
29
|
-
});
|
|
30
|
-
return response.json();
|
|
31
|
-
}
|
|
32
|
-
async updatePolicyControlExecution(request) {
|
|
33
|
-
const path = (0, url_1.buildPathAndQuery)('/policies/policy-control-executions/:policyControlExecutionId', {
|
|
34
|
-
path: { policyControlExecutionId: request.policyControlExecutionId },
|
|
35
|
-
query: {},
|
|
36
|
-
});
|
|
37
|
-
const response = await (0, fetch_1.userActionFetch)(path, {
|
|
38
|
-
method: 'PUT',
|
|
39
|
-
body: request.body,
|
|
40
|
-
apiOptions: this.apiOptions,
|
|
41
|
-
});
|
|
42
|
-
return response.json();
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
exports.PolicyExecutionClient = PolicyExecutionClient;
|
|
@@ -1,19 +0,0 @@
|
|
|
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("./DelegatedPolicyExecutionClient"), exports);
|
|
18
|
-
__exportStar(require("./PolicyExecutionClient"), exports);
|
|
19
|
-
__exportStar(require("./types"), exports);
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import * as PolicyExecution from '../datamodel/PolicyExecution';
|
|
2
|
-
export type ListPolicyControlExecutionsRequest = {
|
|
3
|
-
query?: {
|
|
4
|
-
activityId: string;
|
|
5
|
-
};
|
|
6
|
-
};
|
|
7
|
-
export type ListPolicyControlExecutionsResponse = {
|
|
8
|
-
items: PolicyExecution.PolicyControlExecution[];
|
|
9
|
-
};
|
|
10
|
-
export type GetPolicyControlExecutionByIdRequest = {
|
|
11
|
-
policyControlExecutionId: string;
|
|
12
|
-
};
|
|
13
|
-
export type GetPolicyControlExecutionByIdResponse = PolicyExecution.PolicyControlExecution;
|
|
14
|
-
export type UpdatePolicyControlExecutionRequest = {
|
|
15
|
-
policyControlExecutionId: string;
|
|
16
|
-
body: PolicyExecution.UpdatePolicyControlExecutionInput;
|
|
17
|
-
};
|
|
18
|
-
export type UpdatePolicyControlExecutionResponse = PolicyExecution.PolicyControlExecution;
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import { SignUserActionChallengeRequest, UserActionChallengeResponse } from '../../baseAuthApi';
|
|
2
|
-
import { DfnsDelegatedApiClientOptions } from '../../dfnsDelegatedApiClient';
|
|
3
|
-
import * as T from './types';
|
|
4
|
-
export declare class DelegatedPolicyManagementClient {
|
|
5
|
-
private apiOptions;
|
|
6
|
-
constructor(apiOptions: DfnsDelegatedApiClientOptions);
|
|
7
|
-
createPolicyInit(request: T.CreatePolicyRequest): Promise<UserActionChallengeResponse>;
|
|
8
|
-
createPolicyComplete(request: T.CreatePolicyRequest, signedChallenge: SignUserActionChallengeRequest): Promise<T.CreatePolicyResponse>;
|
|
9
|
-
getPolicyById(request: T.GetPolicyByIdRequest): Promise<T.GetPolicyByIdResponse>;
|
|
10
|
-
listPolicies(): Promise<T.ListPoliciesResponse>;
|
|
11
|
-
archivePolicyInit(request: T.ArchivePolicyRequest): Promise<UserActionChallengeResponse>;
|
|
12
|
-
archivePolicyComplete(request: T.ArchivePolicyRequest, signedChallenge: SignUserActionChallengeRequest): Promise<T.ArchivePolicyResponse>;
|
|
13
|
-
createPolicyControlInit(request: T.CreatePolicyControlRequest): Promise<UserActionChallengeResponse>;
|
|
14
|
-
createPolicyControlComplete(request: T.CreatePolicyControlRequest, signedChallenge: SignUserActionChallengeRequest): Promise<T.CreatePolicyControlResponse>;
|
|
15
|
-
getPolicyControlById(request: T.GetPolicyControlByIdRequest): Promise<T.GetPolicyControlByIdResponse>;
|
|
16
|
-
listPolicyControls(): Promise<T.ListPolicyControlsResponse>;
|
|
17
|
-
archivePolicyControlInit(request: T.ArchivePolicyControlRequest): Promise<UserActionChallengeResponse>;
|
|
18
|
-
archivePolicyControlComplete(request: T.ArchivePolicyControlRequest, signedChallenge: SignUserActionChallengeRequest): Promise<T.ArchivePolicyControlResponse>;
|
|
19
|
-
createPolicyRuleInit(request: T.CreatePolicyRuleRequest): Promise<UserActionChallengeResponse>;
|
|
20
|
-
createPolicyRuleComplete(request: T.CreatePolicyRuleRequest, signedChallenge: SignUserActionChallengeRequest): Promise<T.CreatePolicyRuleResponse>;
|
|
21
|
-
getPolicyRuleById(request: T.GetPolicyRuleByIdRequest): Promise<T.GetPolicyRuleByIdResponse>;
|
|
22
|
-
listPolicyRules(request: T.ListPolicyRulesRequest): Promise<T.ListPolicyRulesResponse>;
|
|
23
|
-
archivePolicyRuleInit(request: T.ArchivePolicyRuleRequest): Promise<UserActionChallengeResponse>;
|
|
24
|
-
archivePolicyRuleComplete(request: T.ArchivePolicyRuleRequest, signedChallenge: SignUserActionChallengeRequest): Promise<T.ArchivePolicyRuleResponse>;
|
|
25
|
-
}
|
|
@@ -1,240 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.DelegatedPolicyManagementClient = void 0;
|
|
4
|
-
const baseAuthApi_1 = require("../../baseAuthApi");
|
|
5
|
-
const fetch_1 = require("../../utils/fetch");
|
|
6
|
-
const url_1 = require("../../utils/url");
|
|
7
|
-
class DelegatedPolicyManagementClient {
|
|
8
|
-
constructor(apiOptions) {
|
|
9
|
-
this.apiOptions = apiOptions;
|
|
10
|
-
}
|
|
11
|
-
async createPolicyInit(request) {
|
|
12
|
-
const path = (0, url_1.buildPathAndQuery)('/policies', {
|
|
13
|
-
path: {},
|
|
14
|
-
query: {},
|
|
15
|
-
});
|
|
16
|
-
const challenge = await baseAuthApi_1.BaseAuthApi.createUserActionChallenge({
|
|
17
|
-
userActionHttpMethod: 'POST',
|
|
18
|
-
userActionHttpPath: path,
|
|
19
|
-
userActionPayload: JSON.stringify(request.body),
|
|
20
|
-
userActionServerKind: 'Api',
|
|
21
|
-
}, this.apiOptions);
|
|
22
|
-
return challenge;
|
|
23
|
-
}
|
|
24
|
-
async createPolicyComplete(request, signedChallenge) {
|
|
25
|
-
const path = (0, url_1.buildPathAndQuery)('/policies', {
|
|
26
|
-
path: {},
|
|
27
|
-
query: {},
|
|
28
|
-
});
|
|
29
|
-
const { userAction } = await baseAuthApi_1.BaseAuthApi.signUserActionChallenge(signedChallenge, this.apiOptions);
|
|
30
|
-
const response = await (0, fetch_1.simpleFetch)(path, {
|
|
31
|
-
method: 'POST',
|
|
32
|
-
body: request.body,
|
|
33
|
-
headers: { 'x-dfns-useraction': userAction },
|
|
34
|
-
apiOptions: this.apiOptions,
|
|
35
|
-
});
|
|
36
|
-
return response.json();
|
|
37
|
-
}
|
|
38
|
-
async getPolicyById(request) {
|
|
39
|
-
const path = (0, url_1.buildPathAndQuery)('/policies/:policyId', {
|
|
40
|
-
path: { policyId: request.policyId },
|
|
41
|
-
query: {},
|
|
42
|
-
});
|
|
43
|
-
const response = await (0, fetch_1.simpleFetch)(path, {
|
|
44
|
-
method: 'GET',
|
|
45
|
-
apiOptions: this.apiOptions,
|
|
46
|
-
});
|
|
47
|
-
return response.json();
|
|
48
|
-
}
|
|
49
|
-
async listPolicies() {
|
|
50
|
-
const path = (0, url_1.buildPathAndQuery)('/policies', {
|
|
51
|
-
path: {},
|
|
52
|
-
query: {},
|
|
53
|
-
});
|
|
54
|
-
const response = await (0, fetch_1.simpleFetch)(path, {
|
|
55
|
-
method: 'GET',
|
|
56
|
-
apiOptions: this.apiOptions,
|
|
57
|
-
});
|
|
58
|
-
return response.json();
|
|
59
|
-
}
|
|
60
|
-
async archivePolicyInit(request) {
|
|
61
|
-
const path = (0, url_1.buildPathAndQuery)('/policies/:policyId', {
|
|
62
|
-
path: { policyId: request.policyId },
|
|
63
|
-
query: {},
|
|
64
|
-
});
|
|
65
|
-
const challenge = await baseAuthApi_1.BaseAuthApi.createUserActionChallenge({
|
|
66
|
-
userActionHttpMethod: 'DELETE',
|
|
67
|
-
userActionHttpPath: path,
|
|
68
|
-
userActionPayload: JSON.stringify({}),
|
|
69
|
-
userActionServerKind: 'Api',
|
|
70
|
-
}, this.apiOptions);
|
|
71
|
-
return challenge;
|
|
72
|
-
}
|
|
73
|
-
async archivePolicyComplete(request, signedChallenge) {
|
|
74
|
-
const path = (0, url_1.buildPathAndQuery)('/policies/:policyId', {
|
|
75
|
-
path: { policyId: request.policyId },
|
|
76
|
-
query: {},
|
|
77
|
-
});
|
|
78
|
-
const { userAction } = await baseAuthApi_1.BaseAuthApi.signUserActionChallenge(signedChallenge, this.apiOptions);
|
|
79
|
-
const response = await (0, fetch_1.simpleFetch)(path, {
|
|
80
|
-
method: 'DELETE',
|
|
81
|
-
body: {},
|
|
82
|
-
headers: { 'x-dfns-useraction': userAction },
|
|
83
|
-
apiOptions: this.apiOptions,
|
|
84
|
-
});
|
|
85
|
-
return response.json();
|
|
86
|
-
}
|
|
87
|
-
async createPolicyControlInit(request) {
|
|
88
|
-
const path = (0, url_1.buildPathAndQuery)('/policies/policy-controls', {
|
|
89
|
-
path: {},
|
|
90
|
-
query: {},
|
|
91
|
-
});
|
|
92
|
-
const challenge = await baseAuthApi_1.BaseAuthApi.createUserActionChallenge({
|
|
93
|
-
userActionHttpMethod: 'POST',
|
|
94
|
-
userActionHttpPath: path,
|
|
95
|
-
userActionPayload: JSON.stringify(request.body),
|
|
96
|
-
userActionServerKind: 'Api',
|
|
97
|
-
}, this.apiOptions);
|
|
98
|
-
return challenge;
|
|
99
|
-
}
|
|
100
|
-
async createPolicyControlComplete(request, signedChallenge) {
|
|
101
|
-
const path = (0, url_1.buildPathAndQuery)('/policies/policy-controls', {
|
|
102
|
-
path: {},
|
|
103
|
-
query: {},
|
|
104
|
-
});
|
|
105
|
-
const { userAction } = await baseAuthApi_1.BaseAuthApi.signUserActionChallenge(signedChallenge, this.apiOptions);
|
|
106
|
-
const response = await (0, fetch_1.simpleFetch)(path, {
|
|
107
|
-
method: 'POST',
|
|
108
|
-
body: request.body,
|
|
109
|
-
headers: { 'x-dfns-useraction': userAction },
|
|
110
|
-
apiOptions: this.apiOptions,
|
|
111
|
-
});
|
|
112
|
-
return response.json();
|
|
113
|
-
}
|
|
114
|
-
async getPolicyControlById(request) {
|
|
115
|
-
const path = (0, url_1.buildPathAndQuery)('/policies/policy-controls/:policyControlId', {
|
|
116
|
-
path: { policyControlId: request.policyControlId },
|
|
117
|
-
query: {},
|
|
118
|
-
});
|
|
119
|
-
const response = await (0, fetch_1.simpleFetch)(path, {
|
|
120
|
-
method: 'GET',
|
|
121
|
-
apiOptions: this.apiOptions,
|
|
122
|
-
});
|
|
123
|
-
return response.json();
|
|
124
|
-
}
|
|
125
|
-
async listPolicyControls() {
|
|
126
|
-
const path = (0, url_1.buildPathAndQuery)('/policies/policy-controls', {
|
|
127
|
-
path: {},
|
|
128
|
-
query: {},
|
|
129
|
-
});
|
|
130
|
-
const response = await (0, fetch_1.simpleFetch)(path, {
|
|
131
|
-
method: 'GET',
|
|
132
|
-
apiOptions: this.apiOptions,
|
|
133
|
-
});
|
|
134
|
-
return response.json();
|
|
135
|
-
}
|
|
136
|
-
async archivePolicyControlInit(request) {
|
|
137
|
-
const path = (0, url_1.buildPathAndQuery)('/policies/policy-controls/:policyControlId', {
|
|
138
|
-
path: { policyControlId: request.policyControlId },
|
|
139
|
-
query: {},
|
|
140
|
-
});
|
|
141
|
-
const challenge = await baseAuthApi_1.BaseAuthApi.createUserActionChallenge({
|
|
142
|
-
userActionHttpMethod: 'DELETE',
|
|
143
|
-
userActionHttpPath: path,
|
|
144
|
-
userActionPayload: JSON.stringify({}),
|
|
145
|
-
userActionServerKind: 'Api',
|
|
146
|
-
}, this.apiOptions);
|
|
147
|
-
return challenge;
|
|
148
|
-
}
|
|
149
|
-
async archivePolicyControlComplete(request, signedChallenge) {
|
|
150
|
-
const path = (0, url_1.buildPathAndQuery)('/policies/policy-controls/:policyControlId', {
|
|
151
|
-
path: { policyControlId: request.policyControlId },
|
|
152
|
-
query: {},
|
|
153
|
-
});
|
|
154
|
-
const { userAction } = await baseAuthApi_1.BaseAuthApi.signUserActionChallenge(signedChallenge, this.apiOptions);
|
|
155
|
-
const response = await (0, fetch_1.simpleFetch)(path, {
|
|
156
|
-
method: 'DELETE',
|
|
157
|
-
body: {},
|
|
158
|
-
headers: { 'x-dfns-useraction': userAction },
|
|
159
|
-
apiOptions: this.apiOptions,
|
|
160
|
-
});
|
|
161
|
-
return response.json();
|
|
162
|
-
}
|
|
163
|
-
async createPolicyRuleInit(request) {
|
|
164
|
-
const path = (0, url_1.buildPathAndQuery)('/policies/policy-rules', {
|
|
165
|
-
path: {},
|
|
166
|
-
query: {},
|
|
167
|
-
});
|
|
168
|
-
const challenge = await baseAuthApi_1.BaseAuthApi.createUserActionChallenge({
|
|
169
|
-
userActionHttpMethod: 'POST',
|
|
170
|
-
userActionHttpPath: path,
|
|
171
|
-
userActionPayload: JSON.stringify(request.body),
|
|
172
|
-
userActionServerKind: 'Api',
|
|
173
|
-
}, this.apiOptions);
|
|
174
|
-
return challenge;
|
|
175
|
-
}
|
|
176
|
-
async createPolicyRuleComplete(request, signedChallenge) {
|
|
177
|
-
const path = (0, url_1.buildPathAndQuery)('/policies/policy-rules', {
|
|
178
|
-
path: {},
|
|
179
|
-
query: {},
|
|
180
|
-
});
|
|
181
|
-
const { userAction } = await baseAuthApi_1.BaseAuthApi.signUserActionChallenge(signedChallenge, this.apiOptions);
|
|
182
|
-
const response = await (0, fetch_1.simpleFetch)(path, {
|
|
183
|
-
method: 'POST',
|
|
184
|
-
body: request.body,
|
|
185
|
-
headers: { 'x-dfns-useraction': userAction },
|
|
186
|
-
apiOptions: this.apiOptions,
|
|
187
|
-
});
|
|
188
|
-
return response.json();
|
|
189
|
-
}
|
|
190
|
-
async getPolicyRuleById(request) {
|
|
191
|
-
const path = (0, url_1.buildPathAndQuery)('/policies/policy-rules/:policyRuleId', {
|
|
192
|
-
path: { policyRuleId: request.policyRuleId },
|
|
193
|
-
query: {},
|
|
194
|
-
});
|
|
195
|
-
const response = await (0, fetch_1.simpleFetch)(path, {
|
|
196
|
-
method: 'GET',
|
|
197
|
-
apiOptions: this.apiOptions,
|
|
198
|
-
});
|
|
199
|
-
return response.json();
|
|
200
|
-
}
|
|
201
|
-
async listPolicyRules(request) {
|
|
202
|
-
const path = (0, url_1.buildPathAndQuery)('/policies/policy-rules', {
|
|
203
|
-
path: {},
|
|
204
|
-
query: request.query ?? {},
|
|
205
|
-
});
|
|
206
|
-
const response = await (0, fetch_1.simpleFetch)(path, {
|
|
207
|
-
method: 'GET',
|
|
208
|
-
apiOptions: this.apiOptions,
|
|
209
|
-
});
|
|
210
|
-
return response.json();
|
|
211
|
-
}
|
|
212
|
-
async archivePolicyRuleInit(request) {
|
|
213
|
-
const path = (0, url_1.buildPathAndQuery)('/policies/policy-rules/:policyRuleId', {
|
|
214
|
-
path: { policyRuleId: request.policyRuleId },
|
|
215
|
-
query: {},
|
|
216
|
-
});
|
|
217
|
-
const challenge = await baseAuthApi_1.BaseAuthApi.createUserActionChallenge({
|
|
218
|
-
userActionHttpMethod: 'DELETE',
|
|
219
|
-
userActionHttpPath: path,
|
|
220
|
-
userActionPayload: JSON.stringify({}),
|
|
221
|
-
userActionServerKind: 'Api',
|
|
222
|
-
}, this.apiOptions);
|
|
223
|
-
return challenge;
|
|
224
|
-
}
|
|
225
|
-
async archivePolicyRuleComplete(request, signedChallenge) {
|
|
226
|
-
const path = (0, url_1.buildPathAndQuery)('/policies/policy-rules/:policyRuleId', {
|
|
227
|
-
path: { policyRuleId: request.policyRuleId },
|
|
228
|
-
query: {},
|
|
229
|
-
});
|
|
230
|
-
const { userAction } = await baseAuthApi_1.BaseAuthApi.signUserActionChallenge(signedChallenge, this.apiOptions);
|
|
231
|
-
const response = await (0, fetch_1.simpleFetch)(path, {
|
|
232
|
-
method: 'DELETE',
|
|
233
|
-
body: {},
|
|
234
|
-
headers: { 'x-dfns-useraction': userAction },
|
|
235
|
-
apiOptions: this.apiOptions,
|
|
236
|
-
});
|
|
237
|
-
return response.json();
|
|
238
|
-
}
|
|
239
|
-
}
|
|
240
|
-
exports.DelegatedPolicyManagementClient = DelegatedPolicyManagementClient;
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { DfnsApiClientOptions } from '../../dfnsApiClient';
|
|
2
|
-
import * as T from './types';
|
|
3
|
-
export declare class PolicyManagementClient {
|
|
4
|
-
private apiOptions;
|
|
5
|
-
constructor(apiOptions: DfnsApiClientOptions);
|
|
6
|
-
createPolicy(request: T.CreatePolicyRequest): Promise<T.CreatePolicyResponse>;
|
|
7
|
-
getPolicyById(request: T.GetPolicyByIdRequest): Promise<T.GetPolicyByIdResponse>;
|
|
8
|
-
listPolicies(): Promise<T.ListPoliciesResponse>;
|
|
9
|
-
archivePolicy(request: T.ArchivePolicyRequest): Promise<T.ArchivePolicyResponse>;
|
|
10
|
-
createPolicyControl(request: T.CreatePolicyControlRequest): Promise<T.CreatePolicyControlResponse>;
|
|
11
|
-
getPolicyControlById(request: T.GetPolicyControlByIdRequest): Promise<T.GetPolicyControlByIdResponse>;
|
|
12
|
-
listPolicyControls(): Promise<T.ListPolicyControlsResponse>;
|
|
13
|
-
archivePolicyControl(request: T.ArchivePolicyControlRequest): Promise<T.ArchivePolicyControlResponse>;
|
|
14
|
-
createPolicyRule(request: T.CreatePolicyRuleRequest): Promise<T.CreatePolicyRuleResponse>;
|
|
15
|
-
getPolicyRuleById(request: T.GetPolicyRuleByIdRequest): Promise<T.GetPolicyRuleByIdResponse>;
|
|
16
|
-
listPolicyRules(request: T.ListPolicyRulesRequest): Promise<T.ListPolicyRulesResponse>;
|
|
17
|
-
archivePolicyRule(request: T.ArchivePolicyRuleRequest): Promise<T.ArchivePolicyRuleResponse>;
|
|
18
|
-
}
|