graphlit-client 1.0.20240418009 → 1.0.20240418010

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.
Files changed (2) hide show
  1. package/dist/client.js +7 -5
  2. package/package.json +1 -1
package/dist/client.js CHANGED
@@ -38,16 +38,18 @@ const core_1 = require("@apollo/client/core");
38
38
  const Documents = __importStar(require("./generated/graphql-documents"));
39
39
  const dotenv = __importStar(require("dotenv"));
40
40
  // Initialize dotenv to use environment variables
41
- dotenv.config();
41
+ if (process)
42
+ dotenv.config();
42
43
  // Define the Graphlit class
43
44
  class Graphlit {
44
45
  constructor(organizationId, environmentId, jwtSecret, ownerId, apiUri, correlationId) {
46
+ var _a, _b, _c, _d;
45
47
  this.apiUri = apiUri || "https://data-scus.graphlit.io/api/v1";
46
- this.organizationId = organizationId || process.env.GRAPHLIT_ORGANIZATION_ID;
47
- this.environmentId = environmentId || process.env.GRAPHLIT_ENVIRONMENT_ID;
48
- this.jwtSecret = jwtSecret || process.env.GRAPHLIT_JWT_SECRET;
48
+ this.organizationId = organizationId || ((_a = process === null || process === void 0 ? void 0 : process.env) === null || _a === void 0 ? void 0 : _a.GRAPHLIT_ORGANIZATION_ID);
49
+ this.environmentId = environmentId || ((_b = process === null || process === void 0 ? void 0 : process.env) === null || _b === void 0 ? void 0 : _b.GRAPHLIT_ENVIRONMENT_ID);
50
+ this.jwtSecret = jwtSecret || ((_c = process === null || process === void 0 ? void 0 : process.env) === null || _c === void 0 ? void 0 : _c.GRAPHLIT_JWT_SECRET);
49
51
  // optional: for multi-tenant support
50
- this.ownerId = ownerId || process.env.GRAPHLIT_OWNER_ID;
52
+ this.ownerId = ownerId || ((_d = process === null || process === void 0 ? void 0 : process.env) === null || _d === void 0 ? void 0 : _d.GRAPHLIT_OWNER_ID);
51
53
  // optional: for billing correlation of multiple operations
52
54
  this.correlationId = correlationId || undefined;
53
55
  if (!this.organizationId) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "graphlit-client",
3
- "version": "1.0.20240418009",
3
+ "version": "1.0.20240418010",
4
4
  "description": "Graphlit API TypeScript Client",
5
5
  "main": "dist/client.js",
6
6
  "types": "dist/client.d.ts",