cloudcommerce 0.26.2 → 0.26.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/CHANGELOG.md +13 -0
- package/ecomplus-stores/barra-doce/functions/many/package.json +3 -3
- package/ecomplus-stores/barra-doce/functions/ssr/index.js +0 -1
- package/ecomplus-stores/barra-doce/functions/ssr/package.json +8 -8
- package/ecomplus-stores/barra-doce/functions/ssr/src/components/CartItem.vue +64 -0
- package/ecomplus-stores/barra-doce/functions/ssr/src/components/CartSidebar.vue +38 -7
- package/ecomplus-stores/barra-doce/functions/ssr/src/components/Prices.vue +2 -3
- package/ecomplus-stores/barra-doce/functions/ssr/src/components/ShopHeader.vue +8 -4
- package/ecomplus-stores/barra-doce/functions/with-apps/package.json +3 -3
- package/ecomplus-stores/barra-doce/package.json +2 -2
- package/ecomplus-stores/iluminim/functions/many/package.json +3 -3
- package/ecomplus-stores/iluminim/functions/ssr/package.json +8 -8
- package/ecomplus-stores/iluminim/functions/ssr/src/components/CartItem.vue +64 -0
- package/ecomplus-stores/iluminim/functions/ssr/src/components/CartSidebar.vue +37 -6
- package/ecomplus-stores/iluminim/functions/ssr/src/components/Prices.vue +2 -3
- package/ecomplus-stores/iluminim/functions/ssr/src/components/ShopHeader.vue +6 -2
- package/ecomplus-stores/iluminim/functions/with-apps/package.json +3 -3
- package/ecomplus-stores/iluminim/package.json +2 -2
- package/package.json +3 -3
- package/packages/api/package.json +1 -1
- package/packages/apps/affilate-program/package.json +1 -1
- package/packages/apps/correios/package.json +1 -1
- package/packages/apps/custom-payment/package.json +1 -1
- package/packages/apps/custom-shipping/package.json +1 -1
- package/packages/apps/datafrete/package.json +1 -1
- package/packages/apps/discounts/package.json +1 -1
- package/packages/apps/emails/package.json +2 -2
- package/packages/apps/fb-conversions/package.json +1 -1
- package/packages/apps/flash-courier/package.json +1 -1
- package/packages/apps/frenet/package.json +1 -1
- package/packages/apps/galaxpay/package.json +1 -1
- package/packages/apps/google-analytics/package.json +1 -1
- package/packages/apps/jadlog/package.json +1 -1
- package/packages/apps/loyalty-points/package.json +1 -1
- package/packages/apps/melhor-envio/package.json +1 -1
- package/packages/apps/mercadopago/package.json +1 -1
- package/packages/apps/pagarme/package.json +1 -1
- package/packages/apps/paghiper/package.json +1 -1
- package/packages/apps/pix/package.json +1 -1
- package/packages/apps/tiny-erp/package.json +1 -1
- package/packages/apps/webhooks/package.json +1 -1
- package/packages/cli/package.json +1 -1
- package/packages/config/package.json +1 -1
- package/packages/emails/package.json +1 -1
- package/packages/eslint/package.json +3 -3
- package/packages/events/package.json +1 -1
- package/packages/feeds/package.json +1 -1
- package/packages/firebase/package.json +1 -1
- package/packages/i18n/package.json +1 -1
- package/packages/modules/lib/firebase/functions-checkout/request-to-module.js +2 -2
- package/packages/modules/lib/firebase/functions-checkout/request-to-module.js.map +1 -1
- package/packages/modules/lib/firebase/functions-checkout/utils.js +21 -9
- package/packages/modules/lib/firebase/functions-checkout/utils.js.map +1 -1
- package/packages/modules/package.json +2 -2
- package/packages/modules/schemas/@checkout.cjs +0 -1
- package/packages/modules/src/firebase/functions-checkout/request-to-module.ts +2 -2
- package/packages/modules/src/firebase/functions-checkout/utils.ts +23 -9
- package/packages/passport/package.json +1 -1
- package/packages/ssr/package.json +2 -2
- package/packages/storefront/dist/client/_astro/{Carousel.926668f2.js → Carousel.0b24e2cb.js} +1 -1
- package/packages/storefront/dist/client/_astro/CartSidebar.2731d333.js +1 -0
- package/packages/storefront/dist/client/_astro/{HeroSlider.1f0524aa.js → HeroSlider.a70b2582.js} +1 -1
- package/packages/storefront/dist/client/_astro/{PitchBar.7407eeaf.js → PitchBar.13991988.js} +1 -1
- package/packages/storefront/dist/client/_astro/{Prices.562a32ab.js → Prices.cdfa346a.js} +1 -1
- package/packages/storefront/dist/client/_astro/{ProductShelf.763cd2ca.js → ProductShelf.619c56a5.js} +1 -1
- package/packages/storefront/dist/client/_astro/SearchModal.117a477d.js +1 -0
- package/packages/storefront/dist/client/_astro/{ShopHeader.126900a6.js → ShopHeader.2c2fded7.js} +2 -2
- package/packages/storefront/dist/client/_astro/_...slug_.b693913e.css +1 -0
- package/packages/storefront/dist/client/_astro/{_plugin-vue_export-helper.ee681fa8.js → _plugin-vue_export-helper.fc5e2f5b.js} +1 -1
- package/packages/storefront/dist/client/_astro/{api.a2eda23e.js → api.39f40cd8.js} +1 -1
- package/packages/storefront/dist/client/_astro/client.a5d2898b.js +1 -0
- package/packages/storefront/dist/client/_astro/{firebase-app.93857bfb.js → firebase-app.8c541cce.js} +3 -3
- package/packages/storefront/dist/client/_astro/{format-money.923559cc.js → format-money.86f14860.js} +1 -1
- package/packages/storefront/dist/client/_astro/hoisted.d90361ee.js +1 -0
- package/packages/storefront/dist/client/_astro/{img.ec6ba316.js → img.d4891d80.js} +1 -1
- package/packages/storefront/dist/client/_astro/index.33801818.js +1 -0
- package/packages/storefront/dist/client/_astro/{modules-info.48980668.js → modules-info.ec412b24.js} +1 -1
- package/packages/storefront/dist/client/_empty-middleware.mjs +3 -0
- package/packages/storefront/dist/client/chunks/CartSidebar.0ce1e999.mjs +382 -0
- package/packages/storefront/dist/client/chunks/SearchModal.f603145b.mjs +32 -0
- package/packages/storefront/dist/client/chunks/astro.11be33ee.mjs +1424 -0
- package/packages/storefront/dist/{server/chunks/pages/_...slug_.astro.fd8a229f.mjs → client/chunks/pages/_...slug_.astro.ec6517ba.mjs} +360 -274
- package/packages/storefront/dist/{server/chunks/pages/account.astro.3b21bff8.mjs → client/chunks/pages/account.astro.3d2605e6.mjs} +2 -10
- package/packages/storefront/dist/{server/chunks/pages/index.astro.dab642f5.mjs → client/chunks/pages/index.astro.8ad03206.mjs} +167 -17
- package/packages/storefront/dist/{server/chunks/pages/~fallback.astro.7630c0d6.mjs → client/chunks/pages/~fallback.astro.d31d20b4.mjs} +8 -20
- package/packages/storefront/dist/client/chunks/sharp.3f154e38.mjs +74 -0
- package/packages/storefront/dist/client/manifest.e39eb543.mjs +79 -0
- package/packages/storefront/dist/client/pages/_---slug_.astro.mjs +23 -0
- package/packages/storefront/dist/client/pages/app/account.astro.mjs +23 -0
- package/packages/storefront/dist/client/pages/app.astro.mjs +23 -0
- package/packages/storefront/dist/client/pages/index.astro.mjs +23 -0
- package/packages/storefront/dist/client/pages/~fallback.astro.mjs +23 -0
- package/packages/storefront/dist/client/registerSW.js +1 -0
- package/packages/storefront/dist/client/renderers.mjs +369 -0
- package/packages/storefront/dist/client/sw.js +1 -1
- package/packages/storefront/dist/server/chunks/{CartSidebar.2b555408.mjs → CartSidebar.cca9fdd3.mjs} +14 -24
- package/packages/storefront/dist/server/chunks/{SearchModal.f418e188.mjs → SearchModal.a680efae.mjs} +8 -19
- package/packages/storefront/dist/server/chunks/_...f7cdc954.mjs +24 -0
- package/packages/storefront/dist/server/chunks/account@_@astro.fa8b921b.mjs +24 -0
- package/packages/storefront/dist/server/chunks/{astro.bb5b7191.mjs → astro.440a2e08.mjs} +149 -1859
- package/packages/storefront/dist/server/chunks/image-endpoint@_@js.802bf648.mjs +24 -0
- package/packages/storefront/dist/server/chunks/index@_@astro.a122f091.mjs +24 -0
- package/packages/storefront/dist/server/chunks/index@_@astro.da98dcbe.mjs +24 -0
- package/packages/storefront/dist/server/chunks/pages/_...slug_.astro.08ba5973.mjs +3930 -0
- package/packages/storefront/dist/server/chunks/pages/account.astro.f11f26f3.mjs +15 -0
- package/packages/storefront/dist/server/chunks/pages/image-endpoint.js.a9374d3e.mjs +238 -0
- package/packages/storefront/dist/server/chunks/pages/index.astro.079f316a.mjs +1650 -0
- package/packages/storefront/dist/server/chunks/pages/~fallback.astro.01594623.mjs +55 -0
- package/packages/storefront/dist/server/chunks/sharp.52841bb4.mjs +75 -0
- package/packages/storefront/dist/server/chunks/~fallback@_@astro.876a97c5.mjs +24 -0
- package/packages/storefront/dist/server/entry.mjs +1167 -2360
- package/packages/storefront/dist/server/manifest.12e7a10c.mjs +561 -0
- package/packages/storefront/dist/server/renderers.mjs +10 -21
- package/packages/storefront/package.json +6 -6
- package/packages/storefront/src/lib/layouts/BaseHead.astro +3 -2
- package/packages/test-base/package.json +1 -1
- package/packages/types/modules/@checkout:params.d.ts +1 -1
- package/packages/types/package.json +1 -1
- package/ecomplus-stores/iluminim/.ecomplus.cd.json +0 -5
- package/packages/storefront/dist/client/_astro/CartSidebar.eadba34f.js +0 -1
- package/packages/storefront/dist/client/_astro/SearchModal.cffd4c2d.js +0 -1
- package/packages/storefront/dist/client/_astro/_...slug_.36cd433d.css +0 -1
- package/packages/storefront/dist/client/_astro/client.e6d9439a.js +0 -1
- package/packages/storefront/dist/client/_astro/hoisted.572313d6.js +0 -1
- package/packages/storefront/dist/client/_astro/index.709ac149.js +0 -1
- package/packages/storefront/dist/server/chunks/_...d32bcc0c.mjs +0 -35
- package/packages/storefront/dist/server/chunks/account@_@astro.0106855f.mjs +0 -35
- package/packages/storefront/dist/server/chunks/endpoint@_@js.35807882.mjs +0 -35
- package/packages/storefront/dist/server/chunks/index@_@astro.477f5af1.mjs +0 -35
- package/packages/storefront/dist/server/chunks/index@_@astro.e5a61d6e.mjs +0 -35
- package/packages/storefront/dist/server/chunks/pages/endpoint.js.247079ba.mjs +0 -119
- package/packages/storefront/dist/server/chunks/~fallback@_@astro.65227dd7.mjs +0 -35
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { c as createAstro, b as createComponent, r as renderTemplate } from '../astro.440a2e08.mjs';
|
|
2
|
+
import 'clsx';
|
|
3
|
+
import 'html-escaper';
|
|
4
|
+
|
|
5
|
+
const $$Astro = createAstro("https://ecom2-demo.web.app");
|
|
6
|
+
const $$Account = createComponent(async ($$result, $$props, $$slots) => {
|
|
7
|
+
const Astro2 = $$result.createAstro($$Astro, $$props, $$slots);
|
|
8
|
+
Astro2.self = $$Account;
|
|
9
|
+
return renderTemplate``;
|
|
10
|
+
}, "/home/leo/code/ecomplus/cloud-commerce/packages/storefront/src/pages/app/account.astro", void 0);
|
|
11
|
+
|
|
12
|
+
const $$file = "/home/leo/code/ecomplus/cloud-commerce/packages/storefront/src/pages/app/account.astro";
|
|
13
|
+
const $$url = "/app/account";
|
|
14
|
+
|
|
15
|
+
export { $$Account as default, $$file as file, $$url as url };
|
|
@@ -0,0 +1,238 @@
|
|
|
1
|
+
import { isRemotePath } from '@astrojs/internal-helpers/path';
|
|
2
|
+
import mime from 'mime/lite.js';
|
|
3
|
+
import { i as imageConfig } from './_...slug_.astro.08ba5973.mjs';
|
|
4
|
+
import '../astro.440a2e08.mjs';
|
|
5
|
+
import 'clsx';
|
|
6
|
+
import 'html-escaper';
|
|
7
|
+
import '@cloudcommerce/api';
|
|
8
|
+
import 'node:events';
|
|
9
|
+
import 'node:fs';
|
|
10
|
+
import 'node:path';
|
|
11
|
+
import '@cloudcommerce/config';
|
|
12
|
+
import '@ecomplus/utils';
|
|
13
|
+
import 'ultrahtml';
|
|
14
|
+
/* empty css */import 'image-size';
|
|
15
|
+
import 'mime';
|
|
16
|
+
import 'vue';
|
|
17
|
+
import '@vueuse/core';
|
|
18
|
+
import 'vue/server-renderer';
|
|
19
|
+
import '@headlessui/vue';
|
|
20
|
+
|
|
21
|
+
const InvalidImageService = {
|
|
22
|
+
name: "InvalidImageService",
|
|
23
|
+
title: "Error while loading image service.",
|
|
24
|
+
message: "There was an error loading the configured image service. Please see the stack trace for more information."
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
function normalizeLF(code) {
|
|
28
|
+
return code.replace(/\r\n|\r(?!\n)|\n/g, "\n");
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
function codeFrame(src, loc) {
|
|
32
|
+
if (!loc || loc.line === void 0 || loc.column === void 0) {
|
|
33
|
+
return "";
|
|
34
|
+
}
|
|
35
|
+
const lines = normalizeLF(src).split("\n").map((ln) => ln.replace(/\t/g, " "));
|
|
36
|
+
const visibleLines = [];
|
|
37
|
+
for (let n = -2; n <= 2; n++) {
|
|
38
|
+
if (lines[loc.line + n])
|
|
39
|
+
visibleLines.push(loc.line + n);
|
|
40
|
+
}
|
|
41
|
+
let gutterWidth = 0;
|
|
42
|
+
for (const lineNo of visibleLines) {
|
|
43
|
+
let w = `> ${lineNo}`;
|
|
44
|
+
if (w.length > gutterWidth)
|
|
45
|
+
gutterWidth = w.length;
|
|
46
|
+
}
|
|
47
|
+
let output = "";
|
|
48
|
+
for (const lineNo of visibleLines) {
|
|
49
|
+
const isFocusedLine = lineNo === loc.line - 1;
|
|
50
|
+
output += isFocusedLine ? "> " : " ";
|
|
51
|
+
output += `${lineNo + 1} | ${lines[lineNo]}
|
|
52
|
+
`;
|
|
53
|
+
if (isFocusedLine)
|
|
54
|
+
output += `${Array.from({ length: gutterWidth }).join(" ")} | ${Array.from({
|
|
55
|
+
length: loc.column
|
|
56
|
+
}).join(" ")}^
|
|
57
|
+
`;
|
|
58
|
+
}
|
|
59
|
+
return output;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
class AstroError extends Error {
|
|
63
|
+
loc;
|
|
64
|
+
title;
|
|
65
|
+
hint;
|
|
66
|
+
frame;
|
|
67
|
+
type = "AstroError";
|
|
68
|
+
constructor(props, ...params) {
|
|
69
|
+
super(...params);
|
|
70
|
+
const { name, title, message, stack, location, hint, frame } = props;
|
|
71
|
+
this.title = title;
|
|
72
|
+
this.name = name;
|
|
73
|
+
if (message)
|
|
74
|
+
this.message = message;
|
|
75
|
+
this.stack = stack ? stack : this.stack;
|
|
76
|
+
this.loc = location;
|
|
77
|
+
this.hint = hint;
|
|
78
|
+
this.frame = frame;
|
|
79
|
+
}
|
|
80
|
+
setLocation(location) {
|
|
81
|
+
this.loc = location;
|
|
82
|
+
}
|
|
83
|
+
setName(name) {
|
|
84
|
+
this.name = name;
|
|
85
|
+
}
|
|
86
|
+
setMessage(message) {
|
|
87
|
+
this.message = message;
|
|
88
|
+
}
|
|
89
|
+
setHint(hint) {
|
|
90
|
+
this.hint = hint;
|
|
91
|
+
}
|
|
92
|
+
setFrame(source, location) {
|
|
93
|
+
this.frame = codeFrame(source, location);
|
|
94
|
+
}
|
|
95
|
+
static is(err) {
|
|
96
|
+
return err.type === "AstroError";
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
function matchPattern(url, remotePattern) {
|
|
101
|
+
return matchProtocol(url, remotePattern.protocol) && matchHostname(url, remotePattern.hostname, true) && matchPort(url, remotePattern.port) && matchPathname(url, remotePattern.pathname, true);
|
|
102
|
+
}
|
|
103
|
+
function matchPort(url, port) {
|
|
104
|
+
return !port || port === url.port;
|
|
105
|
+
}
|
|
106
|
+
function matchProtocol(url, protocol) {
|
|
107
|
+
return !protocol || protocol === url.protocol.slice(0, -1);
|
|
108
|
+
}
|
|
109
|
+
function matchHostname(url, hostname, allowWildcard) {
|
|
110
|
+
if (!hostname) {
|
|
111
|
+
return true;
|
|
112
|
+
} else if (!allowWildcard || !hostname.startsWith("*")) {
|
|
113
|
+
return hostname === url.hostname;
|
|
114
|
+
} else if (hostname.startsWith("**.")) {
|
|
115
|
+
const slicedHostname = hostname.slice(2);
|
|
116
|
+
return slicedHostname !== url.hostname && url.hostname.endsWith(slicedHostname);
|
|
117
|
+
} else if (hostname.startsWith("*.")) {
|
|
118
|
+
const slicedHostname = hostname.slice(1);
|
|
119
|
+
const additionalSubdomains = url.hostname.replace(slicedHostname, "").split(".").filter(Boolean);
|
|
120
|
+
return additionalSubdomains.length === 1;
|
|
121
|
+
}
|
|
122
|
+
return false;
|
|
123
|
+
}
|
|
124
|
+
function matchPathname(url, pathname, allowWildcard) {
|
|
125
|
+
if (!pathname) {
|
|
126
|
+
return true;
|
|
127
|
+
} else if (!allowWildcard || !pathname.endsWith("*")) {
|
|
128
|
+
return pathname === url.pathname;
|
|
129
|
+
} else if (pathname.endsWith("/**")) {
|
|
130
|
+
const slicedPathname = pathname.slice(0, -2);
|
|
131
|
+
return slicedPathname !== url.pathname && url.pathname.startsWith(slicedPathname);
|
|
132
|
+
} else if (pathname.endsWith("/*")) {
|
|
133
|
+
const slicedPathname = pathname.slice(0, -1);
|
|
134
|
+
const additionalPathChunks = url.pathname.replace(slicedPathname, "").split("/").filter(Boolean);
|
|
135
|
+
return additionalPathChunks.length === 1;
|
|
136
|
+
}
|
|
137
|
+
return false;
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
function isRemoteAllowed(src, {
|
|
141
|
+
domains = [],
|
|
142
|
+
remotePatterns = []
|
|
143
|
+
}) {
|
|
144
|
+
if (!isRemotePath(src))
|
|
145
|
+
return true;
|
|
146
|
+
const url = new URL(src);
|
|
147
|
+
return domains.some((domain) => matchHostname(url, domain)) || remotePatterns.some((remotePattern) => matchPattern(url, remotePattern));
|
|
148
|
+
}
|
|
149
|
+
async function getConfiguredImageService() {
|
|
150
|
+
if (!globalThis?.astroAsset?.imageService) {
|
|
151
|
+
const { default: service } = await import(
|
|
152
|
+
// @ts-expect-error
|
|
153
|
+
'../sharp.52841bb4.mjs'
|
|
154
|
+
).catch((e) => {
|
|
155
|
+
const error = new AstroError(InvalidImageService);
|
|
156
|
+
error.cause = e;
|
|
157
|
+
throw error;
|
|
158
|
+
});
|
|
159
|
+
if (!globalThis.astroAsset)
|
|
160
|
+
globalThis.astroAsset = {};
|
|
161
|
+
globalThis.astroAsset.imageService = service;
|
|
162
|
+
return service;
|
|
163
|
+
}
|
|
164
|
+
return globalThis.astroAsset.imageService;
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
const fnv1a52 = (str) => {
|
|
168
|
+
const len = str.length;
|
|
169
|
+
let i = 0, t0 = 0, v0 = 8997, t1 = 0, v1 = 33826, t2 = 0, v2 = 40164, t3 = 0, v3 = 52210;
|
|
170
|
+
while (i < len) {
|
|
171
|
+
v0 ^= str.charCodeAt(i++);
|
|
172
|
+
t0 = v0 * 435;
|
|
173
|
+
t1 = v1 * 435;
|
|
174
|
+
t2 = v2 * 435;
|
|
175
|
+
t3 = v3 * 435;
|
|
176
|
+
t2 += v0 << 8;
|
|
177
|
+
t3 += v1 << 8;
|
|
178
|
+
t1 += t0 >>> 16;
|
|
179
|
+
v0 = t0 & 65535;
|
|
180
|
+
t2 += t1 >>> 16;
|
|
181
|
+
v1 = t1 & 65535;
|
|
182
|
+
v3 = t3 + (t2 >>> 16) & 65535;
|
|
183
|
+
v2 = t2 & 65535;
|
|
184
|
+
}
|
|
185
|
+
return (v3 & 15) * 281474976710656 + v2 * 4294967296 + v1 * 65536 + (v0 ^ v3 >> 4);
|
|
186
|
+
};
|
|
187
|
+
const etag = (payload, weak = false) => {
|
|
188
|
+
const prefix = weak ? 'W/"' : '"';
|
|
189
|
+
return prefix + fnv1a52(payload).toString(36) + payload.length.toString(36) + '"';
|
|
190
|
+
};
|
|
191
|
+
|
|
192
|
+
async function loadRemoteImage(src) {
|
|
193
|
+
try {
|
|
194
|
+
const res = await fetch(src);
|
|
195
|
+
if (!res.ok) {
|
|
196
|
+
return void 0;
|
|
197
|
+
}
|
|
198
|
+
return Buffer.from(await res.arrayBuffer());
|
|
199
|
+
} catch (err) {
|
|
200
|
+
return void 0;
|
|
201
|
+
}
|
|
202
|
+
}
|
|
203
|
+
const GET = async ({ request }) => {
|
|
204
|
+
try {
|
|
205
|
+
const imageService = await getConfiguredImageService();
|
|
206
|
+
if (!("transform" in imageService)) {
|
|
207
|
+
throw new Error("Configured image service is not a local service");
|
|
208
|
+
}
|
|
209
|
+
const url = new URL(request.url);
|
|
210
|
+
const transform = await imageService.parseURL(url, imageConfig);
|
|
211
|
+
if (!transform?.src) {
|
|
212
|
+
throw new Error("Incorrect transform returned by `parseURL`");
|
|
213
|
+
}
|
|
214
|
+
let inputBuffer = void 0;
|
|
215
|
+
const sourceUrl = isRemotePath(transform.src) ? new URL(transform.src) : new URL(transform.src, url.origin);
|
|
216
|
+
if (isRemotePath(transform.src) && isRemoteAllowed(transform.src, imageConfig) === false) {
|
|
217
|
+
return new Response("Forbidden", { status: 403 });
|
|
218
|
+
}
|
|
219
|
+
inputBuffer = await loadRemoteImage(sourceUrl);
|
|
220
|
+
if (!inputBuffer) {
|
|
221
|
+
return new Response("Not Found", { status: 404 });
|
|
222
|
+
}
|
|
223
|
+
const { data, format } = await imageService.transform(inputBuffer, transform, imageConfig);
|
|
224
|
+
return new Response(data, {
|
|
225
|
+
status: 200,
|
|
226
|
+
headers: {
|
|
227
|
+
"Content-Type": mime.getType(format) ?? `image/${format}`,
|
|
228
|
+
"Cache-Control": "public, max-age=31536000",
|
|
229
|
+
ETag: etag(data.toString()),
|
|
230
|
+
Date: (/* @__PURE__ */ new Date()).toUTCString()
|
|
231
|
+
}
|
|
232
|
+
});
|
|
233
|
+
} catch (err) {
|
|
234
|
+
return new Response(`Server Error: ${err}`, { status: 500 });
|
|
235
|
+
}
|
|
236
|
+
};
|
|
237
|
+
|
|
238
|
+
export { GET };
|