@builtbystack/sq-shopify-theme-sdk 0.0.24 → 0.0.27
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.md +152 -13
- package/dist/sq-shopify-theme-sdk.d.ts +77 -6
- package/dist/sq-shopify-theme-sdk.js +359 -306
- package/dist/sq-shopify-theme-sdk.umd.js +72 -50
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -145,20 +145,12 @@ getLocationAvailability は渡されたSKUとLocationIDにおける在庫情報
|
|
|
145
145
|
|
|
146
146
|
#### getLocations()
|
|
147
147
|
|
|
148
|
-
> **getLocations**(`
|
|
148
|
+
> **getLocations**(`first`?, `after`?, `locationFilter`?, `isReverse`?): `Promise`\<[`Locations`](#type-aliaseslocationsmd)\>
|
|
149
149
|
|
|
150
150
|
getLocations は ShopifyIntegration に紐づく LocationGroup の Location の一覧を取得します。
|
|
151
151
|
|
|
152
152
|
##### Parameters
|
|
153
153
|
|
|
154
|
-
• **tag?**: `string`
|
|
155
|
-
|
|
156
|
-
取得したいLocationのタグ。
|
|
157
|
-
|
|
158
|
-
• **provinceCodes?**: `string`[]
|
|
159
|
-
|
|
160
|
-
取得したいLocationの都道府県コード。
|
|
161
|
-
|
|
162
154
|
• **first?**: `number`
|
|
163
155
|
|
|
164
156
|
取得してくる個数。デフォルトは250。
|
|
@@ -167,6 +159,10 @@ getLocations は ShopifyIntegration に紐づく LocationGroup の Location の
|
|
|
167
159
|
|
|
168
160
|
ページングの値。指定しない場合先頭から取得してくる。
|
|
169
161
|
|
|
162
|
+
• **locationFilter?**: [`LocationFilter`](#type-aliaseslocationfiltermd)
|
|
163
|
+
|
|
164
|
+
ロケーションのロケーションのフィルタリング条件。
|
|
165
|
+
|
|
170
166
|
• **isReverse?**: `boolean`
|
|
171
167
|
|
|
172
168
|
並び順。デフォルトはfalse。
|
|
@@ -221,8 +217,7 @@ getPointChangeActivities は購入者のポイント変動履歴を返します
|
|
|
221
217
|
|
|
222
218
|
> **getPoints**(): `Promise`\<`null` \| [`Points`](#type-aliasespointsmd)\>
|
|
223
219
|
|
|
224
|
-
getPoints
|
|
225
|
-
存在しない場合は0を返します。
|
|
220
|
+
getPoints は、Points は SDK から取得できるポイントの情報を返します。
|
|
226
221
|
|
|
227
222
|
##### Returns
|
|
228
223
|
|
|
@@ -411,6 +406,35 @@ CurrencyCode は通貨コードを表す
|
|
|
411
406
|
> **Usd**: `"USD"`
|
|
412
407
|
|
|
413
408
|
|
|
409
|
+
<a name="enumerationslocationtypemd"></a>
|
|
410
|
+
|
|
411
|
+
[**@builtbystack/sq-shopify-theme-sdk**](#readmemd) • **Docs**
|
|
412
|
+
|
|
413
|
+
***
|
|
414
|
+
|
|
415
|
+
[@builtbystack/sq-shopify-theme-sdk](#globalsmd) / LocationType
|
|
416
|
+
|
|
417
|
+
## Enumeration: LocationType
|
|
418
|
+
|
|
419
|
+
LocationType はロケーションの種別を表す
|
|
420
|
+
|
|
421
|
+
### Enumeration Members
|
|
422
|
+
|
|
423
|
+
#### Retail
|
|
424
|
+
|
|
425
|
+
> **Retail**: `"RETAIL"`
|
|
426
|
+
|
|
427
|
+
店舗
|
|
428
|
+
|
|
429
|
+
***
|
|
430
|
+
|
|
431
|
+
#### Warehouse
|
|
432
|
+
|
|
433
|
+
> **Warehouse**: `"WAREHOUSE"`
|
|
434
|
+
|
|
435
|
+
倉庫
|
|
436
|
+
|
|
437
|
+
|
|
414
438
|
<a name="globalsmd"></a>
|
|
415
439
|
|
|
416
440
|
[**@builtbystack/sq-shopify-theme-sdk**](#readmemd) • **Docs**
|
|
@@ -422,6 +446,7 @@ CurrencyCode は通貨コードを表す
|
|
|
422
446
|
## Enumerations
|
|
423
447
|
|
|
424
448
|
- [CurrencyCode](#enumerationscurrencycodemd)
|
|
449
|
+
- [LocationType](#enumerationslocationtypemd)
|
|
425
450
|
|
|
426
451
|
## Classes
|
|
427
452
|
|
|
@@ -437,10 +462,12 @@ CurrencyCode は通貨コードを表す
|
|
|
437
462
|
- [CustomerRankRule](#type-aliasescustomerrankrulemd)
|
|
438
463
|
- [CustomerSharingActivationCode](#type-aliasescustomersharingactivationcodemd)
|
|
439
464
|
- [EstimatedPoint](#type-aliasesestimatedpointmd)
|
|
465
|
+
- [EstimatedPointCampaign](#type-aliasesestimatedpointcampaignmd)
|
|
440
466
|
- [InventoryItem](#type-aliasesinventoryitemmd)
|
|
441
467
|
- [Location](#type-aliaseslocationmd)
|
|
442
468
|
- [LocationAvailabilities](#type-aliaseslocationavailabilitiesmd)
|
|
443
469
|
- [LocationAvailability](#type-aliaseslocationavailabilitymd)
|
|
470
|
+
- [LocationFilter](#type-aliaseslocationfiltermd)
|
|
444
471
|
- [Locations](#type-aliaseslocationsmd)
|
|
445
472
|
- [PageInfo](#type-aliasespageinfomd)
|
|
446
473
|
- [PointCampaignOrderRule](#type-aliasespointcampaignorderrulemd)
|
|
@@ -756,9 +783,49 @@ EstimatedPoint は獲得予想ポイントを表す
|
|
|
756
783
|
|
|
757
784
|
### Type declaration
|
|
758
785
|
|
|
759
|
-
####
|
|
786
|
+
#### pointCampaign?
|
|
787
|
+
|
|
788
|
+
> `optional` **pointCampaign**: [`EstimatedPointCampaign`](#type-aliasesestimatedpointcampaignmd)
|
|
789
|
+
|
|
790
|
+
適用されるポイントキャンペーン
|
|
791
|
+
注文日時に開催期間内で条件を満たすキャンペーンが存在しなかった場合はnilを返す
|
|
792
|
+
カートの場合、明細ごとのポイント計算ロジック内でポイントが加算されるため、ポイントキャンペーンの種別が「商品」の場合もnilを返す
|
|
793
|
+
商品に適用されるポイントキャンペーンはgetEstimatedShopifyCartLineItemPointから取得が可能
|
|
794
|
+
|
|
795
|
+
#### pointsEarning
|
|
796
|
+
|
|
797
|
+
> **pointsEarning**: `number`
|
|
798
|
+
|
|
799
|
+
ポイントキャンペーン適用前の獲得予想ポイント
|
|
800
|
+
|
|
801
|
+
#### totalPointsEarning
|
|
802
|
+
|
|
803
|
+
> **totalPointsEarning**: `number`
|
|
804
|
+
|
|
805
|
+
ポイントキャンペーン適用後の獲得予想ポイント
|
|
806
|
+
|
|
807
|
+
|
|
808
|
+
<a name="type-aliasesestimatedpointcampaignmd"></a>
|
|
809
|
+
|
|
810
|
+
[**@builtbystack/sq-shopify-theme-sdk**](#readmemd) • **Docs**
|
|
811
|
+
|
|
812
|
+
***
|
|
813
|
+
|
|
814
|
+
[@builtbystack/sq-shopify-theme-sdk](#globalsmd) / EstimatedPointCampaign
|
|
815
|
+
|
|
816
|
+
## Type Alias: EstimatedPointCampaign
|
|
817
|
+
|
|
818
|
+
> **EstimatedPointCampaign**: `object`
|
|
819
|
+
|
|
820
|
+
### Type declaration
|
|
821
|
+
|
|
822
|
+
#### pointCampaignOrderRule
|
|
823
|
+
|
|
824
|
+
> **pointCampaignOrderRule**: [`PointCampaignOrderRule`](#type-aliasespointcampaignorderrulemd)
|
|
825
|
+
|
|
826
|
+
#### pointsEarning
|
|
760
827
|
|
|
761
|
-
> **
|
|
828
|
+
> **pointsEarning**: `number`
|
|
762
829
|
|
|
763
830
|
|
|
764
831
|
<a name="type-aliasesinventoryitemmd"></a>
|
|
@@ -881,6 +948,41 @@ inventoryQuantity は在庫数を表す。
|
|
|
881
948
|
location は在庫のLocationを表す。
|
|
882
949
|
|
|
883
950
|
|
|
951
|
+
<a name="type-aliaseslocationfiltermd"></a>
|
|
952
|
+
|
|
953
|
+
[**@builtbystack/sq-shopify-theme-sdk**](#readmemd) • **Docs**
|
|
954
|
+
|
|
955
|
+
***
|
|
956
|
+
|
|
957
|
+
[@builtbystack/sq-shopify-theme-sdk](#globalsmd) / LocationFilter
|
|
958
|
+
|
|
959
|
+
## Type Alias: LocationFilter
|
|
960
|
+
|
|
961
|
+
> **LocationFilter**: `object`
|
|
962
|
+
|
|
963
|
+
LocationType はロケーションのフィルタリング条件を表現するオブジェクト
|
|
964
|
+
|
|
965
|
+
### Type declaration
|
|
966
|
+
|
|
967
|
+
#### locationType?
|
|
968
|
+
|
|
969
|
+
> `optional` **locationType**: [`LocationType`](#enumerationslocationtypemd)
|
|
970
|
+
|
|
971
|
+
ロケーションの種別
|
|
972
|
+
|
|
973
|
+
#### provinceCodes?
|
|
974
|
+
|
|
975
|
+
> `optional` **provinceCodes**: `string`[]
|
|
976
|
+
|
|
977
|
+
ロケーションの都道府県コード
|
|
978
|
+
|
|
979
|
+
#### tag?
|
|
980
|
+
|
|
981
|
+
> `optional` **tag**: `string`
|
|
982
|
+
|
|
983
|
+
ロケーションのタグ
|
|
984
|
+
|
|
985
|
+
|
|
884
986
|
<a name="type-aliaseslocationsmd"></a>
|
|
885
987
|
|
|
886
988
|
[**@builtbystack/sq-shopify-theme-sdk**](#readmemd) • **Docs**
|
|
@@ -968,6 +1070,18 @@ PointCampaignOrderRule はポイントキャンペーンの設定を表す。
|
|
|
968
1070
|
|
|
969
1071
|
> **id**: `string`
|
|
970
1072
|
|
|
1073
|
+
#### pointMethod
|
|
1074
|
+
|
|
1075
|
+
> **pointMethod**: `string`
|
|
1076
|
+
|
|
1077
|
+
キャンペーンポイントの計算方法
|
|
1078
|
+
|
|
1079
|
+
#### targetType
|
|
1080
|
+
|
|
1081
|
+
> **targetType**: `string`
|
|
1082
|
+
|
|
1083
|
+
キャンペーンポイント付与対象の種別
|
|
1084
|
+
|
|
971
1085
|
#### title
|
|
972
1086
|
|
|
973
1087
|
> **title**: `string`
|
|
@@ -1197,6 +1311,31 @@ Points は SDK から取得できるポイントの情報を表す。
|
|
|
1197
1311
|
|
|
1198
1312
|
PointsApproved は保有ポイントを表す。
|
|
1199
1313
|
|
|
1314
|
+
#### pointsExpiringSoon?
|
|
1315
|
+
|
|
1316
|
+
> `optional` **pointsExpiringSoon**: `object`
|
|
1317
|
+
|
|
1318
|
+
PointsExpiringSoon は最も直近の失効予定ポイントを表す。
|
|
1319
|
+
|
|
1320
|
+
#### pointsExpiringSoon.availableUntil
|
|
1321
|
+
|
|
1322
|
+
> **availableUntil**: `Date`
|
|
1323
|
+
|
|
1324
|
+
availableUntil は最も直近の失効予定ポイントが利用できる期限を表す。失効する直前を表すため、expiresDate から1ナノ秒を引いた値となる。
|
|
1325
|
+
例えば、expiresDate が 2024-06-12 00:00:00 なら、availableUntil は 2024-06-11 23:59:59.999999999 となる。
|
|
1326
|
+
|
|
1327
|
+
#### pointsExpiringSoon.expiresDate
|
|
1328
|
+
|
|
1329
|
+
> **expiresDate**: `Date`
|
|
1330
|
+
|
|
1331
|
+
expiresDate は最も直近の失効日を表す。
|
|
1332
|
+
|
|
1333
|
+
#### pointsExpiringSoon.points
|
|
1334
|
+
|
|
1335
|
+
> **points**: `number`
|
|
1336
|
+
|
|
1337
|
+
points は最も直近の失効予定ポイントを表す。
|
|
1338
|
+
|
|
1200
1339
|
#### pointsPending
|
|
1201
1340
|
|
|
1202
1341
|
> **pointsPending**: `number`
|
|
@@ -135,7 +135,26 @@ export declare type CustomerSharingActivationCode = {
|
|
|
135
135
|
* EstimatedPoint は獲得予想ポイントを表す
|
|
136
136
|
*/
|
|
137
137
|
export declare type EstimatedPoint = {
|
|
138
|
-
|
|
138
|
+
/**
|
|
139
|
+
* ポイントキャンペーン適用前の獲得予想ポイント
|
|
140
|
+
*/
|
|
141
|
+
pointsEarning: number;
|
|
142
|
+
/**
|
|
143
|
+
* ポイントキャンペーン適用後の獲得予想ポイント
|
|
144
|
+
*/
|
|
145
|
+
totalPointsEarning: number;
|
|
146
|
+
/**
|
|
147
|
+
* 適用されるポイントキャンペーン
|
|
148
|
+
* 注文日時に開催期間内で条件を満たすキャンペーンが存在しなかった場合はnilを返す
|
|
149
|
+
* カートの場合、明細ごとのポイント計算ロジック内でポイントが加算されるため、ポイントキャンペーンの種別が「商品」の場合もnilを返す
|
|
150
|
+
* 商品に適用されるポイントキャンペーンはgetEstimatedShopifyCartLineItemPointから取得が可能
|
|
151
|
+
*/
|
|
152
|
+
pointCampaign?: EstimatedPointCampaign;
|
|
153
|
+
};
|
|
154
|
+
|
|
155
|
+
export declare type EstimatedPointCampaign = {
|
|
156
|
+
pointsEarning: number;
|
|
157
|
+
pointCampaignOrderRule: PointCampaignOrderRule;
|
|
139
158
|
};
|
|
140
159
|
|
|
141
160
|
/**
|
|
@@ -181,6 +200,24 @@ export declare type LocationAvailability = {
|
|
|
181
200
|
inventoryQuantity: number;
|
|
182
201
|
};
|
|
183
202
|
|
|
203
|
+
/**
|
|
204
|
+
* LocationType はロケーションのフィルタリング条件を表現するオブジェクト
|
|
205
|
+
*/
|
|
206
|
+
export declare type LocationFilter = {
|
|
207
|
+
/**
|
|
208
|
+
* ロケーションの種別
|
|
209
|
+
*/
|
|
210
|
+
locationType?: LocationType;
|
|
211
|
+
/**
|
|
212
|
+
* ロケーションのタグ
|
|
213
|
+
*/
|
|
214
|
+
tag?: string;
|
|
215
|
+
/**
|
|
216
|
+
* ロケーションの都道府県コード
|
|
217
|
+
*/
|
|
218
|
+
provinceCodes?: string[];
|
|
219
|
+
};
|
|
220
|
+
|
|
184
221
|
/**
|
|
185
222
|
* Locations は Location の一覧を取得するための情報を表す。
|
|
186
223
|
*/
|
|
@@ -189,6 +226,16 @@ export declare type Locations = {
|
|
|
189
226
|
pageInfo: PageInfo;
|
|
190
227
|
};
|
|
191
228
|
|
|
229
|
+
/**
|
|
230
|
+
* LocationType はロケーションの種別を表す
|
|
231
|
+
*/
|
|
232
|
+
export declare enum LocationType {
|
|
233
|
+
/** 店舗 */
|
|
234
|
+
Retail = "RETAIL",
|
|
235
|
+
/** 倉庫 */
|
|
236
|
+
Warehouse = "WAREHOUSE"
|
|
237
|
+
}
|
|
238
|
+
|
|
192
239
|
/**
|
|
193
240
|
* PageInfo はページングを伴って一覧を取得したときに、その一覧のページングの情報を表す。
|
|
194
241
|
*/
|
|
@@ -221,6 +268,14 @@ export declare type PointCampaignOrderRule = {
|
|
|
221
268
|
* キャンペーンのタイトル
|
|
222
269
|
*/
|
|
223
270
|
title: string;
|
|
271
|
+
/**
|
|
272
|
+
* キャンペーンポイントの計算方法
|
|
273
|
+
*/
|
|
274
|
+
pointMethod: string;
|
|
275
|
+
/**
|
|
276
|
+
* キャンペーンポイント付与対象の種別
|
|
277
|
+
*/
|
|
278
|
+
targetType: string;
|
|
224
279
|
};
|
|
225
280
|
|
|
226
281
|
/**
|
|
@@ -331,6 +386,24 @@ export declare type Points = {
|
|
|
331
386
|
* PointsPending は獲得予定ポイントを表す。
|
|
332
387
|
*/
|
|
333
388
|
pointsPending: number;
|
|
389
|
+
/**
|
|
390
|
+
* PointsExpiringSoon は最も直近の失効予定ポイントを表す。
|
|
391
|
+
*/
|
|
392
|
+
pointsExpiringSoon?: {
|
|
393
|
+
/**
|
|
394
|
+
* points は最も直近の失効予定ポイントを表す。
|
|
395
|
+
*/
|
|
396
|
+
points: number;
|
|
397
|
+
/**
|
|
398
|
+
* expiresDate は最も直近の失効日を表す。
|
|
399
|
+
*/
|
|
400
|
+
expiresDate: Date;
|
|
401
|
+
/**
|
|
402
|
+
* availableUntil は最も直近の失効予定ポイントが利用できる期限を表す。失効する直前を表すため、expiresDate から1ナノ秒を引いた値となる。
|
|
403
|
+
* 例えば、expiresDate が 2024-06-12 00:00:00 なら、availableUntil は 2024-06-11 23:59:59.999999999 となる。
|
|
404
|
+
*/
|
|
405
|
+
availableUntil: Date;
|
|
406
|
+
};
|
|
334
407
|
};
|
|
335
408
|
|
|
336
409
|
/**
|
|
@@ -473,20 +546,18 @@ export declare class SDK {
|
|
|
473
546
|
*/
|
|
474
547
|
getPurchasingCustomerMetafield(namespace: string, key: string): Promise<PurchasingCustomerMetafield | null>;
|
|
475
548
|
/**
|
|
476
|
-
* getPoints
|
|
477
|
-
* 存在しない場合は0を返します。
|
|
549
|
+
* getPoints は、Points は SDK から取得できるポイントの情報を返します。
|
|
478
550
|
*/
|
|
479
551
|
getPoints(): Promise<Points | null>;
|
|
480
552
|
/**
|
|
481
553
|
* getLocations は ShopifyIntegration に紐づく LocationGroup の Location の一覧を取得します。
|
|
482
554
|
*
|
|
483
|
-
* @param {string} [tag] 取得したいLocationのタグ。
|
|
484
|
-
* @param {string[]} [provinceCodes] 取得したいLocationの都道府県コード。
|
|
485
555
|
* @param {number} [first] 取得してくる個数。デフォルトは250。
|
|
486
556
|
* @param {string} [after] ページングの値。指定しない場合先頭から取得してくる。
|
|
557
|
+
* @param {LocationFilter} [locationFilter] ロケーションのロケーションのフィルタリング条件。
|
|
487
558
|
* @param {boolean} [isReverse] 並び順。デフォルトはfalse。
|
|
488
559
|
*/
|
|
489
|
-
getLocations(
|
|
560
|
+
getLocations(first?: number, after?: string, locationFilter?: LocationFilter, isReverse?: boolean): Promise<Locations>;
|
|
490
561
|
/**
|
|
491
562
|
* getPurchasingCustomerDiscounts は購入者の割引情報を返します。
|
|
492
563
|
*
|