@pintahub/shopify-api 2.0.4 → 2.0.6
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.
|
@@ -9,11 +9,11 @@ import { AdminProductsAPIInterface } from "./admin/products-v2";
|
|
|
9
9
|
import { AdminCustomersAPIInterface } from "./admin/customers";
|
|
10
10
|
export declare class AdminAPI {
|
|
11
11
|
private readonly options;
|
|
12
|
-
private readonly client
|
|
13
|
-
readonly product
|
|
14
|
-
readonly metaobject
|
|
15
|
-
readonly order
|
|
16
|
-
readonly files
|
|
12
|
+
private readonly client?;
|
|
13
|
+
readonly product?: AdminProductAPIInterface;
|
|
14
|
+
readonly metaobject?: AdminMetaObjectAPIInterface;
|
|
15
|
+
readonly order?: AdminOrderAPIInterface;
|
|
16
|
+
readonly files?: AdminFileAPIInterface;
|
|
17
17
|
readonly menus: AdminMenuAPIInterface;
|
|
18
18
|
readonly products: AdminProductsAPIInterface;
|
|
19
19
|
readonly customers: AdminCustomersAPIInterface;
|
package/dist/classes/AdminAPI.js
CHANGED
|
@@ -12,12 +12,18 @@ const products_v2_1 = require("./admin/products-v2");
|
|
|
12
12
|
const customers_1 = require("./admin/customers");
|
|
13
13
|
class AdminAPI {
|
|
14
14
|
constructor(options) {
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
this.
|
|
19
|
-
|
|
20
|
-
|
|
15
|
+
const defaultOptions = {
|
|
16
|
+
legacy: true
|
|
17
|
+
};
|
|
18
|
+
this.options = Object.assign({}, defaultOptions, options);
|
|
19
|
+
const { legacy } = this.options;
|
|
20
|
+
if (legacy) {
|
|
21
|
+
this.client = this._createClient();
|
|
22
|
+
this.product = new products_1.AdminProductAPI(this.client);
|
|
23
|
+
this.metaobject = new metaobjects_1.AdminMetaObjectAPI(this.client);
|
|
24
|
+
this.order = new orders_1.AdminOrderAPI(this.client);
|
|
25
|
+
this.files = new files_1.AdminFileAPI(this.client); //Start migration with plurality
|
|
26
|
+
}
|
|
21
27
|
this.menus = new menus_1.AdminMenuAPI(this._createClient('2024-07'));
|
|
22
28
|
this.products = new products_v2_1.AdminProductsAPI(this._createClient('2024-10'));
|
|
23
29
|
this.customers = new customers_1.AdminCustomersAPI(this._createClient('2024-10'));
|
|
@@ -27,13 +27,15 @@ const handleErrors_1 = require("../../../utils/handleErrors");
|
|
|
27
27
|
class GetProductMedia extends ActionBuilder_1.ActionBuilder {
|
|
28
28
|
_formatMedia(media) {
|
|
29
29
|
return media.map(item => {
|
|
30
|
-
const _a = Object.assign({}, item), { preview } = _a, rest = __rest(_a, ["preview"]);
|
|
30
|
+
const _a = Object.assign({}, item), { preview, originalSource } = _a, rest = __rest(_a, ["preview", "originalSource"]);
|
|
31
31
|
const { image } = Object.assign({}, preview);
|
|
32
32
|
const { url, width, height, altText } = Object.assign({}, image);
|
|
33
|
+
const { fileSize } = Object.assign({}, originalSource);
|
|
33
34
|
return Object.assign(Object.assign({}, rest), { url,
|
|
34
35
|
width,
|
|
35
36
|
height,
|
|
36
|
-
altText
|
|
37
|
+
altText,
|
|
38
|
+
fileSize });
|
|
37
39
|
});
|
|
38
40
|
}
|
|
39
41
|
run(args) {
|
|
@@ -51,6 +53,9 @@ class GetProductMedia extends ActionBuilder_1.ActionBuilder {
|
|
|
51
53
|
... on MediaImage {
|
|
52
54
|
id
|
|
53
55
|
mimeType
|
|
56
|
+
originalSource {
|
|
57
|
+
fileSize
|
|
58
|
+
}
|
|
54
59
|
preview {
|
|
55
60
|
image {
|
|
56
61
|
altText
|