@camox/api-contract 0.74.1 → 0.76.0
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/drafts.d.ts +17 -0
- package/dist/drafts.js +6 -1
- package/dist/query-keys.d.ts +12 -2
- package/dist/query-keys.js +18 -0
- package/dist/router.d.ts +1043 -45
- package/dist/threads.d.ts +42 -8
- package/dist/threads.js +44 -12
- package/package.json +1 -1
- package/src/drafts.ts +16 -0
- package/src/query-keys.ts +17 -2
- package/src/threads.ts +57 -12
package/dist/drafts.d.ts
CHANGED
|
@@ -136,6 +136,23 @@ export type EndedDraft = {
|
|
|
136
136
|
};
|
|
137
137
|
endedAt: number;
|
|
138
138
|
};
|
|
139
|
+
/**
|
|
140
|
+
* A draft set aside without ending it (ADR 0046): who archived it, a member or Camox, and when.
|
|
141
|
+
* It keeps its id, changes, thread and code until it's restored or deleted.
|
|
142
|
+
*/
|
|
143
|
+
export type ArchivedDraft = {
|
|
144
|
+
draftId: string;
|
|
145
|
+
archivedBy: {
|
|
146
|
+
id: string;
|
|
147
|
+
name: string;
|
|
148
|
+
};
|
|
149
|
+
archivedAt: number;
|
|
150
|
+
};
|
|
151
|
+
/**
|
|
152
|
+
* The oRPC error code a request naming an archived draft fails with: its `data` is an
|
|
153
|
+
* `ArchivedDraft`. Nothing reads or writes the draft until it's restored.
|
|
154
|
+
*/
|
|
155
|
+
export declare const DRAFT_ARCHIVED_ERROR_CODE = "DRAFT_ARCHIVED";
|
|
139
156
|
/**
|
|
140
157
|
* The oRPC error code a request naming an ended draft fails with. Its `data` is an `EndedDraft`,
|
|
141
158
|
* so a page can render Live and say who published or deleted the draft.
|
package/dist/drafts.js
CHANGED
|
@@ -86,6 +86,11 @@ const DRAFT_CREATE_HEADER = "x-camox-draft-create";
|
|
|
86
86
|
/** URL search param carrying the current draft's id in the studio and the rendered site. */
|
|
87
87
|
const DRAFT_SEARCH_PARAM = "camox-draft";
|
|
88
88
|
/**
|
|
89
|
+
* The oRPC error code a request naming an archived draft fails with: its `data` is an
|
|
90
|
+
* `ArchivedDraft`. Nothing reads or writes the draft until it's restored.
|
|
91
|
+
*/
|
|
92
|
+
const DRAFT_ARCHIVED_ERROR_CODE = "DRAFT_ARCHIVED";
|
|
93
|
+
/**
|
|
89
94
|
* The oRPC error code a request naming an ended draft fails with. Its `data` is an `EndedDraft`,
|
|
90
95
|
* so a page can render Live and say who published or deleted the draft.
|
|
91
96
|
*/
|
|
@@ -230,4 +235,4 @@ function isContentWrite(path) {
|
|
|
230
235
|
}
|
|
231
236
|
|
|
232
237
|
//#endregion
|
|
233
|
-
export { ARTIFACT_FIELD_ATTRIBUTE, ARTIFACT_ITEM_ATTRIBUTE, CAMOX_ACTOR, CAMOX_NAME, DRAFT_CREATE_HEADER, DRAFT_ENDED_ERROR_CODE, DRAFT_HEADER, DRAFT_SEARCH_PARAM, LIVE_READ_ONLY_ERROR, LOCALE_HEADER, LOOK_ARTIFACT_CAPTURE, LOOK_BLOCKS_PARAM, LOOK_BLOCK_DEFINITION_PARAM, LOOK_CONTENT_PARAM, LOOK_DOCUMENT_PATH, LOOK_LAYOUT_DEFINITION_PARAM, LOOK_LOCALE_PARAM, LOOK_PATH_PARAM, LOOK_PLACEHOLDER_HEIGHTS, LOOK_PLACEHOLDER_PARAM, LOOK_SETTINGS_PARAM, LOOK_TOKEN_COOKIE, LOOK_TOKEN_HEADER, NOT_PUBLISHED_CODES, PUBLISHING_DRAFT_HEADER, PUBLISHING_DRAFT_VAR, PUBLISH_ABORT_REASONS, PUBLISH_BLOCKED_ERROR, REVISION_CHANGED_ERROR, UNPLACED_BLOCK_ID, isContentWrite, lookArtifactSelector };
|
|
238
|
+
export { ARTIFACT_FIELD_ATTRIBUTE, ARTIFACT_ITEM_ATTRIBUTE, CAMOX_ACTOR, CAMOX_NAME, DRAFT_ARCHIVED_ERROR_CODE, DRAFT_CREATE_HEADER, DRAFT_ENDED_ERROR_CODE, DRAFT_HEADER, DRAFT_SEARCH_PARAM, LIVE_READ_ONLY_ERROR, LOCALE_HEADER, LOOK_ARTIFACT_CAPTURE, LOOK_BLOCKS_PARAM, LOOK_BLOCK_DEFINITION_PARAM, LOOK_CONTENT_PARAM, LOOK_DOCUMENT_PATH, LOOK_LAYOUT_DEFINITION_PARAM, LOOK_LOCALE_PARAM, LOOK_PATH_PARAM, LOOK_PLACEHOLDER_HEIGHTS, LOOK_PLACEHOLDER_PARAM, LOOK_SETTINGS_PARAM, LOOK_TOKEN_COOKIE, LOOK_TOKEN_HEADER, NOT_PUBLISHED_CODES, PUBLISHING_DRAFT_HEADER, PUBLISHING_DRAFT_VAR, PUBLISH_ABORT_REASONS, PUBLISH_BLOCKED_ERROR, REVISION_CHANGED_ERROR, UNPLACED_BLOCK_ID, isContentWrite, lookArtifactSelector };
|
package/dist/query-keys.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { EndedDraft } from "./drafts.js";
|
|
1
|
+
import { ArchivedDraft, EndedDraft } from "./drafts.js";
|
|
2
2
|
//#region src/query-keys.d.ts
|
|
3
3
|
/**
|
|
4
4
|
* Use TypeScript to enforce 'camox' as the first query key to ensure they're all namespaced.
|
|
@@ -39,6 +39,12 @@ export declare const queryKeys: {
|
|
|
39
39
|
all: ["camox", string];
|
|
40
40
|
list: ["camox", string, string];
|
|
41
41
|
get: ["camox", string, string];
|
|
42
|
+
archived: ["camox", string, string];
|
|
43
|
+
};
|
|
44
|
+
publications: {
|
|
45
|
+
all: ["camox", string];
|
|
46
|
+
list: ["camox", string, string];
|
|
47
|
+
get: ["camox", string, string];
|
|
42
48
|
};
|
|
43
49
|
specialists: {
|
|
44
50
|
get: ["camox", string];
|
|
@@ -71,6 +77,10 @@ export type InvalidationMessage = {
|
|
|
71
77
|
export type DraftEndedMessage = {
|
|
72
78
|
type: "draftEnded";
|
|
73
79
|
} & EndedDraft;
|
|
80
|
+
/** A draft was archived: its viewers go back to Live (ADR 0046). */
|
|
81
|
+
export type DraftArchivedMessage = {
|
|
82
|
+
type: "draftArchived";
|
|
83
|
+
} & ArchivedDraft;
|
|
74
84
|
/** A draft with code has a new revision, built with Camox's `sdkVersion`. */
|
|
75
85
|
export type RevisionAnnouncement = {
|
|
76
86
|
draftId: string;
|
|
@@ -82,5 +92,5 @@ export type RevisionMessage = {
|
|
|
82
92
|
type: "revision";
|
|
83
93
|
} & RevisionAnnouncement;
|
|
84
94
|
/** Everything the project room broadcasts. */
|
|
85
|
-
export type ProjectRoomMessage = InvalidationMessage | DraftEndedMessage | RevisionMessage;
|
|
95
|
+
export type ProjectRoomMessage = InvalidationMessage | DraftEndedMessage | DraftArchivedMessage | RevisionMessage;
|
|
86
96
|
//#endregion
|
package/dist/query-keys.js
CHANGED
|
@@ -97,6 +97,24 @@ const queryKeys = {
|
|
|
97
97
|
"camox",
|
|
98
98
|
"drafts",
|
|
99
99
|
"get"
|
|
100
|
+
],
|
|
101
|
+
archived: [
|
|
102
|
+
"camox",
|
|
103
|
+
"drafts",
|
|
104
|
+
"archived"
|
|
105
|
+
]
|
|
106
|
+
},
|
|
107
|
+
publications: {
|
|
108
|
+
all: ["camox", "publications"],
|
|
109
|
+
list: [
|
|
110
|
+
"camox",
|
|
111
|
+
"publications",
|
|
112
|
+
"list"
|
|
113
|
+
],
|
|
114
|
+
get: [
|
|
115
|
+
"camox",
|
|
116
|
+
"publications",
|
|
117
|
+
"get"
|
|
100
118
|
]
|
|
101
119
|
},
|
|
102
120
|
specialists: { get: ["camox", "specialists"] },
|