@builtbystack/sq-shopify-theme-sdk 0.0.18 → 0.0.20
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.doc.md +7 -0
- package/README.md +155 -0
- package/dist/sq-shopify-theme-sdk.d.ts +50 -0
- package/dist/sq-shopify-theme-sdk.js +260 -192
- package/dist/sq-shopify-theme-sdk.umd.js +59 -29
- package/package.json +2 -4
package/README.doc.md
CHANGED
|
@@ -4,6 +4,13 @@
|
|
|
4
4
|
|
|
5
5
|
`@x.x.x` で指定されているバージョンは適宜最新のものを利用してください。
|
|
6
6
|
|
|
7
|
+
SDKは名前空間 `SQ` 内に存在するため、SDKの初期化は `new SQ.SDK()` で行ってください。
|
|
8
|
+
|
|
7
9
|
```html
|
|
8
10
|
<script src="https://unpkg.com/@builtbystack/sq-shopify-theme-sdk@x.x.x/dist/sq-shopify-theme-sdk.umd.js" defer></script>
|
|
11
|
+
<script type="text/javascript">
|
|
12
|
+
window.onload = async () => {
|
|
13
|
+
const sdk = new SQ.SDK({{ request.origin | json }});
|
|
14
|
+
}
|
|
15
|
+
</script>
|
|
9
16
|
```
|
package/README.md
CHANGED
|
@@ -11,8 +11,15 @@
|
|
|
11
11
|
|
|
12
12
|
`@x.x.x` で指定されているバージョンは適宜最新のものを利用してください。
|
|
13
13
|
|
|
14
|
+
SDKは名前空間 `SQ` 内に存在するため、SDKの初期化は `new SQ.SDK()` で行ってください。
|
|
15
|
+
|
|
14
16
|
```html
|
|
15
17
|
<script src="https://unpkg.com/@builtbystack/sq-shopify-theme-sdk@x.x.x/dist/sq-shopify-theme-sdk.umd.js" defer></script>
|
|
18
|
+
<script type="text/javascript">
|
|
19
|
+
window.onload = async () => {
|
|
20
|
+
const sdk = new SQ.SDK({{ request.origin | json }});
|
|
21
|
+
}
|
|
22
|
+
</script>
|
|
16
23
|
```
|
|
17
24
|
|
|
18
25
|
# Classes
|
|
@@ -165,6 +172,28 @@ getPoints は、現在の保有ポイントと、獲得予定ポイントを返
|
|
|
165
172
|
|
|
166
173
|
***
|
|
167
174
|
|
|
175
|
+
#### getProduct()
|
|
176
|
+
|
|
177
|
+
> **getProduct**(`id`, `first`?, `after`?, `isReverse`?, `sortKeys`?): `Promise`\<`null` \| [`Product`](#type-aliasesproductmd)\>
|
|
178
|
+
|
|
179
|
+
##### Parameters
|
|
180
|
+
|
|
181
|
+
• **id**: `string`
|
|
182
|
+
|
|
183
|
+
• **first?**: `number`
|
|
184
|
+
|
|
185
|
+
• **after?**: `string`
|
|
186
|
+
|
|
187
|
+
• **isReverse?**: `boolean`
|
|
188
|
+
|
|
189
|
+
• **sortKeys?**: `ProductVariantSortKeys`
|
|
190
|
+
|
|
191
|
+
##### Returns
|
|
192
|
+
|
|
193
|
+
`Promise`\<`null` \| [`Product`](#type-aliasesproductmd)\>
|
|
194
|
+
|
|
195
|
+
***
|
|
196
|
+
|
|
168
197
|
#### getPurchasingCustomerCurrentRank()
|
|
169
198
|
|
|
170
199
|
> **getPurchasingCustomerCurrentRank**(): `Promise`\<`null` \| [`CustomerRank`](#type-aliasescustomerrankmd)\>
|
|
@@ -311,6 +340,7 @@ purchasingCustomerSendCustomerSharingActivationCode はログインしている
|
|
|
311
340
|
- [CustomerRankCalculationPeriod](#type-aliasescustomerrankcalculationperiodmd)
|
|
312
341
|
- [CustomerRankRule](#type-aliasescustomerrankrulemd)
|
|
313
342
|
- [CustomerSharingActivationCode](#type-aliasescustomersharingactivationcodemd)
|
|
343
|
+
- [InventoryItem](#type-aliasesinventoryitemmd)
|
|
314
344
|
- [Location](#type-aliaseslocationmd)
|
|
315
345
|
- [LocationAvailabilities](#type-aliaseslocationavailabilitiesmd)
|
|
316
346
|
- [LocationAvailability](#type-aliaseslocationavailabilitymd)
|
|
@@ -321,6 +351,9 @@ purchasingCustomerSendCustomerSharingActivationCode はログインしている
|
|
|
321
351
|
- [PointChangeActivity](#type-aliasespointchangeactivitymd)
|
|
322
352
|
- [PointMultiplierCustomerRankRule](#type-aliasespointmultipliercustomerrankrulemd)
|
|
323
353
|
- [Points](#type-aliasespointsmd)
|
|
354
|
+
- [Product](#type-aliasesproductmd)
|
|
355
|
+
- [ProductVariant](#type-aliasesproductvariantmd)
|
|
356
|
+
- [ProductVariants](#type-aliasesproductvariantsmd)
|
|
324
357
|
- [PurchasingCustomer](#type-aliasespurchasingcustomermd)
|
|
325
358
|
- [PurchasingCustomerDiscount](#type-aliasespurchasingcustomerdiscountmd)
|
|
326
359
|
- [PurchasingCustomerDiscounts](#type-aliasespurchasingcustomerdiscountsmd)
|
|
@@ -573,6 +606,31 @@ CustomerRankRule は会員ランクのルールを表す。
|
|
|
573
606
|
> **purchasingCustomer**: [`PurchasingCustomer`](#type-aliasespurchasingcustomermd)
|
|
574
607
|
|
|
575
608
|
|
|
609
|
+
<a name="type-aliasesinventoryitemmd"></a>
|
|
610
|
+
|
|
611
|
+
[**@builtbystack/sq-shopify-theme-sdk**](#readmemd) • **Docs**
|
|
612
|
+
|
|
613
|
+
***
|
|
614
|
+
|
|
615
|
+
[@builtbystack/sq-shopify-theme-sdk](#globalsmd) / InventoryItem
|
|
616
|
+
|
|
617
|
+
## Type Alias: InventoryItem
|
|
618
|
+
|
|
619
|
+
> **InventoryItem**: `object`
|
|
620
|
+
|
|
621
|
+
InventoryItem は在庫情報を表す。
|
|
622
|
+
|
|
623
|
+
### Type declaration
|
|
624
|
+
|
|
625
|
+
#### id
|
|
626
|
+
|
|
627
|
+
> **id**: `string`
|
|
628
|
+
|
|
629
|
+
#### sku
|
|
630
|
+
|
|
631
|
+
> **sku**: `string`
|
|
632
|
+
|
|
633
|
+
|
|
576
634
|
<a name="type-aliaseslocationmd"></a>
|
|
577
635
|
|
|
578
636
|
[**@builtbystack/sq-shopify-theme-sdk**](#readmemd) • **Docs**
|
|
@@ -915,6 +973,103 @@ PointsApproved は保有ポイントを表す。
|
|
|
915
973
|
PointsPending は獲得予定ポイントを表す。
|
|
916
974
|
|
|
917
975
|
|
|
976
|
+
<a name="type-aliasesproductmd"></a>
|
|
977
|
+
|
|
978
|
+
[**@builtbystack/sq-shopify-theme-sdk**](#readmemd) • **Docs**
|
|
979
|
+
|
|
980
|
+
***
|
|
981
|
+
|
|
982
|
+
[@builtbystack/sq-shopify-theme-sdk](#globalsmd) / Product
|
|
983
|
+
|
|
984
|
+
## Type Alias: Product
|
|
985
|
+
|
|
986
|
+
> **Product**: `object`
|
|
987
|
+
|
|
988
|
+
Product は商品情報を表す。
|
|
989
|
+
|
|
990
|
+
### Type declaration
|
|
991
|
+
|
|
992
|
+
#### hasBackOrderProductVariants
|
|
993
|
+
|
|
994
|
+
> **hasBackOrderProductVariants**: `boolean`
|
|
995
|
+
|
|
996
|
+
商品が持つバリエーションに1つでも予約販売設定がされている場合trueが返る
|
|
997
|
+
|
|
998
|
+
#### id
|
|
999
|
+
|
|
1000
|
+
> **id**: `string`
|
|
1001
|
+
|
|
1002
|
+
#### title
|
|
1003
|
+
|
|
1004
|
+
> **title**: `string`
|
|
1005
|
+
|
|
1006
|
+
商品のタイトル
|
|
1007
|
+
|
|
1008
|
+
#### variants
|
|
1009
|
+
|
|
1010
|
+
> **variants**: [`ProductVariants`](#type-aliasesproductvariantsmd)
|
|
1011
|
+
|
|
1012
|
+
商品のバリエーション一覧
|
|
1013
|
+
|
|
1014
|
+
|
|
1015
|
+
<a name="type-aliasesproductvariantmd"></a>
|
|
1016
|
+
|
|
1017
|
+
[**@builtbystack/sq-shopify-theme-sdk**](#readmemd) • **Docs**
|
|
1018
|
+
|
|
1019
|
+
***
|
|
1020
|
+
|
|
1021
|
+
[@builtbystack/sq-shopify-theme-sdk](#globalsmd) / ProductVariant
|
|
1022
|
+
|
|
1023
|
+
## Type Alias: ProductVariant
|
|
1024
|
+
|
|
1025
|
+
> **ProductVariant**: `object`
|
|
1026
|
+
|
|
1027
|
+
ProductVariant は商品のバリエーションを表す。
|
|
1028
|
+
|
|
1029
|
+
### Type declaration
|
|
1030
|
+
|
|
1031
|
+
#### id
|
|
1032
|
+
|
|
1033
|
+
> **id**: `string`
|
|
1034
|
+
|
|
1035
|
+
#### inventoryItem
|
|
1036
|
+
|
|
1037
|
+
> **inventoryItem**: [`InventoryItem`](#type-aliasesinventoryitemmd)
|
|
1038
|
+
|
|
1039
|
+
#### isBackOrderEnable
|
|
1040
|
+
|
|
1041
|
+
> **isBackOrderEnable**: `boolean`
|
|
1042
|
+
|
|
1043
|
+
#### title
|
|
1044
|
+
|
|
1045
|
+
> **title**: `string`
|
|
1046
|
+
|
|
1047
|
+
|
|
1048
|
+
<a name="type-aliasesproductvariantsmd"></a>
|
|
1049
|
+
|
|
1050
|
+
[**@builtbystack/sq-shopify-theme-sdk**](#readmemd) • **Docs**
|
|
1051
|
+
|
|
1052
|
+
***
|
|
1053
|
+
|
|
1054
|
+
[@builtbystack/sq-shopify-theme-sdk](#globalsmd) / ProductVariants
|
|
1055
|
+
|
|
1056
|
+
## Type Alias: ProductVariants
|
|
1057
|
+
|
|
1058
|
+
> **ProductVariants**: `object`
|
|
1059
|
+
|
|
1060
|
+
ProductVariants は商品のバリエーションの一覧を取得するための情報を表す。
|
|
1061
|
+
|
|
1062
|
+
### Type declaration
|
|
1063
|
+
|
|
1064
|
+
#### nodes
|
|
1065
|
+
|
|
1066
|
+
> **nodes**: [`ProductVariant`](#type-aliasesproductvariantmd)[]
|
|
1067
|
+
|
|
1068
|
+
#### pageInfo
|
|
1069
|
+
|
|
1070
|
+
> **pageInfo**: [`PageInfo`](#type-aliasespageinfomd)
|
|
1071
|
+
|
|
1072
|
+
|
|
918
1073
|
<a name="type-aliasespurchasingcustomermd"></a>
|
|
919
1074
|
|
|
920
1075
|
[**@builtbystack/sq-shopify-theme-sdk**](#readmemd) • **Docs**
|
|
@@ -104,6 +104,14 @@ export declare type CustomerSharingActivationCode = {
|
|
|
104
104
|
customerSharingActivationCodeID: string;
|
|
105
105
|
};
|
|
106
106
|
|
|
107
|
+
/**
|
|
108
|
+
* InventoryItem は在庫情報を表す。
|
|
109
|
+
*/
|
|
110
|
+
export declare type InventoryItem = {
|
|
111
|
+
id: string;
|
|
112
|
+
sku: string;
|
|
113
|
+
};
|
|
114
|
+
|
|
107
115
|
/**
|
|
108
116
|
* Location は ShopifyIntegration に紐付いている Location を表す。
|
|
109
117
|
*/
|
|
@@ -252,6 +260,47 @@ export declare type Points = {
|
|
|
252
260
|
pointsPending: number;
|
|
253
261
|
};
|
|
254
262
|
|
|
263
|
+
/**
|
|
264
|
+
* Product は商品情報を表す。
|
|
265
|
+
*/
|
|
266
|
+
export declare type Product = {
|
|
267
|
+
id: string;
|
|
268
|
+
/**
|
|
269
|
+
* 商品のタイトル
|
|
270
|
+
*/
|
|
271
|
+
title: string;
|
|
272
|
+
/**
|
|
273
|
+
* 商品が持つバリエーションに1つでも予約販売設定がされている場合trueが返る
|
|
274
|
+
*/
|
|
275
|
+
hasBackOrderProductVariants: boolean;
|
|
276
|
+
/**
|
|
277
|
+
* 商品のバリエーション一覧
|
|
278
|
+
*/
|
|
279
|
+
variants: ProductVariants;
|
|
280
|
+
};
|
|
281
|
+
|
|
282
|
+
/**
|
|
283
|
+
* ProductVariant は商品のバリエーションを表す。
|
|
284
|
+
*/
|
|
285
|
+
export declare type ProductVariant = {
|
|
286
|
+
id: string;
|
|
287
|
+
title: string;
|
|
288
|
+
isBackOrderEnable: boolean;
|
|
289
|
+
inventoryItem: InventoryItem;
|
|
290
|
+
};
|
|
291
|
+
|
|
292
|
+
/**
|
|
293
|
+
* ProductVariants は商品のバリエーションの一覧を取得するための情報を表す。
|
|
294
|
+
*/
|
|
295
|
+
export declare type ProductVariants = {
|
|
296
|
+
nodes: ProductVariant[];
|
|
297
|
+
pageInfo: PageInfo;
|
|
298
|
+
};
|
|
299
|
+
|
|
300
|
+
declare enum ProductVariantSortKeys {
|
|
301
|
+
CreatedAt = "CREATED_AT"
|
|
302
|
+
}
|
|
303
|
+
|
|
255
304
|
export declare type PurchasingCustomer = {
|
|
256
305
|
id: string;
|
|
257
306
|
sharingPurchasingCustomerCount: number;
|
|
@@ -380,6 +429,7 @@ export declare class SDK {
|
|
|
380
429
|
* getPurchasingCustomerSharing は共有化している顧客情報を返します。
|
|
381
430
|
*/
|
|
382
431
|
getPurchasingCustomerSharing(): Promise<PurchasingCustomerSharing | null>;
|
|
432
|
+
getProduct(id: string, first?: number, after?: string, isReverse?: boolean, sortKeys?: ProductVariantSortKeys): Promise<Product | null>;
|
|
383
433
|
/**
|
|
384
434
|
* purchasingCustomerSendCustomerSharingActivationCode はログインしているアカウントのメールアドレスに顧客情報共有のためのアクティベーションコードを送信します。
|
|
385
435
|
*/
|