@literary-universe/sdk 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/dist/cjs/index.js CHANGED
@@ -60,7 +60,7 @@ class LiteraryUniverseClient {
60
60
  ? typeof options.credentials !== 'function' ||
61
61
  options.token !== undefined
62
62
  : typeof options.token !== 'string' ||
63
- !/^lu_(?:live|dev|test)_[a-zA-Z0-9_-]+$/.test(options.token))
63
+ !/^[\x21-\x7e]+$/.test(options.token))
64
64
  throw invalid();
65
65
  this.endpoint = new URL(`${base.origin}${base.pathname.replace(/\/+$/, '')}/graphql`);
66
66
  this.#token = options.token;
@@ -379,7 +379,7 @@ class LiteraryUniverseClient {
379
379
  const credential = await providedCredential(this.#credentials, signal);
380
380
  if (credential?.kind !== 'api-key' ||
381
381
  typeof credential.token !== 'string' ||
382
- !/^lu_(?:live|dev|test)_[a-zA-Z0-9_-]+$/.test(credential.token))
382
+ !/^[\x21-\x7e]+$/.test(credential.token))
383
383
  throw new LiteraryUniverseApiError('INVALID_CONFIGURATION', 'Credential provider must return a valid API key');
384
384
  return credential.token;
385
385
  }
package/dist/esm/index.js CHANGED
@@ -55,7 +55,7 @@ export class LiteraryUniverseClient {
55
55
  ? typeof options.credentials !== 'function' ||
56
56
  options.token !== undefined
57
57
  : typeof options.token !== 'string' ||
58
- !/^lu_(?:live|dev|test)_[a-zA-Z0-9_-]+$/.test(options.token))
58
+ !/^[\x21-\x7e]+$/.test(options.token))
59
59
  throw invalid();
60
60
  this.endpoint = new URL(`${base.origin}${base.pathname.replace(/\/+$/, '')}/graphql`);
61
61
  this.#token = options.token;
@@ -374,7 +374,7 @@ export class LiteraryUniverseClient {
374
374
  const credential = await providedCredential(this.#credentials, signal);
375
375
  if (credential?.kind !== 'api-key' ||
376
376
  typeof credential.token !== 'string' ||
377
- !/^lu_(?:live|dev|test)_[a-zA-Z0-9_-]+$/.test(credential.token))
377
+ !/^[\x21-\x7e]+$/.test(credential.token))
378
378
  throw new LiteraryUniverseApiError('INVALID_CONFIGURATION', 'Credential provider must return a valid API key');
379
379
  return credential.token;
380
380
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@literary-universe/sdk",
3
- "version": "0.3.2",
3
+ "version": "0.3.3",
4
4
  "description": "Literary Universe authoring API client for Node and Bun",
5
5
  "type": "module",
6
6
  "engines": {