@dfns/sdk 0.2.3 → 0.2.5

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.
@@ -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 { PermissionsClient as PermissionsV2Client } from './generated/permissions';
10
11
  import { PoliciesClient } from './generated/policies';
11
12
  import { SignersClient } from './generated/signers';
12
13
  import { WalletsClient } from './generated/wallets';
@@ -22,7 +23,11 @@ export declare class DfnsApiClient {
22
23
  get auth(): AuthClient;
23
24
  get blockchains(): BlockchainsClient;
24
25
  get callbacks(): CallbacksClient;
26
+ /**
27
+ * @deprecated use permissions v2 instead
28
+ */
25
29
  get permissions(): PermissionsClient;
30
+ get permissionsV2(): PermissionsV2Client;
26
31
  get policies(): PoliciesClient;
27
32
  /**
28
33
  * @deprecated use the new policy engine instead
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 permissions_1 = require("./generated/permissions");
12
13
  const policies_1 = require("./generated/policies");
13
14
  const signers_1 = require("./generated/signers");
14
15
  const wallets_1 = require("./generated/wallets");
@@ -29,9 +30,15 @@ class DfnsApiClient {
29
30
  get callbacks() {
30
31
  return new Callbacks_1.CallbacksClient(this.apiOptions);
31
32
  }
33
+ /**
34
+ * @deprecated use permissions v2 instead
35
+ */
32
36
  get permissions() {
33
37
  return new Permissions_1.PermissionsClient(this.apiOptions);
34
38
  }
39
+ get permissionsV2() {
40
+ return new permissions_1.PermissionsClient(this.apiOptions);
41
+ }
35
42
  get policies() {
36
43
  return new policies_1.PoliciesClient(this.apiOptions);
37
44
  }
@@ -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 { DelegatedPermissionsClient as DelegatedPermissionsV2Client } from './generated/permissions';
10
11
  import { DelegatedPoliciesClient } from './generated/policies';
11
12
  import { DelegatedSignersClient } from './generated/signers';
12
13
  import { DelegatedWalletsClient } from './generated/wallets';
@@ -21,7 +22,11 @@ export declare class DfnsDelegatedApiClient {
21
22
  get auth(): DelegatedAuthClient;
22
23
  get blockchains(): DelegatedBlockchainsClient;
23
24
  get callbacks(): DelegatedCallbacksClient;
25
+ /**
26
+ * @deprecated use permissions v2 instead
27
+ */
24
28
  get permissions(): DelegatedPermissionsClient;
29
+ get permissionsV2(): DelegatedPermissionsV2Client;
25
30
  get policies(): DelegatedPoliciesClient;
26
31
  /**
27
32
  * @deprecated use the new policy engine instead
@@ -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 permissions_1 = require("./generated/permissions");
12
13
  const policies_1 = require("./generated/policies");
13
14
  const signers_1 = require("./generated/signers");
14
15
  const wallets_1 = require("./generated/wallets");
@@ -29,9 +30,15 @@ class DfnsDelegatedApiClient {
29
30
  get callbacks() {
30
31
  return new Callbacks_1.DelegatedCallbacksClient(this.apiOptions);
31
32
  }
33
+ /**
34
+ * @deprecated use permissions v2 instead
35
+ */
32
36
  get permissions() {
33
37
  return new Permissions_1.DelegatedPermissionsClient(this.apiOptions);
34
38
  }
39
+ get permissionsV2() {
40
+ return new permissions_1.DelegatedPermissionsClient(this.apiOptions);
41
+ }
35
42
  get policies() {
36
43
  return new policies_1.DelegatedPoliciesClient(this.apiOptions);
37
44
  }
@@ -0,0 +1,14 @@
1
+ import { DfnsApiClientOptions } from '../../dfnsApiClient';
2
+ import * as T from './types';
3
+ export declare class PermissionsClient {
4
+ private apiOptions;
5
+ constructor(apiOptions: DfnsApiClientOptions);
6
+ archivePermission(request: T.ArchivePermissionRequest): Promise<T.ArchivePermissionResponse>;
7
+ createAssignment(request: T.CreateAssignmentRequest): Promise<T.CreateAssignmentResponse>;
8
+ createPermission(request: T.CreatePermissionRequest): Promise<T.CreatePermissionResponse>;
9
+ deleteAssignment(request: T.DeleteAssignmentRequest): Promise<T.DeleteAssignmentResponse>;
10
+ getPermission(request: T.GetPermissionRequest): Promise<T.GetPermissionResponse>;
11
+ listAssignments(request: T.ListAssignmentsRequest): Promise<T.ListAssignmentsResponse>;
12
+ listPermissions(request?: T.ListPermissionsRequest): Promise<T.ListPermissionsResponse>;
13
+ updatePermission(request: T.UpdatePermissionRequest): Promise<T.UpdatePermissionResponse>;
14
+ }
@@ -0,0 +1,104 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.PermissionsClient = void 0;
4
+ const fetch_1 = require("../../utils/fetch");
5
+ const url_1 = require("../../utils/url");
6
+ class PermissionsClient {
7
+ constructor(apiOptions) {
8
+ this.apiOptions = apiOptions;
9
+ }
10
+ async archivePermission(request) {
11
+ const path = (0, url_1.buildPathAndQuery)('/v2/permissions/:permissionId/archive', {
12
+ path: request ?? {},
13
+ query: {},
14
+ });
15
+ const response = await (0, fetch_1.userActionFetch)(path, {
16
+ method: 'PUT',
17
+ body: request.body,
18
+ apiOptions: this.apiOptions,
19
+ });
20
+ return response.json();
21
+ }
22
+ async createAssignment(request) {
23
+ const path = (0, url_1.buildPathAndQuery)('/v2/permissions/:permissionId/assignments', {
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 createPermission(request) {
35
+ const path = (0, url_1.buildPathAndQuery)('/v2/permissions', {
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 deleteAssignment(request) {
47
+ const path = (0, url_1.buildPathAndQuery)('/v2/permissions/:permissionId/assignments/:assignmentId', {
48
+ path: request ?? {},
49
+ query: {},
50
+ });
51
+ const response = await (0, fetch_1.userActionFetch)(path, {
52
+ method: 'DELETE',
53
+ body: {},
54
+ apiOptions: this.apiOptions,
55
+ });
56
+ return response.json();
57
+ }
58
+ async getPermission(request) {
59
+ const path = (0, url_1.buildPathAndQuery)('/v2/permissions/:permissionId', {
60
+ path: request ?? {},
61
+ query: {},
62
+ });
63
+ const response = await (0, fetch_1.simpleFetch)(path, {
64
+ method: 'GET',
65
+ apiOptions: this.apiOptions,
66
+ });
67
+ return response.json();
68
+ }
69
+ async listAssignments(request) {
70
+ const path = (0, url_1.buildPathAndQuery)('/v2/permissions/:permissionId/assignments', {
71
+ path: request ?? {},
72
+ query: {},
73
+ });
74
+ const response = await (0, fetch_1.simpleFetch)(path, {
75
+ method: 'GET',
76
+ apiOptions: this.apiOptions,
77
+ });
78
+ return response.json();
79
+ }
80
+ async listPermissions(request) {
81
+ const path = (0, url_1.buildPathAndQuery)('/v2/permissions', {
82
+ path: request ?? {},
83
+ query: request?.query ?? {},
84
+ });
85
+ const response = await (0, fetch_1.simpleFetch)(path, {
86
+ method: 'GET',
87
+ apiOptions: this.apiOptions,
88
+ });
89
+ return response.json();
90
+ }
91
+ async updatePermission(request) {
92
+ const path = (0, url_1.buildPathAndQuery)('/v2/permissions/:permissionId', {
93
+ path: request ?? {},
94
+ query: {},
95
+ });
96
+ const response = await (0, fetch_1.userActionFetch)(path, {
97
+ method: 'PUT',
98
+ body: request.body,
99
+ apiOptions: this.apiOptions,
100
+ });
101
+ return response.json();
102
+ }
103
+ }
104
+ exports.PermissionsClient = PermissionsClient;
@@ -0,0 +1,20 @@
1
+ import { SignUserActionChallengeRequest, UserActionChallengeResponse } from '../../baseAuthApi';
2
+ import { DfnsDelegatedApiClientOptions } from '../../dfnsDelegatedApiClient';
3
+ import * as T from './types';
4
+ export declare class DelegatedPermissionsClient {
5
+ private apiOptions;
6
+ constructor(apiOptions: DfnsDelegatedApiClientOptions);
7
+ archivePermissionInit(request: T.ArchivePermissionRequest): Promise<UserActionChallengeResponse>;
8
+ archivePermissionComplete(request: T.ArchivePermissionRequest, signedChallenge: SignUserActionChallengeRequest): Promise<T.ArchivePermissionResponse>;
9
+ createAssignmentInit(request: T.CreateAssignmentRequest): Promise<UserActionChallengeResponse>;
10
+ createAssignmentComplete(request: T.CreateAssignmentRequest, signedChallenge: SignUserActionChallengeRequest): Promise<T.CreateAssignmentResponse>;
11
+ createPermissionInit(request: T.CreatePermissionRequest): Promise<UserActionChallengeResponse>;
12
+ createPermissionComplete(request: T.CreatePermissionRequest, signedChallenge: SignUserActionChallengeRequest): Promise<T.CreatePermissionResponse>;
13
+ deleteAssignmentInit(request: T.DeleteAssignmentRequest): Promise<UserActionChallengeResponse>;
14
+ deleteAssignmentComplete(request: T.DeleteAssignmentRequest, signedChallenge: SignUserActionChallengeRequest): Promise<T.DeleteAssignmentResponse>;
15
+ getPermission(request: T.GetPermissionRequest): Promise<T.GetPermissionResponse>;
16
+ listAssignments(request: T.ListAssignmentsRequest): Promise<T.ListAssignmentsResponse>;
17
+ listPermissions(request?: T.ListPermissionsRequest): Promise<T.ListPermissionsResponse>;
18
+ updatePermissionInit(request: T.UpdatePermissionRequest): Promise<UserActionChallengeResponse>;
19
+ updatePermissionComplete(request: T.UpdatePermissionRequest, signedChallenge: SignUserActionChallengeRequest): Promise<T.UpdatePermissionResponse>;
20
+ }
@@ -0,0 +1,180 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.DelegatedPermissionsClient = void 0;
4
+ const baseAuthApi_1 = require("../../baseAuthApi");
5
+ const fetch_1 = require("../../utils/fetch");
6
+ const url_1 = require("../../utils/url");
7
+ class DelegatedPermissionsClient {
8
+ constructor(apiOptions) {
9
+ this.apiOptions = apiOptions;
10
+ }
11
+ async archivePermissionInit(request) {
12
+ const path = (0, url_1.buildPathAndQuery)('/v2/permissions/:permissionId/archive', {
13
+ path: request ?? {},
14
+ query: {},
15
+ });
16
+ const challenge = await baseAuthApi_1.BaseAuthApi.createUserActionChallenge({
17
+ userActionHttpMethod: 'PUT',
18
+ userActionHttpPath: path,
19
+ userActionPayload: JSON.stringify(request.body),
20
+ userActionServerKind: 'Api',
21
+ }, this.apiOptions);
22
+ return challenge;
23
+ }
24
+ async archivePermissionComplete(request, signedChallenge) {
25
+ const path = (0, url_1.buildPathAndQuery)('/v2/permissions/:permissionId/archive', {
26
+ path: request ?? {},
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: 'PUT',
32
+ body: request.body,
33
+ headers: { 'x-dfns-useraction': userAction },
34
+ apiOptions: this.apiOptions,
35
+ });
36
+ return response.json();
37
+ }
38
+ async createAssignmentInit(request) {
39
+ const path = (0, url_1.buildPathAndQuery)('/v2/permissions/:permissionId/assignments', {
40
+ path: request ?? {},
41
+ query: {},
42
+ });
43
+ const challenge = await baseAuthApi_1.BaseAuthApi.createUserActionChallenge({
44
+ userActionHttpMethod: 'POST',
45
+ userActionHttpPath: path,
46
+ userActionPayload: JSON.stringify(request.body),
47
+ userActionServerKind: 'Api',
48
+ }, this.apiOptions);
49
+ return challenge;
50
+ }
51
+ async createAssignmentComplete(request, signedChallenge) {
52
+ const path = (0, url_1.buildPathAndQuery)('/v2/permissions/:permissionId/assignments', {
53
+ path: request ?? {},
54
+ query: {},
55
+ });
56
+ const { userAction } = await baseAuthApi_1.BaseAuthApi.signUserActionChallenge(signedChallenge, this.apiOptions);
57
+ const response = await (0, fetch_1.simpleFetch)(path, {
58
+ method: 'POST',
59
+ body: request.body,
60
+ headers: { 'x-dfns-useraction': userAction },
61
+ apiOptions: this.apiOptions,
62
+ });
63
+ return response.json();
64
+ }
65
+ async createPermissionInit(request) {
66
+ const path = (0, url_1.buildPathAndQuery)('/v2/permissions', {
67
+ path: request ?? {},
68
+ query: {},
69
+ });
70
+ const challenge = await baseAuthApi_1.BaseAuthApi.createUserActionChallenge({
71
+ userActionHttpMethod: 'POST',
72
+ userActionHttpPath: path,
73
+ userActionPayload: JSON.stringify(request.body),
74
+ userActionServerKind: 'Api',
75
+ }, this.apiOptions);
76
+ return challenge;
77
+ }
78
+ async createPermissionComplete(request, signedChallenge) {
79
+ const path = (0, url_1.buildPathAndQuery)('/v2/permissions', {
80
+ path: request ?? {},
81
+ query: {},
82
+ });
83
+ const { userAction } = await baseAuthApi_1.BaseAuthApi.signUserActionChallenge(signedChallenge, this.apiOptions);
84
+ const response = await (0, fetch_1.simpleFetch)(path, {
85
+ method: 'POST',
86
+ body: request.body,
87
+ headers: { 'x-dfns-useraction': userAction },
88
+ apiOptions: this.apiOptions,
89
+ });
90
+ return response.json();
91
+ }
92
+ async deleteAssignmentInit(request) {
93
+ const path = (0, url_1.buildPathAndQuery)('/v2/permissions/:permissionId/assignments/:assignmentId', {
94
+ path: request ?? {},
95
+ query: {},
96
+ });
97
+ const challenge = await baseAuthApi_1.BaseAuthApi.createUserActionChallenge({
98
+ userActionHttpMethod: 'DELETE',
99
+ userActionHttpPath: path,
100
+ userActionPayload: JSON.stringify({}),
101
+ userActionServerKind: 'Api',
102
+ }, this.apiOptions);
103
+ return challenge;
104
+ }
105
+ async deleteAssignmentComplete(request, signedChallenge) {
106
+ const path = (0, url_1.buildPathAndQuery)('/v2/permissions/:permissionId/assignments/:assignmentId', {
107
+ path: request ?? {},
108
+ query: {},
109
+ });
110
+ const { userAction } = await baseAuthApi_1.BaseAuthApi.signUserActionChallenge(signedChallenge, this.apiOptions);
111
+ const response = await (0, fetch_1.simpleFetch)(path, {
112
+ method: 'DELETE',
113
+ body: {},
114
+ headers: { 'x-dfns-useraction': userAction },
115
+ apiOptions: this.apiOptions,
116
+ });
117
+ return response.json();
118
+ }
119
+ async getPermission(request) {
120
+ const path = (0, url_1.buildPathAndQuery)('/v2/permissions/:permissionId', {
121
+ path: request ?? {},
122
+ query: {},
123
+ });
124
+ const response = await (0, fetch_1.simpleFetch)(path, {
125
+ method: 'GET',
126
+ apiOptions: this.apiOptions,
127
+ });
128
+ return response.json();
129
+ }
130
+ async listAssignments(request) {
131
+ const path = (0, url_1.buildPathAndQuery)('/v2/permissions/:permissionId/assignments', {
132
+ path: request ?? {},
133
+ query: {},
134
+ });
135
+ const response = await (0, fetch_1.simpleFetch)(path, {
136
+ method: 'GET',
137
+ apiOptions: this.apiOptions,
138
+ });
139
+ return response.json();
140
+ }
141
+ async listPermissions(request) {
142
+ const path = (0, url_1.buildPathAndQuery)('/v2/permissions', {
143
+ path: request ?? {},
144
+ query: request?.query ?? {},
145
+ });
146
+ const response = await (0, fetch_1.simpleFetch)(path, {
147
+ method: 'GET',
148
+ apiOptions: this.apiOptions,
149
+ });
150
+ return response.json();
151
+ }
152
+ async updatePermissionInit(request) {
153
+ const path = (0, url_1.buildPathAndQuery)('/v2/permissions/:permissionId', {
154
+ path: request ?? {},
155
+ query: {},
156
+ });
157
+ const challenge = await baseAuthApi_1.BaseAuthApi.createUserActionChallenge({
158
+ userActionHttpMethod: 'PUT',
159
+ userActionHttpPath: path,
160
+ userActionPayload: JSON.stringify(request.body),
161
+ userActionServerKind: 'Api',
162
+ }, this.apiOptions);
163
+ return challenge;
164
+ }
165
+ async updatePermissionComplete(request, signedChallenge) {
166
+ const path = (0, url_1.buildPathAndQuery)('/v2/permissions/:permissionId', {
167
+ path: request ?? {},
168
+ query: {},
169
+ });
170
+ const { userAction } = await baseAuthApi_1.BaseAuthApi.signUserActionChallenge(signedChallenge, this.apiOptions);
171
+ const response = await (0, fetch_1.simpleFetch)(path, {
172
+ method: 'PUT',
173
+ body: request.body,
174
+ headers: { 'x-dfns-useraction': userAction },
175
+ apiOptions: this.apiOptions,
176
+ });
177
+ return response.json();
178
+ }
179
+ }
180
+ exports.DelegatedPermissionsClient = DelegatedPermissionsClient;
@@ -0,0 +1,3 @@
1
+ export * from './types';
2
+ export * from './client';
3
+ export * from './delegatedClient';
@@ -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("./types"), exports);
18
+ __exportStar(require("./client"), exports);
19
+ __exportStar(require("./delegatedClient"), exports);
@@ -0,0 +1,225 @@
1
+ export type ArchivePermissionBody = {
2
+ isArchived: boolean;
3
+ };
4
+ export type ArchivePermissionParams = {
5
+ permissionId: string;
6
+ };
7
+ export type ArchivePermissionResponse = {
8
+ id: string;
9
+ orgId: string;
10
+ requester: {
11
+ userId: string;
12
+ tokenId: string;
13
+ appId: string;
14
+ };
15
+ kind: "Assignment" | "Permission";
16
+ operationKind: "Create" | "Update" | "Delete";
17
+ status: "Applied" | "Failed" | "Pending" | "Rejected";
18
+ entityId: string;
19
+ dateCreated: Date;
20
+ dateResolved: Date;
21
+ body: {
22
+ id: string;
23
+ orgId: string;
24
+ name: string;
25
+ operations: string[];
26
+ resourceId?: (string | undefined) | null;
27
+ status: "Active";
28
+ predicateIds?: string[] | undefined;
29
+ isImmutable: boolean;
30
+ dateCreated?: string | undefined;
31
+ dateUpdated?: string | undefined;
32
+ isArchived: boolean;
33
+ };
34
+ };
35
+ export type ArchivePermissionRequest = ArchivePermissionParams & {
36
+ body: ArchivePermissionBody;
37
+ };
38
+ export type CreateAssignmentBody = {
39
+ identityId: string;
40
+ };
41
+ export type CreateAssignmentParams = {
42
+ permissionId: string;
43
+ };
44
+ export type CreateAssignmentResponse = {
45
+ id: string;
46
+ orgId: string;
47
+ requester: {
48
+ userId: string;
49
+ tokenId: string;
50
+ appId: string;
51
+ };
52
+ kind: "Assignment" | "Permission";
53
+ operationKind: "Create" | "Update" | "Delete";
54
+ status: "Applied" | "Failed" | "Pending" | "Rejected";
55
+ entityId: string;
56
+ dateCreated: Date;
57
+ dateResolved: Date;
58
+ body: {
59
+ id: string;
60
+ permissionId: string;
61
+ identityId: string;
62
+ isImmutable: boolean;
63
+ dateCreated?: string | undefined;
64
+ dateUpdated?: string | undefined;
65
+ };
66
+ };
67
+ export type CreateAssignmentRequest = CreateAssignmentParams & {
68
+ body: CreateAssignmentBody;
69
+ };
70
+ export type CreatePermissionBody = {
71
+ name: string;
72
+ operations: ("ApiKeys:Create" | "ApiKeys:Read" | "ApiKeys:Revoke" | "AssetAccounts:Archive" | "AssetAccounts:Create" | "AssetAccounts:Read" | "Auth:Action:Sign" | "Auth:Apps:Create" | "Auth:Apps:Read" | "Auth:Apps:Update" | "Auth:Creds:Create" | "Auth:Creds:Read" | "Auth:Creds:Update" | "Auth:Types:Application" | "Auth:Types:Employee" | "Auth:Types:EndUser" | "Auth:Types:Pat" | "Auth:Types:ServiceAccount" | "Auth:Users:Create" | "Auth:Users:Delegate" | "Auth:Users:Read" | "Auth:Users:Update" | "Balances:Read" | "CallbackEvents:Read" | "CallbackSubscriptions:Archive" | "CallbackSubscriptions:Create" | "CallbackSubscriptions:Read" | "Employees:Read" | "Payments:Create" | "Payments:Read" | "PermissionAssignments" | "PermissionAssignments:Create" | "PermissionAssignments:Read" | "PermissionAssignments:Revoke" | "PermissionPredicates" | "PermissionPredicates:Archive" | "PermissionPredicates:Create" | "PermissionPredicates:Read" | "PermissionPredicates:Update" | "Permissions:Archive" | "Permissions:Create" | "Permissions:Read" | "Permissions:Update" | "Policies:Archive" | "Policies:Create" | "Policies:Read" | "Policies:Update" | "Policies:Approvals:Read" | "Policies:Approvals:Approve" | "PolicyControlExecutions:Read" | "PolicyControlExecutions:Update" | "PolicyControls:Archive" | "PolicyControls:Create" | "PolicyControls:Read" | "PolicyControls:Update" | "PolicyRules:Archive" | "PolicyRules:Create" | "PolicyRules:Read" | "PolicyRules:Update" | "PublicKeyAddresses:Read" | "PublicKeys:Create" | "PublicKeys:Read" | "Signatures:Create" | "Signatures:Read" | "Signers:ListSigners" | "Transactions:Create" | "Transactions:Read" | "Wallets:BroadcastTransaction" | "Wallets:Create" | "Wallets:Delegate" | "Wallets:Export" | "Wallets:GenerateSignature" | "Wallets:Import" | "Wallets:Read" | "Wallets:ReadSignature" | "Wallets:ReadTransaction" | "Wallets:ReadTransfer" | "Wallets:TransferAsset" | "Wallets:Update" | "Webhooks:Create" | "Webhooks:Read" | "Webhooks:Update" | "Webhooks:Delete" | "Webhooks:Ping" | "Webhooks:Events:Read")[];
73
+ };
74
+ export type CreatePermissionResponse = {
75
+ id: string;
76
+ orgId: string;
77
+ requester: {
78
+ userId: string;
79
+ tokenId: string;
80
+ appId: string;
81
+ };
82
+ kind: "Assignment" | "Permission";
83
+ operationKind: "Create" | "Update" | "Delete";
84
+ status: "Applied" | "Failed" | "Pending" | "Rejected";
85
+ entityId: string;
86
+ dateCreated: Date;
87
+ dateResolved: Date;
88
+ body: {
89
+ id: string;
90
+ orgId: string;
91
+ name: string;
92
+ operations: string[];
93
+ resourceId?: (string | undefined) | null;
94
+ status: "Active";
95
+ predicateIds?: string[] | undefined;
96
+ isImmutable: boolean;
97
+ dateCreated?: string | undefined;
98
+ dateUpdated?: string | undefined;
99
+ isArchived: boolean;
100
+ };
101
+ };
102
+ export type CreatePermissionRequest = {
103
+ body: CreatePermissionBody;
104
+ };
105
+ export type DeleteAssignmentParams = {
106
+ permissionId: string;
107
+ assignmentId: string;
108
+ };
109
+ export type DeleteAssignmentResponse = {
110
+ id: string;
111
+ orgId: string;
112
+ requester: {
113
+ userId: string;
114
+ tokenId: string;
115
+ appId: string;
116
+ };
117
+ kind: "Assignment" | "Permission";
118
+ operationKind: "Create" | "Update" | "Delete";
119
+ status: "Applied" | "Failed" | "Pending" | "Rejected";
120
+ entityId: string;
121
+ dateCreated: Date;
122
+ dateResolved: Date;
123
+ body: {
124
+ id: string;
125
+ permissionId: string;
126
+ identityId: string;
127
+ isImmutable: boolean;
128
+ dateCreated?: string | undefined;
129
+ dateUpdated?: string | undefined;
130
+ };
131
+ };
132
+ export type DeleteAssignmentRequest = DeleteAssignmentParams;
133
+ export type GetPermissionParams = {
134
+ permissionId: string;
135
+ };
136
+ export type GetPermissionResponse = {
137
+ id: string;
138
+ orgId: string;
139
+ name: string;
140
+ operations: string[];
141
+ resourceId?: (string | undefined) | null;
142
+ status: "Active";
143
+ predicateIds?: string[] | undefined;
144
+ isImmutable: boolean;
145
+ dateCreated?: string | undefined;
146
+ dateUpdated?: string | undefined;
147
+ isArchived: boolean;
148
+ };
149
+ export type GetPermissionRequest = GetPermissionParams;
150
+ export type ListAssignmentsParams = {
151
+ permissionId: string;
152
+ };
153
+ export type ListAssignmentsResponse = {
154
+ items: {
155
+ id: string;
156
+ permissionId: string;
157
+ identityId: string;
158
+ isImmutable: boolean;
159
+ dateCreated?: string | undefined;
160
+ dateUpdated?: string | undefined;
161
+ }[];
162
+ nextPageToken?: string | undefined;
163
+ };
164
+ export type ListAssignmentsRequest = ListAssignmentsParams;
165
+ export type ListPermissionsQuery = {
166
+ limit?: string | undefined;
167
+ paginationToken?: string | undefined;
168
+ };
169
+ export type ListPermissionsResponse = {
170
+ items: {
171
+ id: string;
172
+ orgId: string;
173
+ name: string;
174
+ operations: string[];
175
+ resourceId?: (string | undefined) | null;
176
+ status: "Active";
177
+ predicateIds?: string[] | undefined;
178
+ isImmutable: boolean;
179
+ dateCreated?: string | undefined;
180
+ dateUpdated?: string | undefined;
181
+ isArchived: boolean;
182
+ }[];
183
+ nextPageToken?: string | undefined;
184
+ };
185
+ export type ListPermissionsRequest = {
186
+ query?: ListPermissionsQuery;
187
+ };
188
+ export type UpdatePermissionBody = {
189
+ name?: string | undefined;
190
+ operations?: ("ApiKeys:Create" | "ApiKeys:Read" | "ApiKeys:Revoke" | "AssetAccounts:Archive" | "AssetAccounts:Create" | "AssetAccounts:Read" | "Auth:Action:Sign" | "Auth:Apps:Create" | "Auth:Apps:Read" | "Auth:Apps:Update" | "Auth:Creds:Create" | "Auth:Creds:Read" | "Auth:Creds:Update" | "Auth:Types:Application" | "Auth:Types:Employee" | "Auth:Types:EndUser" | "Auth:Types:Pat" | "Auth:Types:ServiceAccount" | "Auth:Users:Create" | "Auth:Users:Delegate" | "Auth:Users:Read" | "Auth:Users:Update" | "Balances:Read" | "CallbackEvents:Read" | "CallbackSubscriptions:Archive" | "CallbackSubscriptions:Create" | "CallbackSubscriptions:Read" | "Employees:Read" | "Payments:Create" | "Payments:Read" | "PermissionAssignments" | "PermissionAssignments:Create" | "PermissionAssignments:Read" | "PermissionAssignments:Revoke" | "PermissionPredicates" | "PermissionPredicates:Archive" | "PermissionPredicates:Create" | "PermissionPredicates:Read" | "PermissionPredicates:Update" | "Permissions:Archive" | "Permissions:Create" | "Permissions:Read" | "Permissions:Update" | "Policies:Archive" | "Policies:Create" | "Policies:Read" | "Policies:Update" | "Policies:Approvals:Read" | "Policies:Approvals:Approve" | "PolicyControlExecutions:Read" | "PolicyControlExecutions:Update" | "PolicyControls:Archive" | "PolicyControls:Create" | "PolicyControls:Read" | "PolicyControls:Update" | "PolicyRules:Archive" | "PolicyRules:Create" | "PolicyRules:Read" | "PolicyRules:Update" | "PublicKeyAddresses:Read" | "PublicKeys:Create" | "PublicKeys:Read" | "Signatures:Create" | "Signatures:Read" | "Signers:ListSigners" | "Transactions:Create" | "Transactions:Read" | "Wallets:BroadcastTransaction" | "Wallets:Create" | "Wallets:Delegate" | "Wallets:Export" | "Wallets:GenerateSignature" | "Wallets:Import" | "Wallets:Read" | "Wallets:ReadSignature" | "Wallets:ReadTransaction" | "Wallets:ReadTransfer" | "Wallets:TransferAsset" | "Wallets:Update" | "Webhooks:Create" | "Webhooks:Read" | "Webhooks:Update" | "Webhooks:Delete" | "Webhooks:Ping" | "Webhooks:Events:Read")[] | undefined;
191
+ };
192
+ export type UpdatePermissionParams = {
193
+ permissionId: string;
194
+ };
195
+ export type UpdatePermissionResponse = {
196
+ id: string;
197
+ orgId: string;
198
+ requester: {
199
+ userId: string;
200
+ tokenId: string;
201
+ appId: string;
202
+ };
203
+ kind: "Assignment" | "Permission";
204
+ operationKind: "Create" | "Update" | "Delete";
205
+ status: "Applied" | "Failed" | "Pending" | "Rejected";
206
+ entityId: string;
207
+ dateCreated: Date;
208
+ dateResolved: Date;
209
+ body: {
210
+ id: string;
211
+ orgId: string;
212
+ name: string;
213
+ operations: string[];
214
+ resourceId?: (string | undefined) | null;
215
+ status: "Active";
216
+ predicateIds?: string[] | undefined;
217
+ isImmutable: boolean;
218
+ dateCreated?: string | undefined;
219
+ dateUpdated?: string | undefined;
220
+ isArchived: boolean;
221
+ };
222
+ };
223
+ export type UpdatePermissionRequest = UpdatePermissionParams & {
224
+ body: UpdatePermissionBody;
225
+ };
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });