@teemill/gfn-catalog 1.2.0 → 1.4.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.
- package/.openapi-generator/FILES +10 -0
- package/.openapi-generator/VERSION +1 -1
- package/README.md +2 -2
- package/dist/apis/ProductsApi.d.ts +1 -1
- package/dist/apis/ProductsApi.js +47 -128
- package/dist/apis/StatementsApi.d.ts +48 -0
- package/dist/apis/StatementsApi.js +127 -0
- package/dist/apis/TransactionsApi.d.ts +48 -0
- package/dist/apis/TransactionsApi.js +129 -0
- package/dist/apis/VariantsApi.d.ts +19 -2
- package/dist/apis/VariantsApi.js +170 -245
- package/dist/apis/index.d.ts +2 -0
- package/dist/apis/index.js +2 -0
- package/dist/esm/apis/ProductsApi.d.ts +35 -0
- package/dist/esm/apis/ProductsApi.js +81 -0
- package/dist/esm/apis/StatementsApi.d.ts +48 -0
- package/dist/esm/apis/StatementsApi.js +123 -0
- package/dist/esm/apis/TransactionsApi.d.ts +48 -0
- package/dist/esm/apis/TransactionsApi.js +125 -0
- package/dist/esm/apis/VariantsApi.d.ts +82 -0
- package/dist/esm/apis/VariantsApi.js +225 -0
- package/dist/esm/apis/index.d.ts +4 -0
- package/dist/esm/apis/index.js +6 -0
- package/dist/esm/index.d.ts +3 -0
- package/dist/esm/index.js +5 -0
- package/dist/esm/models/ApiError.d.ts +37 -0
- package/dist/esm/models/ApiError.js +42 -0
- package/dist/esm/models/ApiValidationError.d.ts +39 -0
- package/dist/esm/models/ApiValidationError.js +44 -0
- package/dist/esm/models/Attribute.d.ts +50 -0
- package/dist/esm/models/Attribute.js +49 -0
- package/dist/esm/models/AttributeThumbnail.d.ts +46 -0
- package/dist/esm/models/AttributeThumbnail.js +48 -0
- package/dist/esm/models/ExportTransactionsRequest.d.ts +43 -0
- package/dist/esm/models/ExportTransactionsRequest.js +42 -0
- package/dist/esm/models/Image.d.ts +67 -0
- package/dist/esm/models/Image.js +50 -0
- package/dist/esm/models/ListStatements200Response.d.ts +38 -0
- package/dist/esm/models/ListStatements200Response.js +41 -0
- package/dist/esm/models/ListTransactions200Response.d.ts +38 -0
- package/dist/esm/models/ListTransactions200Response.js +41 -0
- package/dist/esm/models/Product.d.ts +67 -0
- package/dist/esm/models/Product.js +52 -0
- package/dist/esm/models/ProductsResponse.d.ts +38 -0
- package/dist/esm/models/ProductsResponse.js +41 -0
- package/dist/esm/models/Statement.d.ts +61 -0
- package/dist/esm/models/Statement.js +60 -0
- package/dist/esm/models/Stock.d.ts +31 -0
- package/dist/esm/models/Stock.js +38 -0
- package/dist/esm/models/StockResponse.d.ts +38 -0
- package/dist/esm/models/StockResponse.js +41 -0
- package/dist/esm/models/Transaction.d.ts +68 -0
- package/dist/esm/models/Transaction.js +61 -0
- package/dist/esm/models/TransactionOrder.d.ts +37 -0
- package/dist/esm/models/TransactionOrder.js +44 -0
- package/dist/esm/models/Variant.d.ts +78 -0
- package/dist/esm/models/Variant.js +61 -0
- package/dist/esm/models/VariantManufacturerOrigin.d.ts +37 -0
- package/dist/esm/models/VariantManufacturerOrigin.js +40 -0
- package/dist/esm/models/VariantProduct.d.ts +37 -0
- package/dist/esm/models/VariantProduct.js +40 -0
- package/dist/esm/models/VariantStock.d.ts +50 -0
- package/dist/esm/models/VariantStock.js +45 -0
- package/dist/esm/models/VariantsResponse.d.ts +38 -0
- package/dist/esm/models/VariantsResponse.js +41 -0
- package/dist/esm/models/index.d.ts +20 -0
- package/dist/esm/models/index.js +22 -0
- package/dist/esm/runtime.d.ts +187 -0
- package/dist/esm/runtime.js +333 -0
- package/dist/models/ApiError.d.ts +2 -2
- package/dist/models/ApiError.js +2 -2
- package/dist/models/ApiValidationError.d.ts +39 -0
- package/dist/models/ApiValidationError.js +51 -0
- package/dist/models/Attribute.d.ts +2 -2
- package/dist/models/Attribute.js +4 -4
- package/dist/models/AttributeThumbnail.d.ts +2 -2
- package/dist/models/AttributeThumbnail.js +1 -1
- package/dist/models/ExportTransactionsRequest.d.ts +43 -0
- package/dist/models/ExportTransactionsRequest.js +49 -0
- package/dist/models/Image.d.ts +2 -2
- package/dist/models/Image.js +1 -1
- package/dist/models/ListStatements200Response.d.ts +38 -0
- package/dist/models/ListStatements200Response.js +48 -0
- package/dist/models/ListTransactions200Response.d.ts +38 -0
- package/dist/models/ListTransactions200Response.js +48 -0
- package/dist/models/Product.d.ts +2 -2
- package/dist/models/Product.js +2 -2
- package/dist/models/ProductsResponse.d.ts +2 -2
- package/dist/models/ProductsResponse.js +2 -2
- package/dist/models/Statement.d.ts +61 -0
- package/dist/models/Statement.js +67 -0
- package/dist/models/Stock.d.ts +2 -2
- package/dist/models/Stock.js +1 -1
- package/dist/models/StockResponse.d.ts +2 -2
- package/dist/models/StockResponse.js +2 -2
- package/dist/models/Transaction.d.ts +68 -0
- package/dist/models/Transaction.js +68 -0
- package/dist/models/TransactionOrder.d.ts +37 -0
- package/dist/models/TransactionOrder.js +51 -0
- package/dist/models/Variant.d.ts +4 -4
- package/dist/models/Variant.js +8 -8
- package/dist/models/VariantManufacturerOrigin.d.ts +2 -2
- package/dist/models/VariantManufacturerOrigin.js +1 -1
- package/dist/models/VariantProduct.d.ts +2 -2
- package/dist/models/VariantProduct.js +1 -1
- package/dist/models/VariantStock.d.ts +2 -2
- package/dist/models/VariantStock.js +2 -2
- package/dist/models/VariantsResponse.d.ts +2 -2
- package/dist/models/VariantsResponse.js +2 -2
- package/dist/models/index.d.ts +7 -0
- package/dist/models/index.js +7 -0
- package/dist/runtime.d.ts +1 -1
- package/dist/runtime.js +223 -439
- package/package.json +5 -3
- package/src/apis/ProductsApi.ts +4 -1
- package/src/apis/StatementsApi.ts +177 -0
- package/src/apis/TransactionsApi.ts +180 -0
- package/src/apis/VariantsApi.ts +87 -1
- package/src/apis/index.ts +2 -0
- package/src/models/ApiError.ts +3 -3
- package/src/models/ApiValidationError.ts +70 -0
- package/src/models/Attribute.ts +4 -4
- package/src/models/AttributeThumbnail.ts +2 -2
- package/src/models/ExportTransactionsRequest.ts +76 -0
- package/src/models/Image.ts +2 -2
- package/src/models/ListStatements200Response.ts +75 -0
- package/src/models/ListTransactions200Response.ts +75 -0
- package/src/models/Product.ts +3 -3
- package/src/models/ProductsResponse.ts +2 -2
- package/src/models/Statement.ts +106 -0
- package/src/models/Stock.ts +2 -2
- package/src/models/StockResponse.ts +2 -2
- package/src/models/Transaction.ts +120 -0
- package/src/models/TransactionOrder.ts +70 -0
- package/src/models/Variant.ts +16 -16
- package/src/models/VariantManufacturerOrigin.ts +2 -2
- package/src/models/VariantProduct.ts +2 -2
- package/src/models/VariantStock.ts +2 -2
- package/src/models/VariantsResponse.ts +2 -2
- package/src/models/index.ts +7 -0
- package/src/runtime.ts +1 -1
- package/tsconfig.esm.json +7 -0
- package/tsconfig.json +2 -2
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@teemill/gfn-catalog",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.4.0",
|
|
4
4
|
"description": "OpenAPI client for @teemill/gfn-catalog",
|
|
5
5
|
"author": "OpenAPI-Generator",
|
|
6
6
|
"repository": {
|
|
@@ -9,11 +9,13 @@
|
|
|
9
9
|
},
|
|
10
10
|
"main": "./dist/index.js",
|
|
11
11
|
"typings": "./dist/index.d.ts",
|
|
12
|
+
"module": "./dist/esm/index.js",
|
|
13
|
+
"sideEffects": false,
|
|
12
14
|
"scripts": {
|
|
13
|
-
"build": "tsc",
|
|
15
|
+
"build": "tsc && tsc -p tsconfig.esm.json",
|
|
14
16
|
"prepare": "npm run build"
|
|
15
17
|
},
|
|
16
18
|
"devDependencies": {
|
|
17
|
-
"typescript": "^4.0"
|
|
19
|
+
"typescript": "^4.0 || ^5.0"
|
|
18
20
|
}
|
|
19
21
|
}
|
package/src/apis/ProductsApi.ts
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* GFN Catalog API
|
|
5
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
6
|
*
|
|
7
|
-
* The version of the OpenAPI document: 1.
|
|
7
|
+
* The version of the OpenAPI document: 1.4.0
|
|
8
8
|
* Contact: hello@teemill.com
|
|
9
9
|
*
|
|
10
10
|
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
@@ -16,11 +16,14 @@
|
|
|
16
16
|
import * as runtime from '../runtime';
|
|
17
17
|
import type {
|
|
18
18
|
ApiError,
|
|
19
|
+
ApiValidationError,
|
|
19
20
|
ProductsResponse,
|
|
20
21
|
} from '../models/index';
|
|
21
22
|
import {
|
|
22
23
|
ApiErrorFromJSON,
|
|
23
24
|
ApiErrorToJSON,
|
|
25
|
+
ApiValidationErrorFromJSON,
|
|
26
|
+
ApiValidationErrorToJSON,
|
|
24
27
|
ProductsResponseFromJSON,
|
|
25
28
|
ProductsResponseToJSON,
|
|
26
29
|
} from '../models/index';
|
|
@@ -0,0 +1,177 @@
|
|
|
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
|
+
}
|
|
@@ -0,0 +1,180 @@
|
|
|
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
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* GFN Catalog API
|
|
5
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
6
|
*
|
|
7
|
-
* The version of the OpenAPI document: 1.
|
|
7
|
+
* The version of the OpenAPI document: 1.4.0
|
|
8
8
|
* Contact: hello@teemill.com
|
|
9
9
|
*
|
|
10
10
|
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
@@ -16,21 +16,33 @@
|
|
|
16
16
|
import * as runtime from '../runtime';
|
|
17
17
|
import type {
|
|
18
18
|
ApiError,
|
|
19
|
+
ApiValidationError,
|
|
19
20
|
StockResponse,
|
|
20
21
|
Variant,
|
|
22
|
+
VariantStock,
|
|
21
23
|
VariantsResponse,
|
|
22
24
|
} from '../models/index';
|
|
23
25
|
import {
|
|
24
26
|
ApiErrorFromJSON,
|
|
25
27
|
ApiErrorToJSON,
|
|
28
|
+
ApiValidationErrorFromJSON,
|
|
29
|
+
ApiValidationErrorToJSON,
|
|
26
30
|
StockResponseFromJSON,
|
|
27
31
|
StockResponseToJSON,
|
|
28
32
|
VariantFromJSON,
|
|
29
33
|
VariantToJSON,
|
|
34
|
+
VariantStockFromJSON,
|
|
35
|
+
VariantStockToJSON,
|
|
30
36
|
VariantsResponseFromJSON,
|
|
31
37
|
VariantsResponseToJSON,
|
|
32
38
|
} from '../models/index';
|
|
33
39
|
|
|
40
|
+
export interface GetStockRequest {
|
|
41
|
+
project: string;
|
|
42
|
+
variantId: string;
|
|
43
|
+
fulfillmentProjects?: string;
|
|
44
|
+
}
|
|
45
|
+
|
|
34
46
|
export interface GetVariantRequest {
|
|
35
47
|
project: string;
|
|
36
48
|
variantId: string;
|
|
@@ -39,8 +51,10 @@ export interface GetVariantRequest {
|
|
|
39
51
|
|
|
40
52
|
export interface ListStockRequest {
|
|
41
53
|
project: string;
|
|
54
|
+
fulfillmentProjects?: string;
|
|
42
55
|
pageToken?: number;
|
|
43
56
|
pageSize?: number;
|
|
57
|
+
search?: string;
|
|
44
58
|
}
|
|
45
59
|
|
|
46
60
|
export interface ListVariantsRequest {
|
|
@@ -56,6 +70,70 @@ export interface ListVariantsRequest {
|
|
|
56
70
|
*/
|
|
57
71
|
export class VariantsApi extends runtime.BaseAPI {
|
|
58
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
|
+
|
|
59
137
|
/**
|
|
60
138
|
* Gets a GFN variant by the given ID.
|
|
61
139
|
* Get a GFN variant
|
|
@@ -135,6 +213,10 @@ export class VariantsApi extends runtime.BaseAPI {
|
|
|
135
213
|
queryParameters['project'] = requestParameters.project;
|
|
136
214
|
}
|
|
137
215
|
|
|
216
|
+
if (requestParameters.fulfillmentProjects !== undefined) {
|
|
217
|
+
queryParameters['fulfillmentProjects'] = requestParameters.fulfillmentProjects;
|
|
218
|
+
}
|
|
219
|
+
|
|
138
220
|
if (requestParameters.pageToken !== undefined) {
|
|
139
221
|
queryParameters['pageToken'] = requestParameters.pageToken;
|
|
140
222
|
}
|
|
@@ -143,6 +225,10 @@ export class VariantsApi extends runtime.BaseAPI {
|
|
|
143
225
|
queryParameters['pageSize'] = requestParameters.pageSize;
|
|
144
226
|
}
|
|
145
227
|
|
|
228
|
+
if (requestParameters.search !== undefined) {
|
|
229
|
+
queryParameters['search'] = requestParameters.search;
|
|
230
|
+
}
|
|
231
|
+
|
|
146
232
|
const headerParameters: runtime.HTTPHeaders = {};
|
|
147
233
|
|
|
148
234
|
if (this.configuration && this.configuration.accessToken) {
|
package/src/apis/index.ts
CHANGED
package/src/models/ApiError.ts
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* GFN Catalog API
|
|
5
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
6
|
*
|
|
7
|
-
* The version of the OpenAPI document: 1.
|
|
7
|
+
* The version of the OpenAPI document: 1.4.0
|
|
8
8
|
* Contact: hello@teemill.com
|
|
9
9
|
*
|
|
10
10
|
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
@@ -36,8 +36,8 @@ export interface ApiError {
|
|
|
36
36
|
/**
|
|
37
37
|
* Check if a given object implements the ApiError interface.
|
|
38
38
|
*/
|
|
39
|
-
export function instanceOfApiError(value: object):
|
|
40
|
-
if (!('message' in value)) return false;
|
|
39
|
+
export function instanceOfApiError(value: object): value is ApiError {
|
|
40
|
+
if (!('message' in value) || value['message'] === undefined) return false;
|
|
41
41
|
return true;
|
|
42
42
|
}
|
|
43
43
|
|
|
@@ -0,0 +1,70 @@
|
|
|
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
|
+
|
package/src/models/Attribute.ts
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* GFN Catalog API
|
|
5
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
6
|
*
|
|
7
|
-
* The version of the OpenAPI document: 1.
|
|
7
|
+
* The version of the OpenAPI document: 1.4.0
|
|
8
8
|
* Contact: hello@teemill.com
|
|
9
9
|
*
|
|
10
10
|
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
@@ -55,9 +55,9 @@ export interface Attribute {
|
|
|
55
55
|
/**
|
|
56
56
|
* Check if a given object implements the Attribute interface.
|
|
57
57
|
*/
|
|
58
|
-
export function instanceOfAttribute(value: object):
|
|
59
|
-
if (!('name' in value)) return false;
|
|
60
|
-
if (!('value' in value)) return false;
|
|
58
|
+
export function instanceOfAttribute(value: object): value is Attribute {
|
|
59
|
+
if (!('name' in value) || value['name'] === undefined) return false;
|
|
60
|
+
if (!('value' in value) || value['value'] === undefined) return false;
|
|
61
61
|
return true;
|
|
62
62
|
}
|
|
63
63
|
|