@floegence/floe-webapp-boot 0.47.0 → 0.47.1

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.
@@ -21,8 +21,8 @@ function _(e, r) {
21
21
  return t.pathname = t.pathname.replace(/\/+$/u, ""), t;
22
22
  }
23
23
  function j(e, r) {
24
- const t = r === void 0 ? "/v1/connect/artifact" : "/v1/connect/artifact/entry";
25
- return new URL(`${e.pathname}${t}`, e).toString();
24
+ const t = r === void 0 ? "/v1/connect/artifact" : "/v1/connect/artifact/entry", o = e.pathname === "/" ? "" : e.pathname;
25
+ return new URL(`${o}${t}`, e).toString();
26
26
  }
27
27
  function v(e) {
28
28
  if (!y.test(e.code))
@@ -58,10 +58,10 @@ function m(e, r) {
58
58
  throw new TypeError("validateSpendBinding is required");
59
59
  const t = e.fetch ?? globalThis.fetch;
60
60
  if (typeof t != "function") throw new TypeError("fetch is required");
61
- const n = _(e.baseUrl, e.allowLoopbackHTTP === !0), s = j(n, e.entryTicket), i = {
61
+ const o = _(e.baseUrl, e.allowLoopbackHTTP === !0), s = j(o, e.entryTicket), i = {
62
62
  acquire: async ({ signal: d }) => {
63
63
  try {
64
- const o = {
64
+ const n = {
65
65
  endpoint_id: e.endpointId,
66
66
  ...e.payload === void 0 ? {} : { payload: e.payload },
67
67
  ...e.entryTicket === void 0 && e.correlation !== void 0 ? { correlation: { trace_id: e.correlation.traceId } } : {}
@@ -72,16 +72,16 @@ function m(e, r) {
72
72
  "content-type": "application/json",
73
73
  ...e.entryTicket === void 0 ? {} : { authorization: `Bearer ${e.entryTicket}` }
74
74
  },
75
- body: JSON.stringify(o),
75
+ body: JSON.stringify(n),
76
76
  credentials: "omit",
77
77
  redirect: "error",
78
78
  signal: d
79
79
  });
80
80
  if (!c.ok) {
81
- const l = await E(c);
81
+ const f = await E(c);
82
82
  return { kind: "failure", ...v({
83
83
  status: c.status,
84
- code: l,
84
+ code: f,
85
85
  retryAfter: c.headers.get("retry-after"),
86
86
  retryableBusinessCodes: e.retryableBusinessCodes
87
87
  }) };
@@ -90,13 +90,13 @@ function m(e, r) {
90
90
  try {
91
91
  u = await c.json();
92
92
  } catch {
93
- return f("invalid_controlplane_response");
93
+ return l("invalid_controlplane_response");
94
94
  }
95
95
  const h = await r(i, u, {
96
96
  commitSpend: e.commitSpend,
97
- validateSpendBinding: (l) => {
97
+ validateSpendBinding: (f) => {
98
98
  try {
99
- return e.validateSpendBinding(l);
99
+ return e.validateSpendBinding(f);
100
100
  } catch {
101
101
  throw new p("invalid_spend_binding");
102
102
  }
@@ -104,10 +104,10 @@ function m(e, r) {
104
104
  expectedConsumer: "trusted"
105
105
  });
106
106
  return Object.freeze({ kind: "lease", lease: h });
107
- } catch (o) {
107
+ } catch (n) {
108
108
  if (d.aborted) throw d.reason ?? new DOMException("Aborted", "AbortError");
109
- if (o instanceof DOMException && o.name === "AbortError") throw o;
110
- return o instanceof p || o instanceof a ? f(o.code) : Object.freeze({
109
+ if (n instanceof DOMException && n.name === "AbortError") throw n;
110
+ return n instanceof p || n instanceof a ? l(n.code) : Object.freeze({
111
111
  kind: "failure",
112
112
  code: "network_error",
113
113
  disposition: Object.freeze({ kind: "retryable" })
@@ -142,8 +142,8 @@ async function E(e) {
142
142
  if (r !== null && typeof r == "object" && !Array.isArray(r)) {
143
143
  const t = r.error;
144
144
  if (t !== null && typeof t == "object" && !Array.isArray(t)) {
145
- const n = t.code;
146
- if (typeof n == "string") return n;
145
+ const o = t.code;
146
+ if (typeof o == "string") return o;
147
147
  }
148
148
  }
149
149
  } catch {
@@ -159,10 +159,10 @@ function g(e, r) {
159
159
  const i = r + s * 1e3;
160
160
  return Number.isSafeInteger(i) && i > r ? i : void 0;
161
161
  }
162
- const n = Date.parse(t);
163
- return Number.isSafeInteger(n) && n > r ? n : void 0;
162
+ const o = Date.parse(t);
163
+ return Number.isSafeInteger(o) && o > r ? o : void 0;
164
164
  }
165
- function f(e) {
165
+ function l(e) {
166
166
  return Object.freeze({
167
167
  kind: "failure",
168
168
  code: y.test(e) ? e : "invalid_error_code",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@floegence/floe-webapp-boot",
3
- "version": "0.47.0",
3
+ "version": "0.47.1",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",