@socialtip/asset-proxy-url-generator 0.5.1 → 0.7.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/dist/index.d.ts +2 -2
- package/dist/index.js +3 -1
- package/package.json +9 -9
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { type
|
|
2
|
-
export type {
|
|
1
|
+
import { type InfoOptions, type ParsedUrlInput } from "@socialtip/asset-proxy-url-parser";
|
|
2
|
+
export type { InfoOptions, ParsedUrlInput, } from "@socialtip/asset-proxy-url-parser";
|
|
3
3
|
/** Options for generating a URL, derived from the asset-proxy parsed URL schema. All fields except `sourceUrl` are optional. */
|
|
4
4
|
export type UrlGeneratorOptions = Partial<ParsedUrlInput> & {
|
|
5
5
|
sourceUrl: string;
|
package/dist/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { encryptSourceUrl,
|
|
1
|
+
import { encryptSourceUrl, SHORTHANDS, sign, } from "@socialtip/asset-proxy-url-parser";
|
|
2
2
|
/** Generates an asset-proxy-compatible URL path. */
|
|
3
3
|
export function generateUrl(options, config) {
|
|
4
4
|
const segments = serializeOptions(options);
|
|
@@ -217,6 +217,8 @@ function serializeOptions(options) {
|
|
|
217
217
|
segments.push(`ct:${options.cut}`);
|
|
218
218
|
if (options.mute !== undefined)
|
|
219
219
|
segments.push(`mu:${bool(options.mute)}`);
|
|
220
|
+
if (options.codec !== undefined)
|
|
221
|
+
segments.push(`cdc:${bool(options.codec)}`);
|
|
220
222
|
if (options.trim) {
|
|
221
223
|
const parts = [String(options.trim.threshold)];
|
|
222
224
|
if (options.trim.colour !== undefined ||
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@socialtip/asset-proxy-url-generator",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.7.0",
|
|
4
4
|
"description": "Generate asset-proxy-compatible URL paths with optional encryption and signing",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -14,8 +14,13 @@
|
|
|
14
14
|
"files": [
|
|
15
15
|
"dist"
|
|
16
16
|
],
|
|
17
|
+
"scripts": {
|
|
18
|
+
"build": "tsc -p tsconfig.build.json",
|
|
19
|
+
"typecheck": "tsc --noEmit",
|
|
20
|
+
"test": "vitest run"
|
|
21
|
+
},
|
|
17
22
|
"dependencies": {
|
|
18
|
-
"@socialtip/asset-proxy-url-parser": "
|
|
23
|
+
"@socialtip/asset-proxy-url-parser": "workspace:*"
|
|
19
24
|
},
|
|
20
25
|
"devDependencies": {
|
|
21
26
|
"@imgproxy/imgproxy-node": "^1.1.0",
|
|
@@ -26,12 +31,7 @@
|
|
|
26
31
|
"license": "UNLICENSED",
|
|
27
32
|
"repository": {
|
|
28
33
|
"type": "git",
|
|
29
|
-
"url": "https://github.com/SocialTip/asset-proxy.git",
|
|
34
|
+
"url": "git+https://github.com/SocialTip/asset-proxy.git",
|
|
30
35
|
"directory": "packages/url-generator"
|
|
31
|
-
},
|
|
32
|
-
"scripts": {
|
|
33
|
-
"build": "tsc -p tsconfig.build.json",
|
|
34
|
-
"typecheck": "tsc --noEmit",
|
|
35
|
-
"test": "vitest run"
|
|
36
36
|
}
|
|
37
|
-
}
|
|
37
|
+
}
|