@digital8/lighting-illusions-ts-sdk 0.0.943 → 0.0.945
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/README.md +3 -2
- package/dist/apis/ProductCategoryApi.d.ts +13 -1
- package/dist/apis/ProductCategoryApi.js +48 -0
- package/dist/models/ExternalApiLogResource.d.ts +1 -1
- package/dist/models/ExternalApiLogResource.js +1 -3
- package/docs/ProductCategoryApi.md +69 -0
- package/package.json +1 -1
- package/src/apis/ProductCategoryApi.ts +48 -0
- package/src/models/ExternalApiLogResource.ts +2 -3
package/README.md
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# @digital8/lighting-illusions-ts-sdk@0.0.
|
|
1
|
+
# @digital8/lighting-illusions-ts-sdk@0.0.945
|
|
2
2
|
|
|
3
3
|
A TypeScript SDK client for the localhost API.
|
|
4
4
|
|
|
@@ -122,6 +122,7 @@ All URIs are relative to *http://localhost/api*
|
|
|
122
122
|
*ProductCategoryApi* | [**bulkDetachProductsProductCategory**](docs/ProductCategoryApi.md#bulkdetachproductsproductcategory) | **DELETE** /admin-api/product-category/{productCategory}/bulk-detach-products | Auto-generated: bulkDetachProductsProductCategory
|
|
123
123
|
*ProductCategoryApi* | [**destroyProductCategory**](docs/ProductCategoryApi.md#destroyproductcategory) | **DELETE** /admin-api/product-category/{productCategory}/delete | Auto-generated: destroyProductCategory
|
|
124
124
|
*ProductCategoryApi* | [**detachProductsProductCategory**](docs/ProductCategoryApi.md#detachproductsproductcategoryoperation) | **POST** /admin-api/product-category/{productCategory}/detach-products | Auto-generated: detachProductsProductCategory
|
|
125
|
+
*ProductCategoryApi* | [**getAllChildrenProductCategory**](docs/ProductCategoryApi.md#getallchildrenproductcategory) | **POST** /admin-api/product-category/{productCategory}/children/all | Auto-generated: getAllChildrenProductCategory
|
|
125
126
|
*ProductCategoryApi* | [**getAllProductCategory**](docs/ProductCategoryApi.md#getallproductcategoryoperation) | **POST** /admin-api/product-category/all | Auto-generated: getAllProductCategory
|
|
126
127
|
*ProductCategoryApi* | [**getChildrenProductCategory**](docs/ProductCategoryApi.md#getchildrenproductcategory) | **GET** /admin-api/product-category/{productCategory}/children | Auto-generated: getChildrenProductCategory
|
|
127
128
|
*ProductCategoryApi* | [**getHierarchyProductCategory**](docs/ProductCategoryApi.md#gethierarchyproductcategoryoperation) | **POST** /admin-api/product-category/hierarchy | Auto-generated: getHierarchyProductCategory
|
|
@@ -464,7 +465,7 @@ and is automatically generated by the
|
|
|
464
465
|
[OpenAPI Generator](https://openapi-generator.tech) project:
|
|
465
466
|
|
|
466
467
|
- API version: `1.0.0`
|
|
467
|
-
- Package version: `0.0.
|
|
468
|
+
- Package version: `0.0.945`
|
|
468
469
|
- Generator version: `7.19.0`
|
|
469
470
|
- Build package: `org.openapitools.codegen.languages.TypeScriptFetchClientCodegen`
|
|
470
471
|
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
* Do not edit the class manually.
|
|
11
11
|
*/
|
|
12
12
|
import * as runtime from '../runtime';
|
|
13
|
-
import type { AttachProductsProductCategoryRequest, DetachProductsProductCategoryRequest, GenericResponse, GetAllProductCategoryRequest, GetHierarchyProductCategoryRequest, IndexProductCategoryRequest, PaginatedProductCategoryListResourceResponse, PreviewAutomationRulesProductCategoryRequest, PreviewAutomationRulesResource, ProductCategoryHierarchyResourceArrayResponse, ProductCategoryLiteResourceArrayResponse, ProductCategoryResource, StoreProductCategoryRequest, UpdateProductCategoryRequest } from '../models/index';
|
|
13
|
+
import type { AttachProductsProductCategoryRequest, DetachProductsProductCategoryRequest, GenericResponse, GetAllProductCategoryRequest, GetHierarchyProductCategoryRequest, IndexProductCategoryRequest, PaginatedProductCategoryListResourceResponse, PreviewAutomationRulesProductCategoryRequest, PreviewAutomationRulesResource, ProductCategoryHierarchyResourceArrayResponse, ProductCategoryListResourceArrayResponse, ProductCategoryLiteResourceArrayResponse, ProductCategoryResource, StoreProductCategoryRequest, UpdateProductCategoryRequest } from '../models/index';
|
|
14
14
|
export interface AttachProductsProductCategoryOperationRequest {
|
|
15
15
|
productCategory: number;
|
|
16
16
|
attachProductsProductCategoryRequest?: AttachProductsProductCategoryRequest;
|
|
@@ -25,6 +25,10 @@ export interface DetachProductsProductCategoryOperationRequest {
|
|
|
25
25
|
productCategory: number;
|
|
26
26
|
detachProductsProductCategoryRequest?: DetachProductsProductCategoryRequest;
|
|
27
27
|
}
|
|
28
|
+
export interface GetAllChildrenProductCategoryRequest {
|
|
29
|
+
productCategory: number;
|
|
30
|
+
getAllProductCategoryRequest?: GetAllProductCategoryRequest;
|
|
31
|
+
}
|
|
28
32
|
export interface GetAllProductCategoryOperationRequest {
|
|
29
33
|
getAllProductCategoryRequest?: GetAllProductCategoryRequest;
|
|
30
34
|
}
|
|
@@ -87,6 +91,14 @@ export declare class ProductCategoryApi extends runtime.BaseAPI {
|
|
|
87
91
|
* Auto-generated: detachProductsProductCategory
|
|
88
92
|
*/
|
|
89
93
|
detachProductsProductCategory(requestParameters: DetachProductsProductCategoryOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<ProductCategoryResource>;
|
|
94
|
+
/**
|
|
95
|
+
* Auto-generated: getAllChildrenProductCategory
|
|
96
|
+
*/
|
|
97
|
+
getAllChildrenProductCategoryRaw(requestParameters: GetAllChildrenProductCategoryRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<ProductCategoryListResourceArrayResponse>>;
|
|
98
|
+
/**
|
|
99
|
+
* Auto-generated: getAllChildrenProductCategory
|
|
100
|
+
*/
|
|
101
|
+
getAllChildrenProductCategory(requestParameters: GetAllChildrenProductCategoryRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<ProductCategoryListResourceArrayResponse>;
|
|
90
102
|
/**
|
|
91
103
|
* Auto-generated: getAllProductCategory
|
|
92
104
|
*/
|
|
@@ -263,6 +263,54 @@ var ProductCategoryApi = /** @class */ (function (_super) {
|
|
|
263
263
|
});
|
|
264
264
|
});
|
|
265
265
|
};
|
|
266
|
+
/**
|
|
267
|
+
* Auto-generated: getAllChildrenProductCategory
|
|
268
|
+
*/
|
|
269
|
+
ProductCategoryApi.prototype.getAllChildrenProductCategoryRaw = function (requestParameters, initOverrides) {
|
|
270
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
271
|
+
var queryParameters, headerParameters, urlPath, response;
|
|
272
|
+
return __generator(this, function (_a) {
|
|
273
|
+
switch (_a.label) {
|
|
274
|
+
case 0:
|
|
275
|
+
if (requestParameters['productCategory'] == null) {
|
|
276
|
+
throw new runtime.RequiredError('productCategory', 'Required parameter "productCategory" was null or undefined when calling getAllChildrenProductCategory().');
|
|
277
|
+
}
|
|
278
|
+
queryParameters = {};
|
|
279
|
+
headerParameters = {};
|
|
280
|
+
headerParameters['Content-Type'] = 'application/json';
|
|
281
|
+
urlPath = "/admin-api/product-category/{productCategory}/children/all";
|
|
282
|
+
urlPath = urlPath.replace("{".concat("productCategory", "}"), encodeURIComponent(String(requestParameters['productCategory'])));
|
|
283
|
+
return [4 /*yield*/, this.request({
|
|
284
|
+
path: urlPath,
|
|
285
|
+
method: 'POST',
|
|
286
|
+
headers: headerParameters,
|
|
287
|
+
query: queryParameters,
|
|
288
|
+
body: (0, index_1.GetAllProductCategoryRequestToJSON)(requestParameters['getAllProductCategoryRequest']),
|
|
289
|
+
}, initOverrides)];
|
|
290
|
+
case 1:
|
|
291
|
+
response = _a.sent();
|
|
292
|
+
return [2 /*return*/, new runtime.JSONApiResponse(response, function (jsonValue) { return (0, index_1.ProductCategoryListResourceArrayResponseFromJSON)(jsonValue); })];
|
|
293
|
+
}
|
|
294
|
+
});
|
|
295
|
+
});
|
|
296
|
+
};
|
|
297
|
+
/**
|
|
298
|
+
* Auto-generated: getAllChildrenProductCategory
|
|
299
|
+
*/
|
|
300
|
+
ProductCategoryApi.prototype.getAllChildrenProductCategory = function (requestParameters, initOverrides) {
|
|
301
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
302
|
+
var response;
|
|
303
|
+
return __generator(this, function (_a) {
|
|
304
|
+
switch (_a.label) {
|
|
305
|
+
case 0: return [4 /*yield*/, this.getAllChildrenProductCategoryRaw(requestParameters, initOverrides)];
|
|
306
|
+
case 1:
|
|
307
|
+
response = _a.sent();
|
|
308
|
+
return [4 /*yield*/, response.value()];
|
|
309
|
+
case 2: return [2 /*return*/, _a.sent()];
|
|
310
|
+
}
|
|
311
|
+
});
|
|
312
|
+
});
|
|
313
|
+
};
|
|
266
314
|
/**
|
|
267
315
|
* Auto-generated: getAllProductCategory
|
|
268
316
|
*/
|
|
@@ -37,8 +37,6 @@ function instanceOfExternalApiLogResource(value) {
|
|
|
37
37
|
return false;
|
|
38
38
|
if (!('responseCode' in value) || value['responseCode'] === undefined)
|
|
39
39
|
return false;
|
|
40
|
-
if (!('requestPayload' in value) || value['requestPayload'] === undefined)
|
|
41
|
-
return false;
|
|
42
40
|
if (!('responsePayload' in value) || value['responsePayload'] === undefined)
|
|
43
41
|
return false;
|
|
44
42
|
if (!('site' in value) || value['site'] === undefined)
|
|
@@ -60,7 +58,7 @@ function ExternalApiLogResourceFromJSONTyped(json, ignoreDiscriminator) {
|
|
|
60
58
|
'exteranlApiLoggableId': json['exteranlApiLoggableId'],
|
|
61
59
|
'endpoint': json['endpoint'],
|
|
62
60
|
'responseCode': json['responseCode'],
|
|
63
|
-
'requestPayload': json['requestPayload'],
|
|
61
|
+
'requestPayload': json['requestPayload'] == null ? undefined : json['requestPayload'],
|
|
64
62
|
'responsePayload': json['responsePayload'],
|
|
65
63
|
'createdAt': json['createdAt'] == null ? undefined : json['createdAt'],
|
|
66
64
|
'site': (0, SiteLiteResource_1.SiteLiteResourceFromJSON)(json['site']),
|
|
@@ -8,6 +8,7 @@ All URIs are relative to *http://localhost/api*
|
|
|
8
8
|
| [**bulkDetachProductsProductCategory**](ProductCategoryApi.md#bulkdetachproductsproductcategory) | **DELETE** /admin-api/product-category/{productCategory}/bulk-detach-products | Auto-generated: bulkDetachProductsProductCategory |
|
|
9
9
|
| [**destroyProductCategory**](ProductCategoryApi.md#destroyproductcategory) | **DELETE** /admin-api/product-category/{productCategory}/delete | Auto-generated: destroyProductCategory |
|
|
10
10
|
| [**detachProductsProductCategory**](ProductCategoryApi.md#detachproductsproductcategoryoperation) | **POST** /admin-api/product-category/{productCategory}/detach-products | Auto-generated: detachProductsProductCategory |
|
|
11
|
+
| [**getAllChildrenProductCategory**](ProductCategoryApi.md#getallchildrenproductcategory) | **POST** /admin-api/product-category/{productCategory}/children/all | Auto-generated: getAllChildrenProductCategory |
|
|
11
12
|
| [**getAllProductCategory**](ProductCategoryApi.md#getallproductcategoryoperation) | **POST** /admin-api/product-category/all | Auto-generated: getAllProductCategory |
|
|
12
13
|
| [**getChildrenProductCategory**](ProductCategoryApi.md#getchildrenproductcategory) | **GET** /admin-api/product-category/{productCategory}/children | Auto-generated: getChildrenProductCategory |
|
|
13
14
|
| [**getHierarchyProductCategory**](ProductCategoryApi.md#gethierarchyproductcategoryoperation) | **POST** /admin-api/product-category/hierarchy | Auto-generated: getHierarchyProductCategory |
|
|
@@ -285,6 +286,74 @@ No authorization required
|
|
|
285
286
|
[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
|
|
286
287
|
|
|
287
288
|
|
|
289
|
+
## getAllChildrenProductCategory
|
|
290
|
+
|
|
291
|
+
> ProductCategoryListResourceArrayResponse getAllChildrenProductCategory(productCategory, getAllProductCategoryRequest)
|
|
292
|
+
|
|
293
|
+
Auto-generated: getAllChildrenProductCategory
|
|
294
|
+
|
|
295
|
+
### Example
|
|
296
|
+
|
|
297
|
+
```ts
|
|
298
|
+
import {
|
|
299
|
+
Configuration,
|
|
300
|
+
ProductCategoryApi,
|
|
301
|
+
} from '@digital8/lighting-illusions-ts-sdk';
|
|
302
|
+
import type { GetAllChildrenProductCategoryRequest } from '@digital8/lighting-illusions-ts-sdk';
|
|
303
|
+
|
|
304
|
+
async function example() {
|
|
305
|
+
console.log("🚀 Testing @digital8/lighting-illusions-ts-sdk SDK...");
|
|
306
|
+
const api = new ProductCategoryApi();
|
|
307
|
+
|
|
308
|
+
const body = {
|
|
309
|
+
// number | The id of the productCategory
|
|
310
|
+
productCategory: 56,
|
|
311
|
+
// GetAllProductCategoryRequest (optional)
|
|
312
|
+
getAllProductCategoryRequest: ...,
|
|
313
|
+
} satisfies GetAllChildrenProductCategoryRequest;
|
|
314
|
+
|
|
315
|
+
try {
|
|
316
|
+
const data = await api.getAllChildrenProductCategory(body);
|
|
317
|
+
console.log(data);
|
|
318
|
+
} catch (error) {
|
|
319
|
+
console.error(error);
|
|
320
|
+
}
|
|
321
|
+
}
|
|
322
|
+
|
|
323
|
+
// Run the test
|
|
324
|
+
example().catch(console.error);
|
|
325
|
+
```
|
|
326
|
+
|
|
327
|
+
### Parameters
|
|
328
|
+
|
|
329
|
+
|
|
330
|
+
| Name | Type | Description | Notes |
|
|
331
|
+
|------------- | ------------- | ------------- | -------------|
|
|
332
|
+
| **productCategory** | `number` | The id of the productCategory | [Defaults to `undefined`] |
|
|
333
|
+
| **getAllProductCategoryRequest** | [GetAllProductCategoryRequest](GetAllProductCategoryRequest.md) | | [Optional] |
|
|
334
|
+
|
|
335
|
+
### Return type
|
|
336
|
+
|
|
337
|
+
[**ProductCategoryListResourceArrayResponse**](ProductCategoryListResourceArrayResponse.md)
|
|
338
|
+
|
|
339
|
+
### Authorization
|
|
340
|
+
|
|
341
|
+
No authorization required
|
|
342
|
+
|
|
343
|
+
### HTTP request headers
|
|
344
|
+
|
|
345
|
+
- **Content-Type**: `application/json`
|
|
346
|
+
- **Accept**: `application/json`
|
|
347
|
+
|
|
348
|
+
|
|
349
|
+
### HTTP response details
|
|
350
|
+
| Status code | Description | Response headers |
|
|
351
|
+
|-------------|-------------|------------------|
|
|
352
|
+
| **200** | Successful resource response | - |
|
|
353
|
+
|
|
354
|
+
[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
|
|
355
|
+
|
|
356
|
+
|
|
288
357
|
## getAllProductCategory
|
|
289
358
|
|
|
290
359
|
> ProductCategoryLiteResourceArrayResponse getAllProductCategory(getAllProductCategoryRequest)
|
package/package.json
CHANGED
|
@@ -25,6 +25,7 @@ import type {
|
|
|
25
25
|
PreviewAutomationRulesProductCategoryRequest,
|
|
26
26
|
PreviewAutomationRulesResource,
|
|
27
27
|
ProductCategoryHierarchyResourceArrayResponse,
|
|
28
|
+
ProductCategoryListResourceArrayResponse,
|
|
28
29
|
ProductCategoryLiteResourceArrayResponse,
|
|
29
30
|
ProductCategoryResource,
|
|
30
31
|
StoreProductCategoryRequest,
|
|
@@ -51,6 +52,8 @@ import {
|
|
|
51
52
|
PreviewAutomationRulesResourceToJSON,
|
|
52
53
|
ProductCategoryHierarchyResourceArrayResponseFromJSON,
|
|
53
54
|
ProductCategoryHierarchyResourceArrayResponseToJSON,
|
|
55
|
+
ProductCategoryListResourceArrayResponseFromJSON,
|
|
56
|
+
ProductCategoryListResourceArrayResponseToJSON,
|
|
54
57
|
ProductCategoryLiteResourceArrayResponseFromJSON,
|
|
55
58
|
ProductCategoryLiteResourceArrayResponseToJSON,
|
|
56
59
|
ProductCategoryResourceFromJSON,
|
|
@@ -79,6 +82,11 @@ export interface DetachProductsProductCategoryOperationRequest {
|
|
|
79
82
|
detachProductsProductCategoryRequest?: DetachProductsProductCategoryRequest;
|
|
80
83
|
}
|
|
81
84
|
|
|
85
|
+
export interface GetAllChildrenProductCategoryRequest {
|
|
86
|
+
productCategory: number;
|
|
87
|
+
getAllProductCategoryRequest?: GetAllProductCategoryRequest;
|
|
88
|
+
}
|
|
89
|
+
|
|
82
90
|
export interface GetAllProductCategoryOperationRequest {
|
|
83
91
|
getAllProductCategoryRequest?: GetAllProductCategoryRequest;
|
|
84
92
|
}
|
|
@@ -272,6 +280,46 @@ export class ProductCategoryApi extends runtime.BaseAPI {
|
|
|
272
280
|
return await response.value();
|
|
273
281
|
}
|
|
274
282
|
|
|
283
|
+
/**
|
|
284
|
+
* Auto-generated: getAllChildrenProductCategory
|
|
285
|
+
*/
|
|
286
|
+
async getAllChildrenProductCategoryRaw(requestParameters: GetAllChildrenProductCategoryRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<ProductCategoryListResourceArrayResponse>> {
|
|
287
|
+
if (requestParameters['productCategory'] == null) {
|
|
288
|
+
throw new runtime.RequiredError(
|
|
289
|
+
'productCategory',
|
|
290
|
+
'Required parameter "productCategory" was null or undefined when calling getAllChildrenProductCategory().'
|
|
291
|
+
);
|
|
292
|
+
}
|
|
293
|
+
|
|
294
|
+
const queryParameters: any = {};
|
|
295
|
+
|
|
296
|
+
const headerParameters: runtime.HTTPHeaders = {};
|
|
297
|
+
|
|
298
|
+
headerParameters['Content-Type'] = 'application/json';
|
|
299
|
+
|
|
300
|
+
|
|
301
|
+
let urlPath = `/admin-api/product-category/{productCategory}/children/all`;
|
|
302
|
+
urlPath = urlPath.replace(`{${"productCategory"}}`, encodeURIComponent(String(requestParameters['productCategory'])));
|
|
303
|
+
|
|
304
|
+
const response = await this.request({
|
|
305
|
+
path: urlPath,
|
|
306
|
+
method: 'POST',
|
|
307
|
+
headers: headerParameters,
|
|
308
|
+
query: queryParameters,
|
|
309
|
+
body: GetAllProductCategoryRequestToJSON(requestParameters['getAllProductCategoryRequest']),
|
|
310
|
+
}, initOverrides);
|
|
311
|
+
|
|
312
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => ProductCategoryListResourceArrayResponseFromJSON(jsonValue));
|
|
313
|
+
}
|
|
314
|
+
|
|
315
|
+
/**
|
|
316
|
+
* Auto-generated: getAllChildrenProductCategory
|
|
317
|
+
*/
|
|
318
|
+
async getAllChildrenProductCategory(requestParameters: GetAllChildrenProductCategoryRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<ProductCategoryListResourceArrayResponse> {
|
|
319
|
+
const response = await this.getAllChildrenProductCategoryRaw(requestParameters, initOverrides);
|
|
320
|
+
return await response.value();
|
|
321
|
+
}
|
|
322
|
+
|
|
275
323
|
/**
|
|
276
324
|
* Auto-generated: getAllProductCategory
|
|
277
325
|
*/
|
|
@@ -74,7 +74,7 @@ export interface ExternalApiLogResource {
|
|
|
74
74
|
* @type {string}
|
|
75
75
|
* @memberof ExternalApiLogResource
|
|
76
76
|
*/
|
|
77
|
-
requestPayload
|
|
77
|
+
requestPayload?: string | null;
|
|
78
78
|
/**
|
|
79
79
|
*
|
|
80
80
|
* @type {string}
|
|
@@ -106,7 +106,6 @@ export function instanceOfExternalApiLogResource(value: object): value is Extern
|
|
|
106
106
|
if (!('exteranlApiLoggableId' in value) || value['exteranlApiLoggableId'] === undefined) return false;
|
|
107
107
|
if (!('endpoint' in value) || value['endpoint'] === undefined) return false;
|
|
108
108
|
if (!('responseCode' in value) || value['responseCode'] === undefined) return false;
|
|
109
|
-
if (!('requestPayload' in value) || value['requestPayload'] === undefined) return false;
|
|
110
109
|
if (!('responsePayload' in value) || value['responsePayload'] === undefined) return false;
|
|
111
110
|
if (!('site' in value) || value['site'] === undefined) return false;
|
|
112
111
|
return true;
|
|
@@ -129,7 +128,7 @@ export function ExternalApiLogResourceFromJSONTyped(json: any, ignoreDiscriminat
|
|
|
129
128
|
'exteranlApiLoggableId': json['exteranlApiLoggableId'],
|
|
130
129
|
'endpoint': json['endpoint'],
|
|
131
130
|
'responseCode': json['responseCode'],
|
|
132
|
-
'requestPayload': json['requestPayload'],
|
|
131
|
+
'requestPayload': json['requestPayload'] == null ? undefined : json['requestPayload'],
|
|
133
132
|
'responsePayload': json['responsePayload'],
|
|
134
133
|
'createdAt': json['createdAt'] == null ? undefined : json['createdAt'],
|
|
135
134
|
'site': SiteLiteResourceFromJSON(json['site']),
|