@vardum/shared 0.1.0 → 0.2.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/LICENSE +21 -0
- package/dist/mime.d.ts +8 -0
- package/dist/mime.js +8 -0
- package/dist/wire.d.ts +10 -0
- package/package.json +16 -8
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Vardum contributors
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/dist/mime.d.ts
CHANGED
|
@@ -15,3 +15,11 @@ export declare const extensionMimeTypes: Record<string, SupportedMimeType>;
|
|
|
15
15
|
export declare function mimeForFilename(filename: string): SupportedMimeType | null;
|
|
16
16
|
/** Value for a file input's accept attribute, e.g. ".avif,.gif,…". */
|
|
17
17
|
export declare const uploadAccept: string;
|
|
18
|
+
/** Per-kind upload ceilings in bytes, as the API reports them. */
|
|
19
|
+
export type UploadLimits = {
|
|
20
|
+
image: number;
|
|
21
|
+
video: number;
|
|
22
|
+
file: number;
|
|
23
|
+
};
|
|
24
|
+
/** Files are the future generic kind: whatever is neither image nor video. */
|
|
25
|
+
export declare function uploadLimitFor(limits: UploadLimits, mimeType: string): number;
|
package/dist/mime.js
CHANGED
|
@@ -54,3 +54,11 @@ export function mimeForFilename(filename) {
|
|
|
54
54
|
export const uploadAccept = Object.keys(extensionMimeTypes)
|
|
55
55
|
.map((extension) => `.${extension}`)
|
|
56
56
|
.join(",");
|
|
57
|
+
/** Files are the future generic kind: whatever is neither image nor video. */
|
|
58
|
+
export function uploadLimitFor(limits, mimeType) {
|
|
59
|
+
return videoMimeSet.has(mimeType)
|
|
60
|
+
? limits.video
|
|
61
|
+
: mimeType.startsWith("image/")
|
|
62
|
+
? limits.image
|
|
63
|
+
: limits.file;
|
|
64
|
+
}
|
package/dist/wire.d.ts
CHANGED
|
@@ -34,10 +34,20 @@ export type VardManifest = {
|
|
|
34
34
|
updatedAt: string;
|
|
35
35
|
items: VardItem[];
|
|
36
36
|
};
|
|
37
|
+
/** Literal recursive inclusion of ready current originals; empty prefixes mean root. */
|
|
38
|
+
export type VardFolderRule = {
|
|
39
|
+
sourcePrefix: string;
|
|
40
|
+
outputPrefix: string;
|
|
41
|
+
};
|
|
42
|
+
/** Editable configuration: items are manual mappings only, never expanded outputs. */
|
|
43
|
+
export type VardDefinition = VardManifest & {
|
|
44
|
+
folderRules: VardFolderRule[];
|
|
45
|
+
};
|
|
37
46
|
export type SyncAsset = {
|
|
38
47
|
id: string;
|
|
39
48
|
key: string;
|
|
40
49
|
displayName: string;
|
|
50
|
+
isPublic: boolean;
|
|
41
51
|
versionId: string;
|
|
42
52
|
checksum: string | null;
|
|
43
53
|
mimeType: string;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vardum/shared",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.2.0",
|
|
4
4
|
"description": "Shared Vardum wire types and accepted-format tables",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -14,16 +14,24 @@
|
|
|
14
14
|
"default": "./dist/index.js"
|
|
15
15
|
}
|
|
16
16
|
},
|
|
17
|
-
"scripts": {
|
|
18
|
-
"build": "tsc -p tsconfig.json",
|
|
19
|
-
"dev": "tsc -p tsconfig.json --watch --preserveWatchOutput",
|
|
20
|
-
"typecheck": "tsc -p tsconfig.json --noEmit",
|
|
21
|
-
"prepublishOnly": "pnpm build"
|
|
22
|
-
},
|
|
23
17
|
"publishConfig": {
|
|
24
18
|
"access": "public"
|
|
25
19
|
},
|
|
26
20
|
"devDependencies": {
|
|
27
21
|
"typescript": "5.9.3"
|
|
22
|
+
},
|
|
23
|
+
"repository": {
|
|
24
|
+
"type": "git",
|
|
25
|
+
"url": "git+https://github.com/frgtn-dot-dev/vardum.git",
|
|
26
|
+
"directory": "packages/shared"
|
|
27
|
+
},
|
|
28
|
+
"homepage": "https://github.com/frgtn-dot-dev/vardum/tree/main/packages/shared#readme",
|
|
29
|
+
"bugs": {
|
|
30
|
+
"url": "https://github.com/frgtn-dot-dev/vardum/issues"
|
|
31
|
+
},
|
|
32
|
+
"scripts": {
|
|
33
|
+
"build": "tsc -p tsconfig.json",
|
|
34
|
+
"dev": "tsc -p tsconfig.json --watch --preserveWatchOutput",
|
|
35
|
+
"typecheck": "tsc -p tsconfig.json --noEmit"
|
|
28
36
|
}
|
|
29
|
-
}
|
|
37
|
+
}
|