@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 +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +25 -13
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +25 -13
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -4887,6 +4887,16 @@ var init_PermissionManager = __esm({
|
|
|
4887
4887
|
}
|
|
4888
4888
|
});
|
|
4889
4889
|
|
|
4890
|
+
// src/core/constants.ts
|
|
4891
|
+
var DEFAULT_API_URL, DEFAULT_WEB_URL;
|
|
4892
|
+
var init_constants = __esm({
|
|
4893
|
+
"src/core/constants.ts"() {
|
|
4894
|
+
"use strict";
|
|
4895
|
+
DEFAULT_API_URL = "https://panel.lucasqueiroga.shop";
|
|
4896
|
+
DEFAULT_WEB_URL = "https://paywallo.com.br";
|
|
4897
|
+
}
|
|
4898
|
+
});
|
|
4899
|
+
|
|
4890
4900
|
// src/domains/notifications/config.ts
|
|
4891
4901
|
function resolveApiBaseUrl(config) {
|
|
4892
4902
|
if (config.apiBaseUrl) return config.apiBaseUrl;
|
|
@@ -4897,8 +4907,9 @@ var DEFAULT_API_BASE_URL, SANDBOX_API_BASE_URL;
|
|
|
4897
4907
|
var init_config = __esm({
|
|
4898
4908
|
"src/domains/notifications/config.ts"() {
|
|
4899
4909
|
"use strict";
|
|
4900
|
-
|
|
4901
|
-
|
|
4910
|
+
init_constants();
|
|
4911
|
+
DEFAULT_API_BASE_URL = DEFAULT_API_URL;
|
|
4912
|
+
SANDBOX_API_BASE_URL = DEFAULT_API_URL;
|
|
4902
4913
|
}
|
|
4903
4914
|
});
|
|
4904
4915
|
|
|
@@ -4993,6 +5004,9 @@ function mapPermissionStatus2(status) {
|
|
|
4993
5004
|
function detectPlatform2() {
|
|
4994
5005
|
return Platform11.OS === "ios" ? "ios" : "android";
|
|
4995
5006
|
}
|
|
5007
|
+
function detectEnvironment() {
|
|
5008
|
+
return typeof __DEV__ !== "undefined" && __DEV__ ? "sandbox" : "production";
|
|
5009
|
+
}
|
|
4996
5010
|
async function getAppVersion() {
|
|
4997
5011
|
try {
|
|
4998
5012
|
const { collectDeviceInfo: collectDeviceInfo2 } = await Promise.resolve().then(() => (init_deviceInfo(), deviceInfo_exports));
|
|
@@ -5020,8 +5034,8 @@ var init_utils = __esm({
|
|
|
5020
5034
|
// src/core/version.ts
|
|
5021
5035
|
function resolveVersion() {
|
|
5022
5036
|
try {
|
|
5023
|
-
if ("2.0
|
|
5024
|
-
return "2.0
|
|
5037
|
+
if ("2.1.0") {
|
|
5038
|
+
return "2.1.0";
|
|
5025
5039
|
}
|
|
5026
5040
|
} catch {
|
|
5027
5041
|
}
|
|
@@ -5060,7 +5074,8 @@ async function buildRegistration(token, getDeviceId, getDistinctId) {
|
|
|
5060
5074
|
sdk_version: SDK_VERSION,
|
|
5061
5075
|
deviceId: getDeviceId?.() ?? void 0,
|
|
5062
5076
|
locale: getLocale(),
|
|
5063
|
-
timezone: getTimezone2()
|
|
5077
|
+
timezone: getTimezone2(),
|
|
5078
|
+
environment: detectEnvironment()
|
|
5064
5079
|
};
|
|
5065
5080
|
}
|
|
5066
5081
|
async function registerToken(deps, token) {
|
|
@@ -5754,11 +5769,10 @@ function buildConditionalFlagUrl(baseUrl, flagKey, context) {
|
|
|
5754
5769
|
if (context.distinctId) url.searchParams.set("distinctId", context.distinctId);
|
|
5755
5770
|
return url.toString();
|
|
5756
5771
|
}
|
|
5757
|
-
var DEFAULT_WEB_URL;
|
|
5758
5772
|
var init_apiUrlUtils = __esm({
|
|
5759
5773
|
"src/core/apiUrlUtils.ts"() {
|
|
5760
5774
|
"use strict";
|
|
5761
|
-
|
|
5775
|
+
init_constants();
|
|
5762
5776
|
}
|
|
5763
5777
|
});
|
|
5764
5778
|
|
|
@@ -7252,7 +7266,6 @@ function setupAutoPreload(state, apiClient, config, distinctId) {
|
|
|
7252
7266
|
return null;
|
|
7253
7267
|
}).catch(() => null);
|
|
7254
7268
|
}
|
|
7255
|
-
var DEFAULT_API_URL;
|
|
7256
7269
|
var init_PaywalloInitHelpers = __esm({
|
|
7257
7270
|
"src/core/PaywalloInitHelpers.ts"() {
|
|
7258
7271
|
"use strict";
|
|
@@ -7260,7 +7273,7 @@ var init_PaywalloInitHelpers = __esm({
|
|
|
7260
7273
|
init_identity();
|
|
7261
7274
|
init_notifications();
|
|
7262
7275
|
init_SecureStorage();
|
|
7263
|
-
|
|
7276
|
+
init_constants();
|
|
7264
7277
|
}
|
|
7265
7278
|
});
|
|
7266
7279
|
|
|
@@ -7309,7 +7322,7 @@ function reportInitFailure(state, config, error, reason) {
|
|
|
7309
7322
|
try {
|
|
7310
7323
|
const tempClient = new ApiClient(
|
|
7311
7324
|
config.appKey,
|
|
7312
|
-
config.apiUrl ??
|
|
7325
|
+
config.apiUrl ?? DEFAULT_API_URL,
|
|
7313
7326
|
config.debug
|
|
7314
7327
|
);
|
|
7315
7328
|
void tempClient.reportError("INIT_FAILED", reason, {
|
|
@@ -7353,7 +7366,7 @@ async function doInit(state, config) {
|
|
|
7353
7366
|
]);
|
|
7354
7367
|
const apiClient = new ApiClient(
|
|
7355
7368
|
config.appKey,
|
|
7356
|
-
config.apiUrl ??
|
|
7369
|
+
config.apiUrl ?? DEFAULT_API_URL,
|
|
7357
7370
|
config.debug,
|
|
7358
7371
|
environment,
|
|
7359
7372
|
offlineQueueEnabled,
|
|
@@ -7459,7 +7472,6 @@ async function doInit(state, config) {
|
|
|
7459
7472
|
}
|
|
7460
7473
|
setupAutoPreload(state, apiClient, config, distinctId);
|
|
7461
7474
|
}
|
|
7462
|
-
var DEFAULT_API_URL2;
|
|
7463
7475
|
var init_PaywalloInitializer = __esm({
|
|
7464
7476
|
"src/core/PaywalloInitializer.ts"() {
|
|
7465
7477
|
"use strict";
|
|
@@ -7478,7 +7490,7 @@ var init_PaywalloInitializer = __esm({
|
|
|
7478
7490
|
init_eventPipelineBridge();
|
|
7479
7491
|
init_PaywalloState();
|
|
7480
7492
|
init_PaywalloInitHelpers();
|
|
7481
|
-
|
|
7493
|
+
init_constants();
|
|
7482
7494
|
}
|
|
7483
7495
|
});
|
|
7484
7496
|
|