@strifeapp/astro 1.0.25 → 1.0.27

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.
Files changed (2) hide show
  1. package/dist/index.js +25 -23
  2. package/package.json +3 -3
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(t) {
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, IndexCreation } from "ravendb";
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(t.certificate)}, 'base64'),
281
- password: ${d(t.password)},
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(t.urls ? t.urls : [])},
286
- ${d(t.database || "")},
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
- ${(t.collections || ["Posts"]).map((e) => `this.map("${typeof e == "string" ? e : e.name}", (doc) => { return mapDocument(doc) });`).join(`
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 = t.collections) == null ? void 0 : o.map((e) => `
311
- await bulkInsert.store(${JSON.stringify(e)}, 'templates/${e.name}', { '@collection': 'Templates' });
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(t, s) {
326
- let o = process.env.STRIFE_DATABASE_URLS, e = process.env.STRIFE_DATABASE, r = process.env.STRIFE_CERTIFICATE, l = process.env.STRIFE_CERTIFICATE_PASSWORD;
327
- if (!o || !e || !r || !l) {
328
- const n = f(t, s ?? "", "");
329
- o = o || n.STRIFE_DATABASE_URLS, e = e || n.STRIFE_DATABASE, r = r || n.STRIFE_CERTIFICATE, l = l || n.STRIFE_CERTIFICATE_PASSWORD;
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: ${e || "[NOT SET]"}`), console.log(` STRIFE_CERTIFICATE: ${r ? `[SET, length=${r.length}]` : "[NOT SET]"}`), console.log(` STRIFE_CERTIFICATE_PASSWORD: ${l ? "[SET]" : "[NOT SET]"}`), {
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: e || void 0,
335
+ database: t || void 0,
334
336
  certificate: r || void 0,
335
337
  password: l || void 0
336
338
  };
337
339
  }
338
- function v(t) {
340
+ function v(e) {
339
341
  return {
340
342
  name: "@strife/astro",
341
343
  hooks: {
342
- "astro:config:setup": ({ command: s, config: o, updateConfig: e }) => {
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
- ...t ? Object.fromEntries(
349
- Object.entries(t).filter(([a, i]) => !!i)
350
+ ...e ? Object.fromEntries(
351
+ Object.entries(e).filter(([a, i]) => !!i)
350
352
  ) : {}
351
- }, c = ["urls", "database", "certificate", "password"], u = c.filter(
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
- e({
364
+ t({
363
365
  vite: {
364
366
  plugins: [
365
367
  h(n)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@strifeapp/astro",
3
- "version": "1.0.25",
3
+ "version": "1.0.27",
4
4
  "description": "Official Strife Astro integration",
5
5
  "keywords": [
6
6
  "astro-integration",
@@ -30,7 +30,7 @@
30
30
  "dependencies": {
31
31
  "astro": "^4.0.0 || ^5.0.0",
32
32
  "dotenv": "^16.4.5",
33
- "ravendb": "^6.0.0",
33
+ "ravendb": "^5.4.3",
34
34
  "serialize-javascript": "^6.0.2"
35
35
  },
36
36
  "devDependencies": {
@@ -42,7 +42,7 @@
42
42
  },
43
43
  "peerDependencies": {
44
44
  "astro": "^4.0.0 || ^5.0.0",
45
- "ravendb": "^6.0.0"
45
+ "ravendb": "^5.4.3"
46
46
  },
47
47
  "compilerOptions": {
48
48
  "declaration": true,