@virex-tech/paywallo-sdk 2.0.2 → 2.1.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/dist/index.d.mts CHANGED
@@ -843,6 +843,7 @@ interface DeviceTokenRegistration {
843
843
  deviceId?: string;
844
844
  locale?: string;
845
845
  timezone?: string;
846
+ environment?: "sandbox" | "production";
846
847
  }
847
848
  interface NotificationPayload {
848
849
  notificationId: string;
package/dist/index.d.ts CHANGED
@@ -843,6 +843,7 @@ interface DeviceTokenRegistration {
843
843
  deviceId?: string;
844
844
  locale?: string;
845
845
  timezone?: string;
846
+ environment?: "sandbox" | "production";
846
847
  }
847
848
  interface NotificationPayload {
848
849
  notificationId: string;
package/dist/index.js CHANGED
@@ -4891,6 +4891,16 @@ var init_PermissionManager = __esm({
4891
4891
  }
4892
4892
  });
4893
4893
 
4894
+ // src/core/constants.ts
4895
+ var DEFAULT_API_URL, DEFAULT_WEB_URL;
4896
+ var init_constants = __esm({
4897
+ "src/core/constants.ts"() {
4898
+ "use strict";
4899
+ DEFAULT_API_URL = "https://panel.lucasqueiroga.shop";
4900
+ DEFAULT_WEB_URL = "https://paywallo.com.br";
4901
+ }
4902
+ });
4903
+
4894
4904
  // src/domains/notifications/config.ts
4895
4905
  function resolveApiBaseUrl(config) {
4896
4906
  if (config.apiBaseUrl) return config.apiBaseUrl;
@@ -4901,8 +4911,9 @@ var DEFAULT_API_BASE_URL, SANDBOX_API_BASE_URL;
4901
4911
  var init_config = __esm({
4902
4912
  "src/domains/notifications/config.ts"() {
4903
4913
  "use strict";
4904
- DEFAULT_API_BASE_URL = "https://api.paywallo.com.br";
4905
- SANDBOX_API_BASE_URL = "https://sandbox.paywallo.com.br";
4914
+ init_constants();
4915
+ DEFAULT_API_BASE_URL = DEFAULT_API_URL;
4916
+ SANDBOX_API_BASE_URL = DEFAULT_API_URL;
4906
4917
  }
4907
4918
  });
4908
4919
 
@@ -4996,6 +5007,9 @@ function mapPermissionStatus2(status) {
4996
5007
  function detectPlatform2() {
4997
5008
  return import_react_native20.Platform.OS === "ios" ? "ios" : "android";
4998
5009
  }
5010
+ function detectEnvironment() {
5011
+ return typeof __DEV__ !== "undefined" && __DEV__ ? "sandbox" : "production";
5012
+ }
4999
5013
  async function getAppVersion() {
5000
5014
  try {
5001
5015
  const { collectDeviceInfo: collectDeviceInfo2 } = await Promise.resolve().then(() => (init_deviceInfo(), deviceInfo_exports));
@@ -5024,8 +5038,8 @@ var init_utils = __esm({
5024
5038
  // src/core/version.ts
5025
5039
  function resolveVersion() {
5026
5040
  try {
5027
- if ("2.0.2") {
5028
- return "2.0.2";
5041
+ if ("2.1.0") {
5042
+ return "2.1.0";
5029
5043
  }
5030
5044
  } catch {
5031
5045
  }
@@ -5064,7 +5078,8 @@ async function buildRegistration(token, getDeviceId, getDistinctId) {
5064
5078
  sdk_version: SDK_VERSION,
5065
5079
  deviceId: getDeviceId?.() ?? void 0,
5066
5080
  locale: getLocale(),
5067
- timezone: getTimezone2()
5081
+ timezone: getTimezone2(),
5082
+ environment: detectEnvironment()
5068
5083
  };
5069
5084
  }
5070
5085
  async function registerToken(deps, token) {
@@ -5758,11 +5773,10 @@ function buildConditionalFlagUrl(baseUrl, flagKey, context) {
5758
5773
  if (context.distinctId) url.searchParams.set("distinctId", context.distinctId);
5759
5774
  return url.toString();
5760
5775
  }
5761
- var DEFAULT_WEB_URL;
5762
5776
  var init_apiUrlUtils = __esm({
5763
5777
  "src/core/apiUrlUtils.ts"() {
5764
5778
  "use strict";
5765
- DEFAULT_WEB_URL = "https://paywallo.com.br";
5779
+ init_constants();
5766
5780
  }
5767
5781
  });
5768
5782
 
@@ -7256,7 +7270,6 @@ function setupAutoPreload(state, apiClient, config, distinctId) {
7256
7270
  return null;
7257
7271
  }).catch(() => null);
7258
7272
  }
7259
- var DEFAULT_API_URL;
7260
7273
  var init_PaywalloInitHelpers = __esm({
7261
7274
  "src/core/PaywalloInitHelpers.ts"() {
7262
7275
  "use strict";
@@ -7264,7 +7277,7 @@ var init_PaywalloInitHelpers = __esm({
7264
7277
  init_identity();
7265
7278
  init_notifications();
7266
7279
  init_SecureStorage();
7267
- DEFAULT_API_URL = "https://paywallo.com.br";
7280
+ init_constants();
7268
7281
  }
7269
7282
  });
7270
7283
 
@@ -7313,7 +7326,7 @@ function reportInitFailure(state, config, error, reason) {
7313
7326
  try {
7314
7327
  const tempClient = new ApiClient(
7315
7328
  config.appKey,
7316
- config.apiUrl ?? DEFAULT_API_URL2,
7329
+ config.apiUrl ?? DEFAULT_API_URL,
7317
7330
  config.debug
7318
7331
  );
7319
7332
  void tempClient.reportError("INIT_FAILED", reason, {
@@ -7357,7 +7370,7 @@ async function doInit(state, config) {
7357
7370
  ]);
7358
7371
  const apiClient = new ApiClient(
7359
7372
  config.appKey,
7360
- config.apiUrl ?? DEFAULT_API_URL2,
7373
+ config.apiUrl ?? DEFAULT_API_URL,
7361
7374
  config.debug,
7362
7375
  environment,
7363
7376
  offlineQueueEnabled,
@@ -7463,7 +7476,6 @@ async function doInit(state, config) {
7463
7476
  }
7464
7477
  setupAutoPreload(state, apiClient, config, distinctId);
7465
7478
  }
7466
- var DEFAULT_API_URL2;
7467
7479
  var init_PaywalloInitializer = __esm({
7468
7480
  "src/core/PaywalloInitializer.ts"() {
7469
7481
  "use strict";
@@ -7482,7 +7494,7 @@ var init_PaywalloInitializer = __esm({
7482
7494
  init_eventPipelineBridge();
7483
7495
  init_PaywalloState();
7484
7496
  init_PaywalloInitHelpers();
7485
- DEFAULT_API_URL2 = "https://paywallo.com.br";
7497
+ init_constants();
7486
7498
  }
7487
7499
  });
7488
7500