@contrail/documents 1.12.0-alpha.aad6f60 → 1.13.0-alpha.7535b68

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/CHANGELOG.md CHANGED
@@ -5,6 +5,13 @@ All notable changes to `@contrail/documents` are documented here.
5
5
  Format follows [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
6
6
  Versioning follows [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
7
 
8
+ ## [1.13.0] - 2026-07-27
9
+
10
+ ### Added
11
+
12
+ - `SortOrderErrorCode.SORT_MODE_MISMATCH` / `SortOrderErrorMessage.SORT_MODE_MISMATCH` — returned when an ordering write targets a representation the document isn't using (a `sortIndex` write to an `array`-mode document, or a sort-order-array write to an `elementIndexing` document). The response's `currentSortMode` says which representation the document is on, so a client can switch and retry.
13
+ - `DOCUMENT_SORT_MODES` — the sort modes as a runtime array, for validators that need to check a value against the same source as the `DocumentSortMode` type.
14
+
8
15
  ## [1.12.0] - 2026-07-21
9
16
 
10
17
  ### Added
@@ -1,6 +1,8 @@
1
1
  export declare enum SortOrderErrorCode {
2
- SORT_MIGRATION_IN_PROGRESS = "SORT_MIGRATION_IN_PROGRESS"
2
+ SORT_MIGRATION_IN_PROGRESS = "SORT_MIGRATION_IN_PROGRESS",
3
+ SORT_MODE_MISMATCH = "SORT_MODE_MISMATCH"
3
4
  }
4
5
  export declare enum SortOrderErrorMessage {
5
- SORT_MIGRATION_IN_PROGRESS = "Sort order is being migrated for this document; editing is briefly locked"
6
+ SORT_MIGRATION_IN_PROGRESS = "Sort order is being migrated for this document; editing is briefly locked",
7
+ SORT_MODE_MISMATCH = "Ordering write does not match the document's sort mode"
6
8
  }
@@ -4,8 +4,10 @@ exports.SortOrderErrorMessage = exports.SortOrderErrorCode = void 0;
4
4
  var SortOrderErrorCode;
5
5
  (function (SortOrderErrorCode) {
6
6
  SortOrderErrorCode["SORT_MIGRATION_IN_PROGRESS"] = "SORT_MIGRATION_IN_PROGRESS";
7
+ SortOrderErrorCode["SORT_MODE_MISMATCH"] = "SORT_MODE_MISMATCH";
7
8
  })(SortOrderErrorCode || (exports.SortOrderErrorCode = SortOrderErrorCode = {}));
8
9
  var SortOrderErrorMessage;
9
10
  (function (SortOrderErrorMessage) {
10
11
  SortOrderErrorMessage["SORT_MIGRATION_IN_PROGRESS"] = "Sort order is being migrated for this document; editing is briefly locked";
12
+ SortOrderErrorMessage["SORT_MODE_MISMATCH"] = "Ordering write does not match the document's sort mode";
11
13
  })(SortOrderErrorMessage || (exports.SortOrderErrorMessage = SortOrderErrorMessage = {}));
@@ -5,7 +5,8 @@ export interface ImportReferenceDetail {
5
5
  importedFileReference?: string;
6
6
  }
7
7
  export type DocumentWriteMode = 'transactional' | 'legacy';
8
- export type DocumentSortMode = 'array' | 'elementIndexing' | 'migrating';
8
+ export declare const DOCUMENT_SORT_MODES: readonly ["array", "elementIndexing", "migrating"];
9
+ export type DocumentSortMode = (typeof DOCUMENT_SORT_MODES)[number];
9
10
  export interface Document {
10
11
  id?: string;
11
12
  name?: string;
@@ -1,2 +1,4 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.DOCUMENT_SORT_MODES = void 0;
4
+ exports.DOCUMENT_SORT_MODES = ['array', 'elementIndexing', 'migrating'];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@contrail/documents",
3
- "version": "1.12.0-alpha.aad6f60",
3
+ "version": "1.13.0-alpha.7535b68",
4
4
  "description": "Documents library for contrail platform",
5
5
  "main": "lib/index.js",
6
6
  "types": "lib/index.d.ts",