@krak-stack/assets 0.1.4 → 0.1.6

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.
Files changed (86) hide show
  1. package/CHANGELOG.md +67 -0
  2. package/README.md +174 -20
  3. package/dist/access.d.ts +44 -0
  4. package/dist/access.d.ts.map +1 -0
  5. package/dist/access.js +56 -0
  6. package/dist/access.js.map +1 -0
  7. package/dist/api.builder.d.ts +100 -0
  8. package/dist/api.builder.d.ts.map +1 -0
  9. package/dist/api.builder.js +233 -0
  10. package/dist/api.builder.js.map +1 -0
  11. package/dist/api.d.ts +2 -0
  12. package/dist/api.d.ts.map +1 -0
  13. package/dist/api.group.d.ts +222 -0
  14. package/dist/api.group.d.ts.map +1 -0
  15. package/dist/api.group.js +83 -0
  16. package/dist/api.group.js.map +1 -0
  17. package/dist/api.js +2 -0
  18. package/dist/api.js.map +1 -0
  19. package/dist/catalog.d.ts +91 -0
  20. package/dist/catalog.d.ts.map +1 -0
  21. package/dist/catalog.js +52 -0
  22. package/dist/catalog.js.map +1 -0
  23. package/dist/client.d.ts +245 -0
  24. package/dist/client.d.ts.map +1 -0
  25. package/dist/client.js +8 -0
  26. package/dist/client.js.map +1 -0
  27. package/dist/commands.d.ts +55 -0
  28. package/dist/commands.d.ts.map +1 -0
  29. package/dist/commands.js +127 -0
  30. package/dist/commands.js.map +1 -0
  31. package/dist/components/asset-input/html.d.ts +70 -0
  32. package/dist/components/asset-input/html.d.ts.map +1 -0
  33. package/dist/components/asset-input/html.js +1549 -0
  34. package/dist/components/asset-input/html.js.map +1 -0
  35. package/dist/components/asset-input/index.d.ts +280 -0
  36. package/dist/components/asset-input/react.d.ts +32 -0
  37. package/dist/components/asset-input/react.d.ts.map +1 -0
  38. package/dist/components/asset-input/react.js +2269 -0
  39. package/dist/components/asset-input/react.js.map +1 -0
  40. package/dist/components/asset-input/schema.d.ts +93 -0
  41. package/dist/components/asset-input/upload.d.ts +15 -0
  42. package/dist/components/asset-table/html.d.ts +110 -0
  43. package/dist/components/asset-table/html.d.ts.map +1 -0
  44. package/dist/components/asset-table/html.js +4934 -0
  45. package/dist/components/asset-table/html.js.map +1 -0
  46. package/dist/components/asset-table/index.d.ts +225 -0
  47. package/dist/components/asset-table/react.d.ts +21 -0
  48. package/dist/components/asset-table/react.d.ts.map +1 -0
  49. package/dist/components/asset-table/react.js +8241 -0
  50. package/dist/components/asset-table/react.js.map +1 -0
  51. package/dist/components/asset-table/schema.d.ts +73 -0
  52. package/dist/index.d.ts +215 -9
  53. package/dist/index.d.ts.map +1 -1
  54. package/dist/index.js +49 -24
  55. package/dist/index.js.map +1 -1
  56. package/dist/migrations/0004_upload_intents.d.ts +5 -0
  57. package/dist/migrations/0004_upload_intents.d.ts.map +1 -0
  58. package/dist/migrations/0004_upload_intents.js +14 -0
  59. package/dist/migrations/0004_upload_intents.js.map +1 -0
  60. package/dist/migrations.d.ts.map +1 -1
  61. package/dist/migrations.js +2 -0
  62. package/dist/migrations.js.map +1 -1
  63. package/dist/queries.d.ts +6 -0
  64. package/dist/queries.d.ts.map +1 -0
  65. package/dist/queries.js +18 -0
  66. package/dist/queries.js.map +1 -0
  67. package/dist/retrieval.d.ts +6 -1
  68. package/dist/retrieval.d.ts.map +1 -1
  69. package/dist/retrieval.js +48 -17
  70. package/dist/retrieval.js.map +1 -1
  71. package/dist/schema.d.ts +116 -1
  72. package/dist/schema.d.ts.map +1 -1
  73. package/dist/schema.js +88 -1
  74. package/dist/schema.js.map +1 -1
  75. package/dist/services/assets/library.d.ts +221 -0
  76. package/dist/services/assets/library.d.ts.map +1 -0
  77. package/dist/services/assets/library.js +101 -0
  78. package/dist/services/assets/library.js.map +1 -0
  79. package/dist/services/assets/schema.d.ts +3 -0
  80. package/dist/services/assets/url.d.ts +12 -0
  81. package/dist/services/assets/use-library.d.ts +20 -0
  82. package/dist/workflows.d.ts +2 -0
  83. package/dist/workflows.d.ts.map +1 -1
  84. package/dist/workflows.js +2 -0
  85. package/dist/workflows.js.map +1 -1
  86. package/package.json +43 -7
@@ -0,0 +1,233 @@
1
+ import { Effect, Layer } from "effect";
2
+ import { HttpEffect, HttpServerResponse } from "effect/http";
3
+ import { HttpApiBuilder, HttpApiError, } from "effect/http-api";
4
+ import { AssetsApi } from "./api.group.js";
5
+ import { AssetNotFound, AssetTextChunkInvalid, } from "./schema.js";
6
+ const requirePermission = (access, permission) => Effect.gen(function* () {
7
+ const context = yield* access.resolve;
8
+ if (!context.permissions.includes(permission))
9
+ return yield* new HttpApiError.Forbidden();
10
+ return context;
11
+ });
12
+ const storageError = () => new HttpApiError.InternalServerError();
13
+ const assetFileUrl = (id) => `/api/assets/${id}/file`;
14
+ const uploadError = (error) => error._tag === "AssetUploadInvalid" ||
15
+ error._tag === "Forbidden" ||
16
+ error._tag === "Unauthorized" ||
17
+ error._tag === "AssetNotFound"
18
+ ? error
19
+ : storageError();
20
+ const authorizedUpload = Effect.fnUntraced(function* (access, assets, { assetId, attemptId }) {
21
+ const { organizationId, actorId, permissions } = yield* access.resolve;
22
+ if (!permissions.includes("create") && !permissions.includes("update"))
23
+ return yield* new HttpApiError.Forbidden();
24
+ const key = {
25
+ organizationId,
26
+ createdBy: actorId,
27
+ uploadToken: (attemptId ?? assetId).toLowerCase(),
28
+ };
29
+ const notFound = () => new AssetNotFound({ assetId });
30
+ const intent = yield* assets
31
+ .getUploadIntent(key)
32
+ .pipe(Effect.mapError((error) => error._tag === "AssetUploadInvalid" ? notFound() : error));
33
+ if (attemptId === undefined
34
+ ? intent.assetId !== undefined
35
+ : intent.assetId?.toLowerCase() !== assetId.toLowerCase())
36
+ return yield* notFound();
37
+ if (!permissions.includes(intent.assetId ? "update" : "create"))
38
+ return yield* new HttpApiError.Forbidden();
39
+ return { key, intent };
40
+ });
41
+ const handler = (_api, _group, _name, run) => run;
42
+ export const makeAssetsHandlers = (service, access) => ({
43
+ list: handler(AssetsApi, "assets", "list", ({ query }) => Effect.gen(function* () {
44
+ yield* HttpEffect.appendPreResponseHandler((_, response) => Effect.succeed(HttpServerResponse.setHeader(response, "cache-control", "private, no-store")));
45
+ const { organizationId, permissions } = yield* requirePermission(access, "list");
46
+ const assets = yield* Effect.service(service);
47
+ const canRead = permissions.includes("read");
48
+ const { items, stats } = yield* assets
49
+ .query({ ...query, organizationId })
50
+ .pipe(Effect.mapError(() => new HttpApiError.InternalServerError()));
51
+ return {
52
+ items: items.map(({ id, name, mimeType, byteSize, createdAt, updatedAt }) => ({
53
+ id,
54
+ name,
55
+ mimeType,
56
+ byteSize,
57
+ createdAt,
58
+ updatedAt,
59
+ ...(canRead ? { url: assetFileUrl(id) } : {}),
60
+ })),
61
+ stats,
62
+ };
63
+ })),
64
+ file: handler(AssetsApi, "assets", "file", ({ params: { assetId }, query }) => Effect.gen(function* () {
65
+ const { organizationId } = yield* requirePermission(access, "read");
66
+ const assets = yield* Effect.service(service);
67
+ if (query.download) {
68
+ const { name, body } = yield* assets
69
+ .downloadAttachment({ organizationId, assetId })
70
+ .pipe(Effect.mapError((error) => error._tag === "AssetNotFound" ? error : storageError()));
71
+ const filename = encodeURIComponent(name.replace(/\p{Surrogate}/gu, "�")).replace(/['()*]/g, (character) => `%${character.charCodeAt(0).toString(16).toUpperCase()}`);
72
+ return HttpServerResponse.raw(body, {
73
+ headers: {
74
+ "cache-control": "private, no-store",
75
+ "content-type": "application/octet-stream",
76
+ "content-disposition": `attachment; filename*=UTF-8''${filename}`,
77
+ "x-content-type-options": "nosniff",
78
+ },
79
+ });
80
+ }
81
+ const { url } = yield* assets
82
+ .download({ organizationId, assetId })
83
+ .pipe(Effect.mapError((error) => error._tag === "AssetNotFound"
84
+ ? error
85
+ : new HttpApiError.InternalServerError()));
86
+ return HttpServerResponse.redirect(url, {
87
+ status: 302,
88
+ headers: { "cache-control": "private, no-store" },
89
+ });
90
+ })),
91
+ getAsset: handler(AssetsApi, "assets", "getAsset", ({ params, query }) => Effect.gen(function* () {
92
+ const { organizationId, permissions } = yield* access.resolve;
93
+ const assets = yield* Effect.service(service);
94
+ const { assetId } = params;
95
+ const { attemptId, outlineOffset } = query;
96
+ yield* HttpEffect.appendPreResponseHandler((_, response) => Effect.succeed(HttpServerResponse.setHeader(response, "cache-control", "private, no-store")));
97
+ const canRead = permissions.includes("read");
98
+ const getDetails = () => assets.getOverview({ organizationId, assetId, outlineOffset }).pipe(Effect.map(({ processingId: _, ...details }) => ({
99
+ ...details,
100
+ url: assetFileUrl(details.id),
101
+ })));
102
+ if (attemptId === undefined && canRead) {
103
+ const details = yield* getDetails().pipe(Effect.catchTag("AssetNotFound", () => Effect.succeed(undefined)));
104
+ if (details)
105
+ return details;
106
+ if (!permissions.includes("create"))
107
+ return yield* new AssetNotFound({ assetId });
108
+ }
109
+ const { key } = yield* authorizedUpload(access, assets, {
110
+ assetId,
111
+ attemptId,
112
+ });
113
+ const { status } = yield* assets.getUploadScan(key);
114
+ // Publication may have committed since the first details lookup.
115
+ if (status === "published" && attemptId === undefined && canRead)
116
+ return yield* getDetails();
117
+ return {
118
+ assetId,
119
+ ...(attemptId ? { attemptId } : {}),
120
+ uploadStatus: status,
121
+ };
122
+ }).pipe(Effect.mapError((error) => error._tag === "AssetNotFound" ||
123
+ error._tag === "Forbidden" ||
124
+ error._tag === "Unauthorized"
125
+ ? error
126
+ : storageError()))),
127
+ getAssetChunks: handler(AssetsApi, "assets", "getAssetChunks", ({ params, query }) => Effect.gen(function* () {
128
+ const { organizationId } = yield* requirePermission(access, "read");
129
+ const assets = yield* Effect.service(service);
130
+ const { ids, query: terms, language, offset, headingPath, includeNeighbors, } = query;
131
+ if ((terms === undefined) === (ids === undefined) ||
132
+ (ids &&
133
+ (language !== undefined ||
134
+ offset !== undefined ||
135
+ headingPath !== undefined)) ||
136
+ (terms !== undefined && includeNeighbors !== undefined))
137
+ return yield* new AssetTextChunkInvalid({
138
+ message: "Use query for search or ids for reading chunks; do not mix their options",
139
+ });
140
+ yield* HttpEffect.appendPreResponseHandler((_, response) => Effect.succeed(HttpServerResponse.setHeader(response, "cache-control", "private, no-store")));
141
+ const scope = { ...params, organizationId };
142
+ if (ids) {
143
+ const { assetId, chunks } = yield* assets.readChunks({
144
+ ...scope,
145
+ ids,
146
+ includeNeighbors,
147
+ });
148
+ return {
149
+ assetId,
150
+ chunks: chunks.map(({ processingId: _, ...chunk }) => chunk),
151
+ };
152
+ }
153
+ if (terms === undefined)
154
+ return yield* new AssetTextChunkInvalid({
155
+ message: "Search terms are required",
156
+ });
157
+ const { assetId, hits, nextOffset } = yield* assets.searchChunks({
158
+ ...scope,
159
+ query: terms,
160
+ language: language ?? "en",
161
+ offset,
162
+ headingPath,
163
+ });
164
+ return {
165
+ assetId,
166
+ hits: hits.map(({ processingId: _, ...hit }) => hit),
167
+ nextOffset,
168
+ };
169
+ }).pipe(Effect.mapError((error) => error._tag === "Forbidden" ||
170
+ error._tag === "Unauthorized" ||
171
+ error._tag === "AssetNotFound" ||
172
+ error._tag === "AssetTextChunkInvalid" ||
173
+ error._tag === "AssetTextVersionChanged"
174
+ ? error
175
+ : storageError()))),
176
+ createAssetUpload: handler(AssetsApi, "assets", "createAssetUpload", ({ payload }) => Effect.gen(function* () {
177
+ const { organizationId, actorId } = yield* requirePermission(access, payload.assetId ? "update" : "create");
178
+ const assets = yield* Effect.service(service);
179
+ const { uploadToken, ...upload } = yield* assets
180
+ .beginUpload({ organizationId, createdBy: actorId, payload })
181
+ .pipe(Effect.mapError((error) => error._tag === "AssetNotFound" ||
182
+ error._tag === "AssetUploadInvalid"
183
+ ? error
184
+ : storageError()));
185
+ return {
186
+ ...upload,
187
+ assetId: payload.assetId ?? uploadToken,
188
+ ...(payload.assetId ? { attemptId: uploadToken } : {}),
189
+ };
190
+ })),
191
+ completeAssetUpload: handler(AssetsApi, "assets", "completeAssetUpload", ({ params: { assetId }, query: { attemptId } }) => Effect.gen(function* () {
192
+ const assets = yield* Effect.service(service);
193
+ const { key: { organizationId, createdBy, uploadToken }, intent, } = yield* authorizedUpload(access, assets, { assetId, attemptId });
194
+ const { status } = yield* assets.queueUploadScan({
195
+ organizationId,
196
+ createdBy,
197
+ payload: { ...intent, uploadToken },
198
+ });
199
+ return {
200
+ assetId,
201
+ ...(attemptId ? { attemptId } : {}),
202
+ uploadStatus: status,
203
+ };
204
+ }).pipe(Effect.mapError(uploadError))),
205
+ deleteAssets: handler(AssetsApi, "assets", "deleteAssets", ({ payload }) => Effect.gen(function* () {
206
+ const { organizationId } = yield* requirePermission(access, "delete");
207
+ const assets = yield* Effect.service(service);
208
+ const results = yield* Effect.forEach(Array.from(new Set(payload.ids)), (assetId) => assets.remove({ organizationId, assetId }).pipe(Effect.map(({ id }) => ({ _tag: "Deleted", id })), Effect.catchTags({
209
+ AssetInUse: ({ assetId: id }) => Effect.succeed({
210
+ _tag: "Failed",
211
+ id,
212
+ reason: "in_use",
213
+ }),
214
+ AssetNotFound: ({ assetId: id }) => Effect.succeed({
215
+ _tag: "Failed",
216
+ id,
217
+ reason: "not_found",
218
+ }),
219
+ })), { concurrency: 4 }).pipe(Effect.mapError(storageError));
220
+ return {
221
+ deletedIds: results.flatMap((result) => result._tag === "Deleted" ? [result.id] : []),
222
+ failures: results.flatMap((result) => result._tag === "Failed"
223
+ ? [{ id: result.id, reason: result.reason }]
224
+ : []),
225
+ };
226
+ })),
227
+ });
228
+ export const makeAssetsApiLayer = (service, access) => {
229
+ const h = makeAssetsHandlers(service, access);
230
+ const handlers = HttpApiBuilder.group(AssetsApi, "assets", (group) => group.handleAll(h));
231
+ return HttpApiBuilder.layer(AssetsApi).pipe(Layer.provide(handlers));
232
+ };
233
+ //# sourceMappingURL=api.builder.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"api.builder.js","sourceRoot":"","sources":["../src/api.builder.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,KAAK,EAAgB,MAAM,QAAQ,CAAC;AACrD,OAAO,EAAE,UAAU,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AAC7D,OAAO,EACL,cAAc,EACd,YA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,CACH;CACF,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAChC,OAAmD,EACnD,MAA2B,EAC3B,EAAE;IACF,MAAM,CAAC,GAAG,kBAAkB,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC;IAC9C,MAAM,QAAQ,GAAG,cAAc,CAAC,KAAK,CAAC,SAAS,EAAE,QAAQ,EAAE,CAAC,KAAK,EAAE,EAAE,CACnE,KAAK,CAAC,SAAS,CAAC,CAAC,CAAC,CACnB,CAAC;IACF,OAAO,cAAc,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC,CAAC;AACvE,CAAC,CAAC"}
package/dist/api.d.ts ADDED
@@ -0,0 +1,2 @@
1
+ export { AssetsApi, AssetsApiGroup, AssetsContext, AssetsPolicy, CurrentAssetsContext, } from "./api.group.js";
2
+ //# sourceMappingURL=api.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"api.d.ts","sourceRoot":"","sources":["../src/api.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,SAAS,EACT,cAAc,EACd,aAAa,EACb,YAAY,EACZ,oBAAoB,GACrB,MAAM,gBAAgB,CAAC"}
@@ -0,0 +1,222 @@
1
+ import { Schema } from "effect";
2
+ import { HttpApi, HttpApiEndpoint, HttpApiError, HttpApiGroup, HttpApiSchema } from "effect/http-api";
3
+ import { AssetNotFound, AssetTextChunkInvalid, AssetTextVersionChanged, AssetUploadInvalid } from "./schema.js";
4
+ export declare const AssetsApiGroup: HttpApiGroup.HttpApiGroup<"assets", HttpApiEndpoint.HttpApiEndpoint<"completeAssetUpload", "POST", "/assets/:assetId/complete", Schema.toCodecStringTree<Schema.Struct<{
5
+ readonly assetId: Schema.String;
6
+ }>>, Schema.toCodecStringTree<Schema.Struct<{
7
+ readonly attemptId: Schema.optionalKey<Schema.String>;
8
+ }>>, never, never, Schema.toCodecJson<Schema.Struct<{
9
+ readonly attemptId: Schema.optionalKey<Schema.String>;
10
+ readonly assetId: Schema.String;
11
+ readonly uploadStatus: Schema.Literals<readonly ["pending", "published", "rejected", "unscannable", "invalid", "failed"]>;
12
+ }>>, Schema.toCodecJson<typeof HttpApiError.Unauthorized | typeof HttpApiError.Forbidden | typeof HttpApiError.InternalServerError | typeof AssetNotFound | typeof AssetUploadInvalid>, never, never> | HttpApiEndpoint.HttpApiEndpoint<"createAssetUpload", "POST", "/assets", never, never, Schema.toCodecJson<Schema.Struct<{
13
+ readonly name: Schema.NonEmptyString;
14
+ readonly mimeType: Schema.NonEmptyString;
15
+ readonly byteSize: Schema.Int;
16
+ readonly checksum: Schema.NonEmptyString;
17
+ readonly assetId: Schema.optional<Schema.String>;
18
+ }>>, never, Schema.toCodecJson<Schema.Struct<{
19
+ readonly attemptId: Schema.optionalKey<Schema.String>;
20
+ readonly assetId: Schema.String;
21
+ readonly uploadUrl: Schema.String;
22
+ readonly contentType: Schema.NonEmptyString;
23
+ }>>, Schema.toCodecJson<typeof HttpApiError.Unauthorized | typeof HttpApiError.Forbidden | typeof HttpApiError.InternalServerError | typeof AssetNotFound | typeof AssetUploadInvalid>, never, never> | HttpApiEndpoint.HttpApiEndpoint<"deleteAssets", "DELETE", "/assets", never, never, Schema.toCodecJson<Schema.Struct<{
24
+ readonly ids: Schema.$Array<Schema.String>;
25
+ }>>, never, Schema.toCodecJson<Schema.Struct<{
26
+ readonly deletedIds: Schema.$Array<Schema.String>;
27
+ readonly failures: Schema.$Array<Schema.Struct<{
28
+ readonly id: Schema.String;
29
+ readonly reason: Schema.Union<readonly [Schema.Literal<"not_found">, Schema.Literal<"in_use">]>;
30
+ }>>;
31
+ }>>, Schema.toCodecJson<typeof HttpApiError.Unauthorized | typeof HttpApiError.Forbidden | typeof HttpApiError.InternalServerError>, never, never> | HttpApiEndpoint.HttpApiEndpoint<"file", "GET", "/assets/:assetId/file", Schema.toCodecStringTree<Schema.Struct<{
32
+ readonly assetId: Schema.String;
33
+ }>>, Schema.toCodecStringTree<Schema.Struct<{
34
+ readonly download: Schema.optionalKey<Schema.Literal<"1">>;
35
+ readonly v: Schema.optionalKey<Schema.String>;
36
+ }>>, never, never, HttpApiSchema.StreamUint8Array | Schema.toCodecJson<Schema.Void>, Schema.toCodecJson<typeof HttpApiError.Unauthorized | typeof HttpApiError.Forbidden | typeof HttpApiError.InternalServerError | typeof AssetNotFound>, never, never> | HttpApiEndpoint.HttpApiEndpoint<"getAsset", "GET", "/assets/:assetId", Schema.toCodecStringTree<Schema.Struct<{
37
+ readonly assetId: Schema.String;
38
+ }>>, Schema.toCodecStringTree<Schema.Struct<{
39
+ readonly attemptId: Schema.optionalKey<Schema.String>;
40
+ readonly outlineOffset: Schema.optionalKey<Schema.Int>;
41
+ }>>, never, never, Schema.toCodecJson<Schema.Union<readonly [Schema.Struct<{
42
+ readonly id: Schema.String;
43
+ readonly name: Schema.String;
44
+ readonly mimeType: Schema.String;
45
+ readonly status: Schema.Literals<readonly ["pending", "running", "completed", "failed", "unsupported"]>;
46
+ readonly totalBytes: Schema.Int;
47
+ readonly totalChunks: Schema.Int;
48
+ readonly failure: Schema.NullOr<Schema.String>;
49
+ readonly outline: Schema.$Array<Schema.Struct<{
50
+ readonly headingPath: Schema.String;
51
+ readonly firstOrdinal: Schema.Int;
52
+ readonly lastOrdinal: Schema.Int;
53
+ }>>;
54
+ readonly nextOutlineOffset: Schema.NullOr<Schema.Int>;
55
+ readonly url: Schema.String;
56
+ }>, Schema.Struct<{
57
+ readonly attemptId: Schema.optionalKey<Schema.String>;
58
+ readonly assetId: Schema.String;
59
+ readonly uploadStatus: Schema.Literals<readonly ["pending", "published", "rejected", "unscannable", "invalid", "failed"]>;
60
+ }>]>>, Schema.toCodecJson<typeof HttpApiError.Unauthorized | typeof HttpApiError.Forbidden | typeof HttpApiError.InternalServerError | typeof AssetNotFound>, never, never> | HttpApiEndpoint.HttpApiEndpoint<"getAssetChunks", "GET", "/assets/:assetId/chunks", Schema.toCodecStringTree<Schema.Struct<{
61
+ readonly assetId: Schema.String;
62
+ }>>, Schema.toCodecStringTree<Schema.Struct<{
63
+ readonly query: Schema.optionalKey<Schema.NonEmptyString>;
64
+ readonly language: Schema.optionalKey<Schema.Literals<readonly ["en", "fr"]>>;
65
+ readonly offset: Schema.optionalKey<Schema.Int>;
66
+ readonly headingPath: Schema.optional<Schema.String>;
67
+ readonly ids: Schema.optionalKey<Schema.$Array<Schema.String>>;
68
+ readonly includeNeighbors: Schema.optional<Schema.Boolean>;
69
+ }>>, never, never, Schema.toCodecJson<Schema.Union<readonly [Schema.Struct<{
70
+ readonly assetId: Schema.String;
71
+ readonly nextOffset: Schema.NullOr<Schema.Int>;
72
+ readonly hits: Schema.$Array<Schema.Struct<{
73
+ readonly id: Schema.String;
74
+ readonly ordinal: Schema.Int;
75
+ readonly headingPath: Schema.String;
76
+ readonly byteStart: Schema.Int;
77
+ readonly byteEnd: Schema.Int;
78
+ readonly firstPage: Schema.NullOr<Schema.Int>;
79
+ readonly lastPage: Schema.NullOr<Schema.Int>;
80
+ readonly snippet: Schema.String;
81
+ readonly score: Schema.Finite;
82
+ }>>;
83
+ }>, Schema.Struct<{
84
+ readonly assetId: Schema.String;
85
+ readonly chunks: Schema.$Array<Schema.Struct<{
86
+ readonly ordinal: Schema.Int;
87
+ readonly content: Schema.NonEmptyString;
88
+ readonly headingPath: Schema.String;
89
+ readonly byteStart: Schema.Int;
90
+ readonly byteEnd: Schema.Int;
91
+ readonly firstPage: Schema.NullOr<Schema.Int>;
92
+ readonly lastPage: Schema.NullOr<Schema.Int>;
93
+ readonly id: Schema.String;
94
+ }>>;
95
+ }>]>>, Schema.toCodecJson<typeof HttpApiError.Unauthorized | typeof HttpApiError.Forbidden | typeof HttpApiError.InternalServerError | typeof AssetTextChunkInvalid | typeof AssetTextVersionChanged | typeof AssetNotFound>, never, never> | HttpApiEndpoint.HttpApiEndpoint<"list", "GET", "/assets", never, Schema.toCodecStringTree<Schema.Struct<{
96
+ readonly search: Schema.optionalKey<Schema.String>;
97
+ readonly kind: Schema.optionalKey<Schema.Literals<readonly ["image", "video", "caption", "document"]>>;
98
+ }>>, never, never, Schema.toCodecJson<Schema.Struct<{
99
+ readonly items: Schema.$Array<Schema.Struct<{
100
+ readonly id: Schema.String;
101
+ readonly name: Schema.NonEmptyString;
102
+ readonly mimeType: Schema.NonEmptyString;
103
+ readonly byteSize: Schema.Int;
104
+ readonly createdAt: Schema.Date;
105
+ readonly updatedAt: Schema.Date;
106
+ readonly url: Schema.optionalKey<Schema.String>;
107
+ }>>;
108
+ readonly stats: Schema.Struct<{
109
+ readonly assetCount: Schema.Int;
110
+ readonly storageUsedBytes: Schema.Int;
111
+ }>;
112
+ }>>, Schema.toCodecJson<typeof HttpApiError.Unauthorized | typeof HttpApiError.Forbidden | typeof HttpApiError.InternalServerError>, never, never>, false>;
113
+ export declare const AssetsApi: HttpApi.HttpApi<"AssetsApi", HttpApiGroup.HttpApiGroup<"assets", HttpApiEndpoint.HttpApiEndpoint<"completeAssetUpload", "POST", "/api/assets/:assetId/complete", Schema.toCodecStringTree<Schema.Struct<{
114
+ readonly assetId: Schema.String;
115
+ }>>, Schema.toCodecStringTree<Schema.Struct<{
116
+ readonly attemptId: Schema.optionalKey<Schema.String>;
117
+ }>>, never, never, Schema.toCodecJson<Schema.Struct<{
118
+ readonly attemptId: Schema.optionalKey<Schema.String>;
119
+ readonly assetId: Schema.String;
120
+ readonly uploadStatus: Schema.Literals<readonly ["pending", "published", "rejected", "unscannable", "invalid", "failed"]>;
121
+ }>>, Schema.toCodecJson<typeof HttpApiError.Unauthorized | typeof HttpApiError.Forbidden | typeof HttpApiError.InternalServerError | typeof AssetNotFound | typeof AssetUploadInvalid>, never, never> | HttpApiEndpoint.HttpApiEndpoint<"createAssetUpload", "POST", "/api/assets", never, never, Schema.toCodecJson<Schema.Struct<{
122
+ readonly name: Schema.NonEmptyString;
123
+ readonly mimeType: Schema.NonEmptyString;
124
+ readonly byteSize: Schema.Int;
125
+ readonly checksum: Schema.NonEmptyString;
126
+ readonly assetId: Schema.optional<Schema.String>;
127
+ }>>, never, Schema.toCodecJson<Schema.Struct<{
128
+ readonly attemptId: Schema.optionalKey<Schema.String>;
129
+ readonly assetId: Schema.String;
130
+ readonly uploadUrl: Schema.String;
131
+ readonly contentType: Schema.NonEmptyString;
132
+ }>>, Schema.toCodecJson<typeof HttpApiError.Unauthorized | typeof HttpApiError.Forbidden | typeof HttpApiError.InternalServerError | typeof AssetNotFound | typeof AssetUploadInvalid>, never, never> | HttpApiEndpoint.HttpApiEndpoint<"deleteAssets", "DELETE", "/api/assets", never, never, Schema.toCodecJson<Schema.Struct<{
133
+ readonly ids: Schema.$Array<Schema.String>;
134
+ }>>, never, Schema.toCodecJson<Schema.Struct<{
135
+ readonly deletedIds: Schema.$Array<Schema.String>;
136
+ readonly failures: Schema.$Array<Schema.Struct<{
137
+ readonly id: Schema.String;
138
+ readonly reason: Schema.Union<readonly [Schema.Literal<"not_found">, Schema.Literal<"in_use">]>;
139
+ }>>;
140
+ }>>, Schema.toCodecJson<typeof HttpApiError.Unauthorized | typeof HttpApiError.Forbidden | typeof HttpApiError.InternalServerError>, never, never> | HttpApiEndpoint.HttpApiEndpoint<"file", "GET", "/api/assets/:assetId/file", Schema.toCodecStringTree<Schema.Struct<{
141
+ readonly assetId: Schema.String;
142
+ }>>, Schema.toCodecStringTree<Schema.Struct<{
143
+ readonly download: Schema.optionalKey<Schema.Literal<"1">>;
144
+ readonly v: Schema.optionalKey<Schema.String>;
145
+ }>>, never, never, HttpApiSchema.StreamUint8Array | Schema.toCodecJson<Schema.Void>, Schema.toCodecJson<typeof HttpApiError.Unauthorized | typeof HttpApiError.Forbidden | typeof HttpApiError.InternalServerError | typeof AssetNotFound>, never, never> | HttpApiEndpoint.HttpApiEndpoint<"getAsset", "GET", "/api/assets/:assetId", Schema.toCodecStringTree<Schema.Struct<{
146
+ readonly assetId: Schema.String;
147
+ }>>, Schema.toCodecStringTree<Schema.Struct<{
148
+ readonly attemptId: Schema.optionalKey<Schema.String>;
149
+ readonly outlineOffset: Schema.optionalKey<Schema.Int>;
150
+ }>>, never, never, Schema.toCodecJson<Schema.Union<readonly [Schema.Struct<{
151
+ readonly id: Schema.String;
152
+ readonly name: Schema.String;
153
+ readonly mimeType: Schema.String;
154
+ readonly status: Schema.Literals<readonly ["pending", "running", "completed", "failed", "unsupported"]>;
155
+ readonly totalBytes: Schema.Int;
156
+ readonly totalChunks: Schema.Int;
157
+ readonly failure: Schema.NullOr<Schema.String>;
158
+ readonly outline: Schema.$Array<Schema.Struct<{
159
+ readonly headingPath: Schema.String;
160
+ readonly firstOrdinal: Schema.Int;
161
+ readonly lastOrdinal: Schema.Int;
162
+ }>>;
163
+ readonly nextOutlineOffset: Schema.NullOr<Schema.Int>;
164
+ readonly url: Schema.String;
165
+ }>, Schema.Struct<{
166
+ readonly attemptId: Schema.optionalKey<Schema.String>;
167
+ readonly assetId: Schema.String;
168
+ readonly uploadStatus: Schema.Literals<readonly ["pending", "published", "rejected", "unscannable", "invalid", "failed"]>;
169
+ }>]>>, Schema.toCodecJson<typeof HttpApiError.Unauthorized | typeof HttpApiError.Forbidden | typeof HttpApiError.InternalServerError | typeof AssetNotFound>, never, never> | HttpApiEndpoint.HttpApiEndpoint<"getAssetChunks", "GET", "/api/assets/:assetId/chunks", Schema.toCodecStringTree<Schema.Struct<{
170
+ readonly assetId: Schema.String;
171
+ }>>, Schema.toCodecStringTree<Schema.Struct<{
172
+ readonly query: Schema.optionalKey<Schema.NonEmptyString>;
173
+ readonly language: Schema.optionalKey<Schema.Literals<readonly ["en", "fr"]>>;
174
+ readonly offset: Schema.optionalKey<Schema.Int>;
175
+ readonly headingPath: Schema.optional<Schema.String>;
176
+ readonly ids: Schema.optionalKey<Schema.$Array<Schema.String>>;
177
+ readonly includeNeighbors: Schema.optional<Schema.Boolean>;
178
+ }>>, never, never, Schema.toCodecJson<Schema.Union<readonly [Schema.Struct<{
179
+ readonly assetId: Schema.String;
180
+ readonly nextOffset: Schema.NullOr<Schema.Int>;
181
+ readonly hits: Schema.$Array<Schema.Struct<{
182
+ readonly id: Schema.String;
183
+ readonly ordinal: Schema.Int;
184
+ readonly headingPath: Schema.String;
185
+ readonly byteStart: Schema.Int;
186
+ readonly byteEnd: Schema.Int;
187
+ readonly firstPage: Schema.NullOr<Schema.Int>;
188
+ readonly lastPage: Schema.NullOr<Schema.Int>;
189
+ readonly snippet: Schema.String;
190
+ readonly score: Schema.Finite;
191
+ }>>;
192
+ }>, Schema.Struct<{
193
+ readonly assetId: Schema.String;
194
+ readonly chunks: Schema.$Array<Schema.Struct<{
195
+ readonly ordinal: Schema.Int;
196
+ readonly content: Schema.NonEmptyString;
197
+ readonly headingPath: Schema.String;
198
+ readonly byteStart: Schema.Int;
199
+ readonly byteEnd: Schema.Int;
200
+ readonly firstPage: Schema.NullOr<Schema.Int>;
201
+ readonly lastPage: Schema.NullOr<Schema.Int>;
202
+ readonly id: Schema.String;
203
+ }>>;
204
+ }>]>>, Schema.toCodecJson<typeof HttpApiError.Unauthorized | typeof HttpApiError.Forbidden | typeof HttpApiError.InternalServerError | typeof AssetTextChunkInvalid | typeof AssetTextVersionChanged | typeof AssetNotFound>, never, never> | HttpApiEndpoint.HttpApiEndpoint<"list", "GET", "/api/assets", never, Schema.toCodecStringTree<Schema.Struct<{
205
+ readonly search: Schema.optionalKey<Schema.String>;
206
+ readonly kind: Schema.optionalKey<Schema.Literals<readonly ["image", "video", "caption", "document"]>>;
207
+ }>>, never, never, Schema.toCodecJson<Schema.Struct<{
208
+ readonly items: Schema.$Array<Schema.Struct<{
209
+ readonly id: Schema.String;
210
+ readonly name: Schema.NonEmptyString;
211
+ readonly mimeType: Schema.NonEmptyString;
212
+ readonly byteSize: Schema.Int;
213
+ readonly createdAt: Schema.Date;
214
+ readonly updatedAt: Schema.Date;
215
+ readonly url: Schema.optionalKey<Schema.String>;
216
+ }>>;
217
+ readonly stats: Schema.Struct<{
218
+ readonly assetCount: Schema.Int;
219
+ readonly storageUsedBytes: Schema.Int;
220
+ }>;
221
+ }>>, Schema.toCodecJson<typeof HttpApiError.Unauthorized | typeof HttpApiError.Forbidden | typeof HttpApiError.InternalServerError>, never, never>, false>>;
222
+ //# sourceMappingURL=api.group.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"api.group.d.ts","sourceRoot":"","sources":["../src/api.group.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAChC,OAAO,EACL,OAAO,EACP,eAAe,EACf,YAAY,EACZ,YAAY,EACZ,aAAa,EAEd,MAAM,iBAAiB,CAAC;AAEzB,OAAO,EAKL,aAAa,EAKb,qBAAqB,EACrB,uBAAuB,EACvB,kBAAkB,EAKnB,MAAM,aAAa,CAAC;AAYrB,eAAO,MAAM,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;0JAoGxB,CAAC;AAEJ,eAAO,MAAM,SAAS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;2JAGL,CAAC"}
@@ -0,0 +1,83 @@
1
+ import { Schema } from "effect";
2
+ import { HttpApi, HttpApiEndpoint, HttpApiError, HttpApiGroup, HttpApiSchema, OpenApi, } from "effect/http-api";
3
+ import packageJson from "../package.json" with { type: "json" };
4
+ import { AssetListSchema, AssetListQuerySchema, AssetDeleteResultSchema, AssetIdsPayloadSchema, AssetNotFound, AssetDetailsSchema, AssetChunksQuerySchema, AssetChunksResponseSchema, AssetParamsSchema, AssetTextChunkInvalid, AssetTextVersionChanged, AssetUploadInvalid, AssetUploadPayloadSchema, AssetUploadAttemptQuery, AssetUploadStartSchema, AssetUploadStateSchema, } from "./schema.js";
5
+ const internal = HttpApiError.InternalServerError;
6
+ const accessErrors = [HttpApiError.Unauthorized, HttpApiError.Forbidden];
7
+ const chunkErrors = [
8
+ ...accessErrors,
9
+ AssetNotFound,
10
+ AssetTextChunkInvalid,
11
+ AssetTextVersionChanged,
12
+ internal,
13
+ ];
14
+ export const AssetsApiGroup = HttpApiGroup.make("assets")
15
+ .annotateMerge(OpenApi.annotations({
16
+ title: "Assets",
17
+ description: "Manage organization files and retrieve text from processed documents.",
18
+ }))
19
+ .add(HttpApiEndpoint.get("list", "/assets", {
20
+ query: AssetListQuerySchema,
21
+ success: AssetListSchema,
22
+ error: [...accessErrors, internal],
23
+ }).annotateMerge(OpenApi.annotations({
24
+ summary: "List assets",
25
+ description: "Requires list access. Search filters filenames, not document text. There is no pagination. Stats cover the whole organization regardless of filters. File URLs are included only with read access.",
26
+ })), HttpApiEndpoint.get("file", "/assets/:assetId/file", {
27
+ params: AssetParamsSchema,
28
+ query: Schema.Struct({
29
+ download: Schema.optionalKey(Schema.Literal("1")),
30
+ v: Schema.optionalKey(Schema.String.check(Schema.isPattern(/^-?\d{1,16}$/))),
31
+ }).annotate({ identifier: "AssetFileQuery" }),
32
+ success: [HttpApiSchema.Empty(302), HttpApiSchema.StreamUint8Array()],
33
+ error: [...accessErrors, AssetNotFound, internal],
34
+ }).annotateMerge(OpenApi.annotations({
35
+ summary: "Open an asset file",
36
+ description: "Requires read access. The stable URL redirects to a temporary signed storage URL for previews. Add download=1 to receive the file as an attachment. The optional v parameter separates browser thumbnail cache entries; it does not select a historical file.",
37
+ })), HttpApiEndpoint.get("getAsset", "/assets/:assetId", {
38
+ params: AssetParamsSchema,
39
+ query: Schema.Struct({
40
+ ...AssetUploadAttemptQuery.fields,
41
+ outlineOffset: Schema.optionalKey(Schema.Int.check(Schema.isBetween({ minimum: 0, maximum: 100000 }))),
42
+ }).annotate({ identifier: "AssetDetailsQuery" }),
43
+ success: Schema.Union([AssetDetailsSchema, AssetUploadStateSchema]),
44
+ error: [...accessErrors, AssetNotFound, internal],
45
+ }).annotateMerge(OpenApi.annotations({
46
+ summary: "Get asset details or upload status",
47
+ description: "Returns details for a published asset with read access. Before publication the initiating actor can see uploadStatus. Pass attemptId to check a replacement without changing the published asset. Use nextOutlineOffset to continue the outline.",
48
+ })), HttpApiEndpoint.get("getAssetChunks", "/assets/:assetId/chunks", {
49
+ params: AssetParamsSchema,
50
+ query: AssetChunksQuerySchema,
51
+ success: AssetChunksResponseSchema,
52
+ error: chunkErrors,
53
+ }).annotateMerge(OpenApi.annotations({
54
+ summary: "Search or read document chunks",
55
+ description: "Requires read access. Use query to get up to eight keyword-search hits in English or French, or repeat ids to read one to four exact chunks. Do not mix the modes. Search resolves the current index automatically; stale or mismatched chunk IDs return 409. Use nextOffset for more hits.",
56
+ })), HttpApiEndpoint.post("createAssetUpload", "/assets", {
57
+ payload: AssetUploadPayloadSchema,
58
+ success: AssetUploadStartSchema,
59
+ error: [...accessErrors, AssetNotFound, AssetUploadInvalid, internal],
60
+ }).annotateMerge(OpenApi.annotations({
61
+ summary: "Start an asset upload",
62
+ description: "Requires create access, or update access when replacing a file. Returns a reserved assetId and, only for replacements, an attemptId. PUT the file to uploadUrl with the returned contentType, then call the asset completion route.",
63
+ })), HttpApiEndpoint.post("completeAssetUpload", "/assets/:assetId/complete", {
64
+ params: AssetParamsSchema,
65
+ query: AssetUploadAttemptQuery,
66
+ success: AssetUploadStateSchema,
67
+ error: [...accessErrors, AssetNotFound, AssetUploadInvalid, internal],
68
+ }).annotateMerge(OpenApi.annotations({
69
+ summary: "Submit an uploaded file for scanning",
70
+ description: "Call after the signed PUT succeeds. Pass attemptId only for replacements. Requires the initiating actor and the original create or update permission. Poll the asset URL for the result.",
71
+ })), HttpApiEndpoint.delete("deleteAssets", "/assets", {
72
+ payload: AssetIdsPayloadSchema,
73
+ success: AssetDeleteResultSchema,
74
+ error: [...accessErrors, internal],
75
+ }).annotateMerge(OpenApi.annotations({
76
+ summary: "Delete assets",
77
+ description: "Requires delete access. Returns deleted IDs and per-asset failures. Referenced assets are not deleted.",
78
+ })));
79
+ export const AssetsApi = HttpApi.make("AssetsApi")
80
+ .annotate(OpenApi.Version, packageJson.version)
81
+ .add(AssetsApiGroup)
82
+ .prefix("/api");
83
+ //# sourceMappingURL=api.group.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"api.group.js","sourceRoot":"","sources":["../src/api.group.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAChC,OAAO,EACL,OAAO,EACP,eAAe,EACf,YAAY,EACZ,YAAY,EACZ,aAAa,EACb,OAAO,GACR,MAAM,iBAAiB,CAAC;AACzB,OAAO,WAAW,MAAM,iBAAiB,CAAC,OAAO,IAAI,EAAE,MAAM,EAAE,CAAC;AAChE,OAAO,EACL,eAAe,EACf,oBAAoB,EACpB,uBAAuB,EACvB,qBAAqB,EACrB,aAAa,EACb,kBAAkB,EAClB,sBAAsB,EACtB,yBAAyB,EACzB,iBAAiB,EACjB,qBAAqB,EACrB,uBAAuB,EACvB,kBAAkB,EAClB,wBAAwB,EACxB,uBAAuB,EACvB,sBAAsB,EACtB,sBAAsB,GACvB,MAAM,aAAa,CAAC;AAErB,MAAM,QAAQ,GAAG,YAAY,CAAC,mBAAmB,CAAC;AAClD,MAAM,YAAY,GAAG,CAAC,YAAY,CAAC,YAAY,EAAE,YAAY,CAAC,SAAS,CAAC,CAAC;AACzE,MAAM,WAAW,GAAG;IAClB,GAAG,YAAY;IACf,aAAa;IACb,qBAAqB;IACrB,uBAAuB;IACvB,QAAQ;CACA,CAAC;AAEX,MAAM,CAAC,MAAM,cAAc,GAAG,YAAY,CAAC,IAAI,CAAC,QAAQ,CAAC;KACtD,aAAa,CACZ,OAAO,CAAC,WAAW,CAAC;IAClB,KAAK,EAAE,QAAQ;IACf,WAAW,EACT,uEAAuE;CAC1E,CAAC,CACH;KACA,GAAG,CACF,eAAe,CAAC,GAAG,CAAC,MAAM,EAAE,SAAS,EAAE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AAC;IAClB,OAAO,EAAE,sCAAsC;IAC/C,WAAW,EACT,0LAA0L;CAC7L,CAAC,CACH,EACD,eAAe,CAAC,MAAM,CAAC,cAAc,EAAE,SAAS,EAAE;IAChD,OAAO,EAAE,qBAAqB;IAC9B,OAAO,EAAE,uBAAuB;IAChC,KAAK,EAAE,CAAC,GAAG,YAAY,EAAE,QAAQ,CAAC;CACnC,CAAC,CAAC,aAAa,CACd,OAAO,CAAC,WAAW,CAAC;IAClB,OAAO,EAAE,eAAe;IACxB,WAAW,EACT,wGAAwG;CAC3G,CAAC,CACH,CACF,CAAC;AAEJ,MAAM,CAAC,MAAM,SAAS,GAAG,OAAO,CAAC,IAAI,CAAC,WAAW,CAAC;KAC/C,QAAQ,CAAC,OAAO,CAAC,OAAO,EAAE,WAAW,CAAC,OAAO,CAAC;KAC9C,GAAG,CAAC,cAAc,CAAC;KACnB,MAAM,CAAC,MAAM,CAAC,CAAC"}
package/dist/api.js ADDED
@@ -0,0 +1,2 @@
1
+ export { AssetsApi, AssetsApiGroup, AssetsContext, AssetsPolicy, CurrentAssetsContext, } from "./api.group.js";
2
+ //# sourceMappingURL=api.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"api.js","sourceRoot":"","sources":["../src/api.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,SAAS,EACT,cAAc,EACd,aAAa,EACb,YAAY,EACZ,oBAAoB,GACrB,MAAM,gBAAgB,CAAC"}