vrtx-react-native 0.1.70 → 0.1.72

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.
@@ -13,7 +13,7 @@ import sa.vrtx.public.configuration.Language
13
13
  import sa.vrtx.public.configuration.Mode
14
14
  import androidx.compose.ui.text.font.FontFamily
15
15
 
16
- class VrtxAndroidModule : Module() {
16
+ class VrtxSdkModule : Module() {
17
17
 
18
18
  private fun getActivity(): ComponentActivity? {
19
19
  return appContext.activityProvider?.currentActivity as? ComponentActivity
@@ -35,7 +35,7 @@ class VrtxAndroidModule : Module() {
35
35
  }
36
36
 
37
37
  override fun definition() = ModuleDefinition {
38
- Name("VrtxAndroid")
38
+ Name("VrtxSdk")
39
39
 
40
40
  Constant("LIBRARY_NAME") {
41
41
  "vrtx-android"
@@ -1,13 +1,12 @@
1
1
  import { NativeModule } from 'expo';
2
- type VrtxAndroidModuleEvents = {
2
+ type VrtxSdkModuleEvents = {
3
3
  onSuccess: () => void;
4
4
  onError: (params: {
5
5
  code: string;
6
6
  message: string;
7
7
  }) => void;
8
8
  };
9
- declare class VrtxAndroidModule extends NativeModule<VrtxAndroidModuleEvents> {
10
- readonly VERSION: string;
9
+ declare class VrtxSdkModule extends NativeModule<VrtxSdkModuleEvents> {
11
10
  readonly LIBRARY_NAME: string;
12
11
  /**
13
12
  * Initialize and launch the Vrtx SDK UI flow
@@ -21,7 +20,7 @@ declare class VrtxAndroidModule extends NativeModule<VrtxAndroidModuleEvents> {
21
20
  */
22
21
  setup(clientId: string, clientSecret: string, environment: 'SANDBOX' | 'STAGING', language: 'ENGLISH' | 'ARABIC', mode?: 'LIGHT' | 'DARK', fontFamily?: string): Promise<void>;
23
22
  }
24
- declare const _default: VrtxAndroidModule;
23
+ declare const _default: VrtxSdkModule;
25
24
  export default _default;
26
25
  export declare enum Environment {
27
26
  Sandbox = "SANDBOX",
@@ -35,4 +34,4 @@ export declare enum Mode {
35
34
  LIGHT = "LIGHT",
36
35
  DARK = "DARK"
37
36
  }
38
- //# sourceMappingURL=VrtxAndroidModule.d.ts.map
37
+ //# sourceMappingURL=VrtxSdkModule.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"VrtxSdkModule.d.ts","sourceRoot":"","sources":["../src/VrtxSdkModule.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAuB,MAAM,MAAM,CAAC;AAEzD,KAAK,mBAAmB,GAAG;IACzB,SAAS,EAAE,MAAM,IAAI,CAAC;IACtB,OAAO,EAAE,CAAC,MAAM,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,MAAM,CAAA;KAAE,KAAK,IAAI,CAAC;CAC9D,CAAC;AAEF,OAAO,OAAO,aAAc,SAAQ,YAAY,CAAC,mBAAmB,CAAC;IACnE,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAC;IAE9B;;;;;;;;;OASG;IACH,KAAK,CACH,QAAQ,EAAE,MAAM,EAChB,YAAY,EAAE,MAAM,EACpB,WAAW,EAAE,SAAS,GAAG,SAAS,EAClC,QAAQ,EAAE,SAAS,GAAG,QAAQ,EAC9B,IAAI,CAAC,EAAE,OAAO,GAAG,MAAM,EACvB,UAAU,CAAC,EAAE,MAAM,GAClB,OAAO,CAAC,IAAI,CAAC;CACjB;;AAGD,wBAA6D;AAE7D,oBAAY,WAAW;IACrB,OAAO,YAAY;IACnB,OAAO,YAAY;CACpB;AAED,oBAAY,QAAQ;IAClB,OAAO,YAAY;IACnB,MAAM,WAAW;CAClB;AAED,oBAAY,IAAI;IACd,KAAK,UAAU;IACf,IAAI,SAAS;CACd"}
@@ -1,6 +1,6 @@
1
1
  import { NativeModule, requireNativeModule } from 'expo';
2
2
  // This call loads the native module object from the JSI.
3
- export default requireNativeModule('VrtxAndroid');
3
+ export default requireNativeModule('VrtxSdk');
4
4
  export var Environment;
5
5
  (function (Environment) {
6
6
  Environment["Sandbox"] = "SANDBOX";
@@ -16,4 +16,4 @@ export var Mode;
16
16
  Mode["LIGHT"] = "LIGHT";
17
17
  Mode["DARK"] = "DARK";
18
18
  })(Mode || (Mode = {}));
19
- //# sourceMappingURL=VrtxAndroidModule.js.map
19
+ //# sourceMappingURL=VrtxSdkModule.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"VrtxSdkModule.js","sourceRoot":"","sources":["../src/VrtxSdkModule.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,mBAAmB,EAAE,MAAM,MAAM,CAAC;AA8BzD,yDAAyD;AACzD,eAAe,mBAAmB,CAAgB,SAAS,CAAC,CAAC;AAE7D,MAAM,CAAN,IAAY,WAGX;AAHD,WAAY,WAAW;IACrB,kCAAmB,CAAA;IACnB,kCAAmB,CAAA;AACrB,CAAC,EAHW,WAAW,KAAX,WAAW,QAGtB;AAED,MAAM,CAAN,IAAY,QAGX;AAHD,WAAY,QAAQ;IAClB,+BAAmB,CAAA;IACnB,6BAAiB,CAAA;AACnB,CAAC,EAHW,QAAQ,KAAR,QAAQ,QAGnB;AAED,MAAM,CAAN,IAAY,IAGX;AAHD,WAAY,IAAI;IACd,uBAAe,CAAA;IACf,qBAAa,CAAA;AACf,CAAC,EAHW,IAAI,KAAJ,IAAI,QAGf","sourcesContent":["import { NativeModule, requireNativeModule } from 'expo';\n\ntype VrtxSdkModuleEvents = {\n onSuccess: () => void;\n onError: (params: { code: string; message: string }) => void;\n};\n\ndeclare class VrtxSdkModule extends NativeModule<VrtxSdkModuleEvents> {\n readonly LIBRARY_NAME: string;\n\n /**\n * Initialize and launch the Vrtx SDK UI flow\n *\n * @param clientId Your Vrtx client ID from the dashboard\n * @param clientSecret Your Vrtx client secret from the dashboard\n * @param environment The environment (SANDBOX or STAGING)\n * @param language The language for the UI (ENGLISH or ARABIC)\n * @param mode Optional display mode (LIGHT or DARK) - defaults to LIGHT\n * @param fontFamily Optional React Native font family name - defaults to the system font\n */\n setup(\n clientId: string,\n clientSecret: string,\n environment: 'SANDBOX' | 'STAGING',\n language: 'ENGLISH' | 'ARABIC',\n mode?: 'LIGHT' | 'DARK',\n fontFamily?: string,\n ): Promise<void>;\n}\n\n// This call loads the native module object from the JSI.\nexport default requireNativeModule<VrtxSdkModule>('VrtxSdk');\n\nexport enum Environment {\n Sandbox = 'SANDBOX',\n Staging = 'STAGING',\n}\n\nexport enum Language {\n English = 'ENGLISH',\n Arabic = 'ARABIC',\n}\n\nexport enum Mode {\n LIGHT = 'LIGHT',\n DARK = 'DARK',\n}\n"]}
package/build/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
- export { Environment, Language, Mode } from './VrtxAndroidModule';
2
- export { default as VrtxAndroid } from './VrtxAndroidModule';
1
+ export { Environment, Language, Mode } from './VrtxSdkModule';
2
+ export { default as VrtxSdk } from './VrtxSdkModule';
3
3
  export type VrtxEnvironment = 'SANDBOX' | 'STAGING';
4
4
  export type VrtxLanguage = 'ENGLISH' | 'ARABIC';
5
5
  export type VrtxMode = 'LIGHT' | 'DARK';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,WAAW,EAAE,QAAQ,EAAE,IAAI,EAAE,MAAM,qBAAqB,CAAC;AAClE,OAAO,EAAE,OAAO,IAAI,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAG7D,MAAM,MAAM,eAAe,GAAG,SAAS,GAAG,SAAS,CAAC;AACpD,MAAM,MAAM,YAAY,GAAG,SAAS,GAAG,QAAQ,CAAC;AAChD,MAAM,MAAM,QAAQ,GAAG,OAAO,GAAG,MAAM,CAAC;AAExC,MAAM,WAAW,UAAU;IACzB,QAAQ,EAAE,MAAM,CAAC;IACjB,YAAY,EAAE,MAAM,CAAC;IACrB,WAAW,EAAE,eAAe,CAAC;IAC7B,QAAQ,CAAC,EAAE,YAAY,CAAC;IACxB,IAAI,CAAC,EAAE,QAAQ,CAAC;IAChB,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAGD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idModule';
2
+ import VrtxSdkModule from './VrtxSdkModule';
3
3
  // Re-export enums for the public setup contract.
4
- export { Environment, Language, Mode } from './VrtxAndroidModule';
5
- export { default as VrtxAndroid } from './VrtxAndroidModule';
4
+ export { Environment, Language, Mode } from './VrtxSdkModule';
5
+ export { default as VrtxSdk } from './VrtxSdkModule';
6
6
  export async function setup(configOrClientId, clientSecret, environment, language = 'ENGLISH', mode, fontFamily) {
7
7
  const config = typeof configOrClientId === 'string'
8
8
  ? {
@@ -14,10 +14,10 @@ export async function setup(configOrClientId, clientSecret, environment, languag
14
14
  fontFamily,
15
15
  }
16
16
  : configOrClientId;
17
- return await VrtxAndroidModule.setup(config.clientId, config.clientSecret, config.environment, config.language ?? 'ENGLISH', config.mode, config.fontFamily);
17
+ return await VrtxSdkModule.setup(config.clientId, config.clientSecret, config.environment, config.language ?? 'ENGLISH', config.mode, config.fontFamily);
18
18
  }
19
19
  export function addListener(eventName, callback) {
20
- return VrtxAndroidModule.addListener(eventName, callback);
20
+ return VrtxSdkModule.addListener(eventName, callback);
21
21
  }
22
22
  // Convenience wrappers
23
23
  export function onSuccess(callback) {
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,gBAAgB;AAChB,OAAO,iBAAiB,MAAM,qBAAqB,CAAC;AAEpD,iDAAiD;AACjD,OAAO,EAAE,WAAW,EAAE,QAAQ,EAAE,IAAI,EAAE,MAAM,qBAAqB,CAAC;AAClE,OAAO,EAAE,OAAO,IAAI,WAAW,EAAE,MAAM,qBAAqB,CAAC;AA0B7D,MAAM,CAAC,KAAK,UAAU,KAAK,CACzB,gBAAqC,EACrC,YAAqB,EACrB,WAA6B,EAC7B,WAAyB,SAAS,EAClC,IAAe,EACf,UAAmB;IAEnB,MAAM,MAAM,GACV,OAAO,gBAAgB,KAAK,QAAQ;QAClC,CAAC,CAAC;YACE,QAAQ,EAAE,gBAAgB;YAC1B,YAAY,EAAE,YAAa;YAC3B,WAAW,EAAE,WAAY;YACzB,QAAQ;YACR,IAAI;YACJ,UAAU;SACX;QACH,CAAC,CAAC,gBAAgB,CAAC;IAEvB,OAAO,MAAM,iBAAiB,CAAC,KAAK,CAClC,MAAM,CAAC,QAAQ,EACf,MAAM,CAAC,YAAY,EACnB,MAAM,CAAC,WAAW,EAClB,MAAM,CAAC,QAAQ,IAAI,SAAS,EAC5B,MAAM,CAAC,IAAI,EACX,MAAM,CAAC,UAAU,CAClB,CAAC;AACJ,CAAC;AAWD,MAAM,UAAU,WAAW,CACzB,SAAiB,EACjB,QAAkC;IAElC,OAAO,iBAAiB,CAAC,WAAW,CAAC,SAAgB,EAAE,QAAQ,CAAC,CAAC;AACnE,CAAC;AAED,uBAAuB;AACvB,MAAM,UAAU,SAAS,CAAC,QAAoB;IAC5C,OAAO,WAAW,CAAC,WAAW,EAAE,QAAQ,CAAC,CAAC;AAC5C,CAAC;AAED,MAAM,UAAU,OAAO,CACrB,QAA4D;IAE5D,OAAO,WAAW,CAAC,SAAS,EAAE,QAAQ,CAAC,CAAC;AAC1C,CAAC","sourcesContent":["// Native module\nimport VrtxAndroidModule from './VrtxAndroidModule';\n\n// Re-export enums for the public setup contract.\nexport { Environment, Language, Mode } from './VrtxAndroidModule';\nexport { default as VrtxAndroid } from './VrtxAndroidModule';\n\n// Types\nexport type VrtxEnvironment = 'SANDBOX' | 'STAGING';\nexport type VrtxLanguage = 'ENGLISH' | 'ARABIC';\nexport type VrtxMode = 'LIGHT' | 'DARK';\n\nexport interface VrtxConfig {\n clientId: string;\n clientSecret: string;\n environment: VrtxEnvironment;\n language?: VrtxLanguage;\n mode?: VrtxMode;\n fontFamily?: string;\n}\n\n// Promise-based setup function - resolves when SDK screen opens\nexport function setup(config: VrtxConfig): Promise<void>;\nexport function setup(\n clientId: string,\n clientSecret: string,\n environment: VrtxEnvironment,\n language?: VrtxLanguage,\n mode?: VrtxMode,\n fontFamily?: string,\n): Promise<void>;\nexport async function setup(\n configOrClientId: VrtxConfig | string,\n clientSecret?: string,\n environment?: VrtxEnvironment,\n language: VrtxLanguage = 'ENGLISH',\n mode?: VrtxMode,\n fontFamily?: string,\n): Promise<void> {\n const config =\n typeof configOrClientId === 'string'\n ? {\n clientId: configOrClientId,\n clientSecret: clientSecret!,\n environment: environment!,\n language,\n mode,\n fontFamily,\n }\n : configOrClientId;\n\n return await VrtxAndroidModule.setup(\n config.clientId,\n config.clientSecret,\n config.environment,\n config.language ?? 'ENGLISH',\n config.mode,\n config.fontFamily,\n );\n}\n\n// Type-safe addListener overloads\nexport function addListener(\n eventName: 'onSuccess',\n callback: () => void,\n): { remove: () => void };\nexport function addListener(\n eventName: 'onError',\n callback: (error: { code: string; message: string }) => void,\n): { remove: () => void };\nexport function addListener(\n eventName: string,\n callback: (...args: any[]) => void,\n): { remove: () => void } {\n return VrtxAndroidModule.addListener(eventName as any, callback);\n}\n\n// Convenience wrappers\nexport function onSuccess(callback: () => void) {\n return addListener('onSuccess', callback);\n}\n\nexport function onError(\n callback: (error: { code: string; message: string }) => void,\n) {\n return addListener('onError', callback);\n}\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,gBAAgB;AAChB,OAAO,aAAa,MAAM,iBAAiB,CAAC;AAE5C,iDAAiD;AACjD,OAAO,EAAE,WAAW,EAAE,QAAQ,EAAE,IAAI,EAAE,MAAM,iBAAiB,CAAC;AAC9D,OAAO,EAAE,OAAO,IAAI,OAAO,EAAE,MAAM,iBAAiB,CAAC;AA0BrD,MAAM,CAAC,KAAK,UAAU,KAAK,CACzB,gBAAqC,EACrC,YAAqB,EACrB,WAA6B,EAC7B,WAAyB,SAAS,EAClC,IAAe,EACf,UAAmB;IAEnB,MAAM,MAAM,GACV,OAAO,gBAAgB,KAAK,QAAQ;QAClC,CAAC,CAAC;YACE,QAAQ,EAAE,gBAAgB;YAC1B,YAAY,EAAE,YAAa;YAC3B,WAAW,EAAE,WAAY;YACzB,QAAQ;YACR,IAAI;YACJ,UAAU;SACX;QACH,CAAC,CAAC,gBAAgB,CAAC;IAEvB,OAAO,MAAM,aAAa,CAAC,KAAK,CAC9B,MAAM,CAAC,QAAQ,EACf,MAAM,CAAC,YAAY,EACnB,MAAM,CAAC,WAAW,EAClB,MAAM,CAAC,QAAQ,IAAI,SAAS,EAC5B,MAAM,CAAC,IAAI,EACX,MAAM,CAAC,UAAU,CAClB,CAAC;AACJ,CAAC;AAWD,MAAM,UAAU,WAAW,CACzB,SAAiB,EACjB,QAAkC;IAElC,OAAO,aAAa,CAAC,WAAW,CAAC,SAAgB,EAAE,QAAQ,CAAC,CAAC;AAC/D,CAAC;AAED,uBAAuB;AACvB,MAAM,UAAU,SAAS,CAAC,QAAoB;IAC5C,OAAO,WAAW,CAAC,WAAW,EAAE,QAAQ,CAAC,CAAC;AAC5C,CAAC;AAED,MAAM,UAAU,OAAO,CACrB,QAA4D;IAE5D,OAAO,WAAW,CAAC,SAAS,EAAE,QAAQ,CAAC,CAAC;AAC1C,CAAC","sourcesContent":["// Native module\nimport VrtxSdkModule from './VrtxSdkModule';\n\n// Re-export enums for the public setup contract.\nexport { Environment, Language, Mode } from './VrtxSdkModule';\nexport { default as VrtxSdk } from './VrtxSdkModule';\n\n// Types\nexport type VrtxEnvironment = 'SANDBOX' | 'STAGING';\nexport type VrtxLanguage = 'ENGLISH' | 'ARABIC';\nexport type VrtxMode = 'LIGHT' | 'DARK';\n\nexport interface VrtxConfig {\n clientId: string;\n clientSecret: string;\n environment: VrtxEnvironment;\n language?: VrtxLanguage;\n mode?: VrtxMode;\n fontFamily?: string;\n}\n\n// Promise-based setup function - resolves when SDK screen opens\nexport function setup(config: VrtxConfig): Promise<void>;\nexport function setup(\n clientId: string,\n clientSecret: string,\n environment: VrtxEnvironment,\n language?: VrtxLanguage,\n mode?: VrtxMode,\n fontFamily?: string,\n): Promise<void>;\nexport async function setup(\n configOrClientId: VrtxConfig | string,\n clientSecret?: string,\n environment?: VrtxEnvironment,\n language: VrtxLanguage = 'ENGLISH',\n mode?: VrtxMode,\n fontFamily?: string,\n): Promise<void> {\n const config =\n typeof configOrClientId === 'string'\n ? {\n clientId: configOrClientId,\n clientSecret: clientSecret!,\n environment: environment!,\n language,\n mode,\n fontFamily,\n }\n : configOrClientId;\n\n return await VrtxSdkModule.setup(\n config.clientId,\n config.clientSecret,\n config.environment,\n config.language ?? 'ENGLISH',\n config.mode,\n config.fontFamily,\n );\n}\n\n// Type-safe addListener overloads\nexport function addListener(\n eventName: 'onSuccess',\n callback: () => void,\n): { remove: () => void };\nexport function addListener(\n eventName: 'onError',\n callback: (error: { code: string; message: string }) => void,\n): { remove: () => void };\nexport function addListener(\n eventName: string,\n callback: (...args: any[]) => void,\n): { remove: () => void } {\n return VrtxSdkModule.addListener(eventName as any, callback);\n}\n\n// Convenience wrappers\nexport function onSuccess(callback: () => void) {\n return addListener('onSuccess', callback);\n}\n\nexport function onError(\n callback: (error: { code: string; message: string }) => void,\n) {\n return addListener('onError', callback);\n}\n"]}
@@ -1,9 +1,9 @@
1
1
  {
2
2
  "platforms": ["apple", "android"],
3
3
  "apple": {
4
- "modules": ["VrtxAndroidModule"]
4
+ "modules": ["VrtxSdkModule"]
5
5
  },
6
6
  "android": {
7
- "modules": ["sa.vrtx.reactnative.VrtxAndroidModule"]
7
+ "modules": ["sa.vrtx.reactnative.VrtxSdkModule"]
8
8
  }
9
9
  }
@@ -3,7 +3,7 @@ require 'json'
3
3
  package = JSON.parse(File.read(File.join(__dir__, '..', 'package.json')))
4
4
 
5
5
  Pod::Spec.new do |s|
6
- s.name = 'VrtxAndroid'
6
+ s.name = 'VrtxSdk'
7
7
  s.version = package['version']
8
8
  s.summary = package['description']
9
9
  s.description = package['description']
@@ -19,11 +19,11 @@ Pod::Spec.new do |s|
19
19
 
20
20
  s.dependency 'ExpoModulesCore'
21
21
 
22
- # The VRTX.xcframework is intentionally not committed (binary, not a
23
- # source artefact). The package's `postinstall` (scripts/fetch-vrtx-ios.mjs)
24
- # downloads it on `npm install` so it's already on disk by the time
25
- # `pod install` resolves this entry.
26
- s.vendored_frameworks = 'Frameworks/VRTX.xcframework'
22
+ # The Vrtx iOS SDK ships as a binary XCFramework published to CocoaPods
23
+ # trunk (https://github.com/vrtx-fintech/vrtx-ios). CocoaPods downloads and
24
+ # embeds it automatically, mirroring how Android pulls `vrtx-android` from
25
+ # Maven Central. Keep this version aligned with the VRTX pod release.
26
+ s.dependency 'VRTX', '0.0.15'
27
27
 
28
28
  # Swift/Objective-C compatibility
29
29
  s.pod_target_xcconfig = {
@@ -1,9 +1,9 @@
1
1
  import ExpoModulesCore
2
2
  import VRTX
3
3
 
4
- public class VrtxAndroidModule: Module {
4
+ public class VrtxSdkModule: Module {
5
5
  public func definition() -> ModuleDefinition {
6
- Name("VrtxAndroid")
6
+ Name("VrtxSdk")
7
7
 
8
8
  Constant("LIBRARY_NAME") {
9
9
  return "vrtx-ios"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vrtx-react-native",
3
- "version": "0.1.70",
3
+ "version": "0.1.72",
4
4
  "description": "vrtx react-native",
5
5
  "keywords": [
6
6
  "android",
@@ -40,8 +40,6 @@
40
40
  "format": "oxfmt .",
41
41
  "format:check": "oxfmt --check .",
42
42
  "test": "expo-module test",
43
- "fetch:ios": "node scripts/fetch-vrtx-ios.mjs",
44
- "postinstall": "node scripts/fetch-vrtx-ios.mjs",
45
43
  "prepare": "expo-module prepare",
46
44
  "prepublishOnly": "expo-module prepublishOnly",
47
45
  "expo-module": "expo-module",
@@ -49,21 +47,18 @@
49
47
  "open:ios": "xed example/ios",
50
48
  "open:android": "cd example/android && ./gradlew :app:installDebug --no-build-cache"
51
49
  },
52
- "dependencies": {
53
- "react": "19.2.6"
54
- },
55
50
  "devDependencies": {
56
51
  "@types/react": "~19.2.15",
57
52
  "expo": "^56.0.8",
58
53
  "expo-module-scripts": "^56.0.3",
59
- "oxfmt": "^0.52.0",
60
- "oxlint": "^1.67.0",
54
+ "oxfmt": "^0.53.0",
55
+ "oxlint": "^1.68.0",
61
56
  "react-native": "0.85.3"
62
57
  },
63
58
  "peerDependencies": {
64
- "expo": "*",
59
+ "expo": ">=52.0.0",
65
60
  "react": "*",
66
- "react-native": "*"
61
+ "react-native": ">=0.76.0"
67
62
  },
68
63
  "jest": {
69
64
  "passWithNoTests": true
@@ -1 +0,0 @@
1
- {"version":3,"file":"VrtxAndroidModule.d.ts","sourceRoot":"","sources":["../src/VrtxAndroidModule.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAuB,MAAM,MAAM,CAAC;AAEzD,KAAK,uBAAuB,GAAG;IAC7B,SAAS,EAAE,MAAM,IAAI,CAAC;IACtB,OAAO,EAAE,CAAC,MAAM,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,MAAM,CAAA;KAAE,KAAK,IAAI,CAAC;CAC9D,CAAC;AAEF,OAAO,OAAO,iBAAkB,SAAQ,YAAY,CAAC,uBAAuB,CAAC;IAC3E,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAC;IAE9B;;;;;;;;;OASG;IACH,KAAK,CACH,QAAQ,EAAE,MAAM,EAChB,YAAY,EAAE,MAAM,EACpB,WAAW,EAAE,SAAS,GAAG,SAAS,EAClC,QAAQ,EAAE,SAAS,GAAG,QAAQ,EAC9B,IAAI,CAAC,EAAE,OAAO,GAAG,MAAM,EACvB,UAAU,CAAC,EAAE,MAAM,GAClB,OAAO,CAAC,IAAI,CAAC;CACjB;;AAGD,wBAAqE;AAErE,oBAAY,WAAW;IACrB,OAAO,YAAY;IACnB,OAAO,YAAY;CACpB;AAED,oBAAY,QAAQ;IAClB,OAAO,YAAY;IACnB,MAAM,WAAW;CAClB;AAED,oBAAY,IAAI;IACd,KAAK,UAAU;IACf,IAAI,SAAS;CACd"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"VrtxAndroidModule.js","sourceRoot":"","sources":["../src/VrtxAndroidModule.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,mBAAmB,EAAE,MAAM,MAAM,CAAC;AA+BzD,yDAAyD;AACzD,eAAe,mBAAmB,CAAoB,aAAa,CAAC,CAAC;AAErE,MAAM,CAAN,IAAY,WAGX;AAHD,WAAY,WAAW;IACrB,kCAAmB,CAAA;IACnB,kCAAmB,CAAA;AACrB,CAAC,EAHW,WAAW,KAAX,WAAW,QAGtB;AAED,MAAM,CAAN,IAAY,QAGX;AAHD,WAAY,QAAQ;IAClB,+BAAmB,CAAA;IACnB,6BAAiB,CAAA;AACnB,CAAC,EAHW,QAAQ,KAAR,QAAQ,QAGnB;AAED,MAAM,CAAN,IAAY,IAGX;AAHD,WAAY,IAAI;IACd,uBAAe,CAAA;IACf,qBAAa,CAAA;AACf,CAAC,EAHW,IAAI,KAAJ,IAAI,QAGf","sourcesContent":["import { NativeModule, requireNativeModule } from 'expo';\n\ntype VrtxAndroidModuleEvents = {\n onSuccess: () => void;\n onError: (params: { code: string; message: string }) => void;\n};\n\ndeclare class VrtxAndroidModule extends NativeModule<VrtxAndroidModuleEvents> {\n readonly VERSION: string;\n readonly LIBRARY_NAME: string;\n\n /**\n * Initialize and launch the Vrtx SDK UI flow\n *\n * @param clientId Your Vrtx client ID from the dashboard\n * @param clientSecret Your Vrtx client secret from the dashboard\n * @param environment The environment (SANDBOX or STAGING)\n * @param language The language for the UI (ENGLISH or ARABIC)\n * @param mode Optional display mode (LIGHT or DARK) - defaults to LIGHT\n * @param fontFamily Optional React Native font family name - defaults to the system font\n */\n setup(\n clientId: string,\n clientSecret: string,\n environment: 'SANDBOX' | 'STAGING',\n language: 'ENGLISH' | 'ARABIC',\n mode?: 'LIGHT' | 'DARK',\n fontFamily?: string,\n ): Promise<void>;\n}\n\n// This call loads the native module object from the JSI.\nexport default requireNativeModule<VrtxAndroidModule>('VrtxAndroid');\n\nexport enum Environment {\n Sandbox = 'SANDBOX',\n Staging = 'STAGING',\n}\n\nexport enum Language {\n English = 'ENGLISH',\n Arabic = 'ARABIC',\n}\n\nexport enum Mode {\n LIGHT = 'LIGHT',\n DARK = 'DARK',\n}\n"]}
@@ -1,76 +0,0 @@
1
- #!/usr/bin/env node
2
- // Downloads the VRTX iOS xcframework from the upstream release into
3
- // ios/Frameworks/. Runs as a postinstall hook so the binary is in
4
- // place before `pod install` runs (for both library consumers and
5
- // local dev).
6
- //
7
- // Skips if the framework is already present (cached from a previous
8
- // install or downloaded by a different mechanism), and skips entirely
9
- // on non-Darwin platforms where the iOS build would never run anyway.
10
-
11
- import { mkdir, rm, stat, writeFile } from 'node:fs/promises';
12
- import { fileURLToPath } from 'node:url';
13
- import { dirname, join } from 'node:path';
14
- import { tmpdir } from 'node:os';
15
- import { execFile } from 'node:child_process';
16
- import { promisify } from 'node:util';
17
-
18
- const execFileAsync = promisify(execFile);
19
-
20
- const VRTX_IOS_VERSION = '0.0.15';
21
- const RELEASE_URL = `https://github.com/vrtx-fintech/vrtx-ios/releases/download/${VRTX_IOS_VERSION}/VRTX.xcframework.zip`;
22
-
23
- const repoRoot = dirname(dirname(fileURLToPath(import.meta.url)));
24
- const frameworksDir = join(repoRoot, 'ios', 'Frameworks');
25
- const targetFramework = join(frameworksDir, 'VRTX.xcframework');
26
-
27
- async function exists(path) {
28
- try {
29
- await stat(path);
30
- return true;
31
- } catch {
32
- return false;
33
- }
34
- }
35
-
36
- async function main() {
37
- if (process.platform !== 'darwin') {
38
- console.log(
39
- '[vrtx-ios] Non-Darwin platform, skipping iOS framework fetch.',
40
- );
41
- return;
42
- }
43
-
44
- if (await exists(targetFramework)) {
45
- console.log(
46
- `[vrtx-ios] VRTX.xcframework ${VRTX_IOS_VERSION} already present, skipping.`,
47
- );
48
- return;
49
- }
50
-
51
- console.log(`[vrtx-ios] Downloading VRTX.xcframework ${VRTX_IOS_VERSION}...`);
52
- await mkdir(frameworksDir, { recursive: true });
53
- const tmpZip = join(tmpdir(), `vrtx-xcframework-${process.pid}.zip`);
54
-
55
- try {
56
- const res = await fetch(RELEASE_URL, { redirect: 'follow' });
57
- if (!res.ok) {
58
- throw new Error(
59
- `HTTP ${res.status} ${res.statusText} fetching ${RELEASE_URL}`,
60
- );
61
- }
62
- const buf = Buffer.from(await res.arrayBuffer());
63
- await writeFile(tmpZip, buf);
64
- await execFileAsync('unzip', ['-q', tmpZip, '-d', frameworksDir]);
65
- console.log(
66
- `[vrtx-ios] Installed VRTX.xcframework ${VRTX_IOS_VERSION} to ${frameworksDir}`,
67
- );
68
- } finally {
69
- await rm(tmpZip, { force: true });
70
- }
71
- }
72
-
73
- main().catch((err) => {
74
- console.error(`[vrtx-ios] Failed to fetch VRTX.xcframework: ${err.message}`);
75
- process.exit(1);
76
- });