@isardsat/editorial-server 6.18.0 → 6.18.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.
@@ -8,9 +8,9 @@ export declare function createSchema(configDirectory: string): Promise<Record<st
8
8
  displayExtra?: string | undefined;
9
9
  placeholder?: string | undefined;
10
10
  showInSummary?: boolean | undefined;
11
- options?: string[] | undefined;
12
- maxSelectedOptions?: number | undefined;
13
- minSelectedOptions?: number | undefined;
11
+ choicesFixed?: string[] | undefined;
12
+ maxSelectedChoices?: number | undefined;
13
+ minSelectedChoices?: number | undefined;
14
14
  isUploadedFile?: boolean | undefined;
15
15
  }>;
16
16
  filterBy?: string | undefined;
@@ -10,9 +10,9 @@ export declare function createStorage(dataDirectory: string): {
10
10
  displayExtra?: string | undefined;
11
11
  placeholder?: string | undefined;
12
12
  showInSummary?: boolean | undefined;
13
- options?: string[] | undefined;
14
- maxSelectedOptions?: number | undefined;
15
- minSelectedOptions?: number | undefined;
13
+ choicesFixed?: string[] | undefined;
14
+ maxSelectedChoices?: number | undefined;
15
+ minSelectedChoices?: number | undefined;
16
16
  isUploadedFile?: boolean | undefined;
17
17
  }>;
18
18
  filterBy?: string | undefined;
@@ -1,5 +1,4 @@
1
- import {} from "@isardsat/editorial-common";
2
- import { getOptionsReference } from "@isardsat/editorial-common";
1
+ import { getChoicesReference, } from "@isardsat/editorial-common";
3
2
  /**
4
3
  * Resolves uploaded file paths to full URLs for an item.
5
4
  */
@@ -39,7 +38,7 @@ export function resolveReferences(item, schema, itemType, content, origin, resol
39
38
  if (fieldConfig.type !== "select" && fieldConfig.type !== "multiselect") {
40
39
  continue;
41
40
  }
42
- const referencedType = getOptionsReference(fieldConfig.options);
41
+ const referencedType = getChoicesReference(fieldConfig.choicesFixed);
43
42
  if (!referencedType)
44
43
  continue;
45
44
  const referencedCollection = content[referencedType];
@@ -463,11 +463,11 @@ export function createDataRoutes(config, storage) {
463
463
  },
464
464
  tags: ["Data"],
465
465
  }), async (c) => {
466
- // Fetch both preview and production content
466
+ // Fetch both preview and production content (not cached to ensure real-time diff)
467
467
  const [previewContent, productionContent, schema] = await Promise.all([
468
- cache.getContent(storage, { production: false }),
469
- cache.getContent(storage, { production: true }),
470
- cache.getSchema(storage),
468
+ storage.getContent({ production: false }),
469
+ storage.getContent({ production: true }),
470
+ storage.getSchema(),
471
471
  ]);
472
472
  const result = {
473
473
  collections: {},
@@ -511,6 +511,10 @@ export function createDataRoutes(config, storage) {
511
511
  else if (previewItem?.updatedAt !== productionItem?.updatedAt) {
512
512
  // Singleton has different updatedAt = modified
513
513
  const changedFields = getChangedFields(previewItem, productionItem);
514
+ if (changedFields.length === 0) {
515
+ // If there are no changed fields other than updatedAt, we can consider it as not modified
516
+ continue;
517
+ }
514
518
  result.singles[itemType] = {
515
519
  status: "modified",
516
520
  preview: previewItem,
@@ -540,6 +544,10 @@ export function createDataRoutes(config, storage) {
540
544
  else if (previewItem.updatedAt !== productionItem.updatedAt) {
541
545
  // Item has different updatedAt = modified (not yet published)
542
546
  const changedFields = getChangedFields(previewItem, productionItem);
547
+ if (changedFields.length === 0) {
548
+ // If there are no changed fields other than updatedAt, we can consider it as not modified
549
+ continue;
550
+ }
543
551
  modified.push({
544
552
  id,
545
553
  preview: previewItem,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@isardsat/editorial-server",
3
- "version": "6.18.0",
3
+ "version": "6.18.2",
4
4
  "type": "module",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -15,8 +15,8 @@
15
15
  "jose": "^6.1.3",
16
16
  "yaml": "^2.8.1",
17
17
  "zod": "^4.1.11",
18
- "@isardsat/editorial-admin": "^6.18.0",
19
- "@isardsat/editorial-common": "^6.18.0"
18
+ "@isardsat/editorial-admin": "^6.18.2",
19
+ "@isardsat/editorial-common": "^6.18.2"
20
20
  },
21
21
  "devDependencies": {
22
22
  "@tsconfig/node22": "^22.0.0",