@seal-protocol/backendjs 0.0.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.
package/lib/api.d.ts ADDED
@@ -0,0 +1,295 @@
1
+ /**
2
+ * seal/backend/server/query.proto
3
+ * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
4
+ *
5
+ * The version of the OpenAPI document: version not set
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
+ import type { Configuration } from './configuration';
13
+ import type { AxiosPromise, AxiosInstance, RawAxiosRequestConfig } from 'axios';
14
+ import type { RequestArgs } from './base';
15
+ import { BaseAPI } from './base';
16
+ /**
17
+ *
18
+ * @export
19
+ * @interface BackendserverConfig
20
+ */
21
+ export interface BackendserverConfig {
22
+ /**
23
+ *
24
+ * @type {string}
25
+ * @memberof BackendserverConfig
26
+ */
27
+ 'dummy'?: string;
28
+ }
29
+ /**
30
+ *
31
+ * @export
32
+ * @interface ProtobufAny
33
+ */
34
+ export interface ProtobufAny {
35
+ [key: string]: object | any;
36
+ /**
37
+ *
38
+ * @type {string}
39
+ * @memberof ProtobufAny
40
+ */
41
+ '@type'?: string;
42
+ }
43
+ /**
44
+ *
45
+ * @export
46
+ * @interface RpcStatus
47
+ */
48
+ export interface RpcStatus {
49
+ /**
50
+ *
51
+ * @type {number}
52
+ * @memberof RpcStatus
53
+ */
54
+ 'code'?: number;
55
+ /**
56
+ *
57
+ * @type {string}
58
+ * @memberof RpcStatus
59
+ */
60
+ 'message'?: string;
61
+ /**
62
+ *
63
+ * @type {Array<ProtobufAny>}
64
+ * @memberof RpcStatus
65
+ */
66
+ 'details'?: Array<ProtobufAny>;
67
+ }
68
+ /**
69
+ *
70
+ * @export
71
+ * @interface ServerCreateOrderIntentRequest
72
+ */
73
+ export interface ServerCreateOrderIntentRequest {
74
+ /**
75
+ *
76
+ * @type {string}
77
+ * @memberof ServerCreateOrderIntentRequest
78
+ */
79
+ 'owner'?: string;
80
+ /**
81
+ *
82
+ * @type {string}
83
+ * @memberof ServerCreateOrderIntentRequest
84
+ */
85
+ 'tokenIn'?: string;
86
+ /**
87
+ *
88
+ * @type {string}
89
+ * @memberof ServerCreateOrderIntentRequest
90
+ */
91
+ 'amountIn'?: string;
92
+ /**
93
+ *
94
+ * @type {string}
95
+ * @memberof ServerCreateOrderIntentRequest
96
+ */
97
+ 'tokenOut'?: string;
98
+ /**
99
+ *
100
+ * @type {string}
101
+ * @memberof ServerCreateOrderIntentRequest
102
+ */
103
+ 'amountOut'?: string;
104
+ /**
105
+ *
106
+ * @type {boolean}
107
+ * @memberof ServerCreateOrderIntentRequest
108
+ */
109
+ 'allowReservation'?: boolean;
110
+ /**
111
+ *
112
+ * @type {string}
113
+ * @memberof ServerCreateOrderIntentRequest
114
+ */
115
+ 'reservationDepositToken'?: string;
116
+ /**
117
+ *
118
+ * @type {string}
119
+ * @memberof ServerCreateOrderIntentRequest
120
+ */
121
+ 'reservationDepositAmount'?: string;
122
+ /**
123
+ *
124
+ * @type {string}
125
+ * @memberof ServerCreateOrderIntentRequest
126
+ */
127
+ 'reservationPeriod'?: string;
128
+ /**
129
+ *
130
+ * @type {boolean}
131
+ * @memberof ServerCreateOrderIntentRequest
132
+ */
133
+ 'partiallyFillable'?: boolean;
134
+ /**
135
+ *
136
+ * @type {string}
137
+ * @memberof ServerCreateOrderIntentRequest
138
+ */
139
+ 'expiry'?: string;
140
+ /**
141
+ *
142
+ * @type {string}
143
+ * @memberof ServerCreateOrderIntentRequest
144
+ */
145
+ 'nonce'?: string;
146
+ /**
147
+ *
148
+ * @type {string}
149
+ * @memberof ServerCreateOrderIntentRequest
150
+ */
151
+ 'deadline'?: string;
152
+ }
153
+ /**
154
+ *
155
+ * @export
156
+ * @interface ServerQueryConfigResponse
157
+ */
158
+ export interface ServerQueryConfigResponse {
159
+ /**
160
+ *
161
+ * @type {BackendserverConfig}
162
+ * @memberof ServerQueryConfigResponse
163
+ */
164
+ 'config'?: BackendserverConfig;
165
+ /**
166
+ *
167
+ * @type {string}
168
+ * @memberof ServerQueryConfigResponse
169
+ */
170
+ 'gitRevision'?: string;
171
+ /**
172
+ *
173
+ * @type {string}
174
+ * @memberof ServerQueryConfigResponse
175
+ */
176
+ 'uptime'?: string;
177
+ }
178
+ /**
179
+ *
180
+ * @export
181
+ * @interface ServerQueryHealthCheckResponse
182
+ */
183
+ export interface ServerQueryHealthCheckResponse {
184
+ /**
185
+ *
186
+ * @type {string}
187
+ * @memberof ServerQueryHealthCheckResponse
188
+ */
189
+ 'uptime'?: string;
190
+ }
191
+ /**
192
+ * QueryApi - axios parameter creator
193
+ * @export
194
+ */
195
+ export declare const QueryApiAxiosParamCreator: (configuration?: Configuration) => {
196
+ /**
197
+ *
198
+ * @param {*} [options] Override http request option.
199
+ * @throws {RequiredError}
200
+ */
201
+ queryConfig: (options?: RawAxiosRequestConfig) => Promise<RequestArgs>;
202
+ /**
203
+ *
204
+ * @param {ServerCreateOrderIntentRequest} body
205
+ * @param {*} [options] Override http request option.
206
+ * @throws {RequiredError}
207
+ */
208
+ queryCreateOrderIntent: (body: ServerCreateOrderIntentRequest, options?: RawAxiosRequestConfig) => Promise<RequestArgs>;
209
+ /**
210
+ *
211
+ * @param {*} [options] Override http request option.
212
+ * @throws {RequiredError}
213
+ */
214
+ queryHealthCheck: (options?: RawAxiosRequestConfig) => Promise<RequestArgs>;
215
+ };
216
+ /**
217
+ * QueryApi - functional programming interface
218
+ * @export
219
+ */
220
+ export declare const QueryApiFp: (configuration?: Configuration) => {
221
+ /**
222
+ *
223
+ * @param {*} [options] Override http request option.
224
+ * @throws {RequiredError}
225
+ */
226
+ queryConfig(options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<ServerQueryConfigResponse>>;
227
+ /**
228
+ *
229
+ * @param {ServerCreateOrderIntentRequest} body
230
+ * @param {*} [options] Override http request option.
231
+ * @throws {RequiredError}
232
+ */
233
+ queryCreateOrderIntent(body: ServerCreateOrderIntentRequest, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<object>>;
234
+ /**
235
+ *
236
+ * @param {*} [options] Override http request option.
237
+ * @throws {RequiredError}
238
+ */
239
+ queryHealthCheck(options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<ServerQueryHealthCheckResponse>>;
240
+ };
241
+ /**
242
+ * QueryApi - factory interface
243
+ * @export
244
+ */
245
+ export declare const QueryApiFactory: (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) => {
246
+ /**
247
+ *
248
+ * @param {*} [options] Override http request option.
249
+ * @throws {RequiredError}
250
+ */
251
+ queryConfig(options?: RawAxiosRequestConfig): AxiosPromise<ServerQueryConfigResponse>;
252
+ /**
253
+ *
254
+ * @param {ServerCreateOrderIntentRequest} body
255
+ * @param {*} [options] Override http request option.
256
+ * @throws {RequiredError}
257
+ */
258
+ queryCreateOrderIntent(body: ServerCreateOrderIntentRequest, options?: RawAxiosRequestConfig): AxiosPromise<object>;
259
+ /**
260
+ *
261
+ * @param {*} [options] Override http request option.
262
+ * @throws {RequiredError}
263
+ */
264
+ queryHealthCheck(options?: RawAxiosRequestConfig): AxiosPromise<ServerQueryHealthCheckResponse>;
265
+ };
266
+ /**
267
+ * QueryApi - object-oriented interface
268
+ * @export
269
+ * @class QueryApi
270
+ * @extends {BaseAPI}
271
+ */
272
+ export declare class QueryApi extends BaseAPI {
273
+ /**
274
+ *
275
+ * @param {*} [options] Override http request option.
276
+ * @throws {RequiredError}
277
+ * @memberof QueryApi
278
+ */
279
+ queryConfig(options?: RawAxiosRequestConfig): Promise<import("axios").AxiosResponse<ServerQueryConfigResponse, any>>;
280
+ /**
281
+ *
282
+ * @param {ServerCreateOrderIntentRequest} body
283
+ * @param {*} [options] Override http request option.
284
+ * @throws {RequiredError}
285
+ * @memberof QueryApi
286
+ */
287
+ queryCreateOrderIntent(body: ServerCreateOrderIntentRequest, options?: RawAxiosRequestConfig): Promise<import("axios").AxiosResponse<object, any>>;
288
+ /**
289
+ *
290
+ * @param {*} [options] Override http request option.
291
+ * @throws {RequiredError}
292
+ * @memberof QueryApi
293
+ */
294
+ queryHealthCheck(options?: RawAxiosRequestConfig): Promise<import("axios").AxiosResponse<ServerQueryHealthCheckResponse, any>>;
295
+ }
package/lib/api.js ADDED
@@ -0,0 +1,227 @@
1
+ "use strict";
2
+ /* tslint:disable */
3
+ /* eslint-disable */
4
+ /**
5
+ * seal/backend/server/query.proto
6
+ * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
7
+ *
8
+ * The version of the OpenAPI document: version not set
9
+ *
10
+ *
11
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
12
+ * https://openapi-generator.tech
13
+ * Do not edit the class manually.
14
+ */
15
+ var __importDefault = (this && this.__importDefault) || function (mod) {
16
+ return (mod && mod.__esModule) ? mod : { "default": mod };
17
+ };
18
+ Object.defineProperty(exports, "__esModule", { value: true });
19
+ exports.QueryApi = exports.QueryApiFactory = exports.QueryApiFp = exports.QueryApiAxiosParamCreator = void 0;
20
+ const axios_1 = __importDefault(require("axios"));
21
+ // Some imports not used depending on template conditions
22
+ // @ts-ignore
23
+ const common_1 = require("./common");
24
+ // @ts-ignore
25
+ const base_1 = require("./base");
26
+ /**
27
+ * QueryApi - axios parameter creator
28
+ * @export
29
+ */
30
+ const QueryApiAxiosParamCreator = function (configuration) {
31
+ return {
32
+ /**
33
+ *
34
+ * @param {*} [options] Override http request option.
35
+ * @throws {RequiredError}
36
+ */
37
+ queryConfig: async (options = {}) => {
38
+ const localVarPath = `/seal/config`;
39
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
40
+ const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
41
+ let baseOptions;
42
+ if (configuration) {
43
+ baseOptions = configuration.baseOptions;
44
+ }
45
+ const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options };
46
+ const localVarHeaderParameter = {};
47
+ const localVarQueryParameter = {};
48
+ (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
49
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
50
+ localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers };
51
+ return {
52
+ url: (0, common_1.toPathString)(localVarUrlObj),
53
+ options: localVarRequestOptions,
54
+ };
55
+ },
56
+ /**
57
+ *
58
+ * @param {ServerCreateOrderIntentRequest} body
59
+ * @param {*} [options] Override http request option.
60
+ * @throws {RequiredError}
61
+ */
62
+ queryCreateOrderIntent: async (body, options = {}) => {
63
+ // verify required parameter 'body' is not null or undefined
64
+ (0, common_1.assertParamExists)('queryCreateOrderIntent', 'body', body);
65
+ const localVarPath = `/seal/order/create_order_intent`;
66
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
67
+ const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
68
+ let baseOptions;
69
+ if (configuration) {
70
+ baseOptions = configuration.baseOptions;
71
+ }
72
+ const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options };
73
+ const localVarHeaderParameter = {};
74
+ const localVarQueryParameter = {};
75
+ localVarHeaderParameter['Content-Type'] = 'application/json';
76
+ (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
77
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
78
+ localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers };
79
+ localVarRequestOptions.data = (0, common_1.serializeDataIfNeeded)(body, localVarRequestOptions, configuration);
80
+ return {
81
+ url: (0, common_1.toPathString)(localVarUrlObj),
82
+ options: localVarRequestOptions,
83
+ };
84
+ },
85
+ /**
86
+ *
87
+ * @param {*} [options] Override http request option.
88
+ * @throws {RequiredError}
89
+ */
90
+ queryHealthCheck: async (options = {}) => {
91
+ const localVarPath = `/seal/health`;
92
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
93
+ const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
94
+ let baseOptions;
95
+ if (configuration) {
96
+ baseOptions = configuration.baseOptions;
97
+ }
98
+ const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options };
99
+ const localVarHeaderParameter = {};
100
+ const localVarQueryParameter = {};
101
+ (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
102
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
103
+ localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers };
104
+ return {
105
+ url: (0, common_1.toPathString)(localVarUrlObj),
106
+ options: localVarRequestOptions,
107
+ };
108
+ },
109
+ };
110
+ };
111
+ exports.QueryApiAxiosParamCreator = QueryApiAxiosParamCreator;
112
+ /**
113
+ * QueryApi - functional programming interface
114
+ * @export
115
+ */
116
+ const QueryApiFp = function (configuration) {
117
+ const localVarAxiosParamCreator = (0, exports.QueryApiAxiosParamCreator)(configuration);
118
+ return {
119
+ /**
120
+ *
121
+ * @param {*} [options] Override http request option.
122
+ * @throws {RequiredError}
123
+ */
124
+ async queryConfig(options) {
125
+ const localVarAxiosArgs = await localVarAxiosParamCreator.queryConfig(options);
126
+ const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
127
+ const localVarOperationServerBasePath = base_1.operationServerMap['QueryApi.queryConfig']?.[localVarOperationServerIndex]?.url;
128
+ return (axios, basePath) => (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
129
+ },
130
+ /**
131
+ *
132
+ * @param {ServerCreateOrderIntentRequest} body
133
+ * @param {*} [options] Override http request option.
134
+ * @throws {RequiredError}
135
+ */
136
+ async queryCreateOrderIntent(body, options) {
137
+ const localVarAxiosArgs = await localVarAxiosParamCreator.queryCreateOrderIntent(body, options);
138
+ const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
139
+ const localVarOperationServerBasePath = base_1.operationServerMap['QueryApi.queryCreateOrderIntent']?.[localVarOperationServerIndex]?.url;
140
+ return (axios, basePath) => (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
141
+ },
142
+ /**
143
+ *
144
+ * @param {*} [options] Override http request option.
145
+ * @throws {RequiredError}
146
+ */
147
+ async queryHealthCheck(options) {
148
+ const localVarAxiosArgs = await localVarAxiosParamCreator.queryHealthCheck(options);
149
+ const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
150
+ const localVarOperationServerBasePath = base_1.operationServerMap['QueryApi.queryHealthCheck']?.[localVarOperationServerIndex]?.url;
151
+ return (axios, basePath) => (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
152
+ },
153
+ };
154
+ };
155
+ exports.QueryApiFp = QueryApiFp;
156
+ /**
157
+ * QueryApi - factory interface
158
+ * @export
159
+ */
160
+ const QueryApiFactory = function (configuration, basePath, axios) {
161
+ const localVarFp = (0, exports.QueryApiFp)(configuration);
162
+ return {
163
+ /**
164
+ *
165
+ * @param {*} [options] Override http request option.
166
+ * @throws {RequiredError}
167
+ */
168
+ queryConfig(options) {
169
+ return localVarFp.queryConfig(options).then((request) => request(axios, basePath));
170
+ },
171
+ /**
172
+ *
173
+ * @param {ServerCreateOrderIntentRequest} body
174
+ * @param {*} [options] Override http request option.
175
+ * @throws {RequiredError}
176
+ */
177
+ queryCreateOrderIntent(body, options) {
178
+ return localVarFp.queryCreateOrderIntent(body, options).then((request) => request(axios, basePath));
179
+ },
180
+ /**
181
+ *
182
+ * @param {*} [options] Override http request option.
183
+ * @throws {RequiredError}
184
+ */
185
+ queryHealthCheck(options) {
186
+ return localVarFp.queryHealthCheck(options).then((request) => request(axios, basePath));
187
+ },
188
+ };
189
+ };
190
+ exports.QueryApiFactory = QueryApiFactory;
191
+ /**
192
+ * QueryApi - object-oriented interface
193
+ * @export
194
+ * @class QueryApi
195
+ * @extends {BaseAPI}
196
+ */
197
+ class QueryApi extends base_1.BaseAPI {
198
+ /**
199
+ *
200
+ * @param {*} [options] Override http request option.
201
+ * @throws {RequiredError}
202
+ * @memberof QueryApi
203
+ */
204
+ queryConfig(options) {
205
+ return (0, exports.QueryApiFp)(this.configuration).queryConfig(options).then((request) => request(this.axios, this.basePath));
206
+ }
207
+ /**
208
+ *
209
+ * @param {ServerCreateOrderIntentRequest} body
210
+ * @param {*} [options] Override http request option.
211
+ * @throws {RequiredError}
212
+ * @memberof QueryApi
213
+ */
214
+ queryCreateOrderIntent(body, options) {
215
+ return (0, exports.QueryApiFp)(this.configuration).queryCreateOrderIntent(body, options).then((request) => request(this.axios, this.basePath));
216
+ }
217
+ /**
218
+ *
219
+ * @param {*} [options] Override http request option.
220
+ * @throws {RequiredError}
221
+ * @memberof QueryApi
222
+ */
223
+ queryHealthCheck(options) {
224
+ return (0, exports.QueryApiFp)(this.configuration).queryHealthCheck(options).then((request) => request(this.axios, this.basePath));
225
+ }
226
+ }
227
+ exports.QueryApi = QueryApi;
package/lib/base.d.ts ADDED
@@ -0,0 +1,66 @@
1
+ /**
2
+ * seal/backend/server/query.proto
3
+ * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
4
+ *
5
+ * The version of the OpenAPI document: version not set
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
+ import type { Configuration } from './configuration';
13
+ import type { AxiosInstance, RawAxiosRequestConfig } from 'axios';
14
+ export declare const BASE_PATH: string;
15
+ /**
16
+ *
17
+ * @export
18
+ */
19
+ export declare const COLLECTION_FORMATS: {
20
+ csv: string;
21
+ ssv: string;
22
+ tsv: string;
23
+ pipes: string;
24
+ };
25
+ /**
26
+ *
27
+ * @export
28
+ * @interface RequestArgs
29
+ */
30
+ export interface RequestArgs {
31
+ url: string;
32
+ options: RawAxiosRequestConfig;
33
+ }
34
+ /**
35
+ *
36
+ * @export
37
+ * @class BaseAPI
38
+ */
39
+ export declare class BaseAPI {
40
+ protected basePath: string;
41
+ protected axios: AxiosInstance;
42
+ protected configuration: Configuration | undefined;
43
+ constructor(configuration?: Configuration, basePath?: string, axios?: AxiosInstance);
44
+ }
45
+ /**
46
+ *
47
+ * @export
48
+ * @class RequiredError
49
+ * @extends {Error}
50
+ */
51
+ export declare class RequiredError extends Error {
52
+ field: string;
53
+ constructor(field: string, msg?: string);
54
+ }
55
+ interface ServerMap {
56
+ [key: string]: {
57
+ url: string;
58
+ description: string;
59
+ }[];
60
+ }
61
+ /**
62
+ *
63
+ * @export
64
+ */
65
+ export declare const operationServerMap: ServerMap;
66
+ export {};
package/lib/base.js ADDED
@@ -0,0 +1,71 @@
1
+ "use strict";
2
+ /* tslint:disable */
3
+ /* eslint-disable */
4
+ /**
5
+ * seal/backend/server/query.proto
6
+ * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
7
+ *
8
+ * The version of the OpenAPI document: version not set
9
+ *
10
+ *
11
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
12
+ * https://openapi-generator.tech
13
+ * Do not edit the class manually.
14
+ */
15
+ var __importDefault = (this && this.__importDefault) || function (mod) {
16
+ return (mod && mod.__esModule) ? mod : { "default": mod };
17
+ };
18
+ Object.defineProperty(exports, "__esModule", { value: true });
19
+ exports.operationServerMap = exports.RequiredError = exports.BaseAPI = exports.COLLECTION_FORMATS = exports.BASE_PATH = void 0;
20
+ const axios_1 = __importDefault(require("axios"));
21
+ exports.BASE_PATH = "http://localhost".replace(/\/+$/, "");
22
+ /**
23
+ *
24
+ * @export
25
+ */
26
+ exports.COLLECTION_FORMATS = {
27
+ csv: ",",
28
+ ssv: " ",
29
+ tsv: "\t",
30
+ pipes: "|",
31
+ };
32
+ /**
33
+ *
34
+ * @export
35
+ * @class BaseAPI
36
+ */
37
+ class BaseAPI {
38
+ basePath;
39
+ axios;
40
+ configuration;
41
+ constructor(configuration, basePath = exports.BASE_PATH, axios = axios_1.default) {
42
+ this.basePath = basePath;
43
+ this.axios = axios;
44
+ if (configuration) {
45
+ this.configuration = configuration;
46
+ this.basePath = configuration.basePath ?? basePath;
47
+ }
48
+ }
49
+ }
50
+ exports.BaseAPI = BaseAPI;
51
+ ;
52
+ /**
53
+ *
54
+ * @export
55
+ * @class RequiredError
56
+ * @extends {Error}
57
+ */
58
+ class RequiredError extends Error {
59
+ field;
60
+ constructor(field, msg) {
61
+ super(msg);
62
+ this.field = field;
63
+ this.name = "RequiredError";
64
+ }
65
+ }
66
+ exports.RequiredError = RequiredError;
67
+ /**
68
+ *
69
+ * @export
70
+ */
71
+ exports.operationServerMap = {};
@@ -0,0 +1,65 @@
1
+ /**
2
+ * seal/backend/server/query.proto
3
+ * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
4
+ *
5
+ * The version of the OpenAPI document: version not set
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
+ import type { Configuration } from "./configuration";
13
+ import type { RequestArgs } from "./base";
14
+ import type { AxiosInstance, AxiosResponse } from 'axios';
15
+ /**
16
+ *
17
+ * @export
18
+ */
19
+ export declare const DUMMY_BASE_URL = "https://example.com";
20
+ /**
21
+ *
22
+ * @throws {RequiredError}
23
+ * @export
24
+ */
25
+ export declare const assertParamExists: (functionName: string, paramName: string, paramValue: unknown) => void;
26
+ /**
27
+ *
28
+ * @export
29
+ */
30
+ export declare const setApiKeyToObject: (object: any, keyParamName: string, configuration?: Configuration) => Promise<void>;
31
+ /**
32
+ *
33
+ * @export
34
+ */
35
+ export declare const setBasicAuthToObject: (object: any, configuration?: Configuration) => void;
36
+ /**
37
+ *
38
+ * @export
39
+ */
40
+ export declare const setBearerAuthToObject: (object: any, configuration?: Configuration) => Promise<void>;
41
+ /**
42
+ *
43
+ * @export
44
+ */
45
+ export declare const setOAuthToObject: (object: any, name: string, scopes: string[], configuration?: Configuration) => Promise<void>;
46
+ /**
47
+ *
48
+ * @export
49
+ */
50
+ export declare const setSearchParams: (url: URL, ...objects: any[]) => void;
51
+ /**
52
+ *
53
+ * @export
54
+ */
55
+ export declare const serializeDataIfNeeded: (value: any, requestOptions: any, configuration?: Configuration) => any;
56
+ /**
57
+ *
58
+ * @export
59
+ */
60
+ export declare const toPathString: (url: URL) => string;
61
+ /**
62
+ *
63
+ * @export
64
+ */
65
+ export declare const createRequestFunction: (axiosArgs: RequestArgs, globalAxios: AxiosInstance, BASE_PATH: string, configuration?: Configuration) => <T = unknown, R = AxiosResponse<T>>(axios?: AxiosInstance, basePath?: string) => Promise<R>;
package/lib/common.js ADDED
@@ -0,0 +1,145 @@
1
+ "use strict";
2
+ /* tslint:disable */
3
+ /* eslint-disable */
4
+ /**
5
+ * seal/backend/server/query.proto
6
+ * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
7
+ *
8
+ * The version of the OpenAPI document: version not set
9
+ *
10
+ *
11
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
12
+ * https://openapi-generator.tech
13
+ * Do not edit the class manually.
14
+ */
15
+ Object.defineProperty(exports, "__esModule", { value: true });
16
+ exports.createRequestFunction = exports.toPathString = exports.serializeDataIfNeeded = exports.setSearchParams = exports.setOAuthToObject = exports.setBearerAuthToObject = exports.setBasicAuthToObject = exports.setApiKeyToObject = exports.assertParamExists = exports.DUMMY_BASE_URL = void 0;
17
+ const base_1 = require("./base");
18
+ /**
19
+ *
20
+ * @export
21
+ */
22
+ exports.DUMMY_BASE_URL = 'https://example.com';
23
+ /**
24
+ *
25
+ * @throws {RequiredError}
26
+ * @export
27
+ */
28
+ const assertParamExists = function (functionName, paramName, paramValue) {
29
+ if (paramValue === null || paramValue === undefined) {
30
+ throw new base_1.RequiredError(paramName, `Required parameter ${paramName} was null or undefined when calling ${functionName}.`);
31
+ }
32
+ };
33
+ exports.assertParamExists = assertParamExists;
34
+ /**
35
+ *
36
+ * @export
37
+ */
38
+ const setApiKeyToObject = async function (object, keyParamName, configuration) {
39
+ if (configuration && configuration.apiKey) {
40
+ const localVarApiKeyValue = typeof configuration.apiKey === 'function'
41
+ ? await configuration.apiKey(keyParamName)
42
+ : await configuration.apiKey;
43
+ object[keyParamName] = localVarApiKeyValue;
44
+ }
45
+ };
46
+ exports.setApiKeyToObject = setApiKeyToObject;
47
+ /**
48
+ *
49
+ * @export
50
+ */
51
+ const setBasicAuthToObject = function (object, configuration) {
52
+ if (configuration && (configuration.username || configuration.password)) {
53
+ object["auth"] = { username: configuration.username, password: configuration.password };
54
+ }
55
+ };
56
+ exports.setBasicAuthToObject = setBasicAuthToObject;
57
+ /**
58
+ *
59
+ * @export
60
+ */
61
+ const setBearerAuthToObject = async function (object, configuration) {
62
+ if (configuration && configuration.accessToken) {
63
+ const accessToken = typeof configuration.accessToken === 'function'
64
+ ? await configuration.accessToken()
65
+ : await configuration.accessToken;
66
+ object["Authorization"] = "Bearer " + accessToken;
67
+ }
68
+ };
69
+ exports.setBearerAuthToObject = setBearerAuthToObject;
70
+ /**
71
+ *
72
+ * @export
73
+ */
74
+ const setOAuthToObject = async function (object, name, scopes, configuration) {
75
+ if (configuration && configuration.accessToken) {
76
+ const localVarAccessTokenValue = typeof configuration.accessToken === 'function'
77
+ ? await configuration.accessToken(name, scopes)
78
+ : await configuration.accessToken;
79
+ object["Authorization"] = "Bearer " + localVarAccessTokenValue;
80
+ }
81
+ };
82
+ exports.setOAuthToObject = setOAuthToObject;
83
+ function setFlattenedQueryParams(urlSearchParams, parameter, key = "") {
84
+ if (parameter == null)
85
+ return;
86
+ if (typeof parameter === "object") {
87
+ if (Array.isArray(parameter)) {
88
+ parameter.forEach(item => setFlattenedQueryParams(urlSearchParams, item, key));
89
+ }
90
+ else {
91
+ Object.keys(parameter).forEach(currentKey => setFlattenedQueryParams(urlSearchParams, parameter[currentKey], `${key}${key !== '' ? '.' : ''}${currentKey}`));
92
+ }
93
+ }
94
+ else {
95
+ if (urlSearchParams.has(key)) {
96
+ urlSearchParams.append(key, parameter);
97
+ }
98
+ else {
99
+ urlSearchParams.set(key, parameter);
100
+ }
101
+ }
102
+ }
103
+ /**
104
+ *
105
+ * @export
106
+ */
107
+ const setSearchParams = function (url, ...objects) {
108
+ const searchParams = new URLSearchParams(url.search);
109
+ setFlattenedQueryParams(searchParams, objects);
110
+ url.search = searchParams.toString();
111
+ };
112
+ exports.setSearchParams = setSearchParams;
113
+ /**
114
+ *
115
+ * @export
116
+ */
117
+ const serializeDataIfNeeded = function (value, requestOptions, configuration) {
118
+ const nonString = typeof value !== 'string';
119
+ const needsSerialization = nonString && configuration && configuration.isJsonMime
120
+ ? configuration.isJsonMime(requestOptions.headers['Content-Type'])
121
+ : nonString;
122
+ return needsSerialization
123
+ ? JSON.stringify(value !== undefined ? value : {})
124
+ : (value || "");
125
+ };
126
+ exports.serializeDataIfNeeded = serializeDataIfNeeded;
127
+ /**
128
+ *
129
+ * @export
130
+ */
131
+ const toPathString = function (url) {
132
+ return url.pathname + url.search + url.hash;
133
+ };
134
+ exports.toPathString = toPathString;
135
+ /**
136
+ *
137
+ * @export
138
+ */
139
+ const createRequestFunction = function (axiosArgs, globalAxios, BASE_PATH, configuration) {
140
+ return (axios = globalAxios, basePath = BASE_PATH) => {
141
+ const axiosRequestArgs = { ...axiosArgs.options, url: (axios.defaults.baseURL ? '' : configuration?.basePath ?? basePath) + axiosArgs.url };
142
+ return axios.request(axiosRequestArgs);
143
+ };
144
+ };
145
+ exports.createRequestFunction = createRequestFunction;
@@ -0,0 +1,91 @@
1
+ /**
2
+ * seal/backend/server/query.proto
3
+ * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
4
+ *
5
+ * The version of the OpenAPI document: version not set
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
+ export interface ConfigurationParameters {
13
+ apiKey?: string | Promise<string> | ((name: string) => string) | ((name: string) => Promise<string>);
14
+ username?: string;
15
+ password?: string;
16
+ accessToken?: string | Promise<string> | ((name?: string, scopes?: string[]) => string) | ((name?: string, scopes?: string[]) => Promise<string>);
17
+ basePath?: string;
18
+ serverIndex?: number;
19
+ baseOptions?: any;
20
+ formDataCtor?: new () => any;
21
+ }
22
+ export declare class Configuration {
23
+ /**
24
+ * parameter for apiKey security
25
+ * @param name security name
26
+ * @memberof Configuration
27
+ */
28
+ apiKey?: string | Promise<string> | ((name: string) => string) | ((name: string) => Promise<string>);
29
+ /**
30
+ * parameter for basic security
31
+ *
32
+ * @type {string}
33
+ * @memberof Configuration
34
+ */
35
+ username?: string;
36
+ /**
37
+ * parameter for basic security
38
+ *
39
+ * @type {string}
40
+ * @memberof Configuration
41
+ */
42
+ password?: string;
43
+ /**
44
+ * parameter for oauth2 security
45
+ * @param name security name
46
+ * @param scopes oauth2 scope
47
+ * @memberof Configuration
48
+ */
49
+ accessToken?: string | Promise<string> | ((name?: string, scopes?: string[]) => string) | ((name?: string, scopes?: string[]) => Promise<string>);
50
+ /**
51
+ * override base path
52
+ *
53
+ * @type {string}
54
+ * @memberof Configuration
55
+ */
56
+ basePath?: string;
57
+ /**
58
+ * override server index
59
+ *
60
+ * @type {number}
61
+ * @memberof Configuration
62
+ */
63
+ serverIndex?: number;
64
+ /**
65
+ * base options for axios calls
66
+ *
67
+ * @type {any}
68
+ * @memberof Configuration
69
+ */
70
+ baseOptions?: any;
71
+ /**
72
+ * The FormData constructor that will be used to create multipart form data
73
+ * requests. You can inject this here so that execution environments that
74
+ * do not support the FormData class can still run the generated client.
75
+ *
76
+ * @type {new () => FormData}
77
+ */
78
+ formDataCtor?: new () => any;
79
+ constructor(param?: ConfigurationParameters);
80
+ /**
81
+ * Check if the given MIME is a JSON MIME.
82
+ * JSON MIME examples:
83
+ * application/json
84
+ * application/json; charset=UTF8
85
+ * APPLICATION/JSON
86
+ * application/vnd.company+json
87
+ * @param mime - MIME (Multipurpose Internet Mail Extensions)
88
+ * @return True if the given MIME is JSON, false otherwise.
89
+ */
90
+ isJsonMime(mime: string): boolean;
91
+ }
@@ -0,0 +1,104 @@
1
+ "use strict";
2
+ /* tslint:disable */
3
+ /* eslint-disable */
4
+ /**
5
+ * seal/backend/server/query.proto
6
+ * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
7
+ *
8
+ * The version of the OpenAPI document: version not set
9
+ *
10
+ *
11
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
12
+ * https://openapi-generator.tech
13
+ * Do not edit the class manually.
14
+ */
15
+ Object.defineProperty(exports, "__esModule", { value: true });
16
+ exports.Configuration = void 0;
17
+ class Configuration {
18
+ /**
19
+ * parameter for apiKey security
20
+ * @param name security name
21
+ * @memberof Configuration
22
+ */
23
+ apiKey;
24
+ /**
25
+ * parameter for basic security
26
+ *
27
+ * @type {string}
28
+ * @memberof Configuration
29
+ */
30
+ username;
31
+ /**
32
+ * parameter for basic security
33
+ *
34
+ * @type {string}
35
+ * @memberof Configuration
36
+ */
37
+ password;
38
+ /**
39
+ * parameter for oauth2 security
40
+ * @param name security name
41
+ * @param scopes oauth2 scope
42
+ * @memberof Configuration
43
+ */
44
+ accessToken;
45
+ /**
46
+ * override base path
47
+ *
48
+ * @type {string}
49
+ * @memberof Configuration
50
+ */
51
+ basePath;
52
+ /**
53
+ * override server index
54
+ *
55
+ * @type {number}
56
+ * @memberof Configuration
57
+ */
58
+ serverIndex;
59
+ /**
60
+ * base options for axios calls
61
+ *
62
+ * @type {any}
63
+ * @memberof Configuration
64
+ */
65
+ baseOptions;
66
+ /**
67
+ * The FormData constructor that will be used to create multipart form data
68
+ * requests. You can inject this here so that execution environments that
69
+ * do not support the FormData class can still run the generated client.
70
+ *
71
+ * @type {new () => FormData}
72
+ */
73
+ formDataCtor;
74
+ constructor(param = {}) {
75
+ this.apiKey = param.apiKey;
76
+ this.username = param.username;
77
+ this.password = param.password;
78
+ this.accessToken = param.accessToken;
79
+ this.basePath = param.basePath;
80
+ this.serverIndex = param.serverIndex;
81
+ this.baseOptions = {
82
+ ...param.baseOptions,
83
+ headers: {
84
+ ...param.baseOptions?.headers,
85
+ },
86
+ };
87
+ this.formDataCtor = param.formDataCtor;
88
+ }
89
+ /**
90
+ * Check if the given MIME is a JSON MIME.
91
+ * JSON MIME examples:
92
+ * application/json
93
+ * application/json; charset=UTF8
94
+ * APPLICATION/JSON
95
+ * application/vnd.company+json
96
+ * @param mime - MIME (Multipurpose Internet Mail Extensions)
97
+ * @return True if the given MIME is JSON, false otherwise.
98
+ */
99
+ isJsonMime(mime) {
100
+ const jsonMime = new RegExp('^(application\/json|[^;/ \t]+\/[^;/ \t]+[+]json)[ \t]*(;.*)?$', 'i');
101
+ return mime !== null && (jsonMime.test(mime) || mime.toLowerCase() === 'application/json-patch+json');
102
+ }
103
+ }
104
+ exports.Configuration = Configuration;
package/lib/index.d.ts ADDED
@@ -0,0 +1,13 @@
1
+ /**
2
+ * seal/backend/server/query.proto
3
+ * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
4
+ *
5
+ * The version of the OpenAPI document: version not set
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
+ export * from "./api";
13
+ export * from "./configuration";
package/lib/index.js ADDED
@@ -0,0 +1,31 @@
1
+ "use strict";
2
+ /* tslint:disable */
3
+ /* eslint-disable */
4
+ /**
5
+ * seal/backend/server/query.proto
6
+ * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
7
+ *
8
+ * The version of the OpenAPI document: version not set
9
+ *
10
+ *
11
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
12
+ * https://openapi-generator.tech
13
+ * Do not edit the class manually.
14
+ */
15
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
16
+ if (k2 === undefined) k2 = k;
17
+ var desc = Object.getOwnPropertyDescriptor(m, k);
18
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
19
+ desc = { enumerable: true, get: function() { return m[k]; } };
20
+ }
21
+ Object.defineProperty(o, k2, desc);
22
+ }) : (function(o, m, k, k2) {
23
+ if (k2 === undefined) k2 = k;
24
+ o[k2] = m[k];
25
+ }));
26
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
27
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
28
+ };
29
+ Object.defineProperty(exports, "__esModule", { value: true });
30
+ __exportStar(require("./api"), exports);
31
+ __exportStar(require("./configuration"), exports);
package/package.json ADDED
@@ -0,0 +1,37 @@
1
+ {
2
+ "name": "@seal-protocol/backendjs",
3
+ "version": "0.0.1",
4
+ "description": "Javascript SDK for Seal Backend",
5
+ "author": "amin <amin@refractedlabs.com>",
6
+ "homepage": "https://github.com/seal-protocol/backend/tree/main/ts-client#readme",
7
+ "license": "SEE LICENSE IN LICENSE.md",
8
+ "main": "lib/index.js",
9
+ "types": "lib/index.d.ts",
10
+ "files": [
11
+ "lib/**/*",
12
+ "LICENSE.md",
13
+ "README.md"
14
+ ],
15
+ "publishConfig": {
16
+ "registry": "https://registry.npmjs.org",
17
+ "access": "public"
18
+ },
19
+ "repository": {
20
+ "type": "git",
21
+ "url": "https://github.com/seal-protocol/backend"
22
+ },
23
+ "devDependencies": {
24
+ "@openapitools/openapi-generator-cli": "^2.21.4",
25
+ "@types/node": "^24.2.1",
26
+ "execa": "^9.6.0",
27
+ "ts-node": "^10.9.2",
28
+ "typescript": "^5.9.2"
29
+ },
30
+ "dependencies": {
31
+ "axios": "^1.11.0"
32
+ },
33
+ "scripts": {
34
+ "compile": "rm -rf lib && tsc",
35
+ "codegen": "node scripts/codegen.js"
36
+ }
37
+ }