@dynamic-labs/sdk-api 0.0.845 → 0.0.847

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dynamic-labs/sdk-api",
3
- "version": "0.0.845",
3
+ "version": "0.0.847",
4
4
  "author": "Dynamic Labs",
5
5
  "license": "Apache-2.0",
6
6
  "publishConfig": {
@@ -102,6 +102,44 @@ require('../models/WalletTransactionType.cjs');
102
102
  *
103
103
  */
104
104
  class SessionsApi extends runtime.BaseAPI {
105
+ /**
106
+ * Get a session by ID
107
+ */
108
+ getSessionByIdRaw(requestParameters, initOverrides) {
109
+ return _tslib.__awaiter(this, void 0, void 0, function* () {
110
+ if (requestParameters.userId === null || requestParameters.userId === undefined) {
111
+ throw new runtime.RequiredError('userId', 'Required parameter requestParameters.userId was null or undefined when calling getSessionById.');
112
+ }
113
+ if (requestParameters.sessionId === null || requestParameters.sessionId === undefined) {
114
+ throw new runtime.RequiredError('sessionId', 'Required parameter requestParameters.sessionId was null or undefined when calling getSessionById.');
115
+ }
116
+ const queryParameters = {};
117
+ const headerParameters = {};
118
+ if (this.configuration && this.configuration.accessToken) {
119
+ const token = this.configuration.accessToken;
120
+ const tokenString = yield token("bearerAuth", []);
121
+ if (tokenString) {
122
+ headerParameters["Authorization"] = `Bearer ${tokenString}`;
123
+ }
124
+ }
125
+ const response = yield this.request({
126
+ path: `/users/{userId}/sessions/{sessionId}`.replace(`{${"userId"}}`, encodeURIComponent(String(requestParameters.userId))).replace(`{${"sessionId"}}`, encodeURIComponent(String(requestParameters.sessionId))),
127
+ method: 'GET',
128
+ headers: headerParameters,
129
+ query: queryParameters,
130
+ }, initOverrides);
131
+ return new runtime.JSONApiResponse(response, (jsonValue) => Session.SessionFromJSON(jsonValue));
132
+ });
133
+ }
134
+ /**
135
+ * Get a session by ID
136
+ */
137
+ getSessionById(requestParameters, initOverrides) {
138
+ return _tslib.__awaiter(this, void 0, void 0, function* () {
139
+ const response = yield this.getSessionByIdRaw(requestParameters, initOverrides);
140
+ return yield response.value();
141
+ });
142
+ }
105
143
  /**
106
144
  * Revoke a session
107
145
  */
@@ -11,6 +11,10 @@
11
11
  */
12
12
  import * as runtime from '../runtime';
13
13
  import { Session } from '../models';
14
+ export interface GetSessionByIdRequest {
15
+ userId: string;
16
+ sessionId: string;
17
+ }
14
18
  export interface RevokeSessionByIdRequest {
15
19
  sessionId: string;
16
20
  }
@@ -18,6 +22,14 @@ export interface RevokeSessionByIdRequest {
18
22
  *
19
23
  */
20
24
  export declare class SessionsApi extends runtime.BaseAPI {
25
+ /**
26
+ * Get a session by ID
27
+ */
28
+ getSessionByIdRaw(requestParameters: GetSessionByIdRequest, initOverrides?: RequestInit): Promise<runtime.ApiResponse<Session>>;
29
+ /**
30
+ * Get a session by ID
31
+ */
32
+ getSessionById(requestParameters: GetSessionByIdRequest, initOverrides?: RequestInit): Promise<Session>;
21
33
  /**
22
34
  * Revoke a session
23
35
  */
@@ -98,6 +98,44 @@ import '../models/WalletTransactionType.js';
98
98
  *
99
99
  */
100
100
  class SessionsApi extends BaseAPI {
101
+ /**
102
+ * Get a session by ID
103
+ */
104
+ getSessionByIdRaw(requestParameters, initOverrides) {
105
+ return __awaiter(this, void 0, void 0, function* () {
106
+ if (requestParameters.userId === null || requestParameters.userId === undefined) {
107
+ throw new RequiredError('userId', 'Required parameter requestParameters.userId was null or undefined when calling getSessionById.');
108
+ }
109
+ if (requestParameters.sessionId === null || requestParameters.sessionId === undefined) {
110
+ throw new RequiredError('sessionId', 'Required parameter requestParameters.sessionId was null or undefined when calling getSessionById.');
111
+ }
112
+ const queryParameters = {};
113
+ const headerParameters = {};
114
+ if (this.configuration && this.configuration.accessToken) {
115
+ const token = this.configuration.accessToken;
116
+ const tokenString = yield token("bearerAuth", []);
117
+ if (tokenString) {
118
+ headerParameters["Authorization"] = `Bearer ${tokenString}`;
119
+ }
120
+ }
121
+ const response = yield this.request({
122
+ path: `/users/{userId}/sessions/{sessionId}`.replace(`{${"userId"}}`, encodeURIComponent(String(requestParameters.userId))).replace(`{${"sessionId"}}`, encodeURIComponent(String(requestParameters.sessionId))),
123
+ method: 'GET',
124
+ headers: headerParameters,
125
+ query: queryParameters,
126
+ }, initOverrides);
127
+ return new JSONApiResponse(response, (jsonValue) => SessionFromJSON(jsonValue));
128
+ });
129
+ }
130
+ /**
131
+ * Get a session by ID
132
+ */
133
+ getSessionById(requestParameters, initOverrides) {
134
+ return __awaiter(this, void 0, void 0, function* () {
135
+ const response = yield this.getSessionByIdRaw(requestParameters, initOverrides);
136
+ return yield response.value();
137
+ });
138
+ }
101
139
  /**
102
140
  * Revoke a session
103
141
  */
package/src/index.cjs CHANGED
@@ -589,6 +589,7 @@ var WaasPolicyCreateRequest = require('./models/WaasPolicyCreateRequest.cjs');
589
589
  var WaasPolicyDeleteRequest = require('./models/WaasPolicyDeleteRequest.cjs');
590
590
  var WaasPolicyResponse = require('./models/WaasPolicyResponse.cjs');
591
591
  var WaasPolicyRule = require('./models/WaasPolicyRule.cjs');
592
+ var WaasPolicyRuleOperationRestrictions = require('./models/WaasPolicyRuleOperationRestrictions.cjs');
592
593
  var WaasPolicyRuleType = require('./models/WaasPolicyRuleType.cjs');
593
594
  var WaasPolicyRuleValueLimit = require('./models/WaasPolicyRuleValueLimit.cjs');
594
595
  var WaasPolicyUpdateRequest = require('./models/WaasPolicyUpdateRequest.cjs');
@@ -2680,6 +2681,9 @@ exports.WaasPolicyResponseToJSON = WaasPolicyResponse.WaasPolicyResponseToJSON;
2680
2681
  exports.WaasPolicyRuleFromJSON = WaasPolicyRule.WaasPolicyRuleFromJSON;
2681
2682
  exports.WaasPolicyRuleFromJSONTyped = WaasPolicyRule.WaasPolicyRuleFromJSONTyped;
2682
2683
  exports.WaasPolicyRuleToJSON = WaasPolicyRule.WaasPolicyRuleToJSON;
2684
+ exports.WaasPolicyRuleOperationRestrictionsFromJSON = WaasPolicyRuleOperationRestrictions.WaasPolicyRuleOperationRestrictionsFromJSON;
2685
+ exports.WaasPolicyRuleOperationRestrictionsFromJSONTyped = WaasPolicyRuleOperationRestrictions.WaasPolicyRuleOperationRestrictionsFromJSONTyped;
2686
+ exports.WaasPolicyRuleOperationRestrictionsToJSON = WaasPolicyRuleOperationRestrictions.WaasPolicyRuleOperationRestrictionsToJSON;
2683
2687
  Object.defineProperty(exports, 'WaasPolicyRuleType', {
2684
2688
  enumerable: true,
2685
2689
  get: function () { return WaasPolicyRuleType.WaasPolicyRuleType; }
package/src/index.js CHANGED
@@ -585,6 +585,7 @@ export { WaasPolicyCreateRequestFromJSON, WaasPolicyCreateRequestFromJSONTyped,
585
585
  export { WaasPolicyDeleteRequestFromJSON, WaasPolicyDeleteRequestFromJSONTyped, WaasPolicyDeleteRequestToJSON } from './models/WaasPolicyDeleteRequest.js';
586
586
  export { WaasPolicyResponseFromJSON, WaasPolicyResponseFromJSONTyped, WaasPolicyResponseToJSON } from './models/WaasPolicyResponse.js';
587
587
  export { WaasPolicyRuleFromJSON, WaasPolicyRuleFromJSONTyped, WaasPolicyRuleToJSON } from './models/WaasPolicyRule.js';
588
+ export { WaasPolicyRuleOperationRestrictionsFromJSON, WaasPolicyRuleOperationRestrictionsFromJSONTyped, WaasPolicyRuleOperationRestrictionsToJSON } from './models/WaasPolicyRuleOperationRestrictions.js';
588
589
  export { WaasPolicyRuleType, WaasPolicyRuleTypeFromJSON, WaasPolicyRuleTypeFromJSONTyped, WaasPolicyRuleTypeToJSON } from './models/WaasPolicyRuleType.js';
589
590
  export { WaasPolicyRuleValueLimitFromJSON, WaasPolicyRuleValueLimitFromJSONTyped, WaasPolicyRuleValueLimitToJSON } from './models/WaasPolicyRuleValueLimit.js';
590
591
  export { WaasPolicyUpdateRequestFromJSON, WaasPolicyUpdateRequestFromJSONTyped, WaasPolicyUpdateRequestToJSON } from './models/WaasPolicyUpdateRequest.js';
@@ -32,7 +32,7 @@ export interface Session {
32
32
  * @type {string}
33
33
  * @memberof Session
34
34
  */
35
- ipAddress?: string;
35
+ ipAddress?: string | null;
36
36
  /**
37
37
  *
38
38
  * @type {string}
@@ -5,6 +5,7 @@ Object.defineProperty(exports, '__esModule', { value: true });
5
5
  var runtime = require('../runtime.cjs');
6
6
  var WaasChainEnum = require('./WaasChainEnum.cjs');
7
7
  var WaasPolicyArgumentConstraint = require('./WaasPolicyArgumentConstraint.cjs');
8
+ var WaasPolicyRuleOperationRestrictions = require('./WaasPolicyRuleOperationRestrictions.cjs');
8
9
  var WaasPolicyRuleType = require('./WaasPolicyRuleType.cjs');
9
10
  var WaasPolicyRuleValueLimit = require('./WaasPolicyRuleValueLimit.cjs');
10
11
 
@@ -29,6 +30,7 @@ function WaasPolicyRuleFromJSONTyped(json, ignoreDiscriminator) {
29
30
  'functionName': !runtime.exists(json, 'functionName') ? undefined : json['functionName'],
30
31
  'argumentConstraints': !runtime.exists(json, 'argumentConstraints') ? undefined : (json['argumentConstraints'].map(WaasPolicyArgumentConstraint.WaasPolicyArgumentConstraintFromJSON)),
31
32
  'valueLimit': !runtime.exists(json, 'valueLimit') ? undefined : WaasPolicyRuleValueLimit.WaasPolicyRuleValueLimitFromJSON(json['valueLimit']),
33
+ 'operationRestrictions': !runtime.exists(json, 'operationRestrictions') ? undefined : WaasPolicyRuleOperationRestrictions.WaasPolicyRuleOperationRestrictionsFromJSON(json['operationRestrictions']),
32
34
  };
33
35
  }
34
36
  function WaasPolicyRuleToJSON(value) {
@@ -51,6 +53,7 @@ function WaasPolicyRuleToJSON(value) {
51
53
  'functionName': value.functionName,
52
54
  'argumentConstraints': value.argumentConstraints === undefined ? undefined : (value.argumentConstraints.map(WaasPolicyArgumentConstraint.WaasPolicyArgumentConstraintToJSON)),
53
55
  'valueLimit': WaasPolicyRuleValueLimit.WaasPolicyRuleValueLimitToJSON(value.valueLimit),
56
+ 'operationRestrictions': WaasPolicyRuleOperationRestrictions.WaasPolicyRuleOperationRestrictionsToJSON(value.operationRestrictions),
54
57
  };
55
58
  }
56
59
 
@@ -11,6 +11,7 @@
11
11
  */
12
12
  import { WaasChainEnum } from './WaasChainEnum';
13
13
  import { WaasPolicyArgumentConstraint } from './WaasPolicyArgumentConstraint';
14
+ import { WaasPolicyRuleOperationRestrictions } from './WaasPolicyRuleOperationRestrictions';
14
15
  import { WaasPolicyRuleType } from './WaasPolicyRuleType';
15
16
  import { WaasPolicyRuleValueLimit } from './WaasPolicyRuleValueLimit';
16
17
  /**
@@ -91,6 +92,12 @@ export interface WaasPolicyRule {
91
92
  * @memberof WaasPolicyRule
92
93
  */
93
94
  valueLimit?: WaasPolicyRuleValueLimit;
95
+ /**
96
+ *
97
+ * @type {WaasPolicyRuleOperationRestrictions}
98
+ * @memberof WaasPolicyRule
99
+ */
100
+ operationRestrictions?: WaasPolicyRuleOperationRestrictions;
94
101
  }
95
102
  export declare function WaasPolicyRuleFromJSON(json: any): WaasPolicyRule;
96
103
  export declare function WaasPolicyRuleFromJSONTyped(json: any, ignoreDiscriminator: boolean): WaasPolicyRule;
@@ -1,6 +1,7 @@
1
1
  import { exists } from '../runtime.js';
2
2
  import { WaasChainEnumFromJSON, WaasChainEnumToJSON } from './WaasChainEnum.js';
3
3
  import { WaasPolicyArgumentConstraintFromJSON, WaasPolicyArgumentConstraintToJSON } from './WaasPolicyArgumentConstraint.js';
4
+ import { WaasPolicyRuleOperationRestrictionsFromJSON, WaasPolicyRuleOperationRestrictionsToJSON } from './WaasPolicyRuleOperationRestrictions.js';
4
5
  import { WaasPolicyRuleTypeFromJSON, WaasPolicyRuleTypeToJSON } from './WaasPolicyRuleType.js';
5
6
  import { WaasPolicyRuleValueLimitFromJSON, WaasPolicyRuleValueLimitToJSON } from './WaasPolicyRuleValueLimit.js';
6
7
 
@@ -25,6 +26,7 @@ function WaasPolicyRuleFromJSONTyped(json, ignoreDiscriminator) {
25
26
  'functionName': !exists(json, 'functionName') ? undefined : json['functionName'],
26
27
  'argumentConstraints': !exists(json, 'argumentConstraints') ? undefined : (json['argumentConstraints'].map(WaasPolicyArgumentConstraintFromJSON)),
27
28
  'valueLimit': !exists(json, 'valueLimit') ? undefined : WaasPolicyRuleValueLimitFromJSON(json['valueLimit']),
29
+ 'operationRestrictions': !exists(json, 'operationRestrictions') ? undefined : WaasPolicyRuleOperationRestrictionsFromJSON(json['operationRestrictions']),
28
30
  };
29
31
  }
30
32
  function WaasPolicyRuleToJSON(value) {
@@ -47,6 +49,7 @@ function WaasPolicyRuleToJSON(value) {
47
49
  'functionName': value.functionName,
48
50
  'argumentConstraints': value.argumentConstraints === undefined ? undefined : (value.argumentConstraints.map(WaasPolicyArgumentConstraintToJSON)),
49
51
  'valueLimit': WaasPolicyRuleValueLimitToJSON(value.valueLimit),
52
+ 'operationRestrictions': WaasPolicyRuleOperationRestrictionsToJSON(value.operationRestrictions),
50
53
  };
51
54
  }
52
55
 
@@ -0,0 +1,37 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ var runtime = require('../runtime.cjs');
6
+
7
+ /* tslint:disable */
8
+ function WaasPolicyRuleOperationRestrictionsFromJSON(json) {
9
+ return WaasPolicyRuleOperationRestrictionsFromJSONTyped(json);
10
+ }
11
+ function WaasPolicyRuleOperationRestrictionsFromJSONTyped(json, ignoreDiscriminator) {
12
+ if ((json === undefined) || (json === null)) {
13
+ return json;
14
+ }
15
+ return {
16
+ 'blockExport': !runtime.exists(json, 'blockExport') ? undefined : json['blockExport'],
17
+ 'blockRevocation': !runtime.exists(json, 'blockRevocation') ? undefined : json['blockRevocation'],
18
+ 'blockClientSigning': !runtime.exists(json, 'blockClientSigning') ? undefined : json['blockClientSigning'],
19
+ };
20
+ }
21
+ function WaasPolicyRuleOperationRestrictionsToJSON(value) {
22
+ if (value === undefined) {
23
+ return undefined;
24
+ }
25
+ if (value === null) {
26
+ return null;
27
+ }
28
+ return {
29
+ 'blockExport': value.blockExport,
30
+ 'blockRevocation': value.blockRevocation,
31
+ 'blockClientSigning': value.blockClientSigning,
32
+ };
33
+ }
34
+
35
+ exports.WaasPolicyRuleOperationRestrictionsFromJSON = WaasPolicyRuleOperationRestrictionsFromJSON;
36
+ exports.WaasPolicyRuleOperationRestrictionsFromJSONTyped = WaasPolicyRuleOperationRestrictionsFromJSONTyped;
37
+ exports.WaasPolicyRuleOperationRestrictionsToJSON = WaasPolicyRuleOperationRestrictionsToJSON;
@@ -0,0 +1,39 @@
1
+ /**
2
+ * Dashboard API
3
+ * Dashboard API documentation
4
+ *
5
+ * The version of the OpenAPI document: 1.0.0
6
+ *
7
+ *
8
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
9
+ * https://openapi-generator.tech
10
+ * Do not edit the class manually.
11
+ */
12
+ /**
13
+ * Operation-level restrictions for the wallet
14
+ * @export
15
+ * @interface WaasPolicyRuleOperationRestrictions
16
+ */
17
+ export interface WaasPolicyRuleOperationRestrictions {
18
+ /**
19
+ * Block private key export
20
+ * @type {boolean}
21
+ * @memberof WaasPolicyRuleOperationRestrictions
22
+ */
23
+ blockExport?: boolean;
24
+ /**
25
+ * Block end-user revocation of delegated access
26
+ * @type {boolean}
27
+ * @memberof WaasPolicyRuleOperationRestrictions
28
+ */
29
+ blockRevocation?: boolean;
30
+ /**
31
+ * Block all end-user signing (not delegated)
32
+ * @type {boolean}
33
+ * @memberof WaasPolicyRuleOperationRestrictions
34
+ */
35
+ blockClientSigning?: boolean;
36
+ }
37
+ export declare function WaasPolicyRuleOperationRestrictionsFromJSON(json: any): WaasPolicyRuleOperationRestrictions;
38
+ export declare function WaasPolicyRuleOperationRestrictionsFromJSONTyped(json: any, ignoreDiscriminator: boolean): WaasPolicyRuleOperationRestrictions;
39
+ export declare function WaasPolicyRuleOperationRestrictionsToJSON(value?: WaasPolicyRuleOperationRestrictions | null): any;
@@ -0,0 +1,31 @@
1
+ import { exists } from '../runtime.js';
2
+
3
+ /* tslint:disable */
4
+ function WaasPolicyRuleOperationRestrictionsFromJSON(json) {
5
+ return WaasPolicyRuleOperationRestrictionsFromJSONTyped(json);
6
+ }
7
+ function WaasPolicyRuleOperationRestrictionsFromJSONTyped(json, ignoreDiscriminator) {
8
+ if ((json === undefined) || (json === null)) {
9
+ return json;
10
+ }
11
+ return {
12
+ 'blockExport': !exists(json, 'blockExport') ? undefined : json['blockExport'],
13
+ 'blockRevocation': !exists(json, 'blockRevocation') ? undefined : json['blockRevocation'],
14
+ 'blockClientSigning': !exists(json, 'blockClientSigning') ? undefined : json['blockClientSigning'],
15
+ };
16
+ }
17
+ function WaasPolicyRuleOperationRestrictionsToJSON(value) {
18
+ if (value === undefined) {
19
+ return undefined;
20
+ }
21
+ if (value === null) {
22
+ return null;
23
+ }
24
+ return {
25
+ 'blockExport': value.blockExport,
26
+ 'blockRevocation': value.blockRevocation,
27
+ 'blockClientSigning': value.blockClientSigning,
28
+ };
29
+ }
30
+
31
+ export { WaasPolicyRuleOperationRestrictionsFromJSON, WaasPolicyRuleOperationRestrictionsFromJSONTyped, WaasPolicyRuleOperationRestrictionsToJSON };
@@ -548,6 +548,7 @@ export * from './WaasPolicyCreateRequest';
548
548
  export * from './WaasPolicyDeleteRequest';
549
549
  export * from './WaasPolicyResponse';
550
550
  export * from './WaasPolicyRule';
551
+ export * from './WaasPolicyRuleOperationRestrictions';
551
552
  export * from './WaasPolicyRuleType';
552
553
  export * from './WaasPolicyRuleValueLimit';
553
554
  export * from './WaasPolicyUpdateRequest';