windmill-client 0.3.2 → 0.3.3

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/client.ts CHANGED
@@ -26,12 +26,13 @@ export const SHARED_FOLDER = "/shared";
26
26
 
27
27
  export function setClient(token?: string, baseUrl?: string) {
28
28
  if (baseUrl === undefined) {
29
- baseUrl = getEnv("BASE_INTERNAL_URL") ??
29
+ baseUrl =
30
+ getEnv("BASE_INTERNAL_URL") ??
30
31
  getEnv("BASE_URL") ??
31
- "http://localhost:8000"
32
+ "http://localhost:8000";
32
33
  }
33
34
  if (token === undefined) {
34
- baseUrl = getEnv("WM_TOKEN") ?? "no_token",
35
+ baseUrl = getEnv("WM_TOKEN") ?? "no_token";
35
36
  }
36
37
  OpenAPI.WITH_CREDENTIALS = true;
37
38
  OpenAPI.TOKEN = token;
@@ -39,15 +40,13 @@ export function setClient(token?: string, baseUrl?: string) {
39
40
  }
40
41
 
41
42
  const getEnv = (key: string) => {
42
- if (typeof window === 'undefined') {
43
+ if (typeof window === "undefined") {
43
44
  // node
44
- return process.env[key]
45
+ return process.env[key];
45
46
  }
46
47
  // browser
47
- return window.process.env[key]
48
- }
49
-
50
-
48
+ return window.process.env[key];
49
+ };
51
50
 
52
51
  /**
53
52
  * Create a client configuration from env variables
package/dist/client.js CHANGED
@@ -21,11 +21,11 @@ exports.SHARED_FOLDER = "/shared";
21
21
  function setClient(token, baseUrl) {
22
22
  var _a, _b, _c;
23
23
  if (baseUrl === undefined) {
24
- baseUrl = (_b = (_a = getEnv("BASE_INTERNAL_URL")) !== null && _a !== void 0 ? _a : getEnv("BASE_URL")) !== null && _b !== void 0 ? _b : "http://localhost:8000";
24
+ baseUrl =
25
+ (_b = (_a = getEnv("BASE_INTERNAL_URL")) !== null && _a !== void 0 ? _a : getEnv("BASE_URL")) !== null && _b !== void 0 ? _b : "http://localhost:8000";
25
26
  }
26
27
  if (token === undefined) {
27
- baseUrl = (_c = getEnv("WM_TOKEN")) !== null && _c !== void 0 ? _c : "no_token",
28
- ;
28
+ baseUrl = (_c = getEnv("WM_TOKEN")) !== null && _c !== void 0 ? _c : "no_token";
29
29
  }
30
30
  index_ts_2.OpenAPI.WITH_CREDENTIALS = true;
31
31
  index_ts_2.OpenAPI.TOKEN = token;
@@ -33,7 +33,7 @@ function setClient(token, baseUrl) {
33
33
  }
34
34
  exports.setClient = setClient;
35
35
  const getEnv = (key) => {
36
- if (typeof window === 'undefined') {
36
+ if (typeof window === "undefined") {
37
37
  // node
38
38
  return process.env[key];
39
39
  }
@@ -21,11 +21,11 @@ exports.SHARED_FOLDER = "/shared";
21
21
  function setClient(token, baseUrl) {
22
22
  var _a, _b, _c;
23
23
  if (baseUrl === undefined) {
24
- baseUrl = (_b = (_a = getEnv("BASE_INTERNAL_URL")) !== null && _a !== void 0 ? _a : getEnv("BASE_URL")) !== null && _b !== void 0 ? _b : "http://localhost:8000";
24
+ baseUrl =
25
+ (_b = (_a = getEnv("BASE_INTERNAL_URL")) !== null && _a !== void 0 ? _a : getEnv("BASE_URL")) !== null && _b !== void 0 ? _b : "http://localhost:8000";
25
26
  }
26
27
  if (token === undefined) {
27
- baseUrl = (_c = getEnv("WM_TOKEN")) !== null && _c !== void 0 ? _c : "no_token",
28
- ;
28
+ baseUrl = (_c = getEnv("WM_TOKEN")) !== null && _c !== void 0 ? _c : "no_token";
29
29
  }
30
30
  index_ts_2.OpenAPI.WITH_CREDENTIALS = true;
31
31
  index_ts_2.OpenAPI.TOKEN = token;
@@ -33,7 +33,7 @@ function setClient(token, baseUrl) {
33
33
  }
34
34
  exports.setClient = setClient;
35
35
  const getEnv = (key) => {
36
- if (typeof window === 'undefined') {
36
+ if (typeof window === "undefined") {
37
37
  // node
38
38
  return process.env[key];
39
39
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "windmill-client",
3
3
  "description": "Windmill SDK client for browsers and Node.js",
4
- "version": "0.3.2",
4
+ "version": "0.3.3",
5
5
  "author": "Ruben Fiszel",
6
6
  "license": "Apache 2.0",
7
7
  "dependencies": {},
package/src/client.ts CHANGED
@@ -26,12 +26,13 @@ export const SHARED_FOLDER = "/shared";
26
26
 
27
27
  export function setClient(token?: string, baseUrl?: string) {
28
28
  if (baseUrl === undefined) {
29
- baseUrl = getEnv("BASE_INTERNAL_URL") ??
29
+ baseUrl =
30
+ getEnv("BASE_INTERNAL_URL") ??
30
31
  getEnv("BASE_URL") ??
31
- "http://localhost:8000"
32
+ "http://localhost:8000";
32
33
  }
33
34
  if (token === undefined) {
34
- baseUrl = getEnv("WM_TOKEN") ?? "no_token",
35
+ baseUrl = getEnv("WM_TOKEN") ?? "no_token";
35
36
  }
36
37
  OpenAPI.WITH_CREDENTIALS = true;
37
38
  OpenAPI.TOKEN = token;
@@ -39,15 +40,13 @@ export function setClient(token?: string, baseUrl?: string) {
39
40
  }
40
41
 
41
42
  const getEnv = (key: string) => {
42
- if (typeof window === 'undefined') {
43
+ if (typeof window === "undefined") {
43
44
  // node
44
- return process.env[key]
45
+ return process.env[key];
45
46
  }
46
47
  // browser
47
- return window.process.env[key]
48
- }
49
-
50
-
48
+ return window.process.env[key];
49
+ };
51
50
 
52
51
  /**
53
52
  * Create a client configuration from env variables