@actuate-media/cms-core 0.11.0 → 0.11.1
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/__tests__/actions/document-crud.test.js +5 -1
- package/dist/__tests__/actions/document-crud.test.js.map +1 -1
- package/dist/__tests__/api/admin-contracts.test.js.map +1 -1
- package/dist/__tests__/api/public-globals.test.js.map +1 -1
- package/dist/__tests__/auth/password.test.js.map +1 -1
- package/dist/__tests__/auth/session.test.js.map +1 -1
- package/dist/__tests__/codegen/generate-types.test.js.map +1 -1
- package/dist/__tests__/next.test.js +1 -3
- package/dist/__tests__/next.test.js.map +1 -1
- package/dist/__tests__/scheduling/scheduling.test.js +28 -4
- package/dist/__tests__/scheduling/scheduling.test.js.map +1 -1
- package/dist/__tests__/security/access.test.js +1 -1
- package/dist/__tests__/security/access.test.js.map +1 -1
- package/dist/__tests__/security/audit.test.js.map +1 -1
- package/dist/__tests__/security/client-ip.test.js.map +1 -1
- package/dist/__tests__/security/csrf.test.js.map +1 -1
- package/dist/__tests__/security/ip-allowlist.test.js.map +1 -1
- package/dist/__tests__/security/rate-limit.test.js.map +1 -1
- package/dist/__tests__/security/reauth.test.js.map +1 -1
- package/dist/__tests__/security/redact.test.js.map +1 -1
- package/dist/__tests__/security/sanitize.test.js.map +1 -1
- package/dist/__tests__/security/secret-storage.test.js.map +1 -1
- package/dist/__tests__/security/upload-magic.test.js.map +1 -1
- package/dist/__tests__/server-site.test.js.map +1 -1
- package/dist/__tests__/site.test.js +5 -2
- package/dist/__tests__/site.test.js.map +1 -1
- package/dist/__tests__/webhooks/webhooks.test.js.map +1 -1
- package/dist/a11y/index.d.ts +1 -1
- package/dist/a11y/index.d.ts.map +1 -1
- package/dist/a11y/index.js +23 -20
- package/dist/a11y/index.js.map +1 -1
- package/dist/actions.d.ts +1 -1
- package/dist/actions.d.ts.map +1 -1
- package/dist/actions.js +45 -38
- package/dist/actions.js.map +1 -1
- package/dist/api/handler-factory.d.ts.map +1 -1
- package/dist/api/handler-factory.js +15 -8
- package/dist/api/handler-factory.js.map +1 -1
- package/dist/api/handlers.d.ts.map +1 -1
- package/dist/api/handlers.js +287 -112
- package/dist/api/handlers.js.map +1 -1
- package/dist/api/index.d.ts.map +1 -1
- package/dist/api/index.js.map +1 -1
- package/dist/api/openapi.d.ts.map +1 -1
- package/dist/api/openapi.js +151 -30
- package/dist/api/openapi.js.map +1 -1
- package/dist/api/router.d.ts +6 -6
- package/dist/api/router.d.ts.map +1 -1
- package/dist/api/router.js +27 -10
- package/dist/api/router.js.map +1 -1
- package/dist/auth/index.d.ts +12 -12
- package/dist/auth/index.d.ts.map +1 -1
- package/dist/auth/index.js +9 -9
- package/dist/auth/index.js.map +1 -1
- package/dist/auth/mfa-pending.d.ts.map +1 -1
- package/dist/auth/mfa-pending.js.map +1 -1
- package/dist/auth/oauth.d.ts.map +1 -1
- package/dist/auth/oauth.js +15 -7
- package/dist/auth/oauth.js.map +1 -1
- package/dist/auth/password.d.ts +1 -1
- package/dist/auth/password.d.ts.map +1 -1
- package/dist/auth/password.js +14 -14
- package/dist/auth/password.js.map +1 -1
- package/dist/auth/providers/github.d.ts +1 -1
- package/dist/auth/providers/github.d.ts.map +1 -1
- package/dist/auth/providers/github.js +2 -2
- package/dist/auth/providers/github.js.map +1 -1
- package/dist/auth/providers/google.d.ts +1 -1
- package/dist/auth/providers/google.d.ts.map +1 -1
- package/dist/auth/providers/google.js +2 -2
- package/dist/auth/providers/google.js.map +1 -1
- package/dist/auth/providers/microsoft.d.ts +1 -1
- package/dist/auth/providers/microsoft.d.ts.map +1 -1
- package/dist/auth/providers/microsoft.js +2 -2
- package/dist/auth/providers/microsoft.js.map +1 -1
- package/dist/auth/reset-email.d.ts.map +1 -1
- package/dist/auth/reset-email.js +1 -1
- package/dist/auth/reset-email.js.map +1 -1
- package/dist/auth/reset.d.ts.map +1 -1
- package/dist/auth/reset.js +9 -9
- package/dist/auth/reset.js.map +1 -1
- package/dist/auth/session.d.ts.map +1 -1
- package/dist/auth/session.js +6 -6
- package/dist/auth/session.js.map +1 -1
- package/dist/auth/totp.d.ts.map +1 -1
- package/dist/auth/totp.js +8 -2
- package/dist/auth/totp.js.map +1 -1
- package/dist/backup/index.d.ts +2 -2
- package/dist/backup/index.d.ts.map +1 -1
- package/dist/backup/index.js +5 -5
- package/dist/backup/index.js.map +1 -1
- package/dist/cache/index.d.ts +1 -1
- package/dist/cache/index.d.ts.map +1 -1
- package/dist/cache/index.js +1 -1
- package/dist/cache/index.js.map +1 -1
- package/dist/client.d.ts +1 -1
- package/dist/client.d.ts.map +1 -1
- package/dist/client.js +8 -8
- package/dist/client.js.map +1 -1
- package/dist/codegen/index.d.ts +1 -1
- package/dist/codegen/index.d.ts.map +1 -1
- package/dist/codegen/index.js +170 -174
- package/dist/codegen/index.js.map +1 -1
- package/dist/collections/index.d.ts +1 -1
- package/dist/collections/index.d.ts.map +1 -1
- package/dist/collections/index.js.map +1 -1
- package/dist/config/define.d.ts +2 -2
- package/dist/config/define.d.ts.map +1 -1
- package/dist/config/define.js +1 -1
- package/dist/config/define.js.map +1 -1
- package/dist/config/index.d.ts +3 -3
- package/dist/config/index.d.ts.map +1 -1
- package/dist/config/index.js +32 -18
- package/dist/config/index.js.map +1 -1
- package/dist/config/types.d.ts +26 -26
- package/dist/config/types.d.ts.map +1 -1
- package/dist/content/ai-api.d.ts.map +1 -1
- package/dist/content/ai-api.js +8 -2
- package/dist/content/ai-api.js.map +1 -1
- package/dist/content/content-graph.d.ts +1 -1
- package/dist/content/content-graph.d.ts.map +1 -1
- package/dist/content/content-graph.js +7 -7
- package/dist/content/content-graph.js.map +1 -1
- package/dist/content/extract.js +13 -13
- package/dist/content/extract.js.map +1 -1
- package/dist/content/index.d.ts +7 -7
- package/dist/content/index.d.ts.map +1 -1
- package/dist/content/index.js +4 -4
- package/dist/content/index.js.map +1 -1
- package/dist/content/structured-data.d.ts +3 -3
- package/dist/content/structured-data.d.ts.map +1 -1
- package/dist/content/structured-data.js +65 -67
- package/dist/content/structured-data.js.map +1 -1
- package/dist/db/adapters/mysql.d.ts.map +1 -1
- package/dist/db/adapters/mysql.js.map +1 -1
- package/dist/db/adapters/postgres.d.ts.map +1 -1
- package/dist/db/adapters/postgres.js.map +1 -1
- package/dist/db/adapters/sqlite.d.ts.map +1 -1
- package/dist/db/adapters/sqlite.js.map +1 -1
- package/dist/db/create-adapter.d.ts.map +1 -1
- package/dist/db/create-adapter.js.map +1 -1
- package/dist/db/index.d.ts +1 -1
- package/dist/db/index.d.ts.map +1 -1
- package/dist/db/index.js +1 -1
- package/dist/db/index.js.map +1 -1
- package/dist/db.d.ts +1 -1
- package/dist/db.d.ts.map +1 -1
- package/dist/db.js +1 -1
- package/dist/db.js.map +1 -1
- package/dist/fields/index.d.ts +2 -2
- package/dist/fields/index.d.ts.map +1 -1
- package/dist/fields/index.js +51 -47
- package/dist/fields/index.js.map +1 -1
- package/dist/forms/analytics.d.ts.map +1 -1
- package/dist/forms/analytics.js.map +1 -1
- package/dist/forms/attribution.d.ts.map +1 -1
- package/dist/forms/attribution.js +7 -2
- package/dist/forms/attribution.js.map +1 -1
- package/dist/forms/index.d.ts.map +1 -1
- package/dist/forms/index.js.map +1 -1
- package/dist/graphql/index.d.ts.map +1 -1
- package/dist/graphql/index.js.map +1 -1
- package/dist/graphql/resolvers.d.ts.map +1 -1
- package/dist/graphql/resolvers.js +17 -21
- package/dist/graphql/resolvers.js.map +1 -1
- package/dist/graphql/schema-builder.d.ts.map +1 -1
- package/dist/graphql/schema-builder.js.map +1 -1
- package/dist/health/index.d.ts +2 -2
- package/dist/health/index.d.ts.map +1 -1
- package/dist/health/index.js +9 -9
- package/dist/health/index.js.map +1 -1
- package/dist/i18n/index.d.ts +1 -1
- package/dist/i18n/index.d.ts.map +1 -1
- package/dist/i18n/index.js +2 -2
- package/dist/i18n/index.js.map +1 -1
- package/dist/index.d.ts +78 -78
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +43 -43
- package/dist/index.js.map +1 -1
- package/dist/media/index.d.ts +2 -2
- package/dist/media/index.d.ts.map +1 -1
- package/dist/media/index.js +1 -1
- package/dist/media/index.js.map +1 -1
- package/dist/media/optimize.d.ts.map +1 -1
- package/dist/media/optimize.js +7 -4
- package/dist/media/optimize.js.map +1 -1
- package/dist/middleware.d.ts.map +1 -1
- package/dist/middleware.js +3 -3
- package/dist/middleware.js.map +1 -1
- package/dist/multisite/index.d.ts.map +1 -1
- package/dist/multisite/index.js +4 -4
- package/dist/multisite/index.js.map +1 -1
- package/dist/next/preview.d.ts.map +1 -1
- package/dist/next/preview.js.map +1 -1
- package/dist/next.d.ts.map +1 -1
- package/dist/next.js +4 -5
- package/dist/next.js.map +1 -1
- package/dist/notifications/index.d.ts +1 -1
- package/dist/notifications/index.d.ts.map +1 -1
- package/dist/notifications/index.js +5 -5
- package/dist/notifications/index.js.map +1 -1
- package/dist/page-builder/__tests__/a11y-fix.test.js +1 -5
- package/dist/page-builder/__tests__/a11y-fix.test.js.map +1 -1
- package/dist/page-builder/__tests__/blocks.test.js +4 -0
- package/dist/page-builder/__tests__/blocks.test.js.map +1 -1
- package/dist/page-builder/__tests__/design-scorer.test.js +44 -11
- package/dist/page-builder/__tests__/design-scorer.test.js.map +1 -1
- package/dist/page-builder/__tests__/schema.test.js +12 -12
- package/dist/page-builder/__tests__/schema.test.js.map +1 -1
- package/dist/page-builder/__tests__/seo-analyzer.test.js +27 -13
- package/dist/page-builder/__tests__/seo-analyzer.test.js.map +1 -1
- package/dist/page-builder/ai-pipeline.d.ts.map +1 -1
- package/dist/page-builder/ai-pipeline.js +1 -3
- package/dist/page-builder/ai-pipeline.js.map +1 -1
- package/dist/page-builder/blocks.d.ts.map +1 -1
- package/dist/page-builder/blocks.js +45 -9
- package/dist/page-builder/blocks.js.map +1 -1
- package/dist/page-builder/design-scorer.d.ts.map +1 -1
- package/dist/page-builder/design-scorer.js +249 -41
- package/dist/page-builder/design-scorer.js.map +1 -1
- package/dist/page-builder/index.d.ts +3 -3
- package/dist/page-builder/index.d.ts.map +1 -1
- package/dist/page-builder/index.js +2 -2
- package/dist/page-builder/index.js.map +1 -1
- package/dist/page-builder/seo-analyzer.d.ts.map +1 -1
- package/dist/page-builder/seo-analyzer.js +252 -56
- package/dist/page-builder/seo-analyzer.js.map +1 -1
- package/dist/page-builder/templates.d.ts.map +1 -1
- package/dist/page-builder/templates.js +45 -16
- package/dist/page-builder/templates.js.map +1 -1
- package/dist/page-builder/tree.d.ts.map +1 -1
- package/dist/page-builder/tree.js.map +1 -1
- package/dist/page-builder/validate.js.map +1 -1
- package/dist/presence/index.d.ts.map +1 -1
- package/dist/presence/index.js +2 -2
- package/dist/presence/index.js.map +1 -1
- package/dist/preview/index.d.ts.map +1 -1
- package/dist/preview/index.js.map +1 -1
- package/dist/privacy/index.d.ts +1 -1
- package/dist/privacy/index.d.ts.map +1 -1
- package/dist/privacy/index.js +3 -3
- package/dist/privacy/index.js.map +1 -1
- package/dist/relationships/index.d.ts.map +1 -1
- package/dist/relationships/index.js +1 -1
- package/dist/relationships/index.js.map +1 -1
- package/dist/scheduling/index.d.ts +2 -2
- package/dist/scheduling/index.d.ts.map +1 -1
- package/dist/scheduling/index.js +3 -1
- package/dist/scheduling/index.js.map +1 -1
- package/dist/search/index.d.ts.map +1 -1
- package/dist/search/index.js +1 -3
- package/dist/search/index.js.map +1 -1
- package/dist/security/access.d.ts +4 -4
- package/dist/security/access.d.ts.map +1 -1
- package/dist/security/access.js +11 -15
- package/dist/security/access.js.map +1 -1
- package/dist/security/anomaly-detection.d.ts.map +1 -1
- package/dist/security/anomaly-detection.js +5 -5
- package/dist/security/anomaly-detection.js.map +1 -1
- package/dist/security/api-key-enhanced.d.ts +2 -2
- package/dist/security/api-key-enhanced.d.ts.map +1 -1
- package/dist/security/api-key-enhanced.js +5 -5
- package/dist/security/api-key-enhanced.js.map +1 -1
- package/dist/security/audit.d.ts.map +1 -1
- package/dist/security/audit.js.map +1 -1
- package/dist/security/breach-check.js.map +1 -1
- package/dist/security/captcha.d.ts.map +1 -1
- package/dist/security/captcha.js.map +1 -1
- package/dist/security/client-ip.d.ts.map +1 -1
- package/dist/security/client-ip.js +4 -1
- package/dist/security/client-ip.js.map +1 -1
- package/dist/security/cors.d.ts +1 -1
- package/dist/security/cors.d.ts.map +1 -1
- package/dist/security/cors.js +12 -12
- package/dist/security/cors.js.map +1 -1
- package/dist/security/csp-nonces.js +11 -11
- package/dist/security/csp-nonces.js.map +1 -1
- package/dist/security/csrf.js +2 -2
- package/dist/security/csrf.js.map +1 -1
- package/dist/security/encrypted-fields.d.ts.map +1 -1
- package/dist/security/encrypted-fields.js +7 -4
- package/dist/security/encrypted-fields.js.map +1 -1
- package/dist/security/headers.d.ts.map +1 -1
- package/dist/security/headers.js +12 -12
- package/dist/security/headers.js.map +1 -1
- package/dist/security/index.d.ts +39 -39
- package/dist/security/index.d.ts.map +1 -1
- package/dist/security/index.js +25 -25
- package/dist/security/index.js.map +1 -1
- package/dist/security/internal-keys.d.ts.map +1 -1
- package/dist/security/internal-keys.js.map +1 -1
- package/dist/security/ip-allowlist.js +2 -4
- package/dist/security/ip-allowlist.js.map +1 -1
- package/dist/security/middleware.d.ts +2 -2
- package/dist/security/middleware.d.ts.map +1 -1
- package/dist/security/middleware.js +11 -11
- package/dist/security/middleware.js.map +1 -1
- package/dist/security/rate-limit.d.ts.map +1 -1
- package/dist/security/rate-limit.js +3 -3
- package/dist/security/rate-limit.js.map +1 -1
- package/dist/security/reauth.d.ts +1 -1
- package/dist/security/reauth.d.ts.map +1 -1
- package/dist/security/reauth.js.map +1 -1
- package/dist/security/redact.d.ts.map +1 -1
- package/dist/security/redact.js +4 -1
- package/dist/security/redact.js.map +1 -1
- package/dist/security/safe-fetch.d.ts.map +1 -1
- package/dist/security/safe-fetch.js.map +1 -1
- package/dist/security/sanitize.d.ts.map +1 -1
- package/dist/security/sanitize.js +40 -8
- package/dist/security/sanitize.js.map +1 -1
- package/dist/security/secret-storage.js +6 -6
- package/dist/security/secret-storage.js.map +1 -1
- package/dist/security/security-txt.d.ts.map +1 -1
- package/dist/security/security-txt.js +2 -2
- package/dist/security/security-txt.js.map +1 -1
- package/dist/security/session-limits.d.ts +1 -1
- package/dist/security/session-limits.d.ts.map +1 -1
- package/dist/security/session-limits.js +1 -1
- package/dist/security/session-limits.js.map +1 -1
- package/dist/security/upload.d.ts.map +1 -1
- package/dist/security/upload.js +26 -20
- package/dist/security/upload.js.map +1 -1
- package/dist/security/webhook.d.ts.map +1 -1
- package/dist/security/webhook.js +12 -8
- package/dist/security/webhook.js.map +1 -1
- package/dist/seo/analysis.d.ts.map +1 -1
- package/dist/seo/analysis.js +25 -13
- package/dist/seo/analysis.js.map +1 -1
- package/dist/seo/index.d.ts +9 -9
- package/dist/seo/index.d.ts.map +1 -1
- package/dist/seo/index.js +4 -4
- package/dist/seo/index.js.map +1 -1
- package/dist/seo/llms-txt.js +1 -3
- package/dist/seo/llms-txt.js.map +1 -1
- package/dist/server-site.d.ts.map +1 -1
- package/dist/server-site.js +12 -14
- package/dist/server-site.js.map +1 -1
- package/dist/setup/index.d.ts.map +1 -1
- package/dist/setup/index.js.map +1 -1
- package/dist/site.d.ts.map +1 -1
- package/dist/site.js +7 -3
- package/dist/site.js.map +1 -1
- package/dist/storage/index.d.ts.map +1 -1
- package/dist/storage/index.js.map +1 -1
- package/dist/templates/index.d.ts.map +1 -1
- package/dist/templates/index.js +3 -3
- package/dist/templates/index.js.map +1 -1
- package/dist/upgrade/changelog.d.ts +1 -1
- package/dist/upgrade/changelog.d.ts.map +1 -1
- package/dist/upgrade/changelog.js +12 -12
- package/dist/upgrade/changelog.js.map +1 -1
- package/dist/upgrade/index.d.ts +6 -6
- package/dist/upgrade/index.d.ts.map +1 -1
- package/dist/upgrade/index.js +3 -3
- package/dist/upgrade/index.js.map +1 -1
- package/dist/upgrade/upgrade-pr.d.ts.map +1 -1
- package/dist/upgrade/upgrade-pr.js +36 -36
- package/dist/upgrade/upgrade-pr.js.map +1 -1
- package/dist/upgrade/version-check.d.ts +1 -1
- package/dist/upgrade/version-check.d.ts.map +1 -1
- package/dist/upgrade/version-check.js +13 -13
- package/dist/upgrade/version-check.js.map +1 -1
- package/dist/webhooks/index.d.ts +1 -1
- package/dist/webhooks/index.d.ts.map +1 -1
- package/dist/webhooks/index.js +4 -4
- package/dist/webhooks/index.js.map +1 -1
- package/dist/workflow/index.d.ts.map +1 -1
- package/dist/workflow/index.js.map +1 -1
- package/dist/workflows/index.d.ts +1 -1
- package/dist/workflows/index.d.ts.map +1 -1
- package/dist/workflows/index.js +3 -3
- package/dist/workflows/index.js.map +1 -1
- package/package.json +1 -1
- package/prisma/seed.ts +31 -31
package/dist/cache/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/cache/index.ts"],"names":[],"mappings":"AAQA,iDAAiD;AACjD,MAAM,CAAC,KAAK,UAAU,MAAM,CAC1B,OAAqB,EACrB,GAAW,EACX,IAAc,EACd,GAAW,EACX,EAAoB;IAEpB,MAAM,QAAQ,GAAG,MAAM,OAAO,CAAC,GAAG,CAAgB,GAAG,CAAC,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/cache/index.ts"],"names":[],"mappings":"AAQA,iDAAiD;AACjD,MAAM,CAAC,KAAK,UAAU,MAAM,CAC1B,OAAqB,EACrB,GAAW,EACX,IAAc,EACd,GAAW,EACX,EAAoB;IAEpB,MAAM,QAAQ,GAAG,MAAM,OAAO,CAAC,GAAG,CAAgB,GAAG,CAAC,CAAA;IACtD,IAAI,QAAQ;QAAE,OAAO,QAAQ,CAAC,KAAK,CAAA;IAEnC,MAAM,KAAK,GAAG,MAAM,EAAE,EAAE,CAAA;IACxB,MAAM,OAAO,CAAC,GAAG,CAAgB,GAAG,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,SAAS,EAAE,IAAI,CAAC,GAAG,EAAE,GAAG,GAAG,EAAE,EAAE,G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AE,MAAM,CAAA;IAClB,IAAI,EAAE,CAAC,CAAA;CACR;AAED,MAAM,WAAW,aAAa,CAAC,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;IACxD,IAAI,EAAE;QACJ,EAAE,EAAE,MAAM,CAAA;QACV,UAAU,EAAE,MAAM,CAAA;QAClB,IAAI,EAAE,CAAC,CAAA;QACP,MAAM,EAAE,MAAM,CAAA;QACd,WAAW,EAAE,MAAM,GAAG,IAAI,CAAA;QAC1B,cAAc,EAAE,OAAO,CAAA;KACxB,CAAA;IACD,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,aAAa,CAAC,CAAA;CACvC;AAED,MAAM,WAAW,SAAS;IACxB,UAAU,CAAC,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,IAAI,EAAE,MAAM,GAAG,gBAAgB,CAAC,CAAC,CAAC,CAAA;IAC1E,MAAM,CAAC,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,IAAI,EAAE,MAAM,GAAG,YAAY,CAAC,CAAC,CAAC,CAAA;IAClE,OAAO,CAAC,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC,CAAA;CAC9E;AAED,0DAA0D;AAC1D,wBAAgB,eAAe,CAAC,OAAO,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,MAAM,GAAG,SAAS,CAkD3E"}
|
package/dist/client.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
/** Create a typed CMS client for frontend data access. */
|
|
2
2
|
export function createCMSClient(baseUrl, apiKey) {
|
|
3
3
|
const headers = {
|
|
4
|
-
|
|
4
|
+
'Content-Type': 'application/json',
|
|
5
5
|
};
|
|
6
6
|
if (apiKey)
|
|
7
|
-
headers[
|
|
7
|
+
headers['Authorization'] = `Bearer ${apiKey}`;
|
|
8
8
|
async function fetchApi(path) {
|
|
9
9
|
const response = await fetch(`${baseUrl}${path}`, { headers });
|
|
10
10
|
if (!response.ok) {
|
|
@@ -18,17 +18,17 @@ export function createCMSClient(baseUrl, apiKey) {
|
|
|
18
18
|
async find(options) {
|
|
19
19
|
const params = new URLSearchParams();
|
|
20
20
|
if (options?.page)
|
|
21
|
-
params.set(
|
|
21
|
+
params.set('page', String(options.page));
|
|
22
22
|
if (options?.pageSize)
|
|
23
|
-
params.set(
|
|
23
|
+
params.set('pageSize', String(options.pageSize));
|
|
24
24
|
if (options?.sort)
|
|
25
|
-
params.set(
|
|
25
|
+
params.set('sort', options.sort);
|
|
26
26
|
if (options?.order)
|
|
27
|
-
params.set(
|
|
27
|
+
params.set('order', options.order);
|
|
28
28
|
if (options?.locale)
|
|
29
|
-
params.set(
|
|
29
|
+
params.set('locale', options.locale);
|
|
30
30
|
const qs = params.toString();
|
|
31
|
-
return fetchApi(`/api/collections/${slug}${qs ? `?${qs}` :
|
|
31
|
+
return fetchApi(`/api/collections/${slug}${qs ? `?${qs}` : ''}`);
|
|
32
32
|
},
|
|
33
33
|
async findById(id) {
|
|
34
34
|
return fetchApi(`/api/collections/${slug}/${id}`);
|
package/dist/client.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client.js","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":"AAmDA,0DAA0D;AAC1D,MAAM,UAAU,eAAe,CAAC,OAAe,EAAE,MAAe;IAC9D,MAAM,OAAO,GAA2B;QACtC,cAAc,EAAE,kBAAkB;KACnC,
|
|
1
|
+
{"version":3,"file":"client.js","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":"AAmDA,0DAA0D;AAC1D,MAAM,UAAU,eAAe,CAAC,OAAe,EAAE,MAAe;IAC9D,MAAM,OAAO,GAA2B;QACtC,cAAc,EAAE,kBAAkB;KACnC,CAAA;IACD,IAAI,MAAM;QAAE,OAAO,CAAC,eAAe,C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IAAI,EAAE,EAAE,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAA;gBACjF,CAAC;gBAED,KAAK,CAAC,QAAQ,CAAC,EAAU;oBACvB,OAAO,QAAQ,CAAW,oBAAoB,IAAI,IAAI,EAAE,EAAE,CAAC,CAAA;gBAC7D,CAAC;gBAED,KAAK,CAAC,UAAU,CAAC,SAAiB;oBAChC,OAAO,QAAQ,CAAW,oBAAoB,IAAI,SAAS,SAAS,EAAE,CAAC,CAAA;gBACzE,CAAC;aACF,CAAA;QACH,CAAC;QAED,MAAM,CAA8B,IAAY;YAC9C,OAAO;gBACL,KAAK,CAAC,GAAG;oBACP,OAAO,QAAQ,CAAW,gBAAgB,IAAI,EAAE,CAAC,CAAA;gBACnD,CAAC;aACF,CAAA;QACH,CAAC;QAED,KAAK,CAAC,OAAO,CAA8B,IAAY;YACrD,OAAO,QAAQ,CAAmB,iBAAiB,kBAAkB,CAAC,IAAI,CAAC,EAAE,CAAC,CAAA;QAChF,CAAC;KACF,CAAA;AACH,CAAC"}
|
package/dist/codegen/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { ActuateCMSConfig } from
|
|
1
|
+
import type { ActuateCMSConfig } from '../config/types.js';
|
|
2
2
|
export declare function generateTypes(config: ActuateCMSConfig): string;
|
|
3
3
|
export declare function runCodegen(): Promise<void>;
|
|
4
4
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/codegen/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,gBAAgB,EAIjB,MAAM,oBAAoB,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/codegen/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,gBAAgB,EAIjB,MAAM,oBAAoB,CAAA;AAc3B,wBAAgB,aAAa,CAAC,MAAM,EAAE,gBAAgB,GAAG,MAAM,CAkD9D;AAED,wBAAsB,UAAU,IAAI,OAAO,CAAC,IAAI,CAAC,CAUhD"}
|
package/dist/codegen/index.js
CHANGED
|
@@ -1,23 +1,23 @@
|
|
|
1
1
|
const HEADER = [
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
].join(
|
|
2
|
+
'/* eslint-disable */',
|
|
3
|
+
'/* prettier-ignore */',
|
|
4
|
+
'// ──────────────────────────────────────────────────────────────────────',
|
|
5
|
+
'// Auto-generated by @actuate-media/cms-core — DO NOT EDIT',
|
|
6
|
+
'// Re-run codegen after changing actuate.config.ts',
|
|
7
|
+
'// ──────────────────────────────────────────────────────────────────────',
|
|
8
|
+
'',
|
|
9
|
+
].join('\n');
|
|
10
10
|
// ─── Public API ──────────────────────────────────────────────────────
|
|
11
11
|
export function generateTypes(config) {
|
|
12
12
|
const out = [HEADER];
|
|
13
|
-
emitSection(out,
|
|
13
|
+
emitSection(out, 'Base Types');
|
|
14
14
|
emitDocumentStatus(out);
|
|
15
15
|
emitDocumentBase(out);
|
|
16
16
|
emitFindResult(out);
|
|
17
17
|
emitFindOptions(out);
|
|
18
18
|
const collectionSlugs = Object.keys(config.collections);
|
|
19
19
|
const collectionTypeMap = {};
|
|
20
|
-
emitSection(out,
|
|
20
|
+
emitSection(out, 'Collections');
|
|
21
21
|
for (const slug of collectionSlugs) {
|
|
22
22
|
const typeName = `${pascalCase(slug)}Document`;
|
|
23
23
|
collectionTypeMap[slug] = typeName;
|
|
@@ -30,7 +30,7 @@ export function generateTypes(config) {
|
|
|
30
30
|
const globalTypeMap = {};
|
|
31
31
|
if (config.globals) {
|
|
32
32
|
if (globalSlugs.length > 0) {
|
|
33
|
-
emitSection(out,
|
|
33
|
+
emitSection(out, 'Globals');
|
|
34
34
|
}
|
|
35
35
|
for (const slug of globalSlugs) {
|
|
36
36
|
const typeName = `${pascalCase(slug)}Global`;
|
|
@@ -42,75 +42,75 @@ export function generateTypes(config) {
|
|
|
42
42
|
emitGlobalSlugType(out, globalSlugs);
|
|
43
43
|
}
|
|
44
44
|
}
|
|
45
|
-
emitSection(out,
|
|
45
|
+
emitSection(out, 'Client');
|
|
46
46
|
emitClient(out, globalSlugs.length > 0);
|
|
47
|
-
emitSection(out,
|
|
47
|
+
emitSection(out, 'Utilities');
|
|
48
48
|
emitExtractBlock(out);
|
|
49
49
|
emitSchema(out, globalSlugs.length > 0);
|
|
50
|
-
return out.join(
|
|
50
|
+
return out.join('\n');
|
|
51
51
|
}
|
|
52
52
|
export async function runCodegen() {
|
|
53
|
-
const { writeFile } = await import(
|
|
54
|
-
const { resolve } = await import(
|
|
55
|
-
const configPath = resolve(process.cwd(),
|
|
53
|
+
const { writeFile } = await import('node:fs/promises');
|
|
54
|
+
const { resolve } = await import('node:path');
|
|
55
|
+
const configPath = resolve(process.cwd(), 'actuate.config.ts');
|
|
56
56
|
const mod = await import(configPath);
|
|
57
57
|
const config = mod.default ?? mod;
|
|
58
58
|
const types = generateTypes(config);
|
|
59
|
-
const outPath = resolve(process.cwd(),
|
|
60
|
-
await writeFile(outPath, types,
|
|
59
|
+
const outPath = resolve(process.cwd(), 'actuate.generated.d.ts');
|
|
60
|
+
await writeFile(outPath, types, 'utf-8');
|
|
61
61
|
console.log(`Types written to ${outPath}`);
|
|
62
62
|
}
|
|
63
63
|
// ─── Section dividers ────────────────────────────────────────────────
|
|
64
64
|
function emitSection(out, title) {
|
|
65
65
|
const pad = 68 - title.length;
|
|
66
|
-
out.push(`// ─── ${title} ${
|
|
67
|
-
out.push(
|
|
66
|
+
out.push(`// ─── ${title} ${'─'.repeat(Math.max(pad, 3))}`);
|
|
67
|
+
out.push('');
|
|
68
68
|
}
|
|
69
69
|
// ─── Document base ───────────────────────────────────────────────────
|
|
70
70
|
function emitDocumentStatus(out) {
|
|
71
71
|
out.push('export type DocumentStatus = "DRAFT" | "PUBLISHED" | "ARCHIVED" | "SCHEDULED";');
|
|
72
|
-
out.push(
|
|
72
|
+
out.push('');
|
|
73
73
|
}
|
|
74
74
|
function emitDocumentBase(out) {
|
|
75
|
-
out.push(
|
|
76
|
-
out.push(
|
|
77
|
-
out.push(
|
|
78
|
-
out.push(
|
|
79
|
-
out.push(
|
|
80
|
-
out.push(
|
|
81
|
-
out.push(
|
|
82
|
-
out.push(
|
|
83
|
-
out.push(
|
|
84
|
-
out.push(
|
|
85
|
-
out.push(
|
|
86
|
-
out.push(
|
|
87
|
-
out.push(
|
|
88
|
-
out.push(
|
|
89
|
-
out.push(
|
|
90
|
-
out.push(
|
|
75
|
+
out.push('export interface Document {');
|
|
76
|
+
out.push(' id: string;');
|
|
77
|
+
out.push(' status: DocumentStatus;');
|
|
78
|
+
out.push(' /** ISO 8601 date-time */');
|
|
79
|
+
out.push(' createdAt: string;');
|
|
80
|
+
out.push(' /** ISO 8601 date-time */');
|
|
81
|
+
out.push(' updatedAt: string;');
|
|
82
|
+
out.push(' /** ISO 8601 date-time, null when not yet published */');
|
|
83
|
+
out.push(' publishedAt: string | null;');
|
|
84
|
+
out.push(' /** ISO 8601 date-time, null when not soft-deleted */');
|
|
85
|
+
out.push(' deletedAt: string | null;');
|
|
86
|
+
out.push(' collection: string;');
|
|
87
|
+
out.push(' locale: string | null;');
|
|
88
|
+
out.push(' folderId: string | null;');
|
|
89
|
+
out.push('}');
|
|
90
|
+
out.push('');
|
|
91
91
|
}
|
|
92
92
|
function emitFindResult(out) {
|
|
93
|
-
out.push(
|
|
94
|
-
out.push(
|
|
95
|
-
out.push(
|
|
96
|
-
out.push(
|
|
97
|
-
out.push(
|
|
98
|
-
out.push(
|
|
99
|
-
out.push(
|
|
100
|
-
out.push(
|
|
101
|
-
out.push(
|
|
93
|
+
out.push('export interface FindResult<T> {');
|
|
94
|
+
out.push(' docs: T[];');
|
|
95
|
+
out.push(' totalDocs: number;');
|
|
96
|
+
out.push(' totalPages: number;');
|
|
97
|
+
out.push(' page: number;');
|
|
98
|
+
out.push(' hasNextPage: boolean;');
|
|
99
|
+
out.push(' hasPrevPage: boolean;');
|
|
100
|
+
out.push('}');
|
|
101
|
+
out.push('');
|
|
102
102
|
}
|
|
103
103
|
function emitFindOptions(out) {
|
|
104
|
-
out.push(
|
|
105
|
-
out.push(
|
|
106
|
-
out.push(
|
|
107
|
-
out.push(
|
|
108
|
-
out.push(
|
|
109
|
-
out.push(
|
|
110
|
-
out.push(
|
|
111
|
-
out.push(
|
|
112
|
-
out.push(
|
|
113
|
-
out.push(
|
|
104
|
+
out.push('export interface FindOptions {');
|
|
105
|
+
out.push(' where?: Record<string, unknown>;');
|
|
106
|
+
out.push(' sort?: string;');
|
|
107
|
+
out.push(' limit?: number;');
|
|
108
|
+
out.push(' page?: number;');
|
|
109
|
+
out.push(' locale?: string;');
|
|
110
|
+
out.push(' status?: DocumentStatus | DocumentStatus[];');
|
|
111
|
+
out.push(' includeDeleted?: boolean;');
|
|
112
|
+
out.push('}');
|
|
113
|
+
out.push('');
|
|
114
114
|
}
|
|
115
115
|
// ─── Collections ─────────────────────────────────────────────────────
|
|
116
116
|
function emitCollectionTypes(out, slug, typeName, collection) {
|
|
@@ -123,36 +123,36 @@ function emitCollectionTypes(out, slug, typeName, collection) {
|
|
|
123
123
|
const jsdoc = buildFieldJSDoc(field);
|
|
124
124
|
if (jsdoc)
|
|
125
125
|
out.push(jsdoc);
|
|
126
|
-
const optional = field.required ?
|
|
126
|
+
const optional = field.required ? '' : '?';
|
|
127
127
|
out.push(` ${fieldName}${optional}: ${resolveFieldType(typeName, fieldName, field)};`);
|
|
128
128
|
}
|
|
129
|
-
out.push(
|
|
130
|
-
out.push(
|
|
129
|
+
out.push('}');
|
|
130
|
+
out.push('');
|
|
131
131
|
out.push(`export type ${typeName}CreateInput = Omit<${typeName}, keyof Document>;`);
|
|
132
|
-
out.push(
|
|
132
|
+
out.push('');
|
|
133
133
|
out.push(`export type ${typeName}UpdateInput = Partial<${typeName}CreateInput>;`);
|
|
134
|
-
out.push(
|
|
134
|
+
out.push('');
|
|
135
135
|
}
|
|
136
136
|
function emitCollectionsMap(out, slugs, typeMap) {
|
|
137
|
-
out.push(
|
|
137
|
+
out.push('export interface ActuateCollections {');
|
|
138
138
|
for (const slug of slugs) {
|
|
139
139
|
out.push(` ${slug}: ${typeMap[slug]};`);
|
|
140
140
|
}
|
|
141
|
-
out.push(
|
|
142
|
-
out.push(
|
|
141
|
+
out.push('}');
|
|
142
|
+
out.push('');
|
|
143
143
|
}
|
|
144
144
|
function emitCollectionSlugType(out, slugs) {
|
|
145
145
|
if (slugs.length === 0) {
|
|
146
|
-
out.push(
|
|
146
|
+
out.push('export type ActuateCollectionSlug = never;');
|
|
147
147
|
}
|
|
148
148
|
else {
|
|
149
|
-
out.push(`export type ActuateCollectionSlug = ${slugs.map((s) => `"${s}"`).join(
|
|
149
|
+
out.push(`export type ActuateCollectionSlug = ${slugs.map((s) => `"${s}"`).join(' | ')};`);
|
|
150
150
|
}
|
|
151
|
-
out.push(
|
|
151
|
+
out.push('');
|
|
152
152
|
}
|
|
153
153
|
function emitCollectionDocumentUtility(out) {
|
|
154
|
-
out.push(
|
|
155
|
-
out.push(
|
|
154
|
+
out.push('export type CollectionDocument<K extends ActuateCollectionSlug> = ActuateCollections[K];');
|
|
155
|
+
out.push('');
|
|
156
156
|
}
|
|
157
157
|
// ─── Globals ─────────────────────────────────────────────────────────
|
|
158
158
|
function emitGlobalTypes(out, typeName, global) {
|
|
@@ -163,33 +163,33 @@ function emitGlobalTypes(out, typeName, global) {
|
|
|
163
163
|
const jsdoc = buildFieldJSDoc(field);
|
|
164
164
|
if (jsdoc)
|
|
165
165
|
out.push(jsdoc);
|
|
166
|
-
const optional = field.required ?
|
|
166
|
+
const optional = field.required ? '' : '?';
|
|
167
167
|
out.push(` ${fieldName}${optional}: ${resolveFieldType(typeName, fieldName, field)};`);
|
|
168
168
|
}
|
|
169
|
-
out.push(
|
|
170
|
-
out.push(
|
|
169
|
+
out.push('}');
|
|
170
|
+
out.push('');
|
|
171
171
|
}
|
|
172
172
|
function emitGlobalsMap(out, slugs, typeMap) {
|
|
173
|
-
out.push(
|
|
173
|
+
out.push('export interface ActuateGlobals {');
|
|
174
174
|
for (const slug of slugs) {
|
|
175
175
|
out.push(` ${slug}: ${typeMap[slug]};`);
|
|
176
176
|
}
|
|
177
|
-
out.push(
|
|
178
|
-
out.push(
|
|
177
|
+
out.push('}');
|
|
178
|
+
out.push('');
|
|
179
179
|
}
|
|
180
180
|
function emitGlobalSlugType(out, slugs) {
|
|
181
181
|
if (slugs.length === 0) {
|
|
182
|
-
out.push(
|
|
182
|
+
out.push('export type ActuateGlobalSlug = never;');
|
|
183
183
|
}
|
|
184
184
|
else {
|
|
185
|
-
out.push(`export type ActuateGlobalSlug = ${slugs.map((s) => `"${s}"`).join(
|
|
185
|
+
out.push(`export type ActuateGlobalSlug = ${slugs.map((s) => `"${s}"`).join(' | ')};`);
|
|
186
186
|
}
|
|
187
|
-
out.push(
|
|
187
|
+
out.push('');
|
|
188
188
|
}
|
|
189
189
|
// ─── Auxiliary types (arrays, blocks) ────────────────────────────────
|
|
190
190
|
function emitAuxTypes(out, parentTypeName, fields) {
|
|
191
191
|
for (const [fieldName, field] of Object.entries(fields)) {
|
|
192
|
-
if (field.type ===
|
|
192
|
+
if (field.type === 'array') {
|
|
193
193
|
const subTypeName = `${parentTypeName}_${pascalCase(fieldName)}Item`;
|
|
194
194
|
emitAuxTypes(out, subTypeName, field.fields);
|
|
195
195
|
out.push(`export interface ${subTypeName} {`);
|
|
@@ -197,13 +197,13 @@ function emitAuxTypes(out, parentTypeName, fields) {
|
|
|
197
197
|
const jsdoc = buildFieldJSDoc(subField);
|
|
198
198
|
if (jsdoc)
|
|
199
199
|
out.push(jsdoc);
|
|
200
|
-
const optional = subField.required ?
|
|
200
|
+
const optional = subField.required ? '' : '?';
|
|
201
201
|
out.push(` ${subName}${optional}: ${resolveFieldType(subTypeName, subName, subField)};`);
|
|
202
202
|
}
|
|
203
|
-
out.push(
|
|
204
|
-
out.push(
|
|
203
|
+
out.push('}');
|
|
204
|
+
out.push('');
|
|
205
205
|
}
|
|
206
|
-
else if (field.type ===
|
|
206
|
+
else if (field.type === 'blocks') {
|
|
207
207
|
const blockTypeNames = [];
|
|
208
208
|
for (const block of field.blocks) {
|
|
209
209
|
const blockTypeName = `${parentTypeName}_${pascalCase(block.slug)}Block`;
|
|
@@ -216,59 +216,57 @@ function emitAuxTypes(out, parentTypeName, fields) {
|
|
|
216
216
|
const jsdoc = buildFieldJSDoc(bField);
|
|
217
217
|
if (jsdoc)
|
|
218
218
|
out.push(jsdoc);
|
|
219
|
-
const optional = bField.required ?
|
|
219
|
+
const optional = bField.required ? '' : '?';
|
|
220
220
|
out.push(` ${bFieldName}${optional}: ${resolveFieldType(blockTypeName, bFieldName, bField)};`);
|
|
221
221
|
}
|
|
222
|
-
out.push(
|
|
223
|
-
out.push(
|
|
222
|
+
out.push('}');
|
|
223
|
+
out.push('');
|
|
224
224
|
}
|
|
225
225
|
const unionName = `${parentTypeName}_${pascalCase(fieldName)}Blocks`;
|
|
226
226
|
if (blockTypeNames.length > 0) {
|
|
227
227
|
out.push(`/** Discriminated union on \`blockType\` — narrow with \`ExtractBlock\`. */`);
|
|
228
|
-
out.push(`export type ${unionName} = ${blockTypeNames.join(
|
|
228
|
+
out.push(`export type ${unionName} = ${blockTypeNames.join(' | ')};`);
|
|
229
229
|
}
|
|
230
230
|
else {
|
|
231
231
|
out.push(`export type ${unionName} = Record<string, unknown>;`);
|
|
232
232
|
}
|
|
233
|
-
out.push(
|
|
233
|
+
out.push('');
|
|
234
234
|
}
|
|
235
235
|
}
|
|
236
236
|
}
|
|
237
237
|
// ─── Field type resolution ───────────────────────────────────────────
|
|
238
238
|
function resolveFieldType(parentTypeName, fieldName, field) {
|
|
239
239
|
switch (field.type) {
|
|
240
|
-
case
|
|
241
|
-
case
|
|
242
|
-
case
|
|
243
|
-
case
|
|
244
|
-
case
|
|
245
|
-
return
|
|
246
|
-
case
|
|
247
|
-
return
|
|
248
|
-
case
|
|
249
|
-
return
|
|
250
|
-
case
|
|
251
|
-
return
|
|
252
|
-
case
|
|
253
|
-
return
|
|
254
|
-
case
|
|
255
|
-
const union = field.options.length > 0
|
|
256
|
-
? field.options.map((o) => `"${o.value}"`).join(" | ")
|
|
257
|
-
: "string";
|
|
240
|
+
case 'text':
|
|
241
|
+
case 'slug':
|
|
242
|
+
case 'color':
|
|
243
|
+
case 'url':
|
|
244
|
+
case 'email':
|
|
245
|
+
return 'string';
|
|
246
|
+
case 'richText':
|
|
247
|
+
return 'Record<string, unknown>';
|
|
248
|
+
case 'number':
|
|
249
|
+
return 'number';
|
|
250
|
+
case 'boolean':
|
|
251
|
+
return 'boolean';
|
|
252
|
+
case 'date':
|
|
253
|
+
return 'string';
|
|
254
|
+
case 'select': {
|
|
255
|
+
const union = field.options.length > 0 ? field.options.map((o) => `"${o.value}"`).join(' | ') : 'string';
|
|
258
256
|
return field.multiple ? `(${union})[]` : union;
|
|
259
257
|
}
|
|
260
|
-
case
|
|
261
|
-
return field.hasMany ?
|
|
262
|
-
case
|
|
263
|
-
return
|
|
264
|
-
case
|
|
265
|
-
return
|
|
266
|
-
case
|
|
258
|
+
case 'relationship':
|
|
259
|
+
return field.hasMany ? 'string[]' : 'string';
|
|
260
|
+
case 'media':
|
|
261
|
+
return 'string';
|
|
262
|
+
case 'json':
|
|
263
|
+
return 'Record<string, unknown>';
|
|
264
|
+
case 'array':
|
|
267
265
|
return `${parentTypeName}_${pascalCase(fieldName)}Item[]`;
|
|
268
|
-
case
|
|
266
|
+
case 'blocks':
|
|
269
267
|
return `${parentTypeName}_${pascalCase(fieldName)}Blocks[]`;
|
|
270
268
|
default:
|
|
271
|
-
return
|
|
269
|
+
return 'unknown';
|
|
272
270
|
}
|
|
273
271
|
}
|
|
274
272
|
// ─── JSDoc helpers ───────────────────────────────────────────────────
|
|
@@ -277,94 +275,92 @@ function buildFieldJSDoc(field) {
|
|
|
277
275
|
if (field.label) {
|
|
278
276
|
parts.push(field.label);
|
|
279
277
|
}
|
|
280
|
-
if (field.type ===
|
|
278
|
+
if (field.type === 'relationship') {
|
|
281
279
|
const targets = Array.isArray(field.relationTo)
|
|
282
|
-
? field.relationTo.map((r) => `${pascalCase(r)}Document`).join(
|
|
280
|
+
? field.relationTo.map((r) => `${pascalCase(r)}Document`).join(' | ')
|
|
283
281
|
: `${pascalCase(field.relationTo)}Document`;
|
|
284
282
|
parts.push(`@relation ${targets}`);
|
|
285
283
|
}
|
|
286
|
-
if (field.type ===
|
|
287
|
-
|
|
288
|
-
field.includeTime) {
|
|
289
|
-
parts.push("@format ISO 8601 date-time");
|
|
284
|
+
if (field.type === 'date' && 'includeTime' in field && field.includeTime) {
|
|
285
|
+
parts.push('@format ISO 8601 date-time');
|
|
290
286
|
}
|
|
291
|
-
else if (field.type ===
|
|
292
|
-
parts.push(
|
|
287
|
+
else if (field.type === 'date') {
|
|
288
|
+
parts.push('@format ISO 8601 date');
|
|
293
289
|
}
|
|
294
290
|
if (parts.length === 0)
|
|
295
291
|
return null;
|
|
296
|
-
if (parts.length === 1 && !parts[0].startsWith(
|
|
292
|
+
if (parts.length === 1 && !parts[0].startsWith('@')) {
|
|
297
293
|
return ` /** ${parts[0]} */`;
|
|
298
294
|
}
|
|
299
|
-
const lines = [
|
|
295
|
+
const lines = [' /**'];
|
|
300
296
|
for (const part of parts) {
|
|
301
297
|
lines.push(` * ${part}`);
|
|
302
298
|
}
|
|
303
|
-
lines.push(
|
|
304
|
-
return lines.join(
|
|
299
|
+
lines.push(' */');
|
|
300
|
+
return lines.join('\n');
|
|
305
301
|
}
|
|
306
302
|
// ─── Client ─────────────────────────────────────────────────────────
|
|
307
303
|
function emitClient(out, hasGlobals) {
|
|
308
|
-
out.push(
|
|
309
|
-
out.push(
|
|
310
|
-
out.push(
|
|
311
|
-
out.push(
|
|
312
|
-
out.push(
|
|
313
|
-
out.push(
|
|
314
|
-
out.push(
|
|
315
|
-
out.push(
|
|
316
|
-
out.push(
|
|
317
|
-
out.push(
|
|
318
|
-
out.push(
|
|
319
|
-
out.push(
|
|
320
|
-
out.push(
|
|
321
|
-
out.push(
|
|
322
|
-
out.push(
|
|
323
|
-
out.push(
|
|
324
|
-
out.push(
|
|
325
|
-
out.push(
|
|
326
|
-
out.push(
|
|
327
|
-
out.push(
|
|
328
|
-
out.push(
|
|
329
|
-
out.push(
|
|
330
|
-
out.push(
|
|
331
|
-
out.push(
|
|
332
|
-
out.push(
|
|
333
|
-
out.push(
|
|
304
|
+
out.push('export interface ActuateClient {');
|
|
305
|
+
out.push(' find<K extends keyof ActuateCollections>(');
|
|
306
|
+
out.push(' collection: K,');
|
|
307
|
+
out.push(' options?: FindOptions,');
|
|
308
|
+
out.push(' ): Promise<FindResult<ActuateCollections[K]>>;');
|
|
309
|
+
out.push('');
|
|
310
|
+
out.push(' findOne<K extends keyof ActuateCollections>(');
|
|
311
|
+
out.push(' collection: K,');
|
|
312
|
+
out.push(' id: string,');
|
|
313
|
+
out.push(' ): Promise<ActuateCollections[K] | null>;');
|
|
314
|
+
out.push('');
|
|
315
|
+
out.push(' create<K extends keyof ActuateCollections>(');
|
|
316
|
+
out.push(' collection: K,');
|
|
317
|
+
out.push(' data: Omit<ActuateCollections[K], keyof Document>,');
|
|
318
|
+
out.push(' ): Promise<ActuateCollections[K]>;');
|
|
319
|
+
out.push('');
|
|
320
|
+
out.push(' update<K extends keyof ActuateCollections>(');
|
|
321
|
+
out.push(' collection: K,');
|
|
322
|
+
out.push(' id: string,');
|
|
323
|
+
out.push(' data: Partial<Omit<ActuateCollections[K], keyof Document>>,');
|
|
324
|
+
out.push(' ): Promise<ActuateCollections[K]>;');
|
|
325
|
+
out.push('');
|
|
326
|
+
out.push(' delete<K extends keyof ActuateCollections>(');
|
|
327
|
+
out.push(' collection: K,');
|
|
328
|
+
out.push(' id: string,');
|
|
329
|
+
out.push(' ): Promise<void>;');
|
|
334
330
|
if (hasGlobals) {
|
|
335
|
-
out.push(
|
|
336
|
-
out.push(
|
|
337
|
-
out.push(
|
|
338
|
-
out.push(
|
|
339
|
-
out.push(
|
|
340
|
-
out.push(
|
|
341
|
-
out.push(
|
|
342
|
-
out.push(
|
|
343
|
-
out.push(
|
|
331
|
+
out.push('');
|
|
332
|
+
out.push(' getGlobal<K extends keyof ActuateGlobals>(');
|
|
333
|
+
out.push(' slug: K,');
|
|
334
|
+
out.push(' ): Promise<ActuateGlobals[K]>;');
|
|
335
|
+
out.push('');
|
|
336
|
+
out.push(' updateGlobal<K extends keyof ActuateGlobals>(');
|
|
337
|
+
out.push(' slug: K,');
|
|
338
|
+
out.push(' data: Partial<ActuateGlobals[K]>,');
|
|
339
|
+
out.push(' ): Promise<ActuateGlobals[K]>;');
|
|
344
340
|
}
|
|
345
|
-
out.push(
|
|
346
|
-
out.push(
|
|
341
|
+
out.push('}');
|
|
342
|
+
out.push('');
|
|
347
343
|
}
|
|
348
344
|
// ─── Utility types ──────────────────────────────────────────────────
|
|
349
345
|
function emitExtractBlock(out) {
|
|
350
|
-
out.push(
|
|
351
|
-
out.push(
|
|
352
|
-
out.push(
|
|
346
|
+
out.push('/** Narrow a block discriminated union to a single block type by its `blockType` slug. */');
|
|
347
|
+
out.push('export type ExtractBlock<Union, Slug extends string> = Union extends { blockType: Slug } ? Union : never;');
|
|
348
|
+
out.push('');
|
|
353
349
|
}
|
|
354
350
|
function emitSchema(out, hasGlobals) {
|
|
355
|
-
out.push(
|
|
356
|
-
out.push(
|
|
351
|
+
out.push('export interface ActuateSchema {');
|
|
352
|
+
out.push(' collections: ActuateCollections;');
|
|
357
353
|
if (hasGlobals) {
|
|
358
|
-
out.push(
|
|
354
|
+
out.push(' globals: ActuateGlobals;');
|
|
359
355
|
}
|
|
360
|
-
out.push(
|
|
361
|
-
out.push(
|
|
356
|
+
out.push('}');
|
|
357
|
+
out.push('');
|
|
362
358
|
}
|
|
363
359
|
// ─── String utilities ───────────────────────────────────────────────
|
|
364
360
|
function pascalCase(str) {
|
|
365
361
|
return str
|
|
366
362
|
.split(/[-_\s]+/)
|
|
367
363
|
.map((word) => word.charAt(0).toUpperCase() + word.slice(1))
|
|
368
|
-
.join(
|
|
364
|
+
.join('');
|
|
369
365
|
}
|
|
370
366
|
//# sourceMappingURL=index.js.map
|