@phtngyn/cms 0.1.0-beta.1 → 0.1.0-beta.3
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/README.md +212 -12
- package/bin/cms.mjs +2 -0
- package/package.json +30 -15
- package/src/{Configuration-DyKo0sLS.js → Configuration-CDMYfTre.js} +26 -147
- package/src/Configuration-CDMYfTre.js.map +1 -0
- package/src/Configuration.d.ts +24 -8
- package/src/Configuration.js +0 -1
- package/src/Configuration.js.map +1 -1
- package/src/ContentTransfer-C3Av9sWz.js +53 -0
- package/src/ContentTransfer-C3Av9sWz.js.map +1 -0
- package/src/{DocumentEngine-DYObwMDY.js → DocumentEngine-J7g-emdf.js} +75 -27
- package/src/DocumentEngine-J7g-emdf.js.map +1 -0
- package/src/DocumentModel.d.ts +8 -9
- package/src/DocumentModel.js +13 -3
- package/src/DocumentModel.js.map +1 -1
- package/src/Forms-BsJMev5_.d.ts +74 -0
- package/src/Forms-CfcI3tPU.js +79 -0
- package/src/Forms-CfcI3tPU.js.map +1 -0
- package/src/Forms-Dj6NuW66.js +367 -0
- package/src/Forms-Dj6NuW66.js.map +1 -0
- package/src/Forms.d.ts +51 -0
- package/src/Forms.js +13 -0
- package/src/Forms.js.map +1 -0
- package/src/{HttpPaths-BbS21Jy8.js → HttpPaths-c9nLZ9H2.js} +6 -2
- package/src/HttpPaths-c9nLZ9H2.js.map +1 -0
- package/src/I18n.d.ts +20 -0
- package/src/I18n.js +1 -0
- package/src/Module.js +59 -14
- package/src/Module.js.map +1 -1
- package/src/S3MediaObjects-CpPSzJto.js +2777 -0
- package/src/S3MediaObjects-CpPSzJto.js.map +1 -0
- package/src/Seo-402YumpT.d.ts +198 -0
- package/src/cli/content.js +258 -0
- package/src/cli/content.js.map +1 -0
- package/src/cli.js +71 -0
- package/src/cli.js.map +1 -0
- package/src/{connection-CBTY-TzB.js → connection-CBAy2qGy.js} +5 -7
- package/src/connection-CBAy2qGy.js.map +1 -0
- package/src/{installation-DeuBiFRE.js → installation-CNfIriVm.js} +1007 -2246
- package/src/installation-CNfIriVm.js.map +1 -0
- package/src/internal/authoring-catalog.js +10 -4
- package/src/internal/authoring-catalog.js.map +1 -1
- package/src/internal/authoring-compiler.js +0 -1
- package/src/internal/authoring-compiler.js.map +1 -1
- package/src/internal/authoring-metadata.js +4 -4
- package/src/internal/authoring-metadata.js.map +1 -1
- package/src/internal/cms-config.js +0 -1
- package/src/internal/cms-config.js.map +1 -1
- package/src/internal/configuration.js +26 -17
- package/src/internal/configuration.js.map +1 -1
- package/src/internal/document-model.js +69 -21
- package/src/internal/document-model.js.map +1 -1
- package/src/internal/form-capabilities.js +12 -0
- package/src/internal/form-capabilities.js.map +1 -0
- package/src/internal/i18n.js +47 -0
- package/src/internal/i18n.js.map +1 -0
- package/src/internal/studio-app.js +2 -2
- package/src/internal/studio-app.js.map +1 -1
- package/src/{location-DtYv2aes.js → location-BTqdfIzX.js} +2 -3
- package/src/location-BTqdfIzX.js.map +1 -0
- package/src/{metadata-DE1Mc2td.js → metadata-BEZPWh-3.js} +3 -72
- package/src/metadata-BEZPWh-3.js.map +1 -0
- package/src/{models-C3witQBK.js → models-B4IoTmp7.js} +3 -2
- package/src/models-B4IoTmp7.js.map +1 -0
- package/src/{models-BkMgeaOL.js → models-Bah5B3bT.js} +205 -51
- package/src/models-Bah5B3bT.js.map +1 -0
- package/src/runtime/blocks.js +22 -9
- package/src/runtime/blocks.js.map +1 -1
- package/src/runtime/collaboration.js.map +1 -1
- package/src/runtime/delivery/DocumentRenderer.js +7 -4
- package/src/runtime/delivery/DocumentRenderer.js.map +1 -1
- package/src/runtime/delivery/blocks.js +3 -1
- package/src/runtime/delivery/blocks.js.map +1 -1
- package/src/runtime/delivery/context.js +1 -1
- package/src/runtime/delivery/document-page.js +12 -12
- package/src/runtime/delivery/document-page.js.map +1 -1
- package/src/runtime/delivery/document.js +4 -2
- package/src/runtime/delivery/document.js.map +1 -1
- package/src/runtime/delivery/error.js.map +1 -1
- package/src/runtime/delivery/plugin.js +28 -2
- package/src/runtime/delivery/plugin.js.map +1 -1
- package/src/runtime/delivery/types.d.ts +5 -0
- package/src/runtime/delivery/useCmsDocumentSeo.d.ts +59 -0
- package/src/runtime/delivery/useCmsDocumentSeo.js +101 -0
- package/src/runtime/delivery/useCmsDocumentSeo.js.map +1 -0
- package/src/runtime/delivery/useDocument.js +2 -2
- package/src/runtime/delivery/useDocument.js.map +1 -1
- package/src/runtime/delivery/useDocumentQuery.js +2 -2
- package/src/runtime/delivery/useDocumentQuery.js.map +1 -1
- package/src/runtime/forms/document.js +38 -0
- package/src/runtime/forms/document.js.map +1 -0
- package/src/runtime/forms/useCmsForm.js +190 -0
- package/src/runtime/forms/useCmsForm.js.map +1 -0
- package/src/runtime/i18n/translator.js +51 -0
- package/src/runtime/i18n/translator.js.map +1 -0
- package/src/runtime/i18n/useCmsI18n.d.ts +11 -0
- package/src/runtime/i18n/useCmsI18n.js +37 -0
- package/src/runtime/i18n/useCmsI18n.js.map +1 -0
- package/src/runtime/installation.js +1 -1
- package/src/runtime/plugin.js +3 -3
- package/src/runtime/plugin.js.map +1 -1
- package/src/runtime/preview/comark-document.js +0 -1
- package/src/runtime/preview/comark-document.js.map +1 -1
- package/src/runtime/preview/connection.js +1 -1
- package/src/runtime/preview/controller.js +10 -3
- package/src/runtime/preview/controller.js.map +1 -1
- package/src/runtime/preview/overlay.js.map +1 -1
- package/src/runtime/preview/plugin.client.js +59 -48
- package/src/runtime/preview/plugin.client.js.map +1 -1
- package/src/runtime/preview/protocol.js.map +1 -1
- package/src/runtime/preview/store.js +1 -1
- package/src/runtime/preview/targets.js +0 -1
- package/src/runtime/preview/targets.js.map +1 -1
- package/src/runtime/sitemap-entries.js +17 -0
- package/src/runtime/sitemap-entries.js.map +1 -0
- package/src/runtime/sitemap.js +24 -0
- package/src/runtime/sitemap.js.map +1 -0
- package/src/runtime/studio-app.js.map +1 -1
- package/src/runtime/studio-entry.js +2 -2
- package/src/runtime/studio-entry.js.map +1 -1
- package/src/runtime/studio-navigation.js +1 -1
- package/src/scalars-B2lgGUnj.js +26 -0
- package/src/scalars-B2lgGUnj.js.map +1 -0
- package/src/{store-CfFFx9Ua.js → store-b2CSXgMt.js} +12 -7
- package/src/store-b2CSXgMt.js.map +1 -0
- package/studio/{CreateDocumentDialog--L9lTfx6.js → CreateDocumentDialog-GGey1uBc.js} +44 -44
- package/studio/{collaboration-DUuu678R.js → collaboration-DcK2F6v9.js} +7 -6
- package/studio/{documentPlanning-BXX04Woe.js → documentPlanning-DRErYmBU.js} +7340 -6469
- package/studio/{editor-PexnXkJY.js → editor-Bzlh3zXt.js} +7965 -7955
- package/studio/host.css +1 -1
- package/studio/host.js +10416 -7981
- package/src/Configuration-DyKo0sLS.js.map +0 -1
- package/src/DocumentEngine-DYObwMDY.js.map +0 -1
- package/src/HttpPaths-BbS21Jy8.js.map +0 -1
- package/src/StudioHttp-jR2-bc01.js +0 -718
- package/src/StudioHttp-jR2-bc01.js.map +0 -1
- package/src/connection-CBTY-TzB.js.map +0 -1
- package/src/installation-DeuBiFRE.js.map +0 -1
- package/src/location-DtYv2aes.js.map +0 -1
- package/src/metadata-DE1Mc2td.js.map +0 -1
- package/src/models-BkMgeaOL.js.map +0 -1
- package/src/models-C3witQBK.js.map +0 -1
- package/src/store-CfFFx9Ua.js.map +0 -1
|
@@ -1,718 +0,0 @@
|
|
|
1
|
-
import { c as STUDIO_API_PATH } from "./HttpPaths-BbS21Jy8.js";
|
|
2
|
-
import { A as RemoveDocumentInput, B as StudioActor, D as PublishedDocumentPage, E as PublishedDocumentLookup, F as AccessDenied, I as AuthenticationRequired, K as MediaCleanupReport, M as UndeleteDocumentInput, O as PublishedDocumentQuery, P as UpdateDocumentInput, Q as MediaInvalid, S as DuplicateDocumentInput, T as PublishDocumentInput, Tt as nonNegativeInt, V as StudioEntryDenied, W as MediaAsset, X as MediaId, Y as MediaFolder, Z as MediaIntegrityReport, _ as DocumentSource, _t as DocumentVersion, at as MediaReferenced, b as DocumentSurround, ct as MediaUpload, d as DocumentIssue, et as MediaNotFound, f as DocumentMutationResult, g as DocumentRevisionAction, gt as DocumentId, ht as DocumentHistoryCursor, i as CreateDocumentInput, j as RestoreDocumentInput, k as PublishedDocumentSurroundQuery, m as DocumentNavigationQuery, n as CmsMarkdownDocument, nt as MediaPage, o as DeletedDocument, p as DocumentNavigationItem, pt as RequestId, q as MediaConflict, r as CompiledDocument, rt as MediaQuery, s as DocumentBrowseQuery, st as MediaTooLarge, tt as MediaObjectKey, w as MoveDocumentInput, wt as SourcePath, x as DocumentValidationResult, xt as RevisionId, y as DocumentSummary, yt as PublicPath, z as Role } from "./models-BkMgeaOL.js";
|
|
3
|
-
import { i as MediaConfiguration, r as DocumentConfiguration } from "./Configuration-DyKo0sLS.js";
|
|
4
|
-
import { Context, Schema } from "effect";
|
|
5
|
-
import { Multipart } from "effect/unstable/http";
|
|
6
|
-
import { HttpApi, HttpApiEndpoint, HttpApiGroup, HttpApiMiddleware, HttpApiSchema } from "effect/unstable/httpapi";
|
|
7
|
-
|
|
8
|
-
//#region ../protocol/src/internal/documents/errors.ts
|
|
9
|
-
var DocumentNotFound = class extends Schema.TaggedError()("Document.NotFound", {
|
|
10
|
-
documentId: DocumentId,
|
|
11
|
-
revisionId: Schema.optionalKey(RevisionId)
|
|
12
|
-
}) {};
|
|
13
|
-
var DocumentPathConflict = class extends Schema.TaggedError()("Document.PathConflict", { sourcePath: SourcePath }) {};
|
|
14
|
-
var DocumentVersionConflict = class extends Schema.TaggedError()("Document.VersionConflict", {
|
|
15
|
-
documentId: DocumentId,
|
|
16
|
-
expectedVersion: DocumentVersion,
|
|
17
|
-
actualVersion: DocumentVersion
|
|
18
|
-
}) {};
|
|
19
|
-
var DocumentMediaUnavailable = class extends Schema.TaggedError()("Document.MediaUnavailable", {
|
|
20
|
-
documentId: DocumentId,
|
|
21
|
-
mediaKeys: Schema.Array(MediaObjectKey).check(Schema.isMinLength(1))
|
|
22
|
-
}) {};
|
|
23
|
-
var DocumentValidationFailed = class extends Schema.TaggedError()("Document.ValidationFailed", { issues: Schema.Array(DocumentIssue) }) {};
|
|
24
|
-
var PublishedDocumentNotFound = class extends Schema.TaggedError()("PublishedDocument.NotFound", { lookup: PublishedDocumentLookup }) {};
|
|
25
|
-
|
|
26
|
-
//#endregion
|
|
27
|
-
//#region ../protocol/src/Activity.ts
|
|
28
|
-
/**
|
|
29
|
-
* Immutable completed Activity facts. Pages are ordered newest-first; cursors are opaque,
|
|
30
|
-
* stable continuation tokens and an invalid cursor is a caller-visible failure.
|
|
31
|
-
*/
|
|
32
|
-
const ActivityId = Schema.String.check(Schema.isUUID()).pipe(Schema.brand("ActivityId"));
|
|
33
|
-
const ActivityCursor = Schema.NonEmptyString.pipe(Schema.brand("ActivityCursor"));
|
|
34
|
-
const ACTIVITY_ACTIONS = [
|
|
35
|
-
"document.created",
|
|
36
|
-
"document.updated",
|
|
37
|
-
"document.moved",
|
|
38
|
-
"document.trashed",
|
|
39
|
-
"document.revision.restored",
|
|
40
|
-
"document.untrashed",
|
|
41
|
-
"document.published",
|
|
42
|
-
"document.unpublished",
|
|
43
|
-
"media.uploaded",
|
|
44
|
-
"media.replaced",
|
|
45
|
-
"media.removed",
|
|
46
|
-
"media.cleaned",
|
|
47
|
-
"user.created",
|
|
48
|
-
"user.removed",
|
|
49
|
-
"user.role.changed",
|
|
50
|
-
"user.sessions.revoked",
|
|
51
|
-
"authentication.signed-in",
|
|
52
|
-
"authentication.signed-out",
|
|
53
|
-
"authentication.password.changed",
|
|
54
|
-
"authentication.password.reset"
|
|
55
|
-
];
|
|
56
|
-
const ActivityAction = Schema.Literals(ACTIVITY_ACTIONS);
|
|
57
|
-
const DocumentActivityTarget = Schema.Struct({
|
|
58
|
-
kind: Schema.tag("document"),
|
|
59
|
-
documentId: DocumentId
|
|
60
|
-
});
|
|
61
|
-
const MediaActivityTarget = Schema.Struct({
|
|
62
|
-
kind: Schema.tag("media"),
|
|
63
|
-
mediaId: MediaId
|
|
64
|
-
});
|
|
65
|
-
const MediaLibraryActivityTarget = Schema.Struct({ kind: Schema.tag("media-library") });
|
|
66
|
-
const ActivityTarget = Schema.Union([
|
|
67
|
-
DocumentActivityTarget,
|
|
68
|
-
MediaActivityTarget,
|
|
69
|
-
MediaLibraryActivityTarget,
|
|
70
|
-
Schema.Struct({
|
|
71
|
-
kind: Schema.tag("user"),
|
|
72
|
-
userId: Schema.NonEmptyString
|
|
73
|
-
})
|
|
74
|
-
]).pipe(Schema.toTaggedUnion("kind"));
|
|
75
|
-
const ActivityTargetKind = Schema.Literals([
|
|
76
|
-
"document",
|
|
77
|
-
"media",
|
|
78
|
-
"media-library",
|
|
79
|
-
"user"
|
|
80
|
-
]);
|
|
81
|
-
const ActivityContext = Schema.Struct({
|
|
82
|
-
actor: StudioActor,
|
|
83
|
-
requestId: RequestId,
|
|
84
|
-
reason: Schema.optionalKey(Schema.NonEmptyString.check(Schema.isMaxLength(1e3)))
|
|
85
|
-
}).annotate({ identifier: "ActivityContext" });
|
|
86
|
-
const ActivityEntry = Schema.Struct({
|
|
87
|
-
id: ActivityId,
|
|
88
|
-
action: ActivityAction,
|
|
89
|
-
actor: StudioActor,
|
|
90
|
-
requestId: RequestId,
|
|
91
|
-
reason: ActivityContext.fields.reason,
|
|
92
|
-
target: ActivityTarget,
|
|
93
|
-
details: Schema.JsonObject,
|
|
94
|
-
occurredAt: Schema.DateTimeUtcFromString
|
|
95
|
-
}).annotate({ identifier: "ActivityEntry" });
|
|
96
|
-
const ActivityEntryDraft = Schema.Struct({
|
|
97
|
-
action: ActivityAction,
|
|
98
|
-
context: ActivityContext,
|
|
99
|
-
target: ActivityTarget,
|
|
100
|
-
details: Schema.JsonObject
|
|
101
|
-
}).annotate({ identifier: "ActivityEntryDraft" });
|
|
102
|
-
const ActivityQuery = Schema.Struct({
|
|
103
|
-
action: Schema.optionalKey(ActivityAction),
|
|
104
|
-
actorId: Schema.optionalKey(StudioActor.fields.id),
|
|
105
|
-
cursor: Schema.optionalKey(ActivityCursor),
|
|
106
|
-
limit: Schema.optionalKey(Schema.Int.check(Schema.isBetween({
|
|
107
|
-
minimum: 1,
|
|
108
|
-
maximum: 100
|
|
109
|
-
}))),
|
|
110
|
-
requestId: Schema.optionalKey(RequestId),
|
|
111
|
-
targetId: Schema.optionalKey(Schema.NonEmptyString),
|
|
112
|
-
targetKind: Schema.optionalKey(ActivityTargetKind)
|
|
113
|
-
}).annotate({ identifier: "ActivityQuery" });
|
|
114
|
-
const ActivityPage = Schema.Struct({
|
|
115
|
-
entries: Schema.Array(ActivityEntry),
|
|
116
|
-
nextCursor: Schema.optionalKey(ActivityCursor),
|
|
117
|
-
total: nonNegativeInt
|
|
118
|
-
}).annotate({ identifier: "ActivityPage" });
|
|
119
|
-
var ActivityCursorInvalid = class extends Schema.TaggedError()("Activity.CursorInvalid", {}) {};
|
|
120
|
-
|
|
121
|
-
//#endregion
|
|
122
|
-
//#region ../protocol/src/internal/documents/history.ts
|
|
123
|
-
const DocumentRevisionSummary = Schema.Struct({
|
|
124
|
-
action: DocumentRevisionAction,
|
|
125
|
-
activity: ActivityEntry,
|
|
126
|
-
createdAt: Schema.DateTimeUtcFromString,
|
|
127
|
-
documentId: DocumentId,
|
|
128
|
-
revisionId: RevisionId,
|
|
129
|
-
sourcePath: SourcePath,
|
|
130
|
-
version: DocumentVersion
|
|
131
|
-
}).annotate({ identifier: "DocumentRevisionSummary" });
|
|
132
|
-
const DocumentRevision = Schema.Struct({
|
|
133
|
-
...DocumentRevisionSummary.fields,
|
|
134
|
-
markdown: Schema.String
|
|
135
|
-
}).annotate({ identifier: "DocumentRevision" });
|
|
136
|
-
const DocumentHistoryQuery = Schema.Struct({
|
|
137
|
-
documentId: DocumentId,
|
|
138
|
-
cursor: Schema.optionalKey(DocumentHistoryCursor),
|
|
139
|
-
limit: Schema.optionalKey(Schema.Int.check(Schema.isBetween({
|
|
140
|
-
minimum: 1,
|
|
141
|
-
maximum: 100
|
|
142
|
-
})))
|
|
143
|
-
}).annotate({ identifier: "DocumentHistoryQuery" });
|
|
144
|
-
const DocumentRevisionPage = Schema.Struct({
|
|
145
|
-
revisions: Schema.Array(DocumentRevisionSummary),
|
|
146
|
-
nextCursor: Schema.optionalKey(DocumentHistoryCursor),
|
|
147
|
-
total: nonNegativeInt
|
|
148
|
-
}).annotate({ identifier: "DocumentRevisionPage" });
|
|
149
|
-
const LineNumber = Schema.Int.check(Schema.isGreaterThan(0));
|
|
150
|
-
const DocumentRevisionChange = Schema.Union([
|
|
151
|
-
Schema.Struct({
|
|
152
|
-
kind: Schema.tag("equal"),
|
|
153
|
-
beforeLine: LineNumber,
|
|
154
|
-
afterLine: LineNumber,
|
|
155
|
-
line: Schema.String
|
|
156
|
-
}),
|
|
157
|
-
Schema.Struct({
|
|
158
|
-
kind: Schema.tag("added"),
|
|
159
|
-
afterLine: LineNumber,
|
|
160
|
-
line: Schema.String
|
|
161
|
-
}),
|
|
162
|
-
Schema.Struct({
|
|
163
|
-
kind: Schema.tag("removed"),
|
|
164
|
-
beforeLine: LineNumber,
|
|
165
|
-
line: Schema.String
|
|
166
|
-
})
|
|
167
|
-
]).pipe(Schema.toTaggedUnion("kind"));
|
|
168
|
-
const CompareDocumentRevisionsInput = Schema.Struct({
|
|
169
|
-
documentId: DocumentId,
|
|
170
|
-
fromRevisionId: RevisionId,
|
|
171
|
-
toRevisionId: RevisionId
|
|
172
|
-
}).annotate({ identifier: "CompareDocumentRevisionsInput" });
|
|
173
|
-
const DocumentRevisionComparison = Schema.Struct({
|
|
174
|
-
from: DocumentRevision,
|
|
175
|
-
to: DocumentRevision,
|
|
176
|
-
changes: Schema.Array(DocumentRevisionChange)
|
|
177
|
-
}).annotate({ identifier: "DocumentRevisionComparison" });
|
|
178
|
-
var DocumentHistoryInvalidCursor = class extends Schema.TaggedError()("DocumentHistory.InvalidCursor", {}) {};
|
|
179
|
-
var DocumentHistoryComparisonTooLarge = class extends Schema.TaggedError()("DocumentHistory.ComparisonTooLarge", {
|
|
180
|
-
maximumEditLength: Schema.Int.check(Schema.isGreaterThan(0)),
|
|
181
|
-
maximumLines: Schema.Int.check(Schema.isGreaterThan(0))
|
|
182
|
-
}) {};
|
|
183
|
-
|
|
184
|
-
//#endregion
|
|
185
|
-
//#region ../protocol/src/Collaboration.ts
|
|
186
|
-
/**
|
|
187
|
-
* Collaboration handshake and WebSocket envelopes. Command results correlate by RequestId;
|
|
188
|
-
* checkpoints carry the durable state vector needed for retry and recovery.
|
|
189
|
-
*/
|
|
190
|
-
const StateVector = Schema.String.check(Schema.isBase64()).pipe(Schema.brand("StateVector"));
|
|
191
|
-
const HttpErrorStatus = Schema.Int.check(Schema.isBetween({
|
|
192
|
-
minimum: 400,
|
|
193
|
-
maximum: 599
|
|
194
|
-
}));
|
|
195
|
-
const CollaborationUser = Schema.Struct({
|
|
196
|
-
color: Schema.NonEmptyString,
|
|
197
|
-
id: Schema.NonEmptyString,
|
|
198
|
-
name: Schema.NonEmptyString
|
|
199
|
-
});
|
|
200
|
-
const CollaborationTicket = Schema.Struct({
|
|
201
|
-
authoringRevision: Schema.NonEmptyString,
|
|
202
|
-
authoredStateVector: StateVector,
|
|
203
|
-
documentName: Schema.NonEmptyString,
|
|
204
|
-
source: DocumentSource,
|
|
205
|
-
token: Schema.NonEmptyString,
|
|
206
|
-
url: Schema.NonEmptyString,
|
|
207
|
-
user: CollaborationUser,
|
|
208
|
-
workingStateVector: StateVector
|
|
209
|
-
}).annotate({ identifier: "CollaborationTicket" });
|
|
210
|
-
const CollaborationPreview = DocumentValidationResult.pipe(Schema.fieldsAssign({
|
|
211
|
-
markdown: Schema.String,
|
|
212
|
-
preview: Schema.Struct({
|
|
213
|
-
body: CmsMarkdownDocument,
|
|
214
|
-
fallbacks: Schema.Record(Schema.String, Schema.String)
|
|
215
|
-
})
|
|
216
|
-
})).annotate({ identifier: "CollaborationPreview" });
|
|
217
|
-
const CheckpointMessage = Schema.Struct({ type: Schema.tag("checkpoint") });
|
|
218
|
-
const PreviewMessage = Schema.Struct({
|
|
219
|
-
type: Schema.tag("preview"),
|
|
220
|
-
requestId: RequestId
|
|
221
|
-
});
|
|
222
|
-
const PublishMessage = Schema.Struct({
|
|
223
|
-
type: Schema.tag("publish"),
|
|
224
|
-
requestId: RequestId
|
|
225
|
-
});
|
|
226
|
-
const CollaborationClientMessage = Schema.Union([
|
|
227
|
-
CheckpointMessage,
|
|
228
|
-
PreviewMessage,
|
|
229
|
-
PublishMessage
|
|
230
|
-
]).pipe(Schema.toTaggedUnion("type"));
|
|
231
|
-
const requestFailure = {
|
|
232
|
-
error: Schema.NonEmptyString,
|
|
233
|
-
statusCode: HttpErrorStatus
|
|
234
|
-
};
|
|
235
|
-
const RequestFailure = Schema.Struct({
|
|
236
|
-
status: Schema.tag("failure"),
|
|
237
|
-
...requestFailure
|
|
238
|
-
});
|
|
239
|
-
const PreviewOutcome = Schema.Union([Schema.Struct({
|
|
240
|
-
status: Schema.tag("success"),
|
|
241
|
-
result: CollaborationPreview
|
|
242
|
-
}), RequestFailure]).pipe(Schema.toTaggedUnion("status"));
|
|
243
|
-
const PublishCheckpoint = Schema.Struct({
|
|
244
|
-
authoredStateVector: StateVector,
|
|
245
|
-
result: Schema.optionalKey(DocumentMutationResult)
|
|
246
|
-
});
|
|
247
|
-
const PublishOutcome = Schema.Union([Schema.Struct({
|
|
248
|
-
status: Schema.tag("success"),
|
|
249
|
-
authoredStateVector: StateVector,
|
|
250
|
-
result: DocumentMutationResult
|
|
251
|
-
}), Schema.Struct({
|
|
252
|
-
status: Schema.tag("failure"),
|
|
253
|
-
...requestFailure,
|
|
254
|
-
checkpoint: Schema.optionalKey(PublishCheckpoint)
|
|
255
|
-
})]).pipe(Schema.toTaggedUnion("status"));
|
|
256
|
-
const WorkingSavedMessage = Schema.Struct({
|
|
257
|
-
type: Schema.tag("working-saved"),
|
|
258
|
-
workingStateVector: StateVector
|
|
259
|
-
});
|
|
260
|
-
const WorkingSaveErrorMessage = Schema.Struct({
|
|
261
|
-
type: Schema.tag("working-save-error"),
|
|
262
|
-
error: Schema.NonEmptyString
|
|
263
|
-
});
|
|
264
|
-
const PreviewResultMessage = Schema.Struct({
|
|
265
|
-
type: Schema.tag("preview-result"),
|
|
266
|
-
requestId: RequestId,
|
|
267
|
-
outcome: PreviewOutcome
|
|
268
|
-
});
|
|
269
|
-
const PublishResultMessage = Schema.Struct({
|
|
270
|
-
type: Schema.tag("publish-result"),
|
|
271
|
-
requestId: RequestId,
|
|
272
|
-
outcome: PublishOutcome
|
|
273
|
-
});
|
|
274
|
-
const CollaborationServerMessage = Schema.Union([
|
|
275
|
-
WorkingSavedMessage,
|
|
276
|
-
WorkingSaveErrorMessage,
|
|
277
|
-
PreviewResultMessage,
|
|
278
|
-
PublishResultMessage
|
|
279
|
-
]).pipe(Schema.toTaggedUnion("type"));
|
|
280
|
-
|
|
281
|
-
//#endregion
|
|
282
|
-
//#region ../protocol/src/Users.ts
|
|
283
|
-
/**
|
|
284
|
-
* User administration inputs, offset-paginated directory results, and caller-visible command
|
|
285
|
-
* failures. Commands carry no idempotency key; clients resolve ambiguous outcomes by listing again.
|
|
286
|
-
*/
|
|
287
|
-
const UserEmail = Schema.NonEmptyString.check(Schema.isMaxLength(320), Schema.isPattern(/^[^\s@]+@[^\s@]+\.[^\s@]+$/u)).annotate({ identifier: "UserEmail" });
|
|
288
|
-
const UserName = Schema.NonEmptyString.check(Schema.isMaxLength(200)).annotate({ identifier: "UserName" });
|
|
289
|
-
const UserPassword = Schema.NonEmptyString.check(Schema.isMinLength(8), Schema.isMaxLength(200)).annotate({ identifier: "UserPassword" });
|
|
290
|
-
const User = Schema.Struct({
|
|
291
|
-
id: Schema.NonEmptyString,
|
|
292
|
-
email: UserEmail,
|
|
293
|
-
name: UserName,
|
|
294
|
-
role: Role,
|
|
295
|
-
emailVerified: Schema.Boolean,
|
|
296
|
-
banned: Schema.Boolean,
|
|
297
|
-
createdAt: Schema.DateTimeUtcFromString,
|
|
298
|
-
updatedAt: Schema.DateTimeUtcFromString
|
|
299
|
-
}).annotate({ identifier: "User" });
|
|
300
|
-
const UserPage = Schema.Struct({
|
|
301
|
-
users: Schema.Array(User),
|
|
302
|
-
total: nonNegativeInt
|
|
303
|
-
}).annotate({ identifier: "UserPage" });
|
|
304
|
-
const UserQuery = Schema.Struct({
|
|
305
|
-
limit: Schema.optionalKey(Schema.Int.check(Schema.isBetween({
|
|
306
|
-
minimum: 1,
|
|
307
|
-
maximum: 100
|
|
308
|
-
}))),
|
|
309
|
-
offset: Schema.optionalKey(nonNegativeInt),
|
|
310
|
-
search: Schema.optionalKey(Schema.NonEmptyString.check(Schema.isMaxLength(200)))
|
|
311
|
-
}).annotate({ identifier: "UserQuery" });
|
|
312
|
-
const CreateUserInput = Schema.Struct({
|
|
313
|
-
email: UserEmail,
|
|
314
|
-
name: UserName,
|
|
315
|
-
password: UserPassword,
|
|
316
|
-
role: Role
|
|
317
|
-
}).annotate({ identifier: "CreateUserInput" });
|
|
318
|
-
var UserAlreadyExists = class extends Schema.TaggedError()("User.AlreadyExists", { email: UserEmail }) {};
|
|
319
|
-
var UserNotFound = class extends Schema.TaggedError()("User.NotFound", { userId: User.fields.id }) {};
|
|
320
|
-
var UserSelfRemovalDenied = class extends Schema.TaggedError()("User.SelfRemovalDenied", { userId: User.fields.id }) {};
|
|
321
|
-
var UserSelfRoleChangeDenied = class extends Schema.TaggedError()("User.SelfRoleChangeDenied", { userId: User.fields.id }) {};
|
|
322
|
-
var UserAdministrationDenied = class extends Schema.TaggedError()("UserAdministration.Denied", {}) {};
|
|
323
|
-
|
|
324
|
-
//#endregion
|
|
325
|
-
//#region ../protocol/src/Initialization.ts
|
|
326
|
-
/** Exclusive first-installation claim input, state, and caller-visible rejection failures. */
|
|
327
|
-
const InitializationInput = Schema.Struct({
|
|
328
|
-
email: UserEmail,
|
|
329
|
-
initializationToken: Schema.NonEmptyString.check(Schema.isMaxLength(512)),
|
|
330
|
-
name: UserName,
|
|
331
|
-
password: UserPassword
|
|
332
|
-
}).annotate({ identifier: "InitializationInput" });
|
|
333
|
-
const InitializationState = Schema.Struct({ needsAdministrator: Schema.Boolean }).annotate({ identifier: "InitializationState" });
|
|
334
|
-
var InitializationAlreadyCompleted = class extends Schema.TaggedError()("Initialization.AlreadyCompleted", {}) {};
|
|
335
|
-
var InitializationProofInvalid = class extends Schema.TaggedError()("Initialization.ProofInvalid", {}) {};
|
|
336
|
-
|
|
337
|
-
//#endregion
|
|
338
|
-
//#region ../protocol/src/internal/http/failures.ts
|
|
339
|
-
var StudioInternalError = class extends Schema.TaggedError()("Studio.InternalError", { message: Schema.Literal("The request could not be completed.") }) {};
|
|
340
|
-
function studioInternalError() {
|
|
341
|
-
return new StudioInternalError({ message: "The request could not be completed." });
|
|
342
|
-
}
|
|
343
|
-
|
|
344
|
-
//#endregion
|
|
345
|
-
//#region ../protocol/src/internal/http/delivery.ts
|
|
346
|
-
const DeliverySurroundPayload = Schema.Struct({
|
|
347
|
-
lookup: PublishedDocumentLookup,
|
|
348
|
-
query: PublishedDocumentSurroundQuery
|
|
349
|
-
}).annotate({ identifier: "DeliverySurroundPayload" });
|
|
350
|
-
const InternalError$1 = StudioInternalError.pipe(HttpApiSchema.status(500));
|
|
351
|
-
const PublishedNotFound = PublishedDocumentNotFound.pipe(HttpApiSchema.status(404));
|
|
352
|
-
const Forbidden$1 = AccessDenied.pipe(HttpApiSchema.status(403));
|
|
353
|
-
const PublishedDeliveryApi = HttpApiGroup.make("delivery").add(HttpApiEndpoint.post("read", "/read", {
|
|
354
|
-
payload: PublishedDocumentLookup,
|
|
355
|
-
success: CompiledDocument,
|
|
356
|
-
error: [PublishedNotFound, InternalError$1]
|
|
357
|
-
}), HttpApiEndpoint.post("query", "/query", {
|
|
358
|
-
payload: PublishedDocumentQuery,
|
|
359
|
-
success: PublishedDocumentPage,
|
|
360
|
-
error: InternalError$1
|
|
361
|
-
}), HttpApiEndpoint.post("navigation", "/navigation", {
|
|
362
|
-
payload: DocumentNavigationQuery,
|
|
363
|
-
success: Schema.Array(DocumentNavigationItem),
|
|
364
|
-
error: InternalError$1
|
|
365
|
-
}), HttpApiEndpoint.post("surround", "/surround", {
|
|
366
|
-
payload: DeliverySurroundPayload,
|
|
367
|
-
success: DocumentSurround,
|
|
368
|
-
error: [PublishedNotFound, InternalError$1]
|
|
369
|
-
})).prefix("/delivery");
|
|
370
|
-
const PreviewDeliveryApi = HttpApiGroup.make("previewDelivery").add(HttpApiEndpoint.post("read", "/read", {
|
|
371
|
-
payload: PublishedDocumentLookup,
|
|
372
|
-
success: CompiledDocument,
|
|
373
|
-
error: [
|
|
374
|
-
PublishedNotFound,
|
|
375
|
-
InternalError$1,
|
|
376
|
-
Forbidden$1
|
|
377
|
-
]
|
|
378
|
-
}), HttpApiEndpoint.post("query", "/query", {
|
|
379
|
-
payload: PublishedDocumentQuery,
|
|
380
|
-
success: PublishedDocumentPage,
|
|
381
|
-
error: [InternalError$1, Forbidden$1]
|
|
382
|
-
}), HttpApiEndpoint.post("navigation", "/navigation", {
|
|
383
|
-
payload: DocumentNavigationQuery,
|
|
384
|
-
success: Schema.Array(DocumentNavigationItem),
|
|
385
|
-
error: [InternalError$1, Forbidden$1]
|
|
386
|
-
}), HttpApiEndpoint.post("surround", "/surround", {
|
|
387
|
-
payload: DeliverySurroundPayload,
|
|
388
|
-
success: DocumentSurround,
|
|
389
|
-
error: [
|
|
390
|
-
PublishedNotFound,
|
|
391
|
-
InternalError$1,
|
|
392
|
-
Forbidden$1
|
|
393
|
-
]
|
|
394
|
-
})).prefix("/preview");
|
|
395
|
-
|
|
396
|
-
//#endregion
|
|
397
|
-
//#region ../protocol/src/StudioHttp.ts
|
|
398
|
-
/**
|
|
399
|
-
* Studio HTTP paths, middleware contracts, payloads, and the composed CMS API. Every expected
|
|
400
|
-
* caller failure is a tagged schema with an explicit status; unclassified failures become the
|
|
401
|
-
* deliberately opaque `StudioInternalError`.
|
|
402
|
-
*/
|
|
403
|
-
const ApiVersion = Schema.NonEmptyString.pipe(Schema.brand("ApiVersion"));
|
|
404
|
-
const StudioBootstrap = Schema.Struct({
|
|
405
|
-
basePath: PublicPath,
|
|
406
|
-
documents: DocumentConfiguration,
|
|
407
|
-
media: MediaConfiguration,
|
|
408
|
-
version: ApiVersion
|
|
409
|
-
}).annotate({ identifier: "StudioBootstrap" });
|
|
410
|
-
var StudioBadRequest = class extends Schema.TaggedError()("Studio.BadRequest", { kind: Schema.Literals([
|
|
411
|
-
"Headers",
|
|
412
|
-
"Params",
|
|
413
|
-
"Payload",
|
|
414
|
-
"Query"
|
|
415
|
-
]) }) {};
|
|
416
|
-
var StudioRequestConflict = class extends Schema.TaggedError()("Studio.RequestConflict", { retryable: Schema.Literal(true) }) {};
|
|
417
|
-
var StudioSchemaError = class extends HttpApiMiddleware.Service()("@internal/protocol/StudioSchemaError", { error: [StudioBadRequest.pipe(HttpApiSchema.status(400)), StudioInternalError.pipe(HttpApiSchema.status(500))] }) {};
|
|
418
|
-
var CurrentStudioRequest = class extends Context.Service()("@internal/protocol/CurrentStudioRequest") {};
|
|
419
|
-
var StudioAuthentication = class extends HttpApiMiddleware.Service()("@internal/protocol/StudioAuthentication", { error: [
|
|
420
|
-
AuthenticationRequired.pipe(HttpApiSchema.status(401)),
|
|
421
|
-
StudioEntryDenied.pipe(HttpApiSchema.status(403)),
|
|
422
|
-
StudioInternalError.pipe(HttpApiSchema.status(500))
|
|
423
|
-
] }) {};
|
|
424
|
-
const UpdateDocumentPayload = Schema.Struct({
|
|
425
|
-
expectedVersion: UpdateDocumentInput.fields.expectedVersion,
|
|
426
|
-
markdown: UpdateDocumentInput.fields.markdown
|
|
427
|
-
});
|
|
428
|
-
const MoveDocumentPayload = Schema.Struct({
|
|
429
|
-
expectedVersion: MoveDocumentInput.fields.expectedVersion,
|
|
430
|
-
location: MoveDocumentInput.fields.location
|
|
431
|
-
});
|
|
432
|
-
const PublishDocumentPayload = Schema.Struct({ expectedVersion: PublishDocumentInput.fields.expectedVersion });
|
|
433
|
-
const RemoveDocumentPayload = Schema.Struct({ expectedVersion: RemoveDocumentInput.fields.expectedVersion });
|
|
434
|
-
const RestoreDocumentPayload = Schema.Struct({
|
|
435
|
-
expectedVersion: RestoreDocumentInput.fields.expectedVersion,
|
|
436
|
-
revisionId: RestoreDocumentInput.fields.revisionId
|
|
437
|
-
});
|
|
438
|
-
const UndeleteDocumentPayload = Schema.Struct({ expectedVersion: UndeleteDocumentInput.fields.expectedVersion });
|
|
439
|
-
const ChangeRolePayload = Schema.Struct({ role: Role }).annotate({ identifier: "ChangeRolePayload" });
|
|
440
|
-
const MediaUploadQuery = Schema.Struct({
|
|
441
|
-
declaredByteSize: MediaUpload.fields.declaredByteSize,
|
|
442
|
-
folder: Schema.optionalKey(MediaFolder)
|
|
443
|
-
}).annotate({ identifier: "MediaUploadQuery" });
|
|
444
|
-
const MediaUploadPayload = Schema.Struct({ file: Multipart.SingleFileSchema }).pipe(HttpApiSchema.asMultipartStream({ maxParts: 1 }));
|
|
445
|
-
const NotFound = DocumentNotFound.pipe(HttpApiSchema.status(404));
|
|
446
|
-
const VersionConflict = DocumentVersionConflict.pipe(HttpApiSchema.status(409));
|
|
447
|
-
const Conflict = Schema.Union([
|
|
448
|
-
DocumentMediaUnavailable,
|
|
449
|
-
DocumentPathConflict,
|
|
450
|
-
DocumentVersionConflict
|
|
451
|
-
]).pipe(HttpApiSchema.status(409));
|
|
452
|
-
const ValidationFailed = DocumentValidationFailed.pipe(HttpApiSchema.status(422));
|
|
453
|
-
const RequestConflict = StudioRequestConflict.pipe(HttpApiSchema.status(409));
|
|
454
|
-
const InternalError = StudioInternalError.pipe(HttpApiSchema.status(500));
|
|
455
|
-
const Forbidden = AccessDenied.pipe(HttpApiSchema.status(403));
|
|
456
|
-
const MutationErrors = [
|
|
457
|
-
NotFound,
|
|
458
|
-
Conflict,
|
|
459
|
-
ValidationFailed,
|
|
460
|
-
RequestConflict,
|
|
461
|
-
Forbidden,
|
|
462
|
-
InternalError
|
|
463
|
-
];
|
|
464
|
-
const MediaNotFoundResponse = MediaNotFound.pipe(HttpApiSchema.status(404));
|
|
465
|
-
const MediaInvalidQuery = MediaInvalid.pipe(HttpApiSchema.status(400));
|
|
466
|
-
const MediaInvalidUpload = MediaInvalid.pipe(HttpApiSchema.status(422));
|
|
467
|
-
const MediaTooLargeResponse = MediaTooLarge.pipe(HttpApiSchema.status(413));
|
|
468
|
-
const MediaReferencedResponse = MediaReferenced.pipe(HttpApiSchema.status(409));
|
|
469
|
-
const MediaConflictResponse = MediaConflict.pipe(HttpApiSchema.status(409));
|
|
470
|
-
const InvalidActivityCursor = ActivityCursorInvalid.pipe(HttpApiSchema.status(400));
|
|
471
|
-
const InvalidHistoryCursor = DocumentHistoryInvalidCursor.pipe(HttpApiSchema.status(400));
|
|
472
|
-
const HistoryComparisonTooLarge = DocumentHistoryComparisonTooLarge.pipe(HttpApiSchema.status(422));
|
|
473
|
-
const AlreadyInitialized = InitializationAlreadyCompleted.pipe(HttpApiSchema.status(409));
|
|
474
|
-
const InitializationProofRejected = InitializationProofInvalid.pipe(HttpApiSchema.status(403));
|
|
475
|
-
const UserAdministrationForbidden = UserAdministrationDenied.pipe(HttpApiSchema.status(403));
|
|
476
|
-
const UserDuplicate = UserAlreadyExists.pipe(HttpApiSchema.status(409));
|
|
477
|
-
const MissingUser = UserNotFound.pipe(HttpApiSchema.status(404));
|
|
478
|
-
const UserSelfRemoval = UserSelfRemovalDenied.pipe(HttpApiSchema.status(409));
|
|
479
|
-
const UserSelfRoleChange = UserSelfRoleChangeDenied.pipe(HttpApiSchema.status(409));
|
|
480
|
-
const StudioDocumentsApi = HttpApiGroup.make("documents").add(HttpApiEndpoint.get("browse", "/", {
|
|
481
|
-
query: DocumentBrowseQuery,
|
|
482
|
-
success: Schema.Array(DocumentSummary),
|
|
483
|
-
error: [Forbidden, InternalError]
|
|
484
|
-
}), HttpApiEndpoint.get("trash", "/trash", {
|
|
485
|
-
success: Schema.Array(DeletedDocument),
|
|
486
|
-
error: [Forbidden, InternalError]
|
|
487
|
-
}), HttpApiEndpoint.get("read", "/:documentId", {
|
|
488
|
-
params: { documentId: DocumentId },
|
|
489
|
-
success: DocumentSource,
|
|
490
|
-
error: [
|
|
491
|
-
NotFound,
|
|
492
|
-
Forbidden,
|
|
493
|
-
InternalError
|
|
494
|
-
]
|
|
495
|
-
}), HttpApiEndpoint.post("create", "/", {
|
|
496
|
-
payload: CreateDocumentInput,
|
|
497
|
-
success: DocumentMutationResult.pipe(HttpApiSchema.status(201)),
|
|
498
|
-
error: MutationErrors
|
|
499
|
-
}), HttpApiEndpoint.put("update", "/:documentId", {
|
|
500
|
-
params: { documentId: DocumentId },
|
|
501
|
-
payload: UpdateDocumentPayload,
|
|
502
|
-
success: DocumentMutationResult,
|
|
503
|
-
error: MutationErrors
|
|
504
|
-
}), HttpApiEndpoint.post("validate", "/:documentId/validate", {
|
|
505
|
-
params: { documentId: DocumentId },
|
|
506
|
-
payload: UpdateDocumentPayload,
|
|
507
|
-
success: DocumentValidationResult,
|
|
508
|
-
error: [
|
|
509
|
-
NotFound,
|
|
510
|
-
VersionConflict,
|
|
511
|
-
Forbidden,
|
|
512
|
-
InternalError
|
|
513
|
-
]
|
|
514
|
-
}), HttpApiEndpoint.post("move", "/:documentId/move", {
|
|
515
|
-
params: { documentId: DocumentId },
|
|
516
|
-
payload: MoveDocumentPayload,
|
|
517
|
-
success: DocumentMutationResult,
|
|
518
|
-
error: MutationErrors
|
|
519
|
-
}), HttpApiEndpoint.post("duplicate", "/:documentId/duplicate", {
|
|
520
|
-
params: { documentId: DocumentId },
|
|
521
|
-
payload: Schema.Struct({
|
|
522
|
-
...MoveDocumentPayload.fields,
|
|
523
|
-
includeChildren: DuplicateDocumentInput.fields.includeChildren
|
|
524
|
-
}),
|
|
525
|
-
success: DocumentMutationResult,
|
|
526
|
-
error: MutationErrors
|
|
527
|
-
}), HttpApiEndpoint.post("unpublish", "/:documentId/unpublish", {
|
|
528
|
-
params: { documentId: DocumentId },
|
|
529
|
-
payload: PublishDocumentPayload,
|
|
530
|
-
success: DocumentMutationResult,
|
|
531
|
-
error: MutationErrors
|
|
532
|
-
}), HttpApiEndpoint.post("publish", "/:documentId/publish", {
|
|
533
|
-
params: { documentId: DocumentId },
|
|
534
|
-
payload: PublishDocumentPayload,
|
|
535
|
-
success: DocumentMutationResult,
|
|
536
|
-
error: MutationErrors
|
|
537
|
-
}), HttpApiEndpoint.post("remove", "/:documentId/remove", {
|
|
538
|
-
params: { documentId: DocumentId },
|
|
539
|
-
payload: RemoveDocumentPayload,
|
|
540
|
-
success: DocumentMutationResult,
|
|
541
|
-
error: MutationErrors
|
|
542
|
-
}), HttpApiEndpoint.post("restore", "/:documentId/restore", {
|
|
543
|
-
params: { documentId: DocumentId },
|
|
544
|
-
payload: RestoreDocumentPayload,
|
|
545
|
-
success: DocumentMutationResult,
|
|
546
|
-
error: MutationErrors
|
|
547
|
-
}), HttpApiEndpoint.post("undelete", "/:documentId/undelete", {
|
|
548
|
-
params: { documentId: DocumentId },
|
|
549
|
-
payload: UndeleteDocumentPayload,
|
|
550
|
-
success: DocumentMutationResult,
|
|
551
|
-
error: MutationErrors
|
|
552
|
-
})).middleware(StudioAuthentication).prefix("/documents");
|
|
553
|
-
const StudioMediaApi = HttpApiGroup.make("media").add(HttpApiEndpoint.get("search", "/", {
|
|
554
|
-
query: MediaQuery,
|
|
555
|
-
success: MediaPage,
|
|
556
|
-
error: [
|
|
557
|
-
MediaInvalidQuery,
|
|
558
|
-
Forbidden,
|
|
559
|
-
InternalError
|
|
560
|
-
]
|
|
561
|
-
}), HttpApiEndpoint.post("upload", "/", {
|
|
562
|
-
query: MediaUploadQuery,
|
|
563
|
-
payload: MediaUploadPayload,
|
|
564
|
-
success: MediaAsset.pipe(HttpApiSchema.status(201)),
|
|
565
|
-
error: [
|
|
566
|
-
MediaInvalidUpload,
|
|
567
|
-
MediaTooLargeResponse,
|
|
568
|
-
Forbidden,
|
|
569
|
-
InternalError
|
|
570
|
-
]
|
|
571
|
-
}), HttpApiEndpoint.put("replace", "/:mediaId", {
|
|
572
|
-
params: { mediaId: MediaId },
|
|
573
|
-
query: MediaUploadQuery,
|
|
574
|
-
payload: MediaUploadPayload,
|
|
575
|
-
success: MediaAsset,
|
|
576
|
-
error: [
|
|
577
|
-
MediaNotFoundResponse,
|
|
578
|
-
MediaConflictResponse,
|
|
579
|
-
MediaInvalidUpload,
|
|
580
|
-
MediaTooLargeResponse,
|
|
581
|
-
Forbidden,
|
|
582
|
-
InternalError
|
|
583
|
-
]
|
|
584
|
-
}), HttpApiEndpoint.post("cleanup", "/cleanup", {
|
|
585
|
-
success: MediaCleanupReport,
|
|
586
|
-
error: [Forbidden, InternalError]
|
|
587
|
-
}), HttpApiEndpoint.get("integrity", "/integrity", {
|
|
588
|
-
success: MediaIntegrityReport,
|
|
589
|
-
error: [Forbidden, InternalError]
|
|
590
|
-
}), HttpApiEndpoint.get("get", "/:mediaId", {
|
|
591
|
-
params: { mediaId: MediaId },
|
|
592
|
-
success: MediaAsset,
|
|
593
|
-
error: [
|
|
594
|
-
MediaNotFoundResponse,
|
|
595
|
-
Forbidden,
|
|
596
|
-
InternalError
|
|
597
|
-
]
|
|
598
|
-
}), HttpApiEndpoint.delete("remove", "/:mediaId", {
|
|
599
|
-
params: { mediaId: MediaId },
|
|
600
|
-
success: HttpApiSchema.NoContent,
|
|
601
|
-
error: [
|
|
602
|
-
MediaNotFoundResponse,
|
|
603
|
-
MediaConflictResponse,
|
|
604
|
-
MediaReferencedResponse,
|
|
605
|
-
Forbidden,
|
|
606
|
-
InternalError
|
|
607
|
-
]
|
|
608
|
-
})).middleware(StudioAuthentication).prefix("/media");
|
|
609
|
-
const StudioConfigurationApi = HttpApiGroup.make("configuration").add(HttpApiEndpoint.get("bootstrap", "/bootstrap", { success: StudioBootstrap })).middleware(StudioAuthentication);
|
|
610
|
-
const StudioSessionApi = HttpApiGroup.make("session").add(HttpApiEndpoint.get("current", "/session", { success: StudioActor })).middleware(StudioAuthentication);
|
|
611
|
-
const InitializationApi = HttpApiGroup.make("initialization").add(HttpApiEndpoint.get("status", "/initialization", {
|
|
612
|
-
success: InitializationState,
|
|
613
|
-
error: InternalError
|
|
614
|
-
}), HttpApiEndpoint.post("claim", "/initialization", {
|
|
615
|
-
payload: InitializationInput,
|
|
616
|
-
success: User.pipe(HttpApiSchema.status(201)),
|
|
617
|
-
error: [
|
|
618
|
-
AlreadyInitialized,
|
|
619
|
-
InitializationProofRejected,
|
|
620
|
-
InternalError
|
|
621
|
-
]
|
|
622
|
-
}));
|
|
623
|
-
const StudioDiagnosticsApi = HttpApiGroup.make("diagnostics").add(HttpApiEndpoint.get("documents", "/diagnostics/documents", {
|
|
624
|
-
success: Schema.Array(DocumentIssue),
|
|
625
|
-
error: [Forbidden, InternalError]
|
|
626
|
-
})).middleware(StudioAuthentication);
|
|
627
|
-
const StudioHistoryApi = HttpApiGroup.make("history").add(HttpApiEndpoint.get("list", "/", {
|
|
628
|
-
query: DocumentHistoryQuery,
|
|
629
|
-
success: DocumentRevisionPage,
|
|
630
|
-
error: [
|
|
631
|
-
InvalidHistoryCursor,
|
|
632
|
-
Forbidden,
|
|
633
|
-
InternalError
|
|
634
|
-
]
|
|
635
|
-
}), HttpApiEndpoint.get("read", "/:documentId/:revisionId", {
|
|
636
|
-
params: {
|
|
637
|
-
documentId: DocumentId,
|
|
638
|
-
revisionId: DocumentRevision.fields.revisionId
|
|
639
|
-
},
|
|
640
|
-
success: DocumentRevision,
|
|
641
|
-
error: [
|
|
642
|
-
NotFound,
|
|
643
|
-
Forbidden,
|
|
644
|
-
InternalError
|
|
645
|
-
]
|
|
646
|
-
}), HttpApiEndpoint.post("compare", "/compare", {
|
|
647
|
-
payload: CompareDocumentRevisionsInput,
|
|
648
|
-
success: DocumentRevisionComparison,
|
|
649
|
-
error: [
|
|
650
|
-
NotFound,
|
|
651
|
-
HistoryComparisonTooLarge,
|
|
652
|
-
Forbidden,
|
|
653
|
-
InternalError
|
|
654
|
-
]
|
|
655
|
-
})).middleware(StudioAuthentication).prefix("/history");
|
|
656
|
-
const StudioActivityApi = HttpApiGroup.make("activity").add(HttpApiEndpoint.get("list", "/", {
|
|
657
|
-
query: ActivityQuery,
|
|
658
|
-
success: ActivityPage,
|
|
659
|
-
error: [
|
|
660
|
-
InvalidActivityCursor,
|
|
661
|
-
Forbidden,
|
|
662
|
-
InternalError
|
|
663
|
-
]
|
|
664
|
-
})).middleware(StudioAuthentication).prefix("/activity");
|
|
665
|
-
const StudioUserAdministrationApi = HttpApiGroup.make("users").add(HttpApiEndpoint.get("list", "/", {
|
|
666
|
-
query: UserQuery,
|
|
667
|
-
success: UserPage,
|
|
668
|
-
error: [UserAdministrationForbidden, InternalError]
|
|
669
|
-
}), HttpApiEndpoint.post("create", "/", {
|
|
670
|
-
payload: CreateUserInput,
|
|
671
|
-
success: User.pipe(HttpApiSchema.status(201)),
|
|
672
|
-
error: [
|
|
673
|
-
UserDuplicate,
|
|
674
|
-
UserAdministrationForbidden,
|
|
675
|
-
InternalError
|
|
676
|
-
]
|
|
677
|
-
}), HttpApiEndpoint.post("changeRole", "/:userId/role", {
|
|
678
|
-
params: { userId: User.fields.id },
|
|
679
|
-
payload: ChangeRolePayload,
|
|
680
|
-
success: User,
|
|
681
|
-
error: [
|
|
682
|
-
MissingUser,
|
|
683
|
-
UserSelfRoleChange,
|
|
684
|
-
UserAdministrationForbidden,
|
|
685
|
-
InternalError
|
|
686
|
-
]
|
|
687
|
-
}), HttpApiEndpoint.post("revokeSessions", "/:userId/sessions/revoke", {
|
|
688
|
-
params: { userId: User.fields.id },
|
|
689
|
-
success: User,
|
|
690
|
-
error: [
|
|
691
|
-
MissingUser,
|
|
692
|
-
UserAdministrationForbidden,
|
|
693
|
-
InternalError
|
|
694
|
-
]
|
|
695
|
-
}), HttpApiEndpoint.delete("remove", "/:userId", {
|
|
696
|
-
params: { userId: User.fields.id },
|
|
697
|
-
success: User,
|
|
698
|
-
error: [
|
|
699
|
-
MissingUser,
|
|
700
|
-
UserSelfRemoval,
|
|
701
|
-
UserAdministrationForbidden,
|
|
702
|
-
InternalError
|
|
703
|
-
]
|
|
704
|
-
})).middleware(StudioAuthentication).prefix("/users");
|
|
705
|
-
const StudioCollaborationApi = HttpApiGroup.make("collaboration").add(HttpApiEndpoint.post("ticket", "/:documentId/ticket", {
|
|
706
|
-
params: { documentId: DocumentId },
|
|
707
|
-
success: CollaborationTicket,
|
|
708
|
-
error: [
|
|
709
|
-
NotFound,
|
|
710
|
-
Forbidden,
|
|
711
|
-
InternalError
|
|
712
|
-
]
|
|
713
|
-
})).middleware(StudioAuthentication).prefix("/collaboration");
|
|
714
|
-
var StudioApi = class extends HttpApi.make("StudioApi").add(InitializationApi, PublishedDeliveryApi, StudioConfigurationApi, StudioSessionApi, StudioDiagnosticsApi, PreviewDeliveryApi.middleware(StudioAuthentication), StudioDocumentsApi, StudioHistoryApi, StudioActivityApi, StudioUserAdministrationApi, StudioMediaApi, StudioCollaborationApi).middleware(StudioSchemaError).prefix(STUDIO_API_PATH) {};
|
|
715
|
-
|
|
716
|
-
//#endregion
|
|
717
|
-
export { ACTIVITY_ACTIONS as A, ActivityTargetKind as B, CollaborationTicket as C, DocumentRevision as D, DocumentHistoryInvalidCursor as E, ActivityEntry as F, DocumentVersionConflict as G, DocumentNotFound as H, ActivityEntryDraft as I, PublishedDocumentNotFound as K, ActivityId as L, ActivityContext as M, ActivityCursor as N, DocumentRevisionComparison as O, ActivityCursorInvalid as P, ActivityPage as R, CollaborationServerMessage as S, DocumentHistoryComparisonTooLarge as T, DocumentPathConflict as U, DocumentMediaUnavailable as V, DocumentValidationFailed as W, UserNotFound as _, StudioBootstrap as a, UserSelfRoleChangeDenied as b, StudioInternalError as c, InitializationProofInvalid as d, InitializationState as f, UserAlreadyExists as g, UserAdministrationDenied as h, StudioBadRequest as i, ActivityAction as j, DocumentRevisionPage as k, studioInternalError as l, User as m, StudioApi as n, StudioRequestConflict as o, CreateUserInput as p, StudioAuthentication as r, StudioSchemaError as s, CurrentStudioRequest as t, InitializationAlreadyCompleted as u, UserPage as v, StateVector as w, CollaborationClientMessage as x, UserSelfRemovalDenied as y, ActivityTarget as z };
|
|
718
|
-
//# sourceMappingURL=StudioHttp-jR2-bc01.js.map
|