@ampless/backend 1.0.0-beta.82 → 1.0.0-beta.83

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/index.js +13 -5
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -340,9 +340,13 @@ function amplessSchemaModels(a, opts = {}) {
340
340
  slug: a.string().required(),
341
341
  title: a.string().required(),
342
342
  excerpt: a.string(),
343
- format: a.enum(["tiptap", "markdown", "html", "static"]).required(),
343
+ // Amplify enum fields are always nullable — `a.enum(...).required()`
344
+ // is not a runtime function (it throws at CDK synth). The app layer
345
+ // always populates format/status; the TS `Post` interface treats them
346
+ // as non-optional, but the GraphQL schema cannot enforce required here.
347
+ format: a.enum(["tiptap", "markdown", "html", "static"]),
344
348
  body: a.json(),
345
- status: a.enum(["draft", "published"]).required(),
349
+ status: a.enum(["draft", "published"]),
346
350
  publishedAt: a.datetime(),
347
351
  tags: a.string().array(),
348
352
  // Free-form per-post metadata (JSON). Reserved well-known keys
@@ -363,9 +367,10 @@ function amplessSchemaModels(a, opts = {}) {
363
367
  pageId: a.id().required(),
364
368
  slug: a.string().required(),
365
369
  title: a.string().required(),
366
- format: a.enum(["tiptap", "markdown", "html", "static"]).required(),
370
+ // See the note on Post.format/status enum fields cannot be required.
371
+ format: a.enum(["tiptap", "markdown", "html", "static"]),
367
372
  body: a.json(),
368
- status: a.enum(["draft", "published"]).required(),
373
+ status: a.enum(["draft", "published"]),
369
374
  publishedAt: a.datetime()
370
375
  }).identifier(["pageId"]).authorization((allow) => [
371
376
  allow.groups(["ampless-admin", "ampless-editor"])
@@ -375,7 +380,10 @@ function amplessSchemaModels(a, opts = {}) {
375
380
  src: a.string().required(),
376
381
  mimeType: a.string().required(),
377
382
  size: a.integer(),
378
- delivery: a.enum(["nextjs", "s3-direct"]).required(),
383
+ // Bare string (nullable). Enum fields can't be `.required()`, and
384
+ // making this an enum without required would still be a String→enum
385
+ // GraphQL type change; keep the original loose string for now.
386
+ delivery: a.string(),
379
387
  // Free-form per-asset metadata (JSON). Currently used to
380
388
  // memoise the S3 ETag for stream-back routes; future use
381
389
  // for image dimensions, EXIF strip status, etc. Kept loose
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ampless/backend",
3
- "version": "1.0.0-beta.82",
3
+ "version": "1.0.0-beta.83",
4
4
  "description": "Amplify Gen 2 backend factories for ampless: auth, data, storage, event processors, API key renewer",
5
5
  "license": "MIT",
6
6
  "type": "module",