@pintahub/shopify-api 1.4.6 → 1.4.7
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/dist/classes/AdminAPI.d.ts +1 -4
- package/dist/classes/RestAPI.d.ts +9 -0
- package/dist/classes/RestAPI.js +24 -0
- package/dist/classes/rest/orders/GetOrder.d.ts +12 -0
- package/dist/classes/rest/orders/GetOrder.js +29 -0
- package/dist/classes/rest/orders/SearchOrders.d.ts +14 -0
- package/dist/classes/rest/orders/SearchOrders.js +49 -0
- package/dist/classes/rest/orders/index.d.ts +10 -0
- package/dist/classes/rest/orders/index.js +28 -0
- package/dist/classes/rest/orders/orders/GetOrder.d.ts +10 -0
- package/dist/classes/rest/orders/orders/GetOrder.js +52 -0
- package/dist/classes/rest/orders/orders/SearchOrders.d.ts +14 -0
- package/dist/classes/rest/orders/orders/SearchOrders.js +49 -0
- package/dist/classes/rest/orders/orders/index.d.ts +13 -0
- package/dist/classes/rest/orders/orders/index.js +34 -0
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/interfaces/APIOptions.d.ts +4 -0
- package/dist/interfaces/APIOptions.js +2 -0
- package/dist/utils/parseCleanId.d.ts +0 -0
- package/dist/utils/parseCleanId.js +1 -0
- package/dist/utils/parseOnlyId.d.ts +1 -0
- package/dist/utils/parseOnlyId.js +9 -0
- package/package.json +3 -2
|
@@ -2,10 +2,7 @@ import { AdminProductAPIInterface } from "./admin/products";
|
|
|
2
2
|
import { AdminCollectionAPIInterface } from "./admin/collections";
|
|
3
3
|
import { AdminMetaObjectAPIInterface } from "./admin/metaobjects";
|
|
4
4
|
import { AdminOrderAPIInterface } from "./admin/orders";
|
|
5
|
-
|
|
6
|
-
shop: string;
|
|
7
|
-
accessToken: string;
|
|
8
|
-
}
|
|
5
|
+
import { APIOptions } from "../interfaces/APIOptions";
|
|
9
6
|
export declare class AdminAPI {
|
|
10
7
|
private readonly options;
|
|
11
8
|
private readonly client;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { APIOptions } from "../interfaces/APIOptions";
|
|
2
|
+
import { RestOrderAPIInterface } from "./rest/orders";
|
|
3
|
+
export declare class RestAPI {
|
|
4
|
+
private readonly options;
|
|
5
|
+
private readonly client;
|
|
6
|
+
readonly order: RestOrderAPIInterface;
|
|
7
|
+
constructor(options: APIOptions);
|
|
8
|
+
private _createClient;
|
|
9
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.RestAPI = void 0;
|
|
4
|
+
const axios_1 = require("axios");
|
|
5
|
+
const orders_1 = require("./rest/orders");
|
|
6
|
+
class RestAPI {
|
|
7
|
+
constructor(options) {
|
|
8
|
+
this.options = options;
|
|
9
|
+
this.client = this._createClient();
|
|
10
|
+
this.order = new orders_1.RestOrderAPI(this.client);
|
|
11
|
+
}
|
|
12
|
+
_createClient() {
|
|
13
|
+
const { shop, accessToken } = this.options;
|
|
14
|
+
const url = `https://${shop}/admin/api/2024-01`;
|
|
15
|
+
return axios_1.default.create({
|
|
16
|
+
baseURL: url,
|
|
17
|
+
headers: {
|
|
18
|
+
'X-Shopify-Access-Token': accessToken
|
|
19
|
+
},
|
|
20
|
+
responseType: 'json',
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
exports.RestAPI = RestAPI;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { ActionBuilder } from "../../ActionBuilder";
|
|
2
|
+
import { AxiosInstance } from "axios";
|
|
3
|
+
export interface GetOrderInput extends Record<string, any> {
|
|
4
|
+
id: string;
|
|
5
|
+
}
|
|
6
|
+
export interface GetOrderOutput extends Record<string, any> {
|
|
7
|
+
id: number;
|
|
8
|
+
order_status_url: string;
|
|
9
|
+
}
|
|
10
|
+
export declare class GetOrder extends ActionBuilder<AxiosInstance, GetOrderInput, GetOrderOutput> {
|
|
11
|
+
run(args: GetOrderInput): Promise<GetOrderOutput>;
|
|
12
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.GetOrder = void 0;
|
|
13
|
+
const ActionBuilder_1 = require("../../ActionBuilder");
|
|
14
|
+
const parseOnlyId_1 = require("../../../utils/parseOnlyId");
|
|
15
|
+
class GetOrder extends ActionBuilder_1.ActionBuilder {
|
|
16
|
+
run(args) {
|
|
17
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
18
|
+
const { id } = args;
|
|
19
|
+
const cleanId = (0, parseOnlyId_1.parseOnlyId)(id);
|
|
20
|
+
const { data } = yield this.client({
|
|
21
|
+
url: `orders/${cleanId}.json`,
|
|
22
|
+
method: 'GET'
|
|
23
|
+
});
|
|
24
|
+
const { order } = Object.assign({}, data);
|
|
25
|
+
return Object.assign({}, order);
|
|
26
|
+
});
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
exports.GetOrder = GetOrder;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { AdminApiClient } from "@shopify/admin-api-client/dist/ts/types";
|
|
2
|
+
import { ActionBuilder } from "../../ActionBuilder";
|
|
3
|
+
import { PageInfo } from "../../../interfaces/PageInfo";
|
|
4
|
+
export interface SearchOrdersInput extends Record<string, any> {
|
|
5
|
+
after?: string;
|
|
6
|
+
limit?: number;
|
|
7
|
+
}
|
|
8
|
+
export interface SearchOrdersOutput extends Record<string, any> {
|
|
9
|
+
items: any[];
|
|
10
|
+
pageInfo: PageInfo;
|
|
11
|
+
}
|
|
12
|
+
export declare class SearchOrders extends ActionBuilder<AdminApiClient, SearchOrdersInput, SearchOrdersOutput> {
|
|
13
|
+
run(args?: SearchOrdersInput): Promise<SearchOrdersOutput>;
|
|
14
|
+
}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.SearchOrders = void 0;
|
|
13
|
+
const ActionBuilder_1 = require("../../ActionBuilder");
|
|
14
|
+
const handleErrors_1 = require("../../../utils/handleErrors");
|
|
15
|
+
class SearchOrders extends ActionBuilder_1.ActionBuilder {
|
|
16
|
+
run(args) {
|
|
17
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
18
|
+
const { after, limit } = Object.assign({}, args);
|
|
19
|
+
const vLimit = !!limit ? parseInt(limit + '', 10) : 10;
|
|
20
|
+
const query = `
|
|
21
|
+
{
|
|
22
|
+
orders(
|
|
23
|
+
first: ${vLimit},
|
|
24
|
+
reverse: true,
|
|
25
|
+
${after ? `after: "${after}"` : ''}
|
|
26
|
+
) {
|
|
27
|
+
nodes {
|
|
28
|
+
id
|
|
29
|
+
}
|
|
30
|
+
pageInfo {
|
|
31
|
+
hasNextPage
|
|
32
|
+
endCursor
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
`;
|
|
37
|
+
const { data, errors, extensions } = yield this.client.request(query);
|
|
38
|
+
yield (0, handleErrors_1.handleErrors)(errors);
|
|
39
|
+
const { orders } = Object.assign({}, data);
|
|
40
|
+
const { nodes, pageInfo } = Object.assign({}, orders);
|
|
41
|
+
const items = Array.isArray(nodes) ? nodes : [];
|
|
42
|
+
return {
|
|
43
|
+
items,
|
|
44
|
+
pageInfo
|
|
45
|
+
};
|
|
46
|
+
});
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
exports.SearchOrders = SearchOrders;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { APIBase } from "../../APIBase";
|
|
2
|
+
import { GetOrderInput, GetOrderOutput } from "./GetOrder";
|
|
3
|
+
import { AxiosInstance } from "axios";
|
|
4
|
+
export interface RestOrderAPIInterface {
|
|
5
|
+
get(args: GetOrderInput): Promise<GetOrderOutput>;
|
|
6
|
+
}
|
|
7
|
+
export declare class RestOrderAPI extends APIBase<AxiosInstance> implements RestOrderAPIInterface {
|
|
8
|
+
private _runAction;
|
|
9
|
+
get(args?: GetOrderInput): Promise<GetOrderOutput>;
|
|
10
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.RestOrderAPI = void 0;
|
|
13
|
+
const APIBase_1 = require("../../APIBase");
|
|
14
|
+
const GetOrder_1 = require("./GetOrder");
|
|
15
|
+
class RestOrderAPI extends APIBase_1.APIBase {
|
|
16
|
+
_runAction(Action, args) {
|
|
17
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
18
|
+
const action = new Action(this.client);
|
|
19
|
+
return action.run(args);
|
|
20
|
+
});
|
|
21
|
+
}
|
|
22
|
+
get(args) {
|
|
23
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
24
|
+
return this._runAction(GetOrder_1.GetOrder, args);
|
|
25
|
+
});
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
exports.RestOrderAPI = RestOrderAPI;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { AdminApiClient } from "@shopify/admin-api-client/dist/ts/types";
|
|
2
|
+
import { ActionBuilder } from "../../ActionBuilder";
|
|
3
|
+
export interface GetOrderInput extends Record<string, any> {
|
|
4
|
+
id: string;
|
|
5
|
+
}
|
|
6
|
+
export interface GetOrderOutput extends Record<string, any> {
|
|
7
|
+
}
|
|
8
|
+
export declare class GetOrder extends ActionBuilder<AdminApiClient, GetOrderInput, GetOrderOutput> {
|
|
9
|
+
run(args: GetOrderInput): Promise<GetOrderOutput>;
|
|
10
|
+
}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.GetOrder = void 0;
|
|
13
|
+
const ActionBuilder_1 = require("../../ActionBuilder");
|
|
14
|
+
const getGlobalID_1 = require("../../../utils/getGlobalID");
|
|
15
|
+
const handleErrors_1 = require("../../../utils/handleErrors");
|
|
16
|
+
class GetOrder extends ActionBuilder_1.ActionBuilder {
|
|
17
|
+
run(args) {
|
|
18
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
19
|
+
const { id } = args;
|
|
20
|
+
const globalId = (0, getGlobalID_1.getGlobalID)(id, 'Order');
|
|
21
|
+
const query = `
|
|
22
|
+
{
|
|
23
|
+
order(id: "${globalId}") {
|
|
24
|
+
id
|
|
25
|
+
createdAt
|
|
26
|
+
updatedAt
|
|
27
|
+
name
|
|
28
|
+
email
|
|
29
|
+
phone
|
|
30
|
+
shippingAddress {
|
|
31
|
+
name
|
|
32
|
+
countryCodeV2
|
|
33
|
+
}
|
|
34
|
+
displayFulfillmentStatus
|
|
35
|
+
displayFinancialStatus
|
|
36
|
+
totalPriceSet {
|
|
37
|
+
shopMoney {
|
|
38
|
+
amount
|
|
39
|
+
currencyCode
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
`;
|
|
45
|
+
const { data, errors, extensions } = yield this.client.request(query);
|
|
46
|
+
yield (0, handleErrors_1.handleErrors)(errors);
|
|
47
|
+
const { order } = Object.assign({}, data);
|
|
48
|
+
return Object.assign({}, order);
|
|
49
|
+
});
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
exports.GetOrder = GetOrder;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { AdminApiClient } from "@shopify/admin-api-client/dist/ts/types";
|
|
2
|
+
import { ActionBuilder } from "../../ActionBuilder";
|
|
3
|
+
import { PageInfo } from "../../../interfaces/PageInfo";
|
|
4
|
+
export interface SearchOrdersInput extends Record<string, any> {
|
|
5
|
+
after?: string;
|
|
6
|
+
limit?: number;
|
|
7
|
+
}
|
|
8
|
+
export interface SearchOrdersOutput extends Record<string, any> {
|
|
9
|
+
items: any[];
|
|
10
|
+
pageInfo: PageInfo;
|
|
11
|
+
}
|
|
12
|
+
export declare class SearchOrders extends ActionBuilder<AdminApiClient, SearchOrdersInput, SearchOrdersOutput> {
|
|
13
|
+
run(args?: SearchOrdersInput): Promise<SearchOrdersOutput>;
|
|
14
|
+
}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.SearchOrders = void 0;
|
|
13
|
+
const ActionBuilder_1 = require("../../ActionBuilder");
|
|
14
|
+
const handleErrors_1 = require("../../../utils/handleErrors");
|
|
15
|
+
class SearchOrders extends ActionBuilder_1.ActionBuilder {
|
|
16
|
+
run(args) {
|
|
17
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
18
|
+
const { after, limit } = Object.assign({}, args);
|
|
19
|
+
const vLimit = !!limit ? parseInt(limit + '', 10) : 10;
|
|
20
|
+
const query = `
|
|
21
|
+
{
|
|
22
|
+
orders(
|
|
23
|
+
first: ${vLimit},
|
|
24
|
+
reverse: true,
|
|
25
|
+
${after ? `after: "${after}"` : ''}
|
|
26
|
+
) {
|
|
27
|
+
nodes {
|
|
28
|
+
id
|
|
29
|
+
}
|
|
30
|
+
pageInfo {
|
|
31
|
+
hasNextPage
|
|
32
|
+
endCursor
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
`;
|
|
37
|
+
const { data, errors, extensions } = yield this.client.request(query);
|
|
38
|
+
yield (0, handleErrors_1.handleErrors)(errors);
|
|
39
|
+
const { orders } = Object.assign({}, data);
|
|
40
|
+
const { nodes, pageInfo } = Object.assign({}, orders);
|
|
41
|
+
const items = Array.isArray(nodes) ? nodes : [];
|
|
42
|
+
return {
|
|
43
|
+
items,
|
|
44
|
+
pageInfo
|
|
45
|
+
};
|
|
46
|
+
});
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
exports.SearchOrders = SearchOrders;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { AdminApiClient } from "@shopify/admin-api-client/dist/ts/types";
|
|
2
|
+
import { APIBase } from "../../APIBase";
|
|
3
|
+
import { SearchOrdersInput, SearchOrdersOutput } from "./SearchOrders";
|
|
4
|
+
import { GetOrderInput, GetOrderOutput } from "./GetOrder";
|
|
5
|
+
export interface AdminOrderAPIInterface {
|
|
6
|
+
search(args?: SearchOrdersInput): Promise<SearchOrdersOutput>;
|
|
7
|
+
get(args: GetOrderInput): Promise<GetOrderOutput>;
|
|
8
|
+
}
|
|
9
|
+
export declare class AdminOrderAPI extends APIBase<AdminApiClient> implements AdminOrderAPIInterface {
|
|
10
|
+
private _runAction;
|
|
11
|
+
search(args?: SearchOrdersInput): Promise<SearchOrdersOutput>;
|
|
12
|
+
get(args?: GetOrderInput): Promise<GetOrderOutput>;
|
|
13
|
+
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.AdminOrderAPI = void 0;
|
|
13
|
+
const APIBase_1 = require("../../APIBase");
|
|
14
|
+
const SearchOrders_1 = require("./SearchOrders");
|
|
15
|
+
const GetOrder_1 = require("./GetOrder");
|
|
16
|
+
class AdminOrderAPI extends APIBase_1.APIBase {
|
|
17
|
+
_runAction(Action, args) {
|
|
18
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
19
|
+
const action = new Action(this.client);
|
|
20
|
+
return action.run(args);
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
search(args) {
|
|
24
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
25
|
+
return this._runAction(SearchOrders_1.SearchOrders, args);
|
|
26
|
+
});
|
|
27
|
+
}
|
|
28
|
+
get(args) {
|
|
29
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
30
|
+
return this._runAction(GetOrder_1.GetOrder, args);
|
|
31
|
+
});
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
exports.AdminOrderAPI = AdminOrderAPI;
|
package/dist/index.d.ts
CHANGED
package/dist/index.js
CHANGED
|
@@ -14,6 +14,6 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
14
14
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
__exportStar(require("./classes/ShopifyAPI"), exports);
|
|
18
17
|
__exportStar(require("./classes/StorefrontAPI"), exports);
|
|
19
18
|
__exportStar(require("./classes/AdminAPI"), exports);
|
|
19
|
+
__exportStar(require("./classes/RestAPI"), exports);
|
|
File without changes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const parseOnlyId: (id: string) => string;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.parseOnlyId = void 0;
|
|
4
|
+
const parseOnlyId = (id) => {
|
|
5
|
+
const lastStr = (id || '').split('/')
|
|
6
|
+
.pop();
|
|
7
|
+
return (lastStr || '').trim();
|
|
8
|
+
};
|
|
9
|
+
exports.parseOnlyId = parseOnlyId;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pintahub/shopify-api",
|
|
3
|
-
"version": "1.4.
|
|
3
|
+
"version": "1.4.7",
|
|
4
4
|
"description": "",
|
|
5
5
|
"types": "dist/index.d.ts",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -14,6 +14,7 @@
|
|
|
14
14
|
},
|
|
15
15
|
"dependencies": {
|
|
16
16
|
"@shopify/admin-api-client": "^0.1.0",
|
|
17
|
-
"@shopify/storefront-api-client": "^0.1.1"
|
|
17
|
+
"@shopify/storefront-api-client": "^0.1.1",
|
|
18
|
+
"axios": "^1.6.7"
|
|
18
19
|
}
|
|
19
20
|
}
|