ultracart_rest_api_v2_typescript 4.0.64-RC → 4.0.65-RC

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.
@@ -430,6 +430,9 @@ src/models/ItemContentMultimedia.ts
430
430
  src/models/ItemContentMultimediaThumbnail.ts
431
431
  src/models/ItemDigitalDelivery.ts
432
432
  src/models/ItemDigitalItem.ts
433
+ src/models/ItemDigitalItemPdfMeta.ts
434
+ src/models/ItemDigitalItemResponse.ts
435
+ src/models/ItemDigitalItemsResponse.ts
433
436
  src/models/ItemEbay.ts
434
437
  src/models/ItemEbayCategorySpecific.ts
435
438
  src/models/ItemEbayMarketListing.ts
package/README.md CHANGED
@@ -1,4 +1,4 @@
1
- ## ultracart_rest_api_v2_typescript@4.0.64-RC
1
+ ## ultracart_rest_api_v2_typescript@4.0.65-RC
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 ultracart_rest_api_v2_typescript@4.0.64-RC --save
39
+ npm install ultracart_rest_api_v2_typescript@4.0.65-RC --save
40
40
  ```
41
41
 
42
42
  _unPublished (not recommended):_
@@ -54,6 +54,7 @@ Not every change is committed to every SDK.
54
54
 
55
55
  | Version | Date | Comments |
56
56
  | --: | :-: | --- |
57
+ | 4.0.65-RC | 09/22/2022 | testing digital file mgmt calls |
57
58
  | 4.0.64-RC | 09/19/2022 | conversations pagination |
58
59
  | 4.0.63-RC | 09/13/2022 | storefront comms - postcard tracking |
59
60
  | 4.0.62-RC | 09/12/2022 | storefront comm - send back reviews.io configured flag on getEmailSettings |
@@ -10,10 +10,30 @@
10
10
  * Do not edit the class manually.
11
11
  */
12
12
  import * as runtime from '../runtime';
13
- import { Item, ItemResponse, ItemsRequest, ItemsResponse, PricingTiersResponse, TempMultimediaResponse } from '../models';
13
+ import { Item, ItemDigitalItem, ItemDigitalItemResponse, ItemDigitalItemsResponse, ItemResponse, ItemsRequest, ItemsResponse, PricingTiersResponse, TempMultimediaResponse } from '../models';
14
+ export interface DeleteDigitalItemRequest {
15
+ digitalItemOid: number;
16
+ }
14
17
  export interface DeleteItemRequest {
15
18
  merchantItemOid: number;
16
19
  }
20
+ export interface GetDigitalItemRequest {
21
+ digitalItemOid: number;
22
+ limit?: number;
23
+ offset?: number;
24
+ since?: string;
25
+ sort?: string;
26
+ expand?: string;
27
+ placeholders?: boolean;
28
+ }
29
+ export interface GetDigitalItemsRequest {
30
+ limit?: number;
31
+ offset?: number;
32
+ since?: string;
33
+ sort?: string;
34
+ expand?: string;
35
+ placeholders?: boolean;
36
+ }
17
37
  export interface GetItemRequest {
18
38
  merchantItemOid: number;
19
39
  expand?: string;
@@ -37,11 +57,18 @@ export interface GetItemsRequest {
37
57
  export interface GetPricingTiersRequest {
38
58
  expand?: string;
39
59
  }
60
+ export interface InsertDigitalItemRequest {
61
+ digitalItem: ItemDigitalItem;
62
+ }
40
63
  export interface InsertItemRequest {
41
64
  item: Item;
42
65
  expand?: string;
43
66
  placeholders?: boolean;
44
67
  }
68
+ export interface UpdateDigitalItemRequest {
69
+ digitalItemOid: number;
70
+ digitalItem: ItemDigitalItem;
71
+ }
45
72
  export interface UpdateItemRequest {
46
73
  merchantItemOid: number;
47
74
  item: Item;
@@ -64,6 +91,20 @@ export interface UploadTemporaryMultimediaRequest {
64
91
  * @interface ItemApiInterface
65
92
  */
66
93
  export interface ItemApiInterface {
94
+ /**
95
+ * Delete a digital item on the UltraCart account.
96
+ * @summary Delete a digital item, which is a file within the digital library, not an actual merchant item
97
+ * @param {number} digitalItemOid The digital item oid to delete.
98
+ * @param {*} [options] Override http request option.
99
+ * @throws {RequiredError}
100
+ * @memberof ItemApiInterface
101
+ */
102
+ deleteDigitalItemRaw(requestParameters: DeleteDigitalItemRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<void>>;
103
+ /**
104
+ * Delete a digital item on the UltraCart account.
105
+ * Delete a digital item, which is a file within the digital library, not an actual merchant item
106
+ */
107
+ deleteDigitalItem(requestParameters: DeleteDigitalItemRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<void>;
67
108
  /**
68
109
  * Delete an item on the UltraCart account.
69
110
  * @summary Delete an item
@@ -78,6 +119,45 @@ export interface ItemApiInterface {
78
119
  * Delete an item
79
120
  */
80
121
  deleteItem(requestParameters: DeleteItemRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<void>;
122
+ /**
123
+ * Retrieves a digital item (file information) from the account. Be aware that these are not normal items that can be added to a shopping cart. Rather, they are digital files that may be associated with normal items.
124
+ * @summary Retrieve a digital item from the digital library, which are digital files that may be attached to normal items
125
+ * @param {number} digitalItemOid The digital item oid to retrieve.
126
+ * @param {number} [limit] The maximum number of records to return on this one API call. (Default 100, Max 2000)
127
+ * @param {number} [offset] Pagination of the record set. Offset is a zero based index.
128
+ * @param {string} [since] Fetch items that have been created/modified since this date/time.
129
+ * @param {string} [sort] The sort order of the items. See Sorting documentation for examples of using multiple values and sorting by ascending and descending.
130
+ * @param {string} [expand] The object expansion to perform on the result. See documentation for examples
131
+ * @param {boolean} [placeholders] Whether or not placeholder values should be returned in the result. Useful for UIs that consume this REST API.
132
+ * @param {*} [options] Override http request option.
133
+ * @throws {RequiredError}
134
+ * @memberof ItemApiInterface
135
+ */
136
+ getDigitalItemRaw(requestParameters: GetDigitalItemRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<ItemDigitalItemResponse>>;
137
+ /**
138
+ * Retrieves a digital item (file information) from the account. Be aware that these are not normal items that can be added to a shopping cart. Rather, they are digital files that may be associated with normal items.
139
+ * Retrieve a digital item from the digital library, which are digital files that may be attached to normal items
140
+ */
141
+ getDigitalItem(requestParameters: GetDigitalItemRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<ItemDigitalItemResponse>;
142
+ /**
143
+ * Retrieves a group of digital items (file information) from the account. If no parameters are specified, all digital items will be returned. Be aware that these are not normal items that can be added to a shopping cart. Rather, they are digital files that may be associated with normal items. You will need to make multiple API calls in order to retrieve the entire result set since this API performs result set pagination.
144
+ * @summary Retrieve digital items from the digital library which are digital files that may be attached to normal items
145
+ * @param {number} [limit] The maximum number of records to return on this one API call. (Default 100, Max 2000)
146
+ * @param {number} [offset] Pagination of the record set. Offset is a zero based index.
147
+ * @param {string} [since] Fetch items that have been created/modified since this date/time.
148
+ * @param {string} [sort] The sort order of the items. See Sorting documentation for examples of using multiple values and sorting by ascending and descending.
149
+ * @param {string} [expand] The object expansion to perform on the result. See documentation for examples
150
+ * @param {boolean} [placeholders] Whether or not placeholder values should be returned in the result. Useful for UIs that consume this REST API.
151
+ * @param {*} [options] Override http request option.
152
+ * @throws {RequiredError}
153
+ * @memberof ItemApiInterface
154
+ */
155
+ getDigitalItemsRaw(requestParameters: GetDigitalItemsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<ItemDigitalItemsResponse>>;
156
+ /**
157
+ * Retrieves a group of digital items (file information) from the account. If no parameters are specified, all digital items will be returned. Be aware that these are not normal items that can be added to a shopping cart. Rather, they are digital files that may be associated with normal items. You will need to make multiple API calls in order to retrieve the entire result set since this API performs result set pagination.
158
+ * Retrieve digital items from the digital library which are digital files that may be attached to normal items
159
+ */
160
+ getDigitalItems(requestParameters: GetDigitalItemsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<ItemDigitalItemsResponse>;
81
161
  /**
82
162
  * Retrieves a single item using the specified item oid.
83
163
  * @summary Retrieve an item
@@ -145,6 +225,20 @@ export interface ItemApiInterface {
145
225
  * Retrieve pricing tiers
146
226
  */
147
227
  getPricingTiers(requestParameters: GetPricingTiersRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<PricingTiersResponse>;
228
+ /**
229
+ * Create a file within the digital library. This does not create an item, but makes this digital file available and selectable as part (or all) of an item.
230
+ * @summary Create a file within the digital library
231
+ * @param {ItemDigitalItem} digitalItem Digital item to create
232
+ * @param {*} [options] Override http request option.
233
+ * @throws {RequiredError}
234
+ * @memberof ItemApiInterface
235
+ */
236
+ insertDigitalItemRaw(requestParameters: InsertDigitalItemRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<ItemDigitalItemResponse>>;
237
+ /**
238
+ * Create a file within the digital library. This does not create an item, but makes this digital file available and selectable as part (or all) of an item.
239
+ * Create a file within the digital library
240
+ */
241
+ insertDigitalItem(requestParameters: InsertDigitalItemRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<ItemDigitalItemResponse>;
148
242
  /**
149
243
  * Create a new item on the UltraCart account.
150
244
  * @summary Create an item
@@ -161,6 +255,21 @@ export interface ItemApiInterface {
161
255
  * Create an item
162
256
  */
163
257
  insertItem(requestParameters: InsertItemRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<ItemResponse>;
258
+ /**
259
+ * Updates a file within the digital library. This does not update an item, but updates a digital file available and selectable as part (or all) of an item.
260
+ * @summary Updates a file within the digital library
261
+ * @param {number} digitalItemOid The digital item oid to update.
262
+ * @param {ItemDigitalItem} digitalItem Digital item to update
263
+ * @param {*} [options] Override http request option.
264
+ * @throws {RequiredError}
265
+ * @memberof ItemApiInterface
266
+ */
267
+ updateDigitalItemRaw(requestParameters: UpdateDigitalItemRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<ItemDigitalItemResponse>>;
268
+ /**
269
+ * Updates a file within the digital library. This does not update an item, but updates a digital file available and selectable as part (or all) of an item.
270
+ * Updates a file within the digital library
271
+ */
272
+ updateDigitalItem(requestParameters: UpdateDigitalItemRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<ItemDigitalItemResponse>;
164
273
  /**
165
274
  * Update a new item on the UltraCart account.
166
275
  * @summary Update an item
@@ -214,6 +323,16 @@ export interface ItemApiInterface {
214
323
  *
215
324
  */
216
325
  export declare class ItemApi extends runtime.BaseAPI implements ItemApiInterface {
326
+ /**
327
+ * Delete a digital item on the UltraCart account.
328
+ * Delete a digital item, which is a file within the digital library, not an actual merchant item
329
+ */
330
+ deleteDigitalItemRaw(requestParameters: DeleteDigitalItemRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<void>>;
331
+ /**
332
+ * Delete a digital item on the UltraCart account.
333
+ * Delete a digital item, which is a file within the digital library, not an actual merchant item
334
+ */
335
+ deleteDigitalItem(requestParameters: DeleteDigitalItemRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<void>;
217
336
  /**
218
337
  * Delete an item on the UltraCart account.
219
338
  * Delete an item
@@ -224,6 +343,26 @@ export declare class ItemApi extends runtime.BaseAPI implements ItemApiInterface
224
343
  * Delete an item
225
344
  */
226
345
  deleteItem(requestParameters: DeleteItemRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<void>;
346
+ /**
347
+ * Retrieves a digital item (file information) from the account. Be aware that these are not normal items that can be added to a shopping cart. Rather, they are digital files that may be associated with normal items.
348
+ * Retrieve a digital item from the digital library, which are digital files that may be attached to normal items
349
+ */
350
+ getDigitalItemRaw(requestParameters: GetDigitalItemRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<ItemDigitalItemResponse>>;
351
+ /**
352
+ * Retrieves a digital item (file information) from the account. Be aware that these are not normal items that can be added to a shopping cart. Rather, they are digital files that may be associated with normal items.
353
+ * Retrieve a digital item from the digital library, which are digital files that may be attached to normal items
354
+ */
355
+ getDigitalItem(requestParameters: GetDigitalItemRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<ItemDigitalItemResponse>;
356
+ /**
357
+ * Retrieves a group of digital items (file information) from the account. If no parameters are specified, all digital items will be returned. Be aware that these are not normal items that can be added to a shopping cart. Rather, they are digital files that may be associated with normal items. You will need to make multiple API calls in order to retrieve the entire result set since this API performs result set pagination.
358
+ * Retrieve digital items from the digital library which are digital files that may be attached to normal items
359
+ */
360
+ getDigitalItemsRaw(requestParameters: GetDigitalItemsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<ItemDigitalItemsResponse>>;
361
+ /**
362
+ * Retrieves a group of digital items (file information) from the account. If no parameters are specified, all digital items will be returned. Be aware that these are not normal items that can be added to a shopping cart. Rather, they are digital files that may be associated with normal items. You will need to make multiple API calls in order to retrieve the entire result set since this API performs result set pagination.
363
+ * Retrieve digital items from the digital library which are digital files that may be attached to normal items
364
+ */
365
+ getDigitalItems(requestParameters?: GetDigitalItemsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<ItemDigitalItemsResponse>;
227
366
  /**
228
367
  * Retrieves a single item using the specified item oid.
229
368
  * Retrieve an item
@@ -264,6 +403,16 @@ export declare class ItemApi extends runtime.BaseAPI implements ItemApiInterface
264
403
  * Retrieve pricing tiers
265
404
  */
266
405
  getPricingTiers(requestParameters?: GetPricingTiersRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<PricingTiersResponse>;
406
+ /**
407
+ * Create a file within the digital library. This does not create an item, but makes this digital file available and selectable as part (or all) of an item.
408
+ * Create a file within the digital library
409
+ */
410
+ insertDigitalItemRaw(requestParameters: InsertDigitalItemRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<ItemDigitalItemResponse>>;
411
+ /**
412
+ * Create a file within the digital library. This does not create an item, but makes this digital file available and selectable as part (or all) of an item.
413
+ * Create a file within the digital library
414
+ */
415
+ insertDigitalItem(requestParameters: InsertDigitalItemRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<ItemDigitalItemResponse>;
267
416
  /**
268
417
  * Create a new item on the UltraCart account.
269
418
  * Create an item
@@ -274,6 +423,16 @@ export declare class ItemApi extends runtime.BaseAPI implements ItemApiInterface
274
423
  * Create an item
275
424
  */
276
425
  insertItem(requestParameters: InsertItemRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<ItemResponse>;
426
+ /**
427
+ * Updates a file within the digital library. This does not update an item, but updates a digital file available and selectable as part (or all) of an item.
428
+ * Updates a file within the digital library
429
+ */
430
+ updateDigitalItemRaw(requestParameters: UpdateDigitalItemRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<ItemDigitalItemResponse>>;
431
+ /**
432
+ * Updates a file within the digital library. This does not update an item, but updates a digital file available and selectable as part (or all) of an item.
433
+ * Updates a file within the digital library
434
+ */
435
+ updateDigitalItem(requestParameters: UpdateDigitalItemRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<ItemDigitalItemResponse>;
277
436
  /**
278
437
  * Update a new item on the UltraCart account.
279
438
  * Update an item
@@ -75,6 +75,63 @@ var ItemApi = /** @class */ (function (_super) {
75
75
  function ItemApi() {
76
76
  return _super !== null && _super.apply(this, arguments) || this;
77
77
  }
78
+ /**
79
+ * Delete a digital item on the UltraCart account.
80
+ * Delete a digital item, which is a file within the digital library, not an actual merchant item
81
+ */
82
+ ItemApi.prototype.deleteDigitalItemRaw = function (requestParameters, initOverrides) {
83
+ return __awaiter(this, void 0, void 0, function () {
84
+ var queryParameters, headerParameters, _a, _b, response;
85
+ return __generator(this, function (_c) {
86
+ switch (_c.label) {
87
+ case 0:
88
+ if (requestParameters.digitalItemOid === null || requestParameters.digitalItemOid === undefined) {
89
+ throw new runtime.RequiredError('digitalItemOid', 'Required parameter requestParameters.digitalItemOid was null or undefined when calling deleteDigitalItem.');
90
+ }
91
+ queryParameters = {};
92
+ headerParameters = {};
93
+ if (!(this.configuration && this.configuration.accessToken)) return [3 /*break*/, 2];
94
+ // oauth required
95
+ _a = headerParameters;
96
+ _b = "Authorization";
97
+ return [4 /*yield*/, this.configuration.accessToken("ultraCartOauth", ["item_write"])];
98
+ case 1:
99
+ // oauth required
100
+ _a[_b] = _c.sent();
101
+ _c.label = 2;
102
+ case 2:
103
+ if (this.configuration && this.configuration.apiKey) {
104
+ headerParameters["x-ultracart-simple-key"] = this.configuration.apiKey("x-ultracart-simple-key"); // ultraCartSimpleApiKey authentication
105
+ }
106
+ return [4 /*yield*/, this.request({
107
+ path: "/item/digital_library/{digital_item_oid}".replace("{".concat("digital_item_oid", "}"), encodeURIComponent(String(requestParameters.digitalItemOid))),
108
+ method: 'DELETE',
109
+ headers: headerParameters,
110
+ query: queryParameters,
111
+ }, initOverrides)];
112
+ case 3:
113
+ response = _c.sent();
114
+ return [2 /*return*/, new runtime.VoidApiResponse(response)];
115
+ }
116
+ });
117
+ });
118
+ };
119
+ /**
120
+ * Delete a digital item on the UltraCart account.
121
+ * Delete a digital item, which is a file within the digital library, not an actual merchant item
122
+ */
123
+ ItemApi.prototype.deleteDigitalItem = function (requestParameters, initOverrides) {
124
+ return __awaiter(this, void 0, void 0, function () {
125
+ return __generator(this, function (_a) {
126
+ switch (_a.label) {
127
+ case 0: return [4 /*yield*/, this.deleteDigitalItemRaw(requestParameters, initOverrides)];
128
+ case 1:
129
+ _a.sent();
130
+ return [2 /*return*/];
131
+ }
132
+ });
133
+ });
134
+ };
78
135
  /**
79
136
  * Delete an item on the UltraCart account.
80
137
  * Delete an item
@@ -132,6 +189,158 @@ var ItemApi = /** @class */ (function (_super) {
132
189
  });
133
190
  });
134
191
  };
192
+ /**
193
+ * Retrieves a digital item (file information) from the account. Be aware that these are not normal items that can be added to a shopping cart. Rather, they are digital files that may be associated with normal items.
194
+ * Retrieve a digital item from the digital library, which are digital files that may be attached to normal items
195
+ */
196
+ ItemApi.prototype.getDigitalItemRaw = function (requestParameters, initOverrides) {
197
+ return __awaiter(this, void 0, void 0, function () {
198
+ var queryParameters, headerParameters, _a, _b, response;
199
+ return __generator(this, function (_c) {
200
+ switch (_c.label) {
201
+ case 0:
202
+ if (requestParameters.digitalItemOid === null || requestParameters.digitalItemOid === undefined) {
203
+ throw new runtime.RequiredError('digitalItemOid', 'Required parameter requestParameters.digitalItemOid was null or undefined when calling getDigitalItem.');
204
+ }
205
+ queryParameters = {};
206
+ if (requestParameters.limit !== undefined) {
207
+ queryParameters['_limit'] = requestParameters.limit;
208
+ }
209
+ if (requestParameters.offset !== undefined) {
210
+ queryParameters['_offset'] = requestParameters.offset;
211
+ }
212
+ if (requestParameters.since !== undefined) {
213
+ queryParameters['_since'] = requestParameters.since;
214
+ }
215
+ if (requestParameters.sort !== undefined) {
216
+ queryParameters['_sort'] = requestParameters.sort;
217
+ }
218
+ if (requestParameters.expand !== undefined) {
219
+ queryParameters['_expand'] = requestParameters.expand;
220
+ }
221
+ if (requestParameters.placeholders !== undefined) {
222
+ queryParameters['_placeholders'] = requestParameters.placeholders;
223
+ }
224
+ headerParameters = {};
225
+ if (!(this.configuration && this.configuration.accessToken)) return [3 /*break*/, 2];
226
+ // oauth required
227
+ _a = headerParameters;
228
+ _b = "Authorization";
229
+ return [4 /*yield*/, this.configuration.accessToken("ultraCartOauth", ["item_read"])];
230
+ case 1:
231
+ // oauth required
232
+ _a[_b] = _c.sent();
233
+ _c.label = 2;
234
+ case 2:
235
+ if (this.configuration && this.configuration.apiKey) {
236
+ headerParameters["x-ultracart-simple-key"] = this.configuration.apiKey("x-ultracart-simple-key"); // ultraCartSimpleApiKey authentication
237
+ }
238
+ return [4 /*yield*/, this.request({
239
+ path: "/item/digital_library/{digital_item_oid}".replace("{".concat("digital_item_oid", "}"), encodeURIComponent(String(requestParameters.digitalItemOid))),
240
+ method: 'GET',
241
+ headers: headerParameters,
242
+ query: queryParameters,
243
+ }, initOverrides)];
244
+ case 3:
245
+ response = _c.sent();
246
+ return [2 /*return*/, new runtime.JSONApiResponse(response, function (jsonValue) { return (0, models_1.ItemDigitalItemResponseFromJSON)(jsonValue); })];
247
+ }
248
+ });
249
+ });
250
+ };
251
+ /**
252
+ * Retrieves a digital item (file information) from the account. Be aware that these are not normal items that can be added to a shopping cart. Rather, they are digital files that may be associated with normal items.
253
+ * Retrieve a digital item from the digital library, which are digital files that may be attached to normal items
254
+ */
255
+ ItemApi.prototype.getDigitalItem = function (requestParameters, initOverrides) {
256
+ return __awaiter(this, void 0, void 0, function () {
257
+ var response;
258
+ return __generator(this, function (_a) {
259
+ switch (_a.label) {
260
+ case 0: return [4 /*yield*/, this.getDigitalItemRaw(requestParameters, initOverrides)];
261
+ case 1:
262
+ response = _a.sent();
263
+ return [4 /*yield*/, response.value()];
264
+ case 2: return [2 /*return*/, _a.sent()];
265
+ }
266
+ });
267
+ });
268
+ };
269
+ /**
270
+ * Retrieves a group of digital items (file information) from the account. If no parameters are specified, all digital items will be returned. Be aware that these are not normal items that can be added to a shopping cart. Rather, they are digital files that may be associated with normal items. You will need to make multiple API calls in order to retrieve the entire result set since this API performs result set pagination.
271
+ * Retrieve digital items from the digital library which are digital files that may be attached to normal items
272
+ */
273
+ ItemApi.prototype.getDigitalItemsRaw = function (requestParameters, initOverrides) {
274
+ return __awaiter(this, void 0, void 0, function () {
275
+ var queryParameters, headerParameters, _a, _b, response;
276
+ return __generator(this, function (_c) {
277
+ switch (_c.label) {
278
+ case 0:
279
+ queryParameters = {};
280
+ if (requestParameters.limit !== undefined) {
281
+ queryParameters['_limit'] = requestParameters.limit;
282
+ }
283
+ if (requestParameters.offset !== undefined) {
284
+ queryParameters['_offset'] = requestParameters.offset;
285
+ }
286
+ if (requestParameters.since !== undefined) {
287
+ queryParameters['_since'] = requestParameters.since;
288
+ }
289
+ if (requestParameters.sort !== undefined) {
290
+ queryParameters['_sort'] = requestParameters.sort;
291
+ }
292
+ if (requestParameters.expand !== undefined) {
293
+ queryParameters['_expand'] = requestParameters.expand;
294
+ }
295
+ if (requestParameters.placeholders !== undefined) {
296
+ queryParameters['_placeholders'] = requestParameters.placeholders;
297
+ }
298
+ headerParameters = {};
299
+ if (!(this.configuration && this.configuration.accessToken)) return [3 /*break*/, 2];
300
+ // oauth required
301
+ _a = headerParameters;
302
+ _b = "Authorization";
303
+ return [4 /*yield*/, this.configuration.accessToken("ultraCartOauth", ["item_read"])];
304
+ case 1:
305
+ // oauth required
306
+ _a[_b] = _c.sent();
307
+ _c.label = 2;
308
+ case 2:
309
+ if (this.configuration && this.configuration.apiKey) {
310
+ headerParameters["x-ultracart-simple-key"] = this.configuration.apiKey("x-ultracart-simple-key"); // ultraCartSimpleApiKey authentication
311
+ }
312
+ return [4 /*yield*/, this.request({
313
+ path: "/item/digital_library",
314
+ method: 'GET',
315
+ headers: headerParameters,
316
+ query: queryParameters,
317
+ }, initOverrides)];
318
+ case 3:
319
+ response = _c.sent();
320
+ return [2 /*return*/, new runtime.JSONApiResponse(response, function (jsonValue) { return (0, models_1.ItemDigitalItemsResponseFromJSON)(jsonValue); })];
321
+ }
322
+ });
323
+ });
324
+ };
325
+ /**
326
+ * Retrieves a group of digital items (file information) from the account. If no parameters are specified, all digital items will be returned. Be aware that these are not normal items that can be added to a shopping cart. Rather, they are digital files that may be associated with normal items. You will need to make multiple API calls in order to retrieve the entire result set since this API performs result set pagination.
327
+ * Retrieve digital items from the digital library which are digital files that may be attached to normal items
328
+ */
329
+ ItemApi.prototype.getDigitalItems = function (requestParameters, initOverrides) {
330
+ if (requestParameters === void 0) { requestParameters = {}; }
331
+ return __awaiter(this, void 0, void 0, function () {
332
+ var response;
333
+ return __generator(this, function (_a) {
334
+ switch (_a.label) {
335
+ case 0: return [4 /*yield*/, this.getDigitalItemsRaw(requestParameters, initOverrides)];
336
+ case 1:
337
+ response = _a.sent();
338
+ return [4 /*yield*/, response.value()];
339
+ case 2: return [2 /*return*/, _a.sent()];
340
+ }
341
+ });
342
+ });
343
+ };
135
344
  /**
136
345
  * Retrieves a single item using the specified item oid.
137
346
  * Retrieve an item
@@ -403,6 +612,67 @@ var ItemApi = /** @class */ (function (_super) {
403
612
  });
404
613
  });
405
614
  };
615
+ /**
616
+ * Create a file within the digital library. This does not create an item, but makes this digital file available and selectable as part (or all) of an item.
617
+ * Create a file within the digital library
618
+ */
619
+ ItemApi.prototype.insertDigitalItemRaw = function (requestParameters, initOverrides) {
620
+ return __awaiter(this, void 0, void 0, function () {
621
+ var queryParameters, headerParameters, _a, _b, response;
622
+ return __generator(this, function (_c) {
623
+ switch (_c.label) {
624
+ case 0:
625
+ if (requestParameters.digitalItem === null || requestParameters.digitalItem === undefined) {
626
+ throw new runtime.RequiredError('digitalItem', 'Required parameter requestParameters.digitalItem was null or undefined when calling insertDigitalItem.');
627
+ }
628
+ queryParameters = {};
629
+ headerParameters = {};
630
+ headerParameters['Content-Type'] = 'application/json; charset=UTF-8';
631
+ if (!(this.configuration && this.configuration.accessToken)) return [3 /*break*/, 2];
632
+ // oauth required
633
+ _a = headerParameters;
634
+ _b = "Authorization";
635
+ return [4 /*yield*/, this.configuration.accessToken("ultraCartOauth", ["item_write"])];
636
+ case 1:
637
+ // oauth required
638
+ _a[_b] = _c.sent();
639
+ _c.label = 2;
640
+ case 2:
641
+ if (this.configuration && this.configuration.apiKey) {
642
+ headerParameters["x-ultracart-simple-key"] = this.configuration.apiKey("x-ultracart-simple-key"); // ultraCartSimpleApiKey authentication
643
+ }
644
+ return [4 /*yield*/, this.request({
645
+ path: "/item/digital_library",
646
+ method: 'POST',
647
+ headers: headerParameters,
648
+ query: queryParameters,
649
+ body: (0, models_1.ItemDigitalItemToJSON)(requestParameters.digitalItem),
650
+ }, initOverrides)];
651
+ case 3:
652
+ response = _c.sent();
653
+ return [2 /*return*/, new runtime.JSONApiResponse(response, function (jsonValue) { return (0, models_1.ItemDigitalItemResponseFromJSON)(jsonValue); })];
654
+ }
655
+ });
656
+ });
657
+ };
658
+ /**
659
+ * Create a file within the digital library. This does not create an item, but makes this digital file available and selectable as part (or all) of an item.
660
+ * Create a file within the digital library
661
+ */
662
+ ItemApi.prototype.insertDigitalItem = function (requestParameters, initOverrides) {
663
+ return __awaiter(this, void 0, void 0, function () {
664
+ var response;
665
+ return __generator(this, function (_a) {
666
+ switch (_a.label) {
667
+ case 0: return [4 /*yield*/, this.insertDigitalItemRaw(requestParameters, initOverrides)];
668
+ case 1:
669
+ response = _a.sent();
670
+ return [4 /*yield*/, response.value()];
671
+ case 2: return [2 /*return*/, _a.sent()];
672
+ }
673
+ });
674
+ });
675
+ };
406
676
  /**
407
677
  * Create a new item on the UltraCart account.
408
678
  * Create an item
@@ -470,6 +740,70 @@ var ItemApi = /** @class */ (function (_super) {
470
740
  });
471
741
  });
472
742
  };
743
+ /**
744
+ * Updates a file within the digital library. This does not update an item, but updates a digital file available and selectable as part (or all) of an item.
745
+ * Updates a file within the digital library
746
+ */
747
+ ItemApi.prototype.updateDigitalItemRaw = function (requestParameters, initOverrides) {
748
+ return __awaiter(this, void 0, void 0, function () {
749
+ var queryParameters, headerParameters, _a, _b, response;
750
+ return __generator(this, function (_c) {
751
+ switch (_c.label) {
752
+ case 0:
753
+ if (requestParameters.digitalItemOid === null || requestParameters.digitalItemOid === undefined) {
754
+ throw new runtime.RequiredError('digitalItemOid', 'Required parameter requestParameters.digitalItemOid was null or undefined when calling updateDigitalItem.');
755
+ }
756
+ if (requestParameters.digitalItem === null || requestParameters.digitalItem === undefined) {
757
+ throw new runtime.RequiredError('digitalItem', 'Required parameter requestParameters.digitalItem was null or undefined when calling updateDigitalItem.');
758
+ }
759
+ queryParameters = {};
760
+ headerParameters = {};
761
+ headerParameters['Content-Type'] = 'application/json; charset=UTF-8';
762
+ if (!(this.configuration && this.configuration.accessToken)) return [3 /*break*/, 2];
763
+ // oauth required
764
+ _a = headerParameters;
765
+ _b = "Authorization";
766
+ return [4 /*yield*/, this.configuration.accessToken("ultraCartOauth", ["item_write"])];
767
+ case 1:
768
+ // oauth required
769
+ _a[_b] = _c.sent();
770
+ _c.label = 2;
771
+ case 2:
772
+ if (this.configuration && this.configuration.apiKey) {
773
+ headerParameters["x-ultracart-simple-key"] = this.configuration.apiKey("x-ultracart-simple-key"); // ultraCartSimpleApiKey authentication
774
+ }
775
+ return [4 /*yield*/, this.request({
776
+ path: "/item/digital_library/{digital_item_oid}".replace("{".concat("digital_item_oid", "}"), encodeURIComponent(String(requestParameters.digitalItemOid))),
777
+ method: 'PUT',
778
+ headers: headerParameters,
779
+ query: queryParameters,
780
+ body: (0, models_1.ItemDigitalItemToJSON)(requestParameters.digitalItem),
781
+ }, initOverrides)];
782
+ case 3:
783
+ response = _c.sent();
784
+ return [2 /*return*/, new runtime.JSONApiResponse(response, function (jsonValue) { return (0, models_1.ItemDigitalItemResponseFromJSON)(jsonValue); })];
785
+ }
786
+ });
787
+ });
788
+ };
789
+ /**
790
+ * Updates a file within the digital library. This does not update an item, but updates a digital file available and selectable as part (or all) of an item.
791
+ * Updates a file within the digital library
792
+ */
793
+ ItemApi.prototype.updateDigitalItem = function (requestParameters, initOverrides) {
794
+ return __awaiter(this, void 0, void 0, function () {
795
+ var response;
796
+ return __generator(this, function (_a) {
797
+ switch (_a.label) {
798
+ case 0: return [4 /*yield*/, this.updateDigitalItemRaw(requestParameters, initOverrides)];
799
+ case 1:
800
+ response = _a.sent();
801
+ return [4 /*yield*/, response.value()];
802
+ case 2: return [2 /*return*/, _a.sent()];
803
+ }
804
+ });
805
+ });
806
+ };
473
807
  /**
474
808
  * Update a new item on the UltraCart account.
475
809
  * Update an item