@inneropen/marvin-sdk 2.0.0-next.21 → 2.0.0-next.22

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.
@@ -111,15 +111,21 @@ Change to: ${config.apiUrl.replace(url.protocol, "https:")}`
111
111
  }
112
112
  }
113
113
  }
114
+ function getEnv(key) {
115
+ if (typeof process !== "undefined" && process.env) {
116
+ return process.env[key];
117
+ }
118
+ return void 0;
119
+ }
114
120
  function createConfigFromEnv(overrides) {
115
121
  return {
116
- apiUrl: overrides?.apiUrl || process.env.MARVIN_API_URL || "",
117
- siteClientToken: overrides?.siteClientToken || process.env.MARVIN_SITE_CLIENT_TOKEN || "",
118
- workspaceSlug: overrides?.workspaceSlug || process.env.MARVIN_WORKSPACE_SLUG || "",
122
+ apiUrl: overrides?.apiUrl || getEnv("MARVIN_API_URL") || "",
123
+ siteClientToken: overrides?.siteClientToken || getEnv("MARVIN_SITE_CLIENT_TOKEN") || "",
124
+ workspaceSlug: overrides?.workspaceSlug || getEnv("MARVIN_WORKSPACE_SLUG") || "",
119
125
  autoInitialize: overrides?.autoInitialize ?? false,
120
126
  cacheDuration: overrides?.cacheDuration ?? 5 * 60 * 1e3,
121
127
  // 5 minutes
122
- debug: overrides?.debug ?? process.env.MARVIN_DEBUG === "true",
128
+ debug: overrides?.debug ?? getEnv("MARVIN_DEBUG") === "true",
123
129
  logger: overrides?.logger ?? console
124
130
  };
125
131
  }
package/dist/index.cjs CHANGED
@@ -122,15 +122,21 @@ Change to: ${config.apiUrl.replace(url.protocol, "https:")}`
122
122
  }
123
123
  }
124
124
  }
125
+ function getEnv(key) {
126
+ if (typeof process !== "undefined" && process.env) {
127
+ return process.env[key];
128
+ }
129
+ return void 0;
130
+ }
125
131
  function createConfigFromEnv(overrides) {
126
132
  return {
127
- apiUrl: overrides?.apiUrl || process.env.MARVIN_API_URL || "",
128
- siteClientToken: overrides?.siteClientToken || process.env.MARVIN_SITE_CLIENT_TOKEN || "",
129
- workspaceSlug: overrides?.workspaceSlug || process.env.MARVIN_WORKSPACE_SLUG || "",
133
+ apiUrl: overrides?.apiUrl || getEnv("MARVIN_API_URL") || "",
134
+ siteClientToken: overrides?.siteClientToken || getEnv("MARVIN_SITE_CLIENT_TOKEN") || "",
135
+ workspaceSlug: overrides?.workspaceSlug || getEnv("MARVIN_WORKSPACE_SLUG") || "",
130
136
  autoInitialize: overrides?.autoInitialize ?? false,
131
137
  cacheDuration: overrides?.cacheDuration ?? 5 * 60 * 1e3,
132
138
  // 5 minutes
133
- debug: overrides?.debug ?? process.env.MARVIN_DEBUG === "true",
139
+ debug: overrides?.debug ?? getEnv("MARVIN_DEBUG") === "true",
134
140
  logger: overrides?.logger ?? console
135
141
  };
136
142
  }
package/dist/index.js CHANGED
@@ -13,7 +13,7 @@ import {
13
13
  init_resource,
14
14
  init_workspace,
15
15
  marvin_exports
16
- } from "./chunk-TZ2TZFWP.js";
16
+ } from "./chunk-SGZG7U7V.js";
17
17
  import {
18
18
  BearerTokenAuth,
19
19
  HttpClient,
package/dist/platform.cjs CHANGED
@@ -1781,10 +1781,16 @@ var FormsModule = class {
1781
1781
  };
1782
1782
 
1783
1783
  // src/platform/client.ts
1784
+ function getEnv2(key) {
1785
+ if (typeof process !== "undefined" && process.env) {
1786
+ return process.env[key];
1787
+ }
1788
+ return void 0;
1789
+ }
1784
1790
  function createPlatformConfigFromEnv(overrides) {
1785
1791
  return {
1786
- apiUrl: overrides?.apiUrl || process.env.MARVIN_API_URL || "http://localhost:8080",
1787
- userToken: overrides?.userToken || process.env.MARVIN_USER_TOKEN,
1792
+ apiUrl: overrides?.apiUrl || getEnv2("MARVIN_API_URL") || "http://localhost:8080",
1793
+ userToken: overrides?.userToken || getEnv2("MARVIN_USER_TOKEN"),
1788
1794
  credentials: overrides?.credentials || "include"
1789
1795
  };
1790
1796
  }
@@ -4646,9 +4646,6 @@ interface PlatformClientConfig {
4646
4646
  userToken?: string;
4647
4647
  credentials?: RequestCredentials;
4648
4648
  }
4649
- /**
4650
- * Create Platform API config from environment
4651
- */
4652
4649
  declare function createPlatformConfigFromEnv(overrides?: Partial<PlatformClientConfig>): PlatformClientConfig;
4653
4650
  declare class PlatformClient extends HttpClient {
4654
4651
  entries: EntriesModule;
@@ -4646,9 +4646,6 @@ interface PlatformClientConfig {
4646
4646
  userToken?: string;
4647
4647
  credentials?: RequestCredentials;
4648
4648
  }
4649
- /**
4650
- * Create Platform API config from environment
4651
- */
4652
4649
  declare function createPlatformConfigFromEnv(overrides?: Partial<PlatformClientConfig>): PlatformClientConfig;
4653
4650
  declare class PlatformClient extends HttpClient {
4654
4651
  entries: EntriesModule;
package/dist/platform.js CHANGED
@@ -1338,10 +1338,16 @@ var FormsModule = class {
1338
1338
  };
1339
1339
 
1340
1340
  // src/platform/client.ts
1341
+ function getEnv2(key) {
1342
+ if (typeof process !== "undefined" && process.env) {
1343
+ return process.env[key];
1344
+ }
1345
+ return void 0;
1346
+ }
1341
1347
  function createPlatformConfigFromEnv(overrides) {
1342
1348
  return {
1343
- apiUrl: overrides?.apiUrl || process.env.MARVIN_API_URL || "http://localhost:8080",
1344
- userToken: overrides?.userToken || process.env.MARVIN_USER_TOKEN,
1349
+ apiUrl: overrides?.apiUrl || getEnv2("MARVIN_API_URL") || "http://localhost:8080",
1350
+ userToken: overrides?.userToken || getEnv2("MARVIN_USER_TOKEN"),
1345
1351
  credentials: overrides?.credentials || "include"
1346
1352
  };
1347
1353
  }
package/dist/publish.cjs CHANGED
@@ -122,15 +122,21 @@ Change to: ${config.apiUrl.replace(url.protocol, "https:")}`
122
122
  }
123
123
  }
124
124
  }
125
+ function getEnv(key) {
126
+ if (typeof process !== "undefined" && process.env) {
127
+ return process.env[key];
128
+ }
129
+ return void 0;
130
+ }
125
131
  function createConfigFromEnv(overrides) {
126
132
  return {
127
- apiUrl: overrides?.apiUrl || process.env.MARVIN_API_URL || "",
128
- siteClientToken: overrides?.siteClientToken || process.env.MARVIN_SITE_CLIENT_TOKEN || "",
129
- workspaceSlug: overrides?.workspaceSlug || process.env.MARVIN_WORKSPACE_SLUG || "",
133
+ apiUrl: overrides?.apiUrl || getEnv("MARVIN_API_URL") || "",
134
+ siteClientToken: overrides?.siteClientToken || getEnv("MARVIN_SITE_CLIENT_TOKEN") || "",
135
+ workspaceSlug: overrides?.workspaceSlug || getEnv("MARVIN_WORKSPACE_SLUG") || "",
130
136
  autoInitialize: overrides?.autoInitialize ?? false,
131
137
  cacheDuration: overrides?.cacheDuration ?? 5 * 60 * 1e3,
132
138
  // 5 minutes
133
- debug: overrides?.debug ?? process.env.MARVIN_DEBUG === "true",
139
+ debug: overrides?.debug ?? getEnv("MARVIN_DEBUG") === "true",
134
140
  logger: overrides?.logger ?? console
135
141
  };
136
142
  }
package/dist/publish.js CHANGED
@@ -12,7 +12,7 @@ import {
12
12
  init_marvin,
13
13
  init_resource,
14
14
  init_workspace
15
- } from "./chunk-TZ2TZFWP.js";
15
+ } from "./chunk-SGZG7U7V.js";
16
16
  import {
17
17
  BearerTokenAuth,
18
18
  HttpClient,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@inneropen/marvin-sdk",
3
- "version": "2.0.0-next.21",
3
+ "version": "2.0.0-next.22",
4
4
  "description": "Official TypeScript SDK for Marvin CMS",
5
5
  "type": "module",
6
6
  "main": "./dist/index.cjs",