@dynamic-labs/sdk-api 0.0.846 → 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 +1 -1
- package/src/apis/SessionsApi.cjs +38 -0
- package/src/apis/SessionsApi.d.ts +12 -0
- package/src/apis/SessionsApi.js +38 -0
- package/src/models/Session.d.ts +1 -1
package/package.json
CHANGED
package/src/apis/SessionsApi.cjs
CHANGED
|
@@ -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
|
*/
|
package/src/apis/SessionsApi.js
CHANGED
|
@@ -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
|
*/
|