@dfns/sdk 0.2.0 → 0.2.1

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.
@@ -0,0 +1,544 @@
1
+ export type ArchivePolicyParams = {
2
+ policyId: string;
3
+ };
4
+ export type ArchivePolicyResponse = {
5
+ id: string;
6
+ orgId: string;
7
+ requester: {
8
+ userId: string;
9
+ tokenId: string;
10
+ appId: string;
11
+ };
12
+ kind: "Policy";
13
+ operationKind: "Create" | "Update" | "Delete";
14
+ status: "Applied" | "Failed" | "Pending" | "Rejected";
15
+ entityId: string;
16
+ body: {
17
+ [x: string]: unknown;
18
+ };
19
+ dateCreated: Date;
20
+ dateResolved: Date;
21
+ };
22
+ export type ArchivePolicyRequest = ArchivePolicyParams;
23
+ export type CreateApprovalDecisionBody = {
24
+ value: "Approved" | "Denied";
25
+ reason?: string | undefined;
26
+ };
27
+ export type CreateApprovalDecisionResponse = {
28
+ id: string;
29
+ orgId: string;
30
+ initiatorId: string;
31
+ activityId: string;
32
+ activityKind: string;
33
+ activity: {
34
+ [x: string]: unknown;
35
+ };
36
+ status: "Pending" | "Approved" | "Denied" | "AutoApproved" | "Expired";
37
+ expirationDate?: string | undefined;
38
+ dateCreated?: string | undefined;
39
+ dateUpdated: string;
40
+ dateResolved?: string | undefined;
41
+ evaluatedPolicies: {
42
+ policyId: string;
43
+ triggerStatus: "Triggered" | "Skipped";
44
+ reason: string;
45
+ }[];
46
+ decisions: {
47
+ userId: string;
48
+ dateActioned: string;
49
+ reason: string | null;
50
+ value: "Approved" | "Denied";
51
+ }[];
52
+ };
53
+ export type CreateApprovalDecisionRequest = {
54
+ body: CreateApprovalDecisionBody;
55
+ };
56
+ export type CreatePolicyBody = {
57
+ name: string;
58
+ approvalGroups: {
59
+ name?: string | undefined;
60
+ quorum: number;
61
+ approvers?: {
62
+ [x: string]: {
63
+ [x: string]: string[];
64
+ };
65
+ } | undefined;
66
+ }[];
67
+ autoRejectTimeout?: number | undefined;
68
+ activityKind: "Permissions:Assign";
69
+ rule: {
70
+ kind: "AlwaysRequireApproval";
71
+ configuration: {};
72
+ };
73
+ filters?: {
74
+ [x: string]: {
75
+ [x: string]: string[];
76
+ };
77
+ } | undefined;
78
+ } | {
79
+ name: string;
80
+ approvalGroups: {
81
+ name?: string | undefined;
82
+ quorum: number;
83
+ approvers?: {
84
+ [x: string]: {
85
+ [x: string]: string[];
86
+ };
87
+ } | undefined;
88
+ }[];
89
+ autoRejectTimeout?: number | undefined;
90
+ activityKind: "Permissions:Modify";
91
+ rule: {
92
+ kind: "AlwaysRequireApproval";
93
+ configuration: {};
94
+ };
95
+ filters?: {
96
+ [x: string]: {
97
+ [x: string]: string[];
98
+ };
99
+ } | undefined;
100
+ } | {
101
+ name: string;
102
+ approvalGroups: {
103
+ name?: string | undefined;
104
+ quorum: number;
105
+ approvers?: {
106
+ [x: string]: {
107
+ [x: string]: string[];
108
+ };
109
+ } | undefined;
110
+ }[];
111
+ autoRejectTimeout?: number | undefined;
112
+ activityKind: "Policies:Modify";
113
+ rule: {
114
+ kind: "AlwaysRequireApproval";
115
+ configuration: {};
116
+ };
117
+ filters?: {
118
+ [x: string]: {
119
+ [x: string]: string[];
120
+ };
121
+ } | undefined;
122
+ } | {
123
+ name: string;
124
+ approvalGroups: {
125
+ name?: string | undefined;
126
+ quorum: number;
127
+ approvers?: {
128
+ [x: string]: {
129
+ [x: string]: string[];
130
+ };
131
+ } | undefined;
132
+ }[];
133
+ autoRejectTimeout?: number | undefined;
134
+ activityKind: "Wallets:Sign";
135
+ rule: {
136
+ kind: "AlwaysRequireApproval";
137
+ configuration: {};
138
+ } | {
139
+ kind: "AmountLimit";
140
+ configuration: {
141
+ limit: number;
142
+ currency: "EUR" | "USD";
143
+ };
144
+ };
145
+ filters?: {
146
+ [x: string]: {
147
+ [x: string]: string[];
148
+ };
149
+ } | undefined;
150
+ };
151
+ export type CreatePolicyResponse = {
152
+ id: string;
153
+ orgId: string;
154
+ requester: {
155
+ userId: string;
156
+ tokenId: string;
157
+ appId: string;
158
+ };
159
+ kind: "Policy";
160
+ operationKind: "Create" | "Update" | "Delete";
161
+ status: "Applied" | "Failed" | "Pending" | "Rejected";
162
+ entityId: string;
163
+ body: {
164
+ [x: string]: unknown;
165
+ };
166
+ dateCreated: Date;
167
+ dateResolved: Date;
168
+ };
169
+ export type CreatePolicyRequest = {
170
+ body: CreatePolicyBody;
171
+ };
172
+ export type GetPolicyParams = {
173
+ policyId: string;
174
+ };
175
+ export type GetPolicyResponse = ({
176
+ name: string;
177
+ approvalGroups: {
178
+ name?: string | undefined;
179
+ quorum: number;
180
+ approvers?: {
181
+ [x: string]: {
182
+ [x: string]: string[];
183
+ };
184
+ } | undefined;
185
+ }[];
186
+ autoRejectTimeout?: number | undefined;
187
+ activityKind: "Permissions:Assign";
188
+ rule: {
189
+ kind: "AlwaysRequireApproval";
190
+ configuration: {};
191
+ };
192
+ filters?: {
193
+ [x: string]: {
194
+ [x: string]: string[];
195
+ };
196
+ } | undefined;
197
+ } | {
198
+ name: string;
199
+ approvalGroups: {
200
+ name?: string | undefined;
201
+ quorum: number;
202
+ approvers?: {
203
+ [x: string]: {
204
+ [x: string]: string[];
205
+ };
206
+ } | undefined;
207
+ }[];
208
+ autoRejectTimeout?: number | undefined;
209
+ activityKind: "Permissions:Modify";
210
+ rule: {
211
+ kind: "AlwaysRequireApproval";
212
+ configuration: {};
213
+ };
214
+ filters?: {
215
+ [x: string]: {
216
+ [x: string]: string[];
217
+ };
218
+ } | undefined;
219
+ } | {
220
+ name: string;
221
+ approvalGroups: {
222
+ name?: string | undefined;
223
+ quorum: number;
224
+ approvers?: {
225
+ [x: string]: {
226
+ [x: string]: string[];
227
+ };
228
+ } | undefined;
229
+ }[];
230
+ autoRejectTimeout?: number | undefined;
231
+ activityKind: "Policies:Modify";
232
+ rule: {
233
+ kind: "AlwaysRequireApproval";
234
+ configuration: {};
235
+ };
236
+ filters?: {
237
+ [x: string]: {
238
+ [x: string]: string[];
239
+ };
240
+ } | undefined;
241
+ } | {
242
+ name: string;
243
+ approvalGroups: {
244
+ name?: string | undefined;
245
+ quorum: number;
246
+ approvers?: {
247
+ [x: string]: {
248
+ [x: string]: string[];
249
+ };
250
+ } | undefined;
251
+ }[];
252
+ autoRejectTimeout?: number | undefined;
253
+ activityKind: "Wallets:Sign";
254
+ rule: {
255
+ kind: "AlwaysRequireApproval";
256
+ configuration: {};
257
+ } | {
258
+ kind: "AmountLimit";
259
+ configuration: {
260
+ limit: number;
261
+ currency: "EUR" | "USD";
262
+ };
263
+ };
264
+ filters?: {
265
+ [x: string]: {
266
+ [x: string]: string[];
267
+ };
268
+ } | undefined;
269
+ }) & {
270
+ id: string;
271
+ status: "Active" | "Archived";
272
+ dateCreated?: string | undefined;
273
+ dateUpdated?: string | undefined;
274
+ };
275
+ export type GetPolicyRequest = GetPolicyParams;
276
+ export type ListApprovalsQuery = {
277
+ limit?: string | undefined;
278
+ paginationToken?: string | undefined;
279
+ status?: ("Pending" | "Approved" | "Denied" | "AutoApproved" | "Expired") | undefined;
280
+ triggerStatus?: ("Triggered" | "Skipped") | undefined;
281
+ initiatorId?: string | undefined;
282
+ approverId?: string | undefined;
283
+ };
284
+ export type ListApprovalsResponse = {
285
+ items: {
286
+ id: string;
287
+ orgId: string;
288
+ initiatorId: string;
289
+ activityId: string;
290
+ activityKind: string;
291
+ activity: {
292
+ [x: string]: unknown;
293
+ };
294
+ status: "Pending" | "Approved" | "Denied" | "AutoApproved" | "Expired";
295
+ expirationDate?: string | undefined;
296
+ dateCreated?: string | undefined;
297
+ dateUpdated: string;
298
+ dateResolved?: string | undefined;
299
+ evaluatedPolicies: {
300
+ policyId: string;
301
+ triggerStatus: "Triggered" | "Skipped";
302
+ reason: string;
303
+ }[];
304
+ decisions: {
305
+ userId: string;
306
+ dateActioned: string;
307
+ reason: string | null;
308
+ value: "Approved" | "Denied";
309
+ }[];
310
+ }[];
311
+ nextPageToken?: string | undefined;
312
+ };
313
+ export type ListApprovalsRequest = {
314
+ query?: ListApprovalsQuery;
315
+ };
316
+ export type ListPoliciesQuery = {
317
+ limit?: string | undefined;
318
+ paginationToken?: string | undefined;
319
+ };
320
+ export type ListPoliciesResponse = {
321
+ items: (({
322
+ name: string;
323
+ approvalGroups: {
324
+ name?: string | undefined;
325
+ quorum: number;
326
+ approvers?: {
327
+ [x: string]: {
328
+ [x: string]: string[];
329
+ };
330
+ } | undefined;
331
+ }[];
332
+ autoRejectTimeout?: number | undefined;
333
+ activityKind: "Permissions:Assign";
334
+ rule: {
335
+ kind: "AlwaysRequireApproval";
336
+ configuration: {};
337
+ };
338
+ filters?: {
339
+ [x: string]: {
340
+ [x: string]: string[];
341
+ };
342
+ } | undefined;
343
+ } | {
344
+ name: string;
345
+ approvalGroups: {
346
+ name?: string | undefined;
347
+ quorum: number;
348
+ approvers?: {
349
+ [x: string]: {
350
+ [x: string]: string[];
351
+ };
352
+ } | undefined;
353
+ }[];
354
+ autoRejectTimeout?: number | undefined;
355
+ activityKind: "Permissions:Modify";
356
+ rule: {
357
+ kind: "AlwaysRequireApproval";
358
+ configuration: {};
359
+ };
360
+ filters?: {
361
+ [x: string]: {
362
+ [x: string]: string[];
363
+ };
364
+ } | undefined;
365
+ } | {
366
+ name: string;
367
+ approvalGroups: {
368
+ name?: string | undefined;
369
+ quorum: number;
370
+ approvers?: {
371
+ [x: string]: {
372
+ [x: string]: string[];
373
+ };
374
+ } | undefined;
375
+ }[];
376
+ autoRejectTimeout?: number | undefined;
377
+ activityKind: "Policies:Modify";
378
+ rule: {
379
+ kind: "AlwaysRequireApproval";
380
+ configuration: {};
381
+ };
382
+ filters?: {
383
+ [x: string]: {
384
+ [x: string]: string[];
385
+ };
386
+ } | undefined;
387
+ } | {
388
+ name: string;
389
+ approvalGroups: {
390
+ name?: string | undefined;
391
+ quorum: number;
392
+ approvers?: {
393
+ [x: string]: {
394
+ [x: string]: string[];
395
+ };
396
+ } | undefined;
397
+ }[];
398
+ autoRejectTimeout?: number | undefined;
399
+ activityKind: "Wallets:Sign";
400
+ rule: {
401
+ kind: "AlwaysRequireApproval";
402
+ configuration: {};
403
+ } | {
404
+ kind: "AmountLimit";
405
+ configuration: {
406
+ limit: number;
407
+ currency: "EUR" | "USD";
408
+ };
409
+ };
410
+ filters?: {
411
+ [x: string]: {
412
+ [x: string]: string[];
413
+ };
414
+ } | undefined;
415
+ }) & {
416
+ id: string;
417
+ status: "Active" | "Archived";
418
+ dateCreated?: string | undefined;
419
+ dateUpdated?: string | undefined;
420
+ })[];
421
+ nextPageToken?: string | undefined;
422
+ };
423
+ export type ListPoliciesRequest = {
424
+ query?: ListPoliciesQuery;
425
+ };
426
+ export type UpdatePolicyBody = {
427
+ name: string;
428
+ approvalGroups: {
429
+ name?: string | undefined;
430
+ quorum: number;
431
+ approvers?: {
432
+ [x: string]: {
433
+ [x: string]: string[];
434
+ };
435
+ } | undefined;
436
+ }[];
437
+ autoRejectTimeout?: number | undefined;
438
+ activityKind: "Permissions:Assign";
439
+ rule: {
440
+ kind: "AlwaysRequireApproval";
441
+ configuration: {};
442
+ };
443
+ filters?: {
444
+ [x: string]: {
445
+ [x: string]: string[];
446
+ };
447
+ } | undefined;
448
+ } | {
449
+ name: string;
450
+ approvalGroups: {
451
+ name?: string | undefined;
452
+ quorum: number;
453
+ approvers?: {
454
+ [x: string]: {
455
+ [x: string]: string[];
456
+ };
457
+ } | undefined;
458
+ }[];
459
+ autoRejectTimeout?: number | undefined;
460
+ activityKind: "Permissions:Modify";
461
+ rule: {
462
+ kind: "AlwaysRequireApproval";
463
+ configuration: {};
464
+ };
465
+ filters?: {
466
+ [x: string]: {
467
+ [x: string]: string[];
468
+ };
469
+ } | undefined;
470
+ } | {
471
+ name: string;
472
+ approvalGroups: {
473
+ name?: string | undefined;
474
+ quorum: number;
475
+ approvers?: {
476
+ [x: string]: {
477
+ [x: string]: string[];
478
+ };
479
+ } | undefined;
480
+ }[];
481
+ autoRejectTimeout?: number | undefined;
482
+ activityKind: "Policies:Modify";
483
+ rule: {
484
+ kind: "AlwaysRequireApproval";
485
+ configuration: {};
486
+ };
487
+ filters?: {
488
+ [x: string]: {
489
+ [x: string]: string[];
490
+ };
491
+ } | undefined;
492
+ } | {
493
+ name: string;
494
+ approvalGroups: {
495
+ name?: string | undefined;
496
+ quorum: number;
497
+ approvers?: {
498
+ [x: string]: {
499
+ [x: string]: string[];
500
+ };
501
+ } | undefined;
502
+ }[];
503
+ autoRejectTimeout?: number | undefined;
504
+ activityKind: "Wallets:Sign";
505
+ rule: {
506
+ kind: "AlwaysRequireApproval";
507
+ configuration: {};
508
+ } | {
509
+ kind: "AmountLimit";
510
+ configuration: {
511
+ limit: number;
512
+ currency: "EUR" | "USD";
513
+ };
514
+ };
515
+ filters?: {
516
+ [x: string]: {
517
+ [x: string]: string[];
518
+ };
519
+ } | undefined;
520
+ };
521
+ export type UpdatePolicyParams = {
522
+ policyId: string;
523
+ };
524
+ export type UpdatePolicyResponse = {
525
+ id: string;
526
+ orgId: string;
527
+ requester: {
528
+ userId: string;
529
+ tokenId: string;
530
+ appId: string;
531
+ };
532
+ kind: "Policy";
533
+ operationKind: "Create" | "Update" | "Delete";
534
+ status: "Applied" | "Failed" | "Pending" | "Rejected";
535
+ entityId: string;
536
+ body: {
537
+ [x: string]: unknown;
538
+ };
539
+ dateCreated: Date;
540
+ dateResolved: Date;
541
+ };
542
+ export type UpdatePolicyRequest = UpdatePolicyParams & {
543
+ body: UpdatePolicyBody;
544
+ };
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });