@dfns/sdk 0.2.0 → 0.2.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.
@@ -1,5 +1,8 @@
1
1
  import { DocumentSnapshot, EntityId, InitiatorKind, IsoDatetime } from '../Foundations';
2
2
  import { PolicyActivityKind, PolicyControlKind } from '../PolicyManagement';
3
+ /**
4
+ * @deprecated use the new policy engine instead
5
+ */
3
6
  export type PolicyExecution = {
4
7
  id: EntityId;
5
8
  kind: PolicyActivityKind;
@@ -17,6 +20,9 @@ export type PolicyExecution = {
17
20
  controlExecutions?: PolicyControlExecution[];
18
21
  policyId: EntityId;
19
22
  };
23
+ /**
24
+ * @deprecated use the new policy engine instead
25
+ */
20
26
  export type PolicyControlExecution = {
21
27
  id: EntityId;
22
28
  status: ExecutionStatus;
@@ -33,10 +39,19 @@ export type PolicyControlExecution = {
33
39
  numApprovals?: number;
34
40
  activityId: string;
35
41
  };
42
+ /**
43
+ * @deprecated use the new policy engine instead
44
+ */
36
45
  export type AppraisableActivity = {};
46
+ /**
47
+ * @deprecated use the new policy engine instead
48
+ */
37
49
  export type UpdatePolicyControlExecutionInput = {
38
50
  status: ExecutionStatus;
39
51
  };
52
+ /**
53
+ * @deprecated use the new policy engine instead
54
+ */
40
55
  export declare enum ExecutionStatus {
41
56
  Awaiting = "Awaiting",
42
57
  Passed = "Passed",
@@ -1,7 +1,9 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.ExecutionStatus = void 0;
4
- // FIXME: Missing documentation for ExecutionStatus
4
+ /**
5
+ * @deprecated use the new policy engine instead
6
+ */
5
7
  var ExecutionStatus;
6
8
  (function (ExecutionStatus) {
7
9
  // FIXME: Missing documentation for Awaiting
@@ -1,4 +1,7 @@
1
1
  import { Amount, AssetSymbol, EntityId, IntegerPositiveStrict, IsoDatetime, Tag, Username } from '../Foundations';
2
+ /**
3
+ * @deprecated use the new policy engine instead
4
+ */
2
5
  export type Policy = {
3
6
  id: EntityId;
4
7
  version: string;
@@ -14,11 +17,17 @@ export type Policy = {
14
17
  ruleIds: EntityId[];
15
18
  filter?: PolicyObjectFilter;
16
19
  };
20
+ /**
21
+ * @deprecated use the new policy engine instead
22
+ */
17
23
  export type NotifyAndAuditPcConf = {
18
24
  kind: PolicyControlKind.NotifyAndAudit;
19
25
  usernames?: string[];
20
26
  groups?: string[];
21
27
  };
28
+ /**
29
+ * @deprecated use the new policy engine instead
30
+ */
22
31
  export type RequestApprovalPcConf = {
23
32
  kind: PolicyControlKind.RequestApproval;
24
33
  approverGroups?: string[];
@@ -26,6 +35,9 @@ export type RequestApprovalPcConf = {
26
35
  numApprovals: number;
27
36
  timeoutInMinutes?: IntegerPositiveStrict;
28
37
  };
38
+ /**
39
+ * @deprecated use the new policy engine instead
40
+ */
29
41
  export type PolicyRule = {
30
42
  id: EntityId;
31
43
  version: string;
@@ -39,6 +51,9 @@ export type PolicyRule = {
39
51
  configuration: PolicyRuleConfiguration;
40
52
  status: PolicyRuleStatus;
41
53
  };
54
+ /**
55
+ * @deprecated use the new policy engine instead
56
+ */
42
57
  export type PolicyControl = {
43
58
  id: EntityId;
44
59
  version: string;
@@ -63,35 +78,56 @@ export type PolicyControl = {
63
78
  configuration: PolicyControlConfiguration;
64
79
  status: PolicyControlStatus;
65
80
  };
81
+ /**
82
+ * @deprecated use the new policy engine instead
83
+ */
66
84
  export type CreateAmountLimitPrConf = {
67
85
  kind: PolicyRuleKind.PaymentAmountLimit;
68
86
  limit: Amount;
69
87
  assetSymbol: AssetSymbol;
70
88
  shouldIgnoreAssetsWithoutMarketValue: boolean;
71
89
  };
90
+ /**
91
+ * @deprecated use the new policy engine instead
92
+ */
72
93
  export type UpdateAmountLimitPrConf = {
73
94
  limit?: Amount;
74
95
  assetSymbol?: AssetSymbol;
75
96
  shouldIgnoreAssetsWithoutMarketValue?: boolean;
76
97
  };
98
+ /**
99
+ * @deprecated use the new policy engine instead
100
+ */
77
101
  export type AmountLimitPrConf = {
78
102
  limit: Amount;
79
103
  assetSymbol: AssetSymbol;
80
104
  shouldIgnoreAssetsWithoutMarketValue: boolean;
81
105
  };
106
+ /**
107
+ * @deprecated use the new policy engine instead
108
+ */
82
109
  export type CreateTransferLimitPrConf = {
83
110
  kind: PolicyRuleKind.TransferAmountLimit;
84
111
  limit: Amount;
85
112
  currency: Currency;
86
113
  };
114
+ /**
115
+ * @deprecated use the new policy engine instead
116
+ */
87
117
  export type UpdateTransferLimitPrConf = {
88
118
  limit?: Amount;
89
119
  currency?: Currency;
90
120
  };
121
+ /**
122
+ * @deprecated use the new policy engine instead
123
+ */
91
124
  export type TransferLimitPrConf = {
92
125
  limit: Amount;
93
126
  currency: Currency;
94
127
  };
128
+ /**
129
+ * @deprecated use the new policy engine instead
130
+ */
95
131
  export type CreateOutgoingVelocityPrConf = {
96
132
  kind: PolicyRuleKind.PaymentAmountOutgoingVelocity;
97
133
  velocity: Amount;
@@ -99,18 +135,27 @@ export type CreateOutgoingVelocityPrConf = {
99
135
  intervalInMinutes: number;
100
136
  shouldIgnoreAssetsWithoutMarketValue: boolean;
101
137
  };
138
+ /**
139
+ * @deprecated use the new policy engine instead
140
+ */
102
141
  export type UpdateOutgoingVelocityPrConf = {
103
142
  velocity?: Amount;
104
143
  assetSymbol?: AssetSymbol;
105
144
  intervalInMinutes: number;
106
145
  shouldIgnoreAssetsWithoutMarketValue?: boolean;
107
146
  };
147
+ /**
148
+ * @deprecated use the new policy engine instead
149
+ */
108
150
  export type OutgoingVelocityPrConf = {
109
151
  velocity: Amount;
110
152
  assetSymbol: AssetSymbol;
111
153
  intervalInMinutes: number;
112
154
  shouldIgnoreAssetsWithoutMarketValue: boolean;
113
155
  };
156
+ /**
157
+ * @deprecated use the new policy engine instead
158
+ */
114
159
  export type CreateRequestApprovalPcConf = {
115
160
  kind: PolicyControlKind.RequestApproval;
116
161
  approverUsernames?: string[];
@@ -118,21 +163,33 @@ export type CreateRequestApprovalPcConf = {
118
163
  timeoutInMinutes?: IntegerPositiveStrict;
119
164
  numApprovals: number;
120
165
  };
166
+ /**
167
+ * @deprecated use the new policy engine instead
168
+ */
121
169
  export type UpdateRequestApprovalPcConf = {
122
170
  approverUsernames?: string[];
123
171
  approverGroups?: string[];
124
172
  timeoutInMinutes?: number;
125
173
  numApprovals?: number;
126
174
  };
175
+ /**
176
+ * @deprecated use the new policy engine instead
177
+ */
127
178
  export type CreateNotifyAndAuditPcConf = {
128
179
  kind: PolicyControlKind.NotifyAndAudit;
129
180
  usernames?: string[];
130
181
  groups?: string[];
131
182
  };
183
+ /**
184
+ * @deprecated use the new policy engine instead
185
+ */
132
186
  export type UpdateNotifyAndAuditPcConf = {
133
187
  groups?: string[];
134
188
  usernames?: string[];
135
189
  };
190
+ /**
191
+ * @deprecated use the new policy engine instead
192
+ */
136
193
  export type PolicyManagementPreferences = {
137
194
  /**
138
195
  * Sets default `AssetSymbol` for the policy rules that use it, such as Limit, Velocity, Siphoning, and others.
@@ -143,27 +200,51 @@ export type PolicyManagementPreferences = {
143
200
  */
144
201
  policyRuleVelocityIntervalInMinutes: number;
145
202
  };
203
+ /**
204
+ * @deprecated use the new policy engine instead
205
+ */
146
206
  export type Create = {};
207
+ /**
208
+ * @deprecated use the new policy engine instead
209
+ */
147
210
  export type EmptyConfiguration = {};
211
+ /**
212
+ * @deprecated use the new policy engine instead
213
+ */
148
214
  export type CreateAlwaysActivatedPrConf = {
149
215
  kind: PolicyRuleKind.AlwaysActivated;
150
216
  };
217
+ /**
218
+ * @deprecated use the new policy engine instead
219
+ */
151
220
  export type UpdateAlwaysActivatedPrConf = {};
221
+ /**
222
+ * @deprecated use the new policy engine instead
223
+ */
152
224
  export type AssetAccountFilter = {
153
225
  kind: PolicyObjectFilterKind.AssetAccount;
154
226
  assetAccountIds?: EntityId[];
155
227
  tags?: Tag[];
156
228
  assetSymbols?: string[];
157
229
  };
230
+ /**
231
+ * @deprecated use the new policy engine instead
232
+ */
158
233
  export type PublicKeyFilter = {
159
234
  kind: PolicyObjectFilterKind.PublicKey;
160
235
  publicKeyIds?: EntityId[];
161
236
  tags?: string[];
162
237
  };
238
+ /**
239
+ * @deprecated use the new policy engine instead
240
+ */
163
241
  export type WalletFilter = {
164
242
  kind: PolicyObjectFilterKind.Wallet;
165
243
  walletIds?: EntityId[];
166
244
  };
245
+ /**
246
+ * @deprecated use the new policy engine instead
247
+ */
167
248
  export type CreatePolicyInput = {
168
249
  activityKind: PolicyActivityKind;
169
250
  description: string;
@@ -174,6 +255,9 @@ export type CreatePolicyInput = {
174
255
  filter?: PolicyObjectFilter;
175
256
  isImmutable?: boolean;
176
257
  };
258
+ /**
259
+ * @deprecated use the new policy engine instead
260
+ */
177
261
  export type UpdatePolicyInput = {
178
262
  description?: string;
179
263
  controlIds?: EntityId[];
@@ -181,73 +265,125 @@ export type UpdatePolicyInput = {
181
265
  status?: PolicyStatus;
182
266
  filter?: PolicyObjectFilter;
183
267
  };
268
+ /**
269
+ * @deprecated use the new policy engine instead
270
+ */
184
271
  export type CreatePolicyControlInput = {
185
272
  description?: string;
186
273
  name?: string;
187
274
  configuration: CreatePolicyControlConfiguration;
188
275
  isImmutable?: boolean;
189
276
  };
277
+ /**
278
+ * @deprecated use the new policy engine instead
279
+ */
190
280
  export type UpdatePolicyControlInput = {
191
281
  description?: string;
192
282
  name?: string;
193
283
  configuration?: UpdatePolicyControlConfiguration;
194
284
  };
285
+ /**
286
+ * @deprecated use the new policy engine instead
287
+ */
195
288
  export type CreatePolicyRuleInput = {
196
289
  description?: string;
197
290
  name?: string;
198
291
  configuration: CreatePolicyRuleConfiguration;
199
292
  isImmutable?: boolean;
200
293
  };
294
+ /**
295
+ * @deprecated use the new policy engine instead
296
+ */
201
297
  export type UpdatePolicyRuleInput = {
202
298
  description?: string;
203
299
  name?: string;
204
300
  configuration: UpdatePolicyRuleConfiguration;
205
301
  };
302
+ /**
303
+ * @deprecated use the new policy engine instead
304
+ */
206
305
  export type CreatePolicyRuleConfiguration = CreateAmountLimitPrConf | CreateTransferLimitPrConf | CreateOutgoingVelocityPrConf | CreateAlwaysActivatedPrConf;
306
+ /**
307
+ * @deprecated use the new policy engine instead
308
+ */
207
309
  export type UpdatePolicyRuleConfiguration = UpdateAmountLimitPrConf | UpdateTransferLimitPrConf | UpdateOutgoingVelocityPrConf | UpdateAlwaysActivatedPrConf;
310
+ /**
311
+ * @deprecated use the new policy engine instead
312
+ */
208
313
  export type UpdatePolicyControlConfiguration = UpdateRequestApprovalPcConf | UpdateNotifyAndAuditPcConf;
314
+ /**
315
+ * @deprecated use the new policy engine instead
316
+ */
209
317
  export type CreatePolicyControlConfiguration = CreateRequestApprovalPcConf | CreateNotifyAndAuditPcConf;
318
+ /**
319
+ * @deprecated use the new policy engine instead
320
+ */
210
321
  export type PolicyRuleConfiguration = AmountLimitPrConf | TransferLimitPrConf | OutgoingVelocityPrConf | EmptyConfiguration;
322
+ /**
323
+ * @deprecated use the new policy engine instead
324
+ */
211
325
  export type PolicyControlConfiguration = NotifyAndAuditPcConf | RequestApprovalPcConf;
326
+ /**
327
+ * @deprecated use the new policy engine instead
328
+ */
212
329
  export type PolicyObjectFilter = AssetAccountFilter | PublicKeyFilter | WalletFilter;
330
+ /**
331
+ * @deprecated use the new policy engine instead
332
+ */
213
333
  export declare enum PolicyActivityKind {
214
334
  CreatingSignature = "CreatingSignature",
215
335
  TransactionInitiation = "TransactionInitiation",
216
336
  PaymentInitiation = "PaymentInitiation",
217
337
  WalletsTransferAsset = "WalletsTransferAsset"
218
338
  }
339
+ /**
340
+ * @deprecated use the new policy engine instead
341
+ */
219
342
  export declare enum PolicyStatus {
220
343
  Enabled = "Enabled",
221
344
  Disabled = "Disabled",
222
345
  Archived = "Archived"
223
346
  }
224
347
  /**
225
- * enumm:
226
- * * NotifyAndAudit
227
- * * RequestApproval
348
+ * @deprecated use the new policy engine instead
228
349
  */
229
350
  export declare enum PolicyControlKind {
230
351
  NotifyAndAudit = "NotifyAndAudit",
231
352
  RequestApproval = "RequestApproval"
232
353
  }
354
+ /**
355
+ * @deprecated use the new policy engine instead
356
+ */
233
357
  export declare enum PolicyRuleKind {
234
358
  AlwaysActivated = "AlwaysActivated",
235
359
  PaymentAmountLimit = "PaymentAmountLimit",
236
360
  PaymentAmountOutgoingVelocity = "PaymentAmountOutgoingVelocity",
237
361
  TransferAmountLimit = "TransferAmountLimit"
238
362
  }
363
+ /**
364
+ * @deprecated use the new policy engine instead
365
+ */
239
366
  export declare enum Currency {
240
367
  EUR = "EUR",
241
368
  USD = "USD"
242
369
  }
370
+ /**
371
+ * @deprecated use the new policy engine instead
372
+ */
243
373
  export declare enum PolicyControlStatus {
244
374
  Enabled = "Enabled",
245
375
  Archived = "Archived"
246
376
  }
377
+ /**
378
+ * @deprecated use the new policy engine instead
379
+ */
247
380
  export declare enum PolicyRuleStatus {
248
381
  Enabled = "Enabled",
249
382
  Archived = "Archived"
250
383
  }
384
+ /**
385
+ * @deprecated use the new policy engine instead
386
+ */
251
387
  export declare enum PolicyObjectFilterKind {
252
388
  AssetAccount = "AssetAccount",
253
389
  PublicKey = "PublicKey",
@@ -1,7 +1,9 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.PolicyObjectFilterKind = exports.PolicyRuleStatus = exports.PolicyControlStatus = exports.Currency = exports.PolicyRuleKind = exports.PolicyControlKind = exports.PolicyStatus = exports.PolicyActivityKind = void 0;
4
- // FIXME: Missing documentation for PolicyActivityKind
4
+ /**
5
+ * @deprecated use the new policy engine instead
6
+ */
5
7
  var PolicyActivityKind;
6
8
  (function (PolicyActivityKind) {
7
9
  // FIXME: Missing documentation for CreatingSignature
@@ -13,7 +15,9 @@ var PolicyActivityKind;
13
15
  // FIXME: Missing documentation for WalletsTransferAsset
14
16
  PolicyActivityKind["WalletsTransferAsset"] = "WalletsTransferAsset";
15
17
  })(PolicyActivityKind || (exports.PolicyActivityKind = PolicyActivityKind = {}));
16
- // FIXME: Missing documentation for PolicyStatus
18
+ /**
19
+ * @deprecated use the new policy engine instead
20
+ */
17
21
  var PolicyStatus;
18
22
  (function (PolicyStatus) {
19
23
  // FIXME: Missing documentation for Enabled
@@ -24,9 +28,7 @@ var PolicyStatus;
24
28
  PolicyStatus["Archived"] = "Archived";
25
29
  })(PolicyStatus || (exports.PolicyStatus = PolicyStatus = {}));
26
30
  /**
27
- * enumm:
28
- * * NotifyAndAudit
29
- * * RequestApproval
31
+ * @deprecated use the new policy engine instead
30
32
  */
31
33
  var PolicyControlKind;
32
34
  (function (PolicyControlKind) {
@@ -35,7 +37,9 @@ var PolicyControlKind;
35
37
  // FIXME: Missing documentation for RequestApproval
36
38
  PolicyControlKind["RequestApproval"] = "RequestApproval";
37
39
  })(PolicyControlKind || (exports.PolicyControlKind = PolicyControlKind = {}));
38
- // FIXME: Missing documentation for PolicyRuleKind
40
+ /**
41
+ * @deprecated use the new policy engine instead
42
+ */
39
43
  var PolicyRuleKind;
40
44
  (function (PolicyRuleKind) {
41
45
  // FIXME: Missing documentation for AlwaysActivated
@@ -47,7 +51,9 @@ var PolicyRuleKind;
47
51
  // FIXME: Missing documentation for TransferAmountLimit
48
52
  PolicyRuleKind["TransferAmountLimit"] = "TransferAmountLimit";
49
53
  })(PolicyRuleKind || (exports.PolicyRuleKind = PolicyRuleKind = {}));
50
- // FIXME: Missing documentation for Currency
54
+ /**
55
+ * @deprecated use the new policy engine instead
56
+ */
51
57
  var Currency;
52
58
  (function (Currency) {
53
59
  // FIXME: Missing documentation for EUR
@@ -55,7 +61,9 @@ var Currency;
55
61
  // FIXME: Missing documentation for USD
56
62
  Currency["USD"] = "USD";
57
63
  })(Currency || (exports.Currency = Currency = {}));
58
- // FIXME: Missing documentation for PolicyControlStatus
64
+ /**
65
+ * @deprecated use the new policy engine instead
66
+ */
59
67
  var PolicyControlStatus;
60
68
  (function (PolicyControlStatus) {
61
69
  // FIXME: Missing documentation for Enabled
@@ -63,7 +71,9 @@ var PolicyControlStatus;
63
71
  // FIXME: Missing documentation for Archived
64
72
  PolicyControlStatus["Archived"] = "Archived";
65
73
  })(PolicyControlStatus || (exports.PolicyControlStatus = PolicyControlStatus = {}));
66
- // FIXME: Missing documentation for PolicyRuleStatus
74
+ /**
75
+ * @deprecated use the new policy engine instead
76
+ */
67
77
  var PolicyRuleStatus;
68
78
  (function (PolicyRuleStatus) {
69
79
  // FIXME: Missing documentation for Enabled
@@ -71,7 +81,9 @@ var PolicyRuleStatus;
71
81
  // FIXME: Missing documentation for Archived
72
82
  PolicyRuleStatus["Archived"] = "Archived";
73
83
  })(PolicyRuleStatus || (exports.PolicyRuleStatus = PolicyRuleStatus = {}));
74
- // FIXME: Missing documentation for PolicyObjectFilterKind
84
+ /**
85
+ * @deprecated use the new policy engine instead
86
+ */
75
87
  var PolicyObjectFilterKind;
76
88
  (function (PolicyObjectFilterKind) {
77
89
  // FIXME: Missing documentation for AssetAccount
@@ -7,6 +7,7 @@ import { PermissionsClient } from './codegen/Permissions';
7
7
  import { PolicyExecutionClient } from './codegen/PolicyExecution';
8
8
  import { PolicyManagementClient } from './codegen/PolicyManagement';
9
9
  import { PublicKeysClient } from './codegen/PublicKeys';
10
+ import { PoliciesClient } from './generated/policies';
10
11
  import { SignersClient } from './generated/signers';
11
12
  import { WalletsClient } from './generated/wallets';
12
13
  import { WebhooksClient } from './generated/webhooks';
@@ -22,7 +23,14 @@ export declare class DfnsApiClient {
22
23
  get blockchains(): BlockchainsClient;
23
24
  get callbacks(): CallbacksClient;
24
25
  get permissions(): PermissionsClient;
26
+ get policies(): PoliciesClient;
27
+ /**
28
+ * @deprecated use the new policy engine instead
29
+ */
25
30
  get policyExecution(): PolicyExecutionClient;
31
+ /**
32
+ * @deprecated use the new policy engine instead
33
+ */
26
34
  get policyManagement(): PolicyManagementClient;
27
35
  get publicKeys(): PublicKeysClient;
28
36
  get wallets(): WalletsClient;
package/dfnsApiClient.js CHANGED
@@ -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 policies_1 = require("./generated/policies");
12
13
  const signers_1 = require("./generated/signers");
13
14
  const wallets_1 = require("./generated/wallets");
14
15
  const webhooks_1 = require("./generated/webhooks");
@@ -31,9 +32,18 @@ class DfnsApiClient {
31
32
  get permissions() {
32
33
  return new Permissions_1.PermissionsClient(this.apiOptions);
33
34
  }
35
+ get policies() {
36
+ return new policies_1.PoliciesClient(this.apiOptions);
37
+ }
38
+ /**
39
+ * @deprecated use the new policy engine instead
40
+ */
34
41
  get policyExecution() {
35
42
  return new PolicyExecution_1.PolicyExecutionClient(this.apiOptions);
36
43
  }
44
+ /**
45
+ * @deprecated use the new policy engine instead
46
+ */
37
47
  get policyManagement() {
38
48
  return new PolicyManagement_1.PolicyManagementClient(this.apiOptions);
39
49
  }
@@ -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 { DelegatedPoliciesClient } from './generated/policies';
10
11
  import { DelegatedSignersClient } from './generated/signers';
11
12
  import { DelegatedWalletsClient } from './generated/wallets';
12
13
  import { DelegatedWebhooksClient } from './generated/webhooks';
@@ -21,7 +22,14 @@ export declare class DfnsDelegatedApiClient {
21
22
  get blockchains(): DelegatedBlockchainsClient;
22
23
  get callbacks(): DelegatedCallbacksClient;
23
24
  get permissions(): DelegatedPermissionsClient;
25
+ get policies(): DelegatedPoliciesClient;
26
+ /**
27
+ * @deprecated use the new policy engine instead
28
+ */
24
29
  get policyExecution(): DelegatedPolicyExecutionClient;
30
+ /**
31
+ * @deprecated use the new policy engine instead
32
+ */
25
33
  get policyManagement(): DelegatedPolicyManagementClient;
26
34
  get publicKeys(): DelegatedPublicKeysClient;
27
35
  get wallets(): DelegatedWalletsClient;
@@ -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 policies_1 = require("./generated/policies");
12
13
  const signers_1 = require("./generated/signers");
13
14
  const wallets_1 = require("./generated/wallets");
14
15
  const webhooks_1 = require("./generated/webhooks");
@@ -31,9 +32,18 @@ class DfnsDelegatedApiClient {
31
32
  get permissions() {
32
33
  return new Permissions_1.DelegatedPermissionsClient(this.apiOptions);
33
34
  }
35
+ get policies() {
36
+ return new policies_1.DelegatedPoliciesClient(this.apiOptions);
37
+ }
38
+ /**
39
+ * @deprecated use the new policy engine instead
40
+ */
34
41
  get policyExecution() {
35
42
  return new PolicyExecution_1.DelegatedPolicyExecutionClient(this.apiOptions);
36
43
  }
44
+ /**
45
+ * @deprecated use the new policy engine instead
46
+ */
37
47
  get policyManagement() {
38
48
  return new PolicyManagement_1.DelegatedPolicyManagementClient(this.apiOptions);
39
49
  }
@@ -0,0 +1,13 @@
1
+ import { DfnsApiClientOptions } from '../../dfnsApiClient';
2
+ import * as T from './types';
3
+ export declare class PoliciesClient {
4
+ private apiOptions;
5
+ constructor(apiOptions: DfnsApiClientOptions);
6
+ archivePolicy(request: T.ArchivePolicyRequest): Promise<T.ArchivePolicyResponse>;
7
+ createApprovalDecision(request: T.CreateApprovalDecisionRequest): Promise<T.CreateApprovalDecisionResponse>;
8
+ createPolicy(request: T.CreatePolicyRequest): Promise<T.CreatePolicyResponse>;
9
+ getPolicy(request: T.GetPolicyRequest): Promise<T.GetPolicyResponse>;
10
+ listApprovals(request?: T.ListApprovalsRequest): Promise<T.ListApprovalsResponse>;
11
+ listPolicies(request?: T.ListPoliciesRequest): Promise<T.ListPoliciesResponse>;
12
+ updatePolicy(request: T.UpdatePolicyRequest): Promise<T.UpdatePolicyResponse>;
13
+ }
@@ -0,0 +1,92 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.PoliciesClient = void 0;
4
+ const fetch_1 = require("../../utils/fetch");
5
+ const url_1 = require("../../utils/url");
6
+ class PoliciesClient {
7
+ constructor(apiOptions) {
8
+ this.apiOptions = apiOptions;
9
+ }
10
+ async archivePolicy(request) {
11
+ const path = (0, url_1.buildPathAndQuery)('/v2/policies/:policyId', {
12
+ path: request ?? {},
13
+ query: {},
14
+ });
15
+ const response = await (0, fetch_1.userActionFetch)(path, {
16
+ method: 'DELETE',
17
+ body: {},
18
+ apiOptions: this.apiOptions,
19
+ });
20
+ return response.json();
21
+ }
22
+ async createApprovalDecision(request) {
23
+ const path = (0, url_1.buildPathAndQuery)('/v2/policy-approvals/:approvalId/decisions', {
24
+ path: request ?? {},
25
+ query: {},
26
+ });
27
+ const response = await (0, fetch_1.userActionFetch)(path, {
28
+ method: 'POST',
29
+ body: request.body,
30
+ apiOptions: this.apiOptions,
31
+ });
32
+ return response.json();
33
+ }
34
+ async createPolicy(request) {
35
+ const path = (0, url_1.buildPathAndQuery)('/v2/policies', {
36
+ path: request ?? {},
37
+ query: {},
38
+ });
39
+ const response = await (0, fetch_1.userActionFetch)(path, {
40
+ method: 'POST',
41
+ body: request.body,
42
+ apiOptions: this.apiOptions,
43
+ });
44
+ return response.json();
45
+ }
46
+ async getPolicy(request) {
47
+ const path = (0, url_1.buildPathAndQuery)('/v2/policies/:policyId', {
48
+ path: request ?? {},
49
+ query: {},
50
+ });
51
+ const response = await (0, fetch_1.simpleFetch)(path, {
52
+ method: 'GET',
53
+ apiOptions: this.apiOptions,
54
+ });
55
+ return response.json();
56
+ }
57
+ async listApprovals(request) {
58
+ const path = (0, url_1.buildPathAndQuery)('/v2/policy-approvals', {
59
+ path: request ?? {},
60
+ query: request?.query ?? {},
61
+ });
62
+ const response = await (0, fetch_1.simpleFetch)(path, {
63
+ method: 'GET',
64
+ apiOptions: this.apiOptions,
65
+ });
66
+ return response.json();
67
+ }
68
+ async listPolicies(request) {
69
+ const path = (0, url_1.buildPathAndQuery)('/v2/policies', {
70
+ path: request ?? {},
71
+ query: request?.query ?? {},
72
+ });
73
+ const response = await (0, fetch_1.simpleFetch)(path, {
74
+ method: 'GET',
75
+ apiOptions: this.apiOptions,
76
+ });
77
+ return response.json();
78
+ }
79
+ async updatePolicy(request) {
80
+ const path = (0, url_1.buildPathAndQuery)('/v2/policies/:policyId', {
81
+ path: request ?? {},
82
+ query: {},
83
+ });
84
+ const response = await (0, fetch_1.userActionFetch)(path, {
85
+ method: 'PUT',
86
+ body: request.body,
87
+ apiOptions: this.apiOptions,
88
+ });
89
+ return response.json();
90
+ }
91
+ }
92
+ exports.PoliciesClient = PoliciesClient;