@teemill/integrations 0.4.2 → 0.6.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.
@@ -8,6 +8,8 @@ src/index.ts
8
8
  src/models/ApiError.ts
9
9
  src/models/Integration.ts
10
10
  src/models/IntegrationInfo.ts
11
+ src/models/IntegrationProduct.ts
12
+ src/models/IntegrationProductsResponse.ts
11
13
  src/models/IntegrationsResponse.ts
12
14
  src/models/index.ts
13
15
  src/runtime.ts
@@ -1 +1 @@
1
- 7.2.0-SNAPSHOT
1
+ 7.3.0-SNAPSHOT
package/README.md CHANGED
@@ -1,4 +1,4 @@
1
- ## @teemill/integrations@0.4.2
1
+ ## @teemill/integrations@0.6.0
2
2
 
3
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
4
 
@@ -36,7 +36,7 @@ navigate to the folder of your consuming project and run one of the following co
36
36
  _published:_
37
37
 
38
38
  ```
39
- npm install @teemill/integrations@0.4.2 --save
39
+ npm install @teemill/integrations@0.6.0 --save
40
40
  ```
41
41
 
42
42
  _unPublished (not recommended):_
@@ -2,7 +2,7 @@
2
2
  * Integrations API
3
3
  * Manage Teemill Integrations For full documentation on functionality and account settings go to [teemill.com](https://teemill.com)
4
4
  *
5
- * The version of the OpenAPI document: 0.4.2
5
+ * The version of the OpenAPI document: 0.6.0
6
6
  * Contact: hello@teemill.com
7
7
  *
8
8
  * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
@@ -10,9 +10,16 @@
10
10
  * Do not edit the class manually.
11
11
  */
12
12
  import * as runtime from '../runtime';
13
- import type { Integration, IntegrationsResponse } from '../models/index';
13
+ import type { Integration, IntegrationProduct, IntegrationProductsResponse, IntegrationsResponse } from '../models/index';
14
14
  export interface GetIntegrationRequest {
15
- integration: string;
15
+ integration: number;
16
+ }
17
+ export interface GetIntegrationProductRequest {
18
+ integration: number;
19
+ product: string;
20
+ }
21
+ export interface GetIntegrationProductsRequest {
22
+ integration: number;
16
23
  }
17
24
  /**
18
25
  *
@@ -27,7 +34,27 @@ export declare class IntegrationsApi extends runtime.BaseAPI {
27
34
  * Get an integration
28
35
  * Get integration
29
36
  */
30
- getIntegration(integration: string, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<Integration>;
37
+ getIntegration(integration: number, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<Integration>;
38
+ /**
39
+ * Get a product available for an integration
40
+ * Get integration product
41
+ */
42
+ getIntegrationProductRaw(requestParameters: GetIntegrationProductRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<IntegrationProduct>>;
43
+ /**
44
+ * Get a product available for an integration
45
+ * Get integration product
46
+ */
47
+ getIntegrationProduct(integration: number, product: string, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<IntegrationProduct>;
48
+ /**
49
+ * List all products available for an integration
50
+ * List integration products
51
+ */
52
+ getIntegrationProductsRaw(requestParameters: GetIntegrationProductsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<IntegrationProductsResponse>>;
53
+ /**
54
+ * List all products available for an integration
55
+ * List integration products
56
+ */
57
+ getIntegrationProducts(integration: number, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<IntegrationProductsResponse>;
31
58
  /**
32
59
  * List all integrations available
33
60
  * List integrations
@@ -5,7 +5,7 @@
5
5
  * Integrations API
6
6
  * Manage Teemill Integrations For full documentation on functionality and account settings go to [teemill.com](https://teemill.com)
7
7
  *
8
- * The version of the OpenAPI document: 0.4.2
8
+ * The version of the OpenAPI document: 0.6.0
9
9
  * Contact: hello@teemill.com
10
10
  *
11
11
  * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
@@ -136,6 +136,131 @@ var IntegrationsApi = /** @class */ (function (_super) {
136
136
  });
137
137
  });
138
138
  };
139
+ /**
140
+ * Get a product available for an integration
141
+ * Get integration product
142
+ */
143
+ IntegrationsApi.prototype.getIntegrationProductRaw = function (requestParameters, initOverrides) {
144
+ return __awaiter(this, void 0, void 0, function () {
145
+ var queryParameters, headerParameters, _a, _b, response;
146
+ return __generator(this, function (_c) {
147
+ switch (_c.label) {
148
+ case 0:
149
+ if (requestParameters.integration === null || requestParameters.integration === undefined) {
150
+ throw new runtime.RequiredError('integration', 'Required parameter requestParameters.integration was null or undefined when calling getIntegrationProduct.');
151
+ }
152
+ if (requestParameters.product === null || requestParameters.product === undefined) {
153
+ throw new runtime.RequiredError('product', 'Required parameter requestParameters.product was null or undefined when calling getIntegrationProduct.');
154
+ }
155
+ queryParameters = {};
156
+ headerParameters = {};
157
+ if (!(this.configuration && this.configuration.accessToken)) return [3 /*break*/, 2];
158
+ // oauth required
159
+ _a = headerParameters;
160
+ _b = "Authorization";
161
+ return [4 /*yield*/, this.configuration.accessToken("session-oauth", [])];
162
+ case 1:
163
+ // oauth required
164
+ _a[_b] = _c.sent();
165
+ _c.label = 2;
166
+ case 2:
167
+ if (this.configuration && this.configuration.apiKey) {
168
+ headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // api-key authentication
169
+ }
170
+ return [4 /*yield*/, this.request({
171
+ path: "/v1/integrations/{integration}/products/{product}".replace("{".concat("integration", "}"), encodeURIComponent(String(requestParameters.integration))).replace("{".concat("product", "}"), encodeURIComponent(String(requestParameters.product))),
172
+ method: 'GET',
173
+ headers: headerParameters,
174
+ query: queryParameters,
175
+ }, initOverrides)];
176
+ case 3:
177
+ response = _c.sent();
178
+ return [2 /*return*/, new runtime.JSONApiResponse(response, function (jsonValue) { return (0, index_1.IntegrationProductFromJSON)(jsonValue); })];
179
+ }
180
+ });
181
+ });
182
+ };
183
+ /**
184
+ * Get a product available for an integration
185
+ * Get integration product
186
+ */
187
+ IntegrationsApi.prototype.getIntegrationProduct = function (integration, product, initOverrides) {
188
+ return __awaiter(this, void 0, void 0, function () {
189
+ var response;
190
+ return __generator(this, function (_a) {
191
+ switch (_a.label) {
192
+ case 0: return [4 /*yield*/, this.getIntegrationProductRaw({
193
+ integration: integration, product: product,
194
+ }, initOverrides)];
195
+ case 1:
196
+ response = _a.sent();
197
+ return [4 /*yield*/, response.value()];
198
+ case 2: return [2 /*return*/, _a.sent()];
199
+ }
200
+ });
201
+ });
202
+ };
203
+ /**
204
+ * List all products available for an integration
205
+ * List integration products
206
+ */
207
+ IntegrationsApi.prototype.getIntegrationProductsRaw = function (requestParameters, initOverrides) {
208
+ return __awaiter(this, void 0, void 0, function () {
209
+ var queryParameters, headerParameters, _a, _b, response;
210
+ return __generator(this, function (_c) {
211
+ switch (_c.label) {
212
+ case 0:
213
+ if (requestParameters.integration === null || requestParameters.integration === undefined) {
214
+ throw new runtime.RequiredError('integration', 'Required parameter requestParameters.integration was null or undefined when calling getIntegrationProducts.');
215
+ }
216
+ queryParameters = {};
217
+ headerParameters = {};
218
+ if (!(this.configuration && this.configuration.accessToken)) return [3 /*break*/, 2];
219
+ // oauth required
220
+ _a = headerParameters;
221
+ _b = "Authorization";
222
+ return [4 /*yield*/, this.configuration.accessToken("session-oauth", [])];
223
+ case 1:
224
+ // oauth required
225
+ _a[_b] = _c.sent();
226
+ _c.label = 2;
227
+ case 2:
228
+ if (this.configuration && this.configuration.apiKey) {
229
+ headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // api-key authentication
230
+ }
231
+ return [4 /*yield*/, this.request({
232
+ path: "/v1/integrations/{integration}/products".replace("{".concat("integration", "}"), encodeURIComponent(String(requestParameters.integration))),
233
+ method: 'GET',
234
+ headers: headerParameters,
235
+ query: queryParameters,
236
+ }, initOverrides)];
237
+ case 3:
238
+ response = _c.sent();
239
+ return [2 /*return*/, new runtime.JSONApiResponse(response, function (jsonValue) { return (0, index_1.IntegrationProductsResponseFromJSON)(jsonValue); })];
240
+ }
241
+ });
242
+ });
243
+ };
244
+ /**
245
+ * List all products available for an integration
246
+ * List integration products
247
+ */
248
+ IntegrationsApi.prototype.getIntegrationProducts = function (integration, initOverrides) {
249
+ return __awaiter(this, void 0, void 0, function () {
250
+ var response;
251
+ return __generator(this, function (_a) {
252
+ switch (_a.label) {
253
+ case 0: return [4 /*yield*/, this.getIntegrationProductsRaw({
254
+ integration: integration,
255
+ }, initOverrides)];
256
+ case 1:
257
+ response = _a.sent();
258
+ return [4 /*yield*/, response.value()];
259
+ case 2: return [2 /*return*/, _a.sent()];
260
+ }
261
+ });
262
+ });
263
+ };
139
264
  /**
140
265
  * List all integrations available
141
266
  * List integrations
@@ -2,7 +2,7 @@
2
2
  * Integrations API
3
3
  * Manage Teemill Integrations For full documentation on functionality and account settings go to [teemill.com](https://teemill.com)
4
4
  *
5
- * The version of the OpenAPI document: 0.4.2
5
+ * The version of the OpenAPI document: 0.6.0
6
6
  * Contact: hello@teemill.com
7
7
  *
8
8
  * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
@@ -5,7 +5,7 @@
5
5
  * Integrations API
6
6
  * Manage Teemill Integrations For full documentation on functionality and account settings go to [teemill.com](https://teemill.com)
7
7
  *
8
- * The version of the OpenAPI document: 0.4.2
8
+ * The version of the OpenAPI document: 0.6.0
9
9
  * Contact: hello@teemill.com
10
10
  *
11
11
  * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
@@ -2,7 +2,7 @@
2
2
  * Integrations API
3
3
  * Manage Teemill Integrations For full documentation on functionality and account settings go to [teemill.com](https://teemill.com)
4
4
  *
5
- * The version of the OpenAPI document: 0.4.2
5
+ * The version of the OpenAPI document: 0.6.0
6
6
  * Contact: hello@teemill.com
7
7
  *
8
8
  * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
@@ -5,7 +5,7 @@
5
5
  * Integrations API
6
6
  * Manage Teemill Integrations For full documentation on functionality and account settings go to [teemill.com](https://teemill.com)
7
7
  *
8
- * The version of the OpenAPI document: 0.4.2
8
+ * The version of the OpenAPI document: 0.6.0
9
9
  * Contact: hello@teemill.com
10
10
  *
11
11
  * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
@@ -2,7 +2,7 @@
2
2
  * Integrations API
3
3
  * Manage Teemill Integrations For full documentation on functionality and account settings go to [teemill.com](https://teemill.com)
4
4
  *
5
- * The version of the OpenAPI document: 0.4.2
5
+ * The version of the OpenAPI document: 0.6.0
6
6
  * Contact: hello@teemill.com
7
7
  *
8
8
  * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
@@ -5,7 +5,7 @@
5
5
  * Integrations API
6
6
  * Manage Teemill Integrations For full documentation on functionality and account settings go to [teemill.com](https://teemill.com)
7
7
  *
8
- * The version of the OpenAPI document: 0.4.2
8
+ * The version of the OpenAPI document: 0.6.0
9
9
  * Contact: hello@teemill.com
10
10
  *
11
11
  * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
@@ -0,0 +1,67 @@
1
+ /**
2
+ * Integrations API
3
+ * Manage Teemill Integrations For full documentation on functionality and account settings go to [teemill.com](https://teemill.com)
4
+ *
5
+ * The version of the OpenAPI document: 0.6.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 IntegrationProduct
16
+ */
17
+ export interface IntegrationProduct {
18
+ /**
19
+ * The ID of the product
20
+ * @type {number}
21
+ * @memberof IntegrationProduct
22
+ */
23
+ readonly id?: number;
24
+ /**
25
+ * The SKU of the product
26
+ * @type {string}
27
+ * @memberof IntegrationProduct
28
+ */
29
+ sku: string;
30
+ /**
31
+ * The name of the product
32
+ * @type {string}
33
+ * @memberof IntegrationProduct
34
+ */
35
+ name: string;
36
+ /**
37
+ * The slug of the product that is used in the URL
38
+ * @type {string}
39
+ * @memberof IntegrationProduct
40
+ */
41
+ slug: string;
42
+ /**
43
+ * The user facing description of the product
44
+ * @type {string}
45
+ * @memberof IntegrationProduct
46
+ */
47
+ description: string;
48
+ /**
49
+ * The price of the product in GBP
50
+ * @type {number}
51
+ * @memberof IntegrationProduct
52
+ */
53
+ price: number;
54
+ /**
55
+ * The VAT rate of the product
56
+ * @type {number}
57
+ * @memberof IntegrationProduct
58
+ */
59
+ vatRate: number;
60
+ }
61
+ /**
62
+ * Check if a given object implements the IntegrationProduct interface.
63
+ */
64
+ export declare function instanceOfIntegrationProduct(value: object): boolean;
65
+ export declare function IntegrationProductFromJSON(json: any): IntegrationProduct;
66
+ export declare function IntegrationProductFromJSONTyped(json: any, ignoreDiscriminator: boolean): IntegrationProduct;
67
+ export declare function IntegrationProductToJSON(value?: IntegrationProduct | null): any;
@@ -0,0 +1,67 @@
1
+ "use strict";
2
+ /* tslint:disable */
3
+ /* eslint-disable */
4
+ /**
5
+ * Integrations API
6
+ * Manage Teemill Integrations For full documentation on functionality and account settings go to [teemill.com](https://teemill.com)
7
+ *
8
+ * The version of the OpenAPI document: 0.6.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
+ Object.defineProperty(exports, "__esModule", { value: true });
16
+ exports.IntegrationProductToJSON = exports.IntegrationProductFromJSONTyped = exports.IntegrationProductFromJSON = exports.instanceOfIntegrationProduct = void 0;
17
+ var runtime_1 = require("../runtime");
18
+ /**
19
+ * Check if a given object implements the IntegrationProduct interface.
20
+ */
21
+ function instanceOfIntegrationProduct(value) {
22
+ var isInstance = true;
23
+ isInstance = isInstance && "sku" in value;
24
+ isInstance = isInstance && "name" in value;
25
+ isInstance = isInstance && "slug" in value;
26
+ isInstance = isInstance && "description" in value;
27
+ isInstance = isInstance && "price" in value;
28
+ isInstance = isInstance && "vatRate" in value;
29
+ return isInstance;
30
+ }
31
+ exports.instanceOfIntegrationProduct = instanceOfIntegrationProduct;
32
+ function IntegrationProductFromJSON(json) {
33
+ return IntegrationProductFromJSONTyped(json, false);
34
+ }
35
+ exports.IntegrationProductFromJSON = IntegrationProductFromJSON;
36
+ function IntegrationProductFromJSONTyped(json, ignoreDiscriminator) {
37
+ if ((json === undefined) || (json === null)) {
38
+ return json;
39
+ }
40
+ return {
41
+ 'id': !(0, runtime_1.exists)(json, 'id') ? undefined : json['id'],
42
+ 'sku': json['sku'],
43
+ 'name': json['name'],
44
+ 'slug': json['slug'],
45
+ 'description': json['description'],
46
+ 'price': json['price'],
47
+ 'vatRate': json['vatRate'],
48
+ };
49
+ }
50
+ exports.IntegrationProductFromJSONTyped = IntegrationProductFromJSONTyped;
51
+ function IntegrationProductToJSON(value) {
52
+ if (value === undefined) {
53
+ return undefined;
54
+ }
55
+ if (value === null) {
56
+ return null;
57
+ }
58
+ return {
59
+ 'sku': value.sku,
60
+ 'name': value.name,
61
+ 'slug': value.slug,
62
+ 'description': value.description,
63
+ 'price': value.price,
64
+ 'vatRate': value.vatRate,
65
+ };
66
+ }
67
+ exports.IntegrationProductToJSON = IntegrationProductToJSON;
@@ -0,0 +1,32 @@
1
+ /**
2
+ * Integrations API
3
+ * Manage Teemill Integrations For full documentation on functionality and account settings go to [teemill.com](https://teemill.com)
4
+ *
5
+ * The version of the OpenAPI document: 0.6.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 type { IntegrationProduct } from './IntegrationProduct';
13
+ /**
14
+ *
15
+ * @export
16
+ * @interface IntegrationProductsResponse
17
+ */
18
+ export interface IntegrationProductsResponse {
19
+ /**
20
+ *
21
+ * @type {Array<IntegrationProduct>}
22
+ * @memberof IntegrationProductsResponse
23
+ */
24
+ products: Array<IntegrationProduct>;
25
+ }
26
+ /**
27
+ * Check if a given object implements the IntegrationProductsResponse interface.
28
+ */
29
+ export declare function instanceOfIntegrationProductsResponse(value: object): boolean;
30
+ export declare function IntegrationProductsResponseFromJSON(json: any): IntegrationProductsResponse;
31
+ export declare function IntegrationProductsResponseFromJSONTyped(json: any, ignoreDiscriminator: boolean): IntegrationProductsResponse;
32
+ export declare function IntegrationProductsResponseToJSON(value?: IntegrationProductsResponse | null): any;
@@ -0,0 +1,51 @@
1
+ "use strict";
2
+ /* tslint:disable */
3
+ /* eslint-disable */
4
+ /**
5
+ * Integrations API
6
+ * Manage Teemill Integrations For full documentation on functionality and account settings go to [teemill.com](https://teemill.com)
7
+ *
8
+ * The version of the OpenAPI document: 0.6.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
+ Object.defineProperty(exports, "__esModule", { value: true });
16
+ exports.IntegrationProductsResponseToJSON = exports.IntegrationProductsResponseFromJSONTyped = exports.IntegrationProductsResponseFromJSON = exports.instanceOfIntegrationProductsResponse = void 0;
17
+ var IntegrationProduct_1 = require("./IntegrationProduct");
18
+ /**
19
+ * Check if a given object implements the IntegrationProductsResponse interface.
20
+ */
21
+ function instanceOfIntegrationProductsResponse(value) {
22
+ var isInstance = true;
23
+ isInstance = isInstance && "products" in value;
24
+ return isInstance;
25
+ }
26
+ exports.instanceOfIntegrationProductsResponse = instanceOfIntegrationProductsResponse;
27
+ function IntegrationProductsResponseFromJSON(json) {
28
+ return IntegrationProductsResponseFromJSONTyped(json, false);
29
+ }
30
+ exports.IntegrationProductsResponseFromJSON = IntegrationProductsResponseFromJSON;
31
+ function IntegrationProductsResponseFromJSONTyped(json, ignoreDiscriminator) {
32
+ if ((json === undefined) || (json === null)) {
33
+ return json;
34
+ }
35
+ return {
36
+ 'products': (json['products'].map(IntegrationProduct_1.IntegrationProductFromJSON)),
37
+ };
38
+ }
39
+ exports.IntegrationProductsResponseFromJSONTyped = IntegrationProductsResponseFromJSONTyped;
40
+ function IntegrationProductsResponseToJSON(value) {
41
+ if (value === undefined) {
42
+ return undefined;
43
+ }
44
+ if (value === null) {
45
+ return null;
46
+ }
47
+ return {
48
+ 'products': (value.products.map(IntegrationProduct_1.IntegrationProductToJSON)),
49
+ };
50
+ }
51
+ exports.IntegrationProductsResponseToJSON = IntegrationProductsResponseToJSON;
@@ -2,7 +2,7 @@
2
2
  * Integrations API
3
3
  * Manage Teemill Integrations For full documentation on functionality and account settings go to [teemill.com](https://teemill.com)
4
4
  *
5
- * The version of the OpenAPI document: 0.4.2
5
+ * The version of the OpenAPI document: 0.6.0
6
6
  * Contact: hello@teemill.com
7
7
  *
8
8
  * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
@@ -5,7 +5,7 @@
5
5
  * Integrations API
6
6
  * Manage Teemill Integrations For full documentation on functionality and account settings go to [teemill.com](https://teemill.com)
7
7
  *
8
- * The version of the OpenAPI document: 0.4.2
8
+ * The version of the OpenAPI document: 0.6.0
9
9
  * Contact: hello@teemill.com
10
10
  *
11
11
  * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
@@ -1,4 +1,6 @@
1
1
  export * from './ApiError';
2
2
  export * from './Integration';
3
3
  export * from './IntegrationInfo';
4
+ export * from './IntegrationProduct';
5
+ export * from './IntegrationProductsResponse';
4
6
  export * from './IntegrationsResponse';
@@ -19,4 +19,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
19
19
  __exportStar(require("./ApiError"), exports);
20
20
  __exportStar(require("./Integration"), exports);
21
21
  __exportStar(require("./IntegrationInfo"), exports);
22
+ __exportStar(require("./IntegrationProduct"), exports);
23
+ __exportStar(require("./IntegrationProductsResponse"), exports);
22
24
  __exportStar(require("./IntegrationsResponse"), exports);
package/dist/runtime.d.ts CHANGED
@@ -2,7 +2,7 @@
2
2
  * Integrations API
3
3
  * Manage Teemill Integrations For full documentation on functionality and account settings go to [teemill.com](https://teemill.com)
4
4
  *
5
- * The version of the OpenAPI document: 0.4.2
5
+ * The version of the OpenAPI document: 0.6.0
6
6
  * Contact: hello@teemill.com
7
7
  *
8
8
  * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
package/dist/runtime.js CHANGED
@@ -5,7 +5,7 @@
5
5
  * Integrations API
6
6
  * Manage Teemill Integrations For full documentation on functionality and account settings go to [teemill.com](https://teemill.com)
7
7
  *
8
- * The version of the OpenAPI document: 0.4.2
8
+ * The version of the OpenAPI document: 0.6.0
9
9
  * Contact: hello@teemill.com
10
10
  *
11
11
  * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@teemill/integrations",
3
- "version": "0.4.2",
3
+ "version": "0.6.0",
4
4
  "description": "OpenAPI client for @teemill/integrations",
5
5
  "author": "OpenAPI-Generator",
6
6
  "repository": {
@@ -4,7 +4,7 @@
4
4
  * Integrations API
5
5
  * Manage Teemill Integrations For full documentation on functionality and account settings go to [teemill.com](https://teemill.com)
6
6
  *
7
- * The version of the OpenAPI document: 0.4.2
7
+ * The version of the OpenAPI document: 0.6.0
8
8
  * Contact: hello@teemill.com
9
9
  *
10
10
  * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
@@ -17,6 +17,8 @@ import * as runtime from '../runtime';
17
17
  import type {
18
18
  ApiError,
19
19
  Integration,
20
+ IntegrationProduct,
21
+ IntegrationProductsResponse,
20
22
  IntegrationsResponse,
21
23
  } from '../models/index';
22
24
  import {
@@ -24,12 +26,25 @@ import {
24
26
  ApiErrorToJSON,
25
27
  IntegrationFromJSON,
26
28
  IntegrationToJSON,
29
+ IntegrationProductFromJSON,
30
+ IntegrationProductToJSON,
31
+ IntegrationProductsResponseFromJSON,
32
+ IntegrationProductsResponseToJSON,
27
33
  IntegrationsResponseFromJSON,
28
34
  IntegrationsResponseToJSON,
29
35
  } from '../models/index';
30
36
 
31
37
  export interface GetIntegrationRequest {
32
- integration: string;
38
+ integration: number;
39
+ }
40
+
41
+ export interface GetIntegrationProductRequest {
42
+ integration: number;
43
+ product: string;
44
+ }
45
+
46
+ export interface GetIntegrationProductsRequest {
47
+ integration: number;
33
48
  }
34
49
 
35
50
  /**
@@ -74,7 +89,7 @@ export class IntegrationsApi extends runtime.BaseAPI {
74
89
  * Get integration
75
90
  */
76
91
  async getIntegration(
77
- integration: string,
92
+ integration: number,
78
93
  initOverrides?: RequestInit | runtime.InitOverrideFunction
79
94
  ): Promise<Integration> {
80
95
  const response = await this.getIntegrationRaw(
@@ -87,6 +102,110 @@ export class IntegrationsApi extends runtime.BaseAPI {
87
102
  return await response.value();
88
103
  }
89
104
 
105
+ /**
106
+ * Get a product available for an integration
107
+ * Get integration product
108
+ */
109
+ async getIntegrationProductRaw(requestParameters: GetIntegrationProductRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<IntegrationProduct>> {
110
+ if (requestParameters.integration === null || requestParameters.integration === undefined) {
111
+ throw new runtime.RequiredError('integration','Required parameter requestParameters.integration was null or undefined when calling getIntegrationProduct.');
112
+ }
113
+
114
+ if (requestParameters.product === null || requestParameters.product === undefined) {
115
+ throw new runtime.RequiredError('product','Required parameter requestParameters.product was null or undefined when calling getIntegrationProduct.');
116
+ }
117
+
118
+ const queryParameters: any = {};
119
+
120
+ const headerParameters: runtime.HTTPHeaders = {};
121
+
122
+ if (this.configuration && this.configuration.accessToken) {
123
+ // oauth required
124
+ headerParameters["Authorization"] = await this.configuration.accessToken("session-oauth", []);
125
+ }
126
+
127
+ if (this.configuration && this.configuration.apiKey) {
128
+ headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // api-key authentication
129
+ }
130
+
131
+ const response = await this.request({
132
+ path: `/v1/integrations/{integration}/products/{product}`.replace(`{${"integration"}}`, encodeURIComponent(String(requestParameters.integration))).replace(`{${"product"}}`, encodeURIComponent(String(requestParameters.product))),
133
+ method: 'GET',
134
+ headers: headerParameters,
135
+ query: queryParameters,
136
+ }, initOverrides);
137
+
138
+ return new runtime.JSONApiResponse(response, (jsonValue) => IntegrationProductFromJSON(jsonValue));
139
+ }
140
+
141
+ /**
142
+ * Get a product available for an integration
143
+ * Get integration product
144
+ */
145
+ async getIntegrationProduct(
146
+ integration: number, product: string,
147
+ initOverrides?: RequestInit | runtime.InitOverrideFunction
148
+ ): Promise<IntegrationProduct> {
149
+ const response = await this.getIntegrationProductRaw(
150
+ {
151
+ integration: integration,product: product,
152
+ },
153
+ initOverrides
154
+ );
155
+
156
+ return await response.value();
157
+ }
158
+
159
+ /**
160
+ * List all products available for an integration
161
+ * List integration products
162
+ */
163
+ async getIntegrationProductsRaw(requestParameters: GetIntegrationProductsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<IntegrationProductsResponse>> {
164
+ if (requestParameters.integration === null || requestParameters.integration === undefined) {
165
+ throw new runtime.RequiredError('integration','Required parameter requestParameters.integration was null or undefined when calling getIntegrationProducts.');
166
+ }
167
+
168
+ const queryParameters: any = {};
169
+
170
+ const headerParameters: runtime.HTTPHeaders = {};
171
+
172
+ if (this.configuration && this.configuration.accessToken) {
173
+ // oauth required
174
+ headerParameters["Authorization"] = await this.configuration.accessToken("session-oauth", []);
175
+ }
176
+
177
+ if (this.configuration && this.configuration.apiKey) {
178
+ headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // api-key authentication
179
+ }
180
+
181
+ const response = await this.request({
182
+ path: `/v1/integrations/{integration}/products`.replace(`{${"integration"}}`, encodeURIComponent(String(requestParameters.integration))),
183
+ method: 'GET',
184
+ headers: headerParameters,
185
+ query: queryParameters,
186
+ }, initOverrides);
187
+
188
+ return new runtime.JSONApiResponse(response, (jsonValue) => IntegrationProductsResponseFromJSON(jsonValue));
189
+ }
190
+
191
+ /**
192
+ * List all products available for an integration
193
+ * List integration products
194
+ */
195
+ async getIntegrationProducts(
196
+ integration: number,
197
+ initOverrides?: RequestInit | runtime.InitOverrideFunction
198
+ ): Promise<IntegrationProductsResponse> {
199
+ const response = await this.getIntegrationProductsRaw(
200
+ {
201
+ integration: integration,
202
+ },
203
+ initOverrides
204
+ );
205
+
206
+ return await response.value();
207
+ }
208
+
90
209
  /**
91
210
  * List all integrations available
92
211
  * List integrations
@@ -4,7 +4,7 @@
4
4
  * Integrations API
5
5
  * Manage Teemill Integrations For full documentation on functionality and account settings go to [teemill.com](https://teemill.com)
6
6
  *
7
- * The version of the OpenAPI document: 0.4.2
7
+ * The version of the OpenAPI document: 0.6.0
8
8
  * Contact: hello@teemill.com
9
9
  *
10
10
  * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
@@ -4,7 +4,7 @@
4
4
  * Integrations API
5
5
  * Manage Teemill Integrations For full documentation on functionality and account settings go to [teemill.com](https://teemill.com)
6
6
  *
7
- * The version of the OpenAPI document: 0.4.2
7
+ * The version of the OpenAPI document: 0.6.0
8
8
  * Contact: hello@teemill.com
9
9
  *
10
10
  * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
@@ -4,7 +4,7 @@
4
4
  * Integrations API
5
5
  * Manage Teemill Integrations For full documentation on functionality and account settings go to [teemill.com](https://teemill.com)
6
6
  *
7
- * The version of the OpenAPI document: 0.4.2
7
+ * The version of the OpenAPI document: 0.6.0
8
8
  * Contact: hello@teemill.com
9
9
  *
10
10
  * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
@@ -0,0 +1,118 @@
1
+ /* tslint:disable */
2
+ /* eslint-disable */
3
+ /**
4
+ * Integrations API
5
+ * Manage Teemill Integrations For full documentation on functionality and account settings go to [teemill.com](https://teemill.com)
6
+ *
7
+ * The version of the OpenAPI document: 0.6.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 { exists, mapValues } from '../runtime';
16
+ /**
17
+ *
18
+ * @export
19
+ * @interface IntegrationProduct
20
+ */
21
+ export interface IntegrationProduct {
22
+ /**
23
+ * The ID of the product
24
+ * @type {number}
25
+ * @memberof IntegrationProduct
26
+ */
27
+ readonly id?: number;
28
+ /**
29
+ * The SKU of the product
30
+ * @type {string}
31
+ * @memberof IntegrationProduct
32
+ */
33
+ sku: string;
34
+ /**
35
+ * The name of the product
36
+ * @type {string}
37
+ * @memberof IntegrationProduct
38
+ */
39
+ name: string;
40
+ /**
41
+ * The slug of the product that is used in the URL
42
+ * @type {string}
43
+ * @memberof IntegrationProduct
44
+ */
45
+ slug: string;
46
+ /**
47
+ * The user facing description of the product
48
+ * @type {string}
49
+ * @memberof IntegrationProduct
50
+ */
51
+ description: string;
52
+ /**
53
+ * The price of the product in GBP
54
+ * @type {number}
55
+ * @memberof IntegrationProduct
56
+ */
57
+ price: number;
58
+ /**
59
+ * The VAT rate of the product
60
+ * @type {number}
61
+ * @memberof IntegrationProduct
62
+ */
63
+ vatRate: number;
64
+ }
65
+
66
+ /**
67
+ * Check if a given object implements the IntegrationProduct interface.
68
+ */
69
+ export function instanceOfIntegrationProduct(value: object): boolean {
70
+ let isInstance = true;
71
+ isInstance = isInstance && "sku" in value;
72
+ isInstance = isInstance && "name" in value;
73
+ isInstance = isInstance && "slug" in value;
74
+ isInstance = isInstance && "description" in value;
75
+ isInstance = isInstance && "price" in value;
76
+ isInstance = isInstance && "vatRate" in value;
77
+
78
+ return isInstance;
79
+ }
80
+
81
+ export function IntegrationProductFromJSON(json: any): IntegrationProduct {
82
+ return IntegrationProductFromJSONTyped(json, false);
83
+ }
84
+
85
+ export function IntegrationProductFromJSONTyped(json: any, ignoreDiscriminator: boolean): IntegrationProduct {
86
+ if ((json === undefined) || (json === null)) {
87
+ return json;
88
+ }
89
+ return {
90
+
91
+ 'id': !exists(json, 'id') ? undefined : json['id'],
92
+ 'sku': json['sku'],
93
+ 'name': json['name'],
94
+ 'slug': json['slug'],
95
+ 'description': json['description'],
96
+ 'price': json['price'],
97
+ 'vatRate': json['vatRate'],
98
+ };
99
+ }
100
+
101
+ export function IntegrationProductToJSON(value?: IntegrationProduct | null): any {
102
+ if (value === undefined) {
103
+ return undefined;
104
+ }
105
+ if (value === null) {
106
+ return null;
107
+ }
108
+ return {
109
+
110
+ 'sku': value.sku,
111
+ 'name': value.name,
112
+ 'slug': value.slug,
113
+ 'description': value.description,
114
+ 'price': value.price,
115
+ 'vatRate': value.vatRate,
116
+ };
117
+ }
118
+
@@ -0,0 +1,73 @@
1
+ /* tslint:disable */
2
+ /* eslint-disable */
3
+ /**
4
+ * Integrations API
5
+ * Manage Teemill Integrations For full documentation on functionality and account settings go to [teemill.com](https://teemill.com)
6
+ *
7
+ * The version of the OpenAPI document: 0.6.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 { exists, mapValues } from '../runtime';
16
+ import type { IntegrationProduct } from './IntegrationProduct';
17
+ import {
18
+ IntegrationProductFromJSON,
19
+ IntegrationProductFromJSONTyped,
20
+ IntegrationProductToJSON,
21
+ } from './IntegrationProduct';
22
+
23
+ /**
24
+ *
25
+ * @export
26
+ * @interface IntegrationProductsResponse
27
+ */
28
+ export interface IntegrationProductsResponse {
29
+ /**
30
+ *
31
+ * @type {Array<IntegrationProduct>}
32
+ * @memberof IntegrationProductsResponse
33
+ */
34
+ products: Array<IntegrationProduct>;
35
+ }
36
+
37
+ /**
38
+ * Check if a given object implements the IntegrationProductsResponse interface.
39
+ */
40
+ export function instanceOfIntegrationProductsResponse(value: object): boolean {
41
+ let isInstance = true;
42
+ isInstance = isInstance && "products" in value;
43
+
44
+ return isInstance;
45
+ }
46
+
47
+ export function IntegrationProductsResponseFromJSON(json: any): IntegrationProductsResponse {
48
+ return IntegrationProductsResponseFromJSONTyped(json, false);
49
+ }
50
+
51
+ export function IntegrationProductsResponseFromJSONTyped(json: any, ignoreDiscriminator: boolean): IntegrationProductsResponse {
52
+ if ((json === undefined) || (json === null)) {
53
+ return json;
54
+ }
55
+ return {
56
+
57
+ 'products': ((json['products'] as Array<any>).map(IntegrationProductFromJSON)),
58
+ };
59
+ }
60
+
61
+ export function IntegrationProductsResponseToJSON(value?: IntegrationProductsResponse | null): any {
62
+ if (value === undefined) {
63
+ return undefined;
64
+ }
65
+ if (value === null) {
66
+ return null;
67
+ }
68
+ return {
69
+
70
+ 'products': ((value.products as Array<any>).map(IntegrationProductToJSON)),
71
+ };
72
+ }
73
+
@@ -4,7 +4,7 @@
4
4
  * Integrations API
5
5
  * Manage Teemill Integrations For full documentation on functionality and account settings go to [teemill.com](https://teemill.com)
6
6
  *
7
- * The version of the OpenAPI document: 0.4.2
7
+ * The version of the OpenAPI document: 0.6.0
8
8
  * Contact: hello@teemill.com
9
9
  *
10
10
  * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
@@ -3,4 +3,6 @@
3
3
  export * from './ApiError';
4
4
  export * from './Integration';
5
5
  export * from './IntegrationInfo';
6
+ export * from './IntegrationProduct';
7
+ export * from './IntegrationProductsResponse';
6
8
  export * from './IntegrationsResponse';
package/src/runtime.ts CHANGED
@@ -4,7 +4,7 @@
4
4
  * Integrations API
5
5
  * Manage Teemill Integrations For full documentation on functionality and account settings go to [teemill.com](https://teemill.com)
6
6
  *
7
- * The version of the OpenAPI document: 0.4.2
7
+ * The version of the OpenAPI document: 0.6.0
8
8
  * Contact: hello@teemill.com
9
9
  *
10
10
  * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).