@contrail/documents 1.12.0 → 1.13.0-alpha.740323e
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,14 @@ 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
|
+
- `SortOrderErrorCode.SORT_INDEX_NOT_USABLE` / `SortOrderErrorMessage.SORT_INDEX_NOT_USABLE` — returned when a `sortIndex` write to an `elementIndexing` document carries a value that is not a non-empty string. Such a value would leave the document claiming `elementIndexing` while the read path silently fell back to sort-order-array order.
|
|
14
|
+
- `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.
|
|
15
|
+
|
|
8
16
|
## [1.12.0] - 2026-07-21
|
|
9
17
|
|
|
10
18
|
### Added
|
|
@@ -1,6 +1,10 @@
|
|
|
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",
|
|
4
|
+
SORT_INDEX_NOT_USABLE = "SORT_INDEX_NOT_USABLE"
|
|
3
5
|
}
|
|
4
6
|
export declare enum SortOrderErrorMessage {
|
|
5
|
-
SORT_MIGRATION_IN_PROGRESS = "Sort order is being migrated for this document; editing is briefly locked"
|
|
7
|
+
SORT_MIGRATION_IN_PROGRESS = "Sort order is being migrated for this document; editing is briefly locked",
|
|
8
|
+
SORT_MODE_MISMATCH = "Ordering write does not match the document's sort mode",
|
|
9
|
+
SORT_INDEX_NOT_USABLE = "sortIndex must be a non-empty string"
|
|
6
10
|
}
|
package/lib/sort-order-errors.js
CHANGED
|
@@ -4,8 +4,12 @@ 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";
|
|
8
|
+
SortOrderErrorCode["SORT_INDEX_NOT_USABLE"] = "SORT_INDEX_NOT_USABLE";
|
|
7
9
|
})(SortOrderErrorCode || (exports.SortOrderErrorCode = SortOrderErrorCode = {}));
|
|
8
10
|
var SortOrderErrorMessage;
|
|
9
11
|
(function (SortOrderErrorMessage) {
|
|
10
12
|
SortOrderErrorMessage["SORT_MIGRATION_IN_PROGRESS"] = "Sort order is being migrated for this document; editing is briefly locked";
|
|
13
|
+
SortOrderErrorMessage["SORT_MODE_MISMATCH"] = "Ordering write does not match the document's sort mode";
|
|
14
|
+
SortOrderErrorMessage["SORT_INDEX_NOT_USABLE"] = "sortIndex must be a non-empty string";
|
|
11
15
|
})(SortOrderErrorMessage || (exports.SortOrderErrorMessage = SortOrderErrorMessage = {}));
|
package/lib/types/document.d.ts
CHANGED
|
@@ -5,7 +5,8 @@ export interface ImportReferenceDetail {
|
|
|
5
5
|
importedFileReference?: string;
|
|
6
6
|
}
|
|
7
7
|
export type DocumentWriteMode = 'transactional' | 'legacy';
|
|
8
|
-
export
|
|
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;
|
package/lib/types/document.js
CHANGED