@amplifyup/sdk 0.1.4 → 0.1.5
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/README.md +9 -8
- package/dist/AmplifyRenderer.d.mts +1 -1
- package/dist/AmplifyRenderer.d.ts +1 -1
- package/dist/AmplifyRenderer.js +14 -6
- package/dist/AmplifyRenderer.js.map +1 -1
- package/dist/AmplifyRenderer.mjs +14 -6
- package/dist/AmplifyRenderer.mjs.map +1 -1
- package/dist/index.d.mts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +14 -6
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +14 -6
- package/dist/index.mjs.map +1 -1
- package/dist/react.d.mts +2 -2
- package/dist/react.d.ts +2 -2
- package/dist/react.js +14 -6
- package/dist/react.js.map +1 -1
- package/dist/react.mjs +14 -6
- package/dist/react.mjs.map +1 -1
- package/dist/server.d.mts +2 -2
- package/dist/server.d.ts +2 -2
- package/dist/server.js +0 -6
- package/dist/server.js.map +1 -1
- package/dist/server.mjs +0 -6
- package/dist/server.mjs.map +1 -1
- package/dist/{types-Xv9P55Dj.d.mts → types-B2Swk8BW.d.mts} +10 -7
- package/dist/{types-Xv9P55Dj.d.ts → types-B2Swk8BW.d.ts} +10 -7
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { C as CDPAdapter, A as AmplifyUpConfig, E as EventProperties, I as IdentifyTraits, a as AmplifyUpTarget, b as EventTrackingConfig$1 } from './types-
|
|
2
|
-
export { P as PageConfig, Z as ZoneConfig, i as isAmplifyUpTarget, n as normalizeAmplifyUpTarget, r as resolveAmplifyUpTarget, c as resolveAmplifyUpUrls } from './types-
|
|
1
|
+
import { C as CDPAdapter, A as AmplifyUpConfig, E as EventProperties, I as IdentifyTraits, a as AmplifyUpTarget, b as EventTrackingConfig$1 } from './types-B2Swk8BW.mjs';
|
|
2
|
+
export { P as PageConfig, Z as ZoneConfig, i as isAmplifyUpTarget, n as normalizeAmplifyUpTarget, r as resolveAmplifyUpTarget, c as resolveAmplifyUpUrls } from './types-B2Swk8BW.mjs';
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* AmplifyUp Tracking SDK
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { C as CDPAdapter, A as AmplifyUpConfig, E as EventProperties, I as IdentifyTraits, a as AmplifyUpTarget, b as EventTrackingConfig$1 } from './types-
|
|
2
|
-
export { P as PageConfig, Z as ZoneConfig, i as isAmplifyUpTarget, n as normalizeAmplifyUpTarget, r as resolveAmplifyUpTarget, c as resolveAmplifyUpUrls } from './types-
|
|
1
|
+
import { C as CDPAdapter, A as AmplifyUpConfig, E as EventProperties, I as IdentifyTraits, a as AmplifyUpTarget, b as EventTrackingConfig$1 } from './types-B2Swk8BW.js';
|
|
2
|
+
export { P as PageConfig, Z as ZoneConfig, i as isAmplifyUpTarget, n as normalizeAmplifyUpTarget, r as resolveAmplifyUpTarget, c as resolveAmplifyUpUrls } from './types-B2Swk8BW.js';
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* AmplifyUp Tracking SDK
|
package/dist/index.js
CHANGED
|
@@ -234,14 +234,16 @@ function resolveAmplifyUpTarget(options) {
|
|
|
234
234
|
if (isAmplifyUpTarget(envTarget)) {
|
|
235
235
|
return normalizeAmplifyUpTarget(envTarget);
|
|
236
236
|
}
|
|
237
|
-
if (typeof window !== "undefined") {
|
|
238
|
-
const host = window.location.hostname;
|
|
239
|
-
if (host === "localhost" || host === "127.0.0.1") {
|
|
240
|
-
return "local";
|
|
241
|
-
}
|
|
242
|
-
}
|
|
243
237
|
return "production";
|
|
244
238
|
}
|
|
239
|
+
function isRemoteOrchestratorUrl(orchestratorUrl) {
|
|
240
|
+
try {
|
|
241
|
+
const host = new URL(orchestratorUrl).hostname.toLowerCase();
|
|
242
|
+
return host !== "localhost" && host !== "127.0.0.1" && host !== "::1";
|
|
243
|
+
} catch {
|
|
244
|
+
return false;
|
|
245
|
+
}
|
|
246
|
+
}
|
|
245
247
|
function localOrchestratorUrl() {
|
|
246
248
|
const fromEnv = typeof process !== "undefined" ? process.env.NEXT_PUBLIC_ORCHESTRATOR_URL : void 0;
|
|
247
249
|
return (fromEnv || "http://localhost:5001").replace(/\/$/, "");
|
|
@@ -424,6 +426,12 @@ var AmplifyUpSDK = class {
|
|
|
424
426
|
const previewOverrides = readPreviewQueryOverrides();
|
|
425
427
|
if (previewOverrides.orchestratorUrl) {
|
|
426
428
|
this.orchestratorUrl = previewOverrides.orchestratorUrl;
|
|
429
|
+
if (isRemoteOrchestratorUrl(previewOverrides.orchestratorUrl)) {
|
|
430
|
+
const prodUrls = resolveAmplifyUpUrls("production");
|
|
431
|
+
this.target = "production";
|
|
432
|
+
this.apiGatewayUrl = prodUrls.apiGatewayUrl;
|
|
433
|
+
this.decisionApiUrl = prodUrls.decisionApiUrl;
|
|
434
|
+
}
|
|
427
435
|
}
|
|
428
436
|
this.config = {
|
|
429
437
|
trackingId: previewOverrides.trackingId || config.trackingId,
|