@wix/astro 0.0.1-experimental-react-component → 0.0.1-experimental
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/fsevents-X6WP4TKM.node +0 -0
- package/build/index.d.ts +3 -2
- package/build/index.js +17329 -26
- package/build/index.js.map +1 -1
- package/build-browser-runtime/setup.d.ts +5 -0
- package/build-browser-runtime/setup.js +963 -0
- package/build-runtime/auth.d.ts +5 -0
- package/build-runtime/auth.js +3557 -0
- package/build-runtime/chunk-24J7STEA.js +8 -0
- package/build-runtime/chunk-B6RICTPP.js +94 -0
- package/build-runtime/chunk-C3QOE2TZ.js +7 -0
- package/build-runtime/chunk-EK7YZVWJ.js +353 -0
- package/build-runtime/chunk-FR26HCAT.js +471 -0
- package/build-runtime/chunk-HDTWPOIV.js +811 -0
- package/build-runtime/chunk-HPW4ZAEJ.js +23 -0
- package/build-runtime/chunk-JODQ44LE.js +1079 -0
- package/build-runtime/chunk-MLKGABMK.js +9 -0
- package/build-runtime/chunk-NVTQFGTR.js +7 -0
- package/build-runtime/chunk-PSHIUVP2.js +131 -0
- package/build-runtime/chunk-Q3KPY4P2.js +3104 -0
- package/build-runtime/chunk-QRPWKJ4C.js +41 -0
- package/build-runtime/chunk-RKE6XT5Z.js +3104 -0
- package/build-runtime/chunk-UZPSWWI5.js +13 -0
- package/build-runtime/chunk-VMS3NKCF.js +18 -0
- package/build-runtime/chunk-W73LN534.js +24 -0
- package/build-runtime/chunk-WYNC47R3.js +7 -0
- package/build-runtime/chunk-YMZMZCBN.js +4063 -0
- package/build-runtime/chunk-YX6EVX5Q.js +11 -0
- package/build-runtime/context/elevated.d.ts +2 -0
- package/build-runtime/context/elevated.js +25 -0
- package/build-runtime/context/non-elevated.d.ts +2 -0
- package/build-runtime/context/non-elevated.js +32 -0
- package/build-runtime/context/nonElevated.d.ts +2 -0
- package/build-runtime/context/nonElevated.js +38 -0
- package/build-runtime/context/setupServicePlugin.d.ts +5 -0
- package/build-runtime/context/setupServicePlugin.js +16 -0
- package/build-runtime/context/setupWebhook.d.ts +5 -0
- package/build-runtime/context/setupWebhook.js +16 -0
- package/build-runtime/middleware/auth.d.ts +5 -0
- package/build-runtime/middleware/auth.js +74 -0
- package/build-runtime/middleware/html-embeds.d.ts +5 -0
- package/build-runtime/middleware/html-embeds.js +166 -0
- package/build-runtime/routes/auth/callback.d.ts +5 -0
- package/build-runtime/routes/auth/callback.js +52 -0
- package/build-runtime/routes/auth/login.d.ts +5 -0
- package/build-runtime/routes/auth/login.js +45 -0
- package/build-runtime/routes/auth/logout-callback.d.ts +5 -0
- package/build-runtime/routes/auth/logout-callback.js +23 -0
- package/build-runtime/routes/auth/logout.d.ts +5 -0
- package/build-runtime/routes/auth/logout.js +32 -0
- package/build-runtime/routes/paylink/checkout.d.ts +5 -0
- package/build-runtime/routes/paylink/checkout.js +35 -0
- package/build-runtime/routes/paylink/paylink.d.ts +5 -0
- package/build-runtime/routes/paylink/paylink.js +34 -0
- package/build-runtime/routes/robots/robots.d.ts +5 -0
- package/build-runtime/routes/robots/robots.js +44 -0
- package/build-runtime/routes/service-plugins.d.ts +5 -0
- package/build-runtime/routes/service-plugins.js +11 -0
- package/build-runtime/routes/servicePluginsDevRoute.d.ts +5 -0
- package/build-runtime/routes/servicePluginsDevRoute.js +13 -0
- package/build-runtime/routes/webhooks.d.ts +5 -0
- package/build-runtime/routes/webhooks.js +11 -0
- package/build-runtime/routes/webhooksDevRoute.d.ts +5 -0
- package/build-runtime/routes/webhooksDevRoute.js +13 -0
- package/build-runtime/routes/wix-apis/api.d.ts +5 -0
- package/build-runtime/routes/wix-apis/api.js +34 -0
- package/package.json +45 -19
- package/runtime/entry.astro +26 -0
- package/build/builders.d.ts +0 -5
- package/build/builders.js +0 -40
- package/build/builders.js.map +0 -1
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
// ../../node_modules/@wix/sdk-types/build/index.mjs
|
|
2
|
+
function EventDefinition(type, isDomainEvent = false, transformations = (x) => x) {
|
|
3
|
+
return () => ({
|
|
4
|
+
__type: "event-definition",
|
|
5
|
+
type,
|
|
6
|
+
isDomainEvent,
|
|
7
|
+
transformations
|
|
8
|
+
});
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
// ../../node_modules/@wix/sdk-context/build/index.mjs
|
|
12
|
+
var wixContext = {};
|
|
13
|
+
|
|
14
|
+
// ../../node_modules/@wix/sdk-runtime/build/context.js
|
|
15
|
+
function resolveContext() {
|
|
16
|
+
const oldContext = typeof $wixContext !== "undefined" && $wixContext.initWixModules ? $wixContext.initWixModules : typeof globalThis.__wix_context__ !== "undefined" && globalThis.__wix_context__.initWixModules ? globalThis.__wix_context__.initWixModules : void 0;
|
|
17
|
+
if (oldContext) {
|
|
18
|
+
return {
|
|
19
|
+
// @ts-expect-error
|
|
20
|
+
initWixModules(modules, elevated) {
|
|
21
|
+
return runWithoutContext(() => oldContext(modules, elevated));
|
|
22
|
+
},
|
|
23
|
+
fetchWithAuth() {
|
|
24
|
+
throw new Error("fetchWithAuth is not available in this context");
|
|
25
|
+
},
|
|
26
|
+
graphql() {
|
|
27
|
+
throw new Error("graphql is not available in this context");
|
|
28
|
+
}
|
|
29
|
+
};
|
|
30
|
+
}
|
|
31
|
+
const contextualClient = typeof $wixContext !== "undefined" ? $wixContext.client : typeof wixContext.client !== "undefined" ? wixContext.client : typeof globalThis.__wix_context__ !== "undefined" ? globalThis.__wix_context__.client : void 0;
|
|
32
|
+
const elevatedClient = typeof $wixContext !== "undefined" ? $wixContext.elevatedClient : typeof wixContext.elevatedClient !== "undefined" ? wixContext.elevatedClient : typeof globalThis.__wix_context__ !== "undefined" ? globalThis.__wix_context__.elevatedClient : void 0;
|
|
33
|
+
if (!contextualClient && !elevatedClient) {
|
|
34
|
+
return;
|
|
35
|
+
}
|
|
36
|
+
return {
|
|
37
|
+
initWixModules(wixModules, elevated) {
|
|
38
|
+
if (elevated) {
|
|
39
|
+
if (!elevatedClient) {
|
|
40
|
+
throw new Error("An elevated client is required to use elevated modules. Make sure to initialize the Wix context with an elevated client before using elevated SDK modules");
|
|
41
|
+
}
|
|
42
|
+
return runWithoutContext(() => elevatedClient.use(wixModules));
|
|
43
|
+
}
|
|
44
|
+
if (!contextualClient) {
|
|
45
|
+
throw new Error("Wix context is not available. Make sure to initialize the Wix context before using SDK modules");
|
|
46
|
+
}
|
|
47
|
+
return runWithoutContext(() => contextualClient.use(wixModules));
|
|
48
|
+
},
|
|
49
|
+
fetchWithAuth: (urlOrRequest, requestInit) => {
|
|
50
|
+
if (!contextualClient) {
|
|
51
|
+
throw new Error("Wix context is not available. Make sure to initialize the Wix context before using SDK modules");
|
|
52
|
+
}
|
|
53
|
+
return contextualClient.fetchWithAuth(urlOrRequest, requestInit);
|
|
54
|
+
},
|
|
55
|
+
getAuth() {
|
|
56
|
+
if (!contextualClient) {
|
|
57
|
+
throw new Error("Wix context is not available. Make sure to initialize the Wix context before using SDK modules");
|
|
58
|
+
}
|
|
59
|
+
return contextualClient.auth;
|
|
60
|
+
},
|
|
61
|
+
async graphql(query, variables, opts) {
|
|
62
|
+
if (!contextualClient) {
|
|
63
|
+
throw new Error("Wix context is not available. Make sure to initialize the Wix context before using SDK modules");
|
|
64
|
+
}
|
|
65
|
+
return contextualClient.graphql(query, variables, opts);
|
|
66
|
+
}
|
|
67
|
+
};
|
|
68
|
+
}
|
|
69
|
+
function runWithoutContext(fn) {
|
|
70
|
+
const globalContext = globalThis.__wix_context__;
|
|
71
|
+
const moduleContext = {
|
|
72
|
+
client: wixContext.client,
|
|
73
|
+
elevatedClient: wixContext.elevatedClient
|
|
74
|
+
};
|
|
75
|
+
let closureContext;
|
|
76
|
+
globalThis.__wix_context__ = void 0;
|
|
77
|
+
wixContext.client = void 0;
|
|
78
|
+
wixContext.elevatedClient = void 0;
|
|
79
|
+
if (typeof $wixContext !== "undefined") {
|
|
80
|
+
closureContext = {
|
|
81
|
+
client: $wixContext?.client,
|
|
82
|
+
elevatedClient: $wixContext?.elevatedClient
|
|
83
|
+
};
|
|
84
|
+
delete $wixContext.client;
|
|
85
|
+
delete $wixContext.elevatedClient;
|
|
86
|
+
}
|
|
87
|
+
try {
|
|
88
|
+
return fn();
|
|
89
|
+
} finally {
|
|
90
|
+
globalThis.__wix_context__ = globalContext;
|
|
91
|
+
wixContext.client = moduleContext.client;
|
|
92
|
+
wixContext.elevatedClient = moduleContext.elevatedClient;
|
|
93
|
+
if (typeof $wixContext !== "undefined") {
|
|
94
|
+
$wixContext.client = closureContext.client;
|
|
95
|
+
$wixContext.elevatedClient = closureContext.elevatedClient;
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
// ../../node_modules/@wix/sdk-runtime/build/context-v2.js
|
|
101
|
+
function contextualizeRESTModuleV2(restModule, elevated) {
|
|
102
|
+
return (...args) => {
|
|
103
|
+
const context = resolveContext();
|
|
104
|
+
if (!context) {
|
|
105
|
+
return restModule.apply(void 0, args);
|
|
106
|
+
}
|
|
107
|
+
return context.initWixModules(restModule, elevated).apply(void 0, args);
|
|
108
|
+
};
|
|
109
|
+
}
|
|
110
|
+
function contextualizeEventDefinitionModuleV2(eventDefinition) {
|
|
111
|
+
const contextualMethod = (...args) => {
|
|
112
|
+
const context = resolveContext();
|
|
113
|
+
if (!context) {
|
|
114
|
+
return () => {
|
|
115
|
+
};
|
|
116
|
+
}
|
|
117
|
+
return context.initWixModules(eventDefinition).apply(void 0, args);
|
|
118
|
+
};
|
|
119
|
+
contextualMethod.__type = eventDefinition.__type;
|
|
120
|
+
contextualMethod.type = eventDefinition.type;
|
|
121
|
+
contextualMethod.isDomainEvent = eventDefinition.isDomainEvent;
|
|
122
|
+
contextualMethod.transformations = eventDefinition.transformations;
|
|
123
|
+
return contextualMethod;
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
export {
|
|
127
|
+
EventDefinition,
|
|
128
|
+
contextualizeRESTModuleV2,
|
|
129
|
+
contextualizeEventDefinitionModuleV2,
|
|
130
|
+
resolveContext
|
|
131
|
+
};
|