@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.
- package/.openapi-generator/FILES +6 -28
- package/README.md +3 -3
- package/api.ts +1892 -0
- package/base.ts +86 -0
- package/common.ts +150 -0
- package/configuration.ts +110 -0
- package/dist/api.d.ts +1287 -0
- package/dist/api.js +966 -0
- package/dist/base.d.ts +66 -0
- package/dist/base.js +65 -0
- package/dist/common.d.ts +65 -0
- package/dist/common.js +161 -0
- package/dist/configuration.d.ts +91 -0
- package/dist/configuration.js +43 -0
- package/dist/esm/api.d.ts +1287 -0
- package/dist/esm/api.js +947 -0
- package/dist/esm/base.d.ts +66 -0
- package/dist/esm/{models/AttributeThumbnail.js → base.js} +38 -26
- package/dist/esm/common.d.ts +65 -0
- package/dist/esm/common.js +149 -0
- package/dist/esm/configuration.d.ts +91 -0
- package/dist/esm/configuration.js +39 -0
- package/dist/esm/index.d.ts +13 -3
- package/dist/esm/index.js +13 -3
- package/dist/index.d.ts +13 -3
- package/dist/index.js +15 -5
- package/git_push.sh +57 -0
- package/{dist/models/Stock.d.ts → index.ts} +8 -21
- package/package.json +14 -2
- package/tsconfig.json +4 -6
- package/dist/apis/ProductsApi.d.ts +0 -35
- package/dist/apis/ProductsApi.js +0 -85
- package/dist/apis/StatementsApi.d.ts +0 -48
- package/dist/apis/StatementsApi.js +0 -127
- package/dist/apis/TransactionsApi.d.ts +0 -48
- package/dist/apis/TransactionsApi.js +0 -129
- package/dist/apis/VariantsApi.d.ts +0 -82
- package/dist/apis/VariantsApi.js +0 -229
- package/dist/apis/index.d.ts +0 -4
- package/dist/apis/index.js +0 -22
- package/dist/esm/apis/ProductsApi.d.ts +0 -35
- package/dist/esm/apis/ProductsApi.js +0 -81
- package/dist/esm/apis/StatementsApi.d.ts +0 -48
- package/dist/esm/apis/StatementsApi.js +0 -123
- package/dist/esm/apis/TransactionsApi.d.ts +0 -48
- package/dist/esm/apis/TransactionsApi.js +0 -125
- package/dist/esm/apis/VariantsApi.d.ts +0 -82
- package/dist/esm/apis/VariantsApi.js +0 -225
- package/dist/esm/apis/index.d.ts +0 -4
- package/dist/esm/apis/index.js +0 -6
- package/dist/esm/models/ApiError.d.ts +0 -37
- package/dist/esm/models/ApiError.js +0 -42
- package/dist/esm/models/ApiValidationError.d.ts +0 -39
- package/dist/esm/models/ApiValidationError.js +0 -44
- package/dist/esm/models/Attribute.d.ts +0 -50
- package/dist/esm/models/Attribute.js +0 -49
- package/dist/esm/models/AttributeThumbnail.d.ts +0 -46
- package/dist/esm/models/ExportTransactionsRequest.d.ts +0 -43
- package/dist/esm/models/ExportTransactionsRequest.js +0 -42
- package/dist/esm/models/Image.d.ts +0 -67
- package/dist/esm/models/Image.js +0 -50
- package/dist/esm/models/ListStatements200Response.d.ts +0 -38
- package/dist/esm/models/ListStatements200Response.js +0 -41
- package/dist/esm/models/ListTransactions200Response.d.ts +0 -38
- package/dist/esm/models/ListTransactions200Response.js +0 -41
- package/dist/esm/models/Product.d.ts +0 -67
- package/dist/esm/models/Product.js +0 -52
- package/dist/esm/models/ProductsResponse.d.ts +0 -38
- package/dist/esm/models/ProductsResponse.js +0 -41
- package/dist/esm/models/Statement.d.ts +0 -61
- package/dist/esm/models/Statement.js +0 -60
- package/dist/esm/models/Stock.d.ts +0 -31
- package/dist/esm/models/Stock.js +0 -38
- package/dist/esm/models/StockResponse.d.ts +0 -38
- package/dist/esm/models/StockResponse.js +0 -41
- package/dist/esm/models/Transaction.d.ts +0 -68
- package/dist/esm/models/Transaction.js +0 -61
- package/dist/esm/models/TransactionOrder.d.ts +0 -37
- package/dist/esm/models/TransactionOrder.js +0 -44
- package/dist/esm/models/Variant.d.ts +0 -78
- package/dist/esm/models/Variant.js +0 -61
- package/dist/esm/models/VariantManufacturerOrigin.d.ts +0 -37
- package/dist/esm/models/VariantManufacturerOrigin.js +0 -40
- package/dist/esm/models/VariantProduct.d.ts +0 -37
- package/dist/esm/models/VariantProduct.js +0 -40
- package/dist/esm/models/VariantStock.d.ts +0 -50
- package/dist/esm/models/VariantStock.js +0 -45
- package/dist/esm/models/VariantsResponse.d.ts +0 -38
- package/dist/esm/models/VariantsResponse.js +0 -41
- package/dist/esm/models/index.d.ts +0 -20
- package/dist/esm/models/index.js +0 -22
- package/dist/esm/runtime.d.ts +0 -187
- package/dist/esm/runtime.js +0 -333
- package/dist/models/ApiError.d.ts +0 -37
- package/dist/models/ApiError.js +0 -49
- package/dist/models/ApiValidationError.d.ts +0 -39
- package/dist/models/ApiValidationError.js +0 -51
- package/dist/models/Attribute.d.ts +0 -50
- package/dist/models/Attribute.js +0 -56
- package/dist/models/AttributeThumbnail.d.ts +0 -46
- package/dist/models/AttributeThumbnail.js +0 -55
- package/dist/models/ExportTransactionsRequest.d.ts +0 -43
- package/dist/models/ExportTransactionsRequest.js +0 -49
- package/dist/models/Image.d.ts +0 -67
- package/dist/models/Image.js +0 -57
- package/dist/models/ListStatements200Response.d.ts +0 -38
- package/dist/models/ListStatements200Response.js +0 -48
- package/dist/models/ListTransactions200Response.d.ts +0 -38
- package/dist/models/ListTransactions200Response.js +0 -48
- package/dist/models/Product.d.ts +0 -67
- package/dist/models/Product.js +0 -59
- package/dist/models/ProductsResponse.d.ts +0 -38
- package/dist/models/ProductsResponse.js +0 -48
- package/dist/models/Statement.d.ts +0 -61
- package/dist/models/Statement.js +0 -67
- package/dist/models/Stock.js +0 -45
- package/dist/models/StockResponse.d.ts +0 -38
- package/dist/models/StockResponse.js +0 -48
- package/dist/models/Transaction.d.ts +0 -68
- package/dist/models/Transaction.js +0 -68
- package/dist/models/TransactionOrder.d.ts +0 -37
- package/dist/models/TransactionOrder.js +0 -51
- package/dist/models/Variant.d.ts +0 -78
- package/dist/models/Variant.js +0 -68
- package/dist/models/VariantManufacturerOrigin.d.ts +0 -37
- package/dist/models/VariantManufacturerOrigin.js +0 -47
- package/dist/models/VariantProduct.d.ts +0 -37
- package/dist/models/VariantProduct.js +0 -47
- package/dist/models/VariantStock.d.ts +0 -50
- package/dist/models/VariantStock.js +0 -52
- package/dist/models/VariantsResponse.d.ts +0 -38
- package/dist/models/VariantsResponse.js +0 -48
- package/dist/models/index.d.ts +0 -20
- package/dist/models/index.js +0 -38
- package/dist/runtime.d.ts +0 -187
- package/dist/runtime.js +0 -349
- package/src/apis/ProductsApi.ts +0 -116
- package/src/apis/StatementsApi.ts +0 -177
- package/src/apis/TransactionsApi.ts +0 -180
- package/src/apis/VariantsApi.ts +0 -345
- package/src/apis/index.ts +0 -6
- package/src/index.ts +0 -5
- package/src/models/ApiError.ts +0 -69
- package/src/models/ApiValidationError.ts +0 -70
- package/src/models/Attribute.ts +0 -93
- package/src/models/AttributeThumbnail.ts +0 -80
- package/src/models/ExportTransactionsRequest.ts +0 -76
- package/src/models/Image.ts +0 -108
- package/src/models/ListStatements200Response.ts +0 -75
- package/src/models/ListTransactions200Response.ts +0 -75
- package/src/models/Product.ts +0 -109
- package/src/models/ProductsResponse.ts +0 -75
- package/src/models/Statement.ts +0 -106
- package/src/models/Stock.ts +0 -60
- package/src/models/StockResponse.ts +0 -75
- package/src/models/Transaction.ts +0 -120
- package/src/models/TransactionOrder.ts +0 -70
- package/src/models/Variant.ts +0 -149
- package/src/models/VariantManufacturerOrigin.ts +0 -68
- package/src/models/VariantProduct.ts +0 -68
- package/src/models/VariantStock.ts +0 -91
- package/src/models/VariantsResponse.ts +0 -75
- package/src/models/index.ts +0 -22
- 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
|
-
}
|
package/src/apis/VariantsApi.ts
DELETED
|
@@ -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
package/src/index.ts
DELETED
package/src/models/ApiError.ts
DELETED
|
@@ -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
|
-
|