@strifeapp/astro 1.0.25 → 1.0.26
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/dist/index.js +25 -23
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -262,7 +262,7 @@ function storeAs(name, value) {
|
|
|
262
262
|
|
|
263
263
|
return result;
|
|
264
264
|
}`, m = "strife:store", p = "\0" + m;
|
|
265
|
-
function h(
|
|
265
|
+
function h(e) {
|
|
266
266
|
return {
|
|
267
267
|
name: "strife:store",
|
|
268
268
|
resolveId(s) {
|
|
@@ -273,18 +273,20 @@ function h(t) {
|
|
|
273
273
|
var o;
|
|
274
274
|
if (s === p)
|
|
275
275
|
return `
|
|
276
|
-
import { DocumentStore, AbstractJavaScriptMultiMapIndexCreationTask
|
|
276
|
+
import { DocumentStore, AbstractJavaScriptMultiMapIndexCreationTask } from "ravendb";
|
|
277
277
|
|
|
278
|
+
${e.certificate && e.password ? `
|
|
278
279
|
const authOptions = {
|
|
279
280
|
type: 'pfx',
|
|
280
|
-
certificate: Buffer.from(${d(
|
|
281
|
-
password: ${d(
|
|
281
|
+
certificate: Buffer.from(${d(e.certificate)}, 'base64'),
|
|
282
|
+
password: ${d(e.password)},
|
|
282
283
|
};
|
|
284
|
+
` : ""}
|
|
283
285
|
|
|
284
286
|
const store = new DocumentStore(
|
|
285
|
-
${d(
|
|
286
|
-
${d(
|
|
287
|
-
authOptions
|
|
287
|
+
${d(e.urls ? e.urls : [])},
|
|
288
|
+
${d(e.database || "")}${e.certificate && e.password ? `,
|
|
289
|
+
authOptions` : ""}
|
|
288
290
|
).initialize()
|
|
289
291
|
|
|
290
292
|
class Content_ByUrl extends AbstractJavaScriptMultiMapIndexCreationTask {
|
|
@@ -293,7 +295,7 @@ function h(t) {
|
|
|
293
295
|
|
|
294
296
|
this.additionalSources = {"Helper": ${d(y)}}
|
|
295
297
|
|
|
296
|
-
${(
|
|
298
|
+
${(e.collections || ["Posts"]).map((t) => `this.map("${typeof t == "string" ? t : t.name}", (doc) => { return mapDocument(doc) });`).join(`
|
|
297
299
|
`)}
|
|
298
300
|
|
|
299
301
|
this.deploymentMode = 'Rolling';
|
|
@@ -307,8 +309,8 @@ function h(t) {
|
|
|
307
309
|
|
|
308
310
|
const bulkInsert = store.bulkInsert();
|
|
309
311
|
|
|
310
|
-
${(o =
|
|
311
|
-
await bulkInsert.store(${JSON.stringify(
|
|
312
|
+
${(o = e.collections) == null ? void 0 : o.map((t) => `
|
|
313
|
+
await bulkInsert.store(${JSON.stringify(t)}, 'templates/${t.name}', { '@collection': 'Templates' });
|
|
312
314
|
`).join(`
|
|
313
315
|
`)}
|
|
314
316
|
|
|
@@ -322,33 +324,33 @@ function h(t) {
|
|
|
322
324
|
const T = {
|
|
323
325
|
type: "pfx"
|
|
324
326
|
};
|
|
325
|
-
function R(
|
|
326
|
-
let o = process.env.STRIFE_DATABASE_URLS,
|
|
327
|
-
if (!o || !
|
|
328
|
-
const n = f(
|
|
329
|
-
o = o || n.STRIFE_DATABASE_URLS,
|
|
327
|
+
function R(e, s) {
|
|
328
|
+
let o = process.env.STRIFE_DATABASE_URLS, t = process.env.STRIFE_DATABASE, r = process.env.STRIFE_CERTIFICATE, l = process.env.STRIFE_CERTIFICATE_PASSWORD;
|
|
329
|
+
if (!o || !t || !r || !l) {
|
|
330
|
+
const n = f(e, s ?? "", "");
|
|
331
|
+
o = o || n.STRIFE_DATABASE_URLS, t = t || n.STRIFE_DATABASE, r = r || n.STRIFE_CERTIFICATE, l = l || n.STRIFE_CERTIFICATE_PASSWORD;
|
|
330
332
|
}
|
|
331
|
-
return console.log("[strifeIntegration] Loaded environment variables:"), console.log(` STRIFE_DATABASE_URLS: ${o ? "[SET]" : "[NOT SET]"}`), console.log(` STRIFE_DATABASE: ${
|
|
333
|
+
return console.log("[strifeIntegration] Loaded environment variables:"), console.log(` STRIFE_DATABASE_URLS: ${o ? "[SET]" : "[NOT SET]"}`), console.log(` STRIFE_DATABASE: ${t || "[NOT SET]"}`), console.log(` STRIFE_CERTIFICATE: ${r ? `[SET, length=${r.length}]` : "[NOT SET]"}`), console.log(` STRIFE_CERTIFICATE_PASSWORD: ${l ? "[SET]" : "[NOT SET]"}`), {
|
|
332
334
|
urls: o ? o.split(",").map((n) => n.trim()).filter(Boolean) : void 0,
|
|
333
|
-
database:
|
|
335
|
+
database: t || void 0,
|
|
334
336
|
certificate: r || void 0,
|
|
335
337
|
password: l || void 0
|
|
336
338
|
};
|
|
337
339
|
}
|
|
338
|
-
function v(
|
|
340
|
+
function v(e) {
|
|
339
341
|
return {
|
|
340
342
|
name: "@strife/astro",
|
|
341
343
|
hooks: {
|
|
342
|
-
"astro:config:setup": ({ command: s, config: o, updateConfig:
|
|
344
|
+
"astro:config:setup": ({ command: s, config: o, updateConfig: t }) => {
|
|
343
345
|
const r = o.vite.envDir || process.cwd(), l = R(s, r), n = {
|
|
344
346
|
...T,
|
|
345
347
|
...Object.fromEntries(
|
|
346
348
|
Object.entries(l).filter(([a, i]) => !!i)
|
|
347
349
|
),
|
|
348
|
-
...
|
|
349
|
-
Object.entries(
|
|
350
|
+
...e ? Object.fromEntries(
|
|
351
|
+
Object.entries(e).filter(([a, i]) => !!i)
|
|
350
352
|
) : {}
|
|
351
|
-
}, c = ["urls", "database"
|
|
353
|
+
}, c = ["urls", "database"], u = c.filter(
|
|
352
354
|
(a) => !n[a] || Array.isArray(n[a]) && n[a].length === 0
|
|
353
355
|
);
|
|
354
356
|
if (u.length > 0)
|
|
@@ -359,7 +361,7 @@ Current values:
|
|
|
359
361
|
` + c.map((a) => ` ${a}: ${JSON.stringify(n[a])}`).join(`
|
|
360
362
|
`)
|
|
361
363
|
);
|
|
362
|
-
|
|
364
|
+
t({
|
|
363
365
|
vite: {
|
|
364
366
|
plugins: [
|
|
365
367
|
h(n)
|