@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.
Files changed (143) hide show
  1. package/.openapi-generator/FILES +10 -0
  2. package/.openapi-generator/VERSION +1 -1
  3. package/README.md +2 -2
  4. package/dist/apis/ProductsApi.d.ts +1 -1
  5. package/dist/apis/ProductsApi.js +47 -128
  6. package/dist/apis/StatementsApi.d.ts +48 -0
  7. package/dist/apis/StatementsApi.js +127 -0
  8. package/dist/apis/TransactionsApi.d.ts +48 -0
  9. package/dist/apis/TransactionsApi.js +129 -0
  10. package/dist/apis/VariantsApi.d.ts +19 -2
  11. package/dist/apis/VariantsApi.js +170 -245
  12. package/dist/apis/index.d.ts +2 -0
  13. package/dist/apis/index.js +2 -0
  14. package/dist/esm/apis/ProductsApi.d.ts +35 -0
  15. package/dist/esm/apis/ProductsApi.js +81 -0
  16. package/dist/esm/apis/StatementsApi.d.ts +48 -0
  17. package/dist/esm/apis/StatementsApi.js +123 -0
  18. package/dist/esm/apis/TransactionsApi.d.ts +48 -0
  19. package/dist/esm/apis/TransactionsApi.js +125 -0
  20. package/dist/esm/apis/VariantsApi.d.ts +82 -0
  21. package/dist/esm/apis/VariantsApi.js +225 -0
  22. package/dist/esm/apis/index.d.ts +4 -0
  23. package/dist/esm/apis/index.js +6 -0
  24. package/dist/esm/index.d.ts +3 -0
  25. package/dist/esm/index.js +5 -0
  26. package/dist/esm/models/ApiError.d.ts +37 -0
  27. package/dist/esm/models/ApiError.js +42 -0
  28. package/dist/esm/models/ApiValidationError.d.ts +39 -0
  29. package/dist/esm/models/ApiValidationError.js +44 -0
  30. package/dist/esm/models/Attribute.d.ts +50 -0
  31. package/dist/esm/models/Attribute.js +49 -0
  32. package/dist/esm/models/AttributeThumbnail.d.ts +46 -0
  33. package/dist/esm/models/AttributeThumbnail.js +48 -0
  34. package/dist/esm/models/ExportTransactionsRequest.d.ts +43 -0
  35. package/dist/esm/models/ExportTransactionsRequest.js +42 -0
  36. package/dist/esm/models/Image.d.ts +67 -0
  37. package/dist/esm/models/Image.js +50 -0
  38. package/dist/esm/models/ListStatements200Response.d.ts +38 -0
  39. package/dist/esm/models/ListStatements200Response.js +41 -0
  40. package/dist/esm/models/ListTransactions200Response.d.ts +38 -0
  41. package/dist/esm/models/ListTransactions200Response.js +41 -0
  42. package/dist/esm/models/Product.d.ts +67 -0
  43. package/dist/esm/models/Product.js +52 -0
  44. package/dist/esm/models/ProductsResponse.d.ts +38 -0
  45. package/dist/esm/models/ProductsResponse.js +41 -0
  46. package/dist/esm/models/Statement.d.ts +61 -0
  47. package/dist/esm/models/Statement.js +60 -0
  48. package/dist/esm/models/Stock.d.ts +31 -0
  49. package/dist/esm/models/Stock.js +38 -0
  50. package/dist/esm/models/StockResponse.d.ts +38 -0
  51. package/dist/esm/models/StockResponse.js +41 -0
  52. package/dist/esm/models/Transaction.d.ts +68 -0
  53. package/dist/esm/models/Transaction.js +61 -0
  54. package/dist/esm/models/TransactionOrder.d.ts +37 -0
  55. package/dist/esm/models/TransactionOrder.js +44 -0
  56. package/dist/esm/models/Variant.d.ts +78 -0
  57. package/dist/esm/models/Variant.js +61 -0
  58. package/dist/esm/models/VariantManufacturerOrigin.d.ts +37 -0
  59. package/dist/esm/models/VariantManufacturerOrigin.js +40 -0
  60. package/dist/esm/models/VariantProduct.d.ts +37 -0
  61. package/dist/esm/models/VariantProduct.js +40 -0
  62. package/dist/esm/models/VariantStock.d.ts +50 -0
  63. package/dist/esm/models/VariantStock.js +45 -0
  64. package/dist/esm/models/VariantsResponse.d.ts +38 -0
  65. package/dist/esm/models/VariantsResponse.js +41 -0
  66. package/dist/esm/models/index.d.ts +20 -0
  67. package/dist/esm/models/index.js +22 -0
  68. package/dist/esm/runtime.d.ts +187 -0
  69. package/dist/esm/runtime.js +333 -0
  70. package/dist/models/ApiError.d.ts +2 -2
  71. package/dist/models/ApiError.js +2 -2
  72. package/dist/models/ApiValidationError.d.ts +39 -0
  73. package/dist/models/ApiValidationError.js +51 -0
  74. package/dist/models/Attribute.d.ts +2 -2
  75. package/dist/models/Attribute.js +4 -4
  76. package/dist/models/AttributeThumbnail.d.ts +2 -2
  77. package/dist/models/AttributeThumbnail.js +1 -1
  78. package/dist/models/ExportTransactionsRequest.d.ts +43 -0
  79. package/dist/models/ExportTransactionsRequest.js +49 -0
  80. package/dist/models/Image.d.ts +2 -2
  81. package/dist/models/Image.js +1 -1
  82. package/dist/models/ListStatements200Response.d.ts +38 -0
  83. package/dist/models/ListStatements200Response.js +48 -0
  84. package/dist/models/ListTransactions200Response.d.ts +38 -0
  85. package/dist/models/ListTransactions200Response.js +48 -0
  86. package/dist/models/Product.d.ts +2 -2
  87. package/dist/models/Product.js +2 -2
  88. package/dist/models/ProductsResponse.d.ts +2 -2
  89. package/dist/models/ProductsResponse.js +2 -2
  90. package/dist/models/Statement.d.ts +61 -0
  91. package/dist/models/Statement.js +67 -0
  92. package/dist/models/Stock.d.ts +2 -2
  93. package/dist/models/Stock.js +1 -1
  94. package/dist/models/StockResponse.d.ts +2 -2
  95. package/dist/models/StockResponse.js +2 -2
  96. package/dist/models/Transaction.d.ts +68 -0
  97. package/dist/models/Transaction.js +68 -0
  98. package/dist/models/TransactionOrder.d.ts +37 -0
  99. package/dist/models/TransactionOrder.js +51 -0
  100. package/dist/models/Variant.d.ts +4 -4
  101. package/dist/models/Variant.js +8 -8
  102. package/dist/models/VariantManufacturerOrigin.d.ts +2 -2
  103. package/dist/models/VariantManufacturerOrigin.js +1 -1
  104. package/dist/models/VariantProduct.d.ts +2 -2
  105. package/dist/models/VariantProduct.js +1 -1
  106. package/dist/models/VariantStock.d.ts +2 -2
  107. package/dist/models/VariantStock.js +2 -2
  108. package/dist/models/VariantsResponse.d.ts +2 -2
  109. package/dist/models/VariantsResponse.js +2 -2
  110. package/dist/models/index.d.ts +7 -0
  111. package/dist/models/index.js +7 -0
  112. package/dist/runtime.d.ts +1 -1
  113. package/dist/runtime.js +223 -439
  114. package/package.json +5 -3
  115. package/src/apis/ProductsApi.ts +4 -1
  116. package/src/apis/StatementsApi.ts +177 -0
  117. package/src/apis/TransactionsApi.ts +180 -0
  118. package/src/apis/VariantsApi.ts +87 -1
  119. package/src/apis/index.ts +2 -0
  120. package/src/models/ApiError.ts +3 -3
  121. package/src/models/ApiValidationError.ts +70 -0
  122. package/src/models/Attribute.ts +4 -4
  123. package/src/models/AttributeThumbnail.ts +2 -2
  124. package/src/models/ExportTransactionsRequest.ts +76 -0
  125. package/src/models/Image.ts +2 -2
  126. package/src/models/ListStatements200Response.ts +75 -0
  127. package/src/models/ListTransactions200Response.ts +75 -0
  128. package/src/models/Product.ts +3 -3
  129. package/src/models/ProductsResponse.ts +2 -2
  130. package/src/models/Statement.ts +106 -0
  131. package/src/models/Stock.ts +2 -2
  132. package/src/models/StockResponse.ts +2 -2
  133. package/src/models/Transaction.ts +120 -0
  134. package/src/models/TransactionOrder.ts +70 -0
  135. package/src/models/Variant.ts +16 -16
  136. package/src/models/VariantManufacturerOrigin.ts +2 -2
  137. package/src/models/VariantProduct.ts +2 -2
  138. package/src/models/VariantStock.ts +2 -2
  139. package/src/models/VariantsResponse.ts +2 -2
  140. package/src/models/index.ts +7 -0
  141. package/src/runtime.ts +1 -1
  142. package/tsconfig.esm.json +7 -0
  143. package/tsconfig.json +2 -2
@@ -0,0 +1,81 @@
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
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
15
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
16
+ return new (P || (P = Promise))(function (resolve, reject) {
17
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
18
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
19
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
20
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
21
+ });
22
+ };
23
+ import * as runtime from '../runtime';
24
+ import { ProductsResponseFromJSON, } from '../models/index';
25
+ /**
26
+ *
27
+ */
28
+ export class ProductsApi extends runtime.BaseAPI {
29
+ /**
30
+ * Lists all GFN products available to the project. Can be filtered by style codes using the search parameter.
31
+ * List GFN products
32
+ */
33
+ listProductsRaw(requestParameters, initOverrides) {
34
+ return __awaiter(this, void 0, void 0, function* () {
35
+ if (requestParameters.project === null || requestParameters.project === undefined) {
36
+ throw new runtime.RequiredError('project', 'Required parameter requestParameters.project was null or undefined when calling listProducts.');
37
+ }
38
+ const queryParameters = {};
39
+ if (requestParameters.project !== undefined) {
40
+ queryParameters['project'] = requestParameters.project;
41
+ }
42
+ if (requestParameters.pageToken !== undefined) {
43
+ queryParameters['pageToken'] = requestParameters.pageToken;
44
+ }
45
+ if (requestParameters.pageSize !== undefined) {
46
+ queryParameters['pageSize'] = requestParameters.pageSize;
47
+ }
48
+ if (requestParameters.fields !== undefined) {
49
+ queryParameters['fields'] = requestParameters.fields;
50
+ }
51
+ if (requestParameters.search !== undefined) {
52
+ queryParameters['search'] = requestParameters.search;
53
+ }
54
+ const headerParameters = {};
55
+ if (this.configuration && this.configuration.accessToken) {
56
+ // oauth required
57
+ headerParameters["Authorization"] = yield this.configuration.accessToken("session-oauth", []);
58
+ }
59
+ if (this.configuration && this.configuration.apiKey) {
60
+ headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // api-key authentication
61
+ }
62
+ const response = yield this.request({
63
+ path: `/v1/gfn/catalog/products`,
64
+ method: 'GET',
65
+ headers: headerParameters,
66
+ query: queryParameters,
67
+ }, initOverrides);
68
+ return new runtime.JSONApiResponse(response, (jsonValue) => ProductsResponseFromJSON(jsonValue));
69
+ });
70
+ }
71
+ /**
72
+ * Lists all GFN products available to the project. Can be filtered by style codes using the search parameter.
73
+ * List GFN products
74
+ */
75
+ listProducts(project_1) {
76
+ return __awaiter(this, arguments, void 0, function* (project, optionalParameters = {}, initOverrides) {
77
+ const response = yield this.listProductsRaw(Object.assign({ project: project }, optionalParameters), initOverrides);
78
+ return yield response.value();
79
+ });
80
+ }
81
+ }
@@ -0,0 +1,48 @@
1
+ /**
2
+ * GFN Catalog API
3
+ * 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.
4
+ *
5
+ * The version of the OpenAPI document: 1.4.0
6
+ * Contact: hello@teemill.com
7
+ *
8
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
9
+ * https://openapi-generator.tech
10
+ * Do not edit the class manually.
11
+ */
12
+ import * as runtime from '../runtime';
13
+ import type { ListStatements200Response, Statement } from '../models/index';
14
+ export interface GetStatementRequest {
15
+ project: string;
16
+ statementId: string;
17
+ }
18
+ export interface ListStatementsRequest {
19
+ project: string;
20
+ pageToken?: number;
21
+ pageSize?: number;
22
+ search?: string;
23
+ }
24
+ /**
25
+ *
26
+ */
27
+ export declare class StatementsApi extends runtime.BaseAPI {
28
+ /**
29
+ * Gets a GFN statement by the given ID.
30
+ * Get a GFN statement
31
+ */
32
+ getStatementRaw(requestParameters: GetStatementRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<Statement>>;
33
+ /**
34
+ * Gets a GFN statement by the given ID.
35
+ * Get a GFN statement
36
+ */
37
+ getStatement(project: string, statementId: string, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<Statement>;
38
+ /**
39
+ * Lists GFN statements available to the project
40
+ * List GFN statements
41
+ */
42
+ listStatementsRaw(requestParameters: ListStatementsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<ListStatements200Response>>;
43
+ /**
44
+ * Lists GFN statements available to the project
45
+ * List GFN statements
46
+ */
47
+ listStatements(project: string, optionalParameters?: runtime.OptionalOnly<ListStatementsRequest>, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<ListStatements200Response>;
48
+ }
@@ -0,0 +1,123 @@
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
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
15
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
16
+ return new (P || (P = Promise))(function (resolve, reject) {
17
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
18
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
19
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
20
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
21
+ });
22
+ };
23
+ import * as runtime from '../runtime';
24
+ import { ListStatements200ResponseFromJSON, StatementFromJSON, } from '../models/index';
25
+ /**
26
+ *
27
+ */
28
+ export class StatementsApi extends runtime.BaseAPI {
29
+ /**
30
+ * Gets a GFN statement by the given ID.
31
+ * Get a GFN statement
32
+ */
33
+ getStatementRaw(requestParameters, initOverrides) {
34
+ return __awaiter(this, void 0, void 0, function* () {
35
+ if (requestParameters.project === null || requestParameters.project === undefined) {
36
+ throw new runtime.RequiredError('project', 'Required parameter requestParameters.project was null or undefined when calling getStatement.');
37
+ }
38
+ if (requestParameters.statementId === null || requestParameters.statementId === undefined) {
39
+ throw new runtime.RequiredError('statementId', 'Required parameter requestParameters.statementId was null or undefined when calling getStatement.');
40
+ }
41
+ const queryParameters = {};
42
+ if (requestParameters.project !== undefined) {
43
+ queryParameters['project'] = requestParameters.project;
44
+ }
45
+ const headerParameters = {};
46
+ if (this.configuration && this.configuration.accessToken) {
47
+ // oauth required
48
+ headerParameters["Authorization"] = yield this.configuration.accessToken("session-oauth", []);
49
+ }
50
+ if (this.configuration && this.configuration.apiKey) {
51
+ headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // api-key authentication
52
+ }
53
+ const response = yield this.request({
54
+ path: `/v1/gfn/statements/{statementId}`.replace(`{${"statementId"}}`, encodeURIComponent(String(requestParameters.statementId))),
55
+ method: 'GET',
56
+ headers: headerParameters,
57
+ query: queryParameters,
58
+ }, initOverrides);
59
+ return new runtime.JSONApiResponse(response, (jsonValue) => StatementFromJSON(jsonValue));
60
+ });
61
+ }
62
+ /**
63
+ * Gets a GFN statement by the given ID.
64
+ * Get a GFN statement
65
+ */
66
+ getStatement(project, statementId, initOverrides) {
67
+ return __awaiter(this, void 0, void 0, function* () {
68
+ const response = yield this.getStatementRaw({
69
+ project: project, statementId: statementId,
70
+ }, initOverrides);
71
+ return yield response.value();
72
+ });
73
+ }
74
+ /**
75
+ * Lists GFN statements available to the project
76
+ * List GFN statements
77
+ */
78
+ listStatementsRaw(requestParameters, initOverrides) {
79
+ return __awaiter(this, void 0, void 0, function* () {
80
+ if (requestParameters.project === null || requestParameters.project === undefined) {
81
+ throw new runtime.RequiredError('project', 'Required parameter requestParameters.project was null or undefined when calling listStatements.');
82
+ }
83
+ const queryParameters = {};
84
+ if (requestParameters.project !== undefined) {
85
+ queryParameters['project'] = requestParameters.project;
86
+ }
87
+ if (requestParameters.pageToken !== undefined) {
88
+ queryParameters['pageToken'] = requestParameters.pageToken;
89
+ }
90
+ if (requestParameters.pageSize !== undefined) {
91
+ queryParameters['pageSize'] = requestParameters.pageSize;
92
+ }
93
+ if (requestParameters.search !== undefined) {
94
+ queryParameters['search'] = requestParameters.search;
95
+ }
96
+ const headerParameters = {};
97
+ if (this.configuration && this.configuration.accessToken) {
98
+ // oauth required
99
+ headerParameters["Authorization"] = yield this.configuration.accessToken("session-oauth", []);
100
+ }
101
+ if (this.configuration && this.configuration.apiKey) {
102
+ headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // api-key authentication
103
+ }
104
+ const response = yield this.request({
105
+ path: `/v1/gfn/statements`,
106
+ method: 'GET',
107
+ headers: headerParameters,
108
+ query: queryParameters,
109
+ }, initOverrides);
110
+ return new runtime.JSONApiResponse(response, (jsonValue) => ListStatements200ResponseFromJSON(jsonValue));
111
+ });
112
+ }
113
+ /**
114
+ * Lists GFN statements available to the project
115
+ * List GFN statements
116
+ */
117
+ listStatements(project_1) {
118
+ return __awaiter(this, arguments, void 0, function* (project, optionalParameters = {}, initOverrides) {
119
+ const response = yield this.listStatementsRaw(Object.assign({ project: project }, optionalParameters), initOverrides);
120
+ return yield response.value();
121
+ });
122
+ }
123
+ }
@@ -0,0 +1,48 @@
1
+ /**
2
+ * GFN Catalog API
3
+ * 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.
4
+ *
5
+ * The version of the OpenAPI document: 1.4.0
6
+ * Contact: hello@teemill.com
7
+ *
8
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
9
+ * https://openapi-generator.tech
10
+ * Do not edit the class manually.
11
+ */
12
+ import * as runtime from '../runtime';
13
+ import type { ExportTransactionsRequest, ListTransactions200Response } from '../models/index';
14
+ export interface ExportTransactionsOperationRequest {
15
+ project: string;
16
+ exportTransactionsRequest: ExportTransactionsRequest;
17
+ }
18
+ export interface ListTransactionsRequest {
19
+ project: string;
20
+ pageToken?: number;
21
+ pageSize?: number;
22
+ statementId?: string;
23
+ }
24
+ /**
25
+ *
26
+ */
27
+ export declare class TransactionsApi extends runtime.BaseAPI {
28
+ /**
29
+ * Exports all GFN transactions available to the project
30
+ * Export GFN transactions
31
+ */
32
+ exportTransactionsRaw(requestParameters: ExportTransactionsOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<Blob>>;
33
+ /**
34
+ * Exports all GFN transactions available to the project
35
+ * Export GFN transactions
36
+ */
37
+ exportTransactions(project: string, exportTransactionsRequest: ExportTransactionsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<Blob>;
38
+ /**
39
+ * Lists all GFN transactions available to the project
40
+ * List GFN transactions
41
+ */
42
+ listTransactionsRaw(requestParameters: ListTransactionsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<ListTransactions200Response>>;
43
+ /**
44
+ * Lists all GFN transactions available to the project
45
+ * List GFN transactions
46
+ */
47
+ listTransactions(project: string, optionalParameters?: runtime.OptionalOnly<ListTransactionsRequest>, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<ListTransactions200Response>;
48
+ }
@@ -0,0 +1,125 @@
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
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
15
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
16
+ return new (P || (P = Promise))(function (resolve, reject) {
17
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
18
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
19
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
20
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
21
+ });
22
+ };
23
+ import * as runtime from '../runtime';
24
+ import { ExportTransactionsRequestToJSON, ListTransactions200ResponseFromJSON, } from '../models/index';
25
+ /**
26
+ *
27
+ */
28
+ export class TransactionsApi extends runtime.BaseAPI {
29
+ /**
30
+ * Exports all GFN transactions available to the project
31
+ * Export GFN transactions
32
+ */
33
+ exportTransactionsRaw(requestParameters, initOverrides) {
34
+ return __awaiter(this, void 0, void 0, function* () {
35
+ if (requestParameters.project === null || requestParameters.project === undefined) {
36
+ throw new runtime.RequiredError('project', 'Required parameter requestParameters.project was null or undefined when calling exportTransactions.');
37
+ }
38
+ if (requestParameters.exportTransactionsRequest === null || requestParameters.exportTransactionsRequest === undefined) {
39
+ throw new runtime.RequiredError('exportTransactionsRequest', 'Required parameter requestParameters.exportTransactionsRequest was null or undefined when calling exportTransactions.');
40
+ }
41
+ const queryParameters = {};
42
+ if (requestParameters.project !== undefined) {
43
+ queryParameters['project'] = requestParameters.project;
44
+ }
45
+ const headerParameters = {};
46
+ headerParameters['Content-Type'] = 'application/json';
47
+ if (this.configuration && this.configuration.accessToken) {
48
+ // oauth required
49
+ headerParameters["Authorization"] = yield this.configuration.accessToken("session-oauth", []);
50
+ }
51
+ if (this.configuration && this.configuration.apiKey) {
52
+ headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // api-key authentication
53
+ }
54
+ const response = yield this.request({
55
+ path: `/v1/gfn/transactions/export`,
56
+ method: 'POST',
57
+ headers: headerParameters,
58
+ query: queryParameters,
59
+ body: ExportTransactionsRequestToJSON(requestParameters.exportTransactionsRequest),
60
+ }, initOverrides);
61
+ return new runtime.BlobApiResponse(response);
62
+ });
63
+ }
64
+ /**
65
+ * Exports all GFN transactions available to the project
66
+ * Export GFN transactions
67
+ */
68
+ exportTransactions(project, exportTransactionsRequest, initOverrides) {
69
+ return __awaiter(this, void 0, void 0, function* () {
70
+ const response = yield this.exportTransactionsRaw({
71
+ project: project, exportTransactionsRequest: exportTransactionsRequest,
72
+ }, initOverrides);
73
+ return yield response.value();
74
+ });
75
+ }
76
+ /**
77
+ * Lists all GFN transactions available to the project
78
+ * List GFN transactions
79
+ */
80
+ listTransactionsRaw(requestParameters, initOverrides) {
81
+ return __awaiter(this, void 0, void 0, function* () {
82
+ if (requestParameters.project === null || requestParameters.project === undefined) {
83
+ throw new runtime.RequiredError('project', 'Required parameter requestParameters.project was null or undefined when calling listTransactions.');
84
+ }
85
+ const queryParameters = {};
86
+ if (requestParameters.project !== undefined) {
87
+ queryParameters['project'] = requestParameters.project;
88
+ }
89
+ if (requestParameters.pageToken !== undefined) {
90
+ queryParameters['pageToken'] = requestParameters.pageToken;
91
+ }
92
+ if (requestParameters.pageSize !== undefined) {
93
+ queryParameters['pageSize'] = requestParameters.pageSize;
94
+ }
95
+ if (requestParameters.statementId !== undefined) {
96
+ queryParameters['statementId'] = requestParameters.statementId;
97
+ }
98
+ const headerParameters = {};
99
+ if (this.configuration && this.configuration.accessToken) {
100
+ // oauth required
101
+ headerParameters["Authorization"] = yield this.configuration.accessToken("session-oauth", []);
102
+ }
103
+ if (this.configuration && this.configuration.apiKey) {
104
+ headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // api-key authentication
105
+ }
106
+ const response = yield this.request({
107
+ path: `/v1/gfn/transactions`,
108
+ method: 'GET',
109
+ headers: headerParameters,
110
+ query: queryParameters,
111
+ }, initOverrides);
112
+ return new runtime.JSONApiResponse(response, (jsonValue) => ListTransactions200ResponseFromJSON(jsonValue));
113
+ });
114
+ }
115
+ /**
116
+ * Lists all GFN transactions available to the project
117
+ * List GFN transactions
118
+ */
119
+ listTransactions(project_1) {
120
+ return __awaiter(this, arguments, void 0, function* (project, optionalParameters = {}, initOverrides) {
121
+ const response = yield this.listTransactionsRaw(Object.assign({ project: project }, optionalParameters), initOverrides);
122
+ return yield response.value();
123
+ });
124
+ }
125
+ }
@@ -0,0 +1,82 @@
1
+ /**
2
+ * GFN Catalog API
3
+ * 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.
4
+ *
5
+ * The version of the OpenAPI document: 1.4.0
6
+ * Contact: hello@teemill.com
7
+ *
8
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
9
+ * https://openapi-generator.tech
10
+ * Do not edit the class manually.
11
+ */
12
+ import * as runtime from '../runtime';
13
+ import type { StockResponse, Variant, VariantStock, VariantsResponse } from '../models/index';
14
+ export interface GetStockRequest {
15
+ project: string;
16
+ variantId: string;
17
+ fulfillmentProjects?: string;
18
+ }
19
+ export interface GetVariantRequest {
20
+ project: string;
21
+ variantId: string;
22
+ fields?: string;
23
+ }
24
+ export interface ListStockRequest {
25
+ project: string;
26
+ fulfillmentProjects?: string;
27
+ pageToken?: number;
28
+ pageSize?: number;
29
+ search?: string;
30
+ }
31
+ export interface ListVariantsRequest {
32
+ project: string;
33
+ pageToken?: number;
34
+ pageSize?: number;
35
+ fields?: string;
36
+ search?: string;
37
+ }
38
+ /**
39
+ *
40
+ */
41
+ export declare class VariantsApi extends runtime.BaseAPI {
42
+ /**
43
+ * Gets the stock level for the GFN variant with the given ID.
44
+ * Get GFN variant stock
45
+ */
46
+ getStockRaw(requestParameters: GetStockRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<VariantStock>>;
47
+ /**
48
+ * Gets the stock level for the GFN variant with the given ID.
49
+ * Get GFN variant stock
50
+ */
51
+ getStock(project: string, variantId: string, optionalParameters?: runtime.OptionalOnly<GetStockRequest>, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<VariantStock>;
52
+ /**
53
+ * Gets a GFN variant by the given ID.
54
+ * Get a GFN variant
55
+ */
56
+ getVariantRaw(requestParameters: GetVariantRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<Variant>>;
57
+ /**
58
+ * Gets a GFN variant by the given ID.
59
+ * Get a GFN variant
60
+ */
61
+ getVariant(project: string, variantId: string, optionalParameters?: runtime.OptionalOnly<GetVariantRequest>, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<Variant>;
62
+ /**
63
+ * Lists the stock levels for all GFN variants available to the project.
64
+ * List GFN variant stock
65
+ */
66
+ listStockRaw(requestParameters: ListStockRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<StockResponse>>;
67
+ /**
68
+ * Lists the stock levels for all GFN variants available to the project.
69
+ * List GFN variant stock
70
+ */
71
+ listStock(project: string, optionalParameters?: runtime.OptionalOnly<ListStockRequest>, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<StockResponse>;
72
+ /**
73
+ * Lists all GFN variants available to the project. Can be filtered by product ID, SKU, and attribute values using the search parameter.
74
+ * List GFN variants
75
+ */
76
+ listVariantsRaw(requestParameters: ListVariantsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<VariantsResponse>>;
77
+ /**
78
+ * Lists all GFN variants available to the project. Can be filtered by product ID, SKU, and attribute values using the search parameter.
79
+ * List GFN variants
80
+ */
81
+ listVariants(project: string, optionalParameters?: runtime.OptionalOnly<ListVariantsRequest>, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<VariantsResponse>;
82
+ }