@wix/astro 2.17.0 → 2.19.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/build/dependencies/astro-auth/backend-runtime/{chunk-IUZYED2S.js → chunk-4UEBUUCA.js} +8 -11
- package/build/dependencies/astro-auth/backend-runtime/chunk-USQSPPTM.js +14 -0
- package/build/dependencies/astro-auth/backend-runtime/middleware/auth.js +16 -19
- package/build/dependencies/astro-auth/backend-runtime/middleware/localization.d.ts +5 -0
- package/build/dependencies/astro-auth/backend-runtime/middleware/localization.js +219 -0
- package/build/dependencies/astro-auth/backend-runtime/runtime/backend/setupContextualClient.js +9 -1
- package/build/dependencies/astro-backend-extensions/backend-runtime/chunk-CPGTXQVH.js +75 -0
- package/build/dependencies/astro-backend-extensions/backend-runtime/routes/extensions.js +41 -0
- package/build/dependencies/astro-backend-extensions/backend-runtime/runtime/setupServicePlugin.d.ts +7 -2
- package/build/dependencies/astro-backend-extensions/backend-runtime/runtime/setupServicePlugin.js +25 -4
- package/build/dependencies/astro-backend-extensions/backend-runtime/runtime/setupWebhook.d.ts +6 -2
- package/build/dependencies/astro-backend-extensions/backend-runtime/runtime/setupWebhook.js +24 -5
- package/build/dependencies/astro-backend-extensions/backend-runtime/utils-B7jr2PES.d.ts +5 -0
- package/build/dependencies/astro-context-providers-extensions/browser-runtime/hmr.js +26 -0
- package/build/dependencies/astro-context-providers-extensions/browser-runtime/sdk.js +21 -0
- package/build/dependencies/astro-context-providers-extensions/types/index.d.ts +32 -0
- package/build/dependencies/astro-core/types/index.d.ts +4 -3
- package/build/dependencies/astro-function-libraries-extensions/browser-runtime/sdk.js +21 -0
- package/build/dependencies/astro-function-libraries-extensions/types/index.d.ts +23 -0
- package/build/dependencies/astro-html-embeds/backend-runtime/html-embeds.js +4 -2
- package/build/dependencies/astro-site-components-extensions/types/index.d.ts +5 -0
- package/build/integration/builders-experimental.d.ts +53 -0
- package/build/integration/builders-experimental.js +20 -0
- package/build/integration/builders-experimental.js.map +1 -0
- package/build/integration/builders.d.ts +8 -57
- package/build/integration/builders.js +3 -41
- package/build/integration/builders.js.map +1 -1
- package/build/integration/chunk-QHGDEGZS.js +809 -0
- package/build/integration/chunk-QHGDEGZS.js.map +1 -0
- package/build/integration/chunk-WK4OVFTZ.js +1078 -0
- package/build/integration/chunk-WK4OVFTZ.js.map +1 -0
- package/build/integration/{chunk-IOVROVEX.js → chunk-ZOHC6VQD.js} +1960 -2845
- package/build/integration/chunk-ZOHC6VQD.js.map +1 -0
- package/build/integration/index.d-DMz9m26S.d.ts +58 -0
- package/build/integration/index.d.ts +8 -0
- package/build/integration/index.js +52 -30
- package/build/integration/index.js.map +1 -1
- package/package.json +10 -6
- package/build/dependencies/astro-backend-extensions/backend-runtime/chunk-F7JXR3EK.js +0 -25
- package/build/dependencies/astro-backend-extensions/backend-runtime/routes/servicePlugins.js +0 -18
- package/build/dependencies/astro-backend-extensions/backend-runtime/routes/webhooks.d.ts +0 -5
- package/build/dependencies/astro-backend-extensions/backend-runtime/routes/webhooks.js +0 -18
- package/build/integration/chunk-IOVROVEX.js.map +0 -1
- /package/build/dependencies/astro-backend-extensions/backend-runtime/routes/{servicePlugins.d.ts → extensions.d.ts} +0 -0
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
interface BaseDevCenterComponent {
|
|
2
|
+
compId: string;
|
|
3
|
+
compName?: string;
|
|
4
|
+
compType: string;
|
|
5
|
+
compData: unknown;
|
|
6
|
+
}
|
|
7
|
+
interface DevCenterCustomElementBehaviors {
|
|
8
|
+
dashboard?: {
|
|
9
|
+
dashboardPageComponentId: string;
|
|
10
|
+
};
|
|
11
|
+
settings?: {
|
|
12
|
+
settingsUrl: string;
|
|
13
|
+
};
|
|
14
|
+
}
|
|
15
|
+
type DevCenterCustomElementPresets = Array<{
|
|
16
|
+
id: string;
|
|
17
|
+
name: string;
|
|
18
|
+
thumbnailUrl: string;
|
|
19
|
+
}>;
|
|
20
|
+
interface DevCenterCustomElementSize {
|
|
21
|
+
height: {
|
|
22
|
+
defaultHeight: number;
|
|
23
|
+
heightMode?: 'AUTO' | 'FIXED' | 'UNKNOWN';
|
|
24
|
+
};
|
|
25
|
+
width: {
|
|
26
|
+
allowStretch?: boolean;
|
|
27
|
+
defaultWidth: number;
|
|
28
|
+
stretchByDefault?: boolean;
|
|
29
|
+
};
|
|
30
|
+
}
|
|
31
|
+
interface DevCenterSitePluginMarketData {
|
|
32
|
+
name?: string;
|
|
33
|
+
description?: string;
|
|
34
|
+
logoUrl?: string;
|
|
35
|
+
}
|
|
36
|
+
interface DevCenterSitePluginPlacements {
|
|
37
|
+
appDefinitionId: string;
|
|
38
|
+
slotId: string;
|
|
39
|
+
widgetId: string;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
interface BaseExtension {
|
|
43
|
+
type: string;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
declare class App {
|
|
47
|
+
private extensions;
|
|
48
|
+
use(extension: BaseDevCenterComponent | BaseExtension): this;
|
|
49
|
+
}
|
|
50
|
+
declare function app(): App;
|
|
51
|
+
|
|
52
|
+
interface GenericExtension {
|
|
53
|
+
type: 'GenericExtension';
|
|
54
|
+
options: BaseDevCenterComponent;
|
|
55
|
+
}
|
|
56
|
+
declare function genericExtension(options: BaseDevCenterComponent): GenericExtension;
|
|
57
|
+
|
|
58
|
+
export { type BaseExtension as B, type DevCenterCustomElementBehaviors as D, type DevCenterCustomElementSize as a, type DevCenterCustomElementPresets as b, type DevCenterSitePluginMarketData as c, type DevCenterSitePluginPlacements as d, app as e, genericExtension as g };
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import { AstroIntegration } from 'astro';
|
|
2
|
+
export { extensions } from './builders.js';
|
|
3
|
+
import './index.d-DMz9m26S.js';
|
|
2
4
|
|
|
3
5
|
interface WixAstroConfig {
|
|
4
6
|
auth?: boolean | {
|
|
@@ -7,6 +9,12 @@ interface WixAstroConfig {
|
|
|
7
9
|
backendExtensions?: boolean | {
|
|
8
10
|
enable?: boolean;
|
|
9
11
|
};
|
|
12
|
+
backofficeExtensions?: boolean | {
|
|
13
|
+
enable?: boolean;
|
|
14
|
+
};
|
|
15
|
+
essentials?: boolean | {
|
|
16
|
+
enable?: boolean;
|
|
17
|
+
};
|
|
10
18
|
htmlEmbeds?: boolean | {
|
|
11
19
|
enable?: boolean;
|
|
12
20
|
};
|
|
@@ -2,16 +2,23 @@ import { createRequire as _createRequire } from 'node:module';
|
|
|
2
2
|
const require = _createRequire(import.meta.url);
|
|
3
3
|
import {
|
|
4
4
|
createIntegration,
|
|
5
|
-
createIntegration2
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
5
|
+
createIntegration2
|
|
6
|
+
} from "./chunk-QHGDEGZS.js";
|
|
7
|
+
import {
|
|
8
|
+
createIntegration as createIntegration3,
|
|
9
|
+
createIntegration2 as createIntegration4,
|
|
10
|
+
createIntegration3 as createIntegration5,
|
|
11
|
+
createIntegration4 as createIntegration6,
|
|
12
|
+
createIntegration5 as createIntegration7,
|
|
13
|
+
createIntegration6 as createIntegration8,
|
|
14
|
+
createIntegration7 as createIntegration9,
|
|
15
|
+
extensions
|
|
16
|
+
} from "./chunk-ZOHC6VQD.js";
|
|
17
|
+
import {
|
|
11
18
|
defaultOutdent,
|
|
12
19
|
init_esm_shims,
|
|
13
20
|
normalizePath
|
|
14
|
-
} from "./chunk-
|
|
21
|
+
} from "./chunk-WK4OVFTZ.js";
|
|
15
22
|
|
|
16
23
|
// src/index.ts
|
|
17
24
|
init_esm_shims();
|
|
@@ -83,8 +90,9 @@ var setupContextUrl = new URL(
|
|
|
83
90
|
"../dependencies/astro-auth/browser-runtime/setup.js",
|
|
84
91
|
import.meta.url
|
|
85
92
|
);
|
|
86
|
-
var
|
|
87
|
-
enableAuthRoutes
|
|
93
|
+
var createIntegration10 = ({
|
|
94
|
+
enableAuthRoutes,
|
|
95
|
+
enableWixEssentials
|
|
88
96
|
}) => {
|
|
89
97
|
return {
|
|
90
98
|
name: "@wix/astro/auth",
|
|
@@ -120,6 +128,15 @@ var createIntegration8 = ({
|
|
|
120
128
|
),
|
|
121
129
|
order: "pre"
|
|
122
130
|
});
|
|
131
|
+
if (enableWixEssentials) {
|
|
132
|
+
addMiddleware({
|
|
133
|
+
entrypoint: new URL(
|
|
134
|
+
"../dependencies/astro-auth/backend-runtime/middleware/localization.js",
|
|
135
|
+
import.meta.url
|
|
136
|
+
),
|
|
137
|
+
order: "pre"
|
|
138
|
+
});
|
|
139
|
+
}
|
|
123
140
|
if (enableAuthRoutes) {
|
|
124
141
|
injectRoute({
|
|
125
142
|
entrypoint: new URL(
|
|
@@ -158,11 +175,11 @@ var createIntegration8 = ({
|
|
|
158
175
|
}
|
|
159
176
|
};
|
|
160
177
|
};
|
|
161
|
-
var src_default =
|
|
178
|
+
var src_default = createIntegration10;
|
|
162
179
|
|
|
163
180
|
// ../astro-html-embeds/src/index.ts
|
|
164
181
|
init_esm_shims();
|
|
165
|
-
var
|
|
182
|
+
var createIntegration11 = () => {
|
|
166
183
|
return {
|
|
167
184
|
name: "@wix/astro/html-embeds",
|
|
168
185
|
hooks: {
|
|
@@ -178,11 +195,11 @@ var createIntegration9 = () => {
|
|
|
178
195
|
}
|
|
179
196
|
};
|
|
180
197
|
};
|
|
181
|
-
var src_default2 =
|
|
198
|
+
var src_default2 = createIntegration11;
|
|
182
199
|
|
|
183
200
|
// ../astro-payment-links/src/index.ts
|
|
184
201
|
init_esm_shims();
|
|
185
|
-
var
|
|
202
|
+
var createIntegration12 = () => {
|
|
186
203
|
return {
|
|
187
204
|
name: "@wix/astro/payment-links",
|
|
188
205
|
hooks: {
|
|
@@ -223,11 +240,11 @@ var createIntegration10 = () => {
|
|
|
223
240
|
}
|
|
224
241
|
};
|
|
225
242
|
};
|
|
226
|
-
var src_default3 =
|
|
243
|
+
var src_default3 = createIntegration12;
|
|
227
244
|
|
|
228
245
|
// ../astro-robots/src/index.ts
|
|
229
246
|
init_esm_shims();
|
|
230
|
-
var
|
|
247
|
+
var createIntegration13 = () => {
|
|
231
248
|
return {
|
|
232
249
|
name: "@wix/astro/robots",
|
|
233
250
|
hooks: {
|
|
@@ -244,14 +261,14 @@ var createIntegration11 = () => {
|
|
|
244
261
|
}
|
|
245
262
|
};
|
|
246
263
|
};
|
|
247
|
-
var src_default4 =
|
|
264
|
+
var src_default4 = createIntegration13;
|
|
248
265
|
|
|
249
266
|
// ../astro-viewer-api/src/index.ts
|
|
250
267
|
init_esm_shims();
|
|
251
268
|
|
|
252
269
|
// ../astro-viewer-api/src/integration.ts
|
|
253
270
|
init_esm_shims();
|
|
254
|
-
var
|
|
271
|
+
var createIntegration14 = () => {
|
|
255
272
|
return {
|
|
256
273
|
name: "@wix/astro/viewer-api",
|
|
257
274
|
hooks: {
|
|
@@ -270,34 +287,39 @@ var createIntegration12 = () => {
|
|
|
270
287
|
};
|
|
271
288
|
|
|
272
289
|
// src/index.ts
|
|
273
|
-
function isEnabled(value) {
|
|
290
|
+
function isEnabled(value, defaultValue = true) {
|
|
274
291
|
if (typeof value === "boolean") {
|
|
275
292
|
return value;
|
|
276
293
|
}
|
|
277
|
-
return value?.enable ??
|
|
294
|
+
return value?.enable ?? defaultValue;
|
|
278
295
|
}
|
|
279
|
-
var
|
|
296
|
+
var createIntegration15 = (config) => {
|
|
280
297
|
const enableAuthRoutes = isEnabled(config?.auth);
|
|
281
298
|
const enableHtmlEmbeds = isEnabled(config?.htmlEmbeds);
|
|
282
299
|
const enableRobots = isEnabled(config?.robots);
|
|
283
300
|
const enableBackendExtensions = isEnabled(config?.backendExtensions);
|
|
301
|
+
const enableBackofficeExtensions = isEnabled(config?.backofficeExtensions);
|
|
284
302
|
const enableWixSitePages = isEnabled(config?.wixSitePages);
|
|
303
|
+
const enableWixEssentials = isEnabled(config?.essentials, false);
|
|
285
304
|
const integrations = [
|
|
286
|
-
src_default({ enableAuthRoutes }),
|
|
287
|
-
...enableBackendExtensions ? [
|
|
288
|
-
|
|
289
|
-
|
|
305
|
+
src_default({ enableAuthRoutes, enableWixEssentials }),
|
|
306
|
+
...enableBackendExtensions ? [createIntegration3()] : [],
|
|
307
|
+
...enableBackofficeExtensions ? [createIntegration4()] : [],
|
|
308
|
+
createIntegration6(),
|
|
290
309
|
...enableHtmlEmbeds ? [src_default2()] : [],
|
|
291
|
-
...enableWixSitePages ? [src_default3(),
|
|
292
|
-
createIntegration5(),
|
|
310
|
+
...enableWixSitePages ? [src_default3(), createIntegration14()] : [],
|
|
293
311
|
createIntegration7(),
|
|
294
|
-
|
|
312
|
+
createIntegration9(),
|
|
313
|
+
createIntegration8(),
|
|
314
|
+
createIntegration2(),
|
|
315
|
+
createIntegration(),
|
|
295
316
|
...enableRobots ? [src_default4()] : []
|
|
296
317
|
];
|
|
297
|
-
return [
|
|
318
|
+
return [createIntegration5({ integrations }), ...integrations];
|
|
298
319
|
};
|
|
299
|
-
var index_default =
|
|
320
|
+
var index_default = createIntegration15;
|
|
300
321
|
export {
|
|
301
|
-
index_default as default
|
|
322
|
+
index_default as default,
|
|
323
|
+
extensions
|
|
302
324
|
};
|
|
303
325
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/index.ts","../../../astro-auth/src/index.ts","../../../astro-auth/src/plugins/patchAstroInlineScripts.ts","../../../astro-auth/src/plugins/setupContentCollectionContext.ts","../../../astro-html-embeds/src/index.ts","../../../astro-payment-links/src/index.ts","../../../astro-robots/src/index.ts","../../../astro-viewer-api/src/index.ts","../../../astro-viewer-api/src/integration.ts"],"sourcesContent":["import type { AstroIntegration } from 'astro';\nimport auth from '@wix/astro-auth';\nimport backend from '@wix/astro-backend-extensions';\nimport backoffice from '@wix/astro-backoffice-extensions';\nimport core from '@wix/astro-core';\nimport customElements from '@wix/astro-custom-elements-extensions';\nimport embeddedScripts from '@wix/astro-embedded-scripts-extensions';\nimport htmlEmbeds from '@wix/astro-html-embeds';\nimport paymentLinks from '@wix/astro-payment-links';\nimport robots from '@wix/astro-robots';\nimport siteComponentPanels from '@wix/astro-site-component-panels-extensions';\nimport siteComponents from '@wix/astro-site-components-extensions';\nimport viewerApi from '@wix/astro-viewer-api';\n\ninterface WixAstroConfig {\n auth?: boolean | { enable?: boolean };\n backendExtensions?: boolean | { enable?: boolean };\n htmlEmbeds?: boolean | { enable?: boolean };\n robots?: boolean | { enable?: boolean };\n wixSitePages?: boolean | { enable?: boolean };\n}\n\nfunction isEnabled(value?: boolean | { enable?: boolean }): boolean {\n if (typeof value === 'boolean') {\n return value;\n }\n return value?.enable ?? true;\n}\n\nconst createIntegration = (config?: WixAstroConfig): AstroIntegration[] => {\n const enableAuthRoutes = isEnabled(config?.auth);\n const enableHtmlEmbeds = isEnabled(config?.htmlEmbeds);\n const enableRobots = isEnabled(config?.robots);\n const enableBackendExtensions = isEnabled(config?.backendExtensions);\n const enableWixSitePages = isEnabled(config?.wixSitePages);\n\n const integrations = [\n auth({ enableAuthRoutes }),\n ...(enableBackendExtensions ? [backend()] : []),\n backoffice(),\n customElements(),\n ...(enableHtmlEmbeds ? [htmlEmbeds()] : []),\n ...(enableWixSitePages ? [paymentLinks(), viewerApi()] : []),\n embeddedScripts(),\n siteComponents(),\n siteComponentPanels(),\n ...(enableRobots ? [robots()] : []),\n ];\n\n return [core({ integrations }), ...integrations];\n};\n\nexport default createIntegration;\n","import { fileURLToPath } from 'node:url';\nimport type { WixIntegration } from '@wix/astro-core';\nimport { normalizePath } from '@wix/vite-utils';\nimport { outdent } from 'outdent';\nimport { patchAstroInlineScripts } from './plugins/patchAstroInlineScripts.js';\nimport { setupContentCollectionContext } from './plugins/setupContentCollectionContext.js';\n\nconst setupContextUrl = new URL(\n '../dependencies/astro-auth/browser-runtime/setup.js',\n import.meta.url\n);\n\nconst createIntegration = ({\n enableAuthRoutes,\n}: {\n enableAuthRoutes: boolean;\n}): WixIntegration => {\n return {\n name: '@wix/astro/auth',\n hooks: {\n 'astro:config:setup'({\n addMiddleware,\n config,\n injectRoute,\n injectScript,\n updateConfig,\n }) {\n const srcDir = fileURLToPath(config.srcDir);\n\n updateConfig({\n vite: {\n plugins: [\n setupContentCollectionContext(srcDir),\n patchAstroInlineScripts(),\n ],\n },\n });\n\n const setupContextCode = outdent`\n import { WIX_CLIENT_ID } from 'astro:env/client';\n import { setup } from '${normalizePath(setupContextUrl)}';\n\n setup({ clientId: WIX_CLIENT_ID });\n `;\n\n // support client-side context calls\n injectScript('before-hydration', setupContextCode);\n injectScript('page', setupContextCode);\n\n // support server side context calls\n addMiddleware({\n entrypoint: new URL(\n '../dependencies/astro-auth/backend-runtime/middleware/auth.js',\n import.meta.url\n ),\n order: 'pre',\n });\n\n // support built-in auth routes\n if (enableAuthRoutes) {\n injectRoute({\n entrypoint: new URL(\n '../dependencies/astro-auth/backend-runtime/routes/login.js',\n import.meta.url\n ),\n pattern: '/api/auth/login',\n prerender: false,\n });\n\n injectRoute({\n entrypoint: new URL(\n '../dependencies/astro-auth/backend-runtime/routes/logout.js',\n import.meta.url\n ),\n pattern: '/api/auth/logout',\n prerender: false,\n });\n\n injectRoute({\n entrypoint: new URL(\n '../dependencies/astro-auth/backend-runtime/routes/callback.js',\n import.meta.url\n ),\n pattern: '/api/auth/callback',\n prerender: false,\n });\n\n injectRoute({\n entrypoint: new URL(\n '../dependencies/astro-auth/backend-runtime/routes/logout-callback.js',\n import.meta.url\n ),\n pattern: '/api/auth/logout-callback',\n prerender: false,\n });\n }\n },\n },\n };\n};\n\nexport default createIntegration;\n","import type { PluginOption } from 'vite';\nimport { outdent } from 'outdent';\n\nexport function patchAstroInlineScripts(): PluginOption {\n return {\n name: 'patch-astro-inline-scripts',\n transform(code, id) {\n const [_filename, rawQuery] = id.split(`?`, 2);\n const query = Object.fromEntries(new URLSearchParams(rawQuery).entries());\n\n if (\n query.astro == null ||\n query.type !== 'script' ||\n query['lang.ts'] == null ||\n code === ''\n ) {\n return null;\n }\n\n return outdent`\n import 'astro:scripts/page.js';\n\n ${code}\n `;\n },\n };\n}\n","import { relative } from 'node:path';\nimport type { PluginOption } from 'vite';\nimport { normalizePath } from '@wix/vite-utils';\nimport { outdent } from 'outdent';\n\n// https://github.com/withastro/astro/blob/e0c4460c5b6cc0c19b705d81820809aef0544100/packages/astro/src/content/utils.ts#L748-L763\nconst contentCollectionFilePaths = [\n 'content.config.mjs',\n 'content.config.js',\n 'content.config.mts',\n 'content.config.ts',\n 'content/config.mjs',\n 'content/config.js',\n 'content/config.mts',\n 'content/config.ts',\n];\n\nconst setupContextualClientUrl = new URL(\n '../dependencies/astro-auth/backend-runtime/runtime/backend/setupContextualClient.js',\n import.meta.url\n);\n\nexport function setupContentCollectionContext(srcDir: string): PluginOption {\n return {\n name: 'setup-content-collection-context',\n applyToEnvironment(environment) {\n return environment.name === 'ssr';\n },\n transform(code, id) {\n const relativeId = relative(srcDir, id);\n\n const isContentCollectionFile =\n contentCollectionFilePaths.includes(relativeId);\n\n if (isContentCollectionFile) {\n return outdent`\n import '${normalizePath(setupContextualClientUrl)}';\n\n ${code}\n `;\n }\n\n return null;\n },\n };\n}\n","import type { WixIntegration } from '@wix/astro-core';\n\nconst createIntegration = (): WixIntegration => {\n return {\n name: '@wix/astro/html-embeds',\n hooks: {\n 'astro:config:setup'({ addMiddleware }) {\n addMiddleware({\n entrypoint: new URL(\n '../dependencies/astro-html-embeds/backend-runtime/html-embeds.js',\n import.meta.url\n ),\n order: 'post',\n });\n },\n },\n };\n};\n\nexport default createIntegration;\n","import type { WixIntegration } from '@wix/astro-core';\n\nconst createIntegration = (): WixIntegration => {\n return {\n name: '@wix/astro/payment-links',\n hooks: {\n 'astro:config:setup'({ injectRoute }) {\n /*\n 1. A user generates a paylink -> https://mysite.com/_paylink/[id]\n 2. When accessing the paylink, our route redirects them to the Wix Payments link\n 3. Wix Payments then redirects the user to Wix Checkout,\n which may resolve to either https://mysite.com/checkout/... or https://mysite.com/__ecom/checkout/...,\n depending on the flow within Wix.\n */\n\n injectRoute({\n entrypoint: new URL(\n '../dependencies/astro-payment-links/backend-runtime/payment-link.js',\n import.meta.url\n ),\n pattern: '/_paylink/[id]',\n prerender: false,\n });\n\n injectRoute({\n entrypoint: new URL(\n '../dependencies/astro-payment-links/backend-runtime/payment-checkout.js',\n import.meta.url\n ),\n pattern: '/checkout',\n prerender: false,\n });\n\n injectRoute({\n entrypoint: new URL(\n '../dependencies/astro-payment-links/backend-runtime/payment-checkout.js',\n import.meta.url\n ),\n pattern: '/__ecom/checkout',\n prerender: false,\n });\n\n injectRoute({\n entrypoint: new URL(\n '../dependencies/astro-payment-links/backend-runtime/proposal.js',\n import.meta.url\n ),\n pattern: '/_proposal',\n prerender: false,\n });\n },\n },\n };\n};\n\nexport default createIntegration;\n","import type { WixIntegration } from '@wix/astro-core';\n\nconst createIntegration = (): WixIntegration => {\n return {\n name: '@wix/astro/robots',\n hooks: {\n 'astro:config:setup'({ injectRoute }) {\n injectRoute({\n entrypoint: new URL(\n '../dependencies/astro-robots/backend-runtime/robots.js',\n import.meta.url\n ),\n pattern: '/robots.txt',\n prerender: false,\n });\n },\n },\n };\n};\n\nexport default createIntegration;\n","export { createIntegration as default } from './integration.js';\n","import type { WixIntegration } from '@wix/astro-core';\n\nexport const createIntegration = (): WixIntegration => {\n return {\n name: '@wix/astro/viewer-api',\n hooks: {\n 'astro:config:setup'({ injectRoute }) {\n injectRoute({\n entrypoint: new URL(\n '../dependencies/astro-viewer-api/backend-runtime/api.js',\n import.meta.url\n ),\n pattern: '/_api/[...path]',\n prerender: false,\n });\n },\n },\n };\n};\n"],"mappings":";;;;;;;;;;;;;;;;AAAA;;;ACAA;AAAA,SAAS,qBAAqB;;;ACA9B;AAGO,SAAS,0BAAwC;AACtD,SAAO;AAAA,IACL,MAAM;AAAA,IACN,UAAU,MAAM,IAAI;AAClB,YAAM,CAAC,WAAW,QAAQ,IAAI,GAAG,MAAM,KAAK,CAAC;AAC7C,YAAM,QAAQ,OAAO,YAAY,IAAI,gBAAgB,QAAQ,EAAE,QAA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;AAEA,IAAMC,sBAAoB,CAAC,WAAgD;AACzE,QAAM,mBAAmB,UAAU,QAAQ,IAAI;AAC/C,QAAM,mBAAmB,UAAU,QAAQ,UAAU;AACrD,QAAM,eAAe,UAAU,QAAQ,MAAM;AAC7C,QAAM,0BAA0B,UAAU,QAAQ,iBAAiB;AACnE,QAAM,qBAAqB,UAAU,QAAQ,YAAY;AAEzD,QAAM,eAAe;AAAA,IACnB,YAAK,EAAE,iBAAiB,CAAC;AAAA,IACzB,GAAI,0BAA0B,CAAC,kBAAQ,CAAC,IAAI,CAAC;AAAA,IAC7CA,mBAAW;AAAA,IACXA,mBAAe;AAAA,IACf,GAAI,mBAAmB,CAACC,aAAW,CAAC,IAAI,CAAC;AAAA,IACzC,GAAI,qBAAqB,CAACA,aAAa,GAAGD,oBAAU,CAAC,IAAI,CAAC;AAAA,IAC1DA,mBAAgB;AAAA,IAChBA,mBAAe;AAAA,IACfA,mBAAoB;AAAA,IACpB,GAAI,eAAe,CAACC,aAAO,CAAC,IAAI,CAAC;AAAA,EACnC;AAEA,SAAO,CAACD,mBAAK,EAAE,aAAa,CAAC,GAAG,GAAG,YAAY;AACjD;AAEA,IAAO,gBAAQA;","names":["createIntegration","createIntegration","src_default","createIntegration","src_default","createIntegration","src_default","createIntegration","createIntegration","src_default"]}
|
|
1
|
+
{"version":3,"sources":["../../src/index.ts","../../../astro-auth/src/index.ts","../../../astro-auth/src/plugins/patchAstroInlineScripts.ts","../../../astro-auth/src/plugins/setupContentCollectionContext.ts","../../../astro-html-embeds/src/index.ts","../../../astro-payment-links/src/index.ts","../../../astro-robots/src/index.ts","../../../astro-viewer-api/src/index.ts","../../../astro-viewer-api/src/integration.ts"],"sourcesContent":["import type { AstroIntegration } from 'astro';\nimport auth from '@wix/astro-auth';\nimport backend from '@wix/astro-backend-extensions';\nimport backoffice from '@wix/astro-backoffice-extensions';\nimport contextProviders from '@wix/astro-context-providers-extensions';\nimport core from '@wix/astro-core';\nimport customElements from '@wix/astro-custom-elements-extensions';\nimport embeddedScripts from '@wix/astro-embedded-scripts-extensions';\nimport functionLibraries from '@wix/astro-function-libraries-extensions';\nimport htmlEmbeds from '@wix/astro-html-embeds';\nimport paymentLinks from '@wix/astro-payment-links';\nimport robots from '@wix/astro-robots';\nimport siteComponentPanels from '@wix/astro-site-component-panels-extensions';\nimport siteComponents from '@wix/astro-site-components-extensions';\nimport viewerApi from '@wix/astro-viewer-api';\n\nexport { extensions } from './builders.js';\n\ninterface WixAstroConfig {\n auth?: boolean | { enable?: boolean };\n backendExtensions?: boolean | { enable?: boolean };\n backofficeExtensions?: boolean | { enable?: boolean };\n essentials?: boolean | { enable?: boolean };\n htmlEmbeds?: boolean | { enable?: boolean };\n robots?: boolean | { enable?: boolean };\n wixSitePages?: boolean | { enable?: boolean };\n}\n\nfunction isEnabled(\n value?: boolean | { enable?: boolean },\n defaultValue = true\n): boolean {\n if (typeof value === 'boolean') {\n return value;\n }\n return value?.enable ?? defaultValue;\n}\n\nconst createIntegration = (config?: WixAstroConfig): AstroIntegration[] => {\n const enableAuthRoutes = isEnabled(config?.auth);\n const enableHtmlEmbeds = isEnabled(config?.htmlEmbeds);\n const enableRobots = isEnabled(config?.robots);\n const enableBackendExtensions = isEnabled(config?.backendExtensions);\n const enableBackofficeExtensions = isEnabled(config?.backofficeExtensions);\n const enableWixSitePages = isEnabled(config?.wixSitePages);\n const enableWixEssentials = isEnabled(config?.essentials, false);\n\n const integrations = [\n auth({ enableAuthRoutes, enableWixEssentials }),\n ...(enableBackendExtensions ? [backend()] : []),\n ...(enableBackofficeExtensions ? [backoffice()] : []),\n customElements(),\n ...(enableHtmlEmbeds ? [htmlEmbeds()] : []),\n ...(enableWixSitePages ? [paymentLinks(), viewerApi()] : []),\n embeddedScripts(),\n siteComponents(),\n siteComponentPanels(),\n functionLibraries(),\n contextProviders(),\n ...(enableRobots ? [robots()] : []),\n ];\n\n return [core({ integrations }), ...integrations];\n};\n\nexport default createIntegration;\n","import { fileURLToPath } from 'node:url';\nimport type { WixIntegration } from '@wix/astro-core';\nimport { normalizePath } from '@wix/vite-utils';\nimport { outdent } from 'outdent';\nimport { patchAstroInlineScripts } from './plugins/patchAstroInlineScripts.js';\nimport { setupContentCollectionContext } from './plugins/setupContentCollectionContext.js';\n\nconst setupContextUrl = new URL(\n '../dependencies/astro-auth/browser-runtime/setup.js',\n import.meta.url\n);\n\nconst createIntegration = ({\n enableAuthRoutes,\n enableWixEssentials,\n}: {\n enableAuthRoutes: boolean;\n enableWixEssentials: boolean;\n}): WixIntegration => {\n return {\n name: '@wix/astro/auth',\n hooks: {\n 'astro:config:setup'({\n addMiddleware,\n config,\n injectRoute,\n injectScript,\n updateConfig,\n }) {\n const srcDir = fileURLToPath(config.srcDir);\n\n updateConfig({\n vite: {\n plugins: [\n setupContentCollectionContext(srcDir),\n patchAstroInlineScripts(),\n ],\n },\n });\n\n const setupContextCode = outdent`\n import { WIX_CLIENT_ID } from 'astro:env/client';\n import { setup } from '${normalizePath(setupContextUrl)}';\n\n setup({ clientId: WIX_CLIENT_ID });\n `;\n\n // support client-side context calls\n injectScript('before-hydration', setupContextCode);\n injectScript('page', setupContextCode);\n\n // support server side context calls\n addMiddleware({\n entrypoint: new URL(\n '../dependencies/astro-auth/backend-runtime/middleware/auth.js',\n import.meta.url\n ),\n order: 'pre',\n });\n\n // support localization\n if (enableWixEssentials) {\n addMiddleware({\n entrypoint: new URL(\n '../dependencies/astro-auth/backend-runtime/middleware/localization.js',\n import.meta.url\n ),\n order: 'pre',\n });\n }\n\n // support built-in auth routes\n if (enableAuthRoutes) {\n injectRoute({\n entrypoint: new URL(\n '../dependencies/astro-auth/backend-runtime/routes/login.js',\n import.meta.url\n ),\n pattern: '/api/auth/login',\n prerender: false,\n });\n\n injectRoute({\n entrypoint: new URL(\n '../dependencies/astro-auth/backend-runtime/routes/logout.js',\n import.meta.url\n ),\n pattern: '/api/auth/logout',\n prerender: false,\n });\n\n injectRoute({\n entrypoint: new URL(\n '../dependencies/astro-auth/backend-runtime/routes/callback.js',\n import.meta.url\n ),\n pattern: '/api/auth/callback',\n prerender: false,\n });\n\n injectRoute({\n entrypoint: new URL(\n '../dependencies/astro-auth/backend-runtime/routes/logout-callback.js',\n import.meta.url\n ),\n pattern: '/api/auth/logout-callback',\n prerender: false,\n });\n }\n },\n },\n };\n};\n\nexport default createIntegration;\n","import type { PluginOption } from 'vite';\nimport { outdent } from 'outdent';\n\nexport function patchAstroInlineScripts(): PluginOption {\n return {\n name: 'patch-astro-inline-scripts',\n transform(code, id) {\n const [_filename, rawQuery] = id.split(`?`, 2);\n const query = Object.fromEntries(new URLSearchParams(rawQuery).entries());\n\n if (\n query.astro == null ||\n query.type !== 'script' ||\n query['lang.ts'] == null ||\n code === ''\n ) {\n return null;\n }\n\n return outdent`\n import 'astro:scripts/page.js';\n\n ${code}\n `;\n },\n };\n}\n","import { relative } from 'node:path';\nimport type { PluginOption } from 'vite';\nimport { normalizePath } from '@wix/vite-utils';\nimport { outdent } from 'outdent';\n\n// https://github.com/withastro/astro/blob/e0c4460c5b6cc0c19b705d81820809aef0544100/packages/astro/src/content/utils.ts#L748-L763\nconst contentCollectionFilePaths = [\n 'content.config.mjs',\n 'content.config.js',\n 'content.config.mts',\n 'content.config.ts',\n 'content/config.mjs',\n 'content/config.js',\n 'content/config.mts',\n 'content/config.ts',\n];\n\nconst setupContextualClientUrl = new URL(\n '../dependencies/astro-auth/backend-runtime/runtime/backend/setupContextualClient.js',\n import.meta.url\n);\n\nexport function setupContentCollectionContext(srcDir: string): PluginOption {\n return {\n name: 'setup-content-collection-context',\n applyToEnvironment(environment) {\n return environment.name === 'ssr';\n },\n transform(code, id) {\n const relativeId = relative(srcDir, id);\n\n const isContentCollectionFile =\n contentCollectionFilePaths.includes(relativeId);\n\n if (isContentCollectionFile) {\n return outdent`\n import '${normalizePath(setupContextualClientUrl)}';\n\n ${code}\n `;\n }\n\n return null;\n },\n };\n}\n","import type { WixIntegration } from '@wix/astro-core';\n\nconst createIntegration = (): WixIntegration => {\n return {\n name: '@wix/astro/html-embeds',\n hooks: {\n 'astro:config:setup'({ addMiddleware }) {\n addMiddleware({\n entrypoint: new URL(\n '../dependencies/astro-html-embeds/backend-runtime/html-embeds.js',\n import.meta.url\n ),\n order: 'post',\n });\n },\n },\n };\n};\n\nexport default createIntegration;\n","import type { WixIntegration } from '@wix/astro-core';\n\nconst createIntegration = (): WixIntegration => {\n return {\n name: '@wix/astro/payment-links',\n hooks: {\n 'astro:config:setup'({ injectRoute }) {\n /*\n 1. A user generates a paylink -> https://mysite.com/_paylink/[id]\n 2. When accessing the paylink, our route redirects them to the Wix Payments link\n 3. Wix Payments then redirects the user to Wix Checkout,\n which may resolve to either https://mysite.com/checkout/... or https://mysite.com/__ecom/checkout/...,\n depending on the flow within Wix.\n */\n\n injectRoute({\n entrypoint: new URL(\n '../dependencies/astro-payment-links/backend-runtime/payment-link.js',\n import.meta.url\n ),\n pattern: '/_paylink/[id]',\n prerender: false,\n });\n\n injectRoute({\n entrypoint: new URL(\n '../dependencies/astro-payment-links/backend-runtime/payment-checkout.js',\n import.meta.url\n ),\n pattern: '/checkout',\n prerender: false,\n });\n\n injectRoute({\n entrypoint: new URL(\n '../dependencies/astro-payment-links/backend-runtime/payment-checkout.js',\n import.meta.url\n ),\n pattern: '/__ecom/checkout',\n prerender: false,\n });\n\n injectRoute({\n entrypoint: new URL(\n '../dependencies/astro-payment-links/backend-runtime/proposal.js',\n import.meta.url\n ),\n pattern: '/_proposal',\n prerender: false,\n });\n },\n },\n };\n};\n\nexport default createIntegration;\n","import type { WixIntegration } from '@wix/astro-core';\n\nconst createIntegration = (): WixIntegration => {\n return {\n name: '@wix/astro/robots',\n hooks: {\n 'astro:config:setup'({ injectRoute }) {\n injectRoute({\n entrypoint: new URL(\n '../dependencies/astro-robots/backend-runtime/robots.js',\n import.meta.url\n ),\n pattern: '/robots.txt',\n prerender: false,\n });\n },\n },\n };\n};\n\nexport default createIntegration;\n","export { createIntegration as default } from './integration.js';\n","import type { WixIntegration } from '@wix/astro-core';\n\nexport const createIntegration = (): WixIntegration => {\n return {\n name: '@wix/astro/viewer-api',\n hooks: {\n 'astro:config:setup'({ injectRoute }) {\n injectRoute({\n entrypoint: new URL(\n '../dependencies/astro-viewer-api/backend-runtime/api.js',\n import.meta.url\n ),\n pattern: '/_api/[...path]',\n prerender: false,\n });\n },\n },\n };\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAAA;;;ACAA;AAAA,SAAS,qBAAqB;;;ACA9B;AAGO,SAAS,0BAAwC;AACtD,SAAO;AAAA,IACL,MAAM;AAAA,IACN,UAAU,MAAM,IAAI;AAClB,YAAM,CAAC,WAAW,QAAQ,IAAI,GAAG,MAAM,KAAK,CAAC;AAC7C,YAAM,QAAQ,OAAO,YAAY,IAAI,gBAAgB,QAAQ,EAAE,QAAQ,CAAC;AAExE,UACE,MAAM,SAAS,QACf,MAAM,SAAS,YACf,MAAM,SAAS,KAAK,QACpB,SAAS,IACT;AACA,eAAO;AAAA,MACT;AAEA,aAAO;AAAA;AAAA;AAAA,UAGH,IAAI;AAAA;AAAA,IAEV;AAAA,EACF;AACF;;;AC1BA;AAAA,SAAS,gBAAgB;AAMzB,IAAM,6BAA6B;AAAA,EACjC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF;AAEA,IAAM,2BAA2B,IAAI;AAAA,EACnC;AAAA,EACA,YAAY;AACd;AAEO,SAAS,8BAA8B,QAA8B;AAC1E,SAAO;AAAA,IACL,MAAM;AAAA,IACN,mBAAmB,aAAa;AAC9B,aAAO,YAAY,SAAS;AAAA,IAC9B;AAAA,IACA,UAAU,MAAM,IAAI;AAClB,YAAM,aAAa,SAAS,QAAQ,EAAE;AAEtC,YAAM,0BACJ,2BAA2B,SAAS,UAAU;AAEhD,UAAI,yBAAyB;AAC3B,eAAO;AAAA,oBACK,cAAc,wBAAwB,CAAC;AAAA;AAAA,YAE/C,IAAI;A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CAACC,aAAW,CAAC,IAAI,CAAC;AAAA,IACzC,GAAI,qBAAqB,CAACA,aAAa,GAAGD,oBAAU,CAAC,IAAI,CAAC;AAAA,IAC1DA,mBAAgB;AAAA,IAChBA,mBAAe;AAAA,IACfA,mBAAoB;AAAA,IACpBA,mBAAkB;AAAA,IAClB,kBAAiB;AAAA,IACjB,GAAI,eAAe,CAACC,aAAO,CAAC,IAAI,CAAC;AAAA,EACnC;AAEA,SAAO,CAACD,mBAAK,EAAE,aAAa,CAAC,GAAG,GAAG,YAAY;AACjD;AAEA,IAAO,gBAAQA;","names":["createIntegration","createIntegration","src_default","createIntegration","src_default","createIntegration","src_default","createIntegration","createIntegration","src_default"]}
|
package/package.json
CHANGED
|
@@ -1,14 +1,15 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wix/astro",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.19.0",
|
|
4
4
|
"dependencies": {
|
|
5
5
|
"@wix/auth-management": "^1.0.71",
|
|
6
6
|
"@wix/dashboard": "^1.3.40",
|
|
7
7
|
"@wix/editor": "^1.403.0",
|
|
8
|
-
"@wix/headless-
|
|
9
|
-
"@wix/headless-
|
|
10
|
-
"@wix/headless-site
|
|
11
|
-
"@wix/
|
|
8
|
+
"@wix/headless-localization-utils": "^1.0.10",
|
|
9
|
+
"@wix/headless-node": "^1.27.0",
|
|
10
|
+
"@wix/headless-site": "^1.27.0",
|
|
11
|
+
"@wix/headless-site-assets": "^1.0.9",
|
|
12
|
+
"@wix/sdk": "^1.17.9",
|
|
12
13
|
"@wix/sdk-runtime": "^1.0.0",
|
|
13
14
|
"@wix/sdk-types": "^1.13.41",
|
|
14
15
|
"@wix/site": "^1.22.0"
|
|
@@ -17,9 +18,11 @@
|
|
|
17
18
|
"@wix/astro-auth": "0.0.0",
|
|
18
19
|
"@wix/astro-backend-extensions": "0.0.0",
|
|
19
20
|
"@wix/astro-backoffice-extensions": "0.0.0",
|
|
21
|
+
"@wix/astro-context-providers-extensions": "0.0.0",
|
|
20
22
|
"@wix/astro-core": "0.0.0",
|
|
21
23
|
"@wix/astro-custom-elements-extensions": "0.0.0",
|
|
22
24
|
"@wix/astro-embedded-scripts-extensions": "0.0.0",
|
|
25
|
+
"@wix/astro-function-libraries-extensions": "0.0.0",
|
|
23
26
|
"@wix/astro-html-embeds": "0.0.0",
|
|
24
27
|
"@wix/astro-payment-links": "0.0.0",
|
|
25
28
|
"@wix/astro-robots": "0.0.0",
|
|
@@ -34,6 +37,7 @@
|
|
|
34
37
|
"exports": {
|
|
35
38
|
".": "./build/integration/index.js",
|
|
36
39
|
"./builders": "./build/integration/builders.js",
|
|
40
|
+
"./builders/experimental": "./build/integration/builders-experimental.js",
|
|
37
41
|
"./package.json": "./package.json"
|
|
38
42
|
},
|
|
39
43
|
"files": [
|
|
@@ -66,5 +70,5 @@
|
|
|
66
70
|
]
|
|
67
71
|
}
|
|
68
72
|
},
|
|
69
|
-
"falconPackageHash": "
|
|
73
|
+
"falconPackageHash": "28e6cdf87f94976a562abe9b434c81167ed02d6269d11c6062a5c753"
|
|
70
74
|
}
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
// src/runtime/utils.ts
|
|
2
|
-
import { AppStrategy, createClient } from "@wix/sdk";
|
|
3
|
-
import { wixContext } from "@wix/sdk-context";
|
|
4
|
-
import { WIX_CLIENT_ID } from "astro:env/client";
|
|
5
|
-
import { WIX_CLIENT_PUBLIC_KEY, WIX_CLIENT_SECRET } from "astro:env/server";
|
|
6
|
-
async function setupClient(fn) {
|
|
7
|
-
const client = createClient({
|
|
8
|
-
auth: AppStrategy({
|
|
9
|
-
appId: WIX_CLIENT_ID,
|
|
10
|
-
appSecret: WIX_CLIENT_SECRET,
|
|
11
|
-
publicKey: WIX_CLIENT_PUBLIC_KEY
|
|
12
|
-
})
|
|
13
|
-
});
|
|
14
|
-
const olderClient = wixContext.client;
|
|
15
|
-
client.enableContext("module");
|
|
16
|
-
await fn();
|
|
17
|
-
if (olderClient) {
|
|
18
|
-
olderClient.enableContext("module");
|
|
19
|
-
}
|
|
20
|
-
return client;
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
export {
|
|
24
|
-
setupClient
|
|
25
|
-
};
|
package/build/dependencies/astro-backend-extensions/backend-runtime/routes/servicePlugins.js
DELETED
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
// src/routes/servicePlugins.ts
|
|
2
|
-
var ALL = async (context) => {
|
|
3
|
-
const extensions = import.meta.glob(
|
|
4
|
-
`/.astro/integrations/_wix_astro_backend-extensions/service-plugins/*/entry.ts`
|
|
5
|
-
);
|
|
6
|
-
if (context.params.compId == null) {
|
|
7
|
-
return new Response(null, { status: 404 });
|
|
8
|
-
}
|
|
9
|
-
const load = extensions[`.astro/integrations/_wix_astro_backend-extensions/service-plugins/${context.params.compId}/entry.ts`];
|
|
10
|
-
if (load == null) {
|
|
11
|
-
return new Response(null, { status: 404 });
|
|
12
|
-
}
|
|
13
|
-
const { default: run } = await load();
|
|
14
|
-
return run(context);
|
|
15
|
-
};
|
|
16
|
-
export {
|
|
17
|
-
ALL
|
|
18
|
-
};
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
// src/routes/webhooks.ts
|
|
2
|
-
var ALL = async (context) => {
|
|
3
|
-
const extensions = import.meta.glob(
|
|
4
|
-
`/.astro/integrations/_wix_astro_backend-extensions/webhooks/*/entry.ts`
|
|
5
|
-
);
|
|
6
|
-
if (context.params.compId == null) {
|
|
7
|
-
return new Response(null, { status: 404 });
|
|
8
|
-
}
|
|
9
|
-
const load = extensions[`.astro/integrations/_wix_astro_backend-extensions/webhooks/${context.params.compId}/entry.ts`];
|
|
10
|
-
if (load == null) {
|
|
11
|
-
return new Response(null, { status: 404 });
|
|
12
|
-
}
|
|
13
|
-
const { default: run } = await load();
|
|
14
|
-
return run(context);
|
|
15
|
-
};
|
|
16
|
-
export {
|
|
17
|
-
ALL
|
|
18
|
-
};
|