@builtbystack/sq-shopify-theme-sdk 0.0.23 → 0.0.25
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 +161 -2
- package/dist/sq-shopify-theme-sdk.d.ts +55 -2
- package/dist/sq-shopify-theme-sdk.js +1152 -1098
- package/dist/sq-shopify-theme-sdk.umd.js +46 -29
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -51,6 +51,46 @@ SDKは名前空間 `SQ` 内に存在するため、SDKの初期化は `new SQ.SD
|
|
|
51
51
|
|
|
52
52
|
### Methods
|
|
53
53
|
|
|
54
|
+
#### getEstimatedShopifyCartLineItemPoint()
|
|
55
|
+
|
|
56
|
+
> **getEstimatedShopifyCartLineItemPoint**(`currencyCode`, `taxesIncluded`, `sku`, `quantity`, `unitPrice`): `Promise`\<`null` \| [`EstimatedPoint`](#type-aliasesestimatedpointmd)\>
|
|
57
|
+
|
|
58
|
+
##### Parameters
|
|
59
|
+
|
|
60
|
+
• **currencyCode**: [`CurrencyCode`](#enumerationscurrencycodemd)
|
|
61
|
+
|
|
62
|
+
• **taxesIncluded**: `boolean`
|
|
63
|
+
|
|
64
|
+
• **sku**: `string`
|
|
65
|
+
|
|
66
|
+
• **quantity**: `number`
|
|
67
|
+
|
|
68
|
+
• **unitPrice**: `string`
|
|
69
|
+
|
|
70
|
+
##### Returns
|
|
71
|
+
|
|
72
|
+
`Promise`\<`null` \| [`EstimatedPoint`](#type-aliasesestimatedpointmd)\>
|
|
73
|
+
|
|
74
|
+
***
|
|
75
|
+
|
|
76
|
+
#### getEstimatedShopifyCartPoint()
|
|
77
|
+
|
|
78
|
+
> **getEstimatedShopifyCartPoint**(`currencyCode`, `taxesIncluded`, `lineItems`): `Promise`\<`null` \| [`EstimatedPoint`](#type-aliasesestimatedpointmd)\>
|
|
79
|
+
|
|
80
|
+
##### Parameters
|
|
81
|
+
|
|
82
|
+
• **currencyCode**: [`CurrencyCode`](#enumerationscurrencycodemd)
|
|
83
|
+
|
|
84
|
+
• **taxesIncluded**: `boolean`
|
|
85
|
+
|
|
86
|
+
• **lineItems**: [`CartLineItem`](#type-aliasescartlineitemmd)[]
|
|
87
|
+
|
|
88
|
+
##### Returns
|
|
89
|
+
|
|
90
|
+
`Promise`\<`null` \| [`EstimatedPoint`](#type-aliasesestimatedpointmd)\>
|
|
91
|
+
|
|
92
|
+
***
|
|
93
|
+
|
|
54
94
|
#### getLocationAvailabilities()
|
|
55
95
|
|
|
56
96
|
> **getLocationAvailabilities**(`sku`, `first`?, `after`?, `isReverse`?): `Promise`\<[`LocationAvailabilities`](#type-aliaseslocationavailabilitiesmd)\>
|
|
@@ -181,8 +221,7 @@ getPointChangeActivities は購入者のポイント変動履歴を返します
|
|
|
181
221
|
|
|
182
222
|
> **getPoints**(): `Promise`\<`null` \| [`Points`](#type-aliasespointsmd)\>
|
|
183
223
|
|
|
184
|
-
getPoints
|
|
185
|
-
存在しない場合は0を返します。
|
|
224
|
+
getPoints は、Points は SDK から取得できるポイントの情報を返します。
|
|
186
225
|
|
|
187
226
|
##### Returns
|
|
188
227
|
|
|
@@ -337,6 +376,39 @@ purchasingCustomerSendCustomerSharingActivationCode はログインしている
|
|
|
337
376
|
|
|
338
377
|
`Promise`\<`null` \| [`CustomerSharingActivationCode`](#type-aliasescustomersharingactivationcodemd)\>
|
|
339
378
|
|
|
379
|
+
# Enumerations
|
|
380
|
+
|
|
381
|
+
|
|
382
|
+
<a name="enumerationscurrencycodemd"></a>
|
|
383
|
+
|
|
384
|
+
[**@builtbystack/sq-shopify-theme-sdk**](#readmemd) • **Docs**
|
|
385
|
+
|
|
386
|
+
***
|
|
387
|
+
|
|
388
|
+
[@builtbystack/sq-shopify-theme-sdk](#globalsmd) / CurrencyCode
|
|
389
|
+
|
|
390
|
+
## Enumeration: CurrencyCode
|
|
391
|
+
|
|
392
|
+
CurrencyCode は通貨コードを表す
|
|
393
|
+
|
|
394
|
+
### Enumeration Members
|
|
395
|
+
|
|
396
|
+
#### Eur
|
|
397
|
+
|
|
398
|
+
> **Eur**: `"EUR"`
|
|
399
|
+
|
|
400
|
+
***
|
|
401
|
+
|
|
402
|
+
#### Jpy
|
|
403
|
+
|
|
404
|
+
> **Jpy**: `"JPY"`
|
|
405
|
+
|
|
406
|
+
***
|
|
407
|
+
|
|
408
|
+
#### Usd
|
|
409
|
+
|
|
410
|
+
> **Usd**: `"USD"`
|
|
411
|
+
|
|
340
412
|
|
|
341
413
|
<a name="globalsmd"></a>
|
|
342
414
|
|
|
@@ -346,6 +418,10 @@ purchasingCustomerSendCustomerSharingActivationCode はログインしている
|
|
|
346
418
|
|
|
347
419
|
# @builtbystack/sq-shopify-theme-sdk
|
|
348
420
|
|
|
421
|
+
## Enumerations
|
|
422
|
+
|
|
423
|
+
- [CurrencyCode](#enumerationscurrencycodemd)
|
|
424
|
+
|
|
349
425
|
## Classes
|
|
350
426
|
|
|
351
427
|
- [SDK](#classessdkmd)
|
|
@@ -353,11 +429,13 @@ purchasingCustomerSendCustomerSharingActivationCode はログインしている
|
|
|
353
429
|
## Type Aliases
|
|
354
430
|
|
|
355
431
|
- [Address](#type-aliasesaddressmd)
|
|
432
|
+
- [CartLineItem](#type-aliasescartlineitemmd)
|
|
356
433
|
- [CustomerRank](#type-aliasescustomerrankmd)
|
|
357
434
|
- [CustomerRankCalculationCondition](#type-aliasescustomerrankcalculationconditionmd)
|
|
358
435
|
- [CustomerRankCalculationPeriod](#type-aliasescustomerrankcalculationperiodmd)
|
|
359
436
|
- [CustomerRankRule](#type-aliasescustomerrankrulemd)
|
|
360
437
|
- [CustomerSharingActivationCode](#type-aliasescustomersharingactivationcodemd)
|
|
438
|
+
- [EstimatedPoint](#type-aliasesestimatedpointmd)
|
|
361
439
|
- [InventoryItem](#type-aliasesinventoryitemmd)
|
|
362
440
|
- [Location](#type-aliaseslocationmd)
|
|
363
441
|
- [LocationAvailabilities](#type-aliaseslocationavailabilitiesmd)
|
|
@@ -437,6 +515,41 @@ Address はLocationの住所を表す。
|
|
|
437
515
|
> **provinceCode**: `string`
|
|
438
516
|
|
|
439
517
|
|
|
518
|
+
<a name="type-aliasescartlineitemmd"></a>
|
|
519
|
+
|
|
520
|
+
[**@builtbystack/sq-shopify-theme-sdk**](#readmemd) • **Docs**
|
|
521
|
+
|
|
522
|
+
***
|
|
523
|
+
|
|
524
|
+
[@builtbystack/sq-shopify-theme-sdk](#globalsmd) / CartLineItem
|
|
525
|
+
|
|
526
|
+
## Type Alias: CartLineItem
|
|
527
|
+
|
|
528
|
+
> **CartLineItem**: `object`
|
|
529
|
+
|
|
530
|
+
CartLineItem はカートの商品明細情報を表す
|
|
531
|
+
|
|
532
|
+
### Type declaration
|
|
533
|
+
|
|
534
|
+
#### quantity
|
|
535
|
+
|
|
536
|
+
> **quantity**: `number`
|
|
537
|
+
|
|
538
|
+
商品の数量
|
|
539
|
+
|
|
540
|
+
#### sku
|
|
541
|
+
|
|
542
|
+
> **sku**: `string`
|
|
543
|
+
|
|
544
|
+
商品のSKU
|
|
545
|
+
|
|
546
|
+
#### unitPrice
|
|
547
|
+
|
|
548
|
+
> **unitPrice**: `string`
|
|
549
|
+
|
|
550
|
+
商品の単価
|
|
551
|
+
|
|
552
|
+
|
|
440
553
|
<a name="type-aliasescustomerrankmd"></a>
|
|
441
554
|
|
|
442
555
|
[**@builtbystack/sq-shopify-theme-sdk**](#readmemd) • **Docs**
|
|
@@ -626,6 +739,27 @@ CustomerRankRule は会員ランクのルールを表す。
|
|
|
626
739
|
> **purchasingCustomer**: [`PurchasingCustomer`](#type-aliasespurchasingcustomermd)
|
|
627
740
|
|
|
628
741
|
|
|
742
|
+
<a name="type-aliasesestimatedpointmd"></a>
|
|
743
|
+
|
|
744
|
+
[**@builtbystack/sq-shopify-theme-sdk**](#readmemd) • **Docs**
|
|
745
|
+
|
|
746
|
+
***
|
|
747
|
+
|
|
748
|
+
[@builtbystack/sq-shopify-theme-sdk](#globalsmd) / EstimatedPoint
|
|
749
|
+
|
|
750
|
+
## Type Alias: EstimatedPoint
|
|
751
|
+
|
|
752
|
+
> **EstimatedPoint**: `object`
|
|
753
|
+
|
|
754
|
+
EstimatedPoint は獲得予想ポイントを表す
|
|
755
|
+
|
|
756
|
+
### Type declaration
|
|
757
|
+
|
|
758
|
+
#### pointsEarned
|
|
759
|
+
|
|
760
|
+
> **pointsEarned**: `number`
|
|
761
|
+
|
|
762
|
+
|
|
629
763
|
<a name="type-aliasesinventoryitemmd"></a>
|
|
630
764
|
|
|
631
765
|
[**@builtbystack/sq-shopify-theme-sdk**](#readmemd) • **Docs**
|
|
@@ -1062,6 +1196,31 @@ Points は SDK から取得できるポイントの情報を表す。
|
|
|
1062
1196
|
|
|
1063
1197
|
PointsApproved は保有ポイントを表す。
|
|
1064
1198
|
|
|
1199
|
+
#### pointsExpiringSoon?
|
|
1200
|
+
|
|
1201
|
+
> `optional` **pointsExpiringSoon**: `object`
|
|
1202
|
+
|
|
1203
|
+
PointsExpiringSoon は最も直近の失効予定ポイントを表す。
|
|
1204
|
+
|
|
1205
|
+
#### pointsExpiringSoon.availableUntil
|
|
1206
|
+
|
|
1207
|
+
> **availableUntil**: `Date`
|
|
1208
|
+
|
|
1209
|
+
availableUntil は最も直近の失効予定ポイントが利用できる期限を表す。失効する直前を表すため、expiresDate から1ナノ秒を引いた値となる。
|
|
1210
|
+
例えば、expiresDate が 2024-06-12 00:00:00 なら、availableUntil は 2024-06-11 23:59:59.999999999 となる。
|
|
1211
|
+
|
|
1212
|
+
#### pointsExpiringSoon.expiresDate
|
|
1213
|
+
|
|
1214
|
+
> **expiresDate**: `Date`
|
|
1215
|
+
|
|
1216
|
+
expiresDate は最も直近の失効日を表す。
|
|
1217
|
+
|
|
1218
|
+
#### pointsExpiringSoon.points
|
|
1219
|
+
|
|
1220
|
+
> **points**: `number`
|
|
1221
|
+
|
|
1222
|
+
points は最も直近の失効予定ポイントを表す。
|
|
1223
|
+
|
|
1065
1224
|
#### pointsPending
|
|
1066
1225
|
|
|
1067
1226
|
> **pointsPending**: `number`
|
|
@@ -13,6 +13,33 @@ export declare type Address = {
|
|
|
13
13
|
address2: string;
|
|
14
14
|
};
|
|
15
15
|
|
|
16
|
+
/**
|
|
17
|
+
* CartLineItem はカートの商品明細情報を表す
|
|
18
|
+
*/
|
|
19
|
+
export declare type CartLineItem = {
|
|
20
|
+
/**
|
|
21
|
+
* 商品のSKU
|
|
22
|
+
*/
|
|
23
|
+
sku: string;
|
|
24
|
+
/**
|
|
25
|
+
* 商品の数量
|
|
26
|
+
*/
|
|
27
|
+
quantity: number;
|
|
28
|
+
/**
|
|
29
|
+
* 商品の単価
|
|
30
|
+
*/
|
|
31
|
+
unitPrice: string;
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* CurrencyCode は通貨コードを表す
|
|
36
|
+
*/
|
|
37
|
+
export declare enum CurrencyCode {
|
|
38
|
+
Eur = "EUR",
|
|
39
|
+
Jpy = "JPY",
|
|
40
|
+
Usd = "USD"
|
|
41
|
+
}
|
|
42
|
+
|
|
16
43
|
/**
|
|
17
44
|
* CustomerRank は会員ランクを表す。
|
|
18
45
|
*/
|
|
@@ -104,6 +131,13 @@ export declare type CustomerSharingActivationCode = {
|
|
|
104
131
|
customerSharingActivationCodeID: string;
|
|
105
132
|
};
|
|
106
133
|
|
|
134
|
+
/**
|
|
135
|
+
* EstimatedPoint は獲得予想ポイントを表す
|
|
136
|
+
*/
|
|
137
|
+
export declare type EstimatedPoint = {
|
|
138
|
+
pointsEarned: number;
|
|
139
|
+
};
|
|
140
|
+
|
|
107
141
|
/**
|
|
108
142
|
* InventoryItem は在庫情報を表す。
|
|
109
143
|
*/
|
|
@@ -297,6 +331,24 @@ export declare type Points = {
|
|
|
297
331
|
* PointsPending は獲得予定ポイントを表す。
|
|
298
332
|
*/
|
|
299
333
|
pointsPending: number;
|
|
334
|
+
/**
|
|
335
|
+
* PointsExpiringSoon は最も直近の失効予定ポイントを表す。
|
|
336
|
+
*/
|
|
337
|
+
pointsExpiringSoon?: {
|
|
338
|
+
/**
|
|
339
|
+
* points は最も直近の失効予定ポイントを表す。
|
|
340
|
+
*/
|
|
341
|
+
points: number;
|
|
342
|
+
/**
|
|
343
|
+
* expiresDate は最も直近の失効日を表す。
|
|
344
|
+
*/
|
|
345
|
+
expiresDate: Date;
|
|
346
|
+
/**
|
|
347
|
+
* availableUntil は最も直近の失効予定ポイントが利用できる期限を表す。失効する直前を表すため、expiresDate から1ナノ秒を引いた値となる。
|
|
348
|
+
* 例えば、expiresDate が 2024-06-12 00:00:00 なら、availableUntil は 2024-06-11 23:59:59.999999999 となる。
|
|
349
|
+
*/
|
|
350
|
+
availableUntil: Date;
|
|
351
|
+
};
|
|
300
352
|
};
|
|
301
353
|
|
|
302
354
|
/**
|
|
@@ -439,8 +491,7 @@ export declare class SDK {
|
|
|
439
491
|
*/
|
|
440
492
|
getPurchasingCustomerMetafield(namespace: string, key: string): Promise<PurchasingCustomerMetafield | null>;
|
|
441
493
|
/**
|
|
442
|
-
* getPoints
|
|
443
|
-
* 存在しない場合は0を返します。
|
|
494
|
+
* getPoints は、Points は SDK から取得できるポイントの情報を返します。
|
|
444
495
|
*/
|
|
445
496
|
getPoints(): Promise<Points | null>;
|
|
446
497
|
/**
|
|
@@ -489,6 +540,8 @@ export declare class SDK {
|
|
|
489
540
|
getPurchasingCustomerSharing(): Promise<PurchasingCustomerSharing | null>;
|
|
490
541
|
getProduct(id: string, first?: number, after?: string, isReverse?: boolean, sortKeys?: ProductVariantSortKeys): Promise<Product | null>;
|
|
491
542
|
getPointCampaignOrderRuleTargetCustomerRank(): Promise<PointCampaignOrderRuleTargetCustomerRank | null>;
|
|
543
|
+
getEstimatedShopifyCartPoint(currencyCode: CurrencyCode, taxesIncluded: boolean, lineItems: CartLineItem[]): Promise<EstimatedPoint | null>;
|
|
544
|
+
getEstimatedShopifyCartLineItemPoint(currencyCode: CurrencyCode, taxesIncluded: boolean, sku: string, quantity: number, unitPrice: string): Promise<EstimatedPoint | null>;
|
|
492
545
|
/**
|
|
493
546
|
* purchasingCustomerSendCustomerSharingActivationCode はログインしているアカウントのメールアドレスに顧客情報共有のためのアクティベーションコードを送信します。
|
|
494
547
|
*/
|