@lilaquadrat/interfaces 1.31.0 → 1.33.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.
Files changed (56) hide show
  1. package/CHANGELOG.md +20 -0
  2. package/lib/cjs/AvailableStorageTypes.d.ts +1 -1
  3. package/lib/cjs/DatabaseQueryOptions.d.ts +1 -0
  4. package/lib/cjs/Media.d.ts +4 -2
  5. package/lib/cjs/MediaMetadata.d.ts +17 -0
  6. package/lib/cjs/PathMapping.d.ts +7 -0
  7. package/lib/cjs/ShareClientOptions.d.ts +12 -0
  8. package/lib/cjs/Storage.d.ts +28 -0
  9. package/lib/cjs/StorageFilePaths.d.ts +5 -0
  10. package/lib/cjs/StorageWithVersions.d.ts +4 -0
  11. package/lib/cjs/Stored.d.ts +7 -0
  12. package/lib/cjs/Upload.d.ts +29 -0
  13. package/lib/cjs/index.d.ts +7 -1
  14. package/lib/esm/AvailableStorageTypes.d.ts +1 -1
  15. package/lib/esm/DatabaseQueryOptions.d.ts +1 -0
  16. package/lib/esm/Media.d.ts +4 -2
  17. package/lib/esm/MediaMetadata.d.ts +17 -0
  18. package/lib/esm/MediaMetadata.js +2 -0
  19. package/lib/esm/MediaMetadata.js.map +1 -0
  20. package/lib/esm/PathMapping.d.ts +7 -0
  21. package/lib/esm/PathMapping.js +2 -0
  22. package/lib/esm/PathMapping.js.map +1 -0
  23. package/lib/esm/ShareClientOptions.d.ts +12 -0
  24. package/lib/esm/Storage.d.ts +28 -0
  25. package/lib/esm/Storage.js +2 -0
  26. package/lib/esm/Storage.js.map +1 -0
  27. package/lib/esm/StorageFilePaths.d.ts +5 -0
  28. package/lib/esm/StorageFilePaths.js +2 -0
  29. package/lib/esm/StorageFilePaths.js.map +1 -0
  30. package/lib/esm/StorageWithVersions.d.ts +4 -0
  31. package/lib/esm/StorageWithVersions.js +2 -0
  32. package/lib/esm/StorageWithVersions.js.map +1 -0
  33. package/lib/esm/Stored.d.ts +7 -0
  34. package/lib/esm/Stored.js +2 -0
  35. package/lib/esm/Stored.js.map +1 -0
  36. package/lib/esm/Upload.d.ts +29 -0
  37. package/lib/esm/Upload.js +2 -0
  38. package/lib/esm/Upload.js.map +1 -0
  39. package/lib/esm/index.d.ts +7 -1
  40. package/package.json +2 -2
  41. package/src/AvailableStorageTypes.ts +1 -1
  42. package/src/DatabaseQueryOptions.ts +1 -0
  43. package/src/Media.ts +5 -2
  44. package/src/MediaMetadata.ts +17 -0
  45. package/src/PathMapping.ts +7 -0
  46. package/src/ShareClientOptions.ts +12 -0
  47. package/src/Storage.ts +36 -0
  48. package/src/StorageFilePaths.ts +5 -0
  49. package/src/StorageWithVersions.ts +5 -0
  50. package/src/Stored.ts +11 -0
  51. package/src/Upload.ts +27 -0
  52. package/lib/cjs/MediaInfo.d.ts +0 -6
  53. package/lib/esm/MediaInfo.d.ts +0 -6
  54. package/lib/esm/MediaInfo.js +0 -2
  55. package/lib/esm/MediaInfo.js.map +0 -1
  56. package/src/MediaInfo.ts +0 -6
package/CHANGELOG.md CHANGED
@@ -2,6 +2,26 @@
2
2
 
3
3
  All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
4
4
 
5
+ ## [1.33.0](https://github.com/lilaquadrat/interfaces/compare/v1.32.0...v1.33.0) (2025-12-23)
6
+
7
+
8
+ ### Features
9
+
10
+ * **databasequeryoptions:** added search ([99d6a62](https://github.com/lilaquadrat/interfaces/commit/99d6a62b0be4b291d7cd69f85665bd2fb273907a))
11
+ * **mongodb:** installed version 7 ([92d072e](https://github.com/lilaquadrat/interfaces/commit/92d072e83cfec43970029e19b52f3ad51c312db8))
12
+
13
+
14
+ ### Bug Fixes
15
+
16
+ * **storage:** company and filename are required ([c2da646](https://github.com/lilaquadrat/interfaces/commit/c2da6460ef5a2e82b034056647b7cd3b78b6ec42))
17
+
18
+ ## [1.32.0](https://github.com/lilaquadrat/interfaces/compare/v1.31.0...v1.32.0) (2025-12-12)
19
+
20
+
21
+ ### Features
22
+
23
+ * **Storage, Upload:** enhance interfaces with customer and list properties; add StorageFilePaths interface ([b466639](https://github.com/lilaquadrat/interfaces/commit/b466639dcbad3ae03e9a33a540c80958c6f4491f))
24
+
5
25
  ## [1.31.0](https://github.com/lilaquadrat/interfaces/compare/v1.30.0...v1.31.0) (2025-11-01)
6
26
 
7
27
 
@@ -1 +1 @@
1
- export type AvailableStorageTypes = 'mock' | 'azureBlob' | 'azureStorage' | 'filesystem';
1
+ export type AvailableStorageTypes = 'mock' | 'azureBlob' | 'azureStorage' | 'filesystem' | 'minio';
@@ -28,4 +28,5 @@ export interface DatabaseQueryOptions {
28
28
  */
29
29
  keepSearch?: boolean;
30
30
  keepSort?: boolean;
31
+ search?: string[];
31
32
  }
@@ -1,6 +1,6 @@
1
1
  import { ObjectId } from "mongodb";
2
2
  import { Content } from "./Content";
3
- import { MediaInfo } from "./MediaInfo";
3
+ import { MediaMetadata } from "./MediaMetadata";
4
4
  import { MediaViewInfo } from "./MediaViewInfo";
5
5
  import { VersionInfo } from "./VersionInfo";
6
6
  export interface Media {
@@ -18,10 +18,12 @@ export interface Media {
18
18
  video?: boolean;
19
19
  folder?: boolean;
20
20
  mimetype?: string;
21
- info?: MediaInfo;
21
+ path?: string;
22
+ info?: MediaMetadata;
22
23
  view?: MediaViewInfo;
23
24
  download?: string;
24
25
  basePath?: string;
26
+ copyright?: string;
25
27
  baseContent?: {
26
28
  id: ObjectId;
27
29
  version: number;
@@ -0,0 +1,17 @@
1
+ export interface MediaMetadata {
2
+ /**
3
+ * e.g. 'untouched' or 'thumbnail_250' or 'optimized'
4
+ */
5
+ type?: string;
6
+ width?: number;
7
+ height?: number;
8
+ ratio?: number;
9
+ orientation?: 'landscape' | 'portrait' | 'square' | 'unknown';
10
+ /**
11
+ * in bytes
12
+ */
13
+ size?: number;
14
+ mimetype?: string;
15
+ copyright?: string;
16
+ tags?: string[];
17
+ }
@@ -0,0 +1,7 @@
1
+ export interface PathMapping {
2
+ filename: string;
3
+ mimetype: string;
4
+ path: string;
5
+ company: string;
6
+ project: string;
7
+ }
@@ -6,4 +6,16 @@ export interface ShareClientOptions {
6
6
  baseFolder?: string;
7
7
  accountName?: string;
8
8
  sharedKeyCredentials?: StorageSharedKeyCredential;
9
+ /**
10
+ * s3/minio accessKey
11
+ */
12
+ accessKey?: string;
13
+ /**
14
+ * s3/minio secretKey
15
+ */
16
+ secretKey?: string;
17
+ /**
18
+ * s3/minio endpoint
19
+ */
20
+ endpoint?: string;
9
21
  }
@@ -0,0 +1,28 @@
1
+ import { ObjectId } from "mongodb";
2
+ import { MediaMetadata } from "./MediaMetadata";
3
+ export interface Storage {
4
+ company: string;
5
+ project?: string;
6
+ /**
7
+ * this document can be bound to a specific customer
8
+ */
9
+ customer?: ObjectId;
10
+ /**
11
+ * this document can be bound to a specific list and customer
12
+ */
13
+ list?: ObjectId;
14
+ filename: string;
15
+ prefix?: string;
16
+ path?: string;
17
+ metadata?: MediaMetadata;
18
+ parent?: ObjectId;
19
+ /**
20
+ * app functions here as a bucket
21
+ */
22
+ app?: string;
23
+ /**
24
+ * for better classification
25
+ * e.g. profilepicture
26
+ */
27
+ type?: string;
28
+ }
@@ -0,0 +1,5 @@
1
+ export interface StorageFilePaths {
2
+ dir: string;
3
+ file: string;
4
+ relativePath: string;
5
+ }
@@ -0,0 +1,4 @@
1
+ import { Storage } from "./Storage";
2
+ export type StorageWithVersions = Storage & {
3
+ versions?: Storage[];
4
+ };
@@ -0,0 +1,7 @@
1
+ import { ObjectId } from "mongodb";
2
+ /**
3
+ * the passed data comes from mongodb and has a _id
4
+ */
5
+ export type Stored<T> = T & {
6
+ _id: ObjectId;
7
+ };
@@ -0,0 +1,29 @@
1
+ import { ObjectId } from 'mongodb';
2
+ import { ObjectIdString } from './ObjectIdString';
3
+ export interface Upload {
4
+ _id?: ObjectId;
5
+ filename?: string;
6
+ prefix?: string;
7
+ company?: string;
8
+ project?: string;
9
+ customer?: ObjectIdString | ObjectId;
10
+ list?: ObjectIdString | ObjectId;
11
+ user?: string;
12
+ app?: string;
13
+ mimetype?: string;
14
+ size?: number;
15
+ chunks: number;
16
+ paths?: {
17
+ path: string;
18
+ index: number;
19
+ }[];
20
+ updated?: Date;
21
+ state?: 'uploading' | 'waiting' | 'processing' | 'finished' | 'error';
22
+ options?: {
23
+ /**
24
+ * create thumbnails for images
25
+ */
26
+ thumbnails?: boolean;
27
+ overwrite?: boolean;
28
+ };
29
+ }
@@ -129,7 +129,7 @@ export * from './MePermissionsProject';
129
129
  export * from './Media';
130
130
  export * from './MediaApp';
131
131
  export * from './MediaContentFiles';
132
- export * from './MediaInfo';
132
+ export * from './MediaMetadata';
133
133
  export * from './MediaStats';
134
134
  export * from './MediaViewInfo';
135
135
  export * from './MenuCategoryElement';
@@ -149,6 +149,7 @@ export * from './ObjectIdString';
149
149
  export * from './Options';
150
150
  export * from './PartialModule';
151
151
  export * from './Partner';
152
+ export * from './PathMapping';
152
153
  export * from './Payment';
153
154
  export * from './PaymentProvider';
154
155
  export * from './PaymentProviderShopify';
@@ -192,6 +193,10 @@ export * from './ShareClientOptions';
192
193
  export * from './ShopifyProjectSettings';
193
194
  export * from './ShoppingCartModule';
194
195
  export * from './SkipLimitSort';
196
+ export * from './Storage';
197
+ export * from './StorageFilePaths';
198
+ export * from './StorageWithVersions';
199
+ export * from './Stored';
195
200
  export * from './StoryModule';
196
201
  export * from './Structure';
197
202
  export * from './StudioIframeMessage';
@@ -203,6 +208,7 @@ export * from './TrackerInput';
203
208
  export * from './TrackerStatistics';
204
209
  export * from './TrainingMdule';
205
210
  export * from './Universal';
211
+ export * from './Upload';
206
212
  export * from './UserApp';
207
213
  export * from './UserAppOptionsRequired';
208
214
  export * from './UserAppWithOptions';
@@ -1 +1 @@
1
- export type AvailableStorageTypes = 'mock' | 'azureBlob' | 'azureStorage' | 'filesystem';
1
+ export type AvailableStorageTypes = 'mock' | 'azureBlob' | 'azureStorage' | 'filesystem' | 'minio';
@@ -28,4 +28,5 @@ export interface DatabaseQueryOptions {
28
28
  */
29
29
  keepSearch?: boolean;
30
30
  keepSort?: boolean;
31
+ search?: string[];
31
32
  }
@@ -1,6 +1,6 @@
1
1
  import { ObjectId } from "mongodb";
2
2
  import { Content } from "./Content";
3
- import { MediaInfo } from "./MediaInfo";
3
+ import { MediaMetadata } from "./MediaMetadata";
4
4
  import { MediaViewInfo } from "./MediaViewInfo";
5
5
  import { VersionInfo } from "./VersionInfo";
6
6
  export interface Media {
@@ -18,10 +18,12 @@ export interface Media {
18
18
  video?: boolean;
19
19
  folder?: boolean;
20
20
  mimetype?: string;
21
- info?: MediaInfo;
21
+ path?: string;
22
+ info?: MediaMetadata;
22
23
  view?: MediaViewInfo;
23
24
  download?: string;
24
25
  basePath?: string;
26
+ copyright?: string;
25
27
  baseContent?: {
26
28
  id: ObjectId;
27
29
  version: number;
@@ -0,0 +1,17 @@
1
+ export interface MediaMetadata {
2
+ /**
3
+ * e.g. 'untouched' or 'thumbnail_250' or 'optimized'
4
+ */
5
+ type?: string;
6
+ width?: number;
7
+ height?: number;
8
+ ratio?: number;
9
+ orientation?: 'landscape' | 'portrait' | 'square' | 'unknown';
10
+ /**
11
+ * in bytes
12
+ */
13
+ size?: number;
14
+ mimetype?: string;
15
+ copyright?: string;
16
+ tags?: string[];
17
+ }
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=MediaMetadata.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"MediaMetadata.js","sourceRoot":"","sources":["../../src/MediaMetadata.ts"],"names":[],"mappings":""}
@@ -0,0 +1,7 @@
1
+ export interface PathMapping {
2
+ filename: string;
3
+ mimetype: string;
4
+ path: string;
5
+ company: string;
6
+ project: string;
7
+ }
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=PathMapping.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PathMapping.js","sourceRoot":"","sources":["../../src/PathMapping.ts"],"names":[],"mappings":""}
@@ -6,4 +6,16 @@ export interface ShareClientOptions {
6
6
  baseFolder?: string;
7
7
  accountName?: string;
8
8
  sharedKeyCredentials?: StorageSharedKeyCredential;
9
+ /**
10
+ * s3/minio accessKey
11
+ */
12
+ accessKey?: string;
13
+ /**
14
+ * s3/minio secretKey
15
+ */
16
+ secretKey?: string;
17
+ /**
18
+ * s3/minio endpoint
19
+ */
20
+ endpoint?: string;
9
21
  }
@@ -0,0 +1,28 @@
1
+ import { ObjectId } from "mongodb";
2
+ import { MediaMetadata } from "./MediaMetadata";
3
+ export interface Storage {
4
+ company: string;
5
+ project?: string;
6
+ /**
7
+ * this document can be bound to a specific customer
8
+ */
9
+ customer?: ObjectId;
10
+ /**
11
+ * this document can be bound to a specific list and customer
12
+ */
13
+ list?: ObjectId;
14
+ filename: string;
15
+ prefix?: string;
16
+ path?: string;
17
+ metadata?: MediaMetadata;
18
+ parent?: ObjectId;
19
+ /**
20
+ * app functions here as a bucket
21
+ */
22
+ app?: string;
23
+ /**
24
+ * for better classification
25
+ * e.g. profilepicture
26
+ */
27
+ type?: string;
28
+ }
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=Storage.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Storage.js","sourceRoot":"","sources":["../../src/Storage.ts"],"names":[],"mappings":""}
@@ -0,0 +1,5 @@
1
+ export interface StorageFilePaths {
2
+ dir: string;
3
+ file: string;
4
+ relativePath: string;
5
+ }
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=StorageFilePaths.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"StorageFilePaths.js","sourceRoot":"","sources":["../../src/StorageFilePaths.ts"],"names":[],"mappings":""}
@@ -0,0 +1,4 @@
1
+ import { Storage } from "./Storage";
2
+ export type StorageWithVersions = Storage & {
3
+ versions?: Storage[];
4
+ };
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=StorageWithVersions.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"StorageWithVersions.js","sourceRoot":"","sources":["../../src/StorageWithVersions.ts"],"names":[],"mappings":""}
@@ -0,0 +1,7 @@
1
+ import { ObjectId } from "mongodb";
2
+ /**
3
+ * the passed data comes from mongodb and has a _id
4
+ */
5
+ export type Stored<T> = T & {
6
+ _id: ObjectId;
7
+ };
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=Stored.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Stored.js","sourceRoot":"","sources":["../../src/Stored.ts"],"names":[],"mappings":""}
@@ -0,0 +1,29 @@
1
+ import { ObjectId } from 'mongodb';
2
+ import { ObjectIdString } from './ObjectIdString';
3
+ export interface Upload {
4
+ _id?: ObjectId;
5
+ filename?: string;
6
+ prefix?: string;
7
+ company?: string;
8
+ project?: string;
9
+ customer?: ObjectIdString | ObjectId;
10
+ list?: ObjectIdString | ObjectId;
11
+ user?: string;
12
+ app?: string;
13
+ mimetype?: string;
14
+ size?: number;
15
+ chunks: number;
16
+ paths?: {
17
+ path: string;
18
+ index: number;
19
+ }[];
20
+ updated?: Date;
21
+ state?: 'uploading' | 'waiting' | 'processing' | 'finished' | 'error';
22
+ options?: {
23
+ /**
24
+ * create thumbnails for images
25
+ */
26
+ thumbnails?: boolean;
27
+ overwrite?: boolean;
28
+ };
29
+ }
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=Upload.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Upload.js","sourceRoot":"","sources":["../../src/Upload.ts"],"names":[],"mappings":""}
@@ -129,7 +129,7 @@ export * from './MePermissionsProject';
129
129
  export * from './Media';
130
130
  export * from './MediaApp';
131
131
  export * from './MediaContentFiles';
132
- export * from './MediaInfo';
132
+ export * from './MediaMetadata';
133
133
  export * from './MediaStats';
134
134
  export * from './MediaViewInfo';
135
135
  export * from './MenuCategoryElement';
@@ -149,6 +149,7 @@ export * from './ObjectIdString';
149
149
  export * from './Options';
150
150
  export * from './PartialModule';
151
151
  export * from './Partner';
152
+ export * from './PathMapping';
152
153
  export * from './Payment';
153
154
  export * from './PaymentProvider';
154
155
  export * from './PaymentProviderShopify';
@@ -192,6 +193,10 @@ export * from './ShareClientOptions';
192
193
  export * from './ShopifyProjectSettings';
193
194
  export * from './ShoppingCartModule';
194
195
  export * from './SkipLimitSort';
196
+ export * from './Storage';
197
+ export * from './StorageFilePaths';
198
+ export * from './StorageWithVersions';
199
+ export * from './Stored';
195
200
  export * from './StoryModule';
196
201
  export * from './Structure';
197
202
  export * from './StudioIframeMessage';
@@ -203,6 +208,7 @@ export * from './TrackerInput';
203
208
  export * from './TrackerStatistics';
204
209
  export * from './TrainingMdule';
205
210
  export * from './Universal';
211
+ export * from './Upload';
206
212
  export * from './UserApp';
207
213
  export * from './UserAppOptionsRequired';
208
214
  export * from './UserAppWithOptions';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lilaquadrat/interfaces",
3
- "version": "1.31.0",
3
+ "version": "1.33.0",
4
4
  "description": "interfaces in context of lilaquadrat STUDIO",
5
5
  "author": {
6
6
  "email": "m.schuebel@lila2.de",
@@ -32,7 +32,7 @@
32
32
  "@types/node": "^20.11.9",
33
33
  "ajv": "^8.12.0",
34
34
  "cz-conventional-changelog": "^3.3.0",
35
- "mongodb": "^6.12.0",
35
+ "mongodb": "^7.0.0",
36
36
  "standard-version": "^9.5.0"
37
37
  },
38
38
  "config": {
@@ -1 +1 @@
1
- export type AvailableStorageTypes = 'mock'|'azureBlob'|'azureStorage'|'filesystem';
1
+ export type AvailableStorageTypes = 'mock' | 'azureBlob' | 'azureStorage' | 'filesystem' | 'minio';
@@ -28,4 +28,5 @@ export interface DatabaseQueryOptions {
28
28
  */
29
29
  keepSearch?: boolean;
30
30
  keepSort?: boolean;
31
+ search?: string[];
31
32
  }
package/src/Media.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  import { ObjectId } from "mongodb";
2
2
  import {Content} from "./Content";
3
- import { MediaInfo } from "./MediaInfo";
3
+ import { MediaMetadata } from "./MediaMetadata";
4
4
  import { MediaViewInfo } from "./MediaViewInfo";
5
5
  import { VersionInfo } from "./VersionInfo";
6
6
 
@@ -22,12 +22,15 @@ export interface Media {
22
22
  video?: boolean;
23
23
  folder?: boolean;
24
24
  mimetype?: string;
25
+ path?: string
25
26
 
26
- info?: MediaInfo;
27
+ info?: MediaMetadata;
27
28
  view?: MediaViewInfo;
28
29
  download?: string;
29
30
  basePath?: string;
30
31
 
32
+ copyright?: string;
33
+
31
34
  baseContent?: {
32
35
  id: ObjectId,
33
36
  version: number
@@ -0,0 +1,17 @@
1
+ export interface MediaMetadata {
2
+ /**
3
+ * e.g. 'untouched' or 'thumbnail_250' or 'optimized'
4
+ */
5
+ type?: string
6
+ width?: number
7
+ height?: number
8
+ ratio?: number
9
+ orientation?: 'landscape' | 'portrait' | 'square' | 'unknown'
10
+ /**
11
+ * in bytes
12
+ */
13
+ size?: number
14
+ mimetype?: string
15
+ copyright?: string
16
+ tags?: string[]
17
+ }
@@ -0,0 +1,7 @@
1
+ export interface PathMapping {
2
+ filename: string
3
+ mimetype: string
4
+ path: string
5
+ company: string
6
+ project: string
7
+ }
@@ -7,4 +7,16 @@ export interface ShareClientOptions {
7
7
  baseFolder?: string
8
8
  accountName?: string
9
9
  sharedKeyCredentials?: StorageSharedKeyCredential
10
+ /**
11
+ * s3/minio accessKey
12
+ */
13
+ accessKey?: string
14
+ /**
15
+ * s3/minio secretKey
16
+ */
17
+ secretKey?: string
18
+ /**
19
+ * s3/minio endpoint
20
+ */
21
+ endpoint?: string
10
22
  }
package/src/Storage.ts ADDED
@@ -0,0 +1,36 @@
1
+ import { ObjectId } from "mongodb";
2
+ import { MediaMetadata } from "./MediaMetadata";
3
+
4
+ export interface Storage {
5
+ company: string
6
+ project?: string
7
+
8
+ /**
9
+ * this document can be bound to a specific customer
10
+ */
11
+ customer?: ObjectId
12
+ /**
13
+ * this document can be bound to a specific list and customer
14
+ */
15
+ list?: ObjectId
16
+
17
+ filename: string
18
+ prefix?: string
19
+
20
+ path?: string
21
+
22
+ metadata?: MediaMetadata
23
+
24
+ parent?: ObjectId
25
+
26
+ /**
27
+ * app functions here as a bucket
28
+ */
29
+ app?: string
30
+
31
+ /**
32
+ * for better classification
33
+ * e.g. profilepicture
34
+ */
35
+ type?: string
36
+ }
@@ -0,0 +1,5 @@
1
+ export interface StorageFilePaths {
2
+ dir: string
3
+ file: string
4
+ relativePath: string
5
+ }
@@ -0,0 +1,5 @@
1
+ import { Storage } from "./Storage";
2
+
3
+ export type StorageWithVersions = Storage & {
4
+ versions?: Storage[]
5
+ }
package/src/Stored.ts ADDED
@@ -0,0 +1,11 @@
1
+ import { ObjectId } from "mongodb"
2
+
3
+ /**
4
+ * the passed data comes from mongodb and has a _id
5
+ */
6
+ export type Stored<T> = T & {
7
+
8
+ _id: ObjectId
9
+
10
+ }
11
+
package/src/Upload.ts ADDED
@@ -0,0 +1,27 @@
1
+ import { ObjectId } from 'mongodb';
2
+ import { ObjectIdString } from './ObjectIdString';
3
+
4
+ export interface Upload {
5
+ _id?: ObjectId;
6
+ filename?: string;
7
+ prefix?: string;
8
+ company?: string;
9
+ project?: string;
10
+ customer?: ObjectIdString | ObjectId;
11
+ list?: ObjectIdString | ObjectId;
12
+ user?: string;
13
+ app?: string;
14
+ mimetype?: string;
15
+ size?: number;
16
+ chunks: number;
17
+ paths?: { path: string, index: number }[];
18
+ updated?: Date;
19
+ state?: 'uploading' | 'waiting' | 'processing' | 'finished' | 'error';
20
+ options?: {
21
+ /**
22
+ * create thumbnails for images
23
+ */
24
+ thumbnails?: boolean,
25
+ overwrite?: boolean
26
+ }
27
+ }
@@ -1,6 +0,0 @@
1
- export interface MediaInfo {
2
- width?: number;
3
- height?: number;
4
- ratio?: number;
5
- size?: number;
6
- }
@@ -1,6 +0,0 @@
1
- export interface MediaInfo {
2
- width?: number;
3
- height?: number;
4
- ratio?: number;
5
- size?: number;
6
- }
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=MediaInfo.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"MediaInfo.js","sourceRoot":"","sources":["../../src/MediaInfo.ts"],"names":[],"mappings":""}
package/src/MediaInfo.ts DELETED
@@ -1,6 +0,0 @@
1
- export interface MediaInfo {
2
- width?: number;
3
- height?: number;
4
- ratio?: number;
5
- size?: number;
6
- }