mobilyflow-react-native-sdk 0.1.1-alpha.1 → 0.1.1-alpha.12

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 (61) hide show
  1. package/MobilyflowReactNativeSdk.podspec +1 -1
  2. package/android/build.gradle +1 -1
  3. package/android/generated/java/com/mobilyflowreactnativesdk/NativeMobilyflowReactNativeSdkSpec.java +3 -3
  4. package/android/generated/jni/RNMobilyflowReactNativeSdkSpec-generated.cpp +2 -2
  5. package/android/generated/jni/react/renderer/components/RNMobilyflowReactNativeSdkSpec/RNMobilyflowReactNativeSdkSpecJSI-generated.cpp +3 -2
  6. package/android/generated/jni/react/renderer/components/RNMobilyflowReactNativeSdkSpec/RNMobilyflowReactNativeSdkSpecJSI.h +11 -11
  7. package/android/src/main/java/com/mobilyflowreactnativesdk/MobilyflowReactNativeSdkModule.kt +7 -7
  8. package/ios/MobilyflowReactNativeSdk.mm +45 -50
  9. package/ios/Utils/ParserMobilyPurchaseSDKOptions.mm +1 -1
  10. package/ios/generated/RNMobilyflowReactNativeSdkSpec/RNMobilyflowReactNativeSdkSpec-generated.mm +4 -4
  11. package/ios/generated/RNMobilyflowReactNativeSdkSpec/RNMobilyflowReactNativeSdkSpec.h +3 -2
  12. package/ios/generated/RNMobilyflowReactNativeSdkSpecJSI-generated.cpp +3 -2
  13. package/ios/generated/RNMobilyflowReactNativeSdkSpecJSI.h +11 -11
  14. package/lib/commonjs/MobilyPurchaseSDK.js +8 -6
  15. package/lib/commonjs/MobilyPurchaseSDK.js.map +1 -1
  16. package/lib/commonjs/NativeMobilyflowReactNativeSdk.js.map +1 -1
  17. package/lib/commonjs/entities/mobily-customer.js +16 -0
  18. package/lib/commonjs/entities/mobily-customer.js.map +1 -0
  19. package/lib/commonjs/entities/mobily-product.js.map +1 -1
  20. package/lib/commonjs/entities/mobily-subscription-offer.js.map +1 -1
  21. package/lib/commonjs/errors/mobily-purchase-error.js +10 -8
  22. package/lib/commonjs/errors/mobily-purchase-error.js.map +1 -1
  23. package/lib/module/MobilyPurchaseSDK.js +8 -6
  24. package/lib/module/MobilyPurchaseSDK.js.map +1 -1
  25. package/lib/module/NativeMobilyflowReactNativeSdk.js.map +1 -1
  26. package/lib/module/entities/mobily-customer.js +11 -0
  27. package/lib/module/entities/mobily-customer.js.map +1 -0
  28. package/lib/module/entities/mobily-product.js.map +1 -1
  29. package/lib/module/errors/mobily-purchase-error.js +10 -8
  30. package/lib/module/errors/mobily-purchase-error.js.map +1 -1
  31. package/lib/typescript/commonjs/src/MobilyPurchaseSDK.d.ts +4 -3
  32. package/lib/typescript/commonjs/src/MobilyPurchaseSDK.d.ts.map +1 -1
  33. package/lib/typescript/commonjs/src/NativeMobilyflowReactNativeSdk.d.ts +4 -3
  34. package/lib/typescript/commonjs/src/NativeMobilyflowReactNativeSdk.d.ts.map +1 -1
  35. package/lib/typescript/commonjs/src/entities/mobily-customer.d.ts +9 -0
  36. package/lib/typescript/commonjs/src/entities/mobily-customer.d.ts.map +1 -0
  37. package/lib/typescript/commonjs/src/entities/mobily-product.d.ts +1 -0
  38. package/lib/typescript/commonjs/src/entities/mobily-product.d.ts.map +1 -1
  39. package/lib/typescript/commonjs/src/entities/mobily-subscription-offer.d.ts +4 -1
  40. package/lib/typescript/commonjs/src/entities/mobily-subscription-offer.d.ts.map +1 -1
  41. package/lib/typescript/commonjs/src/errors/mobily-purchase-error.d.ts +10 -8
  42. package/lib/typescript/commonjs/src/errors/mobily-purchase-error.d.ts.map +1 -1
  43. package/lib/typescript/module/src/MobilyPurchaseSDK.d.ts +4 -3
  44. package/lib/typescript/module/src/MobilyPurchaseSDK.d.ts.map +1 -1
  45. package/lib/typescript/module/src/NativeMobilyflowReactNativeSdk.d.ts +4 -3
  46. package/lib/typescript/module/src/NativeMobilyflowReactNativeSdk.d.ts.map +1 -1
  47. package/lib/typescript/module/src/entities/mobily-customer.d.ts +9 -0
  48. package/lib/typescript/module/src/entities/mobily-customer.d.ts.map +1 -0
  49. package/lib/typescript/module/src/entities/mobily-product.d.ts +1 -0
  50. package/lib/typescript/module/src/entities/mobily-product.d.ts.map +1 -1
  51. package/lib/typescript/module/src/entities/mobily-subscription-offer.d.ts +4 -1
  52. package/lib/typescript/module/src/entities/mobily-subscription-offer.d.ts.map +1 -1
  53. package/lib/typescript/module/src/errors/mobily-purchase-error.d.ts +10 -8
  54. package/lib/typescript/module/src/errors/mobily-purchase-error.d.ts.map +1 -1
  55. package/package.json +1 -1
  56. package/src/MobilyPurchaseSDK.tsx +8 -6
  57. package/src/NativeMobilyflowReactNativeSdk.ts +4 -3
  58. package/src/entities/mobily-customer.ts +13 -0
  59. package/src/entities/mobily-product.ts +1 -0
  60. package/src/entities/mobily-subscription-offer.ts +4 -1
  61. package/src/errors/mobily-purchase-error.ts +4 -2
@@ -4,6 +4,7 @@ import { MobilyProduct } from './entities/mobily-product';
4
4
  import { MobilySubscriptionGroup } from './entities/mobily-subscription-group';
5
5
  import { MobilyCustomerEntitlement } from './entities/mobily-customer-entitlement';
6
6
  import { WebhookStatus } from './enums/webhook-status';
7
+ import type { MobilyCustomer } from './entities/mobily-customer';
7
8
 
8
9
  export type MobilyPurchaseSDKOptions = {
9
10
  languages?: string[];
@@ -20,7 +21,7 @@ export interface Spec extends TurboModule {
20
21
  instantiate(appId: string, apiKey: string, environment: number, options?: MobilyPurchaseSDKOptions): string;
21
22
  close(uuid: string): void;
22
23
 
23
- login(uuid: string, externalId: string): Promise<void>;
24
+ login(uuid: string, externalRef: string): Promise<MobilyCustomer>;
24
25
  getProducts(uuid: string, identifiers: string[], onlyAvailable: boolean): Promise<MobilyProduct[]>;
25
26
  getSubscriptionGroups(
26
27
  uuid: string,
@@ -34,13 +35,13 @@ export interface Spec extends TurboModule {
34
35
 
35
36
  requestTransferOwnership(uuid: string): Promise<void>;
36
37
  openManageSubscription(uuid: string): Promise<void>;
37
- openRefundDialog(uuid: string, transactionId: string): Promise<boolean>;
38
+ openRefundDialog(uuid: string, productId: string): Promise<boolean>;
38
39
 
39
40
  purchaseProduct(uuid: string, productId: string, options?: PurchaseOptions): Promise<WebhookStatus>;
40
41
 
41
42
  sendDiagnotic(uuid: string): void;
42
43
  getStoreCountry(uuid: string): Promise<string>;
43
- isForwardingEnable(uuid: string): Promise<boolean>;
44
+ isForwardingEnable(uuid: string, externalRef: string): Promise<boolean>;
44
45
  }
45
46
 
46
47
  export default TurboModuleRegistry.getEnforcing<Spec>('MobilyflowReactNativeSdk');
@@ -0,0 +1,13 @@
1
+ import { objectTransformer } from '../utils/object-transformer';
2
+
3
+ export class MobilyCustomer {
4
+ public id: string;
5
+ public createdAt: Date;
6
+ public updatedAt: Date;
7
+ public externalRef: string;
8
+ public isForwardingEnable: boolean;
9
+
10
+ static parseFromAPI(obj: MobilyCustomer) {
11
+ return objectTransformer(obj, { dates: ['createdAt', 'updatedAt'] });
12
+ }
13
+ }
@@ -11,6 +11,7 @@ export class MobilyProduct {
11
11
  deletedAt?: Date;
12
12
 
13
13
  identifier: string;
14
+ externalRef: string;
14
15
  appId: string;
15
16
 
16
17
  name: string;
@@ -3,13 +3,16 @@ import type { PeriodUnit } from '../enums/period-unit';
3
3
 
4
4
  export class MobilySubscriptionOffer {
5
5
  id: string;
6
+ identifier: string;
7
+ externalRef: string;
6
8
  name: string;
7
9
  price: number;
8
10
  currencyCode: string;
9
11
  priceFormatted: string;
10
- isFreeTrial: boolean;
12
+ type: string;
11
13
  periodCount: number;
12
14
  periodUnit: PeriodUnit;
15
+ countBillingCycle: number;
13
16
  ios_offerId: string;
14
17
  extras: any;
15
18
  status: ProductStatus;
@@ -14,14 +14,16 @@ export namespace MobilyPurchaseError {
14
14
 
15
15
  PRODUCT_UNAVAILABLE,
16
16
  NETWORK_UNAVAILABLE,
17
+ BILLING_ISSUE,
17
18
 
18
- WEBHOOK_NOT_PRECESSED,
19
19
  WEBHOOK_FAILED,
20
+ WEBHOOK_NOT_PROCESSED,
20
21
 
21
22
  ALREADY_PURCHASED,
23
+ RENEW_ALREADY_ON_THIS_PLAN,
22
24
  NOT_MANAGED_BY_THIS_STORE_ACCOUNT,
23
25
  STORE_ACCOUNT_ALREADY_HAVE_PURCHASE,
24
- RENEW_ALREADY_ON_THIS_PLAN,
26
+ CUSTOMER_FORWARDED,
25
27
 
26
28
  USER_CANCELED,
27
29
  FAILED,