@builtbystack/sq-shopify-theme-sdk 0.0.1
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.
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* LocationAvailabilities は LocationAvailability の一覧を取得するための情報を表す。
|
|
3
|
+
*/
|
|
4
|
+
export declare type LocationAvailabilities = {
|
|
5
|
+
nodes: LocationAvailability[];
|
|
6
|
+
pageInfo: PageInfo | null;
|
|
7
|
+
};
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* LocationAvailability はLocationの在庫情報を表す。
|
|
11
|
+
*/
|
|
12
|
+
export declare type LocationAvailability = {
|
|
13
|
+
/**
|
|
14
|
+
* location は在庫のLocationを表す。
|
|
15
|
+
*/
|
|
16
|
+
location: {
|
|
17
|
+
/**
|
|
18
|
+
* name はLocationの名前を表す。
|
|
19
|
+
*/
|
|
20
|
+
name: string;
|
|
21
|
+
};
|
|
22
|
+
/**
|
|
23
|
+
* inventoryQuantity は在庫数を表す。
|
|
24
|
+
*/
|
|
25
|
+
inventoryQuantity: number;
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* PageInfo はページングを伴って一覧を取得したときに、その一覧のページングの情報を表す。
|
|
30
|
+
*/
|
|
31
|
+
export declare type PageInfo = {
|
|
32
|
+
/**
|
|
33
|
+
* startCursor は一覧の先頭のカーソルを表す。
|
|
34
|
+
*/
|
|
35
|
+
startCursor: string;
|
|
36
|
+
/**
|
|
37
|
+
* endCursor は一覧の末尾のカーソルを表す。
|
|
38
|
+
* このカーソルを使って次のページを取得することができる。
|
|
39
|
+
*/
|
|
40
|
+
endCursor: string;
|
|
41
|
+
/**
|
|
42
|
+
* hasNextPage は次のページがあるかどうかを表す。
|
|
43
|
+
*/
|
|
44
|
+
hasNextPage: boolean;
|
|
45
|
+
/**
|
|
46
|
+
* hasPreviousPage は前のページがあるかどうかを表す。
|
|
47
|
+
*/
|
|
48
|
+
hasPreviousPage: boolean;
|
|
49
|
+
};
|
|
50
|
+
|
|
51
|
+
/**
|
|
52
|
+
* Points は SDK から取得できるポイントの情報を表す。
|
|
53
|
+
*/
|
|
54
|
+
export declare type Points = {
|
|
55
|
+
pointsApproved: number;
|
|
56
|
+
pointsPending: number;
|
|
57
|
+
};
|
|
58
|
+
|
|
59
|
+
/**
|
|
60
|
+
* PurchasingCustomerMetafield は購入者のカスタムメタフィールドを表す。
|
|
61
|
+
*/
|
|
62
|
+
export declare type PurchasingCustomerMetafield = {
|
|
63
|
+
id: string;
|
|
64
|
+
namespace: string;
|
|
65
|
+
key: string;
|
|
66
|
+
value: string;
|
|
67
|
+
};
|
|
68
|
+
|
|
69
|
+
export declare class SDK {
|
|
70
|
+
private api;
|
|
71
|
+
constructor(apiURL: string);
|
|
72
|
+
/**
|
|
73
|
+
* getLocationAvailabilities は渡されたSKUの各ロケーションにおける残り在庫の一覧を返します。
|
|
74
|
+
*
|
|
75
|
+
* @param {string} sku 在庫一覧を取得したい商品のSKU。
|
|
76
|
+
* @param {number} [first] 取得してくる個数。デフォルトは250。
|
|
77
|
+
* @param {string} [before] ページングの値。指定しない場合先頭から取得してくる。
|
|
78
|
+
* @param {boolean} [isReverse] 並び順。デフォルトはfalse。
|
|
79
|
+
*/
|
|
80
|
+
getLocationAvailabilities(sku: string, first?: number, after?: string, isReverse?: boolean): Promise<LocationAvailabilities>;
|
|
81
|
+
/**
|
|
82
|
+
* getLocationAvailability は渡されたSKUとLocationIDにおける在庫情報を返します。
|
|
83
|
+
* @param {string} sku 在庫情報を取得したい商品のSKU。
|
|
84
|
+
* @param {string} locationID 在庫情報を取得したいLocationのID。
|
|
85
|
+
*/
|
|
86
|
+
getLocationAvailability(sku: string, locationID: string): Promise<LocationAvailability>;
|
|
87
|
+
/**
|
|
88
|
+
* getPurchasingCustomerMetafield は渡されたnamespaceとkeyに一致する現在ログインしているCustomerのカスタムメタフィールドを返します。
|
|
89
|
+
* 存在しない場合はnullを返します。
|
|
90
|
+
*
|
|
91
|
+
* @param {string} namespace 取得したいメタフィールドのnamespace。
|
|
92
|
+
* @param {string} key 取得したいメタフィールドのkey。
|
|
93
|
+
*/
|
|
94
|
+
getPurchasingCustomerMetafield(namespace: string, key: string): Promise<PurchasingCustomerMetafield | null>;
|
|
95
|
+
/**
|
|
96
|
+
* getPoints は、現在の保有ポイントと、獲得予定ポイントを返します。
|
|
97
|
+
* 存在しない場合は0を返します。
|
|
98
|
+
*/
|
|
99
|
+
getPoints(): Promise<Points | null>;
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
export { }
|