@teemill/gfn-catalog 0.1.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 +21 -0
- package/.openapi-generator/VERSION +1 -0
- package/.openapi-generator-ignore +23 -0
- package/README.md +45 -0
- package/dist/apis/ProductsApi.d.ts +33 -0
- package/dist/apis/ProductsApi.js +160 -0
- package/dist/apis/VariantsApi.d.ts +48 -0
- package/dist/apis/VariantsApi.js +229 -0
- package/dist/apis/index.d.ts +2 -0
- package/dist/apis/index.js +20 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.js +21 -0
- package/dist/models/ApiError.d.ts +37 -0
- package/dist/models/ApiError.js +53 -0
- package/dist/models/Attribute.d.ts +50 -0
- package/dist/models/Attribute.js +59 -0
- package/dist/models/AttributeThumbnail.d.ts +46 -0
- package/dist/models/AttributeThumbnail.js +60 -0
- package/dist/models/Image.d.ts +67 -0
- package/dist/models/Image.js +62 -0
- package/dist/models/Product.d.ts +56 -0
- package/dist/models/Product.js +60 -0
- package/dist/models/ProductsResponse.d.ts +32 -0
- package/dist/models/ProductsResponse.js +51 -0
- package/dist/models/Variant.d.ts +64 -0
- package/dist/models/Variant.js +65 -0
- package/dist/models/VariantProduct.d.ts +37 -0
- package/dist/models/VariantProduct.js +52 -0
- package/dist/models/VariantsResponse.d.ts +32 -0
- package/dist/models/VariantsResponse.js +51 -0
- package/dist/models/index.d.ts +9 -0
- package/dist/models/index.js +27 -0
- package/dist/runtime.d.ts +187 -0
- package/dist/runtime.js +565 -0
- package/package.json +19 -0
- package/src/apis/ProductsApi.ts +103 -0
- package/src/apis/VariantsApi.ts +176 -0
- package/src/apis/index.ts +4 -0
- package/src/index.ts +5 -0
- package/src/models/ApiError.ts +74 -0
- package/src/models/Attribute.ts +98 -0
- package/src/models/AttributeThumbnail.ts +85 -0
- package/src/models/Image.ts +113 -0
- package/src/models/Product.ts +105 -0
- package/src/models/ProductsResponse.ts +72 -0
- package/src/models/Variant.ts +126 -0
- package/src/models/VariantProduct.ts +73 -0
- package/src/models/VariantsResponse.ts +72 -0
- package/src/models/index.ts +11 -0
- package/src/runtime.ts +441 -0
- package/tsconfig.json +20 -0
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
.gitignore
|
|
2
|
+
.npmignore
|
|
3
|
+
.openapi-generator-ignore
|
|
4
|
+
README.md
|
|
5
|
+
package.json
|
|
6
|
+
src/apis/ProductsApi.ts
|
|
7
|
+
src/apis/VariantsApi.ts
|
|
8
|
+
src/apis/index.ts
|
|
9
|
+
src/index.ts
|
|
10
|
+
src/models/ApiError.ts
|
|
11
|
+
src/models/Attribute.ts
|
|
12
|
+
src/models/AttributeThumbnail.ts
|
|
13
|
+
src/models/Image.ts
|
|
14
|
+
src/models/Product.ts
|
|
15
|
+
src/models/ProductsResponse.ts
|
|
16
|
+
src/models/Variant.ts
|
|
17
|
+
src/models/VariantProduct.ts
|
|
18
|
+
src/models/VariantsResponse.ts
|
|
19
|
+
src/models/index.ts
|
|
20
|
+
src/runtime.ts
|
|
21
|
+
tsconfig.json
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
7.3.0-SNAPSHOT
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
# OpenAPI Generator Ignore
|
|
2
|
+
# Generated by openapi-generator https://github.com/openapitools/openapi-generator
|
|
3
|
+
|
|
4
|
+
# Use this file to prevent files from being overwritten by the generator.
|
|
5
|
+
# The patterns follow closely to .gitignore or .dockerignore.
|
|
6
|
+
|
|
7
|
+
# As an example, the C# client generator defines ApiClient.cs.
|
|
8
|
+
# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line:
|
|
9
|
+
#ApiClient.cs
|
|
10
|
+
|
|
11
|
+
# You can match any string of characters against a directory, file or extension with a single asterisk (*):
|
|
12
|
+
#foo/*/qux
|
|
13
|
+
# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux
|
|
14
|
+
|
|
15
|
+
# You can recursively match patterns against a directory, file or extension with a double asterisk (**):
|
|
16
|
+
#foo/**/qux
|
|
17
|
+
# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux
|
|
18
|
+
|
|
19
|
+
# You can also negate patterns with an exclamation (!).
|
|
20
|
+
# For example, you can ignore all files in a docs folder with the file extension .md:
|
|
21
|
+
#docs/*.md
|
|
22
|
+
# Then explicitly reverse the ignore rule for a single file:
|
|
23
|
+
#!docs/README.md
|
package/README.md
ADDED
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
## @teemill/gfn-catalog@0.1.0
|
|
2
|
+
|
|
3
|
+
This generator creates TypeScript/JavaScript client that utilizes [Fetch API](https://fetch.spec.whatwg.org/). The generated Node module can be used in the following environments:
|
|
4
|
+
|
|
5
|
+
Environment
|
|
6
|
+
* Node.js
|
|
7
|
+
* Webpack
|
|
8
|
+
* Browserify
|
|
9
|
+
|
|
10
|
+
Language level
|
|
11
|
+
* ES5 - you must have a Promises/A+ library installed
|
|
12
|
+
* ES6
|
|
13
|
+
|
|
14
|
+
Module system
|
|
15
|
+
* CommonJS
|
|
16
|
+
* ES6 module system
|
|
17
|
+
|
|
18
|
+
It can be used in both TypeScript and JavaScript. In TypeScript, the definition should be automatically resolved via `package.json`. ([Reference](http://www.typescriptlang.org/docs/handbook/typings-for-npm-packages.html))
|
|
19
|
+
|
|
20
|
+
### Building
|
|
21
|
+
|
|
22
|
+
To build and compile the typescript sources to javascript use:
|
|
23
|
+
```
|
|
24
|
+
npm install
|
|
25
|
+
npm run build
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
### Publishing
|
|
29
|
+
|
|
30
|
+
First build the package then run ```npm publish```
|
|
31
|
+
|
|
32
|
+
### Consuming
|
|
33
|
+
|
|
34
|
+
navigate to the folder of your consuming project and run one of the following commands.
|
|
35
|
+
|
|
36
|
+
_published:_
|
|
37
|
+
|
|
38
|
+
```
|
|
39
|
+
npm install @teemill/gfn-catalog@0.1.0 --save
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
_unPublished (not recommended):_
|
|
43
|
+
|
|
44
|
+
```
|
|
45
|
+
npm install PATH_TO_GENERATED_PACKAGE --save
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* GFN Catalog API
|
|
3
|
+
* Manage Teemill GFN Products For full documentation on functionality and account settings go to [teemill.com](https://teemill.com)
|
|
4
|
+
*
|
|
5
|
+
* The version of the OpenAPI document: 0.1.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 { ProductsResponse } from '../models/index';
|
|
14
|
+
export interface ListProductsRequest {
|
|
15
|
+
project: string;
|
|
16
|
+
fields?: string;
|
|
17
|
+
search?: string;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
*
|
|
21
|
+
*/
|
|
22
|
+
export declare class ProductsApi extends runtime.BaseAPI {
|
|
23
|
+
/**
|
|
24
|
+
* Lists GFN products
|
|
25
|
+
* List GFN products
|
|
26
|
+
*/
|
|
27
|
+
listProductsRaw(requestParameters: ListProductsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<ProductsResponse>>;
|
|
28
|
+
/**
|
|
29
|
+
* Lists GFN products
|
|
30
|
+
* List GFN products
|
|
31
|
+
*/
|
|
32
|
+
listProducts(project: string, optionalParameters?: runtime.OptionalOnly<ListProductsRequest>, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<ProductsResponse>;
|
|
33
|
+
}
|
|
@@ -0,0 +1,160 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/* tslint:disable */
|
|
3
|
+
/* eslint-disable */
|
|
4
|
+
/**
|
|
5
|
+
* GFN Catalog API
|
|
6
|
+
* Manage Teemill GFN Products For full documentation on functionality and account settings go to [teemill.com](https://teemill.com)
|
|
7
|
+
*
|
|
8
|
+
* The version of the OpenAPI document: 0.1.0
|
|
9
|
+
* Contact: hello@teemill.com
|
|
10
|
+
*
|
|
11
|
+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
12
|
+
* https://openapi-generator.tech
|
|
13
|
+
* Do not edit the class manually.
|
|
14
|
+
*/
|
|
15
|
+
var __extends = (this && this.__extends) || (function () {
|
|
16
|
+
var extendStatics = function (d, b) {
|
|
17
|
+
extendStatics = Object.setPrototypeOf ||
|
|
18
|
+
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
19
|
+
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
20
|
+
return extendStatics(d, b);
|
|
21
|
+
};
|
|
22
|
+
return function (d, b) {
|
|
23
|
+
if (typeof b !== "function" && b !== null)
|
|
24
|
+
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
25
|
+
extendStatics(d, b);
|
|
26
|
+
function __() { this.constructor = d; }
|
|
27
|
+
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
28
|
+
};
|
|
29
|
+
})();
|
|
30
|
+
var __assign = (this && this.__assign) || function () {
|
|
31
|
+
__assign = Object.assign || function(t) {
|
|
32
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
33
|
+
s = arguments[i];
|
|
34
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
35
|
+
t[p] = s[p];
|
|
36
|
+
}
|
|
37
|
+
return t;
|
|
38
|
+
};
|
|
39
|
+
return __assign.apply(this, arguments);
|
|
40
|
+
};
|
|
41
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
42
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
43
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
44
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
45
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
46
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
47
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
48
|
+
});
|
|
49
|
+
};
|
|
50
|
+
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
51
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
52
|
+
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
53
|
+
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
54
|
+
function step(op) {
|
|
55
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
56
|
+
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
57
|
+
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
58
|
+
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
59
|
+
switch (op[0]) {
|
|
60
|
+
case 0: case 1: t = op; break;
|
|
61
|
+
case 4: _.label++; return { value: op[1], done: false };
|
|
62
|
+
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
63
|
+
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
64
|
+
default:
|
|
65
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
66
|
+
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
67
|
+
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
68
|
+
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
69
|
+
if (t[2]) _.ops.pop();
|
|
70
|
+
_.trys.pop(); continue;
|
|
71
|
+
}
|
|
72
|
+
op = body.call(thisArg, _);
|
|
73
|
+
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
74
|
+
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
75
|
+
}
|
|
76
|
+
};
|
|
77
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
78
|
+
exports.ProductsApi = void 0;
|
|
79
|
+
var runtime = require("../runtime");
|
|
80
|
+
var index_1 = require("../models/index");
|
|
81
|
+
/**
|
|
82
|
+
*
|
|
83
|
+
*/
|
|
84
|
+
var ProductsApi = /** @class */ (function (_super) {
|
|
85
|
+
__extends(ProductsApi, _super);
|
|
86
|
+
function ProductsApi() {
|
|
87
|
+
return _super !== null && _super.apply(this, arguments) || this;
|
|
88
|
+
}
|
|
89
|
+
/**
|
|
90
|
+
* Lists GFN products
|
|
91
|
+
* List GFN products
|
|
92
|
+
*/
|
|
93
|
+
ProductsApi.prototype.listProductsRaw = function (requestParameters, initOverrides) {
|
|
94
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
95
|
+
var queryParameters, headerParameters, _a, _b, response;
|
|
96
|
+
return __generator(this, function (_c) {
|
|
97
|
+
switch (_c.label) {
|
|
98
|
+
case 0:
|
|
99
|
+
if (requestParameters.project === null || requestParameters.project === undefined) {
|
|
100
|
+
throw new runtime.RequiredError('project', 'Required parameter requestParameters.project was null or undefined when calling listProducts.');
|
|
101
|
+
}
|
|
102
|
+
queryParameters = {};
|
|
103
|
+
if (requestParameters.project !== undefined) {
|
|
104
|
+
queryParameters['project'] = requestParameters.project;
|
|
105
|
+
}
|
|
106
|
+
if (requestParameters.fields !== undefined) {
|
|
107
|
+
queryParameters['fields'] = requestParameters.fields;
|
|
108
|
+
}
|
|
109
|
+
if (requestParameters.search !== undefined) {
|
|
110
|
+
queryParameters['search'] = requestParameters.search;
|
|
111
|
+
}
|
|
112
|
+
headerParameters = {};
|
|
113
|
+
if (!(this.configuration && this.configuration.accessToken)) return [3 /*break*/, 2];
|
|
114
|
+
// oauth required
|
|
115
|
+
_a = headerParameters;
|
|
116
|
+
_b = "Authorization";
|
|
117
|
+
return [4 /*yield*/, this.configuration.accessToken("session-oauth", [])];
|
|
118
|
+
case 1:
|
|
119
|
+
// oauth required
|
|
120
|
+
_a[_b] = _c.sent();
|
|
121
|
+
_c.label = 2;
|
|
122
|
+
case 2:
|
|
123
|
+
if (this.configuration && this.configuration.apiKey) {
|
|
124
|
+
headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // api-key authentication
|
|
125
|
+
}
|
|
126
|
+
return [4 /*yield*/, this.request({
|
|
127
|
+
path: "/v1/gfn/catalog/products",
|
|
128
|
+
method: 'GET',
|
|
129
|
+
headers: headerParameters,
|
|
130
|
+
query: queryParameters,
|
|
131
|
+
}, initOverrides)];
|
|
132
|
+
case 3:
|
|
133
|
+
response = _c.sent();
|
|
134
|
+
return [2 /*return*/, new runtime.JSONApiResponse(response, function (jsonValue) { return (0, index_1.ProductsResponseFromJSON)(jsonValue); })];
|
|
135
|
+
}
|
|
136
|
+
});
|
|
137
|
+
});
|
|
138
|
+
};
|
|
139
|
+
/**
|
|
140
|
+
* Lists GFN products
|
|
141
|
+
* List GFN products
|
|
142
|
+
*/
|
|
143
|
+
ProductsApi.prototype.listProducts = function (project, optionalParameters, initOverrides) {
|
|
144
|
+
if (optionalParameters === void 0) { optionalParameters = {}; }
|
|
145
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
146
|
+
var response;
|
|
147
|
+
return __generator(this, function (_a) {
|
|
148
|
+
switch (_a.label) {
|
|
149
|
+
case 0: return [4 /*yield*/, this.listProductsRaw(__assign({ project: project }, optionalParameters), initOverrides)];
|
|
150
|
+
case 1:
|
|
151
|
+
response = _a.sent();
|
|
152
|
+
return [4 /*yield*/, response.value()];
|
|
153
|
+
case 2: return [2 /*return*/, _a.sent()];
|
|
154
|
+
}
|
|
155
|
+
});
|
|
156
|
+
});
|
|
157
|
+
};
|
|
158
|
+
return ProductsApi;
|
|
159
|
+
}(runtime.BaseAPI));
|
|
160
|
+
exports.ProductsApi = ProductsApi;
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* GFN Catalog API
|
|
3
|
+
* Manage Teemill GFN Products For full documentation on functionality and account settings go to [teemill.com](https://teemill.com)
|
|
4
|
+
*
|
|
5
|
+
* The version of the OpenAPI document: 0.1.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 { Variant, VariantsResponse } from '../models/index';
|
|
14
|
+
export interface GetVariantRequest {
|
|
15
|
+
project: string;
|
|
16
|
+
variantId: string;
|
|
17
|
+
fields?: string;
|
|
18
|
+
}
|
|
19
|
+
export interface ListVariantsRequest {
|
|
20
|
+
project: string;
|
|
21
|
+
fields?: string;
|
|
22
|
+
search?: string;
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
*
|
|
26
|
+
*/
|
|
27
|
+
export declare class VariantsApi extends runtime.BaseAPI {
|
|
28
|
+
/**
|
|
29
|
+
* Gets a GFN variant by the given id
|
|
30
|
+
* Get a GFN variant
|
|
31
|
+
*/
|
|
32
|
+
getVariantRaw(requestParameters: GetVariantRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<Variant>>;
|
|
33
|
+
/**
|
|
34
|
+
* Gets a GFN variant by the given id
|
|
35
|
+
* Get a GFN variant
|
|
36
|
+
*/
|
|
37
|
+
getVariant(project: string, variantId: string, optionalParameters?: runtime.OptionalOnly<GetVariantRequest>, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<Variant>;
|
|
38
|
+
/**
|
|
39
|
+
* Lists GFN variants
|
|
40
|
+
* List GFN variants
|
|
41
|
+
*/
|
|
42
|
+
listVariantsRaw(requestParameters: ListVariantsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<VariantsResponse>>;
|
|
43
|
+
/**
|
|
44
|
+
* Lists GFN variants
|
|
45
|
+
* List GFN variants
|
|
46
|
+
*/
|
|
47
|
+
listVariants(project: string, optionalParameters?: runtime.OptionalOnly<ListVariantsRequest>, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<VariantsResponse>;
|
|
48
|
+
}
|
|
@@ -0,0 +1,229 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/* tslint:disable */
|
|
3
|
+
/* eslint-disable */
|
|
4
|
+
/**
|
|
5
|
+
* GFN Catalog API
|
|
6
|
+
* Manage Teemill GFN Products For full documentation on functionality and account settings go to [teemill.com](https://teemill.com)
|
|
7
|
+
*
|
|
8
|
+
* The version of the OpenAPI document: 0.1.0
|
|
9
|
+
* Contact: hello@teemill.com
|
|
10
|
+
*
|
|
11
|
+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
12
|
+
* https://openapi-generator.tech
|
|
13
|
+
* Do not edit the class manually.
|
|
14
|
+
*/
|
|
15
|
+
var __extends = (this && this.__extends) || (function () {
|
|
16
|
+
var extendStatics = function (d, b) {
|
|
17
|
+
extendStatics = Object.setPrototypeOf ||
|
|
18
|
+
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
19
|
+
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
20
|
+
return extendStatics(d, b);
|
|
21
|
+
};
|
|
22
|
+
return function (d, b) {
|
|
23
|
+
if (typeof b !== "function" && b !== null)
|
|
24
|
+
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
25
|
+
extendStatics(d, b);
|
|
26
|
+
function __() { this.constructor = d; }
|
|
27
|
+
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
28
|
+
};
|
|
29
|
+
})();
|
|
30
|
+
var __assign = (this && this.__assign) || function () {
|
|
31
|
+
__assign = Object.assign || function(t) {
|
|
32
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
33
|
+
s = arguments[i];
|
|
34
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
35
|
+
t[p] = s[p];
|
|
36
|
+
}
|
|
37
|
+
return t;
|
|
38
|
+
};
|
|
39
|
+
return __assign.apply(this, arguments);
|
|
40
|
+
};
|
|
41
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
42
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
43
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
44
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
45
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
46
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
47
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
48
|
+
});
|
|
49
|
+
};
|
|
50
|
+
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
51
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
52
|
+
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
53
|
+
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
54
|
+
function step(op) {
|
|
55
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
56
|
+
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
57
|
+
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
58
|
+
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
59
|
+
switch (op[0]) {
|
|
60
|
+
case 0: case 1: t = op; break;
|
|
61
|
+
case 4: _.label++; return { value: op[1], done: false };
|
|
62
|
+
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
63
|
+
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
64
|
+
default:
|
|
65
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
66
|
+
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
67
|
+
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
68
|
+
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
69
|
+
if (t[2]) _.ops.pop();
|
|
70
|
+
_.trys.pop(); continue;
|
|
71
|
+
}
|
|
72
|
+
op = body.call(thisArg, _);
|
|
73
|
+
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
74
|
+
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
75
|
+
}
|
|
76
|
+
};
|
|
77
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
78
|
+
exports.VariantsApi = void 0;
|
|
79
|
+
var runtime = require("../runtime");
|
|
80
|
+
var index_1 = require("../models/index");
|
|
81
|
+
/**
|
|
82
|
+
*
|
|
83
|
+
*/
|
|
84
|
+
var VariantsApi = /** @class */ (function (_super) {
|
|
85
|
+
__extends(VariantsApi, _super);
|
|
86
|
+
function VariantsApi() {
|
|
87
|
+
return _super !== null && _super.apply(this, arguments) || this;
|
|
88
|
+
}
|
|
89
|
+
/**
|
|
90
|
+
* Gets a GFN variant by the given id
|
|
91
|
+
* Get a GFN variant
|
|
92
|
+
*/
|
|
93
|
+
VariantsApi.prototype.getVariantRaw = function (requestParameters, initOverrides) {
|
|
94
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
95
|
+
var queryParameters, headerParameters, _a, _b, response;
|
|
96
|
+
return __generator(this, function (_c) {
|
|
97
|
+
switch (_c.label) {
|
|
98
|
+
case 0:
|
|
99
|
+
if (requestParameters.project === null || requestParameters.project === undefined) {
|
|
100
|
+
throw new runtime.RequiredError('project', 'Required parameter requestParameters.project was null or undefined when calling getVariant.');
|
|
101
|
+
}
|
|
102
|
+
if (requestParameters.variantId === null || requestParameters.variantId === undefined) {
|
|
103
|
+
throw new runtime.RequiredError('variantId', 'Required parameter requestParameters.variantId was null or undefined when calling getVariant.');
|
|
104
|
+
}
|
|
105
|
+
queryParameters = {};
|
|
106
|
+
if (requestParameters.project !== undefined) {
|
|
107
|
+
queryParameters['project'] = requestParameters.project;
|
|
108
|
+
}
|
|
109
|
+
if (requestParameters.fields !== undefined) {
|
|
110
|
+
queryParameters['fields'] = requestParameters.fields;
|
|
111
|
+
}
|
|
112
|
+
headerParameters = {};
|
|
113
|
+
if (!(this.configuration && this.configuration.accessToken)) return [3 /*break*/, 2];
|
|
114
|
+
// oauth required
|
|
115
|
+
_a = headerParameters;
|
|
116
|
+
_b = "Authorization";
|
|
117
|
+
return [4 /*yield*/, this.configuration.accessToken("session-oauth", [])];
|
|
118
|
+
case 1:
|
|
119
|
+
// oauth required
|
|
120
|
+
_a[_b] = _c.sent();
|
|
121
|
+
_c.label = 2;
|
|
122
|
+
case 2:
|
|
123
|
+
if (this.configuration && this.configuration.apiKey) {
|
|
124
|
+
headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // api-key authentication
|
|
125
|
+
}
|
|
126
|
+
return [4 /*yield*/, this.request({
|
|
127
|
+
path: "/v1/gfn/catalog/variants/{variantId}".replace("{".concat("variantId", "}"), encodeURIComponent(String(requestParameters.variantId))),
|
|
128
|
+
method: 'GET',
|
|
129
|
+
headers: headerParameters,
|
|
130
|
+
query: queryParameters,
|
|
131
|
+
}, initOverrides)];
|
|
132
|
+
case 3:
|
|
133
|
+
response = _c.sent();
|
|
134
|
+
return [2 /*return*/, new runtime.JSONApiResponse(response, function (jsonValue) { return (0, index_1.VariantFromJSON)(jsonValue); })];
|
|
135
|
+
}
|
|
136
|
+
});
|
|
137
|
+
});
|
|
138
|
+
};
|
|
139
|
+
/**
|
|
140
|
+
* Gets a GFN variant by the given id
|
|
141
|
+
* Get a GFN variant
|
|
142
|
+
*/
|
|
143
|
+
VariantsApi.prototype.getVariant = function (project, variantId, optionalParameters, initOverrides) {
|
|
144
|
+
if (optionalParameters === void 0) { optionalParameters = {}; }
|
|
145
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
146
|
+
var response;
|
|
147
|
+
return __generator(this, function (_a) {
|
|
148
|
+
switch (_a.label) {
|
|
149
|
+
case 0: return [4 /*yield*/, this.getVariantRaw(__assign({ project: project, variantId: variantId }, optionalParameters), initOverrides)];
|
|
150
|
+
case 1:
|
|
151
|
+
response = _a.sent();
|
|
152
|
+
return [4 /*yield*/, response.value()];
|
|
153
|
+
case 2: return [2 /*return*/, _a.sent()];
|
|
154
|
+
}
|
|
155
|
+
});
|
|
156
|
+
});
|
|
157
|
+
};
|
|
158
|
+
/**
|
|
159
|
+
* Lists GFN variants
|
|
160
|
+
* List GFN variants
|
|
161
|
+
*/
|
|
162
|
+
VariantsApi.prototype.listVariantsRaw = function (requestParameters, initOverrides) {
|
|
163
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
164
|
+
var queryParameters, headerParameters, _a, _b, response;
|
|
165
|
+
return __generator(this, function (_c) {
|
|
166
|
+
switch (_c.label) {
|
|
167
|
+
case 0:
|
|
168
|
+
if (requestParameters.project === null || requestParameters.project === undefined) {
|
|
169
|
+
throw new runtime.RequiredError('project', 'Required parameter requestParameters.project was null or undefined when calling listVariants.');
|
|
170
|
+
}
|
|
171
|
+
queryParameters = {};
|
|
172
|
+
if (requestParameters.project !== undefined) {
|
|
173
|
+
queryParameters['project'] = requestParameters.project;
|
|
174
|
+
}
|
|
175
|
+
if (requestParameters.fields !== undefined) {
|
|
176
|
+
queryParameters['fields'] = requestParameters.fields;
|
|
177
|
+
}
|
|
178
|
+
if (requestParameters.search !== undefined) {
|
|
179
|
+
queryParameters['search'] = requestParameters.search;
|
|
180
|
+
}
|
|
181
|
+
headerParameters = {};
|
|
182
|
+
if (!(this.configuration && this.configuration.accessToken)) return [3 /*break*/, 2];
|
|
183
|
+
// oauth required
|
|
184
|
+
_a = headerParameters;
|
|
185
|
+
_b = "Authorization";
|
|
186
|
+
return [4 /*yield*/, this.configuration.accessToken("session-oauth", [])];
|
|
187
|
+
case 1:
|
|
188
|
+
// oauth required
|
|
189
|
+
_a[_b] = _c.sent();
|
|
190
|
+
_c.label = 2;
|
|
191
|
+
case 2:
|
|
192
|
+
if (this.configuration && this.configuration.apiKey) {
|
|
193
|
+
headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // api-key authentication
|
|
194
|
+
}
|
|
195
|
+
return [4 /*yield*/, this.request({
|
|
196
|
+
path: "/v1/gfn/catalog/variants",
|
|
197
|
+
method: 'GET',
|
|
198
|
+
headers: headerParameters,
|
|
199
|
+
query: queryParameters,
|
|
200
|
+
}, initOverrides)];
|
|
201
|
+
case 3:
|
|
202
|
+
response = _c.sent();
|
|
203
|
+
return [2 /*return*/, new runtime.JSONApiResponse(response, function (jsonValue) { return (0, index_1.VariantsResponseFromJSON)(jsonValue); })];
|
|
204
|
+
}
|
|
205
|
+
});
|
|
206
|
+
});
|
|
207
|
+
};
|
|
208
|
+
/**
|
|
209
|
+
* Lists GFN variants
|
|
210
|
+
* List GFN variants
|
|
211
|
+
*/
|
|
212
|
+
VariantsApi.prototype.listVariants = function (project, optionalParameters, initOverrides) {
|
|
213
|
+
if (optionalParameters === void 0) { optionalParameters = {}; }
|
|
214
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
215
|
+
var response;
|
|
216
|
+
return __generator(this, function (_a) {
|
|
217
|
+
switch (_a.label) {
|
|
218
|
+
case 0: return [4 /*yield*/, this.listVariantsRaw(__assign({ project: project }, optionalParameters), initOverrides)];
|
|
219
|
+
case 1:
|
|
220
|
+
response = _a.sent();
|
|
221
|
+
return [4 /*yield*/, response.value()];
|
|
222
|
+
case 2: return [2 /*return*/, _a.sent()];
|
|
223
|
+
}
|
|
224
|
+
});
|
|
225
|
+
});
|
|
226
|
+
};
|
|
227
|
+
return VariantsApi;
|
|
228
|
+
}(runtime.BaseAPI));
|
|
229
|
+
exports.VariantsApi = VariantsApi;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
/* tslint:disable */
|
|
18
|
+
/* eslint-disable */
|
|
19
|
+
__exportStar(require("./ProductsApi"), exports);
|
|
20
|
+
__exportStar(require("./VariantsApi"), exports);
|
package/dist/index.d.ts
ADDED
package/dist/index.js
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
/* tslint:disable */
|
|
18
|
+
/* eslint-disable */
|
|
19
|
+
__exportStar(require("./runtime"), exports);
|
|
20
|
+
__exportStar(require("./apis/index"), exports);
|
|
21
|
+
__exportStar(require("./models/index"), exports);
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* GFN Catalog API
|
|
3
|
+
* Manage Teemill GFN Products For full documentation on functionality and account settings go to [teemill.com](https://teemill.com)
|
|
4
|
+
*
|
|
5
|
+
* The version of the OpenAPI document: 0.1.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
|
+
/**
|
|
13
|
+
*
|
|
14
|
+
* @export
|
|
15
|
+
* @interface ApiError
|
|
16
|
+
*/
|
|
17
|
+
export interface ApiError {
|
|
18
|
+
/**
|
|
19
|
+
*
|
|
20
|
+
* @type {string}
|
|
21
|
+
* @memberof ApiError
|
|
22
|
+
*/
|
|
23
|
+
code?: string;
|
|
24
|
+
/**
|
|
25
|
+
*
|
|
26
|
+
* @type {string}
|
|
27
|
+
* @memberof ApiError
|
|
28
|
+
*/
|
|
29
|
+
message: string;
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* Check if a given object implements the ApiError interface.
|
|
33
|
+
*/
|
|
34
|
+
export declare function instanceOfApiError(value: object): boolean;
|
|
35
|
+
export declare function ApiErrorFromJSON(json: any): ApiError;
|
|
36
|
+
export declare function ApiErrorFromJSONTyped(json: any, ignoreDiscriminator: boolean): ApiError;
|
|
37
|
+
export declare function ApiErrorToJSON(value?: ApiError | null): any;
|