@congminh1254/shopee-sdk 0.5.0 → 0.7.0
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 +7 -6
- package/lib/errors.js +2 -2
- package/lib/fetch.d.ts +2 -2
- package/lib/fetch.js +17 -14
- package/lib/fetch.js.map +1 -1
- package/lib/managers/account-health.manager.d.ts +208 -0
- package/lib/managers/account-health.manager.js +257 -0
- package/lib/managers/account-health.manager.js.map +1 -0
- package/lib/managers/ads.manager.js +22 -22
- package/lib/managers/ads.manager.js.map +1 -1
- package/lib/managers/auth.manager.d.ts +3 -3
- package/lib/managers/auth.manager.js +21 -12
- package/lib/managers/auth.manager.js.map +1 -1
- package/lib/managers/base.manager.d.ts +1 -1
- package/lib/managers/index.d.ts +11 -10
- package/lib/managers/index.js +11 -10
- package/lib/managers/index.js.map +1 -1
- package/lib/managers/logistics.manager.js +2 -2
- package/lib/managers/logistics.manager.js.map +1 -1
- package/lib/managers/order.manager.d.ts +3 -3
- package/lib/managers/order.manager.js +25 -25
- package/lib/managers/order.manager.js.map +1 -1
- package/lib/managers/payment.manager.js +2 -2
- package/lib/managers/payment.manager.js.map +1 -1
- package/lib/managers/product.manager.d.ts +3 -3
- package/lib/managers/product.manager.js +10 -10
- package/lib/managers/product.manager.js.map +1 -1
- package/lib/managers/public.manager.d.ts +3 -3
- package/lib/managers/public.manager.js +8 -8
- package/lib/managers/push.manager.d.ts +3 -3
- package/lib/managers/push.manager.js +11 -11
- package/lib/managers/push.manager.js.map +1 -1
- package/lib/managers/voucher.manager.js +12 -12
- package/lib/managers/voucher.manager.js.map +1 -1
- package/lib/schemas/access-token.d.ts +2 -1
- package/lib/schemas/account-health.d.ts +734 -0
- package/lib/schemas/account-health.js +200 -0
- package/lib/schemas/account-health.js.map +1 -0
- package/lib/schemas/attribute.d.ts +4 -4
- package/lib/schemas/fetch.d.ts +2 -2
- package/lib/schemas/index.d.ts +13 -12
- package/lib/schemas/index.js +13 -12
- package/lib/schemas/index.js.map +1 -1
- package/lib/schemas/logistics.d.ts +1 -1
- package/lib/schemas/order.d.ts +26 -26
- package/lib/schemas/order.js +1 -1
- package/lib/schemas/payment.d.ts +1 -1
- package/lib/schemas/product.d.ts +1 -1
- package/lib/schemas/product.js +0 -1
- package/lib/schemas/product.js.map +1 -1
- package/lib/schemas/push.d.ts +1 -1
- package/lib/schemas/region.js +5 -5
- package/lib/schemas/voucher.js.map +1 -1
- package/lib/sdk.d.ts +14 -12
- package/lib/sdk.js +17 -19
- package/lib/sdk.js.map +1 -1
- package/lib/storage/custom-token-storage.d.ts +2 -2
- package/lib/storage/custom-token-storage.js +11 -11
- package/lib/storage/custom-token-storage.js.map +1 -1
- package/lib/storage/token-storage.interface.d.ts +1 -1
- package/lib/utils/signature.js +3 -6
- package/lib/utils/signature.js.map +1 -1
- package/package.json +2 -1
|
@@ -0,0 +1,200 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Metric type enum values
|
|
3
|
+
* 1 = Fulfillment Performance
|
|
4
|
+
* 2 = Listing Performance
|
|
5
|
+
* 3 = Customer Service Performance
|
|
6
|
+
*/
|
|
7
|
+
export var MetricType;
|
|
8
|
+
(function (MetricType) {
|
|
9
|
+
MetricType[MetricType["FulfillmentPerformance"] = 1] = "FulfillmentPerformance";
|
|
10
|
+
MetricType[MetricType["ListingPerformance"] = 2] = "ListingPerformance";
|
|
11
|
+
MetricType[MetricType["CustomerServicePerformance"] = 3] = "CustomerServicePerformance";
|
|
12
|
+
})(MetricType || (MetricType = {}));
|
|
13
|
+
/**
|
|
14
|
+
* Metric unit enum values
|
|
15
|
+
* 1 = Number
|
|
16
|
+
* 2 = Percentage
|
|
17
|
+
* 3 = Second
|
|
18
|
+
* 4 = Day
|
|
19
|
+
* 5 = Hour
|
|
20
|
+
*/
|
|
21
|
+
export var MetricUnit;
|
|
22
|
+
(function (MetricUnit) {
|
|
23
|
+
MetricUnit[MetricUnit["Number"] = 1] = "Number";
|
|
24
|
+
MetricUnit[MetricUnit["Percentage"] = 2] = "Percentage";
|
|
25
|
+
MetricUnit[MetricUnit["Second"] = 3] = "Second";
|
|
26
|
+
MetricUnit[MetricUnit["Day"] = 4] = "Day";
|
|
27
|
+
MetricUnit[MetricUnit["Hour"] = 5] = "Hour";
|
|
28
|
+
})(MetricUnit || (MetricUnit = {}));
|
|
29
|
+
/**
|
|
30
|
+
* Overall performance rating enum values
|
|
31
|
+
* 1 = Poor
|
|
32
|
+
* 2 = ImprovementNeeded
|
|
33
|
+
* 3 = Good
|
|
34
|
+
* 4 = Excellent
|
|
35
|
+
*/
|
|
36
|
+
export var PerformanceRating;
|
|
37
|
+
(function (PerformanceRating) {
|
|
38
|
+
PerformanceRating[PerformanceRating["Poor"] = 1] = "Poor";
|
|
39
|
+
PerformanceRating[PerformanceRating["ImprovementNeeded"] = 2] = "ImprovementNeeded";
|
|
40
|
+
PerformanceRating[PerformanceRating["Good"] = 3] = "Good";
|
|
41
|
+
PerformanceRating[PerformanceRating["Excellent"] = 4] = "Excellent";
|
|
42
|
+
})(PerformanceRating || (PerformanceRating = {}));
|
|
43
|
+
/**
|
|
44
|
+
* Violation types that can be used to filter penalty point history
|
|
45
|
+
* These values correspond to different violation categories that might result in penalty points.
|
|
46
|
+
* For a complete list, refer to the Shopee API documentation.
|
|
47
|
+
*/
|
|
48
|
+
export var ViolationType;
|
|
49
|
+
(function (ViolationType) {
|
|
50
|
+
ViolationType[ViolationType["HighLateShipmentRate"] = 5] = "HighLateShipmentRate";
|
|
51
|
+
ViolationType[ViolationType["HighNonFulfillmentRate"] = 6] = "HighNonFulfillmentRate";
|
|
52
|
+
ViolationType[ViolationType["HighNumberOfNonFulfilledOrders"] = 7] = "HighNumberOfNonFulfilledOrders";
|
|
53
|
+
ViolationType[ViolationType["HighNumberOfLateShippedOrders"] = 8] = "HighNumberOfLateShippedOrders";
|
|
54
|
+
ViolationType[ViolationType["ProhibitedListings"] = 9] = "ProhibitedListings";
|
|
55
|
+
ViolationType[ViolationType["CounterfeitIPInfringement"] = 10] = "CounterfeitIPInfringement";
|
|
56
|
+
ViolationType[ViolationType["Spam"] = 11] = "Spam";
|
|
57
|
+
ViolationType[ViolationType["CopyStealImages"] = 12] = "CopyStealImages";
|
|
58
|
+
ViolationType[ViolationType["ReUploadingDeletedListings"] = 13] = "ReUploadingDeletedListings";
|
|
59
|
+
ViolationType[ViolationType["BoughtCounterfeitFromMall"] = 14] = "BoughtCounterfeitFromMall";
|
|
60
|
+
ViolationType[ViolationType["CounterfeitCaughtByShopee"] = 15] = "CounterfeitCaughtByShopee";
|
|
61
|
+
ViolationType[ViolationType["HighPercentageOfPreOrderListings"] = 16] = "HighPercentageOfPreOrderListings";
|
|
62
|
+
ViolationType[ViolationType["ConfirmedFraudAttempts"] = 17] = "ConfirmedFraudAttempts";
|
|
63
|
+
ViolationType[ViolationType["ConfirmedFraudAttemptsWithVouchers"] = 18] = "ConfirmedFraudAttemptsWithVouchers";
|
|
64
|
+
ViolationType[ViolationType["FakeReturnAddress"] = 19] = "FakeReturnAddress";
|
|
65
|
+
ViolationType[ViolationType["ShippingFraudAbuse"] = 20] = "ShippingFraudAbuse";
|
|
66
|
+
ViolationType[ViolationType["HighNonRespondedChat"] = 21] = "HighNonRespondedChat";
|
|
67
|
+
ViolationType[ViolationType["RudeChatReplies"] = 22] = "RudeChatReplies";
|
|
68
|
+
ViolationType[ViolationType["RequestBuyerToCancel"] = 23] = "RequestBuyerToCancel";
|
|
69
|
+
ViolationType[ViolationType["RudeReplyToBuyerReview"] = 24] = "RudeReplyToBuyerReview";
|
|
70
|
+
ViolationType[ViolationType["ViolateReturnRefundPolicy"] = 25] = "ViolateReturnRefundPolicy";
|
|
71
|
+
ViolationType[ViolationType["TierReason"] = 101] = "TierReason";
|
|
72
|
+
ViolationType[ViolationType["MisuseOfShopeesIP"] = 3026] = "MisuseOfShopeesIP";
|
|
73
|
+
ViolationType[ViolationType["ViolateShopNameRegulations"] = 3028] = "ViolateShopNameRegulations";
|
|
74
|
+
ViolationType[ViolationType["DirectTransactionsOutsidePlatform"] = 3030] = "DirectTransactionsOutsidePlatform";
|
|
75
|
+
ViolationType[ViolationType["ShippingEmptyIncompleteParcels"] = 3032] = "ShippingEmptyIncompleteParcels";
|
|
76
|
+
ViolationType[ViolationType["SevereViolationsOnShopeeFeed"] = 3034] = "SevereViolationsOnShopeeFeed";
|
|
77
|
+
ViolationType[ViolationType["SevereViolationsOnShopeeLIVE"] = 3036] = "SevereViolationsOnShopeeLIVE";
|
|
78
|
+
ViolationType[ViolationType["MisuseOfLocalVendorTag"] = 3038] = "MisuseOfLocalVendorTag";
|
|
79
|
+
ViolationType[ViolationType["MisleadingShopTagInListingImage"] = 3040] = "MisleadingShopTagInListingImage";
|
|
80
|
+
ViolationType[ViolationType["CounterfeitIPInfringementTest"] = 3042] = "CounterfeitIPInfringementTest";
|
|
81
|
+
ViolationType[ViolationType["RepeatOffenderIPInfringement"] = 3044] = "RepeatOffenderIPInfringement";
|
|
82
|
+
ViolationType[ViolationType["ViolationOfLiveAnimalsSelling"] = 3046] = "ViolationOfLiveAnimalsSelling";
|
|
83
|
+
ViolationType[ViolationType["ChatSpam"] = 3048] = "ChatSpam";
|
|
84
|
+
ViolationType[ViolationType["HighOverseasReturnRefundsRate"] = 3050] = "HighOverseasReturnRefundsRate";
|
|
85
|
+
ViolationType[ViolationType["PrivacyBreachInBuyerReply"] = 3052] = "PrivacyBreachInBuyerReply";
|
|
86
|
+
ViolationType[ViolationType["OrderBrushing"] = 3054] = "OrderBrushing";
|
|
87
|
+
ViolationType[ViolationType["PornImage"] = 3056] = "PornImage";
|
|
88
|
+
ViolationType[ViolationType["IncorrectProductCategories"] = 3058] = "IncorrectProductCategories";
|
|
89
|
+
ViolationType[ViolationType["ExtremelyHighNonFulfillmentRate"] = 3060] = "ExtremelyHighNonFulfillmentRate";
|
|
90
|
+
ViolationType[ViolationType["AMSOverdueInvoicePayment"] = 3062] = "AMSOverdueInvoicePayment";
|
|
91
|
+
ViolationType[ViolationType["GovernmentRelatedListing"] = 3064] = "GovernmentRelatedListing";
|
|
92
|
+
ViolationType[ViolationType["ListingInvalidGiftedItems"] = 3066] = "ListingInvalidGiftedItems";
|
|
93
|
+
ViolationType[ViolationType["HighNonFulfillmentRateNDD"] = 3068] = "HighNonFulfillmentRateNDD";
|
|
94
|
+
ViolationType[ViolationType["HighLateShipmentRateNDD"] = 3070] = "HighLateShipmentRateNDD";
|
|
95
|
+
ViolationType[ViolationType["OPFRViolationValue"] = 3072] = "OPFRViolationValue";
|
|
96
|
+
ViolationType[ViolationType["DirectTransactionsOutsidePlatformViaChat"] = 3074] = "DirectTransactionsOutsidePlatformViaChat";
|
|
97
|
+
ViolationType[ViolationType["ProhibitedListingsExtreme"] = 3090] = "ProhibitedListingsExtreme";
|
|
98
|
+
ViolationType[ViolationType["ProhibitedListingsHigh"] = 3091] = "ProhibitedListingsHigh";
|
|
99
|
+
ViolationType[ViolationType["ProhibitedListingsMid"] = 3092] = "ProhibitedListingsMid";
|
|
100
|
+
ViolationType[ViolationType["ProhibitedListingsLow"] = 3093] = "ProhibitedListingsLow";
|
|
101
|
+
ViolationType[ViolationType["CounterfeitListingsExtreme"] = 3094] = "CounterfeitListingsExtreme";
|
|
102
|
+
ViolationType[ViolationType["CounterfeitListingsHigh"] = 3095] = "CounterfeitListingsHigh";
|
|
103
|
+
ViolationType[ViolationType["CounterfeitListingsMid"] = 3096] = "CounterfeitListingsMid";
|
|
104
|
+
ViolationType[ViolationType["CounterfeitListingsLow"] = 3097] = "CounterfeitListingsLow";
|
|
105
|
+
ViolationType[ViolationType["SpamListingsExtreme"] = 3098] = "SpamListingsExtreme";
|
|
106
|
+
ViolationType[ViolationType["SpamListingsHigh"] = 3099] = "SpamListingsHigh";
|
|
107
|
+
ViolationType[ViolationType["SpamListingsMid"] = 3100] = "SpamListingsMid";
|
|
108
|
+
ViolationType[ViolationType["SpamListingsLow"] = 3101] = "SpamListingsLow";
|
|
109
|
+
ViolationType[ViolationType["ReturnRefundRateNonIntegrated"] = 3145] = "ReturnRefundRateNonIntegrated";
|
|
110
|
+
ViolationType[ViolationType["PoorProductQuality"] = 4130] = "PoorProductQuality";
|
|
111
|
+
})(ViolationType || (ViolationType = {}));
|
|
112
|
+
/**
|
|
113
|
+
* Status of punishment records
|
|
114
|
+
*/
|
|
115
|
+
export var PunishmentStatus;
|
|
116
|
+
(function (PunishmentStatus) {
|
|
117
|
+
/** Ongoing punishments */
|
|
118
|
+
PunishmentStatus[PunishmentStatus["Ongoing"] = 1] = "Ongoing";
|
|
119
|
+
/** Ended punishments */
|
|
120
|
+
PunishmentStatus[PunishmentStatus["Ended"] = 2] = "Ended";
|
|
121
|
+
})(PunishmentStatus || (PunishmentStatus = {}));
|
|
122
|
+
/**
|
|
123
|
+
* Types of shop punishments
|
|
124
|
+
*/
|
|
125
|
+
export var PunishmentType;
|
|
126
|
+
(function (PunishmentType) {
|
|
127
|
+
/** Listings not displayed in category browsing */
|
|
128
|
+
PunishmentType[PunishmentType["ListingsNotDisplayedInCategoryBrowsing"] = 103] = "ListingsNotDisplayedInCategoryBrowsing";
|
|
129
|
+
/** Listings not displayed in search */
|
|
130
|
+
PunishmentType[PunishmentType["ListingsNotDisplayedInSearch"] = 104] = "ListingsNotDisplayedInSearch";
|
|
131
|
+
/** Unable to create new listings */
|
|
132
|
+
PunishmentType[PunishmentType["UnableToCreateNewListings"] = 105] = "UnableToCreateNewListings";
|
|
133
|
+
/** Unable to edit listings */
|
|
134
|
+
PunishmentType[PunishmentType["UnableToEditListings"] = 106] = "UnableToEditListings";
|
|
135
|
+
/** Unable to join marketing campaigns */
|
|
136
|
+
PunishmentType[PunishmentType["UnableToJoinMarketingCampaigns"] = 107] = "UnableToJoinMarketingCampaigns";
|
|
137
|
+
/** No shipping subsidies */
|
|
138
|
+
PunishmentType[PunishmentType["NoShippingSubsidies"] = 108] = "NoShippingSubsidies";
|
|
139
|
+
/** Account is suspended */
|
|
140
|
+
PunishmentType[PunishmentType["AccountSuspended"] = 109] = "AccountSuspended";
|
|
141
|
+
/** Listings not displayed in search (alternative code) */
|
|
142
|
+
PunishmentType[PunishmentType["ListingsNotDisplayedInSearchAlt"] = 600] = "ListingsNotDisplayedInSearchAlt";
|
|
143
|
+
/** Shop listings hide from recommendation */
|
|
144
|
+
PunishmentType[PunishmentType["ShopListingsHideFromRecommendation"] = 601] = "ShopListingsHideFromRecommendation";
|
|
145
|
+
/** Listings not displayed in category browsing (alternative code) */
|
|
146
|
+
PunishmentType[PunishmentType["ListingsNotDisplayedInCategoryBrowsingAlt"] = 602] = "ListingsNotDisplayedInCategoryBrowsingAlt";
|
|
147
|
+
/** Listing Limit is reduced (Tier 1) */
|
|
148
|
+
PunishmentType[PunishmentType["ListingLimitReducedTier1"] = 1109] = "ListingLimitReducedTier1";
|
|
149
|
+
/** Listing Limit is reduced (Tier 2) */
|
|
150
|
+
PunishmentType[PunishmentType["ListingLimitReducedTier2"] = 1110] = "ListingLimitReducedTier2";
|
|
151
|
+
/** Listing Limit is reduced (POL) */
|
|
152
|
+
PunishmentType[PunishmentType["ListingLimitReducedPOL"] = 1111] = "ListingLimitReducedPOL";
|
|
153
|
+
/** Listing Limit is reduced (additional code) */
|
|
154
|
+
PunishmentType[PunishmentType["ListingLimitReducedExtra"] = 1112] = "ListingLimitReducedExtra";
|
|
155
|
+
/** Order Limit */
|
|
156
|
+
PunishmentType[PunishmentType["OrderLimit"] = 2008] = "OrderLimit";
|
|
157
|
+
})(PunishmentType || (PunishmentType = {}));
|
|
158
|
+
/**
|
|
159
|
+
* Reasons for shop punishments
|
|
160
|
+
*/
|
|
161
|
+
export var PunishmentReason;
|
|
162
|
+
(function (PunishmentReason) {
|
|
163
|
+
/** Tier 1 punishment */
|
|
164
|
+
PunishmentReason[PunishmentReason["Tier1"] = 1] = "Tier1";
|
|
165
|
+
/** Tier 2 punishment */
|
|
166
|
+
PunishmentReason[PunishmentReason["Tier2"] = 2] = "Tier2";
|
|
167
|
+
/** Tier 3 punishment */
|
|
168
|
+
PunishmentReason[PunishmentReason["Tier3"] = 3] = "Tier3";
|
|
169
|
+
/** Tier 4 punishment */
|
|
170
|
+
PunishmentReason[PunishmentReason["Tier4"] = 4] = "Tier4";
|
|
171
|
+
/** Tier 5 punishment */
|
|
172
|
+
PunishmentReason[PunishmentReason["Tier5"] = 5] = "Tier5";
|
|
173
|
+
/** Listing Limit Tier 1 */
|
|
174
|
+
PunishmentReason[PunishmentReason["ListingLimitTier1"] = 1109] = "ListingLimitTier1";
|
|
175
|
+
/** Listing Limit Tier 2 */
|
|
176
|
+
PunishmentReason[PunishmentReason["ListingLimitTier2"] = 1110] = "ListingLimitTier2";
|
|
177
|
+
/** Listing Limit POL */
|
|
178
|
+
PunishmentReason[PunishmentReason["ListingLimitPOL"] = 1111] = "ListingLimitPOL";
|
|
179
|
+
})(PunishmentReason || (PunishmentReason = {}));
|
|
180
|
+
/**
|
|
181
|
+
* Reason types for listing issues
|
|
182
|
+
*/
|
|
183
|
+
export var ListingIssueReason;
|
|
184
|
+
(function (ListingIssueReason) {
|
|
185
|
+
/** Prohibited listing */
|
|
186
|
+
ListingIssueReason[ListingIssueReason["Prohibited"] = 1] = "Prohibited";
|
|
187
|
+
/** Counterfeit listing */
|
|
188
|
+
ListingIssueReason[ListingIssueReason["Counterfeit"] = 2] = "Counterfeit";
|
|
189
|
+
/** Spam listing */
|
|
190
|
+
ListingIssueReason[ListingIssueReason["Spam"] = 3] = "Spam";
|
|
191
|
+
/** Inappropriate image */
|
|
192
|
+
ListingIssueReason[ListingIssueReason["InappropriateImage"] = 4] = "InappropriateImage";
|
|
193
|
+
/** Insufficient information */
|
|
194
|
+
ListingIssueReason[ListingIssueReason["InsufficientInfo"] = 5] = "InsufficientInfo";
|
|
195
|
+
/** Mall listing improvement needed */
|
|
196
|
+
ListingIssueReason[ListingIssueReason["MallListingImprovement"] = 6] = "MallListingImprovement";
|
|
197
|
+
/** Other listing improvement needed */
|
|
198
|
+
ListingIssueReason[ListingIssueReason["OtherListingImprovement"] = 7] = "OtherListingImprovement";
|
|
199
|
+
})(ListingIssueReason || (ListingIssueReason = {}));
|
|
200
|
+
//# sourceMappingURL=account-health.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"account-health.js","sourceRoot":"","sources":["../../src/schemas/account-health.ts"],"names":[],"mappings":"AA8CA;;;;;GAKG;AACH,MAAM,CAAN,IAAY,UAIX;AAJD,WAAY,UAAU;IACpB,+EAA0B,CAAA;IAC1B,uEAAsB,CAAA;IACtB,uFAA8B,CAAA;AAChC,CAAC,EAJW,UAAU,KAAV,UAAU,QAIrB;AAED;;;;;;;GAOG;AACH,MAAM,CAAN,IAAY,UAMX;AAND,WAAY,UAAU;IACpB,+CAAU,CAAA;IACV,uDAAc,CAAA;IACd,+CAAU,CAAA;IACV,yCAAO,CAAA;IACP,2CAAQ,CAAA;AACV,CAAC,EANW,UAAU,KAAV,UAAU,QAMrB;AAED;;;;;;GAMG;AACH,MAAM,CAAN,IAAY,iBAKX;AALD,WAAY,iBAAiB;IAC3B,yDAAQ,CAAA;IACR,mFAAqB,CAAA;IACrB,yDAAQ,CAAA;IACR,mEAAa,CAAA;AACf,CAAC,EALW,iBAAiB,KAAjB,iBAAiB,QAK5B;AAgVD;;;;GAIG;AACH,MAAM,CAAN,IAAY,aA8DX;AA9DD,WAAY,aAAa;IACvB,iFAAwB,CAAA;IACxB,qFAA0B,CAAA;IAC1B,qGAAkC,CAAA;IAClC,mGAAiC,CAAA;IACjC,6EAAsB,CAAA;IACtB,4FAA8B,CAAA;IAC9B,kDAAS,CAAA;IACT,wEAAoB,CAAA;IACpB,8FAA+B,CAAA;IAC/B,4FAA8B,CAAA;IAC9B,4FAA8B,CAAA;IAC9B,0GAAqC,CAAA;IACrC,sFAA2B,CAAA;IAC3B,8GAAuC,CAAA;IACvC,4EAAsB,CAAA;IACtB,8EAAuB,CAAA;IACvB,kFAAyB,CAAA;IACzB,wEAAoB,CAAA;IACpB,kFAAyB,CAA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BAAkB,KAAlB,kBAAkB,QAe7B"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
export type InputValidationType =
|
|
2
|
-
export type FormatType =
|
|
3
|
-
export type DateFormatType =
|
|
4
|
-
export type InputType =
|
|
1
|
+
export type InputValidationType = "INT_TYPE" | "STRING_TYPE" | "ENUM_TYPE" | "FLOAT_TYPE" | "DATE_TYPE" | "TIMESTAMP_TYPE";
|
|
2
|
+
export type FormatType = "NORMAL" | "QUANTITATIVE";
|
|
3
|
+
export type DateFormatType = "YEAR_MONTH_DATE" | "YEAR_MONTH";
|
|
4
|
+
export type InputType = "DROP_DOWN" | "MULTIPLE_SELECT" | "TEXT_FILED" | "COMBO_BOX" | "MULTIPLE_SELECT_COMBO_BOX";
|
|
5
5
|
export interface AttributeValue {
|
|
6
6
|
value_id: number;
|
|
7
7
|
original_value_name: string;
|
package/lib/schemas/fetch.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { RequestInit } from
|
|
2
|
-
export type FetchOptions = Omit<RequestInit,
|
|
1
|
+
import { RequestInit } from "node-fetch";
|
|
2
|
+
export type FetchOptions = Omit<RequestInit, "body"> & {
|
|
3
3
|
params?: Record<string, string | number | boolean | undefined | null | (string | number | boolean)[]>;
|
|
4
4
|
body?: unknown;
|
|
5
5
|
auth?: boolean;
|
package/lib/schemas/index.d.ts
CHANGED
|
@@ -1,12 +1,13 @@
|
|
|
1
|
-
export * from
|
|
2
|
-
export * from
|
|
3
|
-
export * from
|
|
4
|
-
export * from
|
|
5
|
-
export * from
|
|
6
|
-
export * from
|
|
7
|
-
export * from
|
|
8
|
-
export * from
|
|
9
|
-
export * from
|
|
10
|
-
export * from
|
|
11
|
-
export * from
|
|
12
|
-
export * from
|
|
1
|
+
export * from "./access-token.js";
|
|
2
|
+
export * from "./attribute.js";
|
|
3
|
+
export * from "./authed-merchant.js";
|
|
4
|
+
export * from "./authed-shop.js";
|
|
5
|
+
export * from "./category.js";
|
|
6
|
+
export * from "./fetch.js";
|
|
7
|
+
export * from "./order.js";
|
|
8
|
+
export * from "./product.js";
|
|
9
|
+
export * from "./public.js";
|
|
10
|
+
export * from "./push.js";
|
|
11
|
+
export * from "./region.js";
|
|
12
|
+
export * from "./ads.js";
|
|
13
|
+
export * from "./account-health.js";
|
package/lib/schemas/index.js
CHANGED
|
@@ -1,13 +1,14 @@
|
|
|
1
|
-
export * from
|
|
2
|
-
export * from
|
|
3
|
-
export * from
|
|
4
|
-
export * from
|
|
5
|
-
export * from
|
|
6
|
-
export * from
|
|
7
|
-
export * from
|
|
8
|
-
export * from
|
|
9
|
-
export * from
|
|
10
|
-
export * from
|
|
11
|
-
export * from
|
|
12
|
-
export * from
|
|
1
|
+
export * from "./access-token.js";
|
|
2
|
+
export * from "./attribute.js";
|
|
3
|
+
export * from "./authed-merchant.js";
|
|
4
|
+
export * from "./authed-shop.js";
|
|
5
|
+
export * from "./category.js";
|
|
6
|
+
export * from "./fetch.js";
|
|
7
|
+
export * from "./order.js";
|
|
8
|
+
export * from "./product.js";
|
|
9
|
+
export * from "./public.js";
|
|
10
|
+
export * from "./push.js";
|
|
11
|
+
export * from "./region.js";
|
|
12
|
+
export * from "./ads.js";
|
|
13
|
+
export * from "./account-health.js";
|
|
13
14
|
//# sourceMappingURL=index.js.map
|
package/lib/schemas/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/schemas/index.ts"],"names":[],"mappings":"AAAA,cAAc,mBAAmB,CAAC;AAClC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,sBAAsB,CAAC;AACrC,cAAc,kBAAkB,CAAC;AACjC,cAAc,eAAe,CAAC;AAC9B,cAAc,YAAY,CAAC;AAC3B,cAAc,YAAY,CAAC;AAC3B,cAAc,cAAc,CAAC;AAC7B,cAAc,aAAa,CAAC;AAC5B,cAAc,WAAW,CAAC;AAC1B,cAAc,aAAa,CAAC;AAC5B,cAAc,UAAU,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/schemas/index.ts"],"names":[],"mappings":"AAAA,cAAc,mBAAmB,CAAC;AAClC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,sBAAsB,CAAC;AACrC,cAAc,kBAAkB,CAAC;AACjC,cAAc,eAAe,CAAC;AAC9B,cAAc,YAAY,CAAC;AAC3B,cAAc,YAAY,CAAC;AAC3B,cAAc,cAAc,CAAC;AAC7B,cAAc,aAAa,CAAC;AAC5B,cAAc,WAAW,CAAC;AAC1B,cAAc,aAAa,CAAC;AAC5B,cAAc,UAAU,CAAC;AACzB,cAAc,qBAAqB,CAAC"}
|
package/lib/schemas/order.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { FetchResponse } from
|
|
1
|
+
import { FetchResponse } from "./fetch.js";
|
|
2
2
|
/**
|
|
3
3
|
* Represents an item in an order with detailed product information
|
|
4
4
|
*/
|
|
@@ -73,31 +73,31 @@ export interface PackageItem {
|
|
|
73
73
|
*/
|
|
74
74
|
export type LogisticsStatus =
|
|
75
75
|
/** Initial status, order not ready for fulfillment */
|
|
76
|
-
|
|
76
|
+
"LOGISTICS_NOT_STARTED"
|
|
77
77
|
/** order arranged shipment */
|
|
78
|
-
|
|
|
78
|
+
| "LOGISTICS_REQUEST_CREATED"
|
|
79
79
|
/** order handed over to 3PL */
|
|
80
|
-
|
|
|
80
|
+
| "LOGISTICS_PICKUP_DONE"
|
|
81
81
|
/** order pending 3PL retry pickup */
|
|
82
|
-
|
|
|
82
|
+
| "LOGISTICS_PICKUP_RETRY"
|
|
83
83
|
/** order cancelled by 3PL due to failed pickup or picked up but not able to proceed with delivery */
|
|
84
|
-
|
|
|
84
|
+
| "LOGISTICS_PICKUP_FAILED"
|
|
85
85
|
/** order successfully delivered */
|
|
86
|
-
|
|
|
86
|
+
| "LOGISTICS_DELIVERY_DONE"
|
|
87
87
|
/** order cancelled due to 3PL delivery failed */
|
|
88
|
-
|
|
|
88
|
+
| "LOGISTICS_DELIVERY_FAILED"
|
|
89
89
|
/** order cancelled when order at LOGISTICS_REQUEST_CREATED */
|
|
90
|
-
|
|
|
90
|
+
| "LOGISTICS_REQUEST_CANCELED"
|
|
91
91
|
/** Integrated logistics COD: Order rejected for COD */
|
|
92
|
-
|
|
|
92
|
+
| "LOGISTICS_COD_REJECTED"
|
|
93
93
|
/** order ready for fulfilment from payment perspective: non-COD: order paid, COD: order passed COD screening */
|
|
94
|
-
|
|
|
94
|
+
| "LOGISTICS_READY"
|
|
95
95
|
/** order cancelled when order at LOGISTICS_READY */
|
|
96
|
-
|
|
|
96
|
+
| "LOGISTICS_INVALID"
|
|
97
97
|
/** order cancelled due to 3PL lost the order */
|
|
98
|
-
|
|
|
98
|
+
| "LOGISTICS_LOST"
|
|
99
99
|
/** order logistics pending arrangement */
|
|
100
|
-
|
|
|
100
|
+
| "LOGISTICS_PENDING_ARRANGE";
|
|
101
101
|
/**
|
|
102
102
|
* Represents a package in an order with shipping information
|
|
103
103
|
*/
|
|
@@ -262,31 +262,31 @@ export interface Order {
|
|
|
262
262
|
/**
|
|
263
263
|
* The kind of time range field for order list query
|
|
264
264
|
*/
|
|
265
|
-
export type TimeRangeField =
|
|
265
|
+
export type TimeRangeField = "create_time" | "update_time";
|
|
266
266
|
/**
|
|
267
267
|
* The status of an order
|
|
268
268
|
*/
|
|
269
269
|
export type OrderStatus =
|
|
270
270
|
/** Order is created, buyer has not paid yet */
|
|
271
|
-
|
|
271
|
+
"UNPAID"
|
|
272
272
|
/** Seller can arrange shipment */
|
|
273
|
-
|
|
|
273
|
+
| "READY_TO_SHIP"
|
|
274
274
|
/** Seller has arranged shipment online and got tracking number from 3PL */
|
|
275
|
-
|
|
|
275
|
+
| "PROCESSED"
|
|
276
276
|
/** 3PL pickup parcel fail. Need to re arrange shipment */
|
|
277
|
-
|
|
|
277
|
+
| "RETRY_SHIP"
|
|
278
278
|
/** The parcel has been drop to 3PL or picked up by 3PL */
|
|
279
|
-
|
|
|
279
|
+
| "SHIPPED"
|
|
280
280
|
/** The order has been received by buyer */
|
|
281
|
-
|
|
|
281
|
+
| "TO_CONFIRM_RECEIVE"
|
|
282
282
|
/** The order's cancelation is under processing */
|
|
283
|
-
|
|
|
283
|
+
| "IN_CANCEL"
|
|
284
284
|
/** The order has been canceled */
|
|
285
|
-
|
|
|
285
|
+
| "CANCELLED"
|
|
286
286
|
/** The buyer requested to return the order and order's return is processing */
|
|
287
|
-
|
|
|
287
|
+
| "TO_RETURN"
|
|
288
288
|
/** The order has been completed */
|
|
289
|
-
|
|
|
289
|
+
| "COMPLETED";
|
|
290
290
|
/**
|
|
291
291
|
* Represents a single order in the order list response
|
|
292
292
|
*/
|
|
@@ -334,7 +334,7 @@ export interface GetOrderListResponse extends FetchResponse<{
|
|
|
334
334
|
}> {
|
|
335
335
|
}
|
|
336
336
|
export declare const allOptionalFields = "buyer_user_id,buyer_username,estimated_shipping_fee,recipient_address,actual_shipping_fee,goods_to_declare,note,note_update_time,item_list,pay_time,dropshipper,dropshipper_phone,split_up,buyer_cancel_reason,cancel_by,cancel_reason,actual_shipping_fee_confirmed,buyer_cpf_id,fulfillment_flag,pickup_done_time,package_list,shipping_carrier,payment_method,total_amount,invoice_data,order_chargeable_weight_gram,return_request_due_date,edt";
|
|
337
|
-
export type OrderDetailOptionalFields =
|
|
337
|
+
export type OrderDetailOptionalFields = "buyer_user_id" | "buyer_username" | "estimated_shipping_fee" | "recipient_address" | "actual_shipping_fee" | "goods_to_declare" | "note" | "note_update_time" | "item_list" | "pay_time" | "dropshipper" | "dropshipper_phone" | "split_up" | "buyer_cancel_reason" | "cancel_by" | "cancel_reason" | "actual_shipping_fee_confirmed" | "buyer_cpf_id" | "fulfillment_flag" | "pickup_done_time" | "package_list" | "shipping_carrier" | "payment_method" | "total_amount" | "invoice_data" | "order_chargeable_weight_gram" | "return_request_due_date" | "edt";
|
|
338
338
|
/**
|
|
339
339
|
* Parameters for getting order details
|
|
340
340
|
*/
|
package/lib/schemas/order.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export const allOptionalFields =
|
|
1
|
+
export const allOptionalFields = "buyer_user_id,buyer_username,estimated_shipping_fee,recipient_address,actual_shipping_fee,goods_to_declare,note,note_update_time,item_list,pay_time,dropshipper,dropshipper_phone,split_up,buyer_cancel_reason,cancel_by,cancel_reason,actual_shipping_fee_confirmed,buyer_cpf_id,fulfillment_flag,pickup_done_time,package_list,shipping_carrier,payment_method,total_amount,invoice_data,order_chargeable_weight_gram,return_request_due_date,edt";
|
|
2
2
|
//# sourceMappingURL=order.js.map
|
package/lib/schemas/payment.d.ts
CHANGED
package/lib/schemas/product.d.ts
CHANGED
package/lib/schemas/product.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"product.js","sourceRoot":"","sources":["../../src/schemas/product.ts"],"names":[],"mappings":"AAIA;;GAEG;AACH,MAAM,CAAN,IAAY,UAOX;AAPD,WAAY,UAAU;IACpB,+BAAiB,CAAA;IACjB,+BAAiB,CAAA;IACjB,+BAAiB,CAAA;IACjB,qCAAuB,CAAA;IACvB,6CAA+B,CAAA;IAC/B,6CAA+B,CAAA;AACjC,CAAC,EAPW,UAAU,KAAV,UAAU,QAOrB
|
|
1
|
+
{"version":3,"file":"product.js","sourceRoot":"","sources":["../../src/schemas/product.ts"],"names":[],"mappings":"AAIA;;GAEG;AACH,MAAM,CAAN,IAAY,UAOX;AAPD,WAAY,UAAU;IACpB,+BAAiB,CAAA;IACjB,+BAAiB,CAAA;IACjB,+BAAiB,CAAA;IACjB,qCAAuB,CAAA;IACvB,6CAA+B,CAAA;IAC/B,6CAA+B,CAAA;AACjC,CAAC,EAPW,UAAU,KAAV,UAAU,QAOrB"}
|
package/lib/schemas/push.d.ts
CHANGED
|
@@ -10,7 +10,7 @@ export interface SetAppPushConfigParams extends Record<string, string | number |
|
|
|
10
10
|
export type SetAppPushConfigResponse = FetchResponse<{
|
|
11
11
|
result: string;
|
|
12
12
|
}>;
|
|
13
|
-
export type LivePushStatus =
|
|
13
|
+
export type LivePushStatus = "Normal" | "Warning" | "Suspended";
|
|
14
14
|
export interface GetAppPushConfigResponse extends FetchResponse<{
|
|
15
15
|
callback_url: string;
|
|
16
16
|
live_push_status: LivePushStatus;
|
package/lib/schemas/region.js
CHANGED
|
@@ -7,10 +7,10 @@ export var ShopeeRegion;
|
|
|
7
7
|
ShopeeRegion["TEST_CHINA"] = "TEST_CHINA";
|
|
8
8
|
})(ShopeeRegion || (ShopeeRegion = {}));
|
|
9
9
|
export const SHOPEE_BASE_URLS = {
|
|
10
|
-
[ShopeeRegion.GLOBAL]:
|
|
11
|
-
[ShopeeRegion.CHINA]:
|
|
12
|
-
[ShopeeRegion.BRAZIL]:
|
|
13
|
-
[ShopeeRegion.TEST_GLOBAL]:
|
|
14
|
-
[ShopeeRegion.TEST_CHINA]:
|
|
10
|
+
[ShopeeRegion.GLOBAL]: "https://partner.shopeemobile.com/api/v2",
|
|
11
|
+
[ShopeeRegion.CHINA]: "https://openplatform.shopee.cn/api/v2/public",
|
|
12
|
+
[ShopeeRegion.BRAZIL]: "https://openplatform.shopee.com.br/api/v2",
|
|
13
|
+
[ShopeeRegion.TEST_GLOBAL]: "https://partner.test-stable.shopeemobile.com/api/v2",
|
|
14
|
+
[ShopeeRegion.TEST_CHINA]: "https://openplatform.test-stable.shopee.cn/api/v2",
|
|
15
15
|
};
|
|
16
16
|
//# sourceMappingURL=region.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"voucher.js","sourceRoot":"","sources":["../../src/schemas/voucher.ts"],"names":[],"mappings":"AAEA;;GAEG;AACH,MAAM,CAAN,IAAY,aASX;AATD,WAAY,aAAa;
|
|
1
|
+
{"version":3,"file":"voucher.js","sourceRoot":"","sources":["../../src/schemas/voucher.ts"],"names":[],"mappings":"AAEA;;GAEG;AACH,MAAM,CAAN,IAAY,aASX;AATD,WAAY,aAAa;IACvB,wCAAwC;IACxC,4BAAW,CAAA;IACX,yCAAyC;IACzC,sCAAqB,CAAA;IACrB,gCAAgC;IAChC,oCAAmB,CAAA;IACnB,+BAA+B;IAC/B,oCAAmB,CAAA;AACrB,CAAC,EATW,aAAa,KAAb,aAAa,QASxB"}
|
package/lib/sdk.d.ts
CHANGED
|
@@ -1,15 +1,16 @@
|
|
|
1
|
-
import { ProductManager } from
|
|
2
|
-
import { OrderManager } from
|
|
3
|
-
import { AuthManager } from
|
|
4
|
-
import { ShopeeRegion } from
|
|
5
|
-
import { TokenStorage } from
|
|
6
|
-
import { AccessToken } from
|
|
7
|
-
import { PublicManager } from
|
|
8
|
-
import { PushManager } from
|
|
9
|
-
import { PaymentManager } from
|
|
10
|
-
import { LogisticsManager } from
|
|
11
|
-
import { VoucherManager } from
|
|
12
|
-
import { AdsManager } from
|
|
1
|
+
import { ProductManager } from "./managers/product.manager.js";
|
|
2
|
+
import { OrderManager } from "./managers/order.manager.js";
|
|
3
|
+
import { AuthManager } from "./managers/auth.manager.js";
|
|
4
|
+
import { ShopeeRegion } from "./schemas/region.js";
|
|
5
|
+
import { TokenStorage } from "./storage/token-storage.interface.js";
|
|
6
|
+
import { AccessToken } from "./schemas/access-token.js";
|
|
7
|
+
import { PublicManager } from "./managers/public.manager.js";
|
|
8
|
+
import { PushManager } from "./managers/push.manager.js";
|
|
9
|
+
import { PaymentManager } from "./managers/payment.manager.js";
|
|
10
|
+
import { LogisticsManager } from "./managers/logistics.manager.js";
|
|
11
|
+
import { VoucherManager } from "./managers/voucher.manager.js";
|
|
12
|
+
import { AdsManager } from "./managers/ads.manager.js";
|
|
13
|
+
import { AccountHealthManager } from "./managers/account-health.manager.js";
|
|
13
14
|
export interface ShopeeConfig {
|
|
14
15
|
partner_id: number;
|
|
15
16
|
partner_key: string;
|
|
@@ -30,6 +31,7 @@ export declare class ShopeeSDK {
|
|
|
30
31
|
readonly payment: PaymentManager;
|
|
31
32
|
readonly logistics: LogisticsManager;
|
|
32
33
|
readonly voucher: VoucherManager;
|
|
34
|
+
readonly accountHealth: AccountHealthManager;
|
|
33
35
|
constructor(config: ShopeeConfig, tokenStorage?: TokenStorage);
|
|
34
36
|
getConfig(): ShopeeConfig;
|
|
35
37
|
setRegion(region: ShopeeRegion): void;
|
package/lib/sdk.js
CHANGED
|
@@ -1,16 +1,17 @@
|
|
|
1
|
-
import { ProductManager } from
|
|
2
|
-
import { OrderManager } from
|
|
3
|
-
import { AuthManager } from
|
|
4
|
-
import { ShopeeRegion, SHOPEE_BASE_URLS } from
|
|
5
|
-
import { CustomTokenStorage } from
|
|
6
|
-
import { ShopeeSdkError } from
|
|
7
|
-
import { PublicManager } from
|
|
8
|
-
import { PushManager } from
|
|
9
|
-
import { generateSignature } from
|
|
10
|
-
import { PaymentManager } from
|
|
11
|
-
import { LogisticsManager } from
|
|
12
|
-
import { VoucherManager } from
|
|
13
|
-
import { AdsManager } from
|
|
1
|
+
import { ProductManager } from "./managers/product.manager.js";
|
|
2
|
+
import { OrderManager } from "./managers/order.manager.js";
|
|
3
|
+
import { AuthManager } from "./managers/auth.manager.js";
|
|
4
|
+
import { ShopeeRegion, SHOPEE_BASE_URLS } from "./schemas/region.js";
|
|
5
|
+
import { CustomTokenStorage } from "./storage/custom-token-storage.js";
|
|
6
|
+
import { ShopeeSdkError } from "./errors.js";
|
|
7
|
+
import { PublicManager } from "./managers/public.manager.js";
|
|
8
|
+
import { PushManager } from "./managers/push.manager.js";
|
|
9
|
+
import { generateSignature } from "./utils/signature.js";
|
|
10
|
+
import { PaymentManager } from "./managers/payment.manager.js";
|
|
11
|
+
import { LogisticsManager } from "./managers/logistics.manager.js";
|
|
12
|
+
import { VoucherManager } from "./managers/voucher.manager.js";
|
|
13
|
+
import { AdsManager } from "./managers/ads.manager.js";
|
|
14
|
+
import { AccountHealthManager } from "./managers/account-health.manager.js";
|
|
14
15
|
export class ShopeeSDK {
|
|
15
16
|
constructor(config, tokenStorage) {
|
|
16
17
|
this.config = {
|
|
@@ -32,6 +33,7 @@ export class ShopeeSDK {
|
|
|
32
33
|
this.payment = new PaymentManager(this.config);
|
|
33
34
|
this.logistics = new LogisticsManager(this.config);
|
|
34
35
|
this.voucher = new VoucherManager(this.config);
|
|
36
|
+
this.accountHealth = new AccountHealthManager(this.config);
|
|
35
37
|
}
|
|
36
38
|
getConfig() {
|
|
37
39
|
return this.config;
|
|
@@ -46,11 +48,7 @@ export class ShopeeSDK {
|
|
|
46
48
|
}
|
|
47
49
|
getAuthorizationUrl(redirect_uri) {
|
|
48
50
|
const timestamp = Math.floor(Date.now() / 1000);
|
|
49
|
-
return `${this.config.base_url}/shop/auth_partner?partner_id=${this.config.partner_id}×tamp=${timestamp}&redirect=${redirect_uri}&sign=${generateSignature(this.config.partner_key, [
|
|
50
|
-
this.config.partner_id.toString(),
|
|
51
|
-
'/api/v2/shop/auth_partner',
|
|
52
|
-
timestamp.toString()
|
|
53
|
-
])}`;
|
|
51
|
+
return `${this.config.base_url}/shop/auth_partner?partner_id=${this.config.partner_id}×tamp=${timestamp}&redirect=${redirect_uri}&sign=${generateSignature(this.config.partner_key, [this.config.partner_id.toString(), "/api/v2/shop/auth_partner", timestamp.toString()])}`;
|
|
54
52
|
}
|
|
55
53
|
async authenticateWithCode(code, shopId, mainAccountId) {
|
|
56
54
|
const token = await this.auth.getAccessToken(code, shopId, mainAccountId);
|
|
@@ -63,7 +61,7 @@ export class ShopeeSDK {
|
|
|
63
61
|
async refreshToken(shop_id, merchant_id) {
|
|
64
62
|
const old_token = await this.tokenStorage.get();
|
|
65
63
|
if (!old_token) {
|
|
66
|
-
throw new ShopeeSdkError(
|
|
64
|
+
throw new ShopeeSdkError("No token found to refresh");
|
|
67
65
|
}
|
|
68
66
|
const token = await this.auth.getRefreshToken(old_token.refresh_token, shop_id ?? old_token.shop_id, merchant_id);
|
|
69
67
|
if (!token) {
|
package/lib/sdk.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sdk.js","sourceRoot":"","sources":["../src/sdk.ts"],"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AA2B,CAAC,CAAC;QACxD,CAAC;QACD,MAAM,KAAK,GAAG,MAAM,IAAI,CAAC,IAAI,CAAC,eAAe,CAC3C,SAAS,CAAC,aAAa,EACvB,OAAO,IAAI,SAAS,CAAC,OAAO,EAC5B,WAAW,CACZ,CAAC;QACF,IAAI,CAAC,KAAK,EAAE,CAAC;YACX,OAAO,IAAI,CAAC;QACd,CAAC;QAED,MAAM,IAAI,CAAC,YAAY,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;QACrC,OAAO,KAAK,CAAC;IACf,CAAC;CACF;AAED,eAAe,SAAS,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { AccessToken } from
|
|
2
|
-
import { TokenStorage } from
|
|
1
|
+
import { AccessToken } from "../schemas/access-token.js";
|
|
2
|
+
import { TokenStorage } from "./token-storage.interface.js";
|
|
3
3
|
export declare class CustomTokenStorage implements TokenStorage {
|
|
4
4
|
private readonly tokenPath;
|
|
5
5
|
private readonly defaultTokenPath;
|