@teemill/inserts 0.1.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/dist/api.js ADDED
@@ -0,0 +1,602 @@
1
+ "use strict";
2
+ /* tslint:disable */
3
+ /* eslint-disable */
4
+ /**
5
+ * Inserts API
6
+ * An API for managing order inserts in PodOS that automatically adds a free item to a customer\'s order when specific conditions are met, such as a first-time purchase.
7
+ *
8
+ * The version of the OpenAPI document: 0.1.1
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 __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
16
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
17
+ return new (P || (P = Promise))(function (resolve, reject) {
18
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
19
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
20
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
21
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
22
+ });
23
+ };
24
+ Object.defineProperty(exports, "__esModule", { value: true });
25
+ exports.InsertsTypesApi = exports.InsertsTypesApiFactory = exports.InsertsTypesApiFp = exports.InsertsTypesApiAxiosParamCreator = exports.InsertsApi = exports.InsertsApiFactory = exports.InsertsApiFp = exports.InsertsApiAxiosParamCreator = void 0;
26
+ const axios_1 = require("axios");
27
+ // Some imports not used depending on template conditions
28
+ // @ts-ignore
29
+ const common_1 = require("./common");
30
+ // @ts-ignore
31
+ const base_1 = require("./base");
32
+ /**
33
+ * InsertsApi - axios parameter creator
34
+ * @export
35
+ */
36
+ const InsertsApiAxiosParamCreator = function (configuration) {
37
+ return {
38
+ /**
39
+ * Create an insert for a project
40
+ * @summary Create an insert
41
+ * @param {string} project
42
+ * @param {CreateInsertRequest} createInsertRequest Create an insert
43
+ * @param {*} [options] Override http request option.
44
+ * @throws {RequiredError}
45
+ */
46
+ createInsert: (project_1, createInsertRequest_1, ...args_1) => __awaiter(this, [project_1, createInsertRequest_1, ...args_1], void 0, function* (project, createInsertRequest, options = {}) {
47
+ // verify required parameter 'project' is not null or undefined
48
+ (0, common_1.assertParamExists)('createInsert', 'project', project);
49
+ // verify required parameter 'createInsertRequest' is not null or undefined
50
+ (0, common_1.assertParamExists)('createInsert', 'createInsertRequest', createInsertRequest);
51
+ const localVarPath = `/v1/inserts`;
52
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
53
+ const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
54
+ let baseOptions;
55
+ if (configuration) {
56
+ baseOptions = configuration.baseOptions;
57
+ }
58
+ const localVarRequestOptions = Object.assign(Object.assign({ method: 'POST' }, baseOptions), options);
59
+ const localVarHeaderParameter = {};
60
+ const localVarQueryParameter = {};
61
+ // authentication session-oauth required
62
+ // oauth required
63
+ yield (0, common_1.setOAuthToObject)(localVarHeaderParameter, "session-oauth", [], configuration);
64
+ // authentication api-key required
65
+ yield (0, common_1.setApiKeyToObject)(localVarHeaderParameter, "Authorization", configuration);
66
+ if (project !== undefined) {
67
+ localVarQueryParameter['project'] = project;
68
+ }
69
+ localVarHeaderParameter['Content-Type'] = 'application/json';
70
+ (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
71
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
72
+ localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
73
+ localVarRequestOptions.data = (0, common_1.serializeDataIfNeeded)(createInsertRequest, localVarRequestOptions, configuration);
74
+ return {
75
+ url: (0, common_1.toPathString)(localVarUrlObj),
76
+ options: localVarRequestOptions,
77
+ };
78
+ }),
79
+ /**
80
+ * Retrieve details for a specific insert for a project
81
+ * @summary Retrieve an insert for a project
82
+ * @param {string} insertId Filter by insert ID
83
+ * @param {string} project
84
+ * @param {*} [options] Override http request option.
85
+ * @throws {RequiredError}
86
+ */
87
+ getInsert: (insertId_1, project_1, ...args_1) => __awaiter(this, [insertId_1, project_1, ...args_1], void 0, function* (insertId, project, options = {}) {
88
+ // verify required parameter 'insertId' is not null or undefined
89
+ (0, common_1.assertParamExists)('getInsert', 'insertId', insertId);
90
+ // verify required parameter 'project' is not null or undefined
91
+ (0, common_1.assertParamExists)('getInsert', 'project', project);
92
+ const localVarPath = `/v1/inserts/{insertId}`
93
+ .replace(`{${"insertId"}}`, encodeURIComponent(String(insertId)));
94
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
95
+ const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
96
+ let baseOptions;
97
+ if (configuration) {
98
+ baseOptions = configuration.baseOptions;
99
+ }
100
+ const localVarRequestOptions = Object.assign(Object.assign({ method: 'GET' }, baseOptions), options);
101
+ const localVarHeaderParameter = {};
102
+ const localVarQueryParameter = {};
103
+ // authentication session-oauth required
104
+ // oauth required
105
+ yield (0, common_1.setOAuthToObject)(localVarHeaderParameter, "session-oauth", [], configuration);
106
+ // authentication api-key required
107
+ yield (0, common_1.setApiKeyToObject)(localVarHeaderParameter, "Authorization", configuration);
108
+ if (project !== undefined) {
109
+ localVarQueryParameter['project'] = project;
110
+ }
111
+ (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
112
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
113
+ localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
114
+ return {
115
+ url: (0, common_1.toPathString)(localVarUrlObj),
116
+ options: localVarRequestOptions,
117
+ };
118
+ }),
119
+ /**
120
+ * List your project inserts
121
+ * @summary List project inserts
122
+ * @param {string} project
123
+ * @param {number} [pageToken] Page reference token
124
+ * @param {number} [pageSize] Max page size. This is the maximum page size that will be returned, but it might be smaller.
125
+ * @param {string} [search] Search for inserts by id or name
126
+ * @param {*} [options] Override http request option.
127
+ * @throws {RequiredError}
128
+ */
129
+ listInserts: (project_1, pageToken_1, pageSize_1, search_1, ...args_1) => __awaiter(this, [project_1, pageToken_1, pageSize_1, search_1, ...args_1], void 0, function* (project, pageToken, pageSize, search, options = {}) {
130
+ // verify required parameter 'project' is not null or undefined
131
+ (0, common_1.assertParamExists)('listInserts', 'project', project);
132
+ const localVarPath = `/v1/inserts`;
133
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
134
+ const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
135
+ let baseOptions;
136
+ if (configuration) {
137
+ baseOptions = configuration.baseOptions;
138
+ }
139
+ const localVarRequestOptions = Object.assign(Object.assign({ method: 'GET' }, baseOptions), options);
140
+ const localVarHeaderParameter = {};
141
+ const localVarQueryParameter = {};
142
+ // authentication session-oauth required
143
+ // oauth required
144
+ yield (0, common_1.setOAuthToObject)(localVarHeaderParameter, "session-oauth", [], configuration);
145
+ // authentication api-key required
146
+ yield (0, common_1.setApiKeyToObject)(localVarHeaderParameter, "Authorization", configuration);
147
+ if (project !== undefined) {
148
+ localVarQueryParameter['project'] = project;
149
+ }
150
+ if (pageToken !== undefined) {
151
+ localVarQueryParameter['pageToken'] = pageToken;
152
+ }
153
+ if (pageSize !== undefined) {
154
+ localVarQueryParameter['pageSize'] = pageSize;
155
+ }
156
+ if (search !== undefined) {
157
+ localVarQueryParameter['search'] = search;
158
+ }
159
+ (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
160
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
161
+ localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
162
+ return {
163
+ url: (0, common_1.toPathString)(localVarUrlObj),
164
+ options: localVarRequestOptions,
165
+ };
166
+ }),
167
+ /**
168
+ * Update an insert for a project
169
+ * @summary Update an insert
170
+ * @param {string} insertId Filter by insert ID
171
+ * @param {string} project
172
+ * @param {UpdateInsertRequest} updateInsertRequest Update an insert
173
+ * @param {*} [options] Override http request option.
174
+ * @throws {RequiredError}
175
+ */
176
+ updateInsert: (insertId_1, project_1, updateInsertRequest_1, ...args_1) => __awaiter(this, [insertId_1, project_1, updateInsertRequest_1, ...args_1], void 0, function* (insertId, project, updateInsertRequest, options = {}) {
177
+ // verify required parameter 'insertId' is not null or undefined
178
+ (0, common_1.assertParamExists)('updateInsert', 'insertId', insertId);
179
+ // verify required parameter 'project' is not null or undefined
180
+ (0, common_1.assertParamExists)('updateInsert', 'project', project);
181
+ // verify required parameter 'updateInsertRequest' is not null or undefined
182
+ (0, common_1.assertParamExists)('updateInsert', 'updateInsertRequest', updateInsertRequest);
183
+ const localVarPath = `/v1/inserts/{insertId}`
184
+ .replace(`{${"insertId"}}`, encodeURIComponent(String(insertId)));
185
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
186
+ const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
187
+ let baseOptions;
188
+ if (configuration) {
189
+ baseOptions = configuration.baseOptions;
190
+ }
191
+ const localVarRequestOptions = Object.assign(Object.assign({ method: 'PATCH' }, baseOptions), options);
192
+ const localVarHeaderParameter = {};
193
+ const localVarQueryParameter = {};
194
+ // authentication session-oauth required
195
+ // oauth required
196
+ yield (0, common_1.setOAuthToObject)(localVarHeaderParameter, "session-oauth", [], configuration);
197
+ // authentication api-key required
198
+ yield (0, common_1.setApiKeyToObject)(localVarHeaderParameter, "Authorization", configuration);
199
+ if (project !== undefined) {
200
+ localVarQueryParameter['project'] = project;
201
+ }
202
+ localVarHeaderParameter['Content-Type'] = 'application/json';
203
+ (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
204
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
205
+ localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
206
+ localVarRequestOptions.data = (0, common_1.serializeDataIfNeeded)(updateInsertRequest, localVarRequestOptions, configuration);
207
+ return {
208
+ url: (0, common_1.toPathString)(localVarUrlObj),
209
+ options: localVarRequestOptions,
210
+ };
211
+ }),
212
+ };
213
+ };
214
+ exports.InsertsApiAxiosParamCreator = InsertsApiAxiosParamCreator;
215
+ /**
216
+ * InsertsApi - functional programming interface
217
+ * @export
218
+ */
219
+ const InsertsApiFp = function (configuration) {
220
+ const localVarAxiosParamCreator = (0, exports.InsertsApiAxiosParamCreator)(configuration);
221
+ return {
222
+ /**
223
+ * Create an insert for a project
224
+ * @summary Create an insert
225
+ * @param {string} project
226
+ * @param {CreateInsertRequest} createInsertRequest Create an insert
227
+ * @param {*} [options] Override http request option.
228
+ * @throws {RequiredError}
229
+ */
230
+ createInsert(project, createInsertRequest, options) {
231
+ return __awaiter(this, void 0, void 0, function* () {
232
+ var _a, _b, _c;
233
+ const localVarAxiosArgs = yield localVarAxiosParamCreator.createInsert(project, createInsertRequest, options);
234
+ const localVarOperationServerIndex = (_a = configuration === null || configuration === void 0 ? void 0 : configuration.serverIndex) !== null && _a !== void 0 ? _a : 0;
235
+ const localVarOperationServerBasePath = (_c = (_b = base_1.operationServerMap['InsertsApi.createInsert']) === null || _b === void 0 ? void 0 : _b[localVarOperationServerIndex]) === null || _c === void 0 ? void 0 : _c.url;
236
+ return (axios, basePath) => (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
237
+ });
238
+ },
239
+ /**
240
+ * Retrieve details for a specific insert for a project
241
+ * @summary Retrieve an insert for a project
242
+ * @param {string} insertId Filter by insert ID
243
+ * @param {string} project
244
+ * @param {*} [options] Override http request option.
245
+ * @throws {RequiredError}
246
+ */
247
+ getInsert(insertId, project, options) {
248
+ return __awaiter(this, void 0, void 0, function* () {
249
+ var _a, _b, _c;
250
+ const localVarAxiosArgs = yield localVarAxiosParamCreator.getInsert(insertId, project, options);
251
+ const localVarOperationServerIndex = (_a = configuration === null || configuration === void 0 ? void 0 : configuration.serverIndex) !== null && _a !== void 0 ? _a : 0;
252
+ const localVarOperationServerBasePath = (_c = (_b = base_1.operationServerMap['InsertsApi.getInsert']) === null || _b === void 0 ? void 0 : _b[localVarOperationServerIndex]) === null || _c === void 0 ? void 0 : _c.url;
253
+ return (axios, basePath) => (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
254
+ });
255
+ },
256
+ /**
257
+ * List your project inserts
258
+ * @summary List project inserts
259
+ * @param {string} project
260
+ * @param {number} [pageToken] Page reference token
261
+ * @param {number} [pageSize] Max page size. This is the maximum page size that will be returned, but it might be smaller.
262
+ * @param {string} [search] Search for inserts by id or name
263
+ * @param {*} [options] Override http request option.
264
+ * @throws {RequiredError}
265
+ */
266
+ listInserts(project, pageToken, pageSize, search, options) {
267
+ return __awaiter(this, void 0, void 0, function* () {
268
+ var _a, _b, _c;
269
+ const localVarAxiosArgs = yield localVarAxiosParamCreator.listInserts(project, pageToken, pageSize, search, options);
270
+ const localVarOperationServerIndex = (_a = configuration === null || configuration === void 0 ? void 0 : configuration.serverIndex) !== null && _a !== void 0 ? _a : 0;
271
+ const localVarOperationServerBasePath = (_c = (_b = base_1.operationServerMap['InsertsApi.listInserts']) === null || _b === void 0 ? void 0 : _b[localVarOperationServerIndex]) === null || _c === void 0 ? void 0 : _c.url;
272
+ return (axios, basePath) => (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
273
+ });
274
+ },
275
+ /**
276
+ * Update an insert for a project
277
+ * @summary Update an insert
278
+ * @param {string} insertId Filter by insert ID
279
+ * @param {string} project
280
+ * @param {UpdateInsertRequest} updateInsertRequest Update an insert
281
+ * @param {*} [options] Override http request option.
282
+ * @throws {RequiredError}
283
+ */
284
+ updateInsert(insertId, project, updateInsertRequest, options) {
285
+ return __awaiter(this, void 0, void 0, function* () {
286
+ var _a, _b, _c;
287
+ const localVarAxiosArgs = yield localVarAxiosParamCreator.updateInsert(insertId, project, updateInsertRequest, options);
288
+ const localVarOperationServerIndex = (_a = configuration === null || configuration === void 0 ? void 0 : configuration.serverIndex) !== null && _a !== void 0 ? _a : 0;
289
+ const localVarOperationServerBasePath = (_c = (_b = base_1.operationServerMap['InsertsApi.updateInsert']) === null || _b === void 0 ? void 0 : _b[localVarOperationServerIndex]) === null || _c === void 0 ? void 0 : _c.url;
290
+ return (axios, basePath) => (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
291
+ });
292
+ },
293
+ };
294
+ };
295
+ exports.InsertsApiFp = InsertsApiFp;
296
+ /**
297
+ * InsertsApi - factory interface
298
+ * @export
299
+ */
300
+ const InsertsApiFactory = function (configuration, basePath, axios) {
301
+ const localVarFp = (0, exports.InsertsApiFp)(configuration);
302
+ return {
303
+ /**
304
+ * Create an insert for a project
305
+ * @summary Create an insert
306
+ * @param {InsertsApiCreateInsertRequest} requestParameters Request parameters.
307
+ * @param {*} [options] Override http request option.
308
+ * @throws {RequiredError}
309
+ */
310
+ createInsert(requestParameters, options) {
311
+ return localVarFp.createInsert(requestParameters.project, requestParameters.createInsertRequest, options).then((request) => request(axios, basePath));
312
+ },
313
+ /**
314
+ * Retrieve details for a specific insert for a project
315
+ * @summary Retrieve an insert for a project
316
+ * @param {InsertsApiGetInsertRequest} requestParameters Request parameters.
317
+ * @param {*} [options] Override http request option.
318
+ * @throws {RequiredError}
319
+ */
320
+ getInsert(requestParameters, options) {
321
+ return localVarFp.getInsert(requestParameters.insertId, requestParameters.project, options).then((request) => request(axios, basePath));
322
+ },
323
+ /**
324
+ * List your project inserts
325
+ * @summary List project inserts
326
+ * @param {InsertsApiListInsertsRequest} requestParameters Request parameters.
327
+ * @param {*} [options] Override http request option.
328
+ * @throws {RequiredError}
329
+ */
330
+ listInserts(requestParameters, options) {
331
+ return localVarFp.listInserts(requestParameters.project, requestParameters.pageToken, requestParameters.pageSize, requestParameters.search, options).then((request) => request(axios, basePath));
332
+ },
333
+ /**
334
+ * Update an insert for a project
335
+ * @summary Update an insert
336
+ * @param {InsertsApiUpdateInsertRequest} requestParameters Request parameters.
337
+ * @param {*} [options] Override http request option.
338
+ * @throws {RequiredError}
339
+ */
340
+ updateInsert(requestParameters, options) {
341
+ return localVarFp.updateInsert(requestParameters.insertId, requestParameters.project, requestParameters.updateInsertRequest, options).then((request) => request(axios, basePath));
342
+ },
343
+ };
344
+ };
345
+ exports.InsertsApiFactory = InsertsApiFactory;
346
+ /**
347
+ * InsertsApi - object-oriented interface
348
+ * @export
349
+ * @class InsertsApi
350
+ * @extends {BaseAPI}
351
+ */
352
+ class InsertsApi extends base_1.BaseAPI {
353
+ /**
354
+ * Create an insert for a project
355
+ * @summary Create an insert
356
+ * @param {InsertsApiCreateInsertRequest} requestParameters Request parameters.
357
+ * @param {*} [options] Override http request option.
358
+ * @throws {RequiredError}
359
+ * @memberof InsertsApi
360
+ */
361
+ createInsert(requestParameters, options) {
362
+ return (0, exports.InsertsApiFp)(this.configuration).createInsert(requestParameters.project, requestParameters.createInsertRequest, options).then((request) => request(this.axios, this.basePath));
363
+ }
364
+ /**
365
+ * Retrieve details for a specific insert for a project
366
+ * @summary Retrieve an insert for a project
367
+ * @param {InsertsApiGetInsertRequest} requestParameters Request parameters.
368
+ * @param {*} [options] Override http request option.
369
+ * @throws {RequiredError}
370
+ * @memberof InsertsApi
371
+ */
372
+ getInsert(requestParameters, options) {
373
+ return (0, exports.InsertsApiFp)(this.configuration).getInsert(requestParameters.insertId, requestParameters.project, options).then((request) => request(this.axios, this.basePath));
374
+ }
375
+ /**
376
+ * List your project inserts
377
+ * @summary List project inserts
378
+ * @param {InsertsApiListInsertsRequest} requestParameters Request parameters.
379
+ * @param {*} [options] Override http request option.
380
+ * @throws {RequiredError}
381
+ * @memberof InsertsApi
382
+ */
383
+ listInserts(requestParameters, options) {
384
+ return (0, exports.InsertsApiFp)(this.configuration).listInserts(requestParameters.project, requestParameters.pageToken, requestParameters.pageSize, requestParameters.search, options).then((request) => request(this.axios, this.basePath));
385
+ }
386
+ /**
387
+ * Update an insert for a project
388
+ * @summary Update an insert
389
+ * @param {InsertsApiUpdateInsertRequest} requestParameters Request parameters.
390
+ * @param {*} [options] Override http request option.
391
+ * @throws {RequiredError}
392
+ * @memberof InsertsApi
393
+ */
394
+ updateInsert(requestParameters, options) {
395
+ return (0, exports.InsertsApiFp)(this.configuration).updateInsert(requestParameters.insertId, requestParameters.project, requestParameters.updateInsertRequest, options).then((request) => request(this.axios, this.basePath));
396
+ }
397
+ }
398
+ exports.InsertsApi = InsertsApi;
399
+ /**
400
+ * InsertsTypesApi - axios parameter creator
401
+ * @export
402
+ */
403
+ const InsertsTypesApiAxiosParamCreator = function (configuration) {
404
+ return {
405
+ /**
406
+ * Retrieve details for a specific insert type
407
+ * @summary Retrieve an insert type
408
+ * @param {string} insertTypeId Filter by insert type ID
409
+ * @param {string} project
410
+ * @param {*} [options] Override http request option.
411
+ * @throws {RequiredError}
412
+ */
413
+ getInsertType: (insertTypeId_1, project_1, ...args_1) => __awaiter(this, [insertTypeId_1, project_1, ...args_1], void 0, function* (insertTypeId, project, options = {}) {
414
+ // verify required parameter 'insertTypeId' is not null or undefined
415
+ (0, common_1.assertParamExists)('getInsertType', 'insertTypeId', insertTypeId);
416
+ // verify required parameter 'project' is not null or undefined
417
+ (0, common_1.assertParamExists)('getInsertType', 'project', project);
418
+ const localVarPath = `/v1/inserts/types/{insertTypeId}`
419
+ .replace(`{${"insertTypeId"}}`, encodeURIComponent(String(insertTypeId)));
420
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
421
+ const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
422
+ let baseOptions;
423
+ if (configuration) {
424
+ baseOptions = configuration.baseOptions;
425
+ }
426
+ const localVarRequestOptions = Object.assign(Object.assign({ method: 'GET' }, baseOptions), options);
427
+ const localVarHeaderParameter = {};
428
+ const localVarQueryParameter = {};
429
+ // authentication session-oauth required
430
+ // oauth required
431
+ yield (0, common_1.setOAuthToObject)(localVarHeaderParameter, "session-oauth", [], configuration);
432
+ // authentication api-key required
433
+ yield (0, common_1.setApiKeyToObject)(localVarHeaderParameter, "Authorization", configuration);
434
+ if (project !== undefined) {
435
+ localVarQueryParameter['project'] = project;
436
+ }
437
+ (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
438
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
439
+ localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
440
+ return {
441
+ url: (0, common_1.toPathString)(localVarUrlObj),
442
+ options: localVarRequestOptions,
443
+ };
444
+ }),
445
+ /**
446
+ * List all insert types
447
+ * @summary List insert types
448
+ * @param {string} project
449
+ * @param {number} [pageToken] Page reference token
450
+ * @param {number} [pageSize] Max page size. This is the maximum page size that will be returned, but it might be smaller.
451
+ * @param {string} [search] Search for inserts by id or name
452
+ * @param {*} [options] Override http request option.
453
+ * @throws {RequiredError}
454
+ */
455
+ listInsertTypes: (project_1, pageToken_1, pageSize_1, search_1, ...args_1) => __awaiter(this, [project_1, pageToken_1, pageSize_1, search_1, ...args_1], void 0, function* (project, pageToken, pageSize, search, options = {}) {
456
+ // verify required parameter 'project' is not null or undefined
457
+ (0, common_1.assertParamExists)('listInsertTypes', 'project', project);
458
+ const localVarPath = `/v1/inserts/types`;
459
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
460
+ const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
461
+ let baseOptions;
462
+ if (configuration) {
463
+ baseOptions = configuration.baseOptions;
464
+ }
465
+ const localVarRequestOptions = Object.assign(Object.assign({ method: 'GET' }, baseOptions), options);
466
+ const localVarHeaderParameter = {};
467
+ const localVarQueryParameter = {};
468
+ // authentication session-oauth required
469
+ // oauth required
470
+ yield (0, common_1.setOAuthToObject)(localVarHeaderParameter, "session-oauth", [], configuration);
471
+ // authentication api-key required
472
+ yield (0, common_1.setApiKeyToObject)(localVarHeaderParameter, "Authorization", configuration);
473
+ if (project !== undefined) {
474
+ localVarQueryParameter['project'] = project;
475
+ }
476
+ if (pageToken !== undefined) {
477
+ localVarQueryParameter['pageToken'] = pageToken;
478
+ }
479
+ if (pageSize !== undefined) {
480
+ localVarQueryParameter['pageSize'] = pageSize;
481
+ }
482
+ if (search !== undefined) {
483
+ localVarQueryParameter['search'] = search;
484
+ }
485
+ (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
486
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
487
+ localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
488
+ return {
489
+ url: (0, common_1.toPathString)(localVarUrlObj),
490
+ options: localVarRequestOptions,
491
+ };
492
+ }),
493
+ };
494
+ };
495
+ exports.InsertsTypesApiAxiosParamCreator = InsertsTypesApiAxiosParamCreator;
496
+ /**
497
+ * InsertsTypesApi - functional programming interface
498
+ * @export
499
+ */
500
+ const InsertsTypesApiFp = function (configuration) {
501
+ const localVarAxiosParamCreator = (0, exports.InsertsTypesApiAxiosParamCreator)(configuration);
502
+ return {
503
+ /**
504
+ * Retrieve details for a specific insert type
505
+ * @summary Retrieve an insert type
506
+ * @param {string} insertTypeId Filter by insert type ID
507
+ * @param {string} project
508
+ * @param {*} [options] Override http request option.
509
+ * @throws {RequiredError}
510
+ */
511
+ getInsertType(insertTypeId, project, options) {
512
+ return __awaiter(this, void 0, void 0, function* () {
513
+ var _a, _b, _c;
514
+ const localVarAxiosArgs = yield localVarAxiosParamCreator.getInsertType(insertTypeId, project, options);
515
+ const localVarOperationServerIndex = (_a = configuration === null || configuration === void 0 ? void 0 : configuration.serverIndex) !== null && _a !== void 0 ? _a : 0;
516
+ const localVarOperationServerBasePath = (_c = (_b = base_1.operationServerMap['InsertsTypesApi.getInsertType']) === null || _b === void 0 ? void 0 : _b[localVarOperationServerIndex]) === null || _c === void 0 ? void 0 : _c.url;
517
+ return (axios, basePath) => (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
518
+ });
519
+ },
520
+ /**
521
+ * List all insert types
522
+ * @summary List insert types
523
+ * @param {string} project
524
+ * @param {number} [pageToken] Page reference token
525
+ * @param {number} [pageSize] Max page size. This is the maximum page size that will be returned, but it might be smaller.
526
+ * @param {string} [search] Search for inserts by id or name
527
+ * @param {*} [options] Override http request option.
528
+ * @throws {RequiredError}
529
+ */
530
+ listInsertTypes(project, pageToken, pageSize, search, options) {
531
+ return __awaiter(this, void 0, void 0, function* () {
532
+ var _a, _b, _c;
533
+ const localVarAxiosArgs = yield localVarAxiosParamCreator.listInsertTypes(project, pageToken, pageSize, search, options);
534
+ const localVarOperationServerIndex = (_a = configuration === null || configuration === void 0 ? void 0 : configuration.serverIndex) !== null && _a !== void 0 ? _a : 0;
535
+ const localVarOperationServerBasePath = (_c = (_b = base_1.operationServerMap['InsertsTypesApi.listInsertTypes']) === null || _b === void 0 ? void 0 : _b[localVarOperationServerIndex]) === null || _c === void 0 ? void 0 : _c.url;
536
+ return (axios, basePath) => (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
537
+ });
538
+ },
539
+ };
540
+ };
541
+ exports.InsertsTypesApiFp = InsertsTypesApiFp;
542
+ /**
543
+ * InsertsTypesApi - factory interface
544
+ * @export
545
+ */
546
+ const InsertsTypesApiFactory = function (configuration, basePath, axios) {
547
+ const localVarFp = (0, exports.InsertsTypesApiFp)(configuration);
548
+ return {
549
+ /**
550
+ * Retrieve details for a specific insert type
551
+ * @summary Retrieve an insert type
552
+ * @param {InsertsTypesApiGetInsertTypeRequest} requestParameters Request parameters.
553
+ * @param {*} [options] Override http request option.
554
+ * @throws {RequiredError}
555
+ */
556
+ getInsertType(requestParameters, options) {
557
+ return localVarFp.getInsertType(requestParameters.insertTypeId, requestParameters.project, options).then((request) => request(axios, basePath));
558
+ },
559
+ /**
560
+ * List all insert types
561
+ * @summary List insert types
562
+ * @param {InsertsTypesApiListInsertTypesRequest} requestParameters Request parameters.
563
+ * @param {*} [options] Override http request option.
564
+ * @throws {RequiredError}
565
+ */
566
+ listInsertTypes(requestParameters, options) {
567
+ return localVarFp.listInsertTypes(requestParameters.project, requestParameters.pageToken, requestParameters.pageSize, requestParameters.search, options).then((request) => request(axios, basePath));
568
+ },
569
+ };
570
+ };
571
+ exports.InsertsTypesApiFactory = InsertsTypesApiFactory;
572
+ /**
573
+ * InsertsTypesApi - object-oriented interface
574
+ * @export
575
+ * @class InsertsTypesApi
576
+ * @extends {BaseAPI}
577
+ */
578
+ class InsertsTypesApi extends base_1.BaseAPI {
579
+ /**
580
+ * Retrieve details for a specific insert type
581
+ * @summary Retrieve an insert type
582
+ * @param {InsertsTypesApiGetInsertTypeRequest} requestParameters Request parameters.
583
+ * @param {*} [options] Override http request option.
584
+ * @throws {RequiredError}
585
+ * @memberof InsertsTypesApi
586
+ */
587
+ getInsertType(requestParameters, options) {
588
+ return (0, exports.InsertsTypesApiFp)(this.configuration).getInsertType(requestParameters.insertTypeId, requestParameters.project, options).then((request) => request(this.axios, this.basePath));
589
+ }
590
+ /**
591
+ * List all insert types
592
+ * @summary List insert types
593
+ * @param {InsertsTypesApiListInsertTypesRequest} requestParameters Request parameters.
594
+ * @param {*} [options] Override http request option.
595
+ * @throws {RequiredError}
596
+ * @memberof InsertsTypesApi
597
+ */
598
+ listInsertTypes(requestParameters, options) {
599
+ return (0, exports.InsertsTypesApiFp)(this.configuration).listInsertTypes(requestParameters.project, requestParameters.pageToken, requestParameters.pageSize, requestParameters.search, options).then((request) => request(this.axios, this.basePath));
600
+ }
601
+ }
602
+ exports.InsertsTypesApi = InsertsTypesApi;
package/dist/base.d.ts ADDED
@@ -0,0 +1,66 @@
1
+ /**
2
+ * Inserts API
3
+ * An API for managing order inserts in PodOS that automatically adds a free item to a customer\'s order when specific conditions are met, such as a first-time purchase.
4
+ *
5
+ * The version of the OpenAPI document: 0.1.1
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 {};