@bernierllc/content-type-video 1.5.0 → 2.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -331,6 +331,10 @@ npm run lint
331
331
  - **Linting**: Zero errors or warnings
332
332
  - **Build**: Successful compilation
333
333
 
334
+ ## Migration: zod 4 (breaking)
335
+
336
+ This release moves the package to zod 4 (`zod@^4.6.7`) to fix the zod 3.x advisory. Exported `*Schema` values are now zod 4 types. Consumers still on zod 3 must upgrade to zod 4 to compose these exports.
337
+
334
338
  ## License
335
339
 
336
340
  Copyright (c) 2025 Bernier LLC
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bernierllc/content-type-video",
3
- "version": "1.5.0",
3
+ "version": "2.0.0",
4
4
  "description": "Base video content type with file upload, local storage, and streaming URL generation",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -21,8 +21,8 @@
21
21
  "author": "Bernier LLC",
22
22
  "license": "SEE LICENSE IN LICENSE",
23
23
  "dependencies": {
24
- "zod": "^3.22.0",
25
- "@bernierllc/content-type-registry": "1.6.0"
24
+ "zod": "^4.6.7",
25
+ "@bernierllc/content-type-registry": "2.0.0"
26
26
  },
27
27
  "devDependencies": {
28
28
  "@types/jest": "^29.0.0",
@@ -35,7 +35,7 @@
35
35
  "typescript": "^5.0.0"
36
36
  },
37
37
  "peerDependencies": {
38
- "@bernierllc/neverhub-adapter": "^0.1.1"
38
+ "@bernierllc/neverhub-adapter": "^0.4.0"
39
39
  },
40
40
  "peerDependenciesMeta": {
41
41
  "@bernierllc/neverhub-adapter": {
@@ -1,32 +0,0 @@
1
- import { VideoContentData, VideoContentTypeConfig, VideoContentResult } from './types';
2
- /**
3
- * Video content type with file upload, local storage, and streaming URL generation
4
- */
5
- export declare class VideoContentType {
6
- readonly typeName = "video";
7
- readonly version = "1.0.0";
8
- private config;
9
- private storage;
10
- constructor(config?: Partial<VideoContentTypeConfig>);
11
- /**
12
- * Register video content type with registry
13
- */
14
- register(): Promise<void>;
15
- /**
16
- * Validate video file
17
- */
18
- validate(file: Buffer | string, filename: string): Promise<VideoContentResult<void>>;
19
- /**
20
- * Upload video file and extract metadata
21
- */
22
- upload(file: Buffer | string, filename: string, uploadedBy?: string): Promise<VideoContentResult<VideoContentData>>;
23
- get(localPath: string): Promise<Buffer | null>;
24
- delete(localPath: string): Promise<boolean>;
25
- exists(localPath: string): Promise<boolean>;
26
- getStreamingUrl(localPath: string): string;
27
- /**
28
- * Validate video content data
29
- */
30
- validateContent(data: VideoContentData): VideoContentResult<VideoContentData>;
31
- }
32
- //# sourceMappingURL=VideoContentType.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"VideoContentType.d.ts","sourceRoot":"","sources":["../src/VideoContentType.ts"],"names":[],"mappings":"AAWA,OAAO,EACL,gBAAgB,EAChB,sBAAsB,EACtB,kBAAkB,EAEnB,MAAM,SAAS,CAAC;AAKjB;;GAEG;AACH,qBAAa,gBAAgB;IAC3B,SAAgB,QAAQ,WAAW;IACnC,SAAgB,OAAO,WAAW;IAClC,OAAO,CAAC,MAAM,CAAyB;IACvC,OAAO,CAAC,OAAO,CAAe;gBAElB,MAAM,GAAE,OAAO,CAAC,sBAAsB,CAAM;IAKxD;;OAEG;IACG,QAAQ,IAAI,OAAO,CAAC,IAAI,CAAC;IAc/B;;OAEG;IACG,QAAQ,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,kBAAkB,CAAC,IAAI,CAAC,CAAC;IAiC1F;;OAEG;IACG,MAAM,CACV,IAAI,EAAE,MAAM,GAAG,MAAM,EACrB,QAAQ,EAAE,MAAM,EAChB,UAAU,CAAC,EAAE,MAAM,GAClB,OAAO,CAAC,kBAAkB,CAAC,gBAAgB,CAAC,CAAC;IAgB1C,GAAG,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC;IAI9C,MAAM,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC;IAI3C,MAAM,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC;IAIjD,eAAe,CAAC,SAAS,EAAE,MAAM,GAAG,MAAM;IAI1C;;OAEG;IACH,eAAe,CAAC,IAAI,EAAE,gBAAgB,GAAG,kBAAkB,CAAC,gBAAgB,CAAC;CAW9E"}
@@ -1,156 +0,0 @@
1
- "use strict";
2
- /*
3
- Copyright (c) 2025 Bernier LLC
4
-
5
- This file is licensed to the client under a limited-use license.
6
- The client may use and modify this code *only within the scope of the project it was delivered for*.
7
- Redistribution or use in other products or commercial offerings is not permitted without written consent from Bernier LLC.
8
- */
9
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- var desc = Object.getOwnPropertyDescriptor(m, k);
12
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
13
- desc = { enumerable: true, get: function() { return m[k]; } };
14
- }
15
- Object.defineProperty(o, k2, desc);
16
- }) : (function(o, m, k, k2) {
17
- if (k2 === undefined) k2 = k;
18
- o[k2] = m[k];
19
- }));
20
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
21
- Object.defineProperty(o, "default", { enumerable: true, value: v });
22
- }) : function(o, v) {
23
- o["default"] = v;
24
- });
25
- var __importStar = (this && this.__importStar) || (function () {
26
- var ownKeys = function(o) {
27
- ownKeys = Object.getOwnPropertyNames || function (o) {
28
- var ar = [];
29
- for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
30
- return ar;
31
- };
32
- return ownKeys(o);
33
- };
34
- return function (mod) {
35
- if (mod && mod.__esModule) return mod;
36
- var result = {};
37
- if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
38
- __setModuleDefault(result, mod);
39
- return result;
40
- };
41
- })();
42
- Object.defineProperty(exports, "__esModule", { value: true });
43
- exports.VideoContentType = void 0;
44
- const content_type_registry_1 = require("@bernierllc/content-type-registry");
45
- const path = __importStar(require("path"));
46
- const fs = __importStar(require("fs"));
47
- const types_1 = require("./types");
48
- const LocalVideoStorage_1 = require("./storage/LocalVideoStorage");
49
- const config_1 = require("./config");
50
- /**
51
- * Video content type with file upload, local storage, and streaming URL generation
52
- */
53
- class VideoContentType {
54
- typeName = 'video';
55
- version = '1.0.0';
56
- config;
57
- storage;
58
- constructor(config = {}) {
59
- this.config = (0, config_1.loadConfig)(config);
60
- this.storage = new LocalVideoStorage_1.LocalVideoStorage(this.config);
61
- }
62
- /**
63
- * Register video content type with registry
64
- */
65
- async register() {
66
- content_type_registry_1.contentTypeRegistry.register({
67
- id: 'video',
68
- name: 'Video',
69
- description: 'Base video content type with file upload and streaming',
70
- baseType: content_type_registry_1.BaseContentType.VIDEO,
71
- icon: 'video',
72
- schema: types_1.VideoMetadataSchema,
73
- editor: this.config.editor,
74
- storage: this.config.storage,
75
- publishing: this.config.publishing,
76
- });
77
- }
78
- /**
79
- * Validate video file
80
- */
81
- async validate(file, filename) {
82
- // Check for zero-byte files
83
- const fileSize = Buffer.isBuffer(file) ? file.length : fs.statSync(file).size;
84
- if (fileSize === 0) {
85
- return {
86
- success: false,
87
- error: 'File is empty (0 bytes)',
88
- };
89
- }
90
- // Validate file format
91
- const extension = path.extname(filename).slice(1).toLowerCase();
92
- const allowedFormats = this.config.uploadOptions?.allowedFormats || ['mp4', 'webm', 'mov', 'avi'];
93
- if (!allowedFormats.includes(extension)) {
94
- return {
95
- success: false,
96
- error: `File format ${extension} not allowed. Allowed: ${allowedFormats.join(', ')}`,
97
- };
98
- }
99
- // Validate file size
100
- const maxSize = this.config.uploadOptions?.maxSizeBytes || 500 * 1024 * 1024;
101
- if (fileSize > maxSize) {
102
- return {
103
- success: false,
104
- error: `File size ${fileSize} exceeds maximum ${maxSize}`,
105
- };
106
- }
107
- return { success: true };
108
- }
109
- /**
110
- * Upload video file and extract metadata
111
- */
112
- async upload(file, filename, uploadedBy) {
113
- try {
114
- const validation = await this.validate(file, filename);
115
- if (!validation.success) {
116
- return { success: false, error: validation.error || 'Validation failed' };
117
- }
118
- return await this.storage.save(file, filename, uploadedBy);
119
- }
120
- catch (error) {
121
- return {
122
- success: false,
123
- error: error instanceof Error ? error.message : 'Unknown error during video upload',
124
- };
125
- }
126
- }
127
- async get(localPath) {
128
- return this.storage.get(localPath);
129
- }
130
- async delete(localPath) {
131
- return this.storage.delete(localPath);
132
- }
133
- async exists(localPath) {
134
- return this.storage.exists(localPath);
135
- }
136
- getStreamingUrl(localPath) {
137
- return this.storage.getStreamingUrl(localPath);
138
- }
139
- /**
140
- * Validate video content data
141
- */
142
- validateContent(data) {
143
- try {
144
- types_1.VideoMetadataSchema.parse(data.metadata);
145
- return { success: true, data };
146
- }
147
- catch (error) {
148
- return {
149
- success: false,
150
- error: error instanceof Error ? error.message : 'Validation failed',
151
- };
152
- }
153
- }
154
- }
155
- exports.VideoContentType = VideoContentType;
156
- //# sourceMappingURL=VideoContentType.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"VideoContentType.js","sourceRoot":"","sources":["../src/VideoContentType.ts"],"names":[],"mappings":";AAAA;;;;;;EAME;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEF,6EAAyF;AACzF,2CAA6B;AAC7B,uCAAyB;AACzB,mCAKiB;AAEjB,mEAAgE;AAChE,qCAAsC;AAEtC;;GAEG;AACH,MAAa,gBAAgB;IACX,QAAQ,GAAG,OAAO,CAAC;IACnB,OAAO,GAAG,OAAO,CAAC;IAC1B,MAAM,CAAyB;IAC/B,OAAO,CAAe;IAE9B,YAAY,SAA0C,EAAE;QACtD,IAAI,CAAC,MAAM,GAAG,IAAA,mBAAU,EAAC,MAAM,CAAC,CAAC;QACjC,IAAI,CAAC,OAAO,GAAG,IAAI,qCAAiB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,CAAC,OAAO,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC;IACxC,CAAC;IAED,KAAK,CAAC,MAAM,CAAC,SAAiB;QAC5B,OAAO,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC;IACxC,CAAC;IAED,eAAe,CAAC,SAAiB;QAC/B,OAAO,IAAI,CAAC,OAAO,CAAC,eAAe,CAAC,SAAS,CAAC,CAAC;IACjD,CAAC;IAED;;OAEG;IACH,eAAe,CAAC,IAAsB;QACpC,IAAI,CAAC;YACH,2BAAmB,CAAC,KAAK,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;YACzC,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC;QACjC,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,OAAO;gBACL,OAAO,EAAE,KAAK;gBACd,KAAK,EAAE,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,mBAAmB;aACpE,CAAC;QACJ,CAAC;IACH,CAAC;CACF;AArHD,4CAqHC"}
package/dist/config.d.ts DELETED
@@ -1,6 +0,0 @@
1
- import { VideoContentTypeConfig } from './types';
2
- /**
3
- * Load configuration from environment variables with fallback to defaults
4
- */
5
- export declare function loadConfig(config?: Partial<VideoContentTypeConfig>): VideoContentTypeConfig;
6
- //# sourceMappingURL=config.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAQA,OAAO,EAAE,sBAAsB,EAAE,MAAM,SAAS,CAAC;AAEjD;;GAEG;AACH,wBAAgB,UAAU,CAAC,MAAM,GAAE,OAAO,CAAC,sBAAsB,CAAM,GAAG,sBAAsB,CAiD/F"}
package/dist/config.js DELETED
@@ -1,58 +0,0 @@
1
- "use strict";
2
- /*
3
- Copyright (c) 2025 Bernier LLC
4
-
5
- This file is licensed to the client under a limited-use license.
6
- The client may use and modify this code *only within the scope of the project it was delivered for*.
7
- Redistribution or use in other products or commercial offerings is not permitted without written consent from Bernier LLC.
8
- */
9
- Object.defineProperty(exports, "__esModule", { value: true });
10
- exports.loadConfig = loadConfig;
11
- /**
12
- * Load configuration from environment variables with fallback to defaults
13
- */
14
- function loadConfig(config = {}) {
15
- const maxSizeBytes = config.uploadOptions?.maxSizeBytes
16
- || (process.env.VIDEO_MAX_SIZE_BYTES ? parseInt(process.env.VIDEO_MAX_SIZE_BYTES, 10) : undefined)
17
- || 500 * 1024 * 1024; // 500MB default
18
- const storageBasePath = config.uploadOptions?.storageBasePath
19
- || process.env.VIDEO_STORAGE_BASE_PATH
20
- || './storage/videos';
21
- const streamingBaseUrl = config.streamingBaseUrl
22
- || process.env.VIDEO_STREAMING_BASE_URL
23
- || '/api/video/stream';
24
- const allowedFormats = config.uploadOptions?.allowedFormats
25
- || (process.env.VIDEO_ALLOWED_FORMATS ? process.env.VIDEO_ALLOWED_FORMATS.split(',').map(f => f.trim()) : undefined)
26
- || ['mp4', 'webm', 'mov', 'avi'];
27
- const generateThumbnail = config.uploadOptions?.generateThumbnail
28
- !== undefined ? config.uploadOptions.generateThumbnail
29
- : (process.env.VIDEO_GENERATE_THUMBNAIL === 'true' || true);
30
- const extractMetadata = config.uploadOptions?.extractMetadata
31
- !== undefined ? config.uploadOptions.extractMetadata
32
- : (process.env.VIDEO_EXTRACT_METADATA === 'true' || true);
33
- return {
34
- baseType: 'video',
35
- editor: config.editor || {
36
- component: 'file-upload-with-player',
37
- settings: {},
38
- },
39
- storage: config.storage || {
40
- method: 'file',
41
- settings: {},
42
- },
43
- publishing: config.publishing || {
44
- methods: ['streaming-url'],
45
- defaultMethod: 'streaming-url',
46
- settings: {},
47
- },
48
- uploadOptions: {
49
- maxSizeBytes,
50
- allowedFormats,
51
- generateThumbnail,
52
- extractMetadata,
53
- storageBasePath,
54
- },
55
- streamingBaseUrl,
56
- };
57
- }
58
- //# sourceMappingURL=config.js.map
@@ -1 +0,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M,CAAC,aAAa,EAAE,eAAe;YACvD,SAAS,CAAC,CAAC,CAAC,MAAM,CAAC,aAAa,CAAC,eAAe;QACpD,CAAC,CAAC,CAAC,OAAO,CAAC,GAAG,CAAC,sBAAsB,KAAK,MAAM,IAAI,IAAI,CAAC,CAAC;IAE5D,OAAO;QACL,QAAQ,EAAE,OAAO;QACjB,MAAM,EAAE,MAAM,CAAC,MAAM,IAAI;YACvB,SAAS,EAAE,yBAAyB;YACpC,QAAQ,EAAE,EAAE;SACb;QACD,OAAO,EAAE,MAAM,CAAC,OAAO,IAAI;YACzB,MAAM,EAAE,MAAM;YACd,QAAQ,EAAE,EAAE;SACb;QACD,UAAU,EAAE,MAAM,CAAC,UAAU,IAAI;YAC/B,OAAO,EAAE,CAAC,eAAe,CAAC;YAC1B,aAAa,EAAE,eAAe;YAC9B,QAAQ,EAAE,EAAE;SACb;QACD,aAAa,EAAE;YACb,YAAY;YACZ,cAAc;YACd,iBAAiB;YACjB,eAAe;YACf,eAAe;SAChB;QACD,gBAAgB;KACjB,CAAC;AACJ,CAAC"}
package/dist/errors.d.ts DELETED
@@ -1,12 +0,0 @@
1
- export type VideoContentTypeErrorCode = 'VIDEO_CONTENT_TYPE_ERROR' | 'INVALID_INPUT' | 'OPERATION_FAILED';
2
- export interface VideoContentTypeErrorOptions {
3
- cause?: Error;
4
- code?: VideoContentTypeErrorCode;
5
- context?: Record<string, unknown>;
6
- }
7
- export declare class VideoContentTypeError extends Error {
8
- readonly code: VideoContentTypeErrorCode;
9
- readonly context?: Record<string, unknown>;
10
- constructor(message: string, options?: VideoContentTypeErrorOptions);
11
- }
12
- //# sourceMappingURL=errors.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../src/errors.ts"],"names":[],"mappings":"AAQA,MAAM,MAAM,yBAAyB,GACjC,0BAA0B,GAC1B,eAAe,GACf,kBAAkB,CAAC;AAEvB,MAAM,WAAW,4BAA4B;IAC3C,KAAK,CAAC,EAAE,KAAK,CAAC;IACd,IAAI,CAAC,EAAE,yBAAyB,CAAC;IACjC,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACnC;AAED,qBAAa,qBAAsB,SAAQ,KAAK;IAC9C,QAAQ,CAAC,IAAI,EAAE,yBAAyB,CAAC;IACzC,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;gBAE/B,OAAO,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,4BAA4B;CASpE"}
package/dist/errors.js DELETED
@@ -1,25 +0,0 @@
1
- "use strict";
2
- /*
3
- Copyright (c) 2025 Bernier LLC
4
-
5
- This file is licensed to the client under a limited-use license.
6
- The client may use and modify this code only within the scope of the project it was delivered for.
7
- Redistribution or use in other products or commercial offerings is not permitted without written consent from Bernier LLC.
8
- */
9
- Object.defineProperty(exports, "__esModule", { value: true });
10
- exports.VideoContentTypeError = void 0;
11
- class VideoContentTypeError extends Error {
12
- code;
13
- context;
14
- constructor(message, options) {
15
- super(message, options?.cause ? { cause: options.cause } : undefined);
16
- this.name = 'VideoContentTypeError';
17
- this.code = options?.code ?? 'VIDEO_CONTENT_TYPE_ERROR';
18
- if (options?.context !== undefined) {
19
- this.context = options.context;
20
- }
21
- Error.captureStackTrace?.(this, this.constructor);
22
- }
23
- }
24
- exports.VideoContentTypeError = VideoContentTypeError;
25
- //# sourceMappingURL=errors.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"errors.js","sourceRoot":"","sources":["../src/errors.ts"],"names":[],"mappings":";AAAA;;;;;;EAME;;;AAaF,MAAa,qBAAsB,SAAQ,KAAK;IACrC,IAAI,CAA4B;IAChC,OAAO,CAA2B;IAE3C,YAAY,OAAe,EAAE,OAAsC;QACjE,KAAK,CAAC,OAAO,EAAE,OAAO,EAAE,KAAK,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,OAAO,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC;QACtE,IAAI,CAAC,IAAI,GAAG,uBAAuB,CAAC;QACpC,IAAI,CAAC,IAAI,GAAG,OAAO,EAAE,IAAI,IAAI,0BAA0B,CAAC;QACxD,IAAI,OAAO,EAAE,OAAO,KAAK,SAAS,EAAE,CAAC;YACnC,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC;QACjC,CAAC;QACD,KAAK,CAAC,iBAAiB,EAAE,CAAC,IAAI,EAAE,IAAI,CAAC,WAAW,CAAC,CAAC;IACpD,CAAC;CACF;AAbD,sDAaC"}
package/dist/index.d.ts DELETED
@@ -1,8 +0,0 @@
1
- export * from './types';
2
- export * from './VideoContentType';
3
- export * from './config';
4
- export * from './storage/VideoStorage';
5
- export * from './storage/LocalVideoStorage';
6
- export { VideoContentType } from './VideoContentType';
7
- export { VideoContentTypeError, type VideoContentTypeErrorCode, type VideoContentTypeErrorOptions, } from './errors';
8
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAQA,cAAc,SAAS,CAAC;AACxB,cAAc,oBAAoB,CAAC;AACnC,cAAc,UAAU,CAAC;AACzB,cAAc,wBAAwB,CAAC;AACvC,cAAc,6BAA6B,CAAC;AAC5C,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACtD,OAAO,EACL,qBAAqB,EACrB,KAAK,yBAAyB,EAC9B,KAAK,4BAA4B,GAClC,MAAM,UAAU,CAAC"}
package/dist/index.js DELETED
@@ -1,34 +0,0 @@
1
- "use strict";
2
- /*
3
- Copyright (c) 2025 Bernier LLC
4
-
5
- This file is licensed to the client under a limited-use license.
6
- The client may use and modify this code *only within the scope of the project it was delivered for*.
7
- Redistribution or use in other products or commercial offerings is not permitted without written consent from Bernier LLC.
8
- */
9
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- var desc = Object.getOwnPropertyDescriptor(m, k);
12
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
13
- desc = { enumerable: true, get: function() { return m[k]; } };
14
- }
15
- Object.defineProperty(o, k2, desc);
16
- }) : (function(o, m, k, k2) {
17
- if (k2 === undefined) k2 = k;
18
- o[k2] = m[k];
19
- }));
20
- var __exportStar = (this && this.__exportStar) || function(m, exports) {
21
- for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
22
- };
23
- Object.defineProperty(exports, "__esModule", { value: true });
24
- exports.VideoContentTypeError = exports.VideoContentType = void 0;
25
- __exportStar(require("./types"), exports);
26
- __exportStar(require("./VideoContentType"), exports);
27
- __exportStar(require("./config"), exports);
28
- __exportStar(require("./storage/VideoStorage"), exports);
29
- __exportStar(require("./storage/LocalVideoStorage"), exports);
30
- var VideoContentType_1 = require("./VideoContentType");
31
- Object.defineProperty(exports, "VideoContentType", { enumerable: true, get: function () { return VideoContentType_1.VideoContentType; } });
32
- var errors_1 = require("./errors");
33
- Object.defineProperty(exports, "VideoContentTypeError", { enumerable: true, get: function () { return errors_1.VideoContentTypeError; } });
34
- //# sourceMappingURL=index.js.map
package/dist/index.js.map DELETED
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAAA;;;;;;EAME;;;;;;;;;;;;;;;;;AAEF,0CAAwB;AACxB,qDAAmC;AACnC,2CAAyB;AACzB,yDAAuC;AACvC,8DAA4C;AAC5C,uDAAsD;AAA7C,oHAAA,gBAAgB,OAAA;AACzB,mCAIkB;AAHhB,+GAAA,qBAAqB,OAAA"}
@@ -1,22 +0,0 @@
1
- import { VideoStorage } from './VideoStorage';
2
- import { VideoContentResult, VideoContentData, VideoContentTypeConfig } from '../types';
3
- /**
4
- * Local file system storage implementation for videos
5
- */
6
- export declare class LocalVideoStorage implements VideoStorage {
7
- private storageBasePath;
8
- private streamingBaseUrl;
9
- constructor(config: VideoContentTypeConfig);
10
- save(file: Buffer | string, filename: string, uploadedBy?: string): Promise<VideoContentResult<VideoContentData>>;
11
- get(localPath: string): Promise<Buffer | null>;
12
- delete(localPath: string): Promise<boolean>;
13
- exists(localPath: string): Promise<boolean>;
14
- getStreamingUrl(localPath: string): string;
15
- /**
16
- * Extract video metadata
17
- * Note: In production, this would use ffmpeg/ffprobe for real metadata extraction
18
- */
19
- private extractMetadata;
20
- private getMimeTypeFromExtension;
21
- }
22
- //# sourceMappingURL=LocalVideoStorage.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"LocalVideoStorage.d.ts","sourceRoot":"","sources":["../../src/storage/LocalVideoStorage.ts"],"names":[],"mappings":"AAWA,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,EAAE,kBAAkB,EAAE,gBAAgB,EAAsC,sBAAsB,EAAE,MAAM,UAAU,CAAC;AAE5H;;GAEG;AACH,qBAAa,iBAAkB,YAAW,YAAY;IACpD,OAAO,CAAC,eAAe,CAAS;IAChC,OAAO,CAAC,gBAAgB,CAAS;gBAErB,MAAM,EAAE,sBAAsB;IAKpC,IAAI,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,UAAU,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,kBAAkB,CAAC,gBAAgB,CAAC,CAAC;IA6CjH,GAAG,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC;IAQ9C,MAAM,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC;IAS3C,MAAM,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC;IASjD,eAAe,CAAC,SAAS,EAAE,MAAM,GAAG,MAAM;IAK1C;;;OAGG;YACW,eAAe;IAiB7B,OAAO,CAAC,wBAAwB;CAUjC"}
@@ -1,157 +0,0 @@
1
- "use strict";
2
- /*
3
- Copyright (c) 2025 Bernier LLC
4
-
5
- This file is licensed to the client under a limited-use license.
6
- The client may use and modify this code *only within the scope of the project it was delivered for*.
7
- Redistribution or use in other products or commercial offerings is not permitted without written consent from Bernier LLC.
8
- */
9
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- var desc = Object.getOwnPropertyDescriptor(m, k);
12
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
13
- desc = { enumerable: true, get: function() { return m[k]; } };
14
- }
15
- Object.defineProperty(o, k2, desc);
16
- }) : (function(o, m, k, k2) {
17
- if (k2 === undefined) k2 = k;
18
- o[k2] = m[k];
19
- }));
20
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
21
- Object.defineProperty(o, "default", { enumerable: true, value: v });
22
- }) : function(o, v) {
23
- o["default"] = v;
24
- });
25
- var __importStar = (this && this.__importStar) || (function () {
26
- var ownKeys = function(o) {
27
- ownKeys = Object.getOwnPropertyNames || function (o) {
28
- var ar = [];
29
- for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
30
- return ar;
31
- };
32
- return ownKeys(o);
33
- };
34
- return function (mod) {
35
- if (mod && mod.__esModule) return mod;
36
- var result = {};
37
- if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
38
- __setModuleDefault(result, mod);
39
- return result;
40
- };
41
- })();
42
- Object.defineProperty(exports, "__esModule", { value: true });
43
- exports.LocalVideoStorage = void 0;
44
- const fs = __importStar(require("fs/promises"));
45
- const fsSync = __importStar(require("fs"));
46
- const path = __importStar(require("path"));
47
- const types_1 = require("../types");
48
- /**
49
- * Local file system storage implementation for videos
50
- */
51
- class LocalVideoStorage {
52
- storageBasePath;
53
- streamingBaseUrl;
54
- constructor(config) {
55
- this.storageBasePath = config.uploadOptions?.storageBasePath || './storage/videos';
56
- this.streamingBaseUrl = config.streamingBaseUrl || '/api/video/stream';
57
- }
58
- async save(file, filename, uploadedBy) {
59
- try {
60
- // Ensure storage directory exists
61
- await fs.mkdir(this.storageBasePath, { recursive: true });
62
- // Generate unique filename
63
- const timestamp = Date.now();
64
- const sanitizedFilename = filename.replace(/[^a-zA-Z0-9.-]/g, '_');
65
- const uniqueFilename = `${timestamp}-${sanitizedFilename}`;
66
- // Save file
67
- const filePath = path.join(this.storageBasePath, uniqueFilename);
68
- if (Buffer.isBuffer(file)) {
69
- await fs.writeFile(filePath, file);
70
- }
71
- else {
72
- await fs.copyFile(file, filePath);
73
- }
74
- // Extract metadata
75
- const metadata = await this.extractMetadata(filePath);
76
- // Generate streaming URL
77
- const streamingUrl = this.getStreamingUrl(filePath);
78
- const contentData = {
79
- filePath,
80
- streamingUrl,
81
- metadata,
82
- uploadedAt: new Date(),
83
- uploadedBy,
84
- };
85
- return {
86
- success: true,
87
- data: contentData,
88
- };
89
- }
90
- catch (error) {
91
- return {
92
- success: false,
93
- error: error instanceof Error ? error.message : 'Unknown save error',
94
- };
95
- }
96
- }
97
- async get(localPath) {
98
- try {
99
- return await fs.readFile(localPath);
100
- }
101
- catch {
102
- return null;
103
- }
104
- }
105
- async delete(localPath) {
106
- try {
107
- await fs.unlink(localPath);
108
- return true;
109
- }
110
- catch {
111
- return false;
112
- }
113
- }
114
- async exists(localPath) {
115
- try {
116
- await fs.access(localPath);
117
- return true;
118
- }
119
- catch {
120
- return false;
121
- }
122
- }
123
- getStreamingUrl(localPath) {
124
- const relativePath = path.relative(this.storageBasePath, localPath);
125
- return `${this.streamingBaseUrl}/${encodeURIComponent(relativePath)}`;
126
- }
127
- /**
128
- * Extract video metadata
129
- * Note: In production, this would use ffmpeg/ffprobe for real metadata extraction
130
- */
131
- async extractMetadata(filePath) {
132
- const stats = fsSync.statSync(filePath);
133
- // Basic metadata - in production, use ffmpeg/ffprobe for real extraction
134
- const metadata = {
135
- filename: path.basename(filePath),
136
- mimeType: this.getMimeTypeFromExtension(filePath),
137
- size: stats.size,
138
- duration: 60, // Placeholder - would extract from video
139
- width: 1920, // Placeholder - would extract from video
140
- height: 1080, // Placeholder - would extract from video
141
- fps: 30, // Placeholder - would extract from video
142
- };
143
- return types_1.VideoMetadataSchema.parse(metadata);
144
- }
145
- getMimeTypeFromExtension(filePath) {
146
- const ext = path.extname(filePath).slice(1).toLowerCase();
147
- const mimeTypes = {
148
- mp4: 'video/mp4',
149
- webm: 'video/webm',
150
- mov: 'video/quicktime',
151
- avi: 'video/x-msvideo',
152
- };
153
- return mimeTypes[ext] || 'video/mp4';
154
- }
155
- }
156
- exports.LocalVideoStorage = LocalVideoStorage;
157
- //# sourceMappingURL=LocalVideoStorage.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"LocalVideoStorage.js","sourceRoot":"","sources":["../../src/storage/LocalVideoStorage.ts"],"names":[],"mappings":";AAAA;;;;;;EAME;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEF,gDAAkC;AAClC,2CAA6B;AAC7B,2CAA6B;AAE7B,oCAA4H;AAE5H;;GAEG;AACH,MAAa,iBAAiB;IACpB,eAAe,CAAS;IACxB,gBAAgB,CAAS;IAEjC,YAAY,MAA8B;QACxC,IAAI,CAAC,eAAe,GAAG,MAAM,CAAC,aAAa,EAAE,eAAe,IAAI,kBAAkB,CAAC;QACnF,IAAI,CAAC,gBAAgB,GAAG,MAAM,CAAC,gBAAgB,IAAI,mBAAmB,CAAC;IACzE,CAAC;IAED,KAAK,CAAC,IAAI,CAAC,IAAqB,EAAE,QAAgB,EAAE,UAAmB;QACrE,IAAI,CAAC;YACH,kCAAkC;YAClC,MAAM,EAAE,CAAC,KAAK,CAAC,IAAI,CAAC,eAAe,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;YAE1D,2BAA2B;YAC3B,MAAM,SAAS,GAAG,IAAI,CAAC,GAAG,EAAE,CAAC;YAC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AC/C,MAAM,GAAG,GAAG,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,WAAW,EAAE,CAAC;QAC1D,MAAM,SAAS,GAA2B;YACxC,GAAG,EAAE,WAAW;YAChB,IAAI,EAAE,YAAY;YAClB,GAAG,EAAE,iBAAiB;YACtB,GAAG,EAAE,iBAAiB;SACvB,CAAC;QACF,OAAO,SAAS,CAAC,GAAG,CAAC,IAAI,WAAW,CAAC;IACvC,CAAC;CACF;AApHD,8CAoHC"}
@@ -1,12 +0,0 @@
1
- import { VideoContentResult, VideoContentData } from '../types';
2
- /**
3
- * Video storage interface
4
- */
5
- export interface VideoStorage {
6
- save(file: Buffer | string, filename: string, uploadedBy?: string): Promise<VideoContentResult<VideoContentData>>;
7
- get(localPath: string): Promise<Buffer | null>;
8
- delete(localPath: string): Promise<boolean>;
9
- exists(localPath: string): Promise<boolean>;
10
- getStreamingUrl(localPath: string): string;
11
- }
12
- //# sourceMappingURL=VideoStorage.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"VideoStorage.d.ts","sourceRoot":"","sources":["../../src/storage/VideoStorage.ts"],"names":[],"mappings":"AAQA,OAAO,EAAE,kBAAkB,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAC;AAEhE;;GAEG;AACH,MAAM,WAAW,YAAY;IAC3B,IAAI,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,UAAU,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,kBAAkB,CAAC,gBAAgB,CAAC,CAAC,CAAC;IAClH,GAAG,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAAC;IAC/C,MAAM,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;IAC5C,MAAM,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;IAC5C,eAAe,CAAC,SAAS,EAAE,MAAM,GAAG,MAAM,CAAC;CAC5C"}
@@ -1,10 +0,0 @@
1
- "use strict";
2
- /*
3
- Copyright (c) 2025 Bernier LLC
4
-
5
- This file is licensed to the client under a limited-use license.
6
- The client may use and modify this code *only within the scope of the project it was delivered for*.
7
- Redistribution or use in other products or commercial offerings is not permitted without written consent from Bernier LLC.
8
- */
9
- Object.defineProperty(exports, "__esModule", { value: true });
10
- //# sourceMappingURL=VideoStorage.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"VideoStorage.js","sourceRoot":"","sources":["../../src/storage/VideoStorage.ts"],"names":[],"mappings":";AAAA;;;;;;EAME"}
package/dist/types.d.ts DELETED
@@ -1,101 +0,0 @@
1
- import { z } from 'zod';
2
- /**
3
- * Video metadata schema
4
- */
5
- export declare const VideoMetadataSchema: z.ZodObject<{
6
- filename: z.ZodString;
7
- mimeType: z.ZodString;
8
- size: z.ZodNumber;
9
- duration: z.ZodNumber;
10
- width: z.ZodNumber;
11
- height: z.ZodNumber;
12
- fps: z.ZodNumber;
13
- thumbnail: z.ZodOptional<z.ZodString>;
14
- bitrate: z.ZodOptional<z.ZodNumber>;
15
- codec: z.ZodOptional<z.ZodString>;
16
- }, "strip", z.ZodTypeAny, {
17
- filename: string;
18
- mimeType: string;
19
- size: number;
20
- duration: number;
21
- width: number;
22
- height: number;
23
- fps: number;
24
- thumbnail?: string | undefined;
25
- bitrate?: number | undefined;
26
- codec?: string | undefined;
27
- }, {
28
- filename: string;
29
- mimeType: string;
30
- size: number;
31
- duration: number;
32
- width: number;
33
- height: number;
34
- fps: number;
35
- thumbnail?: string | undefined;
36
- bitrate?: number | undefined;
37
- codec?: string | undefined;
38
- }>;
39
- export type VideoMetadata = z.infer<typeof VideoMetadataSchema>;
40
- /**
41
- * Video content data
42
- */
43
- export interface VideoContentData {
44
- filePath: string;
45
- streamingUrl: string;
46
- metadata: VideoMetadata;
47
- uploadedAt: Date;
48
- uploadedBy?: string | undefined;
49
- }
50
- /**
51
- * Video upload options
52
- */
53
- export interface VideoUploadOptions {
54
- maxSizeBytes?: number;
55
- allowedFormats?: string[];
56
- generateThumbnail?: boolean;
57
- extractMetadata?: boolean;
58
- storageBasePath?: string;
59
- }
60
- /**
61
- * Video content type configuration
62
- */
63
- export interface VideoContentTypeConfig {
64
- baseType: 'video';
65
- editor: {
66
- component: string;
67
- settings?: Record<string, unknown>;
68
- };
69
- storage: {
70
- method: string;
71
- settings?: Record<string, unknown>;
72
- };
73
- publishing: {
74
- methods: string[];
75
- defaultMethod?: string;
76
- settings?: Record<string, unknown>;
77
- };
78
- uploadOptions?: VideoUploadOptions;
79
- streamingBaseUrl?: string;
80
- }
81
- /**
82
- * Result type for video operations
83
- */
84
- export interface VideoContentResult<T = unknown> {
85
- success: boolean;
86
- data?: T;
87
- error?: string;
88
- }
89
- /**
90
- * Video content error codes
91
- */
92
- export type VideoContentErrorCode = 'INVALID_FORMAT' | 'FILE_TOO_LARGE' | 'UPLOAD_FAILED' | 'METADATA_EXTRACTION_FAILED' | 'VALIDATION_FAILED';
93
- /**
94
- * Video content error
95
- */
96
- export interface VideoContentError {
97
- code: VideoContentErrorCode;
98
- message: string;
99
- details?: unknown;
100
- }
101
- //# sourceMappingURL=types.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAQA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB;;GAEG;AACH,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAW9B,CAAC;AAEH,MAAM,MAAM,aAAa,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,mBAAmB,CAAC,CAAC;AAEhE;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAC/B,QAAQ,EAAE,MAAM,CAAC;IACjB,YAAY,EAAE,MAAM,CAAC;IACrB,QAAQ,EAAE,aAAa,CAAC;IAC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AqB,CAAC;IAC5B,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB"}
package/dist/types.js DELETED
@@ -1,27 +0,0 @@
1
- "use strict";
2
- /*
3
- Copyright (c) 2025 Bernier LLC
4
-
5
- This file is licensed to the client under a limited-use license.
6
- The client may use and modify this code *only within the scope of the project it was delivered for*.
7
- Redistribution or use in other products or commercial offerings is not permitted without written consent from Bernier LLC.
8
- */
9
- Object.defineProperty(exports, "__esModule", { value: true });
10
- exports.VideoMetadataSchema = void 0;
11
- const zod_1 = require("zod");
12
- /**
13
- * Video metadata schema
14
- */
15
- exports.VideoMetadataSchema = zod_1.z.object({
16
- filename: zod_1.z.string(),
17
- mimeType: zod_1.z.string().regex(/^video\//),
18
- size: zod_1.z.number().positive(),
19
- duration: zod_1.z.number().positive(), // seconds
20
- width: zod_1.z.number().int().positive(),
21
- height: zod_1.z.number().int().positive(),
22
- fps: zod_1.z.number().positive(),
23
- thumbnail: zod_1.z.string().optional(), // base64 or URL to thumbnail
24
- bitrate: zod_1.z.number().positive().optional(),
25
- codec: zod_1.z.string().optional()
26
- });
27
- //# sourceMappingURL=types.js.map
package/dist/types.js.map DELETED
@@ -1 +0,0 @@
1
- {"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":";AAAA;;;;;;EAME;;;AAEF,6BAAwB;AAExB;;GAEG;AACU,QAAA,mBAAmB,GAAG,OAAC,CAAC,MAAM,CAAC;IAC1C,QAAQ,EAAE,OAAC,CAAC,MAAM,EAAE;IACpB,QAAQ,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,KAAK,CAAC,UAAU,CAAC;IACtC,IAAI,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAC3B,QAAQ,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,EAAE,UAAU;IAC3C,KAAK,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,QAAQ,EAAE;IAClC,MAAM,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,QAAQ,EAAE;IACnC,GAAG,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAC1B,SAAS,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,EAAE,6BAA6B;IAC/D,OAAO,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,EAAE;IACzC,KAAK,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;CAC7B,CAAC,CAAC"}