@nexpress/core 0.3.1 → 0.3.2

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 (45) hide show
  1. package/dist/auth.d.ts +2 -2
  2. package/dist/{chunk-HUESWYZJ.js → chunk-54KUQF3S.js} +2 -2
  3. package/dist/{chunk-DKOCKZVG.js → chunk-ANZBCOEH.js} +6 -6
  4. package/dist/{chunk-56ZK5PWM.js → chunk-C6HXDY46.js} +2 -2
  5. package/dist/{chunk-AEKO4MXK.js → chunk-LMPYQLMH.js} +17 -2
  6. package/dist/chunk-LMPYQLMH.js.map +1 -0
  7. package/dist/{chunk-UIQYA3Y7.js → chunk-M2FWG5OJ.js} +2 -2
  8. package/dist/{chunk-HVHV3IHF.js → chunk-YOFCLTBR.js} +7 -4
  9. package/dist/chunk-YOFCLTBR.js.map +1 -0
  10. package/dist/{chunk-6IEYOY2L.js → chunk-ZA3IRJUQ.js} +59 -16
  11. package/dist/chunk-ZA3IRJUQ.js.map +1 -0
  12. package/dist/community.d.ts +1 -1
  13. package/dist/community.js +3 -3
  14. package/dist/{config-44MFLLIX.js → config-O7QM2OQS.js} +4 -4
  15. package/dist/db-schema.d.ts +2 -2
  16. package/dist/db.d.ts +3 -3
  17. package/dist/db.js +1 -1
  18. package/dist/fields.d.ts +1 -1
  19. package/dist/{host-DKOWZWKA.js → host-NI3LR774.js} +2 -2
  20. package/dist/i18n.d.ts +1 -1
  21. package/dist/{index-C-jKU1St.d.ts → index-CPp-zGgL.d.ts} +2 -2
  22. package/dist/{index-BmR3Z8Y5.d.ts → index-DKoSaszT.d.ts} +1 -1
  23. package/dist/{index-Ca-WUDH5.d.ts → index-DymnczhP.d.ts} +1 -1
  24. package/dist/{index-lACZ9sON.d.ts → index-UZn29S3i.d.ts} +1 -1
  25. package/dist/index.d.ts +100 -12
  26. package/dist/index.js +13 -11
  27. package/dist/index.js.map +1 -1
  28. package/dist/jobs.d.ts +2 -2
  29. package/dist/jobs.js +1 -1
  30. package/dist/media.d.ts +2 -2
  31. package/dist/{scheduled-VEOGI5EW.js → scheduled-BWJG35Z2.js} +3 -3
  32. package/dist/seo.d.ts +16 -3
  33. package/dist/seo.js +2 -2
  34. package/dist/{types-BY1UmEiY.d.ts → types-D31ppGJw.d.ts} +45 -0
  35. package/package.json +1 -1
  36. package/dist/chunk-6IEYOY2L.js.map +0 -1
  37. package/dist/chunk-AEKO4MXK.js.map +0 -1
  38. package/dist/chunk-HVHV3IHF.js.map +0 -1
  39. /package/dist/{chunk-HUESWYZJ.js.map → chunk-54KUQF3S.js.map} +0 -0
  40. /package/dist/{chunk-DKOCKZVG.js.map → chunk-ANZBCOEH.js.map} +0 -0
  41. /package/dist/{chunk-56ZK5PWM.js.map → chunk-C6HXDY46.js.map} +0 -0
  42. /package/dist/{chunk-UIQYA3Y7.js.map → chunk-M2FWG5OJ.js.map} +0 -0
  43. /package/dist/{config-44MFLLIX.js.map → config-O7QM2OQS.js.map} +0 -0
  44. /package/dist/{host-DKOWZWKA.js.map → host-NI3LR774.js.map} +0 -0
  45. /package/dist/{scheduled-VEOGI5EW.js.map → scheduled-BWJG35Z2.js.map} +0 -0
package/dist/jobs.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- export { D as DEFAULT_JOB_LOG_RETENTION_MS, L as ListJobLogsOptions, N as NpJobCountOptions, a as NpJobHandler, b as NpJobListOptions, c as NpJobListResult, d as NpJobLogEntry, e as NpJobQueue, f as NpJobState, g as NpJobStateCounts, h as NpJobSummary, i as NpJobsPauseState, j as NpPluginScheduleStats, k as NpReconcileSchedulesResult, l as NpScheduleSummary, m as NpWorkerHealthSummary, n as NpWorkerHeartbeat, P as PAUSE_SYNC_INTERVAL_MS, o as PgBossAdapter, S as SetJobsPauseStateInput, W as WORKER_HEARTBEAT_INTERVAL_MS, p as WORKER_STALE_THRESHOLD_MS, r as countAliveWorkers, s as countJobLogs, t as enqueueJob, u as getAllJobHandlers, v as getCurrentJobId, w as getJobHandler, x as getJobQueue, y as getJobsPauseState, z as getOptionalJobQueue, A as listJobLogs, B as listWorkerHealth, C as markWorkerStopped, E as pruneJobLogsOlderThan, F as purgeStaleWorkers, G as recordHeartbeat, H as recordJobLog, I as registerBuiltinHandlers, J as registerJobHandler, K as runInJobContext, M as setJobQueue, O as setJobsPauseState, Q as startProducer, R as startWorker, T as stopProducer, U as stopWorker } from './index-lACZ9sON.js';
2
- import './types-BY1UmEiY.js';
1
+ export { D as DEFAULT_JOB_LOG_RETENTION_MS, L as ListJobLogsOptions, N as NpJobCountOptions, a as NpJobHandler, b as NpJobListOptions, c as NpJobListResult, d as NpJobLogEntry, e as NpJobQueue, f as NpJobState, g as NpJobStateCounts, h as NpJobSummary, i as NpJobsPauseState, j as NpPluginScheduleStats, k as NpReconcileSchedulesResult, l as NpScheduleSummary, m as NpWorkerHealthSummary, n as NpWorkerHeartbeat, P as PAUSE_SYNC_INTERVAL_MS, o as PgBossAdapter, S as SetJobsPauseStateInput, W as WORKER_HEARTBEAT_INTERVAL_MS, p as WORKER_STALE_THRESHOLD_MS, r as countAliveWorkers, s as countJobLogs, t as enqueueJob, u as getAllJobHandlers, v as getCurrentJobId, w as getJobHandler, x as getJobQueue, y as getJobsPauseState, z as getOptionalJobQueue, A as listJobLogs, B as listWorkerHealth, C as markWorkerStopped, E as pruneJobLogsOlderThan, F as purgeStaleWorkers, G as recordHeartbeat, H as recordJobLog, I as registerBuiltinHandlers, J as registerJobHandler, K as runInJobContext, M as setJobQueue, O as setJobsPauseState, Q as startProducer, R as startWorker, T as stopProducer, U as stopWorker } from './index-UZn29S3i.js';
2
+ import './types-D31ppGJw.js';
3
3
  import 'pg-boss';
4
4
  import './logger-DqGaOU_j.js';
package/dist/jobs.js CHANGED
@@ -18,7 +18,7 @@ import {
18
18
  startWorker,
19
19
  stopProducer,
20
20
  stopWorker
21
- } from "./chunk-DKOCKZVG.js";
21
+ } from "./chunk-ANZBCOEH.js";
22
22
  import {
23
23
  DEFAULT_JOB_LOG_RETENTION_MS,
24
24
  countJobLogs,
package/dist/media.d.ts CHANGED
@@ -1,5 +1,5 @@
1
- export { D as DEFAULT_IMAGE_SIZES, q as DrizzleTransactionLike, b as NpGetMediaUrlOptions, c as NpMediaUploader, d as NpMediaUploaderKindFilter, e as NpMediaVariantName, f as NpProcessedImageResult, r as NpProcessedImageSourceMetadata, g as NpProcessedImageVariant, h as cleanupDeletedMedia, i as deleteMedia, j as extractMediaIds, k as getMediaById, l as getMediaUrl, m as getStorageAdapter, n as listMedia, p as processImage, o as processMediaImage, s as setStorageAdapter, t as syncMediaRefs, u as uploadMedia } from './index-Ca-WUDH5.js';
2
- import './types-BY1UmEiY.js';
1
+ export { D as DEFAULT_IMAGE_SIZES, q as DrizzleTransactionLike, b as NpGetMediaUrlOptions, c as NpMediaUploader, d as NpMediaUploaderKindFilter, e as NpMediaVariantName, f as NpProcessedImageResult, r as NpProcessedImageSourceMetadata, g as NpProcessedImageVariant, h as cleanupDeletedMedia, i as deleteMedia, j as extractMediaIds, k as getMediaById, l as getMediaUrl, m as getStorageAdapter, n as listMedia, p as processImage, o as processMediaImage, s as setStorageAdapter, t as syncMediaRefs, u as uploadMedia } from './index-DymnczhP.js';
2
+ import './types-D31ppGJw.js';
3
3
  import 'drizzle-orm';
4
4
  import 'drizzle-orm/pg-core';
5
5
  import 'node:stream/web';
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  publishScheduledDocuments
3
- } from "./chunk-HUESWYZJ.js";
4
- import "./chunk-6IEYOY2L.js";
3
+ } from "./chunk-54KUQF3S.js";
4
+ import "./chunk-ZA3IRJUQ.js";
5
5
  import "./chunk-2VZZ7M26.js";
6
6
  import "./chunk-P5WGQRSG.js";
7
7
  import "./chunk-4ZLMEKFX.js";
@@ -18,4 +18,4 @@ import "./chunk-PZ5AY32C.js";
18
18
  export {
19
19
  publishScheduledDocuments
20
20
  };
21
- //# sourceMappingURL=scheduled-VEOGI5EW.js.map
21
+ //# sourceMappingURL=scheduled-BWJG35Z2.js.map
package/dist/seo.d.ts CHANGED
@@ -150,11 +150,24 @@ interface NpPageMetadataInput {
150
150
  */
151
151
  ogImage?: string | null;
152
152
  /**
153
- * Path of the current page (no origin). Used to build the
154
- * canonical URL. Pass without query / hash; trailing `/` is
155
- * normalized off.
153
+ * Path of the current page (no origin). Drives the OpenGraph
154
+ * `url` field (which represents "this resource"). Also serves
155
+ * as the default for `canonicalPath` when that's not set.
156
+ * Pass without trailing `/` — trailing slashes are normalized
157
+ * off — but query strings are preserved so paginated /
158
+ * filtered routes can identify themselves accurately.
156
159
  */
157
160
  path?: string;
161
+ /**
162
+ * Override the canonical URL path when the page represents
163
+ * one resource but search engines should treat a different
164
+ * URL as authoritative. Defaults to `path`. Use when /blog
165
+ * canonicalises to / on a theme that renders the same content
166
+ * at both, or when a paginated route should dedupe to its
167
+ * first page. Leaving this unset means "canonical = self",
168
+ * which is correct for most pages.
169
+ */
170
+ canonicalPath?: string;
158
171
  /** OpenGraph type. Default `"website"`; posts use `"article"`. */
159
172
  ogType?: "website" | "article" | "profile";
160
173
  /**
package/dist/seo.js CHANGED
@@ -12,8 +12,8 @@ import {
12
12
  renderSitemapIndexXml,
13
13
  renderSitemapXml,
14
14
  validateSeoSettingsPatch
15
- } from "./chunk-HVHV3IHF.js";
16
- import "./chunk-6IEYOY2L.js";
15
+ } from "./chunk-YOFCLTBR.js";
16
+ import "./chunk-ZA3IRJUQ.js";
17
17
  import "./chunk-2VZZ7M26.js";
18
18
  import "./chunk-P5WGQRSG.js";
19
19
  import "./chunk-4ZLMEKFX.js";
@@ -197,6 +197,22 @@ interface NpCheckboxField extends NpFieldBase {
197
197
  }
198
198
  interface NpDateField extends NpFieldBase {
199
199
  type: "date";
200
+ /**
201
+ * Default value the Drizzle schema generator emits as a SQL
202
+ * `DEFAULT` clause. Accepted shapes:
203
+ *
204
+ * - `"now"` sentinel → `.defaultNow()` → `DEFAULT now()`
205
+ * - A `Date` instance → `.default(new Date("<iso>"))`
206
+ * - Any ISO 8601 string → parsed via `new Date(...)` and
207
+ * emitted identically to the Date case.
208
+ *
209
+ * Anything else is dropped silently at codegen time (mirroring
210
+ * the defensive shape used for other scalar fields). Required
211
+ * NOT NULL date columns paired with `defaultValue: "now"` let
212
+ * an `ALTER TABLE … ADD COLUMN` against a populated table
213
+ * succeed without a backfill step.
214
+ */
215
+ defaultValue?: Date | string;
200
216
  pickerOptions?: {
201
217
  format?: string;
202
218
  includeTime?: boolean;
@@ -1052,6 +1068,14 @@ interface NpFindWhereSystemTokens {
1052
1068
  * a `locale` field (only i18n-enabled collections do).
1053
1069
  */
1054
1070
  locale?: string;
1071
+ /**
1072
+ * Lifecycle status filter. Every collection in the framework
1073
+ * carries a `status` column (codegen-enforced), so exposing it
1074
+ * here lets a typed `where` clause filter to published rows
1075
+ * without the doc type having to redeclare it. Accepts a
1076
+ * single value or an array (IN match).
1077
+ */
1078
+ status?: NpDocumentStatus | NpDocumentStatus[];
1055
1079
  }
1056
1080
  /**
1057
1081
  * Strip `null` and unwrap arrays so a hasMany field like
@@ -1122,6 +1146,27 @@ interface NpFindResult<T = Record<string, unknown>> {
1122
1146
  type NpDocumentStatus = "draft" | "scheduled" | "published" | "archived" | "pending";
1123
1147
  interface NpSaveOptions {
1124
1148
  status?: NpDocumentStatus;
1149
+ /**
1150
+ * Caller-owned Drizzle transaction handle. When provided, all
1151
+ * reads + writes in the save flow run against this transaction
1152
+ * instead of opening a private one — useful for batching many
1153
+ * saves (the seed loop) so a mid-batch failure rolls back the
1154
+ * pending writes as a unit.
1155
+ *
1156
+ * Typed as `unknown` here to avoid a circular import between
1157
+ * `config/types.ts` and `collections/pipeline.ts` (where the
1158
+ * structural type lives). Callers pass the `NpTransaction`
1159
+ * value exported from `@nexpress/core`; the pipeline narrows
1160
+ * with an internal cast at the boundary.
1161
+ *
1162
+ * Pre-write hooks still fire OUTSIDE the tx (they shouldn't see
1163
+ * pending state). Post-commit hooks (`content:afterSave` job,
1164
+ * plugin `content:afterCreate` / `content:afterUpdate`) fire
1165
+ * after the inner persist block but before the caller's outer
1166
+ * tx commits — their side effects can diverge from final DB
1167
+ * state on rollback. Same trade-off as `deleteDocument({ tx })`.
1168
+ */
1169
+ tx?: unknown;
1125
1170
  }
1126
1171
  interface NpSaveResult {
1127
1172
  doc: Record<string, unknown>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nexpress/core",
3
- "version": "0.3.1",
3
+ "version": "0.3.2",
4
4
  "description": "Server-side core for NexPress — collections pipeline, auth, jobs, media, plugins, observability.",
5
5
  "license": "MIT",
6
6
  "author": "Nexpress",