@saasbase-io/core-elements 1.1.7 → 1.1.9
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.js +221 -221
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +11 -11
- package/dist/index.mjs.map +1 -1
- package/dist/styles.css +6127 -1437
- package/dist/types/core/index.d.ts +1 -1
- package/package.json +3 -3
package/dist/index.mjs
CHANGED
|
@@ -344,8 +344,8 @@ class fn {
|
|
|
344
344
|
const n = Rt.getConfig();
|
|
345
345
|
if (!n.domain)
|
|
346
346
|
throw new J("CONFIG_ERROR", "Domain is required");
|
|
347
|
-
if (!n.
|
|
348
|
-
throw new J("CONFIG_ERROR", "
|
|
347
|
+
if (!n.appId)
|
|
348
|
+
throw new J("CONFIG_ERROR", "App ID is required");
|
|
349
349
|
if (!n.clientSecret)
|
|
350
350
|
throw new J("CONFIG_ERROR", "Client Secret is required");
|
|
351
351
|
this.flowId = t, this.location = o, this.flowStateManager = r || new Ul(), this.flowEventBus = s || new Ml(), this.navigationTypeDetector = i || new Sd(), gt.Instance.cleanExpiredSession(), gt.Instance.scheduleTokenRefresh();
|
|
@@ -368,9 +368,9 @@ class fn {
|
|
|
368
368
|
*/
|
|
369
369
|
startFlow(t, s) {
|
|
370
370
|
return F(this, void 0, void 0, function* () {
|
|
371
|
-
if (!s.
|
|
371
|
+
if (!s.app_id)
|
|
372
372
|
throw new J("VALIDATION_ERROR", "Client ID is required");
|
|
373
|
-
const o = `/
|
|
373
|
+
const o = `/v1/auth-flow/${t}/start`;
|
|
374
374
|
return this.executeFlowRequest(() => this.httpClient.post(o, s), "START_FLOW_ERROR", "Failed to start flow");
|
|
375
375
|
});
|
|
376
376
|
}
|
|
@@ -379,7 +379,7 @@ class fn {
|
|
|
379
379
|
*/
|
|
380
380
|
resumeFlow(t) {
|
|
381
381
|
return F(this, void 0, void 0, function* () {
|
|
382
|
-
const s = `/
|
|
382
|
+
const s = `/v1/auth-flow/${t}/resume`;
|
|
383
383
|
return this.executeFlowRequest(() => this.httpClient.post(s), "RESUME_FLOW_ERROR", "Failed to resume flow");
|
|
384
384
|
});
|
|
385
385
|
}
|
|
@@ -415,7 +415,7 @@ class fn {
|
|
|
415
415
|
let o = this.flowStateManager.getFlowState();
|
|
416
416
|
if (!o && (console.warn("Flow state expired, restarting flow before processing event"), yield this.initializeFlowInternal(), o = this.flowStateManager.getFlowState(), !o))
|
|
417
417
|
throw new J("FLOW_RESTART_ERROR", "Failed to restart flow - no flow state after initialization");
|
|
418
|
-
const r = o.state, i = `/
|
|
418
|
+
const r = o.state, i = `/v1/auth-flow/${o.flowType}/events`, n = yield this.executeFlowRequest(() => this.httpClient.post(i, t), "PROCESS_EVENT_ERROR", "Failed to process event", s);
|
|
419
419
|
if (!n.auth_result) {
|
|
420
420
|
this.flowStateManager.saveFlowState(o.flowType, o.flow_id, n);
|
|
421
421
|
const l = this.flowStateManager.getFlowState();
|
|
@@ -509,7 +509,7 @@ class fn {
|
|
|
509
509
|
startNewFlow(t) {
|
|
510
510
|
return F(this, void 0, void 0, function* () {
|
|
511
511
|
const s = Rt.getConfig(), o = {
|
|
512
|
-
|
|
512
|
+
app_id: s.appId,
|
|
513
513
|
client_secret: s.clientSecret,
|
|
514
514
|
origin_url: this.location.href,
|
|
515
515
|
signin_url: s.signinUrl,
|
|
@@ -1154,8 +1154,8 @@ class _r {
|
|
|
1154
1154
|
});
|
|
1155
1155
|
}
|
|
1156
1156
|
configure(t) {
|
|
1157
|
-
if (!t.domain || !t.
|
|
1158
|
-
throw new J("CONFIG_ERROR", "domain,
|
|
1157
|
+
if (!t.domain || !t.appId || !t.clientSecret)
|
|
1158
|
+
throw new J("CONFIG_ERROR", "domain, appId, and clientSecret are required");
|
|
1159
1159
|
Rt.setConfig(t), this.configured = !0;
|
|
1160
1160
|
}
|
|
1161
1161
|
isAuthenticated() {
|
|
@@ -26027,7 +26027,7 @@ let Ie = class extends E {
|
|
|
26027
26027
|
await new Promise((t) => setTimeout(t, 20));
|
|
26028
26028
|
dt.configure({
|
|
26029
26029
|
domain: this.env.domain,
|
|
26030
|
-
|
|
26030
|
+
appId: this.env.appId,
|
|
26031
26031
|
clientSecret: this.env.clientSecret ?? "",
|
|
26032
26032
|
locale: this.env.locale,
|
|
26033
26033
|
signinUrl: this.env.signinUrl,
|
|
@@ -26044,7 +26044,7 @@ let Ie = class extends E {
|
|
|
26044
26044
|
var t;
|
|
26045
26045
|
super.updated(e), e.has("customizations") && (this.providedCustomizations = this.customizations), e.has("env") && (t = this.env) != null && t.domain && dt.configure({
|
|
26046
26046
|
domain: this.env.domain,
|
|
26047
|
-
|
|
26047
|
+
appId: this.env.appId,
|
|
26048
26048
|
clientSecret: this.env.clientSecret ?? "",
|
|
26049
26049
|
locale: this.env.locale,
|
|
26050
26050
|
signinUrl: this.env.signinUrl,
|