@literary-universe/sdk 0.3.1 → 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/README.md CHANGED
@@ -243,11 +243,11 @@ The version covers the whole chapter, including its translations. A translation
243
243
  body save can therefore conflict with an original-language edit. Title-only and
244
244
  settings-only edits do not advance it.
245
245
 
246
- The initial write ceiling is 900,000 serialized UTF-8 bytes. In deployed builds,
247
- set server settings authorApi.draftWritesEnabled to true. Optional
248
- authorApi.allowedUserIds limits rollout to selected accounts. Development builds
249
- allow it by default; setting draftWritesEnabled false disables it there too.
250
- Production publication also requires authorApi.publicationEnabled to be true.
246
+ The write ceiling is 900,000 serialized UTF-8 bytes. Writing requires the key's
247
+ write scope and the author's current permissions on the resource. Organization
248
+ keys also require the organization's API feature and plan. Publication requires
249
+ `story:publish` and the work's publication permission. No deployment settings or
250
+ actor allowlist is required.
251
251
 
252
252
  ## Chapter lifecycle
253
253
 
@@ -417,7 +417,8 @@ decoders per server process. Body transfer has a twenty-second deadline; decodin
417
417
  has a killable ten-second deadline. Unavailable enforcement/storage fails closed.
418
418
  Transfer and intent leases renew while work is active; renewal calls are bounded
419
419
  to ten seconds and the final asset/result transaction to twenty-five seconds.
420
- Production uses the existing authorApi.draftWritesEnabled/allowedUserIds rollout.
420
+ Uploads require the purpose's write scope and current resource permissions.
421
+ Organization keys also require their organization's API feature and plan.
421
422
 
422
423
  Keep the prepared bytes and operation ID for retry. Changed input yields
423
424
  IDEMPOTENCY_CONFLICT; committed replay returns the original asset after current
@@ -431,7 +432,7 @@ collection. Storage remains public; protected comic/audio files use other contra
431
432
  For live image checks, configure an isolated local S3-compatible test endpoint in
432
433
  the test server's Backblaze settings, then run `node app/scripts/testApiImageContract.mjs` from the monorepo root with the same
433
434
  local _test database variables as test:integration. Real Backblaze verification
434
- remains a separate rollout check.
435
+ remains a separate integration check.
435
436
 
436
437
  Platform CI runs the package checks on Windows and macOS, including both Intel
437
438
  and Apple Silicon Macs. These checks cover extracted builds, packed consumers,
@@ -498,8 +499,8 @@ They require `blog:read` and management access to that blog.
498
499
  menu and the latest returned version for edits. Keep the full request unchanged
499
500
  when retrying a lost response; the SDK preserves it on transport retries.
500
501
  Organization keys may manage only their own enabled organization blog. Restricted
501
- story/universe keys cannot access blogs. The deployment's author write rollout
502
- must also permit writes.
502
+ story/universe keys cannot access blogs. Writes use these permissions without
503
+ deployment settings or an actor allowlist.
503
504
 
504
505
  ```ts
505
506
  const page = await client.mutateBlog({
@@ -5,6 +5,15 @@ export declare const IMAGE_POLICY: {
5
5
  readonly maxUploadPixels: 16000000;
6
6
  readonly processingSeconds: 10;
7
7
  readonly purposes: {
8
+ readonly "oauth-app-logo": {
9
+ readonly maxBytes: 2097152;
10
+ readonly allowedTypes: readonly ["image/jpeg", "image/png", "image/webp"];
11
+ readonly maxWidth: 512;
12
+ readonly maxHeight: 512;
13
+ readonly aspectRatio: 1;
14
+ readonly recommendedWidth: 512;
15
+ readonly recommendedHeight: 512;
16
+ };
8
17
  readonly "story-cover": {
9
18
  readonly maxBytes: 5242880;
10
19
  readonly allowedTypes: readonly ["image/jpeg", "image/png", "image/webp"];
@@ -9,6 +9,19 @@ exports.IMAGE_POLICY = {
9
9
  "maxUploadPixels": 16000000,
10
10
  "processingSeconds": 10,
11
11
  "purposes": {
12
+ "oauth-app-logo": {
13
+ "maxBytes": 2097152,
14
+ "allowedTypes": [
15
+ "image/jpeg",
16
+ "image/png",
17
+ "image/webp"
18
+ ],
19
+ "maxWidth": 512,
20
+ "maxHeight": 512,
21
+ "aspectRatio": 1,
22
+ "recommendedWidth": 512,
23
+ "recommendedHeight": 512
24
+ },
12
25
  "story-cover": {
13
26
  "maxBytes": 5242880,
14
27
  "allowedTypes": [
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
  }
@@ -5,6 +5,15 @@ export declare const IMAGE_POLICY: {
5
5
  readonly maxUploadPixels: 16000000;
6
6
  readonly processingSeconds: 10;
7
7
  readonly purposes: {
8
+ readonly "oauth-app-logo": {
9
+ readonly maxBytes: 2097152;
10
+ readonly allowedTypes: readonly ["image/jpeg", "image/png", "image/webp"];
11
+ readonly maxWidth: 512;
12
+ readonly maxHeight: 512;
13
+ readonly aspectRatio: 1;
14
+ readonly recommendedWidth: 512;
15
+ readonly recommendedHeight: 512;
16
+ };
8
17
  readonly "story-cover": {
9
18
  readonly maxBytes: 5242880;
10
19
  readonly allowedTypes: readonly ["image/jpeg", "image/png", "image/webp"];
@@ -6,6 +6,19 @@ export const IMAGE_POLICY = {
6
6
  "maxUploadPixels": 16000000,
7
7
  "processingSeconds": 10,
8
8
  "purposes": {
9
+ "oauth-app-logo": {
10
+ "maxBytes": 2097152,
11
+ "allowedTypes": [
12
+ "image/jpeg",
13
+ "image/png",
14
+ "image/webp"
15
+ ],
16
+ "maxWidth": 512,
17
+ "maxHeight": 512,
18
+ "aspectRatio": 1,
19
+ "recommendedWidth": 512,
20
+ "recommendedHeight": 512
21
+ },
9
22
  "story-cover": {
10
23
  "maxBytes": 5242880,
11
24
  "allowedTypes": [
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/image-policy.json CHANGED
@@ -5,6 +5,15 @@
5
5
  "maxUploadPixels": 16000000,
6
6
  "processingSeconds": 10,
7
7
  "purposes": {
8
+ "oauth-app-logo": {
9
+ "maxBytes": 2097152,
10
+ "allowedTypes": ["image/jpeg", "image/png", "image/webp"],
11
+ "maxWidth": 512,
12
+ "maxHeight": 512,
13
+ "aspectRatio": 1,
14
+ "recommendedWidth": 512,
15
+ "recommendedHeight": 512
16
+ },
8
17
  "story-cover": {
9
18
  "maxBytes": 5242880,
10
19
  "allowedTypes": ["image/jpeg", "image/png", "image/webp"],
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@literary-universe/sdk",
3
- "version": "0.3.1",
3
+ "version": "0.3.3",
4
4
  "description": "Literary Universe authoring API client for Node and Bun",
5
5
  "type": "module",
6
6
  "engines": {