@teemill/gfn-catalog 1.4.0 → 2.0.2

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.
Files changed (164) hide show
  1. package/.openapi-generator/FILES +6 -28
  2. package/README.md +3 -3
  3. package/api.ts +1892 -0
  4. package/base.ts +86 -0
  5. package/common.ts +150 -0
  6. package/configuration.ts +110 -0
  7. package/dist/api.d.ts +1287 -0
  8. package/dist/api.js +966 -0
  9. package/dist/base.d.ts +66 -0
  10. package/dist/base.js +65 -0
  11. package/dist/common.d.ts +65 -0
  12. package/dist/common.js +161 -0
  13. package/dist/configuration.d.ts +91 -0
  14. package/dist/configuration.js +43 -0
  15. package/dist/esm/api.d.ts +1287 -0
  16. package/dist/esm/api.js +947 -0
  17. package/dist/esm/base.d.ts +66 -0
  18. package/dist/esm/{models/AttributeThumbnail.js → base.js} +38 -26
  19. package/dist/esm/common.d.ts +65 -0
  20. package/dist/esm/common.js +149 -0
  21. package/dist/esm/configuration.d.ts +91 -0
  22. package/dist/esm/configuration.js +39 -0
  23. package/dist/esm/index.d.ts +13 -3
  24. package/dist/esm/index.js +13 -3
  25. package/dist/index.d.ts +13 -3
  26. package/dist/index.js +15 -5
  27. package/git_push.sh +57 -0
  28. package/{dist/models/Stock.d.ts → index.ts} +8 -21
  29. package/package.json +14 -2
  30. package/tsconfig.json +4 -6
  31. package/dist/apis/ProductsApi.d.ts +0 -35
  32. package/dist/apis/ProductsApi.js +0 -85
  33. package/dist/apis/StatementsApi.d.ts +0 -48
  34. package/dist/apis/StatementsApi.js +0 -127
  35. package/dist/apis/TransactionsApi.d.ts +0 -48
  36. package/dist/apis/TransactionsApi.js +0 -129
  37. package/dist/apis/VariantsApi.d.ts +0 -82
  38. package/dist/apis/VariantsApi.js +0 -229
  39. package/dist/apis/index.d.ts +0 -4
  40. package/dist/apis/index.js +0 -22
  41. package/dist/esm/apis/ProductsApi.d.ts +0 -35
  42. package/dist/esm/apis/ProductsApi.js +0 -81
  43. package/dist/esm/apis/StatementsApi.d.ts +0 -48
  44. package/dist/esm/apis/StatementsApi.js +0 -123
  45. package/dist/esm/apis/TransactionsApi.d.ts +0 -48
  46. package/dist/esm/apis/TransactionsApi.js +0 -125
  47. package/dist/esm/apis/VariantsApi.d.ts +0 -82
  48. package/dist/esm/apis/VariantsApi.js +0 -225
  49. package/dist/esm/apis/index.d.ts +0 -4
  50. package/dist/esm/apis/index.js +0 -6
  51. package/dist/esm/models/ApiError.d.ts +0 -37
  52. package/dist/esm/models/ApiError.js +0 -42
  53. package/dist/esm/models/ApiValidationError.d.ts +0 -39
  54. package/dist/esm/models/ApiValidationError.js +0 -44
  55. package/dist/esm/models/Attribute.d.ts +0 -50
  56. package/dist/esm/models/Attribute.js +0 -49
  57. package/dist/esm/models/AttributeThumbnail.d.ts +0 -46
  58. package/dist/esm/models/ExportTransactionsRequest.d.ts +0 -43
  59. package/dist/esm/models/ExportTransactionsRequest.js +0 -42
  60. package/dist/esm/models/Image.d.ts +0 -67
  61. package/dist/esm/models/Image.js +0 -50
  62. package/dist/esm/models/ListStatements200Response.d.ts +0 -38
  63. package/dist/esm/models/ListStatements200Response.js +0 -41
  64. package/dist/esm/models/ListTransactions200Response.d.ts +0 -38
  65. package/dist/esm/models/ListTransactions200Response.js +0 -41
  66. package/dist/esm/models/Product.d.ts +0 -67
  67. package/dist/esm/models/Product.js +0 -52
  68. package/dist/esm/models/ProductsResponse.d.ts +0 -38
  69. package/dist/esm/models/ProductsResponse.js +0 -41
  70. package/dist/esm/models/Statement.d.ts +0 -61
  71. package/dist/esm/models/Statement.js +0 -60
  72. package/dist/esm/models/Stock.d.ts +0 -31
  73. package/dist/esm/models/Stock.js +0 -38
  74. package/dist/esm/models/StockResponse.d.ts +0 -38
  75. package/dist/esm/models/StockResponse.js +0 -41
  76. package/dist/esm/models/Transaction.d.ts +0 -68
  77. package/dist/esm/models/Transaction.js +0 -61
  78. package/dist/esm/models/TransactionOrder.d.ts +0 -37
  79. package/dist/esm/models/TransactionOrder.js +0 -44
  80. package/dist/esm/models/Variant.d.ts +0 -78
  81. package/dist/esm/models/Variant.js +0 -61
  82. package/dist/esm/models/VariantManufacturerOrigin.d.ts +0 -37
  83. package/dist/esm/models/VariantManufacturerOrigin.js +0 -40
  84. package/dist/esm/models/VariantProduct.d.ts +0 -37
  85. package/dist/esm/models/VariantProduct.js +0 -40
  86. package/dist/esm/models/VariantStock.d.ts +0 -50
  87. package/dist/esm/models/VariantStock.js +0 -45
  88. package/dist/esm/models/VariantsResponse.d.ts +0 -38
  89. package/dist/esm/models/VariantsResponse.js +0 -41
  90. package/dist/esm/models/index.d.ts +0 -20
  91. package/dist/esm/models/index.js +0 -22
  92. package/dist/esm/runtime.d.ts +0 -187
  93. package/dist/esm/runtime.js +0 -333
  94. package/dist/models/ApiError.d.ts +0 -37
  95. package/dist/models/ApiError.js +0 -49
  96. package/dist/models/ApiValidationError.d.ts +0 -39
  97. package/dist/models/ApiValidationError.js +0 -51
  98. package/dist/models/Attribute.d.ts +0 -50
  99. package/dist/models/Attribute.js +0 -56
  100. package/dist/models/AttributeThumbnail.d.ts +0 -46
  101. package/dist/models/AttributeThumbnail.js +0 -55
  102. package/dist/models/ExportTransactionsRequest.d.ts +0 -43
  103. package/dist/models/ExportTransactionsRequest.js +0 -49
  104. package/dist/models/Image.d.ts +0 -67
  105. package/dist/models/Image.js +0 -57
  106. package/dist/models/ListStatements200Response.d.ts +0 -38
  107. package/dist/models/ListStatements200Response.js +0 -48
  108. package/dist/models/ListTransactions200Response.d.ts +0 -38
  109. package/dist/models/ListTransactions200Response.js +0 -48
  110. package/dist/models/Product.d.ts +0 -67
  111. package/dist/models/Product.js +0 -59
  112. package/dist/models/ProductsResponse.d.ts +0 -38
  113. package/dist/models/ProductsResponse.js +0 -48
  114. package/dist/models/Statement.d.ts +0 -61
  115. package/dist/models/Statement.js +0 -67
  116. package/dist/models/Stock.js +0 -45
  117. package/dist/models/StockResponse.d.ts +0 -38
  118. package/dist/models/StockResponse.js +0 -48
  119. package/dist/models/Transaction.d.ts +0 -68
  120. package/dist/models/Transaction.js +0 -68
  121. package/dist/models/TransactionOrder.d.ts +0 -37
  122. package/dist/models/TransactionOrder.js +0 -51
  123. package/dist/models/Variant.d.ts +0 -78
  124. package/dist/models/Variant.js +0 -68
  125. package/dist/models/VariantManufacturerOrigin.d.ts +0 -37
  126. package/dist/models/VariantManufacturerOrigin.js +0 -47
  127. package/dist/models/VariantProduct.d.ts +0 -37
  128. package/dist/models/VariantProduct.js +0 -47
  129. package/dist/models/VariantStock.d.ts +0 -50
  130. package/dist/models/VariantStock.js +0 -52
  131. package/dist/models/VariantsResponse.d.ts +0 -38
  132. package/dist/models/VariantsResponse.js +0 -48
  133. package/dist/models/index.d.ts +0 -20
  134. package/dist/models/index.js +0 -38
  135. package/dist/runtime.d.ts +0 -187
  136. package/dist/runtime.js +0 -349
  137. package/src/apis/ProductsApi.ts +0 -116
  138. package/src/apis/StatementsApi.ts +0 -177
  139. package/src/apis/TransactionsApi.ts +0 -180
  140. package/src/apis/VariantsApi.ts +0 -345
  141. package/src/apis/index.ts +0 -6
  142. package/src/index.ts +0 -5
  143. package/src/models/ApiError.ts +0 -69
  144. package/src/models/ApiValidationError.ts +0 -70
  145. package/src/models/Attribute.ts +0 -93
  146. package/src/models/AttributeThumbnail.ts +0 -80
  147. package/src/models/ExportTransactionsRequest.ts +0 -76
  148. package/src/models/Image.ts +0 -108
  149. package/src/models/ListStatements200Response.ts +0 -75
  150. package/src/models/ListTransactions200Response.ts +0 -75
  151. package/src/models/Product.ts +0 -109
  152. package/src/models/ProductsResponse.ts +0 -75
  153. package/src/models/Statement.ts +0 -106
  154. package/src/models/Stock.ts +0 -60
  155. package/src/models/StockResponse.ts +0 -75
  156. package/src/models/Transaction.ts +0 -120
  157. package/src/models/TransactionOrder.ts +0 -70
  158. package/src/models/Variant.ts +0 -149
  159. package/src/models/VariantManufacturerOrigin.ts +0 -68
  160. package/src/models/VariantProduct.ts +0 -68
  161. package/src/models/VariantStock.ts +0 -91
  162. package/src/models/VariantsResponse.ts +0 -75
  163. package/src/models/index.ts +0 -22
  164. package/src/runtime.ts +0 -441
package/dist/runtime.js DELETED
@@ -1,349 +0,0 @@
1
- "use strict";
2
- /* tslint:disable */
3
- /* eslint-disable */
4
- /**
5
- * GFN Catalog API
6
- * Use this API to access the Global Fulfilment Network, which contains all the warehouse products and variants available to a given project. Warehouse products represent the base products that can be printed on. Products are the top level items, and variants are the different options available for each product. For example, a product might be a T-shirt, and each variant represents a different size and colour combination of that T-shirt. Use references to these warehouse products to create new product listings on your project via the Product Catalog API. Use the variant information to decide which options you would like to offer on each product listing.
7
- *
8
- * The version of the OpenAPI document: 1.4.0
9
- * Contact: hello@teemill.com
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.TextApiResponse = exports.BlobApiResponse = exports.VoidApiResponse = exports.JSONApiResponse = exports.canConsumeForm = exports.mapValues = exports.querystring = exports.exists = exports.COLLECTION_FORMATS = exports.RequiredError = exports.FetchError = exports.ResponseError = exports.BaseAPI = exports.DefaultConfig = exports.Configuration = exports.BASE_PATH = void 0;
26
- exports.BASE_PATH = "https://api.teemill.com".replace(/\/+$/, "");
27
- class Configuration {
28
- constructor(configuration = {}) {
29
- this.configuration = configuration;
30
- }
31
- set config(configuration) {
32
- this.configuration = configuration;
33
- }
34
- get basePath() {
35
- return this.configuration.basePath != null ? this.configuration.basePath : exports.BASE_PATH;
36
- }
37
- get fetchApi() {
38
- return this.configuration.fetchApi;
39
- }
40
- get middleware() {
41
- return this.configuration.middleware || [];
42
- }
43
- get queryParamsStringify() {
44
- return this.configuration.queryParamsStringify || querystring;
45
- }
46
- get username() {
47
- return this.configuration.username;
48
- }
49
- get password() {
50
- return this.configuration.password;
51
- }
52
- get apiKey() {
53
- const apiKey = this.configuration.apiKey;
54
- if (apiKey) {
55
- return typeof apiKey === 'function' ? apiKey : () => apiKey;
56
- }
57
- return undefined;
58
- }
59
- get accessToken() {
60
- const accessToken = this.configuration.accessToken;
61
- if (accessToken) {
62
- return typeof accessToken === 'function' ? accessToken : () => __awaiter(this, void 0, void 0, function* () { return accessToken; });
63
- }
64
- return undefined;
65
- }
66
- get headers() {
67
- return this.configuration.headers;
68
- }
69
- get credentials() {
70
- return this.configuration.credentials;
71
- }
72
- }
73
- exports.Configuration = Configuration;
74
- exports.DefaultConfig = new Configuration();
75
- /**
76
- * This is the base class for all generated API classes.
77
- */
78
- class BaseAPI {
79
- constructor(configuration = exports.DefaultConfig) {
80
- this.configuration = configuration;
81
- this.fetchApi = (url, init) => __awaiter(this, void 0, void 0, function* () {
82
- let fetchParams = { url, init };
83
- for (const middleware of this.middleware) {
84
- if (middleware.pre) {
85
- fetchParams = (yield middleware.pre(Object.assign({ fetch: this.fetchApi }, fetchParams))) || fetchParams;
86
- }
87
- }
88
- let response = undefined;
89
- try {
90
- response = yield (this.configuration.fetchApi || fetch)(fetchParams.url, fetchParams.init);
91
- }
92
- catch (e) {
93
- for (const middleware of this.middleware) {
94
- if (middleware.onError) {
95
- response = (yield middleware.onError({
96
- fetch: this.fetchApi,
97
- url: fetchParams.url,
98
- init: fetchParams.init,
99
- error: e,
100
- response: response ? response.clone() : undefined,
101
- })) || response;
102
- }
103
- }
104
- if (response === undefined) {
105
- if (e instanceof Error) {
106
- throw new FetchError(e, 'The request failed and the interceptors did not return an alternative response');
107
- }
108
- else {
109
- throw e;
110
- }
111
- }
112
- }
113
- for (const middleware of this.middleware) {
114
- if (middleware.post) {
115
- response = (yield middleware.post({
116
- fetch: this.fetchApi,
117
- url: fetchParams.url,
118
- init: fetchParams.init,
119
- response: response.clone(),
120
- })) || response;
121
- }
122
- }
123
- return response;
124
- });
125
- this.middleware = configuration.middleware;
126
- }
127
- isResponseError(error) {
128
- return error instanceof Error && error.name === 'ResponseError';
129
- }
130
- withMiddleware(...middlewares) {
131
- const next = this.clone();
132
- next.middleware = next.middleware.concat(...middlewares);
133
- return next;
134
- }
135
- withPreMiddleware(...preMiddlewares) {
136
- const middlewares = preMiddlewares.map((pre) => ({ pre }));
137
- return this.withMiddleware(...middlewares);
138
- }
139
- withPostMiddleware(...postMiddlewares) {
140
- const middlewares = postMiddlewares.map((post) => ({ post }));
141
- return this.withMiddleware(...middlewares);
142
- }
143
- /**
144
- * Check if the given MIME is a JSON MIME.
145
- * JSON MIME examples:
146
- * application/json
147
- * application/json; charset=UTF8
148
- * APPLICATION/JSON
149
- * application/vnd.company+json
150
- * @param mime - MIME (Multipurpose Internet Mail Extensions)
151
- * @return True if the given MIME is JSON, false otherwise.
152
- */
153
- isJsonMime(mime) {
154
- if (!mime) {
155
- return false;
156
- }
157
- return BaseAPI.jsonRegex.test(mime);
158
- }
159
- request(context, initOverrides) {
160
- return __awaiter(this, void 0, void 0, function* () {
161
- const { url, init } = yield this.createFetchParams(context, initOverrides);
162
- const response = yield this.fetchApi(url, init);
163
- if (response && (response.status >= 200 && response.status < 300)) {
164
- return response;
165
- }
166
- throw new ResponseError(response, 'Response returned an error code');
167
- });
168
- }
169
- createFetchParams(context, initOverrides) {
170
- return __awaiter(this, void 0, void 0, function* () {
171
- let url = this.configuration.basePath + context.path;
172
- if (context.query !== undefined && Object.keys(context.query).length !== 0) {
173
- // only add the querystring to the URL if there are query parameters.
174
- // this is done to avoid urls ending with a "?" character which buggy webservers
175
- // do not handle correctly sometimes.
176
- url += '?' + this.configuration.queryParamsStringify(context.query);
177
- }
178
- const headers = Object.assign({}, this.configuration.headers, context.headers);
179
- Object.keys(headers).forEach(key => headers[key] === undefined ? delete headers[key] : {});
180
- const initOverrideFn = typeof initOverrides === "function"
181
- ? initOverrides
182
- : () => __awaiter(this, void 0, void 0, function* () { return initOverrides; });
183
- const initParams = {
184
- method: context.method,
185
- headers,
186
- body: context.body,
187
- credentials: this.configuration.credentials,
188
- };
189
- const overriddenInit = Object.assign(Object.assign({}, initParams), (yield initOverrideFn({
190
- init: initParams,
191
- context,
192
- })));
193
- let body;
194
- if (isFormData(overriddenInit.body)
195
- || (overriddenInit.body instanceof URLSearchParams)
196
- || isBlob(overriddenInit.body)) {
197
- body = overriddenInit.body;
198
- }
199
- else if (this.isJsonMime(headers['Content-Type'])) {
200
- body = JSON.stringify(overriddenInit.body);
201
- }
202
- else {
203
- body = overriddenInit.body;
204
- }
205
- const init = Object.assign(Object.assign({}, overriddenInit), { body });
206
- return { url, init };
207
- });
208
- }
209
- /**
210
- * Create a shallow clone of `this` by constructing a new instance
211
- * and then shallow cloning data members.
212
- */
213
- clone() {
214
- const constructor = this.constructor;
215
- const next = new constructor(this.configuration);
216
- next.middleware = this.middleware.slice();
217
- return next;
218
- }
219
- }
220
- exports.BaseAPI = BaseAPI;
221
- BaseAPI.jsonRegex = new RegExp('^(:?application\/json|[^;/ \t]+\/[^;/ \t]+[+]json)[ \t]*(:?;.*)?$', 'i');
222
- ;
223
- function isBlob(value) {
224
- return typeof Blob !== 'undefined' && value instanceof Blob;
225
- }
226
- function isFormData(value) {
227
- return typeof FormData !== "undefined" && value instanceof FormData;
228
- }
229
- class ResponseError extends Error {
230
- constructor(response, msg) {
231
- super(msg);
232
- this.response = response;
233
- this.name = "ResponseError";
234
- }
235
- }
236
- exports.ResponseError = ResponseError;
237
- class FetchError extends Error {
238
- constructor(cause, msg) {
239
- super(msg);
240
- this.cause = cause;
241
- this.name = "FetchError";
242
- }
243
- }
244
- exports.FetchError = FetchError;
245
- class RequiredError extends Error {
246
- constructor(field, msg) {
247
- super(msg);
248
- this.field = field;
249
- this.name = "RequiredError";
250
- }
251
- }
252
- exports.RequiredError = RequiredError;
253
- exports.COLLECTION_FORMATS = {
254
- csv: ",",
255
- ssv: " ",
256
- tsv: "\t",
257
- pipes: "|",
258
- };
259
- function exists(json, key) {
260
- const value = json[key];
261
- return value !== null && value !== undefined;
262
- }
263
- exports.exists = exists;
264
- function querystring(params, prefix = '') {
265
- return Object.keys(params)
266
- .map(key => querystringSingleKey(key, params[key], prefix))
267
- .filter(part => part.length > 0)
268
- .join('&');
269
- }
270
- exports.querystring = querystring;
271
- function querystringSingleKey(key, value, keyPrefix = '') {
272
- const fullKey = keyPrefix + (keyPrefix.length ? `[${key}]` : key);
273
- if (value instanceof Array) {
274
- const multiValue = value.map(singleValue => encodeURIComponent(String(singleValue)))
275
- .join(`&${encodeURIComponent(fullKey)}[]=`);
276
- return `${encodeURIComponent(fullKey)}[]=${multiValue}`;
277
- }
278
- if (value instanceof Set) {
279
- const valueAsArray = Array.from(value);
280
- return querystringSingleKey(key, valueAsArray, keyPrefix);
281
- }
282
- if (value instanceof Date) {
283
- return `${encodeURIComponent(fullKey)}=${encodeURIComponent(value.toISOString())}`;
284
- }
285
- if (value instanceof Object) {
286
- return querystring(value, fullKey);
287
- }
288
- return `${encodeURIComponent(fullKey)}=${encodeURIComponent(String(value))}`;
289
- }
290
- function mapValues(data, fn) {
291
- return Object.keys(data).reduce((acc, key) => (Object.assign(Object.assign({}, acc), { [key]: fn(data[key]) })), {});
292
- }
293
- exports.mapValues = mapValues;
294
- function canConsumeForm(consumes) {
295
- for (const consume of consumes) {
296
- if ('multipart/form-data' === consume.contentType) {
297
- return true;
298
- }
299
- }
300
- return false;
301
- }
302
- exports.canConsumeForm = canConsumeForm;
303
- class JSONApiResponse {
304
- constructor(raw, transformer = (jsonValue) => jsonValue) {
305
- this.raw = raw;
306
- this.transformer = transformer;
307
- }
308
- value() {
309
- return __awaiter(this, void 0, void 0, function* () {
310
- return this.transformer(yield this.raw.json());
311
- });
312
- }
313
- }
314
- exports.JSONApiResponse = JSONApiResponse;
315
- class VoidApiResponse {
316
- constructor(raw) {
317
- this.raw = raw;
318
- }
319
- value() {
320
- return __awaiter(this, void 0, void 0, function* () {
321
- return undefined;
322
- });
323
- }
324
- }
325
- exports.VoidApiResponse = VoidApiResponse;
326
- class BlobApiResponse {
327
- constructor(raw) {
328
- this.raw = raw;
329
- }
330
- value() {
331
- return __awaiter(this, void 0, void 0, function* () {
332
- return yield this.raw.blob();
333
- });
334
- }
335
- ;
336
- }
337
- exports.BlobApiResponse = BlobApiResponse;
338
- class TextApiResponse {
339
- constructor(raw) {
340
- this.raw = raw;
341
- }
342
- value() {
343
- return __awaiter(this, void 0, void 0, function* () {
344
- return yield this.raw.text();
345
- });
346
- }
347
- ;
348
- }
349
- exports.TextApiResponse = TextApiResponse;
@@ -1,116 +0,0 @@
1
- /* tslint:disable */
2
- /* eslint-disable */
3
- /**
4
- * GFN Catalog API
5
- * Use this API to access the Global Fulfilment Network, which contains all the warehouse products and variants available to a given project. Warehouse products represent the base products that can be printed on. Products are the top level items, and variants are the different options available for each product. For example, a product might be a T-shirt, and each variant represents a different size and colour combination of that T-shirt. Use references to these warehouse products to create new product listings on your project via the Product Catalog API. Use the variant information to decide which options you would like to offer on each product listing.
6
- *
7
- * The version of the OpenAPI document: 1.4.0
8
- * Contact: hello@teemill.com
9
- *
10
- * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
11
- * https://openapi-generator.tech
12
- * Do not edit the class manually.
13
- */
14
-
15
-
16
- import * as runtime from '../runtime';
17
- import type {
18
- ApiError,
19
- ApiValidationError,
20
- ProductsResponse,
21
- } from '../models/index';
22
- import {
23
- ApiErrorFromJSON,
24
- ApiErrorToJSON,
25
- ApiValidationErrorFromJSON,
26
- ApiValidationErrorToJSON,
27
- ProductsResponseFromJSON,
28
- ProductsResponseToJSON,
29
- } from '../models/index';
30
-
31
- export interface ListProductsRequest {
32
- project: string;
33
- pageToken?: number;
34
- pageSize?: number;
35
- fields?: string;
36
- search?: string;
37
- }
38
-
39
- /**
40
- *
41
- */
42
- export class ProductsApi extends runtime.BaseAPI {
43
-
44
- /**
45
- * Lists all GFN products available to the project. Can be filtered by style codes using the search parameter.
46
- * List GFN products
47
- */
48
- async listProductsRaw(requestParameters: ListProductsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<ProductsResponse>> {
49
- if (requestParameters.project === null || requestParameters.project === undefined) {
50
- throw new runtime.RequiredError('project','Required parameter requestParameters.project was null or undefined when calling listProducts.');
51
- }
52
-
53
- const queryParameters: any = {};
54
-
55
- if (requestParameters.project !== undefined) {
56
- queryParameters['project'] = requestParameters.project;
57
- }
58
-
59
- if (requestParameters.pageToken !== undefined) {
60
- queryParameters['pageToken'] = requestParameters.pageToken;
61
- }
62
-
63
- if (requestParameters.pageSize !== undefined) {
64
- queryParameters['pageSize'] = requestParameters.pageSize;
65
- }
66
-
67
- if (requestParameters.fields !== undefined) {
68
- queryParameters['fields'] = requestParameters.fields;
69
- }
70
-
71
- if (requestParameters.search !== undefined) {
72
- queryParameters['search'] = requestParameters.search;
73
- }
74
-
75
- const headerParameters: runtime.HTTPHeaders = {};
76
-
77
- if (this.configuration && this.configuration.accessToken) {
78
- // oauth required
79
- headerParameters["Authorization"] = await this.configuration.accessToken("session-oauth", []);
80
- }
81
-
82
- if (this.configuration && this.configuration.apiKey) {
83
- headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // api-key authentication
84
- }
85
-
86
- const response = await this.request({
87
- path: `/v1/gfn/catalog/products`,
88
- method: 'GET',
89
- headers: headerParameters,
90
- query: queryParameters,
91
- }, initOverrides);
92
-
93
- return new runtime.JSONApiResponse(response, (jsonValue) => ProductsResponseFromJSON(jsonValue));
94
- }
95
-
96
- /**
97
- * Lists all GFN products available to the project. Can be filtered by style codes using the search parameter.
98
- * List GFN products
99
- */
100
- async listProducts(
101
- project: string,
102
- optionalParameters: runtime.OptionalOnly<ListProductsRequest> = {},
103
- initOverrides?: RequestInit | runtime.InitOverrideFunction
104
- ): Promise<ProductsResponse> {
105
- const response = await this.listProductsRaw(
106
- {
107
- project: project,
108
- ...optionalParameters,
109
- },
110
- initOverrides
111
- );
112
-
113
- return await response.value();
114
- }
115
-
116
- }
@@ -1,177 +0,0 @@
1
- /* tslint:disable */
2
- /* eslint-disable */
3
- /**
4
- * GFN Catalog API
5
- * Use this API to access the Global Fulfilment Network, which contains all the warehouse products and variants available to a given project. Warehouse products represent the base products that can be printed on. Products are the top level items, and variants are the different options available for each product. For example, a product might be a T-shirt, and each variant represents a different size and colour combination of that T-shirt. Use references to these warehouse products to create new product listings on your project via the Product Catalog API. Use the variant information to decide which options you would like to offer on each product listing.
6
- *
7
- * The version of the OpenAPI document: 1.4.0
8
- * Contact: hello@teemill.com
9
- *
10
- * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
11
- * https://openapi-generator.tech
12
- * Do not edit the class manually.
13
- */
14
-
15
-
16
- import * as runtime from '../runtime';
17
- import type {
18
- ApiError,
19
- ApiValidationError,
20
- ListStatements200Response,
21
- Statement,
22
- } from '../models/index';
23
- import {
24
- ApiErrorFromJSON,
25
- ApiErrorToJSON,
26
- ApiValidationErrorFromJSON,
27
- ApiValidationErrorToJSON,
28
- ListStatements200ResponseFromJSON,
29
- ListStatements200ResponseToJSON,
30
- StatementFromJSON,
31
- StatementToJSON,
32
- } from '../models/index';
33
-
34
- export interface GetStatementRequest {
35
- project: string;
36
- statementId: string;
37
- }
38
-
39
- export interface ListStatementsRequest {
40
- project: string;
41
- pageToken?: number;
42
- pageSize?: number;
43
- search?: string;
44
- }
45
-
46
- /**
47
- *
48
- */
49
- export class StatementsApi extends runtime.BaseAPI {
50
-
51
- /**
52
- * Gets a GFN statement by the given ID.
53
- * Get a GFN statement
54
- */
55
- async getStatementRaw(requestParameters: GetStatementRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<Statement>> {
56
- if (requestParameters.project === null || requestParameters.project === undefined) {
57
- throw new runtime.RequiredError('project','Required parameter requestParameters.project was null or undefined when calling getStatement.');
58
- }
59
-
60
- if (requestParameters.statementId === null || requestParameters.statementId === undefined) {
61
- throw new runtime.RequiredError('statementId','Required parameter requestParameters.statementId was null or undefined when calling getStatement.');
62
- }
63
-
64
- const queryParameters: any = {};
65
-
66
- if (requestParameters.project !== undefined) {
67
- queryParameters['project'] = requestParameters.project;
68
- }
69
-
70
- const headerParameters: runtime.HTTPHeaders = {};
71
-
72
- if (this.configuration && this.configuration.accessToken) {
73
- // oauth required
74
- headerParameters["Authorization"] = await this.configuration.accessToken("session-oauth", []);
75
- }
76
-
77
- if (this.configuration && this.configuration.apiKey) {
78
- headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // api-key authentication
79
- }
80
-
81
- const response = await this.request({
82
- path: `/v1/gfn/statements/{statementId}`.replace(`{${"statementId"}}`, encodeURIComponent(String(requestParameters.statementId))),
83
- method: 'GET',
84
- headers: headerParameters,
85
- query: queryParameters,
86
- }, initOverrides);
87
-
88
- return new runtime.JSONApiResponse(response, (jsonValue) => StatementFromJSON(jsonValue));
89
- }
90
-
91
- /**
92
- * Gets a GFN statement by the given ID.
93
- * Get a GFN statement
94
- */
95
- async getStatement(
96
- project: string, statementId: string,
97
- initOverrides?: RequestInit | runtime.InitOverrideFunction
98
- ): Promise<Statement> {
99
- const response = await this.getStatementRaw(
100
- {
101
- project: project,statementId: statementId,
102
- },
103
- initOverrides
104
- );
105
-
106
- return await response.value();
107
- }
108
-
109
- /**
110
- * Lists GFN statements available to the project
111
- * List GFN statements
112
- */
113
- async listStatementsRaw(requestParameters: ListStatementsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<ListStatements200Response>> {
114
- if (requestParameters.project === null || requestParameters.project === undefined) {
115
- throw new runtime.RequiredError('project','Required parameter requestParameters.project was null or undefined when calling listStatements.');
116
- }
117
-
118
- const queryParameters: any = {};
119
-
120
- if (requestParameters.project !== undefined) {
121
- queryParameters['project'] = requestParameters.project;
122
- }
123
-
124
- if (requestParameters.pageToken !== undefined) {
125
- queryParameters['pageToken'] = requestParameters.pageToken;
126
- }
127
-
128
- if (requestParameters.pageSize !== undefined) {
129
- queryParameters['pageSize'] = requestParameters.pageSize;
130
- }
131
-
132
- if (requestParameters.search !== undefined) {
133
- queryParameters['search'] = requestParameters.search;
134
- }
135
-
136
- const headerParameters: runtime.HTTPHeaders = {};
137
-
138
- if (this.configuration && this.configuration.accessToken) {
139
- // oauth required
140
- headerParameters["Authorization"] = await this.configuration.accessToken("session-oauth", []);
141
- }
142
-
143
- if (this.configuration && this.configuration.apiKey) {
144
- headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // api-key authentication
145
- }
146
-
147
- const response = await this.request({
148
- path: `/v1/gfn/statements`,
149
- method: 'GET',
150
- headers: headerParameters,
151
- query: queryParameters,
152
- }, initOverrides);
153
-
154
- return new runtime.JSONApiResponse(response, (jsonValue) => ListStatements200ResponseFromJSON(jsonValue));
155
- }
156
-
157
- /**
158
- * Lists GFN statements available to the project
159
- * List GFN statements
160
- */
161
- async listStatements(
162
- project: string,
163
- optionalParameters: runtime.OptionalOnly<ListStatementsRequest> = {},
164
- initOverrides?: RequestInit | runtime.InitOverrideFunction
165
- ): Promise<ListStatements200Response> {
166
- const response = await this.listStatementsRaw(
167
- {
168
- project: project,
169
- ...optionalParameters,
170
- },
171
- initOverrides
172
- );
173
-
174
- return await response.value();
175
- }
176
-
177
- }