@teemill/gfn-catalog 1.4.0 → 2.0.0

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 +7 -28
  2. package/README.md +3 -3
  3. package/api.ts +1646 -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 +1074 -0
  8. package/dist/api.js +1014 -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 +1074 -0
  16. package/dist/esm/api.js +995 -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
@@ -1,180 +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
- ExportTransactionsRequest,
21
- ListTransactions200Response,
22
- } from '../models/index';
23
- import {
24
- ApiErrorFromJSON,
25
- ApiErrorToJSON,
26
- ApiValidationErrorFromJSON,
27
- ApiValidationErrorToJSON,
28
- ExportTransactionsRequestFromJSON,
29
- ExportTransactionsRequestToJSON,
30
- ListTransactions200ResponseFromJSON,
31
- ListTransactions200ResponseToJSON,
32
- } from '../models/index';
33
-
34
- export interface ExportTransactionsOperationRequest {
35
- project: string;
36
- exportTransactionsRequest: ExportTransactionsRequest;
37
- }
38
-
39
- export interface ListTransactionsRequest {
40
- project: string;
41
- pageToken?: number;
42
- pageSize?: number;
43
- statementId?: string;
44
- }
45
-
46
- /**
47
- *
48
- */
49
- export class TransactionsApi extends runtime.BaseAPI {
50
-
51
- /**
52
- * Exports all GFN transactions available to the project
53
- * Export GFN transactions
54
- */
55
- async exportTransactionsRaw(requestParameters: ExportTransactionsOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<Blob>> {
56
- if (requestParameters.project === null || requestParameters.project === undefined) {
57
- throw new runtime.RequiredError('project','Required parameter requestParameters.project was null or undefined when calling exportTransactions.');
58
- }
59
-
60
- if (requestParameters.exportTransactionsRequest === null || requestParameters.exportTransactionsRequest === undefined) {
61
- throw new runtime.RequiredError('exportTransactionsRequest','Required parameter requestParameters.exportTransactionsRequest was null or undefined when calling exportTransactions.');
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
- headerParameters['Content-Type'] = 'application/json';
73
-
74
- if (this.configuration && this.configuration.accessToken) {
75
- // oauth required
76
- headerParameters["Authorization"] = await this.configuration.accessToken("session-oauth", []);
77
- }
78
-
79
- if (this.configuration && this.configuration.apiKey) {
80
- headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // api-key authentication
81
- }
82
-
83
- const response = await this.request({
84
- path: `/v1/gfn/transactions/export`,
85
- method: 'POST',
86
- headers: headerParameters,
87
- query: queryParameters,
88
- body: ExportTransactionsRequestToJSON(requestParameters.exportTransactionsRequest),
89
- }, initOverrides);
90
-
91
- return new runtime.BlobApiResponse(response);
92
- }
93
-
94
- /**
95
- * Exports all GFN transactions available to the project
96
- * Export GFN transactions
97
- */
98
- async exportTransactions(
99
- project: string, exportTransactionsRequest: ExportTransactionsRequest,
100
- initOverrides?: RequestInit | runtime.InitOverrideFunction
101
- ): Promise<Blob> {
102
- const response = await this.exportTransactionsRaw(
103
- {
104
- project: project,exportTransactionsRequest: exportTransactionsRequest,
105
- },
106
- initOverrides
107
- );
108
-
109
- return await response.value();
110
- }
111
-
112
- /**
113
- * Lists all GFN transactions available to the project
114
- * List GFN transactions
115
- */
116
- async listTransactionsRaw(requestParameters: ListTransactionsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<ListTransactions200Response>> {
117
- if (requestParameters.project === null || requestParameters.project === undefined) {
118
- throw new runtime.RequiredError('project','Required parameter requestParameters.project was null or undefined when calling listTransactions.');
119
- }
120
-
121
- const queryParameters: any = {};
122
-
123
- if (requestParameters.project !== undefined) {
124
- queryParameters['project'] = requestParameters.project;
125
- }
126
-
127
- if (requestParameters.pageToken !== undefined) {
128
- queryParameters['pageToken'] = requestParameters.pageToken;
129
- }
130
-
131
- if (requestParameters.pageSize !== undefined) {
132
- queryParameters['pageSize'] = requestParameters.pageSize;
133
- }
134
-
135
- if (requestParameters.statementId !== undefined) {
136
- queryParameters['statementId'] = requestParameters.statementId;
137
- }
138
-
139
- const headerParameters: runtime.HTTPHeaders = {};
140
-
141
- if (this.configuration && this.configuration.accessToken) {
142
- // oauth required
143
- headerParameters["Authorization"] = await this.configuration.accessToken("session-oauth", []);
144
- }
145
-
146
- if (this.configuration && this.configuration.apiKey) {
147
- headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // api-key authentication
148
- }
149
-
150
- const response = await this.request({
151
- path: `/v1/gfn/transactions`,
152
- method: 'GET',
153
- headers: headerParameters,
154
- query: queryParameters,
155
- }, initOverrides);
156
-
157
- return new runtime.JSONApiResponse(response, (jsonValue) => ListTransactions200ResponseFromJSON(jsonValue));
158
- }
159
-
160
- /**
161
- * Lists all GFN transactions available to the project
162
- * List GFN transactions
163
- */
164
- async listTransactions(
165
- project: string,
166
- optionalParameters: runtime.OptionalOnly<ListTransactionsRequest> = {},
167
- initOverrides?: RequestInit | runtime.InitOverrideFunction
168
- ): Promise<ListTransactions200Response> {
169
- const response = await this.listTransactionsRaw(
170
- {
171
- project: project,
172
- ...optionalParameters,
173
- },
174
- initOverrides
175
- );
176
-
177
- return await response.value();
178
- }
179
-
180
- }
@@ -1,345 +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
- StockResponse,
21
- Variant,
22
- VariantStock,
23
- VariantsResponse,
24
- } from '../models/index';
25
- import {
26
- ApiErrorFromJSON,
27
- ApiErrorToJSON,
28
- ApiValidationErrorFromJSON,
29
- ApiValidationErrorToJSON,
30
- StockResponseFromJSON,
31
- StockResponseToJSON,
32
- VariantFromJSON,
33
- VariantToJSON,
34
- VariantStockFromJSON,
35
- VariantStockToJSON,
36
- VariantsResponseFromJSON,
37
- VariantsResponseToJSON,
38
- } from '../models/index';
39
-
40
- export interface GetStockRequest {
41
- project: string;
42
- variantId: string;
43
- fulfillmentProjects?: string;
44
- }
45
-
46
- export interface GetVariantRequest {
47
- project: string;
48
- variantId: string;
49
- fields?: string;
50
- }
51
-
52
- export interface ListStockRequest {
53
- project: string;
54
- fulfillmentProjects?: string;
55
- pageToken?: number;
56
- pageSize?: number;
57
- search?: string;
58
- }
59
-
60
- export interface ListVariantsRequest {
61
- project: string;
62
- pageToken?: number;
63
- pageSize?: number;
64
- fields?: string;
65
- search?: string;
66
- }
67
-
68
- /**
69
- *
70
- */
71
- export class VariantsApi extends runtime.BaseAPI {
72
-
73
- /**
74
- * Gets the stock level for the GFN variant with the given ID.
75
- * Get GFN variant stock
76
- */
77
- async getStockRaw(requestParameters: GetStockRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<VariantStock>> {
78
- if (requestParameters.project === null || requestParameters.project === undefined) {
79
- throw new runtime.RequiredError('project','Required parameter requestParameters.project was null or undefined when calling getStock.');
80
- }
81
-
82
- if (requestParameters.variantId === null || requestParameters.variantId === undefined) {
83
- throw new runtime.RequiredError('variantId','Required parameter requestParameters.variantId was null or undefined when calling getStock.');
84
- }
85
-
86
- const queryParameters: any = {};
87
-
88
- if (requestParameters.project !== undefined) {
89
- queryParameters['project'] = requestParameters.project;
90
- }
91
-
92
- if (requestParameters.fulfillmentProjects !== undefined) {
93
- queryParameters['fulfillmentProjects'] = requestParameters.fulfillmentProjects;
94
- }
95
-
96
- const headerParameters: runtime.HTTPHeaders = {};
97
-
98
- if (this.configuration && this.configuration.accessToken) {
99
- // oauth required
100
- headerParameters["Authorization"] = await this.configuration.accessToken("session-oauth", []);
101
- }
102
-
103
- if (this.configuration && this.configuration.apiKey) {
104
- headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // api-key authentication
105
- }
106
-
107
- const response = await this.request({
108
- path: `/v1/gfn/catalog/stock/{variantId}`.replace(`{${"variantId"}}`, encodeURIComponent(String(requestParameters.variantId))),
109
- method: 'GET',
110
- headers: headerParameters,
111
- query: queryParameters,
112
- }, initOverrides);
113
-
114
- return new runtime.JSONApiResponse(response, (jsonValue) => VariantStockFromJSON(jsonValue));
115
- }
116
-
117
- /**
118
- * Gets the stock level for the GFN variant with the given ID.
119
- * Get GFN variant stock
120
- */
121
- async getStock(
122
- project: string, variantId: string,
123
- optionalParameters: runtime.OptionalOnly<GetStockRequest> = {},
124
- initOverrides?: RequestInit | runtime.InitOverrideFunction
125
- ): Promise<VariantStock> {
126
- const response = await this.getStockRaw(
127
- {
128
- project: project,variantId: variantId,
129
- ...optionalParameters,
130
- },
131
- initOverrides
132
- );
133
-
134
- return await response.value();
135
- }
136
-
137
- /**
138
- * Gets a GFN variant by the given ID.
139
- * Get a GFN variant
140
- */
141
- async getVariantRaw(requestParameters: GetVariantRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<Variant>> {
142
- if (requestParameters.project === null || requestParameters.project === undefined) {
143
- throw new runtime.RequiredError('project','Required parameter requestParameters.project was null or undefined when calling getVariant.');
144
- }
145
-
146
- if (requestParameters.variantId === null || requestParameters.variantId === undefined) {
147
- throw new runtime.RequiredError('variantId','Required parameter requestParameters.variantId was null or undefined when calling getVariant.');
148
- }
149
-
150
- const queryParameters: any = {};
151
-
152
- if (requestParameters.project !== undefined) {
153
- queryParameters['project'] = requestParameters.project;
154
- }
155
-
156
- if (requestParameters.fields !== undefined) {
157
- queryParameters['fields'] = requestParameters.fields;
158
- }
159
-
160
- const headerParameters: runtime.HTTPHeaders = {};
161
-
162
- if (this.configuration && this.configuration.accessToken) {
163
- // oauth required
164
- headerParameters["Authorization"] = await this.configuration.accessToken("session-oauth", []);
165
- }
166
-
167
- if (this.configuration && this.configuration.apiKey) {
168
- headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // api-key authentication
169
- }
170
-
171
- const response = await this.request({
172
- path: `/v1/gfn/catalog/variants/{variantId}`.replace(`{${"variantId"}}`, encodeURIComponent(String(requestParameters.variantId))),
173
- method: 'GET',
174
- headers: headerParameters,
175
- query: queryParameters,
176
- }, initOverrides);
177
-
178
- return new runtime.JSONApiResponse(response, (jsonValue) => VariantFromJSON(jsonValue));
179
- }
180
-
181
- /**
182
- * Gets a GFN variant by the given ID.
183
- * Get a GFN variant
184
- */
185
- async getVariant(
186
- project: string, variantId: string,
187
- optionalParameters: runtime.OptionalOnly<GetVariantRequest> = {},
188
- initOverrides?: RequestInit | runtime.InitOverrideFunction
189
- ): Promise<Variant> {
190
- const response = await this.getVariantRaw(
191
- {
192
- project: project,variantId: variantId,
193
- ...optionalParameters,
194
- },
195
- initOverrides
196
- );
197
-
198
- return await response.value();
199
- }
200
-
201
- /**
202
- * Lists the stock levels for all GFN variants available to the project.
203
- * List GFN variant stock
204
- */
205
- async listStockRaw(requestParameters: ListStockRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<StockResponse>> {
206
- if (requestParameters.project === null || requestParameters.project === undefined) {
207
- throw new runtime.RequiredError('project','Required parameter requestParameters.project was null or undefined when calling listStock.');
208
- }
209
-
210
- const queryParameters: any = {};
211
-
212
- if (requestParameters.project !== undefined) {
213
- queryParameters['project'] = requestParameters.project;
214
- }
215
-
216
- if (requestParameters.fulfillmentProjects !== undefined) {
217
- queryParameters['fulfillmentProjects'] = requestParameters.fulfillmentProjects;
218
- }
219
-
220
- if (requestParameters.pageToken !== undefined) {
221
- queryParameters['pageToken'] = requestParameters.pageToken;
222
- }
223
-
224
- if (requestParameters.pageSize !== undefined) {
225
- queryParameters['pageSize'] = requestParameters.pageSize;
226
- }
227
-
228
- if (requestParameters.search !== undefined) {
229
- queryParameters['search'] = requestParameters.search;
230
- }
231
-
232
- const headerParameters: runtime.HTTPHeaders = {};
233
-
234
- if (this.configuration && this.configuration.accessToken) {
235
- // oauth required
236
- headerParameters["Authorization"] = await this.configuration.accessToken("session-oauth", []);
237
- }
238
-
239
- if (this.configuration && this.configuration.apiKey) {
240
- headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // api-key authentication
241
- }
242
-
243
- const response = await this.request({
244
- path: `/v1/gfn/catalog/stock`,
245
- method: 'GET',
246
- headers: headerParameters,
247
- query: queryParameters,
248
- }, initOverrides);
249
-
250
- return new runtime.JSONApiResponse(response, (jsonValue) => StockResponseFromJSON(jsonValue));
251
- }
252
-
253
- /**
254
- * Lists the stock levels for all GFN variants available to the project.
255
- * List GFN variant stock
256
- */
257
- async listStock(
258
- project: string,
259
- optionalParameters: runtime.OptionalOnly<ListStockRequest> = {},
260
- initOverrides?: RequestInit | runtime.InitOverrideFunction
261
- ): Promise<StockResponse> {
262
- const response = await this.listStockRaw(
263
- {
264
- project: project,
265
- ...optionalParameters,
266
- },
267
- initOverrides
268
- );
269
-
270
- return await response.value();
271
- }
272
-
273
- /**
274
- * Lists all GFN variants available to the project. Can be filtered by product ID, SKU, and attribute values using the search parameter.
275
- * List GFN variants
276
- */
277
- async listVariantsRaw(requestParameters: ListVariantsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<VariantsResponse>> {
278
- if (requestParameters.project === null || requestParameters.project === undefined) {
279
- throw new runtime.RequiredError('project','Required parameter requestParameters.project was null or undefined when calling listVariants.');
280
- }
281
-
282
- const queryParameters: any = {};
283
-
284
- if (requestParameters.project !== undefined) {
285
- queryParameters['project'] = requestParameters.project;
286
- }
287
-
288
- if (requestParameters.pageToken !== undefined) {
289
- queryParameters['pageToken'] = requestParameters.pageToken;
290
- }
291
-
292
- if (requestParameters.pageSize !== undefined) {
293
- queryParameters['pageSize'] = requestParameters.pageSize;
294
- }
295
-
296
- if (requestParameters.fields !== undefined) {
297
- queryParameters['fields'] = requestParameters.fields;
298
- }
299
-
300
- if (requestParameters.search !== undefined) {
301
- queryParameters['search'] = requestParameters.search;
302
- }
303
-
304
- const headerParameters: runtime.HTTPHeaders = {};
305
-
306
- if (this.configuration && this.configuration.accessToken) {
307
- // oauth required
308
- headerParameters["Authorization"] = await this.configuration.accessToken("session-oauth", []);
309
- }
310
-
311
- if (this.configuration && this.configuration.apiKey) {
312
- headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // api-key authentication
313
- }
314
-
315
- const response = await this.request({
316
- path: `/v1/gfn/catalog/variants`,
317
- method: 'GET',
318
- headers: headerParameters,
319
- query: queryParameters,
320
- }, initOverrides);
321
-
322
- return new runtime.JSONApiResponse(response, (jsonValue) => VariantsResponseFromJSON(jsonValue));
323
- }
324
-
325
- /**
326
- * Lists all GFN variants available to the project. Can be filtered by product ID, SKU, and attribute values using the search parameter.
327
- * List GFN variants
328
- */
329
- async listVariants(
330
- project: string,
331
- optionalParameters: runtime.OptionalOnly<ListVariantsRequest> = {},
332
- initOverrides?: RequestInit | runtime.InitOverrideFunction
333
- ): Promise<VariantsResponse> {
334
- const response = await this.listVariantsRaw(
335
- {
336
- project: project,
337
- ...optionalParameters,
338
- },
339
- initOverrides
340
- );
341
-
342
- return await response.value();
343
- }
344
-
345
- }
package/src/apis/index.ts DELETED
@@ -1,6 +0,0 @@
1
- /* tslint:disable */
2
- /* eslint-disable */
3
- export * from './ProductsApi';
4
- export * from './StatementsApi';
5
- export * from './TransactionsApi';
6
- export * from './VariantsApi';
package/src/index.ts DELETED
@@ -1,5 +0,0 @@
1
- /* tslint:disable */
2
- /* eslint-disable */
3
- export * from './runtime';
4
- export * from './apis/index';
5
- export * from './models/index';
@@ -1,69 +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
- import { mapValues } from '../runtime';
16
- /**
17
- *
18
- * @export
19
- * @interface ApiError
20
- */
21
- export interface ApiError {
22
- /**
23
- *
24
- * @type {string}
25
- * @memberof ApiError
26
- */
27
- code?: string;
28
- /**
29
- *
30
- * @type {string}
31
- * @memberof ApiError
32
- */
33
- message: string;
34
- }
35
-
36
- /**
37
- * Check if a given object implements the ApiError interface.
38
- */
39
- export function instanceOfApiError(value: object): value is ApiError {
40
- if (!('message' in value) || value['message'] === undefined) return false;
41
- return true;
42
- }
43
-
44
- export function ApiErrorFromJSON(json: any): ApiError {
45
- return ApiErrorFromJSONTyped(json, false);
46
- }
47
-
48
- export function ApiErrorFromJSONTyped(json: any, ignoreDiscriminator: boolean): ApiError {
49
- if (json == null) {
50
- return json;
51
- }
52
- return {
53
-
54
- 'code': json['code'] == null ? undefined : json['code'],
55
- 'message': json['message'],
56
- };
57
- }
58
-
59
- export function ApiErrorToJSON(value?: ApiError | null): any {
60
- if (value == null) {
61
- return value;
62
- }
63
- return {
64
-
65
- 'code': value['code'],
66
- 'message': value['message'],
67
- };
68
- }
69
-
@@ -1,70 +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
- import { mapValues } from '../runtime';
16
- /**
17
- *
18
- * @export
19
- * @interface ApiValidationError
20
- */
21
- export interface ApiValidationError {
22
- /**
23
- *
24
- * @type {string}
25
- * @memberof ApiValidationError
26
- */
27
- message: string;
28
- /**
29
- *
30
- * @type {{ [key: string]: Array<string>; }}
31
- * @memberof ApiValidationError
32
- */
33
- errors: { [key: string]: Array<string>; };
34
- }
35
-
36
- /**
37
- * Check if a given object implements the ApiValidationError interface.
38
- */
39
- export function instanceOfApiValidationError(value: object): value is ApiValidationError {
40
- if (!('message' in value) || value['message'] === undefined) return false;
41
- if (!('errors' in value) || value['errors'] === undefined) return false;
42
- return true;
43
- }
44
-
45
- export function ApiValidationErrorFromJSON(json: any): ApiValidationError {
46
- return ApiValidationErrorFromJSONTyped(json, false);
47
- }
48
-
49
- export function ApiValidationErrorFromJSONTyped(json: any, ignoreDiscriminator: boolean): ApiValidationError {
50
- if (json == null) {
51
- return json;
52
- }
53
- return {
54
-
55
- 'message': json['message'],
56
- 'errors': json['errors'],
57
- };
58
- }
59
-
60
- export function ApiValidationErrorToJSON(value?: ApiValidationError | null): any {
61
- if (value == null) {
62
- return value;
63
- }
64
- return {
65
-
66
- 'message': value['message'],
67
- 'errors': value['errors'],
68
- };
69
- }
70
-