@amazon-devices/keplerscript-appstore-iap-lib 2.12.13

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.
Files changed (109) hide show
  1. package/LICENSE +7 -0
  2. package/SystemBundles/453be002f64ad366efa41022a9e3a1aa0c200b706a3a12fdf4a93650adb4985c.bundle +15594 -0
  3. package/SystemBundles/453be002f64ad366efa41022a9e3a1aa0c200b706a3a12fdf4a93650adb4985c.bundle.map +1 -0
  4. package/SystemModules/amzn__keplerscript-appstore-iap-lib-2.modules.txt +48 -0
  5. package/SystemModules/amzn__keplerscript-appstore-iap-lib-2.private.modules.txt +110 -0
  6. package/SystemModules/keplerscript-system-bundle-config.json +7 -0
  7. package/dist/PurchasingService.d.ts +87 -0
  8. package/dist/PurchasingService.js +1 -0
  9. package/dist/hooks/useIapProductData.d.ts +37 -0
  10. package/dist/hooks/useIapProductData.js +1 -0
  11. package/dist/hooks/useIapPurchaseUpdates.d.ts +40 -0
  12. package/dist/hooks/useIapPurchaseUpdates.js +1 -0
  13. package/dist/hooks/useIapUserData.d.ts +40 -0
  14. package/dist/hooks/useIapUserData.js +1 -0
  15. package/dist/index.d.ts +5 -0
  16. package/dist/index.js +1 -0
  17. package/dist/internal/NativeIAPRequestHandler.d.ts +2 -0
  18. package/dist/internal/NativeIAPRequestHandler.js +1 -0
  19. package/dist/internal/PurchasingManager.d.ts +1 -0
  20. package/dist/internal/PurchasingManager.js +1 -0
  21. package/dist/internal/constants/IAPSDKConstants.d.ts +1 -0
  22. package/dist/internal/constants/IAPSDKConstants.js +1 -0
  23. package/dist/internal/internalTypes/InternalIAPTypes.d.ts +1 -0
  24. package/dist/internal/internalTypes/InternalIAPTypes.js +1 -0
  25. package/dist/internal/listeners/IResponseListener.d.ts +5 -0
  26. package/dist/internal/listeners/IResponseListener.js +1 -0
  27. package/dist/internal/listeners/InternalModifySubscriptionResponseListener.d.ts +14 -0
  28. package/dist/internal/listeners/InternalModifySubscriptionResponseListener.js +1 -0
  29. package/dist/internal/listeners/InternalPurchaseResponseListener.d.ts +14 -0
  30. package/dist/internal/listeners/InternalPurchaseResponseListener.js +1 -0
  31. package/dist/internal/listeners/ModifySubscriptionResponseListener.d.ts +20 -0
  32. package/dist/internal/listeners/ModifySubscriptionResponseListener.js +1 -0
  33. package/dist/internal/listeners/PurchaseResponseListener.d.ts +18 -0
  34. package/dist/internal/listeners/PurchaseResponseListener.js +1 -0
  35. package/dist/internal/logger/IAPSDKLogger.d.ts +1 -0
  36. package/dist/internal/logger/IAPSDKLogger.js +1 -0
  37. package/dist/internal/operations/handler/APIBaseRequestHandler.d.ts +1 -0
  38. package/dist/internal/operations/handler/APIBaseRequestHandler.js +1 -0
  39. package/dist/internal/operations/handler/basicAck/BasicAckRequestHandler.d.ts +1 -0
  40. package/dist/internal/operations/handler/basicAck/BasicAckRequestHandler.js +1 -0
  41. package/dist/internal/operations/handler/getProductData/GetProductDataRequestHandler.d.ts +1 -0
  42. package/dist/internal/operations/handler/getProductData/GetProductDataRequestHandler.js +1 -0
  43. package/dist/internal/operations/handler/getPurchaseUpdates/GetPurchaseUpdatesRequestHandler.d.ts +1 -0
  44. package/dist/internal/operations/handler/getPurchaseUpdates/GetPurchaseUpdatesRequestHandler.js +1 -0
  45. package/dist/internal/operations/handler/getPurchaseUpdatesAck/GetPurchaseUpdatesAckRequestHandler.d.ts +1 -0
  46. package/dist/internal/operations/handler/getPurchaseUpdatesAck/GetPurchaseUpdatesAckRequestHandler.js +1 -0
  47. package/dist/internal/operations/handler/getUserData/GetUserDataRequestHandler.d.ts +1 -0
  48. package/dist/internal/operations/handler/getUserData/GetUserDataRequestHandler.js +1 -0
  49. package/dist/internal/operations/handler/modifySubscription/ModifySubscriptionRequestHandler.d.ts +1 -0
  50. package/dist/internal/operations/handler/modifySubscription/ModifySubscriptionRequestHandler.js +1 -0
  51. package/dist/internal/operations/handler/notifyFulfillment/NotifyFulfillmentRequestHandler.d.ts +1 -0
  52. package/dist/internal/operations/handler/notifyFulfillment/NotifyFulfillmentRequestHandler.js +1 -0
  53. package/dist/internal/operations/handler/purchase/PurchaseRequestHandler.d.ts +1 -0
  54. package/dist/internal/operations/handler/purchase/PurchaseRequestHandler.js +1 -0
  55. package/dist/internal/operations/handler/userProfileAccess/UserProfileAccessRequestHandler.d.ts +1 -0
  56. package/dist/internal/operations/handler/userProfileAccess/UserProfileAccessRequestHandler.js +1 -0
  57. package/dist/internal/operations/model/APIReqRespBaseModel.d.ts +19 -0
  58. package/dist/internal/operations/model/APIReqRespBaseModel.js +1 -0
  59. package/dist/internal/operations/model/basicAck/BasicAckReqRespBaseModel.d.ts +1 -0
  60. package/dist/internal/operations/model/basicAck/BasicAckReqRespBaseModel.js +1 -0
  61. package/dist/internal/operations/model/basicAck/BasicAckReqRespModelV2.d.ts +1 -0
  62. package/dist/internal/operations/model/basicAck/BasicAckReqRespModelV2.js +1 -0
  63. package/dist/internal/operations/model/getProductData/GetProductDataReqRespBaseModel.d.ts +1 -0
  64. package/dist/internal/operations/model/getProductData/GetProductDataReqRespBaseModel.js +1 -0
  65. package/dist/internal/operations/model/getProductData/GetProductDataReqRespModelV2.d.ts +1 -0
  66. package/dist/internal/operations/model/getProductData/GetProductDataReqRespModelV2.js +1 -0
  67. package/dist/internal/operations/model/getPurchaseUpdates/GetPurchaseUpdatesReqRespBaseModel.d.ts +1 -0
  68. package/dist/internal/operations/model/getPurchaseUpdates/GetPurchaseUpdatesReqRespBaseModel.js +1 -0
  69. package/dist/internal/operations/model/getPurchaseUpdates/GetPurchaseUpdatesReqRespModelV2.d.ts +1 -0
  70. package/dist/internal/operations/model/getPurchaseUpdates/GetPurchaseUpdatesReqRespModelV2.js +1 -0
  71. package/dist/internal/operations/model/getPurchaseUpdatesAck/GetPurchaseUpdatesAckReqRespBaseModel.d.ts +1 -0
  72. package/dist/internal/operations/model/getPurchaseUpdatesAck/GetPurchaseUpdatesAckReqRespBaseModel.js +1 -0
  73. package/dist/internal/operations/model/getPurchaseUpdatesAck/GetPurchaseUpdatesAckReqRespModelV2.d.ts +1 -0
  74. package/dist/internal/operations/model/getPurchaseUpdatesAck/GetPurchaseUpdatesAckReqRespModelV2.js +1 -0
  75. package/dist/internal/operations/model/getUserData/GetUserDataReqRespBaseModel.d.ts +1 -0
  76. package/dist/internal/operations/model/getUserData/GetUserDataReqRespBaseModel.js +1 -0
  77. package/dist/internal/operations/model/getUserData/GetUserDataReqRespModelV2.d.ts +1 -0
  78. package/dist/internal/operations/model/getUserData/GetUserDataReqRespModelV2.js +1 -0
  79. package/dist/internal/operations/model/modifySubscription/ModifySubscriptionReqRespBaseModel.d.ts +1 -0
  80. package/dist/internal/operations/model/modifySubscription/ModifySubscriptionReqRespBaseModel.js +1 -0
  81. package/dist/internal/operations/model/modifySubscription/ModifySubscriptionReqRespModelV2.d.ts +1 -0
  82. package/dist/internal/operations/model/modifySubscription/ModifySubscriptionReqRespModelV2.js +1 -0
  83. package/dist/internal/operations/model/notifyFulfillment/NotifyFulfillmentReqRespBaseModel.d.ts +1 -0
  84. package/dist/internal/operations/model/notifyFulfillment/NotifyFulfillmentReqRespBaseModel.js +1 -0
  85. package/dist/internal/operations/model/notifyFulfillment/NotifyFulfillmentReqRespModelV2.d.ts +1 -0
  86. package/dist/internal/operations/model/notifyFulfillment/NotifyFulfillmentReqRespModelV2.js +1 -0
  87. package/dist/internal/operations/model/purchase/PurchaseReqRespBaseModel.d.ts +1 -0
  88. package/dist/internal/operations/model/purchase/PurchaseReqRespBaseModel.js +1 -0
  89. package/dist/internal/operations/model/purchase/PurchaseReqRespModelV2.d.ts +1 -0
  90. package/dist/internal/operations/model/purchase/PurchaseReqRespModelV2.js +1 -0
  91. package/dist/internal/operations/model/userProfileAccess/UserProfileAccessReqRespModel.d.ts +1 -0
  92. package/dist/internal/operations/model/userProfileAccess/UserProfileAccessReqRespModel.js +1 -0
  93. package/dist/internal/utils/IAPSDKUtils.d.ts +1 -0
  94. package/dist/internal/utils/IAPSDKUtils.js +1 -0
  95. package/dist/internal/utils/cursor/CursorType.d.ts +4 -0
  96. package/dist/internal/utils/cursor/CursorType.js +1 -0
  97. package/dist/internal/utils/cursor/CursorUtils.d.ts +1 -0
  98. package/dist/internal/utils/cursor/CursorUtils.js +1 -0
  99. package/dist/internal/utils/receiptHelper/ReceiptHelper.d.ts +1 -0
  100. package/dist/internal/utils/receiptHelper/ReceiptHelper.js +1 -0
  101. package/dist/internal/utils/validator/ValidatorUtils.d.ts +1 -0
  102. package/dist/internal/utils/validator/ValidatorUtils.js +1 -0
  103. package/dist/kepler/tm-manifest.json +1 -0
  104. package/dist/types/IAPTypes.d.ts +600 -0
  105. package/dist/types/IAPTypes.js +1 -0
  106. package/kepler-compatibility.json +9 -0
  107. package/kepler-transformed-package-info.json +3 -0
  108. package/package.json +1 -0
  109. package/react-native.config.js +19 -0
@@ -0,0 +1,600 @@
1
+ /**
2
+ * Represents the type of product. Can be consumable, entitlement, or subscription content.
3
+ */
4
+ export declare enum ProductType {
5
+ /**
6
+ * Can be purchased multiple times by a customer and is available only on the device from which it is purchased.
7
+ */
8
+ CONSUMABLE = 1,
9
+ /**
10
+ * Can be purchased only one time by a customer and is available on all compatible devices registered to the
11
+ * customer account.
12
+ */
13
+ ENTITLED = 2,
14
+ /**
15
+ * It is bound by a period of time and is available on all eligible devices registered to the customer account.
16
+ */
17
+ SUBSCRIPTION = 3
18
+ }
19
+ /**
20
+ * Contains data about Amazon Coins that may be rewarded to customers after they purchase the associated Product.
21
+ */
22
+ export interface CoinsReward {
23
+ /**
24
+ * Provides the number of Amazon Coins that a customer may be rewarded after purchasing the associated Product.
25
+ */
26
+ amount: number;
27
+ }
28
+ /**
29
+ * Data model for Price
30
+ */
31
+ export interface Price {
32
+ /**
33
+ * Locale formatted price string including currency symbol and value.
34
+ */
35
+ priceStr: string;
36
+ /**
37
+ * ISO 4217 currency code
38
+ */
39
+ priceCurrencyCode: string;
40
+ /**
41
+ * Price value in micros. 1,000,000 micros is equal to 1 unit of currency value.
42
+ * Example: If the price is $2, then the valueInMicros would be 2,000,000.
43
+ * <br/> <b>Note:</b> If you want to convert the micros value to actual currency value, type cast the
44
+ * micros value to a decimal precision datatype and then divide it by 1M.
45
+ */
46
+ valueInMicros: bigint;
47
+ }
48
+ /**
49
+ * Represents a promotion plan such as "Introductory promotion with $3.00 weekly for 3 terms",
50
+ * where, the {@link Promotion} object contains a list of such promotion plans
51
+ */
52
+ export interface PromotionPlan {
53
+ /**
54
+ * Represents the promotion period associated with the current instance of PromotionPlan.
55
+ * Examples of promotion periods include weekly, monthly, annually, etc.
56
+ */
57
+ period: string;
58
+ /**
59
+ * Represents the localized price of this promotion.
60
+ */
61
+ price: Price;
62
+ /**
63
+ * Represents the number of cycles with the promotion period of this promotion.
64
+ * Example : "3 cycles of weekly Introductory promotion" would mean
65
+ * 3 iterations of this promotion for a total of 3 weeks of duration.
66
+ */
67
+ priceCycles: bigint;
68
+ }
69
+ /**
70
+ * Represents a promotion configured for a {@link Product}
71
+ */
72
+ export interface Promotion {
73
+ /**
74
+ * Represents the type of promotion associated with the current instance.
75
+ */
76
+ type: string;
77
+ /**
78
+ * Represents the list of promotion plans associated with the promotion type.
79
+ */
80
+ plans: PromotionPlan[];
81
+ }
82
+ /**
83
+ * Represents an in-app product, such as consumable, entitlement, or subscription content. Retrieve
84
+ * product data by using {@link PurchasingService.getProductData} API.
85
+ */
86
+ export interface Product {
87
+ /**
88
+ * Number of Amazon Coins that a customer may be rewarded after purchasing the associated Product.
89
+ */
90
+ coinsReward: CoinsReward;
91
+ /**
92
+ * Localized description of the product.
93
+ */
94
+ description: string;
95
+ /**
96
+ * Price of the product.
97
+ */
98
+ price: Price;
99
+ /**
100
+ * Type of product.
101
+ */
102
+ productType: ProductType;
103
+ /**
104
+ * Stock-keeping unit (SKU) of the product.
105
+ */
106
+ sku: string;
107
+ /**
108
+ * Url of the product's small icon.
109
+ */
110
+ smallIconUrl: string;
111
+ /**
112
+ * Localized title of the product.
113
+ */
114
+ title: string;
115
+ /**
116
+ * Returns the subscription period configured in the Amazon Developer Portal.
117
+ * The subscription period, if not null, contains the
118
+ * duration of the subscription associated with the product.
119
+ * It will be null for non-subscriptions.
120
+ */
121
+ subscriptionPeriod?: string;
122
+ /**
123
+ * Returns the free trial period configured in the Amazon Developer Portal.
124
+ * The free trial period, if not null, contains the duration of the
125
+ * free trial associated with the current product.
126
+ * It may be null.
127
+ */
128
+ freeTrialPeriod?: string;
129
+ /**
130
+ * Represents a list of promotions configured in the Amazon Developer Portal.
131
+ * This List, if not empty, contains the data about all the promotions associated with the current product.
132
+ * It will be empty if promotions are unavailable.
133
+ */
134
+ promotions: Promotion[];
135
+ }
136
+ /**
137
+ * Represents the purchase of consumable, entitlement, or subscription content, as well as the renewal
138
+ * of a subscription.
139
+ */
140
+ export interface Receipt {
141
+ /**
142
+ * Cancel date for the purchase, or null if it is not canceled.
143
+ */
144
+ cancelDate: Date;
145
+ /**
146
+ * If the customer modified/updated the subscription, he can opt for immediate change or change in the
147
+ * next billing cycle. In case its the next billing cycle, we term it deferred.
148
+ * <br/> Deferred date for modified subscription, or null if it is not deferred update.
149
+ */
150
+ deferredDate: Date;
151
+ /**
152
+ * If the customer modified/updated the subscription in the upcoming billing cycle, this field denotes the
153
+ * SKU to be modified to. Would be null if its not deferred update.
154
+ */
155
+ deferredSku: string;
156
+ /**
157
+ * Type of product.
158
+ */
159
+ productType: ProductType;
160
+ /**
161
+ * Purchase date for the purchase.
162
+ */
163
+ purchaseDate: Date;
164
+ /**
165
+ * Receipt ID which is a unique identifier of a purchase.
166
+ */
167
+ receiptId: string;
168
+ /**
169
+ * SKU of the purchase.
170
+ */
171
+ sku: string;
172
+ /**
173
+ * Term SKU of the purchase.
174
+ */
175
+ termSku: string;
176
+ /**
177
+ * Checks cancellation or expiration of the receipt.
178
+ */
179
+ isCancelled: boolean;
180
+ /**
181
+ * Checks if update is deferred.
182
+ */
183
+ isDeferred: boolean;
184
+ }
185
+ /**
186
+ * Supported LWA Consent status.
187
+ *
188
+ * @deprecated since version 2.4.0, use {@link UserProfileAccessConsentStatus}
189
+ */
190
+ export declare enum LwaConsentStatus {
191
+ /**
192
+ * Either IAP SDK is not aware of data access consent status (or) fetchLwaConsentStatus flag was not set in the getUserData request.
193
+ */
194
+ UNAVAILABLE = 1,
195
+ /**
196
+ * User has provided consent to access data.
197
+ */
198
+ CONSENTED = 2
199
+ }
200
+ /**
201
+ * Supported Consent status for user profile access.
202
+ */
203
+ export declare enum UserProfileAccessConsentStatus {
204
+ /**
205
+ * Either IAP SDK is not aware of data access consent status (or) fetchUserProfileAccessConsentStatus flag was not set in the getUserData request.
206
+ */
207
+ UNAVAILABLE = 1,
208
+ /**
209
+ * User has provided consent to access data.
210
+ */
211
+ CONSENTED = 2
212
+ }
213
+ /**
214
+ * Represents the user information of the customer that is used for in-app purchases.
215
+ */
216
+ export interface UserData {
217
+ /**
218
+ * Two character Alpha-2 code of ISO_3166-1 denoting the marketplace of the user.
219
+ */
220
+ marketplace: string;
221
+ /**
222
+ * Returns the user ID.
223
+ */
224
+ userId: string;
225
+ /**
226
+ * The LWA data share consent status of the user.
227
+ *
228
+ * @deprecated since version 2.4.0, use {@link userProfileAccessConsentStatus}
229
+ */
230
+ lwaConsentStatus: LwaConsentStatus;
231
+ /**
232
+ * The profile share consent status of the user.
233
+ */
234
+ userProfileAccessConsentStatus: UserProfileAccessConsentStatus;
235
+ }
236
+ /**
237
+ * Represents the id of any in-app purchasing request.
238
+ */
239
+ export interface RequestId {
240
+ /**
241
+ * Encoded string form of the RequestId.
242
+ */
243
+ requestIdStr: string;
244
+ }
245
+ /**
246
+ * Input parameters for purchase request.
247
+ */
248
+ export interface PurchaseRequest {
249
+ /**
250
+ * SKU to purchase.
251
+ */
252
+ sku: string;
253
+ }
254
+ /**
255
+ * Input parameters for Modify Subscription request.
256
+ */
257
+ export interface ModifySubscriptionRequest {
258
+ /**
259
+ * Vendor SKU for which to initiate subscription modification.
260
+ */
261
+ sku: string;
262
+ /**
263
+ * Subscription proration mode.
264
+ */
265
+ prorationMode: ProrationMode;
266
+ }
267
+ /**
268
+ * Input parameters for purchase updates retrieval request.
269
+ */
270
+ export interface PurchaseUpdatesRequest {
271
+ /**
272
+ * Set to true to get a list of all purchases. Set to false to get a list of all purchases made since the
273
+ * last invocation.
274
+ */
275
+ reset: boolean;
276
+ }
277
+ /**
278
+ * Input parameters for the requests to get product data.
279
+ */
280
+ export interface ProductDataRequest {
281
+ /**
282
+ * SKU for which product data has to be retrieved.
283
+ */
284
+ skus: string[];
285
+ }
286
+ /**
287
+ * Represents the fulfillment result for an in-app purchase.
288
+ */
289
+ export declare enum FulfillmentResult {
290
+ /**
291
+ * App successfully fulfilled the purchase.
292
+ */
293
+ FULFILLED = 1,
294
+ /**
295
+ * Purchase can never be fulfilled by the app.
296
+ */
297
+ UNAVAILABLE = 2
298
+ }
299
+ /**
300
+ * Input parameters for fulfillment status notification request.
301
+ */
302
+ export interface NotifyFulfillmentRequest {
303
+ /**
304
+ * Receipt ID of the purchase.
305
+ */
306
+ receiptId: string;
307
+ /**
308
+ * Result of the fulfillment.
309
+ */
310
+ fulfillmentResult: FulfillmentResult;
311
+ }
312
+ /**
313
+ * Input parameters for User data fetching request.
314
+ */
315
+ export interface UserDataRequest {
316
+ /**
317
+ * Set this optional flag to fetch LwaConsentStatus
318
+ *
319
+ * @deprecated since version 2.4.0, use {@link fetchUserProfileAccessConsentStatus}
320
+ */
321
+ fetchLwaConsentStatus?: boolean;
322
+ /**
323
+ * Set this optional flag to fetch UserProfileAccessConsentStatus
324
+ */
325
+ fetchUserProfileAccessConsentStatus?: boolean;
326
+ }
327
+ /**
328
+ * Represents the response code for a purchase request initiated via {@link PurchasingService.purchase}.
329
+ */
330
+ export declare enum PurchaseResponseCode {
331
+ /**
332
+ * Indicates that the purchase was successfully completed.
333
+ */
334
+ SUCCESSFUL = 0,
335
+ /**
336
+ * Indicates that the customer already owns the provided SKU.
337
+ */
338
+ ALREADY_PURCHASED = 1,
339
+ /**
340
+ * Indicates that the SKU originally provided to the PurchasingService.purchase(String) method is not valid.
341
+ */
342
+ INVALID_SKU = 2,
343
+ /**
344
+ * Indicates this call is not supported.
345
+ */
346
+ NOT_SUPPORTED = 3,
347
+ /**
348
+ * Indicates that the purchase failed.
349
+ */
350
+ FAILED = 4
351
+ }
352
+ /**
353
+ * Represents the result of a call to {@link PurchasingService.purchase}.
354
+ */
355
+ export interface PurchaseResponse {
356
+ /**
357
+ * A Receipt if purchaseResponseCode is PurchaseResponseCode.SUCCESSFUL, otherwise null.
358
+ */
359
+ receipt: Receipt;
360
+ /**
361
+ * The request ID originally returned by {@link PurchasingService.purchase}.
362
+ */
363
+ requestId: RequestId;
364
+ /**
365
+ * Status of the purchase request.
366
+ */
367
+ responseCode: PurchaseResponseCode;
368
+ /**
369
+ * Returns the user ID and marketplace information of the user associated with the purchase.
370
+ */
371
+ userData: UserData;
372
+ }
373
+ /**
374
+ * Represents the response code for a purchase updates request initiated via {@link PurchasingService.getPurchaseUpdates}.
375
+ */
376
+ export declare enum PurchaseUpdatesResponseCode {
377
+ /**
378
+ * Indicates that the request was successful.
379
+ */
380
+ SUCCESSFUL = 1,
381
+ /**
382
+ * Indicates this call is not supported.
383
+ */
384
+ NOT_SUPPORTED = 2,
385
+ /**
386
+ * Indicates that the request failed and can be retried.
387
+ */
388
+ FAILED = 3
389
+ }
390
+ /**
391
+ * Represents the result of a call to {@link PurchasingService.getPurchaseUpdates}.
392
+ */
393
+ export interface PurchaseUpdatesResponse {
394
+ /**
395
+ * Receipts, or an empty list if request failed, or there are no receipts.
396
+ */
397
+ receiptList: Receipt[];
398
+ /**
399
+ * Returns the response code of the request.
400
+ */
401
+ responseCode: PurchaseUpdatesResponseCode;
402
+ /**
403
+ * Returns the user ID and marketplace information of the user associated with the purchase.
404
+ */
405
+ userData: UserData;
406
+ /**
407
+ * Returns true if more results are available.
408
+ */
409
+ hasMore: boolean;
410
+ }
411
+ /**
412
+ * Represents the response code for a product data request initiated via {@link PurchasingService.getProductData}.
413
+ */
414
+ export declare enum ProductDataResponseCode {
415
+ /**
416
+ * Indicates that the request was successful.
417
+ */
418
+ SUCCESSFUL = 1,
419
+ /**
420
+ * Indicates this call is not supported.
421
+ */
422
+ NOT_SUPPORTED = 2,
423
+ /**
424
+ * Indicates unsuccessful retrieval of product data.
425
+ */
426
+ FAILED = 3
427
+ }
428
+ /**
429
+ * Represents the result of a call to {@link PurchasingService.getProductData}.
430
+ */
431
+ export interface ProductDataResponse {
432
+ /**
433
+ * Returns product data, keyed by SKU.
434
+ */
435
+ productData: Map<string, Product>;
436
+ /**
437
+ * Returns the response code for the product data request.
438
+ */
439
+ responseCode: ProductDataResponseCode;
440
+ /**
441
+ * Returns the set of SKUs provided in the original request to {@link PurchasingService.getProductData}
442
+ * for which product data is not available.
443
+ */
444
+ unavailableSkus: string[];
445
+ }
446
+ /**
447
+ * Represents the response code of a fulfillment notification request initiated via
448
+ * {@link PurchasingService.notifyFulfillment}.
449
+ */
450
+ export declare enum NotifyFulfillmentResponseCode {
451
+ /**
452
+ * Indicates that the request was successful.
453
+ */
454
+ SUCCESSFUL = 1,
455
+ /**
456
+ * Indicates this call is not supported.
457
+ */
458
+ NOT_SUPPORTED = 2,
459
+ /**
460
+ * Indicates that the request was unsuccessful.
461
+ */
462
+ FAILED = 3
463
+ }
464
+ /**
465
+ * Represents the result of a call to {@link PurchasingService.notifyFulfillment}.
466
+ */
467
+ export interface NotifyFulfillmentResponse {
468
+ /**
469
+ * Returns the response code for the notify fulfillment request.
470
+ */
471
+ responseCode: NotifyFulfillmentResponseCode;
472
+ }
473
+ /**
474
+ * Represents the response code for a get user data request initiated by {@link PurchasingService.getUserData}.
475
+ */
476
+ export declare enum UserDataResponseCode {
477
+ /**
478
+ * Indicates a successful request.
479
+ */
480
+ SUCCESSFUL = 1,
481
+ /**
482
+ * Indicates this call is not supported.
483
+ */
484
+ NOT_SUPPORTED = 2,
485
+ /**
486
+ * Indicates an unsuccessful request.
487
+ */
488
+ FAILED = 3
489
+ }
490
+ /**
491
+ * Represents the result of a call to {@link PurchasingService.getUserData}.
492
+ */
493
+ export interface UserDataResponse {
494
+ /**
495
+ * Returns the user ID and marketplace information of the user associated with the purchase.
496
+ */
497
+ userData: UserData;
498
+ /**
499
+ * Indicates the response code for the getUserData call.
500
+ */
501
+ responseCode: UserDataResponseCode;
502
+ }
503
+ /**
504
+ * Subscription proration modes.
505
+ */
506
+ export declare enum ProrationMode {
507
+ /**
508
+ * Subscription upgrade/downgrade will be triggered immediately. Calling {@link PurchasingService.modifySubscription}
509
+ * with this mode makes Amazon Appstore to charge customer for subscription immediately.
510
+ */
511
+ IMMEDIATE = 0,
512
+ /**
513
+ * Subscription upgrade/downgrade will be triggered after current billing cycle. Calling
514
+ * {@link PurchasingService.modifySubscription} with this mode makes Amazon Appstore to charge customer for
515
+ * subscription after current billing cycle.
516
+ */
517
+ DEFERRED = 1
518
+ }
519
+ /**
520
+ * Represents the response code for a modify subscription request initiated by {@link PurchasingService.modifySubscription}.
521
+ */
522
+ export declare enum ModifySubscriptionResponseCode {
523
+ /**
524
+ * Indicates that the request was successful.
525
+ */
526
+ SUCCESSFUL = 0,
527
+ /**
528
+ * Indicates that the request failed and can be retried.
529
+ */
530
+ FAILED = 1,
531
+ /**
532
+ * Indicates that the SKU originally provided to the modifySubscription request is not valid.
533
+ */
534
+ INVALID_SKU = 2,
535
+ /**
536
+ * Indicates that the SKU originally provided to the modifySubscription request does not satisfy basic
537
+ * criteria to perform a modify request.
538
+ */
539
+ INVALID_REQUEST = 3,
540
+ /**
541
+ * Indicates this call is not supported.
542
+ */
543
+ NOT_SUPPORTED = 4
544
+ }
545
+ /**
546
+ * Represents the result of a call to {@link PurchasingService.modifySubscription}.
547
+ */
548
+ export interface ModifySubscriptionResponse {
549
+ /**
550
+ * Request ID originally returned by {@link PurchasingService.modifySubscription}. This identifier can be used
551
+ * to correlate the original request with this response.
552
+ */
553
+ requestId: RequestId;
554
+ /**
555
+ * Response code for the modifySubscription request.
556
+ */
557
+ responseCode: ModifySubscriptionResponseCode;
558
+ /**
559
+ * User ID and marketplace information of the user associated with the modifySubscription request.
560
+ */
561
+ userData: UserData;
562
+ /**
563
+ * A list of {@link Receipt} if subscription request succeeded, otherwise null.
564
+ */
565
+ receipts: Receipt[];
566
+ }
567
+ /**
568
+ * Represents the response code for a UserProfileAccess request initiated by {@link PurchasingService.requestUserProfileAccess}.
569
+ */
570
+ export declare enum UserProfileAccessResponseCode {
571
+ /**
572
+ * Indicates a successful request.
573
+ */
574
+ SUCCESSFUL = 1,
575
+ /**
576
+ * Indicates this call is not supported.
577
+ */
578
+ NOT_SUPPORTED = 2,
579
+ /**
580
+ * Indicates an unsuccessful request.
581
+ */
582
+ FAILED = 3,
583
+ /**
584
+ * Indicates that service was unavailable at the moment. Try again after some time.
585
+ */
586
+ SERVICE_UNAVAILABLE = 4
587
+ }
588
+ /**
589
+ * Represents the result of a call to {@link PurchasingService.requestUserProfileAccess}.
590
+ */
591
+ export interface UserProfileAccessResponse {
592
+ /**
593
+ * Auth code for user profile access.
594
+ */
595
+ userProfileAccessAuthCode: string;
596
+ /**
597
+ * Returns the response code for UserProfileAccess request.
598
+ */
599
+ responseCode: UserProfileAccessResponseCode;
600
+ }
@@ -0,0 +1 @@
1
+ 'use strict';var a48_0x26bea8=a48_0x33cf;(function(_0x2231ff,_0x3c2b43){var _0x325268=a48_0x33cf,_0x5e561a=_0x2231ff();while(!![]){try{var _0x479f54=-parseInt(_0x325268(0x180))/0x1+parseInt(_0x325268(0x18f))/0x2*(-parseInt(_0x325268(0x18c))/0x3)+-parseInt(_0x325268(0x179))/0x4*(-parseInt(_0x325268(0x18e))/0x5)+-parseInt(_0x325268(0x18d))/0x6+-parseInt(_0x325268(0x187))/0x7*(parseInt(_0x325268(0x19b))/0x8)+-parseInt(_0x325268(0x182))/0x9+parseInt(_0x325268(0x19d))/0xa*(parseInt(_0x325268(0x186))/0xb);if(_0x479f54===_0x3c2b43)break;else _0x5e561a['push'](_0x5e561a['shift']());}catch(_0x5e9817){_0x5e561a['push'](_0x5e561a['shift']());}}}(a48_0x121e,0xea4d3));Object['defineProperty'](exports,a48_0x26bea8(0x184),{'value':!![]}),exports[a48_0x26bea8(0x183)]=exports['ModifySubscriptionResponseCode']=exports[a48_0x26bea8(0x194)]=exports['UserDataResponseCode']=exports[a48_0x26bea8(0x17a)]=exports[a48_0x26bea8(0x18b)]=exports[a48_0x26bea8(0x195)]=exports[a48_0x26bea8(0x199)]=exports['FulfillmentResult']=exports[a48_0x26bea8(0x19c)]=exports[a48_0x26bea8(0x197)]=exports[a48_0x26bea8(0x196)]=void 0x0;var ProductType;(function(_0x39575f){var _0x56d416=a48_0x26bea8;_0x39575f[_0x39575f['CONSUMABLE']=0x1]='CONSUMABLE',_0x39575f[_0x39575f[_0x56d416(0x190)]=0x2]=_0x56d416(0x190),_0x39575f[_0x39575f[_0x56d416(0x185)]=0x3]=_0x56d416(0x185);}(ProductType=exports['ProductType']||(exports[a48_0x26bea8(0x196)]={})));var LwaConsentStatus;(function(_0x36750a){var _0x3458fd=a48_0x26bea8;_0x36750a[_0x36750a[_0x3458fd(0x19a)]=0x1]='UNAVAILABLE',_0x36750a[_0x36750a[_0x3458fd(0x17e)]=0x2]=_0x3458fd(0x17e);}(LwaConsentStatus=exports[a48_0x26bea8(0x197)]||(exports[a48_0x26bea8(0x197)]={})));var UserProfileAccessConsentStatus;(function(_0x1b15b1){var _0x5eae05=a48_0x26bea8;_0x1b15b1[_0x1b15b1[_0x5eae05(0x19a)]=0x1]=_0x5eae05(0x19a),_0x1b15b1[_0x1b15b1[_0x5eae05(0x17e)]=0x2]=_0x5eae05(0x17e);}(UserProfileAccessConsentStatus=exports[a48_0x26bea8(0x19c)]||(exports[a48_0x26bea8(0x19c)]={})));var FulfillmentResult;(function(_0x464b49){var _0x6790fa=a48_0x26bea8;_0x464b49[_0x464b49[_0x6790fa(0x19e)]=0x1]=_0x6790fa(0x19e),_0x464b49[_0x464b49[_0x6790fa(0x19a)]=0x2]='UNAVAILABLE';}(FulfillmentResult=exports[a48_0x26bea8(0x17d)]||(exports[a48_0x26bea8(0x17d)]={})));function a48_0x121e(){var _0x1b5452=['6680236ekUPoB','NotifyFulfillmentResponseCode','NOT_SUPPORTED','INVALID_REQUEST','FulfillmentResult','CONSENTED','INVALID_SKU','1839302wRiLds','ALREADY_PURCHASED','4859703DQGqvM','UserProfileAccessResponseCode','__esModule','SUBSCRIPTION','5256999hiEJLz','7owBezn','DEFERRED','ModifySubscriptionResponseCode','UserDataResponseCode','ProductDataResponseCode','3lgyfDw','9555942XHnkoE','5AFxjmb','3359794SYwOVA','ENTITLED','FAILED','IMMEDIATE','SUCCESSFUL','ProrationMode','PurchaseUpdatesResponseCode','ProductType','LwaConsentStatus','SERVICE_UNAVAILABLE','PurchaseResponseCode','UNAVAILABLE','6347560MtMWEe','UserProfileAccessConsentStatus','120stOGBW','FULFILLED'];a48_0x121e=function(){return _0x1b5452;};return a48_0x121e();}var PurchaseResponseCode;(function(_0x12661e){var _0x1f956f=a48_0x26bea8;_0x12661e[_0x12661e[_0x1f956f(0x193)]=0x0]=_0x1f956f(0x193),_0x12661e[_0x12661e[_0x1f956f(0x181)]=0x1]='ALREADY_PURCHASED',_0x12661e[_0x12661e[_0x1f956f(0x17f)]=0x2]=_0x1f956f(0x17f),_0x12661e[_0x12661e[_0x1f956f(0x17b)]=0x3]=_0x1f956f(0x17b),_0x12661e[_0x12661e['FAILED']=0x4]=_0x1f956f(0x191);}(PurchaseResponseCode=exports[a48_0x26bea8(0x199)]||(exports[a48_0x26bea8(0x199)]={})));var PurchaseUpdatesResponseCode;(function(_0x4a0312){var _0x19710a=a48_0x26bea8;_0x4a0312[_0x4a0312[_0x19710a(0x193)]=0x1]=_0x19710a(0x193),_0x4a0312[_0x4a0312[_0x19710a(0x17b)]=0x2]='NOT_SUPPORTED',_0x4a0312[_0x4a0312[_0x19710a(0x191)]=0x3]=_0x19710a(0x191);}(PurchaseUpdatesResponseCode=exports[a48_0x26bea8(0x195)]||(exports[a48_0x26bea8(0x195)]={})));var ProductDataResponseCode;(function(_0x4eeba6){var _0x40e3de=a48_0x26bea8;_0x4eeba6[_0x4eeba6[_0x40e3de(0x193)]=0x1]=_0x40e3de(0x193),_0x4eeba6[_0x4eeba6[_0x40e3de(0x17b)]=0x2]=_0x40e3de(0x17b),_0x4eeba6[_0x4eeba6[_0x40e3de(0x191)]=0x3]=_0x40e3de(0x191);}(ProductDataResponseCode=exports['ProductDataResponseCode']||(exports[a48_0x26bea8(0x18b)]={})));var NotifyFulfillmentResponseCode;(function(_0x2ab5e9){var _0x309d31=a48_0x26bea8;_0x2ab5e9[_0x2ab5e9[_0x309d31(0x193)]=0x1]='SUCCESSFUL',_0x2ab5e9[_0x2ab5e9[_0x309d31(0x17b)]=0x2]=_0x309d31(0x17b),_0x2ab5e9[_0x2ab5e9[_0x309d31(0x191)]=0x3]=_0x309d31(0x191);}(NotifyFulfillmentResponseCode=exports['NotifyFulfillmentResponseCode']||(exports['NotifyFulfillmentResponseCode']={})));var UserDataResponseCode;(function(_0x5a351b){var _0x429e5f=a48_0x26bea8;_0x5a351b[_0x5a351b[_0x429e5f(0x193)]=0x1]=_0x429e5f(0x193),_0x5a351b[_0x5a351b[_0x429e5f(0x17b)]=0x2]='NOT_SUPPORTED',_0x5a351b[_0x5a351b[_0x429e5f(0x191)]=0x3]=_0x429e5f(0x191);}(UserDataResponseCode=exports[a48_0x26bea8(0x18a)]||(exports['UserDataResponseCode']={})));var ProrationMode;(function(_0x583d23){var _0xa4b387=a48_0x26bea8;_0x583d23[_0x583d23['IMMEDIATE']=0x0]=_0xa4b387(0x192),_0x583d23[_0x583d23[_0xa4b387(0x188)]=0x1]='DEFERRED';}(ProrationMode=exports[a48_0x26bea8(0x194)]||(exports[a48_0x26bea8(0x194)]={})));var ModifySubscriptionResponseCode;(function(_0x1a8556){var _0x31a3aa=a48_0x26bea8;_0x1a8556[_0x1a8556[_0x31a3aa(0x193)]=0x0]=_0x31a3aa(0x193),_0x1a8556[_0x1a8556[_0x31a3aa(0x191)]=0x1]=_0x31a3aa(0x191),_0x1a8556[_0x1a8556[_0x31a3aa(0x17f)]=0x2]=_0x31a3aa(0x17f),_0x1a8556[_0x1a8556['INVALID_REQUEST']=0x3]=_0x31a3aa(0x17c),_0x1a8556[_0x1a8556[_0x31a3aa(0x17b)]=0x4]=_0x31a3aa(0x17b);}(ModifySubscriptionResponseCode=exports[a48_0x26bea8(0x189)]||(exports['ModifySubscriptionResponseCode']={})));function a48_0x33cf(_0x481ce2,_0x3e9849){var _0x121e9c=a48_0x121e();return a48_0x33cf=function(_0x33cf5c,_0x57d99d){_0x33cf5c=_0x33cf5c-0x179;var _0x45540b=_0x121e9c[_0x33cf5c];return _0x45540b;},a48_0x33cf(_0x481ce2,_0x3e9849);}var UserProfileAccessResponseCode;(function(_0x2ac471){var _0x42f993=a48_0x26bea8;_0x2ac471[_0x2ac471[_0x42f993(0x193)]=0x1]='SUCCESSFUL',_0x2ac471[_0x2ac471[_0x42f993(0x17b)]=0x2]=_0x42f993(0x17b),_0x2ac471[_0x2ac471[_0x42f993(0x191)]=0x3]=_0x42f993(0x191),_0x2ac471[_0x2ac471[_0x42f993(0x198)]=0x4]=_0x42f993(0x198);}(UserProfileAccessResponseCode=exports[a48_0x26bea8(0x183)]||(exports[a48_0x26bea8(0x183)]={})));
@@ -0,0 +1,9 @@
1
+ {
2
+ "versions": {
3
+ "2.12.9": "/com.amazon.kepler.appstore_iap_lib_2@IAppstoreIapLib_12",
4
+ "2.12.10": "/com.amazon.kepler.appstore_iap_lib_2@IAppstoreIapLib_12",
5
+ "2.12.11": "/com.amazon.kepler.appstore_iap_lib_2@IAppstoreIapLib_12",
6
+ "2.12.12": "/com.amazon.kepler.appstore_iap_lib_2@IAppstoreIapLib_12",
7
+ "2.12.13": "/com.amazon.kepler.appstore_iap_lib_2@IAppstoreIapLib_12"
8
+ }
9
+ }
@@ -0,0 +1,3 @@
1
+ {
2
+ "sourcePackageRef": "@amzn/keplerscript-appstore-iap-lib"
3
+ }
package/package.json ADDED
@@ -0,0 +1 @@
1
+ {"name": "@amazon-devices/keplerscript-appstore-iap-lib", "version": "2.12.13", "main": "dist/index.js", "types": "dist/index.d.ts", "files": ["dist", "react-native.config.js", "kepler-compatibility.json", "SystemModules", "SystemBundles", "kepler-transformed-package-info.json"], "scripts": {"compile": "tsc", "start": "ENABLE_METRO_BB_WS=1 node node_modules/react-native/local-cli/cli.js start", "obfuscate": "javascript-obfuscator dist -o dist --ignore-imports true", "clean": "rm -rf build bundle kepler-build dist node_modules", "build": "npm-run-all lint test compile obfuscate", "test": "jest --colors --config jestconfig.json", "codegen": "react-native-tscodegen ./react-native-tscodegen.json", "lint": "eslint --fix src --ext .js,.ts,.tsx", "autofix": "eslint --fix src --ext .ts,.tsx", "format": "prettier --write 'src/*.{md,json}' 'src/*.{js,jsx,ts,tsx}' '!.tmp/**'", "prepublishOnly": "KEPLER_NPM_COMMAND=npm-pretty-much react-native build-system-bundle-kepler"}, "dependencies": {"@amazon-devices/keplerscript-turbomodule-api": "^1.0.0", "react": "18.2.0", "react-native": "0.72.0", "react-native-uuid": "^2.0.1", "@amazon-devices/react-native-kepler": "^2.0.0"}, "devDependencies": {"@babel/core": "^7.20.0", "@babel/runtime": "^7.20.0", "@babel/preset-react": "^7.20.0", "@react-native-community/eslint-config": "^3.0.1", "@types/jest": "^28.0.0", "eslint": "^8.12.0", "eslint-config-prettier": "^6.11.0", "eslint-plugin-simple-import-sort": "^5.0.3", "jest": "^28.0.0", "npm-run-all": "^4.1.5", "prettier": "^2.6.2", "ts-jest": "^28.0.0", "typescript": "4.8.4", "javascript-obfuscator": "^4.0.2", "react-native-tscodegen-types": "0.66.0", "react-native-tscodegen": "^0.67.0", "react": "18.2.0", "react-native": "0.72.0", "@amazon-devices/react-native-kepler": "^2.0.0", "react-native-uuid": "^2.0.1", "@amazon-devices/kepler-cli-platform": "^0", "@react-native-community/cli": "^11.2.0"}, "resolutions": {"@types/react": "^18"}, "jest": {"preset": "react-native", "moduleFileExtensions": ["ts", "tsx", "js", "jsx", "json", "node"]}, "kepler": {"projectType": "turbomodule", "targets": ["tv", "auto"], "api": 0.1, "features": ["vega"], "keplerInitializationSharedLibrary": "keplerscript-appstore-iap-lib"}, "license": "See license in LICENSE"}
@@ -0,0 +1,19 @@
1
+
2
+ module.exports = {
3
+ dependency: {
4
+ platforms: {
5
+ kepler: {
6
+ autolink: {
7
+ "keplerscript-appstore-iap-lib": {
8
+ "libraryName": "libkeplerscript-appstore-iap-lib.so",
9
+ "linkDynamic": true,
10
+ "components": [],
11
+ "turbomodules": [
12
+ "AppstoreIAPRequestHandlerModule"
13
+ ]
14
+ }
15
+ }
16
+ },
17
+ },
18
+ },
19
+ };