@vendure/asset-server-plugin 1.6.0 → 1.6.3
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/lib/src/common.js
CHANGED
|
@@ -5,7 +5,11 @@ const constants_1 = require("@vendure/core/dist/common/constants");
|
|
|
5
5
|
function getAssetUrlPrefixFn(options) {
|
|
6
6
|
const { assetUrlPrefix, route } = options;
|
|
7
7
|
if (assetUrlPrefix == null) {
|
|
8
|
-
return (request, identifier) =>
|
|
8
|
+
return (request, identifier) => {
|
|
9
|
+
var _a;
|
|
10
|
+
const protocol = (_a = request.headers['x-forwarded-proto']) !== null && _a !== void 0 ? _a : request.protocol;
|
|
11
|
+
return `${protocol}://${request.get('host')}/${route}/`;
|
|
12
|
+
};
|
|
9
13
|
}
|
|
10
14
|
if (typeof assetUrlPrefix === 'string') {
|
|
11
15
|
return (...args) => assetUrlPrefix;
|
package/lib/src/common.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"common.js","sourceRoot":"","sources":["../../src/common.ts"],"names":[],"mappings":";;;AAAA,mEAA0E;AAK1E,SAAgB,mBAAmB,CAAC,OAA2B;IAC3D,MAAM,EAAE,cAAc,EAAE,KAAK,EAAE,GAAG,OAAO,CAAC;IAC1C,IAAI,cAAc,IAAI,IAAI,EAAE;QACxB,OAAO,CAAC,OAAgB,EAAE,UAAkB,EAAE,EAAE,
|
|
1
|
+
{"version":3,"file":"common.js","sourceRoot":"","sources":["../../src/common.ts"],"names":[],"mappings":";;;AAAA,mEAA0E;AAK1E,SAAgB,mBAAmB,CAAC,OAA2B;IAC3D,MAAM,EAAE,cAAc,EAAE,KAAK,EAAE,GAAG,OAAO,CAAC;IAC1C,IAAI,cAAc,IAAI,IAAI,EAAE;QACxB,OAAO,CAAC,OAAgB,EAAE,UAAkB,EAAE,EAAE;;YAC5C,MAAM,QAAQ,GAAG,MAAA,OAAO,CAAC,OAAO,CAAC,mBAAmB,CAAC,mCAAI,OAAO,CAAC,QAAQ,CAAC;YAC1E,OAAO,GAAG,QAAQ,MAAM,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,IAAI,KAAK,GAAG,CAAC;QAC5D,CAAC,CAAC;KACL;IACD,IAAI,OAAO,cAAc,KAAK,QAAQ,EAAE;QACpC,OAAO,CAAC,GAAG,IAAW,EAAE,EAAE,CAAC,cAAc,CAAC;KAC7C;IACD,IAAI,OAAO,cAAc,KAAK,UAAU,EAAE;QACtC,OAAO,CAAC,OAAgB,EAAE,UAAkB,EAAE,EAAE;YAC5C,MAAM,GAAG,GAAI,OAAe,CAAC,+BAAmB,CAAC,CAAC;YAClD,OAAO,cAAc,CAAC,GAAG,EAAE,UAAU,CAAC,CAAC;QAC3C,CAAC,CAAC;KACL;IACD,MAAM,IAAI,KAAK,CAAC,wDAAwD,IAAI,CAAC,SAAS,CAAC,cAAc,CAAC,EAAE,CAAC,CAAC;AAC9G,CAAC;AAlBD,kDAkBC"}
|
|
@@ -46,17 +46,17 @@ class SharpAssetPreviewStrategy {
|
|
|
46
46
|
}
|
|
47
47
|
}
|
|
48
48
|
generateMimeTypeOverlay(mimeType) {
|
|
49
|
-
return Buffer.from(`
|
|
50
|
-
<svg xmlns="http://www.w3.org/2000/svg" height="150" width="800">
|
|
51
|
-
<style>
|
|
52
|
-
text {
|
|
53
|
-
font-size: 64px;
|
|
54
|
-
font-family: Arial, sans-serif;
|
|
55
|
-
fill: #666;
|
|
56
|
-
}
|
|
57
|
-
</style>
|
|
58
|
-
|
|
59
|
-
<text x="400" y="110" text-anchor="middle" width="800">${mimeType}</text>
|
|
49
|
+
return Buffer.from(`
|
|
50
|
+
<svg xmlns="http://www.w3.org/2000/svg" height="150" width="800">
|
|
51
|
+
<style>
|
|
52
|
+
text {
|
|
53
|
+
font-size: 64px;
|
|
54
|
+
font-family: Arial, sans-serif;
|
|
55
|
+
fill: #666;
|
|
56
|
+
}
|
|
57
|
+
</style>
|
|
58
|
+
|
|
59
|
+
<text x="400" y="110" text-anchor="middle" width="800">${mimeType}</text>
|
|
60
60
|
</svg>`);
|
|
61
61
|
}
|
|
62
62
|
generateBinaryFilePreview(mimeType) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vendure/asset-server-plugin",
|
|
3
|
-
"version": "1.6.
|
|
3
|
+
"version": "1.6.3",
|
|
4
4
|
"main": "lib/index.js",
|
|
5
5
|
"types": "lib/index.d.ts",
|
|
6
6
|
"files": [
|
|
@@ -24,8 +24,8 @@
|
|
|
24
24
|
"@types/fs-extra": "^9.0.8",
|
|
25
25
|
"@types/node-fetch": "^2.5.8",
|
|
26
26
|
"@types/sharp": "^0.27.1",
|
|
27
|
-
"@vendure/common": "^1.6.
|
|
28
|
-
"@vendure/core": "^1.6.
|
|
27
|
+
"@vendure/common": "^1.6.3",
|
|
28
|
+
"@vendure/core": "^1.6.3",
|
|
29
29
|
"aws-sdk": "^2.856.0",
|
|
30
30
|
"express": "^4.17.1",
|
|
31
31
|
"node-fetch": "^2.6.1",
|
|
@@ -37,5 +37,5 @@
|
|
|
37
37
|
"fs-extra": "^10.0.0",
|
|
38
38
|
"sharp": "~0.29.0"
|
|
39
39
|
},
|
|
40
|
-
"gitHead": "
|
|
40
|
+
"gitHead": "809925dbdc1017943c5b8cba7633f1e232f4968d"
|
|
41
41
|
}
|