@digital8/lighting-illusions-ts-sdk 0.0.765 → 0.0.766

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 CHANGED
@@ -1,4 +1,4 @@
1
- # @digital8/lighting-illusions-ts-sdk@0.0.765
1
+ # @digital8/lighting-illusions-ts-sdk@0.0.766
2
2
 
3
3
  A TypeScript SDK client for the localhost API.
4
4
 
@@ -51,7 +51,8 @@ All URIs are relative to *http://localhost/api*
51
51
  | Class | Method | HTTP request | Description
52
52
  | ----- | ------ | ------------ | -------------
53
53
  *AssetApi* | [**destroyAssetForAssetable**](docs/AssetApi.md#destroyassetforassetable) | **DELETE** /admin-api/asset/{asset}/delete | Auto-generated: destroyAssetForAssetable
54
- *AssetApi* | [**storeAssetFile**](docs/AssetApi.md#storeassetfileoperation) | **POST** /admin-api/asset/create | Auto-generated: storeAssetFile
54
+ *AssetApi* | [**storeAssetFile**](docs/AssetApi.md#storeassetfileoperation) | **POST** /admin-api/asset/files | Auto-generated: storeAssetFile
55
+ *AssetApi* | [**storeAssetForAssetable**](docs/AssetApi.md#storeassetforassetableoperation) | **POST** /admin-api/asset/create | Auto-generated: storeAssetForAssetable
55
56
  *AssetApi* | [**updateAssetForAssetable**](docs/AssetApi.md#updateassetforassetableoperation) | **PUT** /admin-api/asset/{asset}/update | Auto-generated: updateAssetForAssetable
56
57
  *AttributeApi* | [**attachProductTypeAttribute**](docs/AttributeApi.md#attachproducttypeattributeoperation) | **POST** /admin-api/attribute/{attribute}/attach-product-type | Auto-generated: attachProductTypeAttribute
57
58
  *AttributeApi* | [**destroyAttribute**](docs/AttributeApi.md#destroyattribute) | **DELETE** /admin-api/attribute/{attribute}/delete | Auto-generated: destroyAttribute
@@ -113,7 +114,6 @@ All URIs are relative to *http://localhost/api*
113
114
  *ProductApi* | [**showAssetsProductChild**](docs/ProductApi.md#showassetsproductchild) | **GET** /admin-api/product/children/{productChild}/assets | Auto-generated: showAssetsProductChild
114
115
  *ProductApi* | [**showProduct**](docs/ProductApi.md#showproduct) | **GET** /admin-api/product/parent/{product} | Auto-generated: showProduct
115
116
  *ProductApi* | [**showProductChild**](docs/ProductApi.md#showproductchild) | **GET** /admin-api/product/children/{productChild} | Auto-generated: showProductChild
116
- *ProductApi* | [**storeAssetForAssetable**](docs/ProductApi.md#storeassetforassetableoperation) | **POST** /admin-api/product/children/{productChild}/asset | Auto-generated: storeAssetForAssetable
117
117
  *ProductApi* | [**storeProduct**](docs/ProductApi.md#storeproductoperation) | **POST** /admin-api/product/parent/create | Auto-generated: storeProduct
118
118
  *ProductApi* | [**storeProductChild**](docs/ProductApi.md#storeproductchildoperation) | **POST** /admin-api/product/children/create | Auto-generated: storeProductChild
119
119
  *ProductApi* | [**updateProduct**](docs/ProductApi.md#updateproductoperation) | **PUT** /admin-api/product/parent/{product}/update | Auto-generated: updateProduct
@@ -463,7 +463,7 @@ and is automatically generated by the
463
463
  [OpenAPI Generator](https://openapi-generator.tech) project:
464
464
 
465
465
  - API version: `1.0.0`
466
- - Package version: `0.0.765`
466
+ - Package version: `0.0.766`
467
467
  - Generator version: `7.19.0`
468
468
  - Build package: `org.openapitools.codegen.languages.TypeScriptFetchClientCodegen`
469
469
 
@@ -10,13 +10,16 @@
10
10
  * Do not edit the class manually.
11
11
  */
12
12
  import * as runtime from '../runtime';
13
- import type { AssetFileForUploadResource, AssetResource, GenericResponse, StoreAssetFileRequest, UpdateAssetForAssetableRequest } from '../models/index';
13
+ import type { AssetFileForUploadResource, AssetResource, GenericResponse, StoreAssetFileRequest, StoreAssetForAssetableRequest, UpdateAssetForAssetableRequest } from '../models/index';
14
14
  export interface DestroyAssetForAssetableRequest {
15
15
  asset: number;
16
16
  }
17
17
  export interface StoreAssetFileOperationRequest {
18
18
  storeAssetFileRequest?: StoreAssetFileRequest;
19
19
  }
20
+ export interface StoreAssetForAssetableOperationRequest {
21
+ storeAssetForAssetableRequest?: StoreAssetForAssetableRequest;
22
+ }
20
23
  export interface UpdateAssetForAssetableOperationRequest {
21
24
  asset: number;
22
25
  updateAssetForAssetableRequest?: UpdateAssetForAssetableRequest;
@@ -41,6 +44,14 @@ export declare class AssetApi extends runtime.BaseAPI {
41
44
  * Auto-generated: storeAssetFile
42
45
  */
43
46
  storeAssetFile(requestParameters?: StoreAssetFileOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<AssetFileForUploadResource>;
47
+ /**
48
+ * Auto-generated: storeAssetForAssetable
49
+ */
50
+ storeAssetForAssetableRaw(requestParameters: StoreAssetForAssetableOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<AssetResource>>;
51
+ /**
52
+ * Auto-generated: storeAssetForAssetable
53
+ */
54
+ storeAssetForAssetable(requestParameters?: StoreAssetForAssetableOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<AssetResource>;
44
55
  /**
45
56
  * Auto-generated: updateAssetForAssetable
46
57
  */
@@ -133,7 +133,7 @@ var AssetApi = /** @class */ (function (_super) {
133
133
  queryParameters = {};
134
134
  headerParameters = {};
135
135
  headerParameters['Content-Type'] = 'application/json';
136
- urlPath = "/admin-api/asset/create";
136
+ urlPath = "/admin-api/asset/files";
137
137
  return [4 /*yield*/, this.request({
138
138
  path: urlPath,
139
139
  method: 'POST',
@@ -166,6 +166,51 @@ var AssetApi = /** @class */ (function (_super) {
166
166
  });
167
167
  });
168
168
  };
169
+ /**
170
+ * Auto-generated: storeAssetForAssetable
171
+ */
172
+ AssetApi.prototype.storeAssetForAssetableRaw = function (requestParameters, initOverrides) {
173
+ return __awaiter(this, void 0, void 0, function () {
174
+ var queryParameters, headerParameters, urlPath, response;
175
+ return __generator(this, function (_a) {
176
+ switch (_a.label) {
177
+ case 0:
178
+ queryParameters = {};
179
+ headerParameters = {};
180
+ headerParameters['Content-Type'] = 'application/json';
181
+ urlPath = "/admin-api/asset/create";
182
+ return [4 /*yield*/, this.request({
183
+ path: urlPath,
184
+ method: 'POST',
185
+ headers: headerParameters,
186
+ query: queryParameters,
187
+ body: (0, index_1.StoreAssetForAssetableRequestToJSON)(requestParameters['storeAssetForAssetableRequest']),
188
+ }, initOverrides)];
189
+ case 1:
190
+ response = _a.sent();
191
+ return [2 /*return*/, new runtime.JSONApiResponse(response, function (jsonValue) { return (0, index_1.AssetResourceFromJSON)(jsonValue); })];
192
+ }
193
+ });
194
+ });
195
+ };
196
+ /**
197
+ * Auto-generated: storeAssetForAssetable
198
+ */
199
+ AssetApi.prototype.storeAssetForAssetable = function () {
200
+ return __awaiter(this, arguments, void 0, function (requestParameters, initOverrides) {
201
+ var response;
202
+ if (requestParameters === void 0) { requestParameters = {}; }
203
+ return __generator(this, function (_a) {
204
+ switch (_a.label) {
205
+ case 0: return [4 /*yield*/, this.storeAssetForAssetableRaw(requestParameters, initOverrides)];
206
+ case 1:
207
+ response = _a.sent();
208
+ return [4 /*yield*/, response.value()];
209
+ case 2: return [2 /*return*/, _a.sent()];
210
+ }
211
+ });
212
+ });
213
+ };
169
214
  /**
170
215
  * Auto-generated: updateAssetForAssetable
171
216
  */
@@ -10,7 +10,7 @@
10
10
  * Do not edit the class manually.
11
11
  */
12
12
  import * as runtime from '../runtime';
13
- import type { AssetResource, AssetResourceArrayResponse, AttachAccessoriesProductChildRequest, AttachDocumentsProductChildRequest, DetachDocumentsProductChildRequest, GenericResponse, GetAllProductChildRequest, GetAllProductRequest, IndexProductChildRequest, IndexProductRequest, PaginatedProductChildListResourceResponse, PaginatedProductListResourceResponse, ProductChildLiteResourceArrayResponse, ProductChildResource, ProductLiteResourceArrayResponse, ProductResource, StoreAssetForAssetableRequest, StoreProductChildRequest, StoreProductRequest, UpdateProductChildRequest, UpdateProductRequest } from '../models/index';
13
+ import type { AssetResourceArrayResponse, AttachAccessoriesProductChildRequest, AttachDocumentsProductChildRequest, DetachDocumentsProductChildRequest, GenericResponse, GetAllProductChildRequest, GetAllProductRequest, IndexProductChildRequest, IndexProductRequest, PaginatedProductChildListResourceResponse, PaginatedProductListResourceResponse, ProductChildLiteResourceArrayResponse, ProductChildResource, ProductLiteResourceArrayResponse, ProductResource, StoreProductChildRequest, StoreProductRequest, UpdateProductChildRequest, UpdateProductRequest } from '../models/index';
14
14
  export interface AttachAccessoriesProductChildOperationRequest {
15
15
  productChild: number;
16
16
  attachAccessoriesProductChildRequest?: AttachAccessoriesProductChildRequest;
@@ -70,10 +70,6 @@ export interface ShowProductRequest {
70
70
  export interface ShowProductChildRequest {
71
71
  productChild: number;
72
72
  }
73
- export interface StoreAssetForAssetableOperationRequest {
74
- productChild: number;
75
- storeAssetForAssetableRequest?: StoreAssetForAssetableRequest;
76
- }
77
73
  export interface StoreProductOperationRequest {
78
74
  storeProductRequest?: StoreProductRequest;
79
75
  }
@@ -228,14 +224,6 @@ export declare class ProductApi extends runtime.BaseAPI {
228
224
  * Auto-generated: showProductChild
229
225
  */
230
226
  showProductChild(requestParameters: ShowProductChildRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<ProductChildResource>;
231
- /**
232
- * Auto-generated: storeAssetForAssetable
233
- */
234
- storeAssetForAssetableRaw(requestParameters: StoreAssetForAssetableOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<AssetResource>>;
235
- /**
236
- * Auto-generated: storeAssetForAssetable
237
- */
238
- storeAssetForAssetable(requestParameters: StoreAssetForAssetableOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<AssetResource>;
239
227
  /**
240
228
  * Auto-generated: storeProduct
241
229
  */
@@ -873,54 +873,6 @@ var ProductApi = /** @class */ (function (_super) {
873
873
  });
874
874
  });
875
875
  };
876
- /**
877
- * Auto-generated: storeAssetForAssetable
878
- */
879
- ProductApi.prototype.storeAssetForAssetableRaw = function (requestParameters, initOverrides) {
880
- return __awaiter(this, void 0, void 0, function () {
881
- var queryParameters, headerParameters, urlPath, response;
882
- return __generator(this, function (_a) {
883
- switch (_a.label) {
884
- case 0:
885
- if (requestParameters['productChild'] == null) {
886
- throw new runtime.RequiredError('productChild', 'Required parameter "productChild" was null or undefined when calling storeAssetForAssetable().');
887
- }
888
- queryParameters = {};
889
- headerParameters = {};
890
- headerParameters['Content-Type'] = 'application/json';
891
- urlPath = "/admin-api/product/children/{productChild}/asset";
892
- urlPath = urlPath.replace("{".concat("productChild", "}"), encodeURIComponent(String(requestParameters['productChild'])));
893
- return [4 /*yield*/, this.request({
894
- path: urlPath,
895
- method: 'POST',
896
- headers: headerParameters,
897
- query: queryParameters,
898
- body: (0, index_1.StoreAssetForAssetableRequestToJSON)(requestParameters['storeAssetForAssetableRequest']),
899
- }, initOverrides)];
900
- case 1:
901
- response = _a.sent();
902
- return [2 /*return*/, new runtime.JSONApiResponse(response, function (jsonValue) { return (0, index_1.AssetResourceFromJSON)(jsonValue); })];
903
- }
904
- });
905
- });
906
- };
907
- /**
908
- * Auto-generated: storeAssetForAssetable
909
- */
910
- ProductApi.prototype.storeAssetForAssetable = function (requestParameters, initOverrides) {
911
- return __awaiter(this, void 0, void 0, function () {
912
- var response;
913
- return __generator(this, function (_a) {
914
- switch (_a.label) {
915
- case 0: return [4 /*yield*/, this.storeAssetForAssetableRaw(requestParameters, initOverrides)];
916
- case 1:
917
- response = _a.sent();
918
- return [4 /*yield*/, response.value()];
919
- case 2: return [2 /*return*/, _a.sent()];
920
- }
921
- });
922
- });
923
- };
924
876
  /**
925
877
  * Auto-generated: storeProduct
926
878
  */
@@ -63,7 +63,7 @@ export interface ExternalApiLogResource {
63
63
  * @type {string}
64
64
  * @memberof ExternalApiLogResource
65
65
  */
66
- requestPayload?: string | null;
66
+ requestPayload: string;
67
67
  /**
68
68
  *
69
69
  * @type {string}
@@ -37,6 +37,8 @@ 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;
40
42
  if (!('responsePayload' in value) || value['responsePayload'] === undefined)
41
43
  return false;
42
44
  if (!('site' in value) || value['site'] === undefined)
@@ -58,7 +60,7 @@ function ExternalApiLogResourceFromJSONTyped(json, ignoreDiscriminator) {
58
60
  'exteranlApiLoggableId': json['exteranlApiLoggableId'],
59
61
  'endpoint': json['endpoint'],
60
62
  'responseCode': json['responseCode'],
61
- 'requestPayload': json['requestPayload'] == null ? undefined : json['requestPayload'],
63
+ 'requestPayload': json['requestPayload'],
62
64
  'responsePayload': json['responsePayload'],
63
65
  'createdAt': json['createdAt'] == null ? undefined : json['createdAt'],
64
66
  'site': (0, SiteLiteResource_1.SiteLiteResourceFromJSON)(json['site']),
@@ -9,7 +9,6 @@
9
9
  * https://openapi-generator.tech
10
10
  * Do not edit the class manually.
11
11
  */
12
- import type { ProductCategoryLiteResource } from './ProductCategoryLiteResource';
13
12
  import type { ProductTypeLiteResource } from './ProductTypeLiteResource';
14
13
  import type { GoogleCategoryResource } from './GoogleCategoryResource';
15
14
  import type { SupplierLiteResource } from './SupplierLiteResource';
@@ -51,10 +50,10 @@ export interface ProductResource {
51
50
  warranty: string;
52
51
  /**
53
52
  *
54
- * @type {Array<ProductCategoryLiteResource>}
53
+ * @type {object}
55
54
  * @memberof ProductResource
56
55
  */
57
- categories: Array<ProductCategoryLiteResource> | null;
56
+ categories: object;
58
57
  /**
59
58
  *
60
59
  * @type {boolean}
@@ -18,7 +18,6 @@ exports.ProductResourceFromJSON = ProductResourceFromJSON;
18
18
  exports.ProductResourceFromJSONTyped = ProductResourceFromJSONTyped;
19
19
  exports.ProductResourceToJSON = ProductResourceToJSON;
20
20
  exports.ProductResourceToJSONTyped = ProductResourceToJSONTyped;
21
- var ProductCategoryLiteResource_1 = require("./ProductCategoryLiteResource");
22
21
  var ProductTypeLiteResource_1 = require("./ProductTypeLiteResource");
23
22
  var GoogleCategoryResource_1 = require("./GoogleCategoryResource");
24
23
  var SupplierLiteResource_1 = require("./SupplierLiteResource");
@@ -65,7 +64,7 @@ function ProductResourceFromJSONTyped(json, ignoreDiscriminator) {
65
64
  'displayName': json['displayName'],
66
65
  'isAccessory': json['isAccessory'],
67
66
  'warranty': json['warranty'],
68
- 'categories': (json['categories'] == null ? null : json['categories'].map(ProductCategoryLiteResource_1.ProductCategoryLiteResourceFromJSON)),
67
+ 'categories': json['categories'],
69
68
  'isDisabled': json['isDisabled'],
70
69
  'googleCategory': (0, GoogleCategoryResource_1.GoogleCategoryResourceFromJSON)(json['googleCategory']),
71
70
  'supplier': (0, SupplierLiteResource_1.SupplierLiteResourceFromJSON)(json['supplier']),
@@ -88,7 +87,7 @@ function ProductResourceToJSONTyped(value, ignoreDiscriminator) {
88
87
  'displayName': value['displayName'],
89
88
  'isAccessory': value['isAccessory'],
90
89
  'warranty': value['warranty'],
91
- 'categories': (value['categories'] == null ? null : value['categories'].map(ProductCategoryLiteResource_1.ProductCategoryLiteResourceToJSON)),
90
+ 'categories': value['categories'],
92
91
  'isDisabled': value['isDisabled'],
93
92
  'googleCategory': (0, GoogleCategoryResource_1.GoogleCategoryResourceToJSON)(value['googleCategory']),
94
93
  'supplier': (0, SupplierLiteResource_1.SupplierLiteResourceToJSON)(value['supplier']),
@@ -15,6 +15,18 @@
15
15
  * @interface StoreAssetForAssetableRequest
16
16
  */
17
17
  export interface StoreAssetForAssetableRequest {
18
+ /**
19
+ *
20
+ * @type {string}
21
+ * @memberof StoreAssetForAssetableRequest
22
+ */
23
+ assetableType: StoreAssetForAssetableRequestAssetableTypeEnum;
24
+ /**
25
+ *
26
+ * @type {number}
27
+ * @memberof StoreAssetForAssetableRequest
28
+ */
29
+ assetableId: number;
18
30
  /**
19
31
  *
20
32
  * @type {string}
@@ -52,6 +64,13 @@ export interface StoreAssetForAssetableRequest {
52
64
  */
53
65
  overlayTemplateIds?: Array<number>;
54
66
  }
67
+ /**
68
+ * @export
69
+ */
70
+ export declare const StoreAssetForAssetableRequestAssetableTypeEnum: {
71
+ readonly AppModelsProductsProductChild: "App\\Models\\Products\\ProductChild";
72
+ };
73
+ export type StoreAssetForAssetableRequestAssetableTypeEnum = typeof StoreAssetForAssetableRequestAssetableTypeEnum[keyof typeof StoreAssetForAssetableRequestAssetableTypeEnum];
55
74
  /**
56
75
  * Check if a given object implements the StoreAssetForAssetableRequest interface.
57
76
  */
@@ -13,15 +13,26 @@
13
13
  * Do not edit the class manually.
14
14
  */
15
15
  Object.defineProperty(exports, "__esModule", { value: true });
16
+ exports.StoreAssetForAssetableRequestAssetableTypeEnum = void 0;
16
17
  exports.instanceOfStoreAssetForAssetableRequest = instanceOfStoreAssetForAssetableRequest;
17
18
  exports.StoreAssetForAssetableRequestFromJSON = StoreAssetForAssetableRequestFromJSON;
18
19
  exports.StoreAssetForAssetableRequestFromJSONTyped = StoreAssetForAssetableRequestFromJSONTyped;
19
20
  exports.StoreAssetForAssetableRequestToJSON = StoreAssetForAssetableRequestToJSON;
20
21
  exports.StoreAssetForAssetableRequestToJSONTyped = StoreAssetForAssetableRequestToJSONTyped;
22
+ /**
23
+ * @export
24
+ */
25
+ exports.StoreAssetForAssetableRequestAssetableTypeEnum = {
26
+ AppModelsProductsProductChild: 'App\\Models\\Products\\ProductChild'
27
+ };
21
28
  /**
22
29
  * Check if a given object implements the StoreAssetForAssetableRequest interface.
23
30
  */
24
31
  function instanceOfStoreAssetForAssetableRequest(value) {
32
+ if (!('assetableType' in value) || value['assetableType'] === undefined)
33
+ return false;
34
+ if (!('assetableId' in value) || value['assetableId'] === undefined)
35
+ return false;
25
36
  if (!('mimeType' in value) || value['mimeType'] === undefined)
26
37
  return false;
27
38
  if (!('fileId' in value) || value['fileId'] === undefined)
@@ -40,6 +51,8 @@ function StoreAssetForAssetableRequestFromJSONTyped(json, ignoreDiscriminator) {
40
51
  return json;
41
52
  }
42
53
  return {
54
+ 'assetableType': json['assetable_type'],
55
+ 'assetableId': json['assetable_id'],
43
56
  'altText': json['alt_text'] == null ? undefined : json['alt_text'],
44
57
  'mimeType': json['mime_type'],
45
58
  'fileId': json['file_id'],
@@ -57,6 +70,8 @@ function StoreAssetForAssetableRequestToJSONTyped(value, ignoreDiscriminator) {
57
70
  return value;
58
71
  }
59
72
  return {
73
+ 'assetable_type': value['assetableType'],
74
+ 'assetable_id': value['assetableId'],
60
75
  'alt_text': value['altText'],
61
76
  'mime_type': value['mimeType'],
62
77
  'file_id': value['fileId'],
package/docs/AssetApi.md CHANGED
@@ -5,7 +5,8 @@ All URIs are relative to *http://localhost/api*
5
5
  | Method | HTTP request | Description |
6
6
  |------------- | ------------- | -------------|
7
7
  | [**destroyAssetForAssetable**](AssetApi.md#destroyassetforassetable) | **DELETE** /admin-api/asset/{asset}/delete | Auto-generated: destroyAssetForAssetable |
8
- | [**storeAssetFile**](AssetApi.md#storeassetfileoperation) | **POST** /admin-api/asset/create | Auto-generated: storeAssetFile |
8
+ | [**storeAssetFile**](AssetApi.md#storeassetfileoperation) | **POST** /admin-api/asset/files | Auto-generated: storeAssetFile |
9
+ | [**storeAssetForAssetable**](AssetApi.md#storeassetforassetableoperation) | **POST** /admin-api/asset/create | Auto-generated: storeAssetForAssetable |
9
10
  | [**updateAssetForAssetable**](AssetApi.md#updateassetforassetableoperation) | **PUT** /admin-api/asset/{asset}/update | Auto-generated: updateAssetForAssetable |
10
11
 
11
12
 
@@ -140,6 +141,71 @@ No authorization required
140
141
  [[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
141
142
 
142
143
 
144
+ ## storeAssetForAssetable
145
+
146
+ > AssetResource storeAssetForAssetable(storeAssetForAssetableRequest)
147
+
148
+ Auto-generated: storeAssetForAssetable
149
+
150
+ ### Example
151
+
152
+ ```ts
153
+ import {
154
+ Configuration,
155
+ AssetApi,
156
+ } from '@digital8/lighting-illusions-ts-sdk';
157
+ import type { StoreAssetForAssetableOperationRequest } from '@digital8/lighting-illusions-ts-sdk';
158
+
159
+ async function example() {
160
+ console.log("🚀 Testing @digital8/lighting-illusions-ts-sdk SDK...");
161
+ const api = new AssetApi();
162
+
163
+ const body = {
164
+ // StoreAssetForAssetableRequest (optional)
165
+ storeAssetForAssetableRequest: ...,
166
+ } satisfies StoreAssetForAssetableOperationRequest;
167
+
168
+ try {
169
+ const data = await api.storeAssetForAssetable(body);
170
+ console.log(data);
171
+ } catch (error) {
172
+ console.error(error);
173
+ }
174
+ }
175
+
176
+ // Run the test
177
+ example().catch(console.error);
178
+ ```
179
+
180
+ ### Parameters
181
+
182
+
183
+ | Name | Type | Description | Notes |
184
+ |------------- | ------------- | ------------- | -------------|
185
+ | **storeAssetForAssetableRequest** | [StoreAssetForAssetableRequest](StoreAssetForAssetableRequest.md) | | [Optional] |
186
+
187
+ ### Return type
188
+
189
+ [**AssetResource**](AssetResource.md)
190
+
191
+ ### Authorization
192
+
193
+ No authorization required
194
+
195
+ ### HTTP request headers
196
+
197
+ - **Content-Type**: `application/json`
198
+ - **Accept**: `application/json`
199
+
200
+
201
+ ### HTTP response details
202
+ | Status code | Description | Response headers |
203
+ |-------------|-------------|------------------|
204
+ | **200** | Successful resource response | - |
205
+
206
+ [[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
207
+
208
+
143
209
  ## updateAssetForAssetable
144
210
 
145
211
  > AssetResource updateAssetForAssetable(asset, updateAssetForAssetableRequest)
@@ -21,7 +21,6 @@ All URIs are relative to *http://localhost/api*
21
21
  | [**showAssetsProductChild**](ProductApi.md#showassetsproductchild) | **GET** /admin-api/product/children/{productChild}/assets | Auto-generated: showAssetsProductChild |
22
22
  | [**showProduct**](ProductApi.md#showproduct) | **GET** /admin-api/product/parent/{product} | Auto-generated: showProduct |
23
23
  | [**showProductChild**](ProductApi.md#showproductchild) | **GET** /admin-api/product/children/{productChild} | Auto-generated: showProductChild |
24
- | [**storeAssetForAssetable**](ProductApi.md#storeassetforassetableoperation) | **POST** /admin-api/product/children/{productChild}/asset | Auto-generated: storeAssetForAssetable |
25
24
  | [**storeProduct**](ProductApi.md#storeproductoperation) | **POST** /admin-api/product/parent/create | Auto-generated: storeProduct |
26
25
  | [**storeProductChild**](ProductApi.md#storeproductchildoperation) | **POST** /admin-api/product/children/create | Auto-generated: storeProductChild |
27
26
  | [**updateProduct**](ProductApi.md#updateproductoperation) | **PUT** /admin-api/product/parent/{product}/update | Auto-generated: updateProduct |
@@ -1158,74 +1157,6 @@ No authorization required
1158
1157
  [[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
1159
1158
 
1160
1159
 
1161
- ## storeAssetForAssetable
1162
-
1163
- > AssetResource storeAssetForAssetable(productChild, storeAssetForAssetableRequest)
1164
-
1165
- Auto-generated: storeAssetForAssetable
1166
-
1167
- ### Example
1168
-
1169
- ```ts
1170
- import {
1171
- Configuration,
1172
- ProductApi,
1173
- } from '@digital8/lighting-illusions-ts-sdk';
1174
- import type { StoreAssetForAssetableOperationRequest } from '@digital8/lighting-illusions-ts-sdk';
1175
-
1176
- async function example() {
1177
- console.log("🚀 Testing @digital8/lighting-illusions-ts-sdk SDK...");
1178
- const api = new ProductApi();
1179
-
1180
- const body = {
1181
- // number | The id of the productChild
1182
- productChild: 56,
1183
- // StoreAssetForAssetableRequest (optional)
1184
- storeAssetForAssetableRequest: ...,
1185
- } satisfies StoreAssetForAssetableOperationRequest;
1186
-
1187
- try {
1188
- const data = await api.storeAssetForAssetable(body);
1189
- console.log(data);
1190
- } catch (error) {
1191
- console.error(error);
1192
- }
1193
- }
1194
-
1195
- // Run the test
1196
- example().catch(console.error);
1197
- ```
1198
-
1199
- ### Parameters
1200
-
1201
-
1202
- | Name | Type | Description | Notes |
1203
- |------------- | ------------- | ------------- | -------------|
1204
- | **productChild** | `number` | The id of the productChild | [Defaults to `undefined`] |
1205
- | **storeAssetForAssetableRequest** | [StoreAssetForAssetableRequest](StoreAssetForAssetableRequest.md) | | [Optional] |
1206
-
1207
- ### Return type
1208
-
1209
- [**AssetResource**](AssetResource.md)
1210
-
1211
- ### Authorization
1212
-
1213
- No authorization required
1214
-
1215
- ### HTTP request headers
1216
-
1217
- - **Content-Type**: `application/json`
1218
- - **Accept**: `application/json`
1219
-
1220
-
1221
- ### HTTP response details
1222
- | Status code | Description | Response headers |
1223
- |-------------|-------------|------------------|
1224
- | **200** | Successful resource response | - |
1225
-
1226
- [[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
1227
-
1228
-
1229
1160
  ## storeProduct
1230
1161
 
1231
1162
  > ProductResource storeProduct(storeProductRequest)
@@ -11,7 +11,7 @@ Name | Type
11
11
  `displayName` | string
12
12
  `isAccessory` | boolean
13
13
  `warranty` | string
14
- `categories` | [Array&lt;ProductCategoryLiteResource&gt;](ProductCategoryLiteResource.md)
14
+ `categories` | object
15
15
  `isDisabled` | boolean
16
16
  `googleCategory` | [GoogleCategoryResource](GoogleCategoryResource.md)
17
17
  `supplier` | [SupplierLiteResource](SupplierLiteResource.md)
@@ -6,6 +6,8 @@
6
6
 
7
7
  Name | Type
8
8
  ------------ | -------------
9
+ `assetableType` | string
10
+ `assetableId` | number
9
11
  `altText` | string
10
12
  `mimeType` | string
11
13
  `fileId` | number
@@ -20,6 +22,8 @@ import type { StoreAssetForAssetableRequest } from '@digital8/lighting-illusions
20
22
 
21
23
  // TODO: Update the object below with actual values
22
24
  const example = {
25
+ "assetableType": null,
26
+ "assetableId": null,
23
27
  "altText": null,
24
28
  "mimeType": null,
25
29
  "fileId": null,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@digital8/lighting-illusions-ts-sdk",
3
- "version": "0.0.765",
3
+ "version": "0.0.766",
4
4
  "description": "OpenAPI client for @digital8/lighting-illusions-ts-sdk",
5
5
  "author": "OpenAPI-Generator",
6
6
  "repository": {
@@ -19,6 +19,7 @@ import type {
19
19
  AssetResource,
20
20
  GenericResponse,
21
21
  StoreAssetFileRequest,
22
+ StoreAssetForAssetableRequest,
22
23
  UpdateAssetForAssetableRequest,
23
24
  } from '../models/index';
24
25
  import {
@@ -30,6 +31,8 @@ import {
30
31
  GenericResponseToJSON,
31
32
  StoreAssetFileRequestFromJSON,
32
33
  StoreAssetFileRequestToJSON,
34
+ StoreAssetForAssetableRequestFromJSON,
35
+ StoreAssetForAssetableRequestToJSON,
33
36
  UpdateAssetForAssetableRequestFromJSON,
34
37
  UpdateAssetForAssetableRequestToJSON,
35
38
  } from '../models/index';
@@ -42,6 +45,10 @@ export interface StoreAssetFileOperationRequest {
42
45
  storeAssetFileRequest?: StoreAssetFileRequest;
43
46
  }
44
47
 
48
+ export interface StoreAssetForAssetableOperationRequest {
49
+ storeAssetForAssetableRequest?: StoreAssetForAssetableRequest;
50
+ }
51
+
45
52
  export interface UpdateAssetForAssetableOperationRequest {
46
53
  asset: number;
47
54
  updateAssetForAssetableRequest?: UpdateAssetForAssetableRequest;
@@ -100,7 +107,7 @@ export class AssetApi extends runtime.BaseAPI {
100
107
  headerParameters['Content-Type'] = 'application/json';
101
108
 
102
109
 
103
- let urlPath = `/admin-api/asset/create`;
110
+ let urlPath = `/admin-api/asset/files`;
104
111
 
105
112
  const response = await this.request({
106
113
  path: urlPath,
@@ -121,6 +128,38 @@ export class AssetApi extends runtime.BaseAPI {
121
128
  return await response.value();
122
129
  }
123
130
 
131
+ /**
132
+ * Auto-generated: storeAssetForAssetable
133
+ */
134
+ async storeAssetForAssetableRaw(requestParameters: StoreAssetForAssetableOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<AssetResource>> {
135
+ const queryParameters: any = {};
136
+
137
+ const headerParameters: runtime.HTTPHeaders = {};
138
+
139
+ headerParameters['Content-Type'] = 'application/json';
140
+
141
+
142
+ let urlPath = `/admin-api/asset/create`;
143
+
144
+ const response = await this.request({
145
+ path: urlPath,
146
+ method: 'POST',
147
+ headers: headerParameters,
148
+ query: queryParameters,
149
+ body: StoreAssetForAssetableRequestToJSON(requestParameters['storeAssetForAssetableRequest']),
150
+ }, initOverrides);
151
+
152
+ return new runtime.JSONApiResponse(response, (jsonValue) => AssetResourceFromJSON(jsonValue));
153
+ }
154
+
155
+ /**
156
+ * Auto-generated: storeAssetForAssetable
157
+ */
158
+ async storeAssetForAssetable(requestParameters: StoreAssetForAssetableOperationRequest = {}, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<AssetResource> {
159
+ const response = await this.storeAssetForAssetableRaw(requestParameters, initOverrides);
160
+ return await response.value();
161
+ }
162
+
124
163
  /**
125
164
  * Auto-generated: updateAssetForAssetable
126
165
  */
@@ -15,7 +15,6 @@
15
15
 
16
16
  import * as runtime from '../runtime';
17
17
  import type {
18
- AssetResource,
19
18
  AssetResourceArrayResponse,
20
19
  AttachAccessoriesProductChildRequest,
21
20
  AttachDocumentsProductChildRequest,
@@ -31,15 +30,12 @@ import type {
31
30
  ProductChildResource,
32
31
  ProductLiteResourceArrayResponse,
33
32
  ProductResource,
34
- StoreAssetForAssetableRequest,
35
33
  StoreProductChildRequest,
36
34
  StoreProductRequest,
37
35
  UpdateProductChildRequest,
38
36
  UpdateProductRequest,
39
37
  } from '../models/index';
40
38
  import {
41
- AssetResourceFromJSON,
42
- AssetResourceToJSON,
43
39
  AssetResourceArrayResponseFromJSON,
44
40
  AssetResourceArrayResponseToJSON,
45
41
  AttachAccessoriesProductChildRequestFromJSON,
@@ -70,8 +66,6 @@ import {
70
66
  ProductLiteResourceArrayResponseToJSON,
71
67
  ProductResourceFromJSON,
72
68
  ProductResourceToJSON,
73
- StoreAssetForAssetableRequestFromJSON,
74
- StoreAssetForAssetableRequestToJSON,
75
69
  StoreProductChildRequestFromJSON,
76
70
  StoreProductChildRequestToJSON,
77
71
  StoreProductRequestFromJSON,
@@ -158,11 +152,6 @@ export interface ShowProductChildRequest {
158
152
  productChild: number;
159
153
  }
160
154
 
161
- export interface StoreAssetForAssetableOperationRequest {
162
- productChild: number;
163
- storeAssetForAssetableRequest?: StoreAssetForAssetableRequest;
164
- }
165
-
166
155
  export interface StoreProductOperationRequest {
167
156
  storeProductRequest?: StoreProductRequest;
168
157
  }
@@ -829,46 +818,6 @@ export class ProductApi extends runtime.BaseAPI {
829
818
  return await response.value();
830
819
  }
831
820
 
832
- /**
833
- * Auto-generated: storeAssetForAssetable
834
- */
835
- async storeAssetForAssetableRaw(requestParameters: StoreAssetForAssetableOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<AssetResource>> {
836
- if (requestParameters['productChild'] == null) {
837
- throw new runtime.RequiredError(
838
- 'productChild',
839
- 'Required parameter "productChild" was null or undefined when calling storeAssetForAssetable().'
840
- );
841
- }
842
-
843
- const queryParameters: any = {};
844
-
845
- const headerParameters: runtime.HTTPHeaders = {};
846
-
847
- headerParameters['Content-Type'] = 'application/json';
848
-
849
-
850
- let urlPath = `/admin-api/product/children/{productChild}/asset`;
851
- urlPath = urlPath.replace(`{${"productChild"}}`, encodeURIComponent(String(requestParameters['productChild'])));
852
-
853
- const response = await this.request({
854
- path: urlPath,
855
- method: 'POST',
856
- headers: headerParameters,
857
- query: queryParameters,
858
- body: StoreAssetForAssetableRequestToJSON(requestParameters['storeAssetForAssetableRequest']),
859
- }, initOverrides);
860
-
861
- return new runtime.JSONApiResponse(response, (jsonValue) => AssetResourceFromJSON(jsonValue));
862
- }
863
-
864
- /**
865
- * Auto-generated: storeAssetForAssetable
866
- */
867
- async storeAssetForAssetable(requestParameters: StoreAssetForAssetableOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<AssetResource> {
868
- const response = await this.storeAssetForAssetableRaw(requestParameters, initOverrides);
869
- return await response.value();
870
- }
871
-
872
821
  /**
873
822
  * Auto-generated: storeProduct
874
823
  */
@@ -74,7 +74,7 @@ export interface ExternalApiLogResource {
74
74
  * @type {string}
75
75
  * @memberof ExternalApiLogResource
76
76
  */
77
- requestPayload?: string | null;
77
+ requestPayload: string;
78
78
  /**
79
79
  *
80
80
  * @type {string}
@@ -106,6 +106,7 @@ 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;
109
110
  if (!('responsePayload' in value) || value['responsePayload'] === undefined) return false;
110
111
  if (!('site' in value) || value['site'] === undefined) return false;
111
112
  return true;
@@ -128,7 +129,7 @@ export function ExternalApiLogResourceFromJSONTyped(json: any, ignoreDiscriminat
128
129
  'exteranlApiLoggableId': json['exteranlApiLoggableId'],
129
130
  'endpoint': json['endpoint'],
130
131
  'responseCode': json['responseCode'],
131
- 'requestPayload': json['requestPayload'] == null ? undefined : json['requestPayload'],
132
+ 'requestPayload': json['requestPayload'],
132
133
  'responsePayload': json['responsePayload'],
133
134
  'createdAt': json['createdAt'] == null ? undefined : json['createdAt'],
134
135
  'site': SiteLiteResourceFromJSON(json['site']),
@@ -13,13 +13,6 @@
13
13
  */
14
14
 
15
15
  import { mapValues } from '../runtime';
16
- import type { ProductCategoryLiteResource } from './ProductCategoryLiteResource';
17
- import {
18
- ProductCategoryLiteResourceFromJSON,
19
- ProductCategoryLiteResourceFromJSONTyped,
20
- ProductCategoryLiteResourceToJSON,
21
- ProductCategoryLiteResourceToJSONTyped,
22
- } from './ProductCategoryLiteResource';
23
16
  import type { ProductTypeLiteResource } from './ProductTypeLiteResource';
24
17
  import {
25
18
  ProductTypeLiteResourceFromJSON,
@@ -80,10 +73,10 @@ export interface ProductResource {
80
73
  warranty: string;
81
74
  /**
82
75
  *
83
- * @type {Array<ProductCategoryLiteResource>}
76
+ * @type {object}
84
77
  * @memberof ProductResource
85
78
  */
86
- categories: Array<ProductCategoryLiteResource> | null;
79
+ categories: object;
87
80
  /**
88
81
  *
89
82
  * @type {boolean}
@@ -156,7 +149,7 @@ export function ProductResourceFromJSONTyped(json: any, ignoreDiscriminator: boo
156
149
  'displayName': json['displayName'],
157
150
  'isAccessory': json['isAccessory'],
158
151
  'warranty': json['warranty'],
159
- 'categories': (json['categories'] == null ? null : (json['categories'] as Array<any>).map(ProductCategoryLiteResourceFromJSON)),
152
+ 'categories': json['categories'],
160
153
  'isDisabled': json['isDisabled'],
161
154
  'googleCategory': GoogleCategoryResourceFromJSON(json['googleCategory']),
162
155
  'supplier': SupplierLiteResourceFromJSON(json['supplier']),
@@ -182,7 +175,7 @@ export function ProductResourceToJSONTyped(value?: ProductResource | null, ignor
182
175
  'displayName': value['displayName'],
183
176
  'isAccessory': value['isAccessory'],
184
177
  'warranty': value['warranty'],
185
- 'categories': (value['categories'] == null ? null : (value['categories'] as Array<any>).map(ProductCategoryLiteResourceToJSON)),
178
+ 'categories': value['categories'],
186
179
  'isDisabled': value['isDisabled'],
187
180
  'googleCategory': GoogleCategoryResourceToJSON(value['googleCategory']),
188
181
  'supplier': SupplierLiteResourceToJSON(value['supplier']),
@@ -19,6 +19,18 @@ import { mapValues } from '../runtime';
19
19
  * @interface StoreAssetForAssetableRequest
20
20
  */
21
21
  export interface StoreAssetForAssetableRequest {
22
+ /**
23
+ *
24
+ * @type {string}
25
+ * @memberof StoreAssetForAssetableRequest
26
+ */
27
+ assetableType: StoreAssetForAssetableRequestAssetableTypeEnum;
28
+ /**
29
+ *
30
+ * @type {number}
31
+ * @memberof StoreAssetForAssetableRequest
32
+ */
33
+ assetableId: number;
22
34
  /**
23
35
  *
24
36
  * @type {string}
@@ -57,10 +69,22 @@ export interface StoreAssetForAssetableRequest {
57
69
  overlayTemplateIds?: Array<number>;
58
70
  }
59
71
 
72
+
73
+ /**
74
+ * @export
75
+ */
76
+ export const StoreAssetForAssetableRequestAssetableTypeEnum = {
77
+ AppModelsProductsProductChild: 'App\\Models\\Products\\ProductChild'
78
+ } as const;
79
+ export type StoreAssetForAssetableRequestAssetableTypeEnum = typeof StoreAssetForAssetableRequestAssetableTypeEnum[keyof typeof StoreAssetForAssetableRequestAssetableTypeEnum];
80
+
81
+
60
82
  /**
61
83
  * Check if a given object implements the StoreAssetForAssetableRequest interface.
62
84
  */
63
85
  export function instanceOfStoreAssetForAssetableRequest(value: object): value is StoreAssetForAssetableRequest {
86
+ if (!('assetableType' in value) || value['assetableType'] === undefined) return false;
87
+ if (!('assetableId' in value) || value['assetableId'] === undefined) return false;
64
88
  if (!('mimeType' in value) || value['mimeType'] === undefined) return false;
65
89
  if (!('fileId' in value) || value['fileId'] === undefined) return false;
66
90
  if (!('isLifestyleImage' in value) || value['isLifestyleImage'] === undefined) return false;
@@ -78,6 +102,8 @@ export function StoreAssetForAssetableRequestFromJSONTyped(json: any, ignoreDisc
78
102
  }
79
103
  return {
80
104
 
105
+ 'assetableType': json['assetable_type'],
106
+ 'assetableId': json['assetable_id'],
81
107
  'altText': json['alt_text'] == null ? undefined : json['alt_text'],
82
108
  'mimeType': json['mime_type'],
83
109
  'fileId': json['file_id'],
@@ -98,6 +124,8 @@ export function StoreAssetForAssetableRequestToJSONTyped(value?: StoreAssetForAs
98
124
 
99
125
  return {
100
126
 
127
+ 'assetable_type': value['assetableType'],
128
+ 'assetable_id': value['assetableId'],
101
129
  'alt_text': value['altText'],
102
130
  'mime_type': value['mimeType'],
103
131
  'file_id': value['fileId'],