@archilogic/extension-sdk 0.2.1 → 0.2.2

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/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # @archilogic/extension-sdk
2
2
 
3
+ ## 0.2.2
4
+
5
+ ### Patch Changes
6
+
7
+ - 235928e: fix(extension-sdk): enable any localhost and deployed frontend url
8
+
3
9
  ## 0.2.1
4
10
 
5
11
  ### Patch Changes
@@ -138,9 +138,9 @@ var Pe = class extends Error {
138
138
  remoteProxy: pe((h, o) => {
139
139
  if (a)
140
140
  throw te(h);
141
- const i = he(), E = o[o.length - 1], u = E instanceof ke, { timeout: p, transferables: g } = u ? E : {}, F = u ? o.slice(0, -1) : o;
141
+ const i = he(), E = o[o.length - 1], u = E instanceof ke, { timeout: p, transferables: K } = u ? E : {}, F = u ? o.slice(0, -1) : o;
142
142
  return new Promise((Y, O) => {
143
- const K = p !== void 0 ? window.setTimeout(() => {
143
+ const g = p !== void 0 ? window.setTimeout(() => {
144
144
  n.delete(i), O(
145
145
  new w(
146
146
  "METHOD_CALL_TIMEOUT",
@@ -150,7 +150,7 @@ var Pe = class extends Error {
150
150
  )
151
151
  );
152
152
  }, p) : void 0;
153
- n.set(i, { methodPath: h, resolve: Y, reject: O, timeoutId: K });
153
+ n.set(i, { methodPath: h, resolve: Y, reject: O, timeoutId: g });
154
154
  try {
155
155
  const T = {
156
156
  namespace: M,
@@ -160,7 +160,7 @@ var Pe = class extends Error {
160
160
  methodPath: h,
161
161
  args: F
162
162
  };
163
- r == null || r(`Sending ${C(h)}() call`, T), e.sendMessage(T, g);
163
+ r == null || r(`Sending ${C(h)}() call`, T), e.sendMessage(T, K);
164
164
  } catch (T) {
165
165
  O(
166
166
  new w("TRANSMISSION_FAILED", T.message)
@@ -271,7 +271,7 @@ var Pe = class extends Error {
271
271
  returnValue: e.value
272
272
  };
273
273
  throw fe(e);
274
- }, ge = ({
274
+ }, Ke = ({
275
275
  messenger: e,
276
276
  methods: t,
277
277
  timeout: r,
@@ -289,7 +289,7 @@ var Pe = class extends Error {
289
289
  `Connection timed out after ${r}ms`
290
290
  )
291
291
  );
292
- }, r) : void 0, g = () => {
292
+ }, r) : void 0, K = () => {
293
293
  for (const c of v)
294
294
  c();
295
295
  }, F = () => {
@@ -299,7 +299,7 @@ var Pe = class extends Error {
299
299
  const { remoteProxy: c, destroy: m } = xe(e, a, n);
300
300
  v.push(m), clearTimeout(p), h = !0, E({
301
301
  remoteProxy: c,
302
- destroy: g
302
+ destroy: K
303
303
  });
304
304
  }, Y = () => {
305
305
  const c = {
@@ -332,7 +332,7 @@ var Pe = class extends Error {
332
332
  u(new w("TRANSMISSION_FAILED", Me.message));
333
333
  return;
334
334
  }
335
- }, K = (c) => {
335
+ }, g = (c) => {
336
336
  n == null || n("Received handshake ACK1", c);
337
337
  const m = {
338
338
  namespace: M,
@@ -350,10 +350,10 @@ var Pe = class extends Error {
350
350
  }, T = (c) => {
351
351
  n == null || n("Received handshake ACK2", c), F();
352
352
  }, q = (c) => {
353
- j(c) && O(c), X(c) && K(c), z(c) && T(c);
353
+ j(c) && O(c), X(c) && g(c), z(c) && T(c);
354
354
  };
355
355
  return e.addMessageHandler(q), v.push(() => e.removeMessageHandler(q)), Y(), i;
356
- }, Ke = ge, ze = (e) => {
356
+ }, ge = Ke, ze = (e) => {
357
357
  let t = !1, r;
358
358
  return (...a) => (t || (t = !0, r = e(...a)), r);
359
359
  }, Ge = ze, ne = /* @__PURE__ */ new WeakSet(), Be = ({
@@ -393,7 +393,7 @@ var Pe = class extends Error {
393
393
  e.initialize({ log: n, validateReceivedMessage: v }), e.addMessageHandler((E) => {
394
394
  Ne(E) && l(!1);
395
395
  });
396
- const { remoteProxy: o, destroy: i } = await Ke({
396
+ const { remoteProxy: o, destroy: i } = await ge({
397
397
  messenger: e,
398
398
  methods: t,
399
399
  timeout: r,
@@ -533,7 +533,7 @@ const Qe = (e, t) => {
533
533
  const r = new ye({
534
534
  remoteWindow: e.contentWindow,
535
535
  // Defaults to the current origin.
536
- allowedOrigins: ["http://localhost:3000", "https://archilogic-com.github.io"]
536
+ allowedOrigins: [/^http:\/\/localhost(:\d+)/, "https://archilogic-com.github.io"]
537
537
  // Alternatively,
538
538
  // allowedOrigins: [new Url(iframe.src).origin]
539
539
  });
@@ -560,9 +560,9 @@ const Qe = (e, t) => {
560
560
  remoteWindow: window.parent,
561
561
  // Defaults to the current origin.
562
562
  allowedOrigins: [
563
- "http://localhost:4000",
564
- "https://app.archilogic.com",
565
- "https://testing-app.archilogic.com"
563
+ /^http:\/\/localhost(:\d+)/,
564
+ /^https:\/\/(.*)app.archilogic.com/,
565
+ /^https:\/\/(.*).archilogic-frontend.com/
566
566
  ]
567
567
  }), r = ve({
568
568
  messenger: t,
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@archilogic/extension-sdk",
3
3
  "description": "",
4
- "version": "0.2.1",
4
+ "version": "0.2.2",
5
5
  "publishConfig": {
6
6
  "access": "public"
7
7
  },