@surelle-ha/dead-fuse 1.0.4 → 1.0.6

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.d.mts CHANGED
@@ -7,6 +7,7 @@ interface DeadFuseConfig {
7
7
  * e.g. "https://your-dashboard.vercel.app"
8
8
  * The SDK fetches configuration from `<master>/api/config` automatically.
9
9
  * Optional: provide this OR both (supabaseUrl + supabaseAnonKey).
10
+ * If omitted, the SDK will use the package default dashboard URL.
10
11
  */
11
12
  master?: string;
12
13
  /**
package/dist/index.d.ts CHANGED
@@ -7,6 +7,7 @@ interface DeadFuseConfig {
7
7
  * e.g. "https://your-dashboard.vercel.app"
8
8
  * The SDK fetches configuration from `<master>/api/config` automatically.
9
9
  * Optional: provide this OR both (supabaseUrl + supabaseAnonKey).
10
+ * If omitted, the SDK will use the package default dashboard URL.
10
11
  */
11
12
  master?: string;
12
13
  /**
package/dist/index.js CHANGED
@@ -28,6 +28,9 @@ module.exports = __toCommonJS(index_exports);
28
28
  // src/connection.ts
29
29
  var import_supabase_js = require("@supabase/supabase-js");
30
30
 
31
+ // src/constants.ts
32
+ var DEFAULT_MASTER = "https://dead-fuse.surelle.xyz";
33
+
31
34
  // src/stateManager.ts
32
35
  var MUTATION_METHODS = /* @__PURE__ */ new Set(["POST", "PUT", "PATCH", "DELETE"]);
33
36
  var currentState = null;
@@ -207,7 +210,7 @@ var DeadFuseConnection = class {
207
210
  let supabaseUrl = this.config.supabaseUrl;
208
211
  let supabaseAnonKey = this.config.supabaseAnonKey;
209
212
  if (!supabaseUrl || !supabaseAnonKey) {
210
- const masterUrl = this.config.master ?? (typeof window !== "undefined" ? window.location.origin : void 0);
213
+ const masterUrl = this.config.master ?? DEFAULT_MASTER;
211
214
  if (!masterUrl) {
212
215
  console.error(
213
216
  "[DeadFuse] Provide either `master` (dashboard URL) or both `supabaseUrl` + `supabaseAnonKey`."
@@ -366,9 +369,7 @@ var DeadFuse = {
366
369
  const hasExplicitSupabase = Boolean(config.supabaseUrl && config.supabaseAnonKey);
367
370
  const resolvedConfig = { ...config };
368
371
  if (!resolvedConfig.master && !hasExplicitSupabase) {
369
- if (typeof window !== "undefined") {
370
- resolvedConfig.master = window.location.origin;
371
- }
372
+ resolvedConfig.master = DEFAULT_MASTER;
372
373
  }
373
374
  if (!resolvedConfig.master && !hasExplicitSupabase) {
374
375
  throw new Error(
package/dist/index.mjs CHANGED
@@ -1,6 +1,9 @@
1
1
  // src/connection.ts
2
2
  import { createClient } from "@supabase/supabase-js";
3
3
 
4
+ // src/constants.ts
5
+ var DEFAULT_MASTER = "https://dead-fuse.surelle.xyz";
6
+
4
7
  // src/stateManager.ts
5
8
  var MUTATION_METHODS = /* @__PURE__ */ new Set(["POST", "PUT", "PATCH", "DELETE"]);
6
9
  var currentState = null;
@@ -180,7 +183,7 @@ var DeadFuseConnection = class {
180
183
  let supabaseUrl = this.config.supabaseUrl;
181
184
  let supabaseAnonKey = this.config.supabaseAnonKey;
182
185
  if (!supabaseUrl || !supabaseAnonKey) {
183
- const masterUrl = this.config.master ?? (typeof window !== "undefined" ? window.location.origin : void 0);
186
+ const masterUrl = this.config.master ?? DEFAULT_MASTER;
184
187
  if (!masterUrl) {
185
188
  console.error(
186
189
  "[DeadFuse] Provide either `master` (dashboard URL) or both `supabaseUrl` + `supabaseAnonKey`."
@@ -339,9 +342,7 @@ var DeadFuse = {
339
342
  const hasExplicitSupabase = Boolean(config.supabaseUrl && config.supabaseAnonKey);
340
343
  const resolvedConfig = { ...config };
341
344
  if (!resolvedConfig.master && !hasExplicitSupabase) {
342
- if (typeof window !== "undefined") {
343
- resolvedConfig.master = window.location.origin;
344
- }
345
+ resolvedConfig.master = DEFAULT_MASTER;
345
346
  }
346
347
  if (!resolvedConfig.master && !hasExplicitSupabase) {
347
348
  throw new Error(
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@surelle-ha/dead-fuse",
3
- "version": "1.0.4",
3
+ "version": "1.0.6",
4
4
  "description": "Lightweight license enforcement and remote control layer for deployed web applications",
5
5
  "publishConfig": {
6
6
  "access": "public"