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

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.
@@ -288,7 +288,8 @@ var createPostSchema = {
288
288
  description: "tiptap = rich text JSON tree; markdown = source string (GFM extensions enabled); html = raw HTML string (rendered verbatim, no sanitization)."
289
289
  },
290
290
  body: {
291
- description: "tiptap JSON (when format=tiptap), markdown source string (format=markdown), or raw HTML string (format=html)."
291
+ type: ["object", "array", "string"],
292
+ description: "tiptap JSON (when format=tiptap; pass a JSON object/array, NOT a stringified string), markdown source string (format=markdown), or raw HTML string (format=html)."
292
293
  },
293
294
  status: { type: "string", enum: ["draft", "published"], default: "draft" },
294
295
  excerpt: { type: "string" },
@@ -357,7 +358,10 @@ var updatePostSchema = {
357
358
  enum: ["tiptap", "markdown", "html"],
358
359
  description: "tiptap = rich text JSON tree; markdown = source string; html = raw HTML string (no sanitization)."
359
360
  },
360
- body: { description: "tiptap JSON, markdown source, or raw HTML string" },
361
+ body: {
362
+ type: ["object", "array", "string"],
363
+ description: "tiptap JSON (when format=tiptap; pass a JSON object/array, NOT a stringified string), markdown source, or raw HTML string"
364
+ },
361
365
  status: { type: "string", enum: ["draft", "published"] },
362
366
  publishedAt: { type: "string", description: "ISO 8601 timestamp" },
363
367
  tags: { type: "array", items: { type: "string" } },
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.84",
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",
@@ -69,7 +69,7 @@
69
69
  "@smithy/protocol-http": "^5.4.4",
70
70
  "@smithy/signature-v4": "^5.4.4",
71
71
  "fflate": "^0.8.3",
72
- "@ampless/mcp-server": "1.0.0-beta.60",
72
+ "@ampless/mcp-server": "1.0.0-beta.61",
73
73
  "ampless": "1.0.0-beta.54"
74
74
  },
75
75
  "peerDependencies": {