@plyaz/types 1.35.4 → 1.36.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/api/index.cjs +199 -1
- package/dist/api/index.cjs.map +1 -1
- package/dist/api/index.js +199 -1
- package/dist/api/index.js.map +1 -1
- package/dist/auth/index.cjs +1 -2
- package/dist/auth/index.cjs.map +1 -1
- package/dist/auth/index.js +1 -2
- package/dist/auth/index.js.map +1 -1
- package/dist/campaign/schemas.d.ts +1 -1
- package/dist/core/domain/files/enums.d.ts +36 -0
- package/dist/core/domain/files/index.d.ts +6 -1
- package/dist/core/domain/files/schemas.d.ts +183 -0
- package/dist/core/domain/files/streaming.d.ts +167 -0
- package/dist/core/domain/files/types.d.ts +5 -67
- package/dist/core/events/index.d.ts +2 -0
- package/dist/core/events/streaming/index.d.ts +18 -0
- package/dist/core/events/streaming/responses.d.ts +164 -0
- package/dist/core/events/streaming/types.d.ts +408 -0
- package/dist/core/frontend/index.d.ts +1 -1
- package/dist/core/frontend/types.d.ts +179 -5
- package/dist/core/index.cjs +221 -0
- package/dist/core/index.cjs.map +1 -1
- package/dist/core/index.d.ts +1 -1
- package/dist/core/index.js +192 -1
- package/dist/core/index.js.map +1 -1
- package/dist/core/init/index.d.ts +1 -1
- package/dist/core/init/types.d.ts +51 -0
- package/dist/errors/codes.d.ts +47 -0
- package/dist/errors/enums.d.ts +1 -0
- package/dist/errors/index.cjs +231 -1
- package/dist/errors/index.cjs.map +1 -1
- package/dist/errors/index.js +231 -2
- package/dist/errors/index.js.map +1 -1
- package/dist/errors/types.d.ts +15 -0
- package/dist/examples/schemas.d.ts +1 -1
- package/dist/index.cjs +450 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +420 -2
- package/dist/index.js.map +1 -1
- package/dist/store/files/index.d.ts +1 -1
- package/dist/store/files/types.d.ts +47 -1
- package/dist/store/index.d.ts +1 -0
- package/dist/store/stream/index.d.ts +9 -0
- package/dist/store/stream/types.d.ts +303 -0
- package/dist/store/types.d.ts +3 -0
- package/package.json +1 -1
|
@@ -11,6 +11,7 @@ import type { RootStoreSlice, RootStoreHook } from '../../store';
|
|
|
11
11
|
import type { CoreBaseDomainServiceConfig } from '../domain';
|
|
12
12
|
import type { CoreBaseServiceConfig, CoreBaseMapperInstance, CoreBaseValidatorInstance } from '../domain';
|
|
13
13
|
import type { CoreDomainServiceInstance, CoreObservabilityConfig, CoreServiceEntry } from '../init';
|
|
14
|
+
import type { PackageErrorLike } from '../../errors';
|
|
14
15
|
/**
|
|
15
16
|
* Base store interface for frontend services.
|
|
16
17
|
*
|
|
@@ -971,6 +972,94 @@ export interface CorePlyazStoreConfig {
|
|
|
971
972
|
/** Callback when a flag value changes */
|
|
972
973
|
onFlagChange?: (key: string, prevValue: FeatureFlagValue | undefined, newValue: FeatureFlagValue) => void;
|
|
973
974
|
}
|
|
975
|
+
/**
|
|
976
|
+
* Streaming configuration for PlyazProvider
|
|
977
|
+
*
|
|
978
|
+
* When enabled, automatically establishes SSE connection and routes
|
|
979
|
+
* messages to the stream store. Domain services register handlers
|
|
980
|
+
* to process events and update their stores.
|
|
981
|
+
*
|
|
982
|
+
* @example
|
|
983
|
+
* ```typescript
|
|
984
|
+
* // Enable streaming with default settings
|
|
985
|
+
* streaming: {
|
|
986
|
+
* enabled: true,
|
|
987
|
+
* }
|
|
988
|
+
*
|
|
989
|
+
* // Custom configuration
|
|
990
|
+
* streaming: {
|
|
991
|
+
* enabled: true,
|
|
992
|
+
* endpoint: '/api/events/stream',
|
|
993
|
+
* channels: ['uploads', 'system'],
|
|
994
|
+
* autoConnect: true,
|
|
995
|
+
* reconnect: {
|
|
996
|
+
* enabled: true,
|
|
997
|
+
* maxAttempts: 10,
|
|
998
|
+
* delay: 1000,
|
|
999
|
+
* },
|
|
1000
|
+
* }
|
|
1001
|
+
* ```
|
|
1002
|
+
*/
|
|
1003
|
+
export interface CorePlyazStreamConfig {
|
|
1004
|
+
/**
|
|
1005
|
+
* Enable streaming (SSE connection).
|
|
1006
|
+
* When true, PlyazProvider establishes SSE connection on mount.
|
|
1007
|
+
* @default false
|
|
1008
|
+
*/
|
|
1009
|
+
enabled?: boolean;
|
|
1010
|
+
/**
|
|
1011
|
+
* SSE endpoint URL.
|
|
1012
|
+
* @default '/api/events/stream'
|
|
1013
|
+
*/
|
|
1014
|
+
endpoint?: string;
|
|
1015
|
+
/**
|
|
1016
|
+
* Channels to subscribe to.
|
|
1017
|
+
* @default ['uploads', 'downloads', 'generations', 'system']
|
|
1018
|
+
*/
|
|
1019
|
+
channels?: string[];
|
|
1020
|
+
/**
|
|
1021
|
+
* Auto-connect on mount.
|
|
1022
|
+
* @default true
|
|
1023
|
+
*/
|
|
1024
|
+
autoConnect?: boolean;
|
|
1025
|
+
/**
|
|
1026
|
+
* Reconnection configuration.
|
|
1027
|
+
*/
|
|
1028
|
+
reconnect?: {
|
|
1029
|
+
/**
|
|
1030
|
+
* Enable auto-reconnection on disconnect.
|
|
1031
|
+
* @default true
|
|
1032
|
+
*/
|
|
1033
|
+
enabled?: boolean;
|
|
1034
|
+
/**
|
|
1035
|
+
* Max reconnection attempts.
|
|
1036
|
+
* @default 10
|
|
1037
|
+
*/
|
|
1038
|
+
maxAttempts?: number;
|
|
1039
|
+
/**
|
|
1040
|
+
* Base delay between attempts (ms). Uses exponential backoff.
|
|
1041
|
+
* @default 1000
|
|
1042
|
+
*/
|
|
1043
|
+
delay?: number;
|
|
1044
|
+
};
|
|
1045
|
+
/**
|
|
1046
|
+
* Enable debug logging for streaming.
|
|
1047
|
+
* @default false (uses verbose from config)
|
|
1048
|
+
*/
|
|
1049
|
+
debug?: boolean;
|
|
1050
|
+
/**
|
|
1051
|
+
* Callback when connected to stream.
|
|
1052
|
+
*/
|
|
1053
|
+
onConnect?: () => void;
|
|
1054
|
+
/**
|
|
1055
|
+
* Callback when disconnected from stream.
|
|
1056
|
+
*/
|
|
1057
|
+
onDisconnect?: () => void;
|
|
1058
|
+
/**
|
|
1059
|
+
* Callback on connection error.
|
|
1060
|
+
*/
|
|
1061
|
+
onError?: (error: PackageErrorLike) => void;
|
|
1062
|
+
}
|
|
974
1063
|
/**
|
|
975
1064
|
* Full provider configuration
|
|
976
1065
|
*/
|
|
@@ -987,6 +1076,22 @@ export interface CorePlyazConfig {
|
|
|
987
1076
|
* Store integration configuration.
|
|
988
1077
|
*/
|
|
989
1078
|
store?: CorePlyazStoreConfig;
|
|
1079
|
+
/**
|
|
1080
|
+
* Streaming configuration (SSE real-time events).
|
|
1081
|
+
*
|
|
1082
|
+
* When enabled, PlyazProvider automatically establishes SSE connection
|
|
1083
|
+
* and routes messages to the stream store. Domain services can register
|
|
1084
|
+
* handlers to process events and update their stores.
|
|
1085
|
+
*
|
|
1086
|
+
* @example
|
|
1087
|
+
* ```typescript
|
|
1088
|
+
* streaming: {
|
|
1089
|
+
* enabled: true,
|
|
1090
|
+
* channels: ['uploads', 'system'],
|
|
1091
|
+
* }
|
|
1092
|
+
* ```
|
|
1093
|
+
*/
|
|
1094
|
+
streaming?: CorePlyazStreamConfig;
|
|
990
1095
|
/** App context (webapp, backoffice, mobile) */
|
|
991
1096
|
appContext?: CoreAppContext;
|
|
992
1097
|
/** Environment (production, staging, development, test) */
|
|
@@ -1046,9 +1151,9 @@ export interface CoreBaseFrontendServiceConstructorConfig<TConfig extends CoreBa
|
|
|
1046
1151
|
*/
|
|
1047
1152
|
export interface CoreInitializationErrorProps {
|
|
1048
1153
|
/** The error that occurred */
|
|
1049
|
-
error:
|
|
1154
|
+
error: PackageErrorLike;
|
|
1050
1155
|
/** Custom error component override */
|
|
1051
|
-
errorComponent?: (error:
|
|
1156
|
+
errorComponent?: (error: PackageErrorLike) => ReactNode;
|
|
1052
1157
|
}
|
|
1053
1158
|
/**
|
|
1054
1159
|
* Props for initialization loading component
|
|
@@ -1138,7 +1243,7 @@ export interface CorePlyazContextValue extends CorePlyazServices {
|
|
|
1138
1243
|
/** Whether services are initialized and ready */
|
|
1139
1244
|
isReady: boolean;
|
|
1140
1245
|
/** Initialization error if any */
|
|
1141
|
-
error:
|
|
1246
|
+
error: PackageErrorLike | null;
|
|
1142
1247
|
/** Re-initialize services */
|
|
1143
1248
|
reinitialize: () => Promise<void>;
|
|
1144
1249
|
}
|
|
@@ -1167,11 +1272,80 @@ export interface CorePlyazProviderProps {
|
|
|
1167
1272
|
/** Loading component to show while initializing */
|
|
1168
1273
|
loading?: ReactNode;
|
|
1169
1274
|
/** Error component to show on initialization failure */
|
|
1170
|
-
error?: (error:
|
|
1275
|
+
error?: (error: PackageErrorLike) => ReactNode;
|
|
1171
1276
|
/** Callback when services are ready */
|
|
1172
1277
|
onReady?: (services: CorePlyazServices) => void;
|
|
1173
1278
|
/** Callback on initialization error */
|
|
1174
|
-
onError?: (error:
|
|
1279
|
+
onError?: (error: PackageErrorLike) => void;
|
|
1175
1280
|
/** Skip showing loading state (render children immediately) */
|
|
1176
1281
|
skipLoadingState?: boolean;
|
|
1177
1282
|
}
|
|
1283
|
+
/**
|
|
1284
|
+
* Store getter function for declarative stream handlers.
|
|
1285
|
+
* Returns the root store state for accessing domain stores.
|
|
1286
|
+
*/
|
|
1287
|
+
export type CoreStreamStoreGetter = () => RootStoreSlice | undefined;
|
|
1288
|
+
/**
|
|
1289
|
+
* Stream handler IDs type.
|
|
1290
|
+
* Use this to define strongly-typed handler ID objects.
|
|
1291
|
+
*
|
|
1292
|
+
* @typeParam TKeys - Union type of handler key names
|
|
1293
|
+
*
|
|
1294
|
+
* @example
|
|
1295
|
+
* ```typescript
|
|
1296
|
+
* // Define handler IDs with type safety
|
|
1297
|
+
* protected static readonly STREAM_HANDLER_IDS: CoreStreamHandlerIds<
|
|
1298
|
+
* 'UPLOAD_PROGRESS' | 'DOWNLOAD_PROGRESS' | 'GENERATE_PROGRESS'
|
|
1299
|
+
* > = {
|
|
1300
|
+
* UPLOAD_PROGRESS: 'files:upload-progress',
|
|
1301
|
+
* DOWNLOAD_PROGRESS: 'files:download-progress',
|
|
1302
|
+
* GENERATE_PROGRESS: 'files:generate-progress',
|
|
1303
|
+
* } as const;
|
|
1304
|
+
* ```
|
|
1305
|
+
*/
|
|
1306
|
+
export type CoreStreamHandlerIds<TKeys extends string> = Readonly<Record<TKeys, string>>;
|
|
1307
|
+
/**
|
|
1308
|
+
* Declarative stream handler configuration.
|
|
1309
|
+
*
|
|
1310
|
+
* Allows defining stream handlers as configuration objects
|
|
1311
|
+
* instead of manual registration code.
|
|
1312
|
+
*
|
|
1313
|
+
* @typeParam TData - Type of message.data payload (default: unknown)
|
|
1314
|
+
*
|
|
1315
|
+
* @example
|
|
1316
|
+
* ```typescript
|
|
1317
|
+
* const handler: CoreStreamHandlerDeclaration<FilesUploadStreamProgress> = {
|
|
1318
|
+
* id: 'files:upload-progress',
|
|
1319
|
+
* channels: ['uploads', 'upload:'],
|
|
1320
|
+
* events: ['progress', 'upload:progress'],
|
|
1321
|
+
* priority: 100,
|
|
1322
|
+
* handler: (message, getStore) => {
|
|
1323
|
+
* // message.data is typed as FilesUploadStreamProgress
|
|
1324
|
+
* const filesStore = getStore()?.files;
|
|
1325
|
+
* filesStore?.setUploadProgress(message.data.fileId, { ... });
|
|
1326
|
+
* },
|
|
1327
|
+
* };
|
|
1328
|
+
* ```
|
|
1329
|
+
*/
|
|
1330
|
+
export interface CoreStreamHandlerDeclaration<TData = unknown> {
|
|
1331
|
+
/** Unique handler ID (use STREAM_HANDLER_IDS values) */
|
|
1332
|
+
id: string;
|
|
1333
|
+
/** Channels to listen to (supports prefix matching with trailing colon) */
|
|
1334
|
+
channels: string[];
|
|
1335
|
+
/** Event types to listen to */
|
|
1336
|
+
events: string[];
|
|
1337
|
+
/** Handler priority (higher = called first). Default: 100 */
|
|
1338
|
+
priority?: number;
|
|
1339
|
+
/**
|
|
1340
|
+
* Handler function.
|
|
1341
|
+
* Receives the typed message and a store getter function.
|
|
1342
|
+
*
|
|
1343
|
+
* @param message - Stream message with typed data
|
|
1344
|
+
* @param getStore - Function to get root store state
|
|
1345
|
+
*/
|
|
1346
|
+
handler: (message: {
|
|
1347
|
+
event: string;
|
|
1348
|
+
data: TData;
|
|
1349
|
+
timestamp?: number;
|
|
1350
|
+
}, getStore: CoreStreamStoreGetter) => void;
|
|
1351
|
+
}
|
package/dist/core/index.cjs
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
+
var zod = require('zod');
|
|
4
|
+
|
|
3
5
|
// @plyaz package - Built with tsup
|
|
4
6
|
|
|
5
7
|
// src/core/modules.ts
|
|
@@ -326,6 +328,195 @@ var CORE_EVENTS = {
|
|
|
326
328
|
}
|
|
327
329
|
};
|
|
328
330
|
|
|
331
|
+
// src/core/domain/files/enums.ts
|
|
332
|
+
var SYSTEM_USER_ID = "00000000-0000-0000-0000-000000000000";
|
|
333
|
+
var FILE_TYPES = {
|
|
334
|
+
IMAGE: "IMAGE",
|
|
335
|
+
VIDEO: "VIDEO",
|
|
336
|
+
AUDIO: "AUDIO",
|
|
337
|
+
DOCUMENT: "DOCUMENT"
|
|
338
|
+
};
|
|
339
|
+
var FILE_ACCESS_LEVELS = {
|
|
340
|
+
PUBLIC: "public",
|
|
341
|
+
PRIVATE: "private",
|
|
342
|
+
PROTECTED: "protected"
|
|
343
|
+
};
|
|
344
|
+
|
|
345
|
+
// src/core/domain/files/streaming.ts
|
|
346
|
+
var FILES_STREAM_MESSAGE_TYPE = {
|
|
347
|
+
PROGRESS: "progress",
|
|
348
|
+
STATUS: "status",
|
|
349
|
+
ERROR: "error"
|
|
350
|
+
};
|
|
351
|
+
var FILES_STREAM_SUBTYPE = {
|
|
352
|
+
UPLOAD: "upload",
|
|
353
|
+
DOWNLOAD: "download",
|
|
354
|
+
GENERATE: "generate"
|
|
355
|
+
};
|
|
356
|
+
var FILES_STREAM_PROGRESS_STATUS = {
|
|
357
|
+
PENDING: "pending",
|
|
358
|
+
UPLOADING: "uploading",
|
|
359
|
+
DOWNLOADING: "downloading",
|
|
360
|
+
PROCESSING: "processing",
|
|
361
|
+
GENERATING: "generating",
|
|
362
|
+
COMPLETED: "completed",
|
|
363
|
+
FAILED: "failed",
|
|
364
|
+
CANCELLED: "cancelled"
|
|
365
|
+
};
|
|
366
|
+
var FILES_STREAM_EVENT = {
|
|
367
|
+
// Upload events
|
|
368
|
+
UPLOAD_PROGRESS: "upload:progress",
|
|
369
|
+
UPLOAD_COMPLETED: "upload:completed",
|
|
370
|
+
UPLOAD_FAILED: "upload:failed",
|
|
371
|
+
UPLOAD_CANCELLED: "upload:cancelled",
|
|
372
|
+
// Download events
|
|
373
|
+
DOWNLOAD_PROGRESS: "download:progress",
|
|
374
|
+
DOWNLOAD_COMPLETED: "download:completed",
|
|
375
|
+
DOWNLOAD_FAILED: "download:failed",
|
|
376
|
+
DOWNLOAD_CANCELLED: "download:cancelled",
|
|
377
|
+
// Generation events
|
|
378
|
+
GENERATE_PROGRESS: "generate:progress",
|
|
379
|
+
GENERATE_COMPLETED: "generate:completed",
|
|
380
|
+
GENERATE_FAILED: "generate:failed"
|
|
381
|
+
};
|
|
382
|
+
var FILES_STREAM_CHANNEL_PREFIX = {
|
|
383
|
+
UPLOAD: "upload:",
|
|
384
|
+
DOWNLOAD: "download:",
|
|
385
|
+
GENERATE: "generate:"
|
|
386
|
+
};
|
|
387
|
+
var FILES_STREAM_BROADCAST_CHANNEL = {
|
|
388
|
+
UPLOADS: "uploads",
|
|
389
|
+
DOWNLOADS: "downloads",
|
|
390
|
+
GENERATIONS: "generations"
|
|
391
|
+
};
|
|
392
|
+
var FILES_STREAM_CHANNEL = {
|
|
393
|
+
// Prefixes (for building per-resource channels)
|
|
394
|
+
PREFIX: FILES_STREAM_CHANNEL_PREFIX,
|
|
395
|
+
// Broadcast channels
|
|
396
|
+
BROADCAST: FILES_STREAM_BROADCAST_CHANNEL
|
|
397
|
+
};
|
|
398
|
+
var MediaTypeSchema = zod.z.enum(["IMAGE", "VIDEO", "AUDIO", "DOCUMENT"]);
|
|
399
|
+
var FileTypeSchema = zod.z.enum(["IMAGE", "VIDEO", "DOCUMENT", "AUDIO", "OTHER"]);
|
|
400
|
+
var MediaAccessLevelSchema = zod.z.enum(["public", "private", "protected"]).nullable();
|
|
401
|
+
var FilesDatabaseRowSchema = zod.z.object({
|
|
402
|
+
// Auto-generated fields
|
|
403
|
+
id: zod.z.string().uuid(),
|
|
404
|
+
created_at: zod.z.string(),
|
|
405
|
+
updated_at: zod.z.string(),
|
|
406
|
+
deleted_at: zod.z.string().nullable(),
|
|
407
|
+
// Required fields
|
|
408
|
+
user_id: zod.z.string().uuid(),
|
|
409
|
+
type: zod.z.string(),
|
|
410
|
+
// String in DB, validated as MediaType on create
|
|
411
|
+
filename: zod.z.string(),
|
|
412
|
+
original_filename: zod.z.string(),
|
|
413
|
+
mime_type: zod.z.string(),
|
|
414
|
+
file_size: zod.z.union([zod.z.bigint(), zod.z.number()]),
|
|
415
|
+
storage_path: zod.z.string(),
|
|
416
|
+
// Optional fields
|
|
417
|
+
cdn_url: zod.z.string().nullable(),
|
|
418
|
+
width: zod.z.number().nullable(),
|
|
419
|
+
height: zod.z.number().nullable(),
|
|
420
|
+
duration: zod.z.number().nullable(),
|
|
421
|
+
is_virus_scanned: zod.z.boolean(),
|
|
422
|
+
virus_scan_result: zod.z.string().nullable(),
|
|
423
|
+
metadata: zod.z.record(zod.z.string(), zod.z.unknown()).nullable(),
|
|
424
|
+
variants: zod.z.record(zod.z.string(), zod.z.unknown()).nullable(),
|
|
425
|
+
entity_type: zod.z.string().nullable(),
|
|
426
|
+
entity_id: zod.z.string().nullable(),
|
|
427
|
+
access_level: zod.z.string().nullable()
|
|
428
|
+
});
|
|
429
|
+
var CreateFilesSchema = zod.z.object({
|
|
430
|
+
// Required fields with defaults for optional scenarios
|
|
431
|
+
user_id: zod.z.string().uuid().default(SYSTEM_USER_ID),
|
|
432
|
+
type: MediaTypeSchema.default("DOCUMENT"),
|
|
433
|
+
filename: zod.z.string().min(1, "Filename is required"),
|
|
434
|
+
original_filename: zod.z.string().min(1, "Original filename is required"),
|
|
435
|
+
mime_type: zod.z.string().min(1, "MIME type is required"),
|
|
436
|
+
file_size: zod.z.union([zod.z.bigint(), zod.z.number()]).refine((val) => Number(val) >= 0, "File size must be non-negative"),
|
|
437
|
+
storage_path: zod.z.string().min(1, "Storage path is required"),
|
|
438
|
+
// Optional fields with defaults
|
|
439
|
+
cdn_url: zod.z.string().url().nullable().default(null),
|
|
440
|
+
width: zod.z.number().positive().nullable().default(null),
|
|
441
|
+
height: zod.z.number().positive().nullable().default(null),
|
|
442
|
+
duration: zod.z.number().positive().nullable().default(null),
|
|
443
|
+
is_virus_scanned: zod.z.boolean().default(false),
|
|
444
|
+
virus_scan_result: zod.z.string().nullable().default(null),
|
|
445
|
+
metadata: zod.z.record(zod.z.string(), zod.z.unknown()).nullable().default(null),
|
|
446
|
+
variants: zod.z.record(zod.z.string(), zod.z.unknown()).nullable().default(null),
|
|
447
|
+
entity_type: zod.z.string().nullable().default(null),
|
|
448
|
+
entity_id: zod.z.string().nullable().default(null),
|
|
449
|
+
access_level: MediaAccessLevelSchema.default(null)
|
|
450
|
+
});
|
|
451
|
+
var PatchFilesSchema = CreateFilesSchema.partial();
|
|
452
|
+
var MediaVariantsDatabaseRowSchema = zod.z.object({
|
|
453
|
+
id: zod.z.string().uuid(),
|
|
454
|
+
media_id: zod.z.string().uuid(),
|
|
455
|
+
variant_name: zod.z.string(),
|
|
456
|
+
file_path: zod.z.string(),
|
|
457
|
+
cdn_url: zod.z.string().nullable(),
|
|
458
|
+
width: zod.z.number().nullable(),
|
|
459
|
+
height: zod.z.number().nullable(),
|
|
460
|
+
file_size: zod.z.number().nullable(),
|
|
461
|
+
created_at: zod.z.string()
|
|
462
|
+
});
|
|
463
|
+
var CreateMediaVariantSchema = MediaVariantsDatabaseRowSchema.omit({
|
|
464
|
+
id: true,
|
|
465
|
+
created_at: true
|
|
466
|
+
});
|
|
467
|
+
|
|
468
|
+
// src/core/events/streaming/types.ts
|
|
469
|
+
var STREAM_TRANSPORT = {
|
|
470
|
+
SSE: "sse",
|
|
471
|
+
WEBSOCKET: "websocket"
|
|
472
|
+
};
|
|
473
|
+
var SYSTEM_STREAM_MESSAGE_TYPE = {
|
|
474
|
+
SYSTEM: "system",
|
|
475
|
+
NOTIFICATION: "notification",
|
|
476
|
+
DATA: "data"
|
|
477
|
+
};
|
|
478
|
+
var SYSTEM_STREAM_SUBTYPE = {
|
|
479
|
+
HEARTBEAT: "heartbeat",
|
|
480
|
+
CONNECTED: "connected",
|
|
481
|
+
DISCONNECTED: "disconnected",
|
|
482
|
+
RECONNECTING: "reconnecting"
|
|
483
|
+
};
|
|
484
|
+
var SYSTEM_STREAM_CHANNEL = {
|
|
485
|
+
SYSTEM: "system"
|
|
486
|
+
};
|
|
487
|
+
var STREAM_MESSAGE_TYPE = {
|
|
488
|
+
...SYSTEM_STREAM_MESSAGE_TYPE,
|
|
489
|
+
...FILES_STREAM_MESSAGE_TYPE
|
|
490
|
+
};
|
|
491
|
+
var STREAM_SUBTYPE = {
|
|
492
|
+
...SYSTEM_STREAM_SUBTYPE,
|
|
493
|
+
...FILES_STREAM_SUBTYPE
|
|
494
|
+
};
|
|
495
|
+
var STREAM_SCOPE = {
|
|
496
|
+
FILES: "files",
|
|
497
|
+
SYSTEM: "system"
|
|
498
|
+
};
|
|
499
|
+
var SYSTEM_STREAM_EVENT = {
|
|
500
|
+
CONNECTED: "connected",
|
|
501
|
+
DISCONNECTED: "disconnected",
|
|
502
|
+
HEARTBEAT: "heartbeat",
|
|
503
|
+
ERROR: "error"
|
|
504
|
+
};
|
|
505
|
+
var STREAM_EVENT = {
|
|
506
|
+
...SYSTEM_STREAM_EVENT,
|
|
507
|
+
...FILES_STREAM_EVENT
|
|
508
|
+
};
|
|
509
|
+
var STREAM_CHANNEL_PREFIX = {
|
|
510
|
+
...FILES_STREAM_CHANNEL_PREFIX
|
|
511
|
+
};
|
|
512
|
+
var STREAM_BROADCAST_CHANNEL = {
|
|
513
|
+
...SYSTEM_STREAM_CHANNEL,
|
|
514
|
+
...FILES_STREAM_BROADCAST_CHANNEL
|
|
515
|
+
};
|
|
516
|
+
var STREAM_PROGRESS_STATUS = {
|
|
517
|
+
...FILES_STREAM_PROGRESS_STATUS
|
|
518
|
+
};
|
|
519
|
+
|
|
329
520
|
// src/core/services/keys.ts
|
|
330
521
|
var SERVICE_KEYS = {
|
|
331
522
|
/** Example domain service (backend) */
|
|
@@ -349,6 +540,8 @@ exports.BACKEND_RUNTIMES = BACKEND_RUNTIMES;
|
|
|
349
540
|
exports.CORE_EVENTS = CORE_EVENTS;
|
|
350
541
|
exports.CacheEventAction = CacheEventAction;
|
|
351
542
|
exports.CoreEventScope = CoreEventScope;
|
|
543
|
+
exports.CreateFilesSchema = CreateFilesSchema;
|
|
544
|
+
exports.CreateMediaVariantSchema = CreateMediaVariantSchema;
|
|
352
545
|
exports.DATABASE_FIELDS = DATABASE_FIELDS;
|
|
353
546
|
exports.DatabaseEventAction = DatabaseEventAction;
|
|
354
547
|
exports.EVALUATION_REASONS = EVALUATION_REASONS;
|
|
@@ -360,13 +553,41 @@ exports.FEATURE_FLAG_PROVIDERS = FEATURE_FLAG_PROVIDERS;
|
|
|
360
553
|
exports.FEATURE_FLAG_RULE_FIELD = FEATURE_FLAG_RULE_FIELD;
|
|
361
554
|
exports.FEATURE_FLAG_TABLE = FEATURE_FLAG_TABLE;
|
|
362
555
|
exports.FEATURE_FLAG_TYPES = FEATURE_FLAG_TYPES;
|
|
556
|
+
exports.FILES_STREAM_BROADCAST_CHANNEL = FILES_STREAM_BROADCAST_CHANNEL;
|
|
557
|
+
exports.FILES_STREAM_CHANNEL = FILES_STREAM_CHANNEL;
|
|
558
|
+
exports.FILES_STREAM_CHANNEL_PREFIX = FILES_STREAM_CHANNEL_PREFIX;
|
|
559
|
+
exports.FILES_STREAM_EVENT = FILES_STREAM_EVENT;
|
|
560
|
+
exports.FILES_STREAM_MESSAGE_TYPE = FILES_STREAM_MESSAGE_TYPE;
|
|
561
|
+
exports.FILES_STREAM_PROGRESS_STATUS = FILES_STREAM_PROGRESS_STATUS;
|
|
562
|
+
exports.FILES_STREAM_SUBTYPE = FILES_STREAM_SUBTYPE;
|
|
563
|
+
exports.FILE_ACCESS_LEVELS = FILE_ACCESS_LEVELS;
|
|
564
|
+
exports.FILE_TYPES = FILE_TYPES;
|
|
363
565
|
exports.FRONTEND_RUNTIMES = FRONTEND_RUNTIMES;
|
|
364
566
|
exports.FeatureFlagEventAction = FeatureFlagEventAction;
|
|
567
|
+
exports.FileTypeSchema = FileTypeSchema;
|
|
568
|
+
exports.FilesDatabaseRowSchema = FilesDatabaseRowSchema;
|
|
569
|
+
exports.MediaAccessLevelSchema = MediaAccessLevelSchema;
|
|
570
|
+
exports.MediaTypeSchema = MediaTypeSchema;
|
|
571
|
+
exports.MediaVariantsDatabaseRowSchema = MediaVariantsDatabaseRowSchema;
|
|
365
572
|
exports.NODE_ENVIRONMENTS = NODE_ENVIRONMENTS;
|
|
366
573
|
exports.NotificationEventAction = NotificationEventAction;
|
|
574
|
+
exports.PatchFilesSchema = PatchFilesSchema;
|
|
367
575
|
exports.SERVICE_KEYS = SERVICE_KEYS;
|
|
368
576
|
exports.SORT_DIRECTION = SORT_DIRECTION;
|
|
577
|
+
exports.STREAM_BROADCAST_CHANNEL = STREAM_BROADCAST_CHANNEL;
|
|
578
|
+
exports.STREAM_CHANNEL_PREFIX = STREAM_CHANNEL_PREFIX;
|
|
579
|
+
exports.STREAM_EVENT = STREAM_EVENT;
|
|
580
|
+
exports.STREAM_MESSAGE_TYPE = STREAM_MESSAGE_TYPE;
|
|
581
|
+
exports.STREAM_PROGRESS_STATUS = STREAM_PROGRESS_STATUS;
|
|
582
|
+
exports.STREAM_SCOPE = STREAM_SCOPE;
|
|
583
|
+
exports.STREAM_SUBTYPE = STREAM_SUBTYPE;
|
|
584
|
+
exports.STREAM_TRANSPORT = STREAM_TRANSPORT;
|
|
585
|
+
exports.SYSTEM_STREAM_CHANNEL = SYSTEM_STREAM_CHANNEL;
|
|
586
|
+
exports.SYSTEM_STREAM_EVENT = SYSTEM_STREAM_EVENT;
|
|
587
|
+
exports.SYSTEM_STREAM_MESSAGE_TYPE = SYSTEM_STREAM_MESSAGE_TYPE;
|
|
588
|
+
exports.SYSTEM_STREAM_SUBTYPE = SYSTEM_STREAM_SUBTYPE;
|
|
369
589
|
exports.SYSTEM_USERS = SYSTEM_USERS;
|
|
590
|
+
exports.SYSTEM_USER_ID = SYSTEM_USER_ID;
|
|
370
591
|
exports.SanitizationEventAction = SanitizationEventAction;
|
|
371
592
|
exports.StorageEventAction = StorageEventAction;
|
|
372
593
|
exports.StoreEventAction = StoreEventAction;
|