@krak-stack/assets 0.1.2 → 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.
- package/CHANGELOG.md +85 -0
- package/README.md +206 -14
- package/dist/access.d.ts +44 -0
- package/dist/access.d.ts.map +1 -0
- package/dist/access.js +56 -0
- package/dist/access.js.map +1 -0
- package/dist/api.builder.d.ts +100 -0
- package/dist/api.builder.d.ts.map +1 -0
- package/dist/api.builder.js +233 -0
- package/dist/api.builder.js.map +1 -0
- package/dist/api.d.ts +2 -0
- package/dist/api.d.ts.map +1 -0
- package/dist/api.group.d.ts +222 -0
- package/dist/api.group.d.ts.map +1 -0
- package/dist/api.group.js +83 -0
- package/dist/api.group.js.map +1 -0
- package/dist/api.js +2 -0
- package/dist/api.js.map +1 -0
- package/dist/catalog.d.ts +91 -0
- package/dist/catalog.d.ts.map +1 -0
- package/dist/catalog.js +52 -0
- package/dist/catalog.js.map +1 -0
- package/dist/client.d.ts +245 -0
- package/dist/client.d.ts.map +1 -0
- package/dist/client.js +8 -0
- package/dist/client.js.map +1 -0
- package/dist/commands.d.ts +55 -0
- package/dist/commands.d.ts.map +1 -0
- package/dist/commands.js +127 -0
- package/dist/commands.js.map +1 -0
- package/dist/components/asset-input/html.d.ts +70 -0
- package/dist/components/asset-input/html.d.ts.map +1 -0
- package/dist/components/asset-input/html.js +1549 -0
- package/dist/components/asset-input/html.js.map +1 -0
- package/dist/components/asset-input/index.d.ts +280 -0
- package/dist/components/asset-input/react.d.ts +32 -0
- package/dist/components/asset-input/react.d.ts.map +1 -0
- package/dist/components/asset-input/react.js +2269 -0
- package/dist/components/asset-input/react.js.map +1 -0
- package/dist/components/asset-input/schema.d.ts +93 -0
- package/dist/components/asset-input/upload.d.ts +15 -0
- package/dist/components/asset-table/html.d.ts +110 -0
- package/dist/components/asset-table/html.d.ts.map +1 -0
- package/dist/components/asset-table/html.js +4934 -0
- package/dist/components/asset-table/html.js.map +1 -0
- package/dist/components/asset-table/index.d.ts +225 -0
- package/dist/components/asset-table/react.d.ts +21 -0
- package/dist/components/asset-table/react.d.ts.map +1 -0
- package/dist/components/asset-table/react.js +8241 -0
- package/dist/components/asset-table/react.js.map +1 -0
- package/dist/components/asset-table/schema.d.ts +73 -0
- package/dist/index.d.ts +266 -10
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +245 -35
- package/dist/index.js.map +1 -1
- package/dist/migrations/0003_upload_publications.d.ts +5 -0
- package/dist/migrations/0003_upload_publications.d.ts.map +1 -0
- package/dist/migrations/0003_upload_publications.js +14 -0
- package/dist/migrations/0003_upload_publications.js.map +1 -0
- package/dist/migrations/0004_upload_intents.d.ts +5 -0
- package/dist/migrations/0004_upload_intents.d.ts.map +1 -0
- package/dist/migrations/0004_upload_intents.js +14 -0
- package/dist/migrations/0004_upload_intents.js.map +1 -0
- package/dist/migrations.d.ts.map +1 -1
- package/dist/migrations.js +4 -0
- package/dist/migrations.js.map +1 -1
- package/dist/queries.d.ts +6 -0
- package/dist/queries.d.ts.map +1 -0
- package/dist/queries.js +18 -0
- package/dist/queries.js.map +1 -0
- package/dist/retrieval.d.ts +6 -1
- package/dist/retrieval.d.ts.map +1 -1
- package/dist/retrieval.js +50 -19
- package/dist/retrieval.js.map +1 -1
- package/dist/schema.d.ts +165 -9
- package/dist/schema.d.ts.map +1 -1
- package/dist/schema.js +119 -2
- package/dist/schema.js.map +1 -1
- package/dist/services/assets/library.d.ts +221 -0
- package/dist/services/assets/library.d.ts.map +1 -0
- package/dist/services/assets/library.js +101 -0
- package/dist/services/assets/library.js.map +1 -0
- package/dist/services/assets/schema.d.ts +3 -0
- package/dist/services/assets/url.d.ts +12 -0
- package/dist/services/assets/use-library.d.ts +20 -0
- package/dist/workflow.d.ts +20 -0
- package/dist/workflow.d.ts.map +1 -1
- package/dist/workflow.js +10 -0
- package/dist/workflow.js.map +1 -1
- package/dist/workflows.d.ts +3 -0
- package/dist/workflows.d.ts.map +1 -1
- package/dist/workflows.js +53 -4
- package/dist/workflows.js.map +1 -1
- package/package.json +45 -11
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"react.js","sourceRoot":"","sources":["../../../src/components/asset-table/react.ts"],"names":[],"mappings":"AAAA,YAAY,CAAC;AAEb,cAAc,wCAAwC,CAAC"}
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import { Schema } from "effect";
|
|
2
|
+
export declare const AssetTableItemSchema: Schema.Struct<{
|
|
3
|
+
readonly id: Schema.NonEmptyString;
|
|
4
|
+
readonly name: Schema.String;
|
|
5
|
+
readonly mimeType: Schema.String;
|
|
6
|
+
readonly byteSize: Schema.Finite;
|
|
7
|
+
readonly createdAt: Schema.Date;
|
|
8
|
+
readonly updatedAt: Schema.Date;
|
|
9
|
+
/** Stable, authorized file URL. Do not pass an expiring signed URL. */
|
|
10
|
+
readonly url: Schema.optionalKey<Schema.String>;
|
|
11
|
+
}>;
|
|
12
|
+
export type AssetTableItem = typeof AssetTableItemSchema.Type;
|
|
13
|
+
export declare const AssetTableMessagesSchema: Schema.$Record<Schema.String, Schema.Struct<{
|
|
14
|
+
readonly id: Schema.optionalKey<Schema.String>;
|
|
15
|
+
readonly name: Schema.optionalKey<Schema.String>;
|
|
16
|
+
readonly type: Schema.optionalKey<Schema.String>;
|
|
17
|
+
readonly size: Schema.optionalKey<Schema.String>;
|
|
18
|
+
readonly created: Schema.optionalKey<Schema.String>;
|
|
19
|
+
readonly updated: Schema.optionalKey<Schema.String>;
|
|
20
|
+
readonly download: Schema.optionalKey<Schema.String>;
|
|
21
|
+
readonly replace: Schema.optionalKey<Schema.String>;
|
|
22
|
+
readonly delete: Schema.optionalKey<Schema.String>;
|
|
23
|
+
readonly deleteSelected: Schema.optionalKey<Schema.String>;
|
|
24
|
+
readonly empty: Schema.optionalKey<Schema.String>;
|
|
25
|
+
readonly loadFailed: Schema.optionalKey<Schema.String>;
|
|
26
|
+
readonly deleteFailed: Schema.optionalKey<Schema.String>;
|
|
27
|
+
readonly title: Schema.optionalKey<Schema.String>;
|
|
28
|
+
readonly copyLink: Schema.optionalKey<Schema.String>;
|
|
29
|
+
readonly linkCopied: Schema.optionalKey<Schema.String>;
|
|
30
|
+
readonly copyLinkUnavailable: Schema.optionalKey<Schema.String>;
|
|
31
|
+
readonly close: Schema.optionalKey<Schema.String>;
|
|
32
|
+
}>>;
|
|
33
|
+
export declare const AssetTablePropsSchema: Schema.Struct<{
|
|
34
|
+
readonly assets: Schema.optionalKey<Schema.$Array<Schema.Struct<{
|
|
35
|
+
readonly id: Schema.NonEmptyString;
|
|
36
|
+
readonly name: Schema.String;
|
|
37
|
+
readonly mimeType: Schema.String;
|
|
38
|
+
readonly byteSize: Schema.Finite;
|
|
39
|
+
readonly createdAt: Schema.Date;
|
|
40
|
+
readonly updatedAt: Schema.Date;
|
|
41
|
+
/** Stable, authorized file URL. Do not pass an expiring signed URL. */
|
|
42
|
+
readonly url: Schema.optionalKey<Schema.String>;
|
|
43
|
+
}>>>;
|
|
44
|
+
readonly access: Schema.optionalKey<Schema.Struct<{
|
|
45
|
+
readonly scopeKey: Schema.NonEmptyString;
|
|
46
|
+
readonly permissions: Schema.$Array<Schema.Literals<readonly ["list", "read", "create", "update", "delete"]>>;
|
|
47
|
+
}>>;
|
|
48
|
+
readonly locale: Schema.optionalKey<Schema.String>;
|
|
49
|
+
readonly timeZone: Schema.optionalKey<Schema.String>;
|
|
50
|
+
readonly messages: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Struct<{
|
|
51
|
+
readonly id: Schema.optionalKey<Schema.String>;
|
|
52
|
+
readonly name: Schema.optionalKey<Schema.String>;
|
|
53
|
+
readonly type: Schema.optionalKey<Schema.String>;
|
|
54
|
+
readonly size: Schema.optionalKey<Schema.String>;
|
|
55
|
+
readonly created: Schema.optionalKey<Schema.String>;
|
|
56
|
+
readonly updated: Schema.optionalKey<Schema.String>;
|
|
57
|
+
readonly download: Schema.optionalKey<Schema.String>;
|
|
58
|
+
readonly replace: Schema.optionalKey<Schema.String>;
|
|
59
|
+
readonly delete: Schema.optionalKey<Schema.String>;
|
|
60
|
+
readonly deleteSelected: Schema.optionalKey<Schema.String>;
|
|
61
|
+
readonly empty: Schema.optionalKey<Schema.String>;
|
|
62
|
+
readonly loadFailed: Schema.optionalKey<Schema.String>;
|
|
63
|
+
readonly deleteFailed: Schema.optionalKey<Schema.String>;
|
|
64
|
+
readonly title: Schema.optionalKey<Schema.String>;
|
|
65
|
+
readonly copyLink: Schema.optionalKey<Schema.String>;
|
|
66
|
+
readonly linkCopied: Schema.optionalKey<Schema.String>;
|
|
67
|
+
readonly copyLinkUnavailable: Schema.optionalKey<Schema.String>;
|
|
68
|
+
readonly close: Schema.optionalKey<Schema.String>;
|
|
69
|
+
}>>>;
|
|
70
|
+
}>;
|
|
71
|
+
export type AssetTableSharedProps = typeof AssetTablePropsSchema.Type;
|
|
72
|
+
export declare const AssetActionSchema: Schema.Literals<readonly ["download", "copyLink", "replace", "delete"]>;
|
|
73
|
+
export type AssetAction = typeof AssetActionSchema.Type;
|
package/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
import { Context, Effect, Layer, Schema } from "effect";
|
|
2
2
|
import { SqlClient } from "effect/sql";
|
|
3
3
|
import { S3Service } from "@krak-stack/registry/service-s3";
|
|
4
|
+
import { ClamAV } from "@krak-stack/registry/clamav";
|
|
5
|
+
import { type AssetsAuthorization } from "./access.js";
|
|
6
|
+
export { AssetsAccess, type AssetsAuthorization, type AssetsPermissionMatrix, } from "./access.js";
|
|
4
7
|
import { AssetInUse, AssetNotFound, AssetUploadInvalid, type AssetUploadCompletionPayload, type AssetUploadPayload, AssetIndexedTextSchema } from "./schema.js";
|
|
5
8
|
import { type AssetProcessingOptions } from "./processing.js";
|
|
6
9
|
declare const Assets_base: Context.ServiceClass<Assets, "Assets", {
|
|
@@ -26,11 +29,11 @@ declare const Assets_base: Context.ServiceClass<Assets, "Assets", {
|
|
|
26
29
|
}, AssetNotFound | import("effect/Cause").NoSuchElementError | Schema.SchemaError | import("effect/sql/SqlError").SqlError, import("effect/workflow/WorkflowEngine").WorkflowEngine>;
|
|
27
30
|
searchChunks: (input: {
|
|
28
31
|
readonly assetId: string;
|
|
29
|
-
readonly processingId: string;
|
|
30
32
|
readonly query: string;
|
|
31
33
|
readonly language: "en" | "fr";
|
|
32
34
|
readonly offset?: number | undefined;
|
|
33
35
|
readonly headingPath?: string | undefined;
|
|
36
|
+
readonly processingId?: string | undefined;
|
|
34
37
|
readonly organizationId: string;
|
|
35
38
|
}) => Effect.Effect<{
|
|
36
39
|
assetId: string;
|
|
@@ -55,6 +58,11 @@ declare const Assets_base: Context.ServiceClass<Assets, "Assets", {
|
|
|
55
58
|
readonly ordinals: readonly number[];
|
|
56
59
|
readonly includeNeighbors?: boolean | undefined;
|
|
57
60
|
readonly organizationId: string;
|
|
61
|
+
} | {
|
|
62
|
+
readonly assetId: string;
|
|
63
|
+
readonly organizationId: string;
|
|
64
|
+
readonly ids: readonly string[];
|
|
65
|
+
readonly includeNeighbors?: boolean | undefined;
|
|
58
66
|
}) => Effect.Effect<{
|
|
59
67
|
assetId: string;
|
|
60
68
|
processingId: string;
|
|
@@ -72,6 +80,8 @@ declare const Assets_base: Context.ServiceClass<Assets, "Assets", {
|
|
|
72
80
|
}, AssetNotFound | import("./schema.js").AssetTextChunkInvalid | import("./schema.js").AssetTextVersionChanged | Schema.SchemaError | import("effect/sql/SqlError").SqlError, never>;
|
|
73
81
|
list: (request: {
|
|
74
82
|
readonly organizationId: string;
|
|
83
|
+
readonly search?: string | undefined;
|
|
84
|
+
readonly kind?: "caption" | "document" | "image" | "video" | undefined;
|
|
75
85
|
}) => Effect.Effect<{
|
|
76
86
|
readonly id: string;
|
|
77
87
|
readonly organizationId: string;
|
|
@@ -87,20 +97,65 @@ declare const Assets_base: Context.ServiceClass<Assets, "Assets", {
|
|
|
87
97
|
readonly updatedAt: Date;
|
|
88
98
|
readonly objectKey: string;
|
|
89
99
|
}[], Schema.SchemaError | import("effect/sql/SqlError").SqlError, never>;
|
|
90
|
-
|
|
91
|
-
organizationId: string;
|
|
100
|
+
query: (request: {
|
|
101
|
+
readonly organizationId: string;
|
|
102
|
+
readonly search?: string | undefined;
|
|
103
|
+
readonly kind?: "caption" | "document" | "image" | "video" | undefined;
|
|
92
104
|
}) => Effect.Effect<{
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
105
|
+
items: {
|
|
106
|
+
readonly id: string;
|
|
107
|
+
readonly organizationId: string;
|
|
108
|
+
readonly name: string;
|
|
109
|
+
readonly mimeType: string;
|
|
110
|
+
readonly byteSize: number;
|
|
111
|
+
readonly checksum: string;
|
|
112
|
+
readonly metadata: {
|
|
113
|
+
readonly [x: string]: unknown;
|
|
114
|
+
};
|
|
115
|
+
readonly createdBy: string;
|
|
116
|
+
readonly createdAt: Date;
|
|
117
|
+
readonly updatedAt: Date;
|
|
118
|
+
readonly objectKey: string;
|
|
119
|
+
}[];
|
|
120
|
+
stats: {
|
|
121
|
+
readonly assetCount: number;
|
|
122
|
+
readonly storageUsedBytes: number;
|
|
123
|
+
};
|
|
124
|
+
}, import("effect/Cause").NoSuchElementError | Schema.SchemaError | import("effect/sql/SqlError").SqlError, never>;
|
|
125
|
+
stats: (request: {
|
|
126
|
+
readonly organizationId: string;
|
|
127
|
+
}) => Effect.Effect<{
|
|
128
|
+
readonly assetCount: number;
|
|
129
|
+
readonly storageUsedBytes: number;
|
|
130
|
+
}, import("effect/Cause").NoSuchElementError | Schema.SchemaError | import("effect/sql/SqlError").SqlError, never>;
|
|
96
131
|
createUpload: (args_0: {
|
|
97
132
|
organizationId: string;
|
|
98
133
|
payload: AssetUploadPayload;
|
|
99
134
|
}) => Effect.Effect<{
|
|
100
|
-
uploadToken:
|
|
135
|
+
uploadToken: string;
|
|
136
|
+
uploadUrl: string;
|
|
137
|
+
contentType: string;
|
|
138
|
+
}, AssetNotFound | AssetUploadInvalid | import("@krak-stack/registry/service-s3/schema").S3ServiceError | Schema.SchemaError | import("effect/sql/SqlError").SqlError, never>;
|
|
139
|
+
beginUpload: (args_0: {
|
|
140
|
+
organizationId: string;
|
|
141
|
+
createdBy: string;
|
|
142
|
+
payload: AssetUploadPayload;
|
|
143
|
+
}) => Effect.Effect<{
|
|
144
|
+
uploadToken: string;
|
|
101
145
|
uploadUrl: string;
|
|
102
146
|
contentType: string;
|
|
103
147
|
}, AssetNotFound | AssetUploadInvalid | import("@krak-stack/registry/service-s3/schema").S3ServiceError | Schema.SchemaError | import("effect/sql/SqlError").SqlError, never>;
|
|
148
|
+
getUploadIntent: (args_0: {
|
|
149
|
+
readonly organizationId: string;
|
|
150
|
+
readonly createdBy: string;
|
|
151
|
+
readonly uploadToken: string;
|
|
152
|
+
}) => Effect.Effect<{
|
|
153
|
+
readonly name: string;
|
|
154
|
+
readonly mimeType: string;
|
|
155
|
+
readonly byteSize: number;
|
|
156
|
+
readonly checksum: string;
|
|
157
|
+
readonly assetId?: string | undefined;
|
|
158
|
+
}, AssetUploadInvalid | Schema.SchemaError | import("effect/sql/SqlError").SqlError, never>;
|
|
104
159
|
completeUpload: (args_0: {
|
|
105
160
|
organizationId: string;
|
|
106
161
|
createdBy: string;
|
|
@@ -120,12 +175,67 @@ declare const Assets_base: Context.ServiceClass<Assets, "Assets", {
|
|
|
120
175
|
readonly updatedAt: Date;
|
|
121
176
|
readonly objectKey: string;
|
|
122
177
|
}, AssetNotFound | AssetUploadInvalid | import("effect/Cause").NoSuchElementError | import("@krak-stack/registry/service-s3/schema").S3ServiceError | Schema.SchemaError | import("effect/sql/SqlError").SqlError, import("effect/workflow/WorkflowEngine").WorkflowEngine>;
|
|
178
|
+
queueUploadScan: (args_0: {
|
|
179
|
+
organizationId: string;
|
|
180
|
+
createdBy: string;
|
|
181
|
+
payload: AssetUploadCompletionPayload;
|
|
182
|
+
}) => Effect.Effect<{
|
|
183
|
+
readonly uploadToken: string;
|
|
184
|
+
readonly status: "failed" | "invalid" | "pending" | "published" | "rejected" | "unscannable";
|
|
185
|
+
readonly assetId: string | null;
|
|
186
|
+
}, AssetUploadInvalid | import("@krak-stack/registry/service-s3/schema").S3ServiceError | Schema.SchemaError | import("effect/sql/SqlError").SqlError, import("effect/workflow/WorkflowEngine").WorkflowEngine>;
|
|
187
|
+
getUploadScan: (input: {
|
|
188
|
+
readonly organizationId: string;
|
|
189
|
+
readonly createdBy: string;
|
|
190
|
+
readonly uploadToken: string;
|
|
191
|
+
}) => Effect.Effect<{
|
|
192
|
+
readonly uploadToken: string;
|
|
193
|
+
readonly status: "failed" | "invalid" | "pending" | "published" | "rejected" | "unscannable";
|
|
194
|
+
readonly assetId: string | null;
|
|
195
|
+
}, Schema.SchemaError | import("effect/sql/SqlError").SqlError, import("effect/workflow/WorkflowEngine").WorkflowEngine>;
|
|
196
|
+
validateAndPublishUpload: (key: {
|
|
197
|
+
readonly organizationId: string;
|
|
198
|
+
readonly createdBy: string;
|
|
199
|
+
readonly uploadToken: string;
|
|
200
|
+
}, request: {
|
|
201
|
+
readonly payload: {
|
|
202
|
+
readonly name: string;
|
|
203
|
+
readonly mimeType: string;
|
|
204
|
+
readonly byteSize: number;
|
|
205
|
+
readonly checksum: string;
|
|
206
|
+
readonly assetId?: string | undefined;
|
|
207
|
+
};
|
|
208
|
+
readonly assetId: string;
|
|
209
|
+
readonly previousObjectKey?: string | undefined;
|
|
210
|
+
}, executionId: string) => Effect.Effect<{
|
|
211
|
+
readonly uploadToken: string;
|
|
212
|
+
readonly status: "failed" | "invalid" | "pending" | "published" | "rejected" | "unscannable";
|
|
213
|
+
readonly assetId: string | null;
|
|
214
|
+
}, string | AssetUploadInvalid | import("@krak-stack/registry/clamav").ClamAVError | import("@krak-stack/registry/service-s3/schema").S3ServiceError | Schema.SchemaError | import("effect/sql/SqlError").SqlError | import("effect/Cause").TimeoutError, never>;
|
|
215
|
+
processScannedUpload: (organizationId: string, request: {
|
|
216
|
+
readonly payload: {
|
|
217
|
+
readonly name: string;
|
|
218
|
+
readonly mimeType: string;
|
|
219
|
+
readonly byteSize: number;
|
|
220
|
+
readonly checksum: string;
|
|
221
|
+
readonly assetId?: string | undefined;
|
|
222
|
+
};
|
|
223
|
+
readonly assetId: string;
|
|
224
|
+
readonly previousObjectKey?: string | undefined;
|
|
225
|
+
}, executionId: string) => Effect.Effect<void, import("effect/Cause").NoSuchElementError | Schema.SchemaError | import("effect/sql/SqlError").SqlError, import("effect/workflow/WorkflowEngine").WorkflowEngine>;
|
|
123
226
|
download: (args_0: {
|
|
124
227
|
organizationId: string;
|
|
125
228
|
assetId: string;
|
|
126
229
|
}) => Effect.Effect<{
|
|
127
230
|
url: string;
|
|
128
231
|
}, AssetNotFound | import("@krak-stack/registry/service-s3/schema").S3ServiceError | Schema.SchemaError | import("effect/sql/SqlError").SqlError, never>;
|
|
232
|
+
downloadAttachment: (args_0: {
|
|
233
|
+
organizationId: string;
|
|
234
|
+
assetId: string;
|
|
235
|
+
}) => Effect.Effect<{
|
|
236
|
+
name: string;
|
|
237
|
+
body: ReadableStream<Uint8Array<ArrayBuffer>>;
|
|
238
|
+
}, AssetNotFound | import("@krak-stack/registry/service-s3/schema").S3ServiceError | Schema.SchemaError | import("effect/sql/SqlError").SqlError, never>;
|
|
129
239
|
readText: (args_0: {
|
|
130
240
|
organizationId: string;
|
|
131
241
|
assetId: string;
|
|
@@ -173,10 +283,156 @@ declare const Assets_base: Context.ServiceClass<Assets, "Assets", {
|
|
|
173
283
|
failProcessing: (processingId: string, failure: string) => Effect.Effect<void, string, never>;
|
|
174
284
|
}>;
|
|
175
285
|
export declare class Assets extends Assets_base {
|
|
176
|
-
static readonly
|
|
286
|
+
static readonly apiLayer: (access?: AssetsAuthorization) => Layer.Layer<never, never, import("effect/FileSystem").FileSystem | import("effect/http/Etag").Generator | import("effect/http/HttpPlatform").HttpPlatform | import("effect/http/HttpRouter").HttpRouter | import("effect/Path").Path | (import("effect/http/HttpRouter").Request<"Requires", Assets> | import("effect/http/HttpRouter").Request<"Requires", import("effect/workflow/WorkflowEngine").WorkflowEngine>)>;
|
|
287
|
+
static readonly apiHandlers: (access?: AssetsAuthorization) => {
|
|
288
|
+
list: (input: {
|
|
289
|
+
readonly query: {
|
|
290
|
+
readonly search?: string | undefined;
|
|
291
|
+
readonly kind?: "caption" | "document" | "image" | "video" | undefined;
|
|
292
|
+
};
|
|
293
|
+
readonly request: import("effect/http/HttpServerRequest").HttpServerRequest;
|
|
294
|
+
}) => Effect.Effect<{
|
|
295
|
+
items: {
|
|
296
|
+
id: string;
|
|
297
|
+
name: string;
|
|
298
|
+
mimeType: string;
|
|
299
|
+
byteSize: number;
|
|
300
|
+
createdAt: Date;
|
|
301
|
+
updatedAt: Date;
|
|
302
|
+
url?: string | undefined;
|
|
303
|
+
}[];
|
|
304
|
+
stats: {
|
|
305
|
+
readonly assetCount: number;
|
|
306
|
+
readonly storageUsedBytes: number;
|
|
307
|
+
};
|
|
308
|
+
}, import("effect/http-api/HttpApiError").Forbidden | import("effect/http-api/HttpApiError").InternalServerError | import("effect/http-api/HttpApiError").Unauthorized, Assets | import("effect/http/HttpServerRequest").HttpServerRequest>;
|
|
309
|
+
file: (input: {
|
|
310
|
+
readonly params: {
|
|
311
|
+
readonly assetId: string;
|
|
312
|
+
};
|
|
313
|
+
readonly query: {
|
|
314
|
+
readonly download?: "1" | undefined;
|
|
315
|
+
readonly v?: string | undefined;
|
|
316
|
+
};
|
|
317
|
+
readonly request: import("effect/http/HttpServerRequest").HttpServerRequest;
|
|
318
|
+
}) => Effect.Effect<import("effect/http/HttpServerResponse").HttpServerResponse, AssetNotFound | import("effect/http-api/HttpApiError").Forbidden | import("effect/http-api/HttpApiError").InternalServerError | import("effect/http-api/HttpApiError").Unauthorized, Assets>;
|
|
319
|
+
getAsset: (input: {
|
|
320
|
+
readonly params: {
|
|
321
|
+
readonly assetId: string;
|
|
322
|
+
};
|
|
323
|
+
readonly query: {
|
|
324
|
+
readonly attemptId?: string | undefined;
|
|
325
|
+
readonly outlineOffset?: number | undefined;
|
|
326
|
+
};
|
|
327
|
+
readonly request: import("effect/http/HttpServerRequest").HttpServerRequest;
|
|
328
|
+
}) => Effect.Effect<{
|
|
329
|
+
id: string;
|
|
330
|
+
name: string;
|
|
331
|
+
mimeType: string;
|
|
332
|
+
status: "completed" | "failed" | "pending" | "running" | "unsupported";
|
|
333
|
+
totalBytes: number;
|
|
334
|
+
totalChunks: number;
|
|
335
|
+
failure: string | null;
|
|
336
|
+
outline: {
|
|
337
|
+
readonly headingPath: string;
|
|
338
|
+
readonly firstOrdinal: number;
|
|
339
|
+
readonly lastOrdinal: number;
|
|
340
|
+
}[];
|
|
341
|
+
nextOutlineOffset: number | null;
|
|
342
|
+
url: string;
|
|
343
|
+
} | {
|
|
344
|
+
assetId: string;
|
|
345
|
+
attemptId?: string | undefined;
|
|
346
|
+
uploadStatus: "failed" | "invalid" | "pending" | "published" | "rejected" | "unscannable";
|
|
347
|
+
}, AssetNotFound | import("effect/http-api/HttpApiError").Forbidden | import("effect/http-api/HttpApiError").InternalServerError | import("effect/http-api/HttpApiError").Unauthorized, Assets | import("effect/http/HttpServerRequest").HttpServerRequest | import("effect/workflow/WorkflowEngine").WorkflowEngine>;
|
|
348
|
+
getAssetChunks: (input: {
|
|
349
|
+
readonly params: {
|
|
350
|
+
readonly assetId: string;
|
|
351
|
+
};
|
|
352
|
+
readonly query: {
|
|
353
|
+
readonly query?: string | undefined;
|
|
354
|
+
readonly language?: "en" | "fr" | undefined;
|
|
355
|
+
readonly offset?: number | undefined;
|
|
356
|
+
readonly headingPath?: string | undefined;
|
|
357
|
+
readonly ids?: readonly string[] | undefined;
|
|
358
|
+
readonly includeNeighbors?: boolean | undefined;
|
|
359
|
+
};
|
|
360
|
+
readonly request: import("effect/http/HttpServerRequest").HttpServerRequest;
|
|
361
|
+
}) => Effect.Effect<{
|
|
362
|
+
assetId: string;
|
|
363
|
+
chunks: {
|
|
364
|
+
ordinal: number;
|
|
365
|
+
content: string;
|
|
366
|
+
headingPath: string;
|
|
367
|
+
byteStart: number;
|
|
368
|
+
byteEnd: number;
|
|
369
|
+
firstPage: number | null;
|
|
370
|
+
lastPage: number | null;
|
|
371
|
+
id: string;
|
|
372
|
+
}[];
|
|
373
|
+
hits?: undefined;
|
|
374
|
+
nextOffset?: undefined;
|
|
375
|
+
} | {
|
|
376
|
+
chunks?: undefined;
|
|
377
|
+
assetId: string;
|
|
378
|
+
hits: {
|
|
379
|
+
id: string;
|
|
380
|
+
ordinal: number;
|
|
381
|
+
headingPath: string;
|
|
382
|
+
byteStart: number;
|
|
383
|
+
byteEnd: number;
|
|
384
|
+
firstPage: number | null;
|
|
385
|
+
lastPage: number | null;
|
|
386
|
+
snippet: string;
|
|
387
|
+
score: number;
|
|
388
|
+
}[];
|
|
389
|
+
nextOffset: number | null;
|
|
390
|
+
}, AssetNotFound | import("./schema.js").AssetTextChunkInvalid | import("./schema.js").AssetTextVersionChanged | import("effect/http-api/HttpApiError").Forbidden | import("effect/http-api/HttpApiError").InternalServerError | import("effect/http-api/HttpApiError").Unauthorized, Assets | import("effect/http/HttpServerRequest").HttpServerRequest>;
|
|
391
|
+
createAssetUpload: (input: {
|
|
392
|
+
readonly payload: {
|
|
393
|
+
readonly name: string;
|
|
394
|
+
readonly mimeType: string;
|
|
395
|
+
readonly byteSize: number;
|
|
396
|
+
readonly checksum: string;
|
|
397
|
+
readonly assetId?: string | undefined;
|
|
398
|
+
};
|
|
399
|
+
readonly request: import("effect/http/HttpServerRequest").HttpServerRequest;
|
|
400
|
+
}) => Effect.Effect<{
|
|
401
|
+
uploadUrl: string;
|
|
402
|
+
contentType: string;
|
|
403
|
+
assetId: string;
|
|
404
|
+
attemptId?: string | undefined;
|
|
405
|
+
}, AssetNotFound | AssetUploadInvalid | import("effect/http-api/HttpApiError").Forbidden | import("effect/http-api/HttpApiError").InternalServerError | import("effect/http-api/HttpApiError").Unauthorized, Assets>;
|
|
406
|
+
completeAssetUpload: (input: {
|
|
407
|
+
readonly params: {
|
|
408
|
+
readonly assetId: string;
|
|
409
|
+
};
|
|
410
|
+
readonly query: {
|
|
411
|
+
readonly attemptId?: string | undefined;
|
|
412
|
+
};
|
|
413
|
+
readonly request: import("effect/http/HttpServerRequest").HttpServerRequest;
|
|
414
|
+
}) => Effect.Effect<{
|
|
415
|
+
assetId: string;
|
|
416
|
+
attemptId?: string | undefined;
|
|
417
|
+
uploadStatus: "failed" | "invalid" | "pending" | "published" | "rejected" | "unscannable";
|
|
418
|
+
}, AssetNotFound | AssetUploadInvalid | import("effect/http-api/HttpApiError").Forbidden | import("effect/http-api/HttpApiError").InternalServerError | import("effect/http-api/HttpApiError").Unauthorized, Assets | import("effect/workflow/WorkflowEngine").WorkflowEngine>;
|
|
419
|
+
deleteAssets: (input: {
|
|
420
|
+
readonly payload: {
|
|
421
|
+
readonly ids: readonly string[];
|
|
422
|
+
};
|
|
423
|
+
readonly request: import("effect/http/HttpServerRequest").HttpServerRequest;
|
|
424
|
+
}) => Effect.Effect<{
|
|
425
|
+
deletedIds: string[];
|
|
426
|
+
failures: {
|
|
427
|
+
id: string;
|
|
428
|
+
reason: "in_use" | "not_found";
|
|
429
|
+
}[];
|
|
430
|
+
}, import("effect/http-api/HttpApiError").Forbidden | import("effect/http-api/HttpApiError").InternalServerError | import("effect/http-api/HttpApiError").Unauthorized, Assets>;
|
|
431
|
+
};
|
|
177
432
|
static readonly layerWithoutMigrationsWith: (options: Partial<AssetProcessingOptions>) => Layer.Layer<Assets, Schema.SchemaError, S3Service | SqlClient.SqlClient>;
|
|
178
|
-
static readonly
|
|
433
|
+
static readonly layerWithoutMigrations: Layer.Layer<Assets, Schema.SchemaError, S3Service | SqlClient.SqlClient>;
|
|
179
434
|
static readonly layerWith: (options: Partial<AssetProcessingOptions>) => Layer.Layer<Assets, import("effect/sql/Migrator").MigrationError | Schema.SchemaError | import("effect/sql/SqlError").SqlError, S3Service | SqlClient.SqlClient>;
|
|
435
|
+
static readonly layer: Layer.Layer<Assets, import("effect/sql/Migrator").MigrationError | Schema.SchemaError | import("effect/sql/SqlError").SqlError, S3Service | SqlClient.SqlClient>;
|
|
436
|
+
static readonly layerWithMalwareScanning: Layer.Layer<Assets, import("effect/sql/Migrator").MigrationError | Schema.SchemaError | import("effect/sql/SqlError").SqlError, ClamAV | S3Service | SqlClient.SqlClient>;
|
|
180
437
|
}
|
|
181
|
-
export {};
|
|
182
438
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,OAAO,EAEL,OAAO,EACP,MAAM,EAEN,KAAK,EAEL,MAAM,EAGP,MAAM,QAAQ,CAAC;AAChB,OAAO,EAAE,SAAS,EAAa,MAAM,YAAY,CAAC;AAElD,OAAO,EAAE,SAAS,EAAE,MAAM,iCAAiC,CAAC;AAC5D,OAAO,EAAE,MAAM,EAAE,MAAM,6BAA6B,CAAC;AACrD,OAAO,EAAgB,KAAK,mBAAmB,EAAE,MAAM,aAAa,CAAC;AAErE,OAAO,EACL,YAAY,EACZ,KAAK,mBAAmB,EACxB,KAAK,sBAAsB,GAC5B,MAAM,aAAa,CAAC;AAErB,OAAO,EACL,UAAU,EAEV,aAAa,EACb,kBAAkB,EASlB,KAAK,4BAA4B,EACjC,KAAK,kBAAkB,EAOvB,sBAAsB,EACvB,MAAM,aAAa,CAAC;AACrB,OAAO,EAGL,KAAK,sBAAsB,EAE5B,MAAM,iBAAiB,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;wBAkIH,MAAM;iBACb,kBAAkB;;;;;;;wBAiCX,MAAM;mBACX,MAAM;iBACR,kBAAkB;;;;;;;;;;;;;;;;;;wBA2CX,MAAM;mBACX,MAAM;iBACR,4BAA4B;;;;;;;;;;;;;;;;;wBAyHrB,MAAM;mBACX,MAAM;iBACR,4BAA4B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;wBAsLrB,MAAM;iBACb,MAAM;;;;;wBAkBG,MAAM;iBACb,MAAM;;;;;;wBAgBD,MAAM;iBACb,MAAM;kBACL,MAAM;;;;;;;;;wBA6MA,MAAM;iBACb,MAAM;;;;;;;;;;;;;;;;uCAuCoB,MAAM;;;;;;;;;;;;;;sCAKzB,MAAM,aACT,OAAO,sBAAsB,CAAC,IAAI;mCAKhB,MAAM,WAAW,MAAM;;AAO5D,qBAAa,MAAO,SAAQ,WAGf;IACX,MAAM,CAAC,QAAQ,CAAC,QAAQ,YAAY,mBAAmB,4ZACpB;IACnC,MAAM,CAAC,QAAQ,CAAC,WAAW,YAAY,mBAAmB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;MACvB;IAEnC,MAAM,CAAC,QAAQ,CAAC,0BAA0B,YAC/B,OAAO,CAAC,sBAAsB,CAAC,8EAgBtC;IAEJ,MAAM,CAAC,QAAQ,CAAC,sBAAsB,2EAAuC;IAE7E,MAAM,CAAC,QAAQ,CAAC,SAAS,YAAa,OAAO,CAAC,sBAAsB,CAAC,sKAGjE;IAEJ,MAAM,CAAC,QAAQ,CAAC,KAAK,mKAAsB;IAE3C,MAAM,CAAC,QAAQ,CAAC,wBAAwB,4KAGD;CACxC"}
|