@floegence/floe-webapp-boot 0.36.65 → 0.36.67

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.
@@ -4,11 +4,18 @@ export type ArtifactRequestContext = Readonly<{
4
4
  traceId?: string;
5
5
  }>;
6
6
  export type ArtifactSourceKind = 'controlplane' | 'entry_controlplane' | 'fixed' | 'factory';
7
+ export type ArtifactSourceMetadata = Readonly<{
8
+ allowAutoReconnect?: boolean;
9
+ }>;
7
10
  export type ArtifactSource = Readonly<{
8
11
  kind: ArtifactSourceKind;
12
+ metadata?: ArtifactSourceMetadata;
9
13
  getArtifact: (ctx: ArtifactRequestContext) => Promise<ConnectArtifact>;
10
14
  }>;
11
- export declare function createArtifactSourceFromFactory(getArtifact: (ctx: ArtifactRequestContext) => Promise<ConnectArtifact>, kind?: ArtifactSourceKind): ArtifactSource;
12
- export declare function createFixedArtifactSource(artifact: ConnectArtifact): ArtifactSource;
15
+ export type FixedArtifactSourceOptions = Readonly<{
16
+ allowAutoReconnect?: boolean;
17
+ }>;
18
+ export declare function createArtifactSourceFromFactory(getArtifact: (ctx: ArtifactRequestContext) => Promise<ConnectArtifact>, kind?: ArtifactSourceKind, metadata?: ArtifactSourceMetadata): ArtifactSource;
19
+ export declare function createFixedArtifactSource(artifact: ConnectArtifact, options?: FixedArtifactSourceOptions): ArtifactSource;
13
20
  export declare function createControlplaneArtifactSource(config: ConnectArtifactRequestConfig): ArtifactSource;
14
21
  export declare function createEntryControlplaneArtifactSource(config: EntryConnectArtifactRequestConfig): ArtifactSource;
package/dist/index.d.ts CHANGED
@@ -2,9 +2,9 @@ export { base64UrlToBase64, clearLocationHash, parseBase64UrlJsonFromHash, parse
2
2
  export type { WaitForMessageOptions } from './messaging';
3
3
  export { postMessageToOrigins, waitForMessage } from './messaging';
4
4
  export { getSessionStorage, removeSessionStorage, setSessionStorage } from './storage';
5
- export type { ArtifactRequestContext, ArtifactSource, ArtifactSourceKind, } from './artifactSource';
5
+ export type { ArtifactSourceMetadata, FixedArtifactSourceOptions, ArtifactRequestContext, ArtifactSource, ArtifactSourceKind, } from './artifactSource';
6
6
  export { createArtifactSourceFromFactory, createControlplaneArtifactSource, createEntryControlplaneArtifactSource, createFixedArtifactSource, } from './artifactSource';
7
7
  export type { DirectArtifactReconnectOptions, TunnelArtifactReconnectOptions, } from './reconnect';
8
- export { createArtifactDirectReconnectConfig, createArtifactTunnelReconnectConfig, createProxyRuntimeTunnelReconnectConfig, } from './reconnect';
8
+ export { createArtifactDirectReconnectConfig, createArtifactTunnelReconnectConfig, createProxyRuntimeTunnelReconnectConfig, FixedArtifactAutoReconnectError, } from './reconnect';
9
9
  export type { ScopeEnvelope, ScopeResolver, ScopeResolverMap } from './scope';
10
10
  export { createBootstrapScopeResolvers, FLOWERSEC_BOOTSTRAP_SCOPE_RESOLVERS, PROXY_RUNTIME_SCOPE_NAME, validateProxyRuntimeScopeEntry, } from './scope';
package/dist/index.js CHANGED
@@ -1,28 +1,29 @@
1
1
  import { base64UrlToBase64 as o, clearLocationHash as t, parseBase64UrlJsonFromHash as a, parseHashParam as c } from "./index2.js";
2
2
  import { postMessageToOrigins as s, waitForMessage as i } from "./index3.js";
3
- import { getSessionStorage as f, removeSessionStorage as p, setSessionStorage as m } from "./index4.js";
4
- import { createArtifactSourceFromFactory as l, createControlplaneArtifactSource as g, createEntryControlplaneArtifactSource as E, createFixedArtifactSource as x } from "./index5.js";
5
- import { createArtifactDirectReconnectConfig as A, createArtifactTunnelReconnectConfig as C, createProxyRuntimeTunnelReconnectConfig as O } from "./index6.js";
6
- import { FLOWERSEC_BOOTSTRAP_SCOPE_RESOLVERS as T, PROXY_RUNTIME_SCOPE_NAME as F, createBootstrapScopeResolvers as _, validateProxyRuntimeScopeEntry as y } from "./index7.js";
3
+ import { getSessionStorage as f, removeSessionStorage as p, setSessionStorage as R } from "./index4.js";
4
+ import { createArtifactSourceFromFactory as l, createControlplaneArtifactSource as E, createEntryControlplaneArtifactSource as g, createFixedArtifactSource as x } from "./index5.js";
5
+ import { FixedArtifactAutoReconnectError as u, createArtifactDirectReconnectConfig as C, createArtifactTunnelReconnectConfig as O, createProxyRuntimeTunnelReconnectConfig as F } from "./index6.js";
6
+ import { FLOWERSEC_BOOTSTRAP_SCOPE_RESOLVERS as T, PROXY_RUNTIME_SCOPE_NAME as _, createBootstrapScopeResolvers as y, validateProxyRuntimeScopeEntry as B } from "./index7.js";
7
7
  export {
8
8
  T as FLOWERSEC_BOOTSTRAP_SCOPE_RESOLVERS,
9
- F as PROXY_RUNTIME_SCOPE_NAME,
9
+ u as FixedArtifactAutoReconnectError,
10
+ _ as PROXY_RUNTIME_SCOPE_NAME,
10
11
  o as base64UrlToBase64,
11
12
  t as clearLocationHash,
12
- A as createArtifactDirectReconnectConfig,
13
+ C as createArtifactDirectReconnectConfig,
13
14
  l as createArtifactSourceFromFactory,
14
- C as createArtifactTunnelReconnectConfig,
15
- _ as createBootstrapScopeResolvers,
16
- g as createControlplaneArtifactSource,
17
- E as createEntryControlplaneArtifactSource,
15
+ O as createArtifactTunnelReconnectConfig,
16
+ y as createBootstrapScopeResolvers,
17
+ E as createControlplaneArtifactSource,
18
+ g as createEntryControlplaneArtifactSource,
18
19
  x as createFixedArtifactSource,
19
- O as createProxyRuntimeTunnelReconnectConfig,
20
+ F as createProxyRuntimeTunnelReconnectConfig,
20
21
  f as getSessionStorage,
21
22
  a as parseBase64UrlJsonFromHash,
22
23
  c as parseHashParam,
23
24
  s as postMessageToOrigins,
24
25
  p as removeSessionStorage,
25
- m as setSessionStorage,
26
- y as validateProxyRuntimeScopeEntry,
26
+ R as setSessionStorage,
27
+ B as validateProxyRuntimeScopeEntry,
27
28
  i as waitForMessage
28
29
  };
package/dist/index5.js CHANGED
@@ -1,40 +1,45 @@
1
1
  import { requestConnectArtifact as c, requestEntryConnectArtifact as a } from "./index8.js";
2
- function o(r, t) {
3
- const e = String(t ?? r?.traceId ?? "").trim();
4
- return e ? { ...r ?? {}, traceId: e } : r;
2
+ function e(r, t) {
3
+ const o = String(t ?? r?.traceId ?? "").trim();
4
+ return o ? { ...r ?? {}, traceId: o } : r;
5
5
  }
6
- function n(r, t = "factory") {
6
+ function n(r, t = "factory", o) {
7
7
  return {
8
8
  kind: t,
9
+ ...o === void 0 ? {} : { metadata: o },
9
10
  getArtifact: r
10
11
  };
11
12
  }
12
- function u(r) {
13
- return n(async () => r, "fixed");
13
+ function l(r, t) {
14
+ return n(
15
+ async () => r,
16
+ "fixed",
17
+ t?.allowAutoReconnect ? { allowAutoReconnect: !0 } : void 0
18
+ );
14
19
  }
15
- function l(r) {
20
+ function u(r) {
16
21
  return n(
17
- async ({ signal: t, traceId: e }) => c({
22
+ async ({ signal: t, traceId: o }) => c({
18
23
  ...r,
19
24
  ...t === void 0 ? {} : { signal: t },
20
- ...o(r.correlation, e) === void 0 ? {} : { correlation: o(r.correlation, e) }
25
+ ...e(r.correlation, o) === void 0 ? {} : { correlation: e(r.correlation, o) }
21
26
  }),
22
27
  "controlplane"
23
28
  );
24
29
  }
25
30
  function f(r) {
26
31
  return n(
27
- async ({ signal: t, traceId: e }) => a({
32
+ async ({ signal: t, traceId: o }) => a({
28
33
  ...r,
29
34
  ...t === void 0 ? {} : { signal: t },
30
- ...o(r.correlation, e) === void 0 ? {} : { correlation: o(r.correlation, e) }
35
+ ...e(r.correlation, o) === void 0 ? {} : { correlation: e(r.correlation, o) }
31
36
  }),
32
37
  "entry_controlplane"
33
38
  );
34
39
  }
35
40
  export {
36
41
  n as createArtifactSourceFromFactory,
37
- l as createControlplaneArtifactSource,
42
+ u as createControlplaneArtifactSource,
38
43
  f as createEntryControlplaneArtifactSource,
39
- u as createFixedArtifactSource
44
+ l as createFixedArtifactSource
40
45
  };
package/dist/index6.js CHANGED
@@ -1,9 +1,23 @@
1
- import { createBootstrapScopeResolvers as n } from "./index7.js";
1
+ import { createBootstrapScopeResolvers as r } from "./index7.js";
2
+ class o extends Error {
3
+ constructor() {
4
+ super(
5
+ "Fixed artifact sources cannot be used with enabled autoReconnect unless allowAutoReconnect is explicitly set."
6
+ ), this.name = "FixedArtifactAutoReconnectError";
7
+ }
8
+ }
2
9
  function t(e) {
3
10
  return async (c) => e.getArtifact(c);
4
11
  }
5
- function r(e) {
6
- return {
12
+ function a(e) {
13
+ return e?.enabled === !0;
14
+ }
15
+ function n(e) {
16
+ if (e.artifactSource.kind === "fixed" && a(e.autoReconnect) && e.artifactSource.metadata?.allowAutoReconnect !== !0)
17
+ throw new o();
18
+ }
19
+ function u(e) {
20
+ return n(e), {
7
21
  mode: "tunnel",
8
22
  getArtifact: t(e.artifactSource),
9
23
  ...e.observer === void 0 ? {} : { observer: e.observer },
@@ -11,18 +25,18 @@ function r(e) {
11
25
  ...e.connect === void 0 ? {} : { connect: e.connect }
12
26
  };
13
27
  }
14
- function a(e) {
28
+ function f(e) {
15
29
  const c = e.connect;
16
- return r({
30
+ return u({
17
31
  ...e,
18
32
  connect: {
19
33
  ...c ?? {},
20
- scopeResolvers: n(c?.scopeResolvers)
34
+ scopeResolvers: r(c?.scopeResolvers)
21
35
  }
22
36
  });
23
37
  }
24
- function u(e) {
25
- return {
38
+ function R(e) {
39
+ return n(e), {
26
40
  mode: "direct",
27
41
  getArtifact: t(e.artifactSource),
28
42
  ...e.observer === void 0 ? {} : { observer: e.observer },
@@ -31,7 +45,8 @@ function u(e) {
31
45
  };
32
46
  }
33
47
  export {
34
- u as createArtifactDirectReconnectConfig,
35
- r as createArtifactTunnelReconnectConfig,
36
- a as createProxyRuntimeTunnelReconnectConfig
48
+ o as FixedArtifactAutoReconnectError,
49
+ R as createArtifactDirectReconnectConfig,
50
+ u as createArtifactTunnelReconnectConfig,
51
+ f as createProxyRuntimeTunnelReconnectConfig
37
52
  };
@@ -15,6 +15,9 @@ export type TunnelArtifactReconnectOptions = SharedArtifactReconnectOptions & Re
15
15
  export type DirectArtifactReconnectOptions = SharedArtifactReconnectOptions & Readonly<{
16
16
  connect?: DirectArtifactConnectOptions;
17
17
  }>;
18
+ export declare class FixedArtifactAutoReconnectError extends Error {
19
+ constructor();
20
+ }
18
21
  export declare function createArtifactTunnelReconnectConfig(options: TunnelArtifactReconnectOptions): TunnelBrowserReconnectConfig;
19
22
  export declare function createProxyRuntimeTunnelReconnectConfig(options: TunnelArtifactReconnectOptions): TunnelBrowserReconnectConfig;
20
23
  export declare function createArtifactDirectReconnectConfig(options: DirectArtifactReconnectOptions): DirectBrowserReconnectConfig;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@floegence/floe-webapp-boot",
3
- "version": "0.36.65",
3
+ "version": "0.36.67",
4
4
  "type": "module",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.js",
@@ -20,6 +20,9 @@
20
20
  "files": [
21
21
  "dist"
22
22
  ],
23
+ "engines": {
24
+ "node": ">=24.0.0"
25
+ },
23
26
  "scripts": {
24
27
  "dev": "vite build --watch",
25
28
  "build": "pnpm clean && vite build && tsc -p tsconfig.build.json",
@@ -27,7 +30,7 @@
27
30
  "clean": "rm -rf dist *.tsbuildinfo"
28
31
  },
29
32
  "dependencies": {
30
- "@floegence/flowersec-core": "^0.19.4"
33
+ "@floegence/flowersec-core": "^0.19.9"
31
34
  },
32
35
  "devDependencies": {
33
36
  "typescript": "^5.9.3",