@flyo/nitro-astro 1.0.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/cdn.ts +48 -0
- package/components/BlockSlot.astro +13 -0
- package/components/BlockSlot.ts +2 -0
- package/components/FallbackComponent.astro +21 -0
- package/components/FallbackComponent.ts +2 -0
- package/components/FlyoNitroBlock.astro +27 -0
- package/components/FlyoNitroBlock.ts +2 -0
- package/components/FlyoNitroPage.astro +12 -0
- package/components/FlyoNitroPage.ts +2 -0
- package/components/MetaInfo.astro +35 -0
- package/components/MetaInfo.ts +2 -0
- package/components/MetaInfoEntity.astro +17 -0
- package/components/MetaInfoEntity.ts +2 -0
- package/components/MetaInfoPage.astro +16 -0
- package/components/MetaInfoPage.ts +2 -0
- package/dist/nitro-astro.js +79 -0
- package/dist/nitro-astro.mjs +844 -0
- package/middleware.ts +45 -0
- package/module.d.ts +6 -0
- package/package.json +99 -0
- package/sitemap.ts +34 -0
|
@@ -0,0 +1,844 @@
|
|
|
1
|
+
const x = "https://api.flyo.cloud/nitro/v1".replace(/\/+$/, "");
|
|
2
|
+
class S {
|
|
3
|
+
constructor(n = {}) {
|
|
4
|
+
this.configuration = n;
|
|
5
|
+
}
|
|
6
|
+
set config(n) {
|
|
7
|
+
this.configuration = n;
|
|
8
|
+
}
|
|
9
|
+
get basePath() {
|
|
10
|
+
return this.configuration.basePath != null ? this.configuration.basePath : x;
|
|
11
|
+
}
|
|
12
|
+
get fetchApi() {
|
|
13
|
+
return this.configuration.fetchApi;
|
|
14
|
+
}
|
|
15
|
+
get middleware() {
|
|
16
|
+
return this.configuration.middleware || [];
|
|
17
|
+
}
|
|
18
|
+
get queryParamsStringify() {
|
|
19
|
+
return this.configuration.queryParamsStringify || q;
|
|
20
|
+
}
|
|
21
|
+
get username() {
|
|
22
|
+
return this.configuration.username;
|
|
23
|
+
}
|
|
24
|
+
get password() {
|
|
25
|
+
return this.configuration.password;
|
|
26
|
+
}
|
|
27
|
+
get apiKey() {
|
|
28
|
+
const n = this.configuration.apiKey;
|
|
29
|
+
if (n)
|
|
30
|
+
return typeof n == "function" ? n : () => n;
|
|
31
|
+
}
|
|
32
|
+
get accessToken() {
|
|
33
|
+
const n = this.configuration.accessToken;
|
|
34
|
+
if (n)
|
|
35
|
+
return typeof n == "function" ? n : async () => n;
|
|
36
|
+
}
|
|
37
|
+
get headers() {
|
|
38
|
+
return this.configuration.headers;
|
|
39
|
+
}
|
|
40
|
+
get credentials() {
|
|
41
|
+
return this.configuration.credentials;
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
const U = new S(), C = class E {
|
|
45
|
+
constructor(n = U) {
|
|
46
|
+
this.configuration = n, this.fetchApi = async (t, i) => {
|
|
47
|
+
let r = { url: t, init: i };
|
|
48
|
+
for (const a of this.middleware)
|
|
49
|
+
a.pre && (r = await a.pre({
|
|
50
|
+
fetch: this.fetchApi,
|
|
51
|
+
...r
|
|
52
|
+
}) || r);
|
|
53
|
+
let o;
|
|
54
|
+
try {
|
|
55
|
+
o = await (this.configuration.fetchApi || fetch)(r.url, r.init);
|
|
56
|
+
} catch (a) {
|
|
57
|
+
for (const l of this.middleware)
|
|
58
|
+
l.onError && (o = await l.onError({
|
|
59
|
+
fetch: this.fetchApi,
|
|
60
|
+
url: r.url,
|
|
61
|
+
init: r.init,
|
|
62
|
+
error: a,
|
|
63
|
+
response: o ? o.clone() : void 0
|
|
64
|
+
}) || o);
|
|
65
|
+
if (o === void 0)
|
|
66
|
+
throw a instanceof Error ? new P(a, "The request failed and the interceptors did not return an alternative response") : a;
|
|
67
|
+
}
|
|
68
|
+
for (const a of this.middleware)
|
|
69
|
+
a.post && (o = await a.post({
|
|
70
|
+
fetch: this.fetchApi,
|
|
71
|
+
url: r.url,
|
|
72
|
+
init: r.init,
|
|
73
|
+
response: o.clone()
|
|
74
|
+
}) || o);
|
|
75
|
+
return o;
|
|
76
|
+
}, this.middleware = n.middleware;
|
|
77
|
+
}
|
|
78
|
+
withMiddleware(...n) {
|
|
79
|
+
const t = this.clone();
|
|
80
|
+
return t.middleware = t.middleware.concat(...n), t;
|
|
81
|
+
}
|
|
82
|
+
withPreMiddleware(...n) {
|
|
83
|
+
const t = n.map((i) => ({ pre: i }));
|
|
84
|
+
return this.withMiddleware(...t);
|
|
85
|
+
}
|
|
86
|
+
withPostMiddleware(...n) {
|
|
87
|
+
const t = n.map((i) => ({ post: i }));
|
|
88
|
+
return this.withMiddleware(...t);
|
|
89
|
+
}
|
|
90
|
+
/**
|
|
91
|
+
* Check if the given MIME is a JSON MIME.
|
|
92
|
+
* JSON MIME examples:
|
|
93
|
+
* application/json
|
|
94
|
+
* application/json; charset=UTF8
|
|
95
|
+
* APPLICATION/JSON
|
|
96
|
+
* application/vnd.company+json
|
|
97
|
+
* @param mime - MIME (Multipurpose Internet Mail Extensions)
|
|
98
|
+
* @return True if the given MIME is JSON, false otherwise.
|
|
99
|
+
*/
|
|
100
|
+
isJsonMime(n) {
|
|
101
|
+
return n ? E.jsonRegex.test(n) : !1;
|
|
102
|
+
}
|
|
103
|
+
async request(n, t) {
|
|
104
|
+
const { url: i, init: r } = await this.createFetchParams(n, t), o = await this.fetchApi(i, r);
|
|
105
|
+
if (o && o.status >= 200 && o.status < 300)
|
|
106
|
+
return o;
|
|
107
|
+
throw new F(o, "Response returned an error code");
|
|
108
|
+
}
|
|
109
|
+
async createFetchParams(n, t) {
|
|
110
|
+
let i = this.configuration.basePath + n.path;
|
|
111
|
+
n.query !== void 0 && Object.keys(n.query).length !== 0 && (i += "?" + this.configuration.queryParamsStringify(n.query));
|
|
112
|
+
const r = Object.assign({}, this.configuration.headers, n.headers);
|
|
113
|
+
Object.keys(r).forEach((p) => r[p] === void 0 ? delete r[p] : {});
|
|
114
|
+
const o = typeof t == "function" ? t : async () => t, a = {
|
|
115
|
+
method: n.method,
|
|
116
|
+
headers: r,
|
|
117
|
+
body: n.body,
|
|
118
|
+
credentials: this.configuration.credentials
|
|
119
|
+
}, l = {
|
|
120
|
+
...a,
|
|
121
|
+
...await o({
|
|
122
|
+
init: a,
|
|
123
|
+
context: n
|
|
124
|
+
})
|
|
125
|
+
};
|
|
126
|
+
let s;
|
|
127
|
+
L(l.body) || l.body instanceof URLSearchParams || j(l.body) ? s = l.body : this.isJsonMime(r["Content-Type"]) ? s = JSON.stringify(l.body) : s = l.body;
|
|
128
|
+
const u = {
|
|
129
|
+
...l,
|
|
130
|
+
body: s
|
|
131
|
+
};
|
|
132
|
+
return { url: i, init: u };
|
|
133
|
+
}
|
|
134
|
+
/**
|
|
135
|
+
* Create a shallow clone of `this` by constructing a new instance
|
|
136
|
+
* and then shallow cloning data members.
|
|
137
|
+
*/
|
|
138
|
+
clone() {
|
|
139
|
+
const n = this.constructor, t = new n(this.configuration);
|
|
140
|
+
return t.middleware = this.middleware.slice(), t;
|
|
141
|
+
}
|
|
142
|
+
};
|
|
143
|
+
C.jsonRegex = new RegExp("^(:?application/json|[^;/ ]+/[^;/ ]+[+]json)[ ]*(:?;.*)?$", "i");
|
|
144
|
+
let d = C;
|
|
145
|
+
function j(e) {
|
|
146
|
+
return typeof Blob < "u" && e instanceof Blob;
|
|
147
|
+
}
|
|
148
|
+
function L(e) {
|
|
149
|
+
return typeof FormData < "u" && e instanceof FormData;
|
|
150
|
+
}
|
|
151
|
+
class F extends Error {
|
|
152
|
+
constructor(n, t) {
|
|
153
|
+
super(t), this.response = n, this.name = "ResponseError";
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
class P extends Error {
|
|
157
|
+
constructor(n, t) {
|
|
158
|
+
super(t), this.cause = n, this.name = "FetchError";
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
class g extends Error {
|
|
162
|
+
constructor(n, t) {
|
|
163
|
+
super(t), this.field = n, this.name = "RequiredError";
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
function q(e, n = "") {
|
|
167
|
+
return Object.keys(e).map((t) => R(t, e[t], n)).filter((t) => t.length > 0).join("&");
|
|
168
|
+
}
|
|
169
|
+
function R(e, n, t = "") {
|
|
170
|
+
const i = t + (t.length ? `[${e}]` : e);
|
|
171
|
+
if (n instanceof Array) {
|
|
172
|
+
const r = n.map((o) => encodeURIComponent(String(o))).join(`&${encodeURIComponent(i)}=`);
|
|
173
|
+
return `${encodeURIComponent(i)}=${r}`;
|
|
174
|
+
}
|
|
175
|
+
if (n instanceof Set) {
|
|
176
|
+
const r = Array.from(n);
|
|
177
|
+
return R(e, r, t);
|
|
178
|
+
}
|
|
179
|
+
return n instanceof Date ? `${encodeURIComponent(i)}=${encodeURIComponent(n.toISOString())}` : n instanceof Object ? q(n, i) : `${encodeURIComponent(i)}=${encodeURIComponent(String(n))}`;
|
|
180
|
+
}
|
|
181
|
+
function y(e, n) {
|
|
182
|
+
return Object.keys(e).reduce(
|
|
183
|
+
(t, i) => ({ ...t, [i]: n(e[i]) }),
|
|
184
|
+
{}
|
|
185
|
+
);
|
|
186
|
+
}
|
|
187
|
+
class c {
|
|
188
|
+
constructor(n, t = (i) => i) {
|
|
189
|
+
this.raw = n, this.transformer = t;
|
|
190
|
+
}
|
|
191
|
+
async value() {
|
|
192
|
+
return this.transformer(await this.raw.json());
|
|
193
|
+
}
|
|
194
|
+
}
|
|
195
|
+
function K(e) {
|
|
196
|
+
return N(e);
|
|
197
|
+
}
|
|
198
|
+
function N(e, n) {
|
|
199
|
+
return e == null ? e : {
|
|
200
|
+
identifier: e.identifier == null ? void 0 : e.identifier,
|
|
201
|
+
content: e.content == null ? void 0 : e.content.map(A)
|
|
202
|
+
};
|
|
203
|
+
}
|
|
204
|
+
function A(e) {
|
|
205
|
+
return $(e);
|
|
206
|
+
}
|
|
207
|
+
function $(e, n) {
|
|
208
|
+
return e == null ? e : {
|
|
209
|
+
items: e.items == null ? void 0 : e.items,
|
|
210
|
+
content: e.content == null ? void 0 : e.content,
|
|
211
|
+
config: e.config == null ? void 0 : e.config,
|
|
212
|
+
identifier: e.identifier == null ? void 0 : e.identifier,
|
|
213
|
+
uid: e.uid == null ? void 0 : e.uid,
|
|
214
|
+
component: e.component == null ? void 0 : e.component,
|
|
215
|
+
slots: e.slots == null ? void 0 : y(e.slots, K)
|
|
216
|
+
};
|
|
217
|
+
}
|
|
218
|
+
function I(e) {
|
|
219
|
+
return B(e);
|
|
220
|
+
}
|
|
221
|
+
function B(e, n) {
|
|
222
|
+
return e == null ? e : {
|
|
223
|
+
type: e.type == null ? void 0 : e.type,
|
|
224
|
+
target: e.target == null ? void 0 : e.target,
|
|
225
|
+
label: e.label == null ? void 0 : e.label,
|
|
226
|
+
href: e.href == null ? void 0 : e.href,
|
|
227
|
+
slug: e.slug == null ? void 0 : e.slug,
|
|
228
|
+
properties: e.properties == null ? void 0 : e.properties,
|
|
229
|
+
children: e.children == null ? void 0 : e.children.map(I)
|
|
230
|
+
};
|
|
231
|
+
}
|
|
232
|
+
function M(e) {
|
|
233
|
+
return O(e);
|
|
234
|
+
}
|
|
235
|
+
function O(e, n) {
|
|
236
|
+
return e == null ? e : {
|
|
237
|
+
items: e.items == null ? void 0 : e.items.map(I),
|
|
238
|
+
uid: e.uid == null ? void 0 : e.uid,
|
|
239
|
+
identifier: e.identifier == null ? void 0 : e.identifier,
|
|
240
|
+
label: e.label == null ? void 0 : e.label
|
|
241
|
+
};
|
|
242
|
+
}
|
|
243
|
+
function D(e) {
|
|
244
|
+
return G(e);
|
|
245
|
+
}
|
|
246
|
+
function G(e, n) {
|
|
247
|
+
return e == null ? e : {
|
|
248
|
+
domain: e.domain == null ? void 0 : e.domain,
|
|
249
|
+
slug: e.slug == null ? void 0 : e.slug,
|
|
250
|
+
version: e.version == null ? void 0 : e.version,
|
|
251
|
+
updated_at: e.updated_at == null ? void 0 : e.updated_at,
|
|
252
|
+
language: e.language == null ? void 0 : e.language,
|
|
253
|
+
primary_language: e.primary_language == null ? void 0 : e.primary_language
|
|
254
|
+
};
|
|
255
|
+
}
|
|
256
|
+
function H(e) {
|
|
257
|
+
return V(e);
|
|
258
|
+
}
|
|
259
|
+
function V(e, n) {
|
|
260
|
+
return e == null ? e : {
|
|
261
|
+
nitro: e.nitro == null ? void 0 : D(e.nitro),
|
|
262
|
+
pages: e.pages == null ? void 0 : e.pages,
|
|
263
|
+
containers: e.containers == null ? void 0 : y(e.containers, M),
|
|
264
|
+
globals: e.globals == null ? void 0 : e.globals
|
|
265
|
+
};
|
|
266
|
+
}
|
|
267
|
+
function z(e) {
|
|
268
|
+
return J(e);
|
|
269
|
+
}
|
|
270
|
+
function J(e, n) {
|
|
271
|
+
return e == null ? e : {
|
|
272
|
+
api: e.api == null ? void 0 : e.api,
|
|
273
|
+
image: e.image == null ? void 0 : e.image
|
|
274
|
+
};
|
|
275
|
+
}
|
|
276
|
+
function W(e) {
|
|
277
|
+
return Q(e);
|
|
278
|
+
}
|
|
279
|
+
function Q(e, n) {
|
|
280
|
+
return e == null ? e : {
|
|
281
|
+
_version: e._version == null ? void 0 : e._version,
|
|
282
|
+
entity_metric: e.entity_metric == null ? void 0 : z(e.entity_metric),
|
|
283
|
+
entity_unique_id: e.entity_unique_id == null ? void 0 : e.entity_unique_id,
|
|
284
|
+
entity_id: e.entity_id == null ? void 0 : e.entity_id,
|
|
285
|
+
entity_image: e.entity_image == null ? void 0 : e.entity_image,
|
|
286
|
+
entity_slug: e.entity_slug == null ? void 0 : e.entity_slug,
|
|
287
|
+
entity_teaser: e.entity_teaser == null ? void 0 : e.entity_teaser,
|
|
288
|
+
entity_time_end: e.entity_time_end == null ? void 0 : e.entity_time_end,
|
|
289
|
+
entity_time_start: e.entity_time_start == null ? void 0 : e.entity_time_start,
|
|
290
|
+
entity_title: e.entity_title == null ? void 0 : e.entity_title,
|
|
291
|
+
entity_type: e.entity_type == null ? void 0 : e.entity_type,
|
|
292
|
+
entity_type_id: e.entity_type_id == null ? void 0 : e.entity_type_id,
|
|
293
|
+
updated_at: e.updated_at == null ? void 0 : e.updated_at,
|
|
294
|
+
routes: e.routes == null ? void 0 : e.routes
|
|
295
|
+
};
|
|
296
|
+
}
|
|
297
|
+
function v(e) {
|
|
298
|
+
return Y(e);
|
|
299
|
+
}
|
|
300
|
+
function Y(e, n) {
|
|
301
|
+
return e == null ? e : {
|
|
302
|
+
entity: e.entity == null ? void 0 : W(e.entity),
|
|
303
|
+
model: e.model == null ? void 0 : e.model,
|
|
304
|
+
language: e.language == null ? void 0 : e.language,
|
|
305
|
+
jsonld: e.jsonld == null ? void 0 : e.jsonld
|
|
306
|
+
};
|
|
307
|
+
}
|
|
308
|
+
function k(e) {
|
|
309
|
+
return Z(e);
|
|
310
|
+
}
|
|
311
|
+
function Z(e, n) {
|
|
312
|
+
return e == null ? e : {
|
|
313
|
+
entity_unique_id: e.entity_unique_id == null ? void 0 : e.entity_unique_id,
|
|
314
|
+
entity_title: e.entity_title == null ? void 0 : e.entity_title,
|
|
315
|
+
entity_teaser: e.entity_teaser == null ? void 0 : e.entity_teaser,
|
|
316
|
+
entity_slug: e.entity_slug == null ? void 0 : e.entity_slug,
|
|
317
|
+
entity_time_start: e.entity_time_start == null ? void 0 : e.entity_time_start,
|
|
318
|
+
entity_type: e.entity_type == null ? void 0 : e.entity_type,
|
|
319
|
+
entity_type_id: e.entity_type_id == null ? void 0 : e.entity_type_id,
|
|
320
|
+
entity_image: e.entity_image == null ? void 0 : e.entity_image,
|
|
321
|
+
routes: e.routes == null ? void 0 : e.routes
|
|
322
|
+
};
|
|
323
|
+
}
|
|
324
|
+
function X(e) {
|
|
325
|
+
return ee(e);
|
|
326
|
+
}
|
|
327
|
+
function ee(e, n) {
|
|
328
|
+
return e == null ? e : {
|
|
329
|
+
description: e.description == null ? void 0 : e.description,
|
|
330
|
+
image: e.image == null ? void 0 : e.image,
|
|
331
|
+
title: e.title == null ? void 0 : e.title
|
|
332
|
+
};
|
|
333
|
+
}
|
|
334
|
+
function ne(e) {
|
|
335
|
+
return te(e);
|
|
336
|
+
}
|
|
337
|
+
function te(e, n) {
|
|
338
|
+
return e == null ? e : {
|
|
339
|
+
slug: e.slug == null ? void 0 : e.slug,
|
|
340
|
+
title: e.title == null ? void 0 : e.title
|
|
341
|
+
};
|
|
342
|
+
}
|
|
343
|
+
function ie(e) {
|
|
344
|
+
return oe(e);
|
|
345
|
+
}
|
|
346
|
+
function oe(e, n) {
|
|
347
|
+
return e == null ? e : {
|
|
348
|
+
value: e.value == null ? void 0 : e.value,
|
|
349
|
+
navigation: e.navigation == null ? void 0 : e.navigation,
|
|
350
|
+
propagate: e.propagate == null ? void 0 : e.propagate
|
|
351
|
+
};
|
|
352
|
+
}
|
|
353
|
+
function m(e) {
|
|
354
|
+
return re(e);
|
|
355
|
+
}
|
|
356
|
+
function re(e, n) {
|
|
357
|
+
return e == null ? e : {
|
|
358
|
+
id: e.id == null ? void 0 : e.id,
|
|
359
|
+
title: e.title == null ? void 0 : e.title,
|
|
360
|
+
href: e.href == null ? void 0 : e.href,
|
|
361
|
+
slug: e.slug == null ? void 0 : e.slug,
|
|
362
|
+
json: e.json == null ? void 0 : e.json.map(A),
|
|
363
|
+
depth: e.depth == null ? void 0 : e.depth,
|
|
364
|
+
is_home: e.is_home == null ? void 0 : e.is_home,
|
|
365
|
+
created_at: e.created_at == null ? void 0 : e.created_at,
|
|
366
|
+
updated_at: e.updated_at == null ? void 0 : e.updated_at,
|
|
367
|
+
is_visible: e.is_visible == null ? void 0 : e.is_visible,
|
|
368
|
+
meta_json: e.meta_json == null ? void 0 : X(e.meta_json),
|
|
369
|
+
properties: e.properties == null ? void 0 : y(e.properties, ie),
|
|
370
|
+
uid: e.uid == null ? void 0 : e.uid,
|
|
371
|
+
type: e.type == null ? void 0 : e.type,
|
|
372
|
+
target: e.target == null ? void 0 : e.target,
|
|
373
|
+
container: e.container == null ? void 0 : e.container,
|
|
374
|
+
breadcrumb: e.breadcrumb == null ? void 0 : e.breadcrumb.map(ne)
|
|
375
|
+
};
|
|
376
|
+
}
|
|
377
|
+
function ae(e) {
|
|
378
|
+
return le(e);
|
|
379
|
+
}
|
|
380
|
+
function le(e, n) {
|
|
381
|
+
return e == null ? e : {
|
|
382
|
+
version: e.version == null ? void 0 : e.version,
|
|
383
|
+
updated_at: e.updated_at == null ? void 0 : e.updated_at
|
|
384
|
+
};
|
|
385
|
+
}
|
|
386
|
+
class se extends d {
|
|
387
|
+
/**
|
|
388
|
+
* The config API endpoint provides comprehensive information required for configuring the layout of websites. It encompasses various essential elements, including containers with pages, an extensive list of available slugs, globals containing content pool data, and crucial details about the Nitro configuration itself. By accessing this endpoint, developers can gather all the necessary data to effectively design and structure their websites. The endpoint offers a holistic view of the website\'s layout, empowering developers to tailor the user experience and optimize the overall design.
|
|
389
|
+
* Get Config
|
|
390
|
+
*/
|
|
391
|
+
async configRaw(n, t) {
|
|
392
|
+
const i = {};
|
|
393
|
+
n.lang != null && (i.lang = n.lang);
|
|
394
|
+
const r = {};
|
|
395
|
+
this.configuration && this.configuration.apiKey && (i.token = await this.configuration.apiKey("token"));
|
|
396
|
+
const o = await this.request({
|
|
397
|
+
path: "/config",
|
|
398
|
+
method: "GET",
|
|
399
|
+
headers: r,
|
|
400
|
+
query: i
|
|
401
|
+
}, t);
|
|
402
|
+
return new c(o, (a) => H(a));
|
|
403
|
+
}
|
|
404
|
+
/**
|
|
405
|
+
* The config API endpoint provides comprehensive information required for configuring the layout of websites. It encompasses various essential elements, including containers with pages, an extensive list of available slugs, globals containing content pool data, and crucial details about the Nitro configuration itself. By accessing this endpoint, developers can gather all the necessary data to effectively design and structure their websites. The endpoint offers a holistic view of the website\'s layout, empowering developers to tailor the user experience and optimize the overall design.
|
|
406
|
+
* Get Config
|
|
407
|
+
*/
|
|
408
|
+
async config(n = {}, t) {
|
|
409
|
+
return await (await this.configRaw(n, t)).value();
|
|
410
|
+
}
|
|
411
|
+
}
|
|
412
|
+
class ue extends d {
|
|
413
|
+
/**
|
|
414
|
+
* The endpoint allows for the retrieval of entities based on their slug, with an optional Entity-Type-ID for more accurate results. The endpoint requires a `slug` parameter to be passed in the path, which is necessary for identifying the entity. However, since slugs are not unique across different entities, it is highly recommended to also provide the `typeId` parameter through the query to avoid incorrect or unintended results. This `typeId` serves as an Entity-Definition-Schema ID, ensuring a more precise and targeted entity retrieval by distinguishing the entities more clearly. The `slug` parameter is mandatory and should be a string (e.g., \'hello-world\'), while the `typeId` parameter is optional and should be an integer (e.g., 123), representing the Entity-Definition-Schema ID.
|
|
415
|
+
* Find entity by slug and optional Entity-Type-ID
|
|
416
|
+
*/
|
|
417
|
+
async entityBySlugRaw(n, t) {
|
|
418
|
+
if (n.slug == null)
|
|
419
|
+
throw new g(
|
|
420
|
+
"slug",
|
|
421
|
+
'Required parameter "slug" was null or undefined when calling entityBySlug().'
|
|
422
|
+
);
|
|
423
|
+
const i = {};
|
|
424
|
+
n.lang != null && (i.lang = n.lang), n.typeId != null && (i.typeId = n.typeId);
|
|
425
|
+
const r = {};
|
|
426
|
+
this.configuration && this.configuration.apiKey && (i.token = await this.configuration.apiKey("token"));
|
|
427
|
+
const o = await this.request({
|
|
428
|
+
path: "/entities/slug/{slug}".replace("{slug}", encodeURIComponent(String(n.slug))),
|
|
429
|
+
method: "GET",
|
|
430
|
+
headers: r,
|
|
431
|
+
query: i
|
|
432
|
+
}, t);
|
|
433
|
+
return new c(o, (a) => v(a));
|
|
434
|
+
}
|
|
435
|
+
/**
|
|
436
|
+
* The endpoint allows for the retrieval of entities based on their slug, with an optional Entity-Type-ID for more accurate results. The endpoint requires a `slug` parameter to be passed in the path, which is necessary for identifying the entity. However, since slugs are not unique across different entities, it is highly recommended to also provide the `typeId` parameter through the query to avoid incorrect or unintended results. This `typeId` serves as an Entity-Definition-Schema ID, ensuring a more precise and targeted entity retrieval by distinguishing the entities more clearly. The `slug` parameter is mandatory and should be a string (e.g., \'hello-world\'), while the `typeId` parameter is optional and should be an integer (e.g., 123), representing the Entity-Definition-Schema ID.
|
|
437
|
+
* Find entity by slug and optional Entity-Type-ID
|
|
438
|
+
*/
|
|
439
|
+
async entityBySlug(n, t) {
|
|
440
|
+
return await (await this.entityBySlugRaw(n, t)).value();
|
|
441
|
+
}
|
|
442
|
+
/**
|
|
443
|
+
* The endpoint provides comprehensive information about a specified entity. An entity represents a collection of information pertaining to a specific data type and is defined by a key-value pair. You can use various data types such as blogs, events, or any other relevant data. However, in order to access an entity, it must be properly configured within the nitro config.
|
|
444
|
+
* Find entity by uniqueid
|
|
445
|
+
*/
|
|
446
|
+
async entityByUniqueidRaw(n, t) {
|
|
447
|
+
if (n.uniqueid == null)
|
|
448
|
+
throw new g(
|
|
449
|
+
"uniqueid",
|
|
450
|
+
'Required parameter "uniqueid" was null or undefined when calling entityByUniqueid().'
|
|
451
|
+
);
|
|
452
|
+
const i = {};
|
|
453
|
+
n.lang != null && (i.lang = n.lang);
|
|
454
|
+
const r = {};
|
|
455
|
+
this.configuration && this.configuration.apiKey && (i.token = await this.configuration.apiKey("token"));
|
|
456
|
+
const o = await this.request({
|
|
457
|
+
path: "/entities/uniqueid/{uniqueid}".replace("{uniqueid}", encodeURIComponent(String(n.uniqueid))),
|
|
458
|
+
method: "GET",
|
|
459
|
+
headers: r,
|
|
460
|
+
query: i
|
|
461
|
+
}, t);
|
|
462
|
+
return new c(o, (a) => v(a));
|
|
463
|
+
}
|
|
464
|
+
/**
|
|
465
|
+
* The endpoint provides comprehensive information about a specified entity. An entity represents a collection of information pertaining to a specific data type and is defined by a key-value pair. You can use various data types such as blogs, events, or any other relevant data. However, in order to access an entity, it must be properly configured within the nitro config.
|
|
466
|
+
* Find entity by uniqueid
|
|
467
|
+
*/
|
|
468
|
+
async entityByUniqueid(n, t) {
|
|
469
|
+
return await (await this.entityByUniqueidRaw(n, t)).value();
|
|
470
|
+
}
|
|
471
|
+
}
|
|
472
|
+
class ce extends d {
|
|
473
|
+
/**
|
|
474
|
+
* This endpoint allows you to retrieve the designated homepage of a website. Alternatively, you can utilize the pages endpoint by specifying an empty slug parameter to achieve the same result. By using either of these methods, you can effectively access the desired homepage of the website.
|
|
475
|
+
* Get Home
|
|
476
|
+
*/
|
|
477
|
+
async homeRaw(n, t) {
|
|
478
|
+
const i = {};
|
|
479
|
+
n.lang != null && (i.lang = n.lang);
|
|
480
|
+
const r = {};
|
|
481
|
+
this.configuration && this.configuration.apiKey && (i.token = await this.configuration.apiKey("token"));
|
|
482
|
+
const o = await this.request({
|
|
483
|
+
path: "/pages/home",
|
|
484
|
+
method: "GET",
|
|
485
|
+
headers: r,
|
|
486
|
+
query: i
|
|
487
|
+
}, t);
|
|
488
|
+
return new c(o, (a) => m(a));
|
|
489
|
+
}
|
|
490
|
+
/**
|
|
491
|
+
* This endpoint allows you to retrieve the designated homepage of a website. Alternatively, you can utilize the pages endpoint by specifying an empty slug parameter to achieve the same result. By using either of these methods, you can effectively access the desired homepage of the website.
|
|
492
|
+
* Get Home
|
|
493
|
+
*/
|
|
494
|
+
async home(n = {}, t) {
|
|
495
|
+
return await (await this.homeRaw(n, t)).value();
|
|
496
|
+
}
|
|
497
|
+
/**
|
|
498
|
+
* This endpoint retrieves comprehensive information from a specified page using either a slug or a path. The slug refers to a unique identifier for the page, while the path is the slug with a leading slash. By providing either the slug or the path as input, the function will gather all the relevant details associated with the page.
|
|
499
|
+
* Get Page by slug
|
|
500
|
+
*/
|
|
501
|
+
async pageRaw(n, t) {
|
|
502
|
+
const i = {};
|
|
503
|
+
n.lang != null && (i.lang = n.lang), n.slug != null && (i.slug = n.slug);
|
|
504
|
+
const r = {};
|
|
505
|
+
this.configuration && this.configuration.apiKey && (i.token = await this.configuration.apiKey("token"));
|
|
506
|
+
const o = await this.request({
|
|
507
|
+
path: "/pages",
|
|
508
|
+
method: "GET",
|
|
509
|
+
headers: r,
|
|
510
|
+
query: i
|
|
511
|
+
}, t);
|
|
512
|
+
return new c(o, (a) => m(a));
|
|
513
|
+
}
|
|
514
|
+
/**
|
|
515
|
+
* This endpoint retrieves comprehensive information from a specified page using either a slug or a path. The slug refers to a unique identifier for the page, while the path is the slug with a leading slash. By providing either the slug or the path as input, the function will gather all the relevant details associated with the page.
|
|
516
|
+
* Get Page by slug
|
|
517
|
+
*/
|
|
518
|
+
async page(n = {}, t) {
|
|
519
|
+
return await (await this.pageRaw(n, t)).value();
|
|
520
|
+
}
|
|
521
|
+
}
|
|
522
|
+
class de extends d {
|
|
523
|
+
/**
|
|
524
|
+
* This endpoint offers a powerful capability to search through the websites sitemap, encompassing both pages and entities. With this endpoint, users can efficiently explore and retrieve information from your sitemap by creating a paginated search experience.
|
|
525
|
+
* Get Search by query
|
|
526
|
+
*/
|
|
527
|
+
async searchRaw(n, t) {
|
|
528
|
+
if (n.query == null)
|
|
529
|
+
throw new g(
|
|
530
|
+
"query",
|
|
531
|
+
'Required parameter "query" was null or undefined when calling search().'
|
|
532
|
+
);
|
|
533
|
+
const i = {};
|
|
534
|
+
n.lang != null && (i.lang = n.lang), n.query != null && (i.query = n.query);
|
|
535
|
+
const r = {};
|
|
536
|
+
this.configuration && this.configuration.apiKey && (i.token = await this.configuration.apiKey("token"));
|
|
537
|
+
const o = await this.request({
|
|
538
|
+
path: "/search",
|
|
539
|
+
method: "GET",
|
|
540
|
+
headers: r,
|
|
541
|
+
query: i
|
|
542
|
+
}, t);
|
|
543
|
+
return new c(o, (a) => a.map(k));
|
|
544
|
+
}
|
|
545
|
+
/**
|
|
546
|
+
* This endpoint offers a powerful capability to search through the websites sitemap, encompassing both pages and entities. With this endpoint, users can efficiently explore and retrieve information from your sitemap by creating a paginated search experience.
|
|
547
|
+
* Get Search by query
|
|
548
|
+
*/
|
|
549
|
+
async search(n, t) {
|
|
550
|
+
return await (await this.searchRaw(n, t)).value();
|
|
551
|
+
}
|
|
552
|
+
}
|
|
553
|
+
class fe extends d {
|
|
554
|
+
/**
|
|
555
|
+
* This endpoint provides comprehensive data for generating the sitemap. It encompasses all the necessary information, including pages from containers, as well as all entities that have been mapped.
|
|
556
|
+
* Get Sitemap
|
|
557
|
+
*/
|
|
558
|
+
async sitemapRaw(n, t) {
|
|
559
|
+
const i = {};
|
|
560
|
+
n.lang != null && (i.lang = n.lang);
|
|
561
|
+
const r = {};
|
|
562
|
+
this.configuration && this.configuration.apiKey && (i.token = await this.configuration.apiKey("token"));
|
|
563
|
+
const o = await this.request({
|
|
564
|
+
path: "/sitemap",
|
|
565
|
+
method: "GET",
|
|
566
|
+
headers: r,
|
|
567
|
+
query: i
|
|
568
|
+
}, t);
|
|
569
|
+
return new c(o, (a) => a.map(k));
|
|
570
|
+
}
|
|
571
|
+
/**
|
|
572
|
+
* This endpoint provides comprehensive data for generating the sitemap. It encompasses all the necessary information, including pages from containers, as well as all entities that have been mapped.
|
|
573
|
+
* Get Sitemap
|
|
574
|
+
*/
|
|
575
|
+
async sitemap(n = {}, t) {
|
|
576
|
+
return await (await this.sitemapRaw(n, t)).value();
|
|
577
|
+
}
|
|
578
|
+
}
|
|
579
|
+
class pe extends d {
|
|
580
|
+
/**
|
|
581
|
+
* The Version API endpoint offers a highly efficient solution for evaluating the current caching status of your application\'s caching mechanism. This functionality allows you to cache the entire application configuration and page responses indefinitely. However, utilizing this endpoint enables you to assess the validity of the cache by sending a request to determine its current status. This caching endpoint is specifically designed for optimal performance when compared to the configuration endpoint, which requires more thorough evaluation and encompasses a substantial response body.
|
|
582
|
+
* Get Version Information
|
|
583
|
+
*/
|
|
584
|
+
async versionRaw(n, t) {
|
|
585
|
+
const i = {};
|
|
586
|
+
n.lang != null && (i.lang = n.lang);
|
|
587
|
+
const r = {};
|
|
588
|
+
this.configuration && this.configuration.apiKey && (i.token = await this.configuration.apiKey("token"));
|
|
589
|
+
const o = await this.request({
|
|
590
|
+
path: "/version",
|
|
591
|
+
method: "GET",
|
|
592
|
+
headers: r,
|
|
593
|
+
query: i
|
|
594
|
+
}, t);
|
|
595
|
+
return new c(o, (a) => ae(a));
|
|
596
|
+
}
|
|
597
|
+
/**
|
|
598
|
+
* The Version API endpoint offers a highly efficient solution for evaluating the current caching status of your application\'s caching mechanism. This functionality allows you to cache the entire application configuration and page responses indefinitely. However, utilizing this endpoint enables you to assess the validity of the cache by sending a request to determine its current status. This caching endpoint is specifically designed for optimal performance when compared to the configuration endpoint, which requires more thorough evaluation and encompasses a substantial response body.
|
|
599
|
+
* Get Version Information
|
|
600
|
+
*/
|
|
601
|
+
async version(n = {}, t) {
|
|
602
|
+
return await (await this.versionRaw(n, t)).value();
|
|
603
|
+
}
|
|
604
|
+
}
|
|
605
|
+
const ge = /[\p{Lu}]/u, ye = /[\p{Ll}]/u, w = /^[\p{Lu}](?![\p{Lu}])/gu, T = /([\p{Alpha}\p{N}_]|$)/u, h = /[_.\- ]+/, he = new RegExp("^" + h.source), _ = new RegExp(h.source + T.source, "gu"), b = new RegExp("\\d+" + T.source, "gu"), ve = (e, n, t, i) => {
|
|
606
|
+
let r = !1, o = !1, a = !1, l = !1;
|
|
607
|
+
for (let s = 0; s < e.length; s++) {
|
|
608
|
+
const u = e[s];
|
|
609
|
+
l = s > 2 ? e[s - 3] === "-" : !0, r && ge.test(u) ? (e = e.slice(0, s) + "-" + e.slice(s), r = !1, a = o, o = !0, s++) : o && a && ye.test(u) && (!l || i) ? (e = e.slice(0, s - 1) + "-" + e.slice(s - 1), a = o, o = !1, r = !0) : (r = n(u) === u && t(u) !== u, a = o, o = t(u) === u && n(u) !== u);
|
|
610
|
+
}
|
|
611
|
+
return e;
|
|
612
|
+
}, me = (e, n) => (w.lastIndex = 0, e.replace(w, (t) => n(t))), we = (e, n) => (_.lastIndex = 0, b.lastIndex = 0, e.replace(_, (t, i) => n(i)).replace(b, (t) => n(t)));
|
|
613
|
+
function _e(e, n) {
|
|
614
|
+
if (!(typeof e == "string" || Array.isArray(e)))
|
|
615
|
+
throw new TypeError("Expected the input to be `string | string[]`");
|
|
616
|
+
if (n = {
|
|
617
|
+
pascalCase: !1,
|
|
618
|
+
preserveConsecutiveUppercase: !1,
|
|
619
|
+
...n
|
|
620
|
+
}, Array.isArray(e) ? e = e.map((o) => o.trim()).filter((o) => o.length).join("-") : e = e.trim(), e.length === 0)
|
|
621
|
+
return "";
|
|
622
|
+
const t = n.locale === !1 ? (o) => o.toLowerCase() : (o) => o.toLocaleLowerCase(n.locale), i = n.locale === !1 ? (o) => o.toUpperCase() : (o) => o.toLocaleUpperCase(n.locale);
|
|
623
|
+
return e.length === 1 ? h.test(e) ? "" : n.pascalCase ? i(e) : t(e) : (e !== t(e) && (e = ve(e, t, i, n.preserveConsecutiveUppercase)), e = e.replace(he, ""), e = n.preserveConsecutiveUppercase ? me(e, t) : t(e), n.pascalCase && (e = i(e.charAt(0)) + e.slice(1)), we(e, i));
|
|
624
|
+
}
|
|
625
|
+
function be(e, n, t) {
|
|
626
|
+
const i = "virtual:flyo-components", r = "\0" + i;
|
|
627
|
+
return {
|
|
628
|
+
name: "vite-plugin-flyo-components",
|
|
629
|
+
async resolveId(o) {
|
|
630
|
+
if (o === i)
|
|
631
|
+
return r;
|
|
632
|
+
},
|
|
633
|
+
async load(o) {
|
|
634
|
+
if (o === r) {
|
|
635
|
+
const a = [];
|
|
636
|
+
for (const [s, u] of Object.entries(
|
|
637
|
+
n
|
|
638
|
+
)) {
|
|
639
|
+
const p = await this.resolve(
|
|
640
|
+
"/" + e + "/" + u + ".astro"
|
|
641
|
+
);
|
|
642
|
+
p && a.push(
|
|
643
|
+
`export { default as ${_e(s)} } from "${p.id}"`
|
|
644
|
+
);
|
|
645
|
+
}
|
|
646
|
+
let l = null;
|
|
647
|
+
return t && (l = await this.resolve(
|
|
648
|
+
"/" + e + "/" + t + ".astro"
|
|
649
|
+
)), l ? a.push(
|
|
650
|
+
`export { default as fallback } from "${l.id}"`
|
|
651
|
+
) : a.push(
|
|
652
|
+
'export { default as fallback } from "@flyo/nitro-astro/FallbackComponent.astro"'
|
|
653
|
+
), a.join(";");
|
|
654
|
+
}
|
|
655
|
+
}
|
|
656
|
+
};
|
|
657
|
+
}
|
|
658
|
+
function Ce() {
|
|
659
|
+
return globalThis.flyoNitroInstance || console.error(
|
|
660
|
+
"The Flyo Typescript Configuration has not been initialized correctly"
|
|
661
|
+
), globalThis.flyoNitroInstance;
|
|
662
|
+
}
|
|
663
|
+
function f() {
|
|
664
|
+
return Ce().config;
|
|
665
|
+
}
|
|
666
|
+
async function qe(e) {
|
|
667
|
+
return await e.locals.config;
|
|
668
|
+
}
|
|
669
|
+
function Re() {
|
|
670
|
+
return new se(f());
|
|
671
|
+
}
|
|
672
|
+
function Ae() {
|
|
673
|
+
return new ue(f());
|
|
674
|
+
}
|
|
675
|
+
function Ie() {
|
|
676
|
+
return new ce(f());
|
|
677
|
+
}
|
|
678
|
+
function ke() {
|
|
679
|
+
return new de(f());
|
|
680
|
+
}
|
|
681
|
+
function Te() {
|
|
682
|
+
return new fe(f());
|
|
683
|
+
}
|
|
684
|
+
function xe() {
|
|
685
|
+
return new pe(f());
|
|
686
|
+
}
|
|
687
|
+
function Se(e) {
|
|
688
|
+
return {
|
|
689
|
+
"data-flyo-block-uid": e.uid
|
|
690
|
+
};
|
|
691
|
+
}
|
|
692
|
+
const Ee = `
|
|
693
|
+
<svg version="1.1" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 163.4 88.5">
|
|
694
|
+
<style type="text/css">
|
|
695
|
+
.st8{fill:#FFFFFF;}
|
|
696
|
+
</style>
|
|
697
|
+
<g id="Ebene_1">
|
|
698
|
+
<g>
|
|
699
|
+
<path class="st8" d="M49,56.7c-0.5-0.3-0.8-0.7-1.2-1.2c-0.4-0.5-0.6-1.2-0.7-1.8c-0.1-0.6-0.2-1.2-0.2-1.8V18.7
|
|
700
|
+
c0-5.2-1.6-9.4-4.8-12.6c-3.2-3.2-8.2-4.8-15-4.8c-6.1,0-10.9,1.5-14.3,4.6C9.4,8.9,7.7,13.3,7.7,19v6.4H1.5V35h6.1v32.1h11.9V35
|
|
701
|
+
h7.7v-9.6h-7.7c0-8.3,0.6-9.4,1.8-11.3c1.2-1.8,3.2-2.8,6.1-2.8c1.5,0,2.7,0.3,3.7,0.8c1,0.5,1.7,1.2,2.3,2.1
|
|
702
|
+
c0.6,0.9,0.9,1.9,1.2,3.1c0.2,1.2,0.3,2.4,0.3,3.7v36.8c0,1.4,0.3,2.6,0.8,3.8c0.5,1.2,1.3,2.2,2.3,3.2c1,0.9,2.1,1.6,3.5,2.1
|
|
703
|
+
c10.1,3,18.5-1.1,18.5-1.1l-4-10.1C52,58.4,49.6,57,49,56.7z"/>
|
|
704
|
+
<path class="st8" d="M146.3,34.6c-1.1-2.9-2.7-5.5-4.9-7.7c-2.1-2.2-4.7-4-7.7-5.3c-3-1.3-6.4-2-10.2-2c-3.8,0-7.2,0.7-10.2,2
|
|
705
|
+
c-3,1.3-5.6,3.1-7.7,5.3c-2.1,2.2-3.7,4.8-4.9,7.7c-1.1,2.9-1.7,6-1.7,9.3c0,3.2,0.6,6.3,1.7,9.2c1.1,2.9,2.7,5.5,4.9,7.7
|
|
706
|
+
c2.1,2.2,4.7,4,7.7,5.3c3,1.3,6.4,2,10.2,2c3.8,0,7.2-0.7,10.2-2c3-1.3,5.6-3.1,7.7-5.3c2.1-2.2,3.7-4.8,4.8-7.7
|
|
707
|
+
c1.1-2.9,1.7-6,1.7-9.2C148,40.6,147.4,37.5,146.3,34.6z M134.8,49.5c-0.6,1.7-1.5,3.2-2.6,4.5c-1.1,1.2-2.4,2.2-3.9,2.9
|
|
708
|
+
c-1.5,0.7-3.1,1-4.8,1c-1.7,0-3.3-0.3-4.8-1c-1.5-0.7-2.8-1.6-3.9-2.9c-1.1-1.2-2-2.7-2.6-4.4s-0.9-3.6-0.9-5.7
|
|
709
|
+
c0-2,0.3-3.9,0.9-5.6c0.6-1.7,1.5-3.2,2.6-4.5c1.1-1.2,2.4-2.2,3.9-2.9c1.5-0.7,3.1-1.1,4.8-1.1c1.7,0,3.3,0.3,4.8,1
|
|
710
|
+
c1.5,0.7,2.8,1.6,3.9,2.9c1.1,1.2,2,2.7,2.6,4.5c0.6,1.7,0.9,3.6,0.9,5.6C135.8,45.8,135.4,47.7,134.8,49.5z"/>
|
|
711
|
+
<path class="st8" d="M88.2,20.4L77,56.8L64.4,20.4H52.1l18.4,46.6c-0.1,0.9-0.2,1.7-0.4,2.6c-0.1,0.4-0.2,0.7-0.3,1.1c0,0,0,0,0,0
|
|
712
|
+
c-0.5,1.2-1,2.4-1.7,3.3c-0.1,0.1-0.1,0.2-0.2,0.3c0,0.1-0.1,0.1-0.2,0.2c-0.8,1-1.8,1.9-3,2.7c0.7,1.7,1.4,3.3,2.2,5.4l1.8,4.7
|
|
713
|
+
c0.3-0.1,0.6-0.3,0.9-0.4c0.3-0.2,0.6-0.3,0.9-0.4c0.2-0.1,0.4-0.2,0.5-0.3c1.3-0.7,2.3-1.4,3.4-2.3c0,0,0.1-0.1,0.1-0.1
|
|
714
|
+
c0.1-0.1,0.3-0.2,0.4-0.4c1.2-1.1,2.2-2.1,3-3.2c1.4-1.8,2.5-3.7,3.3-5.9c0.7-1.8,1.2-3.7,1.4-5.6c0-0.3,0.1-0.6,0.2-1l16.6-47.3
|
|
715
|
+
H88.2z"/>
|
|
716
|
+
<path class="st8" d="M161.3,62.6c-0.3-0.8-0.8-1.6-1.4-2.2c-0.6-0.6-1.3-1.1-2.2-1.5c-0.9-0.4-1.8-0.6-2.9-0.6
|
|
717
|
+
c-1.1,0-2.1,0.2-2.9,0.6c-0.9,0.4-1.6,0.9-2.2,1.5c-0.6,0.6-1.1,1.4-1.4,2.2c-0.3,0.8-0.5,1.7-0.5,2.6c0,0.9,0.2,1.8,0.5,2.6
|
|
718
|
+
c0.3,0.8,0.8,1.6,1.4,2.2c0.6,0.6,1.3,1.1,2.2,1.5c0.9,0.4,1.8,0.6,2.9,0.6c1.1,0,2.1-0.2,2.9-0.6c0.9-0.4,1.6-0.9,2.2-1.5
|
|
719
|
+
c0.6-0.6,1.1-1.4,1.4-2.2c0.3-0.8,0.5-1.7,0.5-2.6C161.7,64.3,161.6,63.4,161.3,62.6z"/>
|
|
720
|
+
</g>
|
|
721
|
+
</g>
|
|
722
|
+
</svg>
|
|
723
|
+
`;
|
|
724
|
+
function Ue(e) {
|
|
725
|
+
const n = {
|
|
726
|
+
accessToken: !1,
|
|
727
|
+
liveEdit: !1,
|
|
728
|
+
fallbackComponent: null,
|
|
729
|
+
componentsDir: "src/components/flyo",
|
|
730
|
+
serverCacheHeaderTtl: 1200,
|
|
731
|
+
// 20 minutes
|
|
732
|
+
clientCacheHeaderTtl: 900,
|
|
733
|
+
// 15 minutes
|
|
734
|
+
...e
|
|
735
|
+
};
|
|
736
|
+
return n.liveEdit === "true" ? n.liveEdit = !0 : n.liveEdit === "false" && (n.liveEdit = !1), {
|
|
737
|
+
name: "@flyo/nitro-astro",
|
|
738
|
+
hooks: {
|
|
739
|
+
"astro:config:setup": ({
|
|
740
|
+
injectScript: t,
|
|
741
|
+
updateConfig: i,
|
|
742
|
+
injectRoute: r,
|
|
743
|
+
addMiddleware: o,
|
|
744
|
+
addDevToolbarApp: a
|
|
745
|
+
}) => {
|
|
746
|
+
a({
|
|
747
|
+
id: "flyo-nitro",
|
|
748
|
+
name: "Flyo Nitro",
|
|
749
|
+
//icon: 'lightbulb',
|
|
750
|
+
icon: Ee,
|
|
751
|
+
//icon: '<svg width="200" height="200" viewBox="0 0 200 200" xmlns="http://www.w3.org/2000/svg"><ellipse cx="100" cy="60" rx="90" ry="50" fill="#F4A460" /><circle cx="70" cy="45" r="5" fill="white" /><circle cx="90" cy="30" r="5" fill="white" /><circle cx="110" cy="45" r="5" fill="white" /><circle cx="130" cy="30" r="5" fill="white" /><circle cx="150" cy="45" r="5" fill="white" /><path d="M30 90 Q60 75, 90 90 T150 90 Q160 80, 180 90" fill="#228B22" /><rect x="30" y="90" width="140" height="15" fill="#FF6347" /><rect x="30" y="105" width="140" height="15" fill="#FFD700" /><rect x="30" y="120" width="140" height="25" fill="#8B4513" /><ellipse cx="100" cy="160" rx="90" ry="30" fill="#F4A460" /></svg>',
|
|
752
|
+
entrypoint: "@flyo/nitro-astro/toolbar.ts"
|
|
753
|
+
}), r({
|
|
754
|
+
pattern: "sitemap.xml",
|
|
755
|
+
entrypoint: "@flyo/nitro-astro/sitemap.ts"
|
|
756
|
+
}), o({
|
|
757
|
+
entrypoint: "@flyo/nitro-astro/middleware.ts",
|
|
758
|
+
order: "post"
|
|
759
|
+
}), i({
|
|
760
|
+
image: {
|
|
761
|
+
service: {
|
|
762
|
+
entrypoint: "@flyo/nitro-astro/cdn.ts"
|
|
763
|
+
}
|
|
764
|
+
},
|
|
765
|
+
vite: {
|
|
766
|
+
plugins: [
|
|
767
|
+
be(
|
|
768
|
+
e.componentsDir,
|
|
769
|
+
e.components || {},
|
|
770
|
+
e.fallbackComponent
|
|
771
|
+
)
|
|
772
|
+
]
|
|
773
|
+
}
|
|
774
|
+
}), t(
|
|
775
|
+
"page-ssr",
|
|
776
|
+
`
|
|
777
|
+
import { Configuration } from '@flyo/nitro-typescript'
|
|
778
|
+
|
|
779
|
+
var defaultConfig = new Configuration({
|
|
780
|
+
apiKey: '${n.accessToken}'
|
|
781
|
+
})
|
|
782
|
+
|
|
783
|
+
globalThis.flyoNitroInstance = {
|
|
784
|
+
config: defaultConfig,
|
|
785
|
+
options: {
|
|
786
|
+
liveEdit: ${n.liveEdit},
|
|
787
|
+
componentsDir: '${n.componentsDir}',
|
|
788
|
+
clientCacheHeaderTtl: ${n.clientCacheHeaderTtl},
|
|
789
|
+
serverCacheHeaderTtl: ${n.serverCacheHeaderTtl}
|
|
790
|
+
}
|
|
791
|
+
};
|
|
792
|
+
`
|
|
793
|
+
), n.liveEdit && t(
|
|
794
|
+
"page",
|
|
795
|
+
`
|
|
796
|
+
window.addEventListener("message", (event) => {
|
|
797
|
+
if (event.data?.action === 'pageRefresh') {
|
|
798
|
+
window.location.reload(true);
|
|
799
|
+
}
|
|
800
|
+
})
|
|
801
|
+
|
|
802
|
+
function getActualWindow() {
|
|
803
|
+
if (window === window.top) {
|
|
804
|
+
return window;
|
|
805
|
+
} else if (window.parent) {
|
|
806
|
+
return window.parent;
|
|
807
|
+
}
|
|
808
|
+
return window;
|
|
809
|
+
}
|
|
810
|
+
|
|
811
|
+
window.openBlockInFlyo = function(blockUid) {
|
|
812
|
+
getActualWindow().postMessage({
|
|
813
|
+
action: 'openEdit',
|
|
814
|
+
data: JSON.parse(JSON.stringify({item:{uid: blockUid}}))
|
|
815
|
+
}, 'https://flyo.cloud')
|
|
816
|
+
}
|
|
817
|
+
|
|
818
|
+
// Find all elements with the 'data-flyo-block-uid' attribute
|
|
819
|
+
const elements = document.querySelectorAll('[data-flyo-block-uid]');
|
|
820
|
+
|
|
821
|
+
elements.forEach(element => {
|
|
822
|
+
element.addEventListener('click', function() {
|
|
823
|
+
openBlockInFlyo(this.getAttribute('data-flyo-block-uid'))
|
|
824
|
+
});
|
|
825
|
+
});
|
|
826
|
+
`
|
|
827
|
+
);
|
|
828
|
+
}
|
|
829
|
+
}
|
|
830
|
+
};
|
|
831
|
+
}
|
|
832
|
+
export {
|
|
833
|
+
Ue as default,
|
|
834
|
+
Se as editableBlock,
|
|
835
|
+
qe as useConfig,
|
|
836
|
+
Re as useConfigApi,
|
|
837
|
+
f as useConfiguration,
|
|
838
|
+
Ae as useEntitiesApi,
|
|
839
|
+
Ce as useFlyoIntegration,
|
|
840
|
+
Ie as usePagesApi,
|
|
841
|
+
ke as useSearchApi,
|
|
842
|
+
Te as useSitemapApi,
|
|
843
|
+
xe as useVersionApi
|
|
844
|
+
};
|