graphlit-client 1.0.20251222002 → 1.0.20251222003

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 +19 -17
  2. package/package.json +1 -1
package/dist/client.js CHANGED
@@ -209,23 +209,25 @@ class Graphlit {
209
209
  jitter: true,
210
210
  ...options.retryConfig,
211
211
  };
212
- if (!this.organizationId) {
213
- throw new Error("Graphlit organization identifier is required.");
214
- }
215
- if (!isValidGuid(this.organizationId)) {
216
- throw new Error(`Invalid organization ID format. Expected a valid GUID, but received: '${this.organizationId}'. ` +
217
- "A valid GUID should be in the format: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx");
218
- }
219
- if (!this.environmentId) {
220
- throw new Error("Graphlit environment identifier is required.");
221
- }
222
- if (!isValidGuid(this.environmentId)) {
223
- throw new Error(`Invalid environment ID format. Expected a valid GUID, but received: '${this.environmentId}'. ` +
224
- "A valid GUID should be in the format: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx");
225
- }
226
- // jwtSecret is only required if no pre-signed token is provided
227
- if (!this.jwtSecret && !options.token) {
228
- throw new Error("Graphlit environment JWT secret is required.");
212
+ // Skip all validation if pre-signed token is provided
213
+ if (!options.token) {
214
+ if (!this.organizationId) {
215
+ throw new Error("Graphlit organization identifier is required.");
216
+ }
217
+ if (!isValidGuid(this.organizationId)) {
218
+ throw new Error(`Invalid organization ID format. Expected a valid GUID, but received: '${this.organizationId}'. ` +
219
+ "A valid GUID should be in the format: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx");
220
+ }
221
+ if (!this.environmentId) {
222
+ throw new Error("Graphlit environment identifier is required.");
223
+ }
224
+ if (!isValidGuid(this.environmentId)) {
225
+ throw new Error(`Invalid environment ID format. Expected a valid GUID, but received: '${this.environmentId}'. ` +
226
+ "A valid GUID should be in the format: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx");
227
+ }
228
+ if (!this.jwtSecret) {
229
+ throw new Error("Graphlit environment JWT secret is required.");
230
+ }
229
231
  }
230
232
  // Validate optional userId if provided (ownerId can be any format)
231
233
  if (this.userId && !isValidGuid(this.userId)) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "graphlit-client",
3
- "version": "1.0.20251222002",
3
+ "version": "1.0.20251222003",
4
4
  "description": "Graphlit API Client for TypeScript",
5
5
  "type": "module",
6
6
  "main": "./dist/client.js",