@dpuse/dpuse-development 1.0.134 → 1.0.135

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.
@@ -79,11 +79,11 @@ function te(e, t) {
79
79
  return Object.prototype.hasOwnProperty.call(e, t) && t !== "__proto__" && t !== "prototype" && t !== "constructor";
80
80
  }
81
81
  /* @__NO_SIDE_EFFECTS__ */
82
- function p(e, t) {
82
+ function ne(e, t) {
83
83
  let n = [...new Set(e)];
84
84
  return n.length > 1 ? `(${n.join(` ${t} `)})` : n[0] ?? "never";
85
85
  }
86
- function m(e) {
86
+ function p(e) {
87
87
  return e["~standard"] = {
88
88
  version: 1,
89
89
  vendor: "valibot",
@@ -91,7 +91,22 @@ function m(e) {
91
91
  }, e;
92
92
  }
93
93
  /* @__NO_SIDE_EFFECTS__ */
94
- function ne(e, t, n) {
94
+ function m(e, t) {
95
+ return {
96
+ kind: "validation",
97
+ type: "min_length",
98
+ reference: m,
99
+ async: !1,
100
+ expects: `>=${e}`,
101
+ requirement: e,
102
+ message: t,
103
+ "~run"(e, t) {
104
+ return e.typed && e.value.length < this.requirement && f(this, "length", e, t, { received: `${e.value.length}` }), e;
105
+ }
106
+ };
107
+ }
108
+ /* @__NO_SIDE_EFFECTS__ */
109
+ function re(e, t, n) {
95
110
  return typeof e.fallback == "function" ? e.fallback(t, n) : e.fallback;
96
111
  }
97
112
  /* @__NO_SIDE_EFFECTS__ */
@@ -100,7 +115,7 @@ function h(e, t, n) {
100
115
  }
101
116
  /* @__NO_SIDE_EFFECTS__ */
102
117
  function g(e, t) {
103
- return m({
118
+ return p({
104
119
  kind: "schema",
105
120
  type: "array",
106
121
  reference: g,
@@ -137,7 +152,7 @@ function g(e, t) {
137
152
  }
138
153
  /* @__NO_SIDE_EFFECTS__ */
139
154
  function _(e) {
140
- return m({
155
+ return p({
141
156
  kind: "schema",
142
157
  type: "boolean",
143
158
  reference: _,
@@ -151,7 +166,7 @@ function _(e) {
151
166
  }
152
167
  /* @__NO_SIDE_EFFECTS__ */
153
168
  function v(e, t) {
154
- return m({
169
+ return p({
155
170
  kind: "schema",
156
171
  type: "literal",
157
172
  reference: v,
@@ -166,7 +181,7 @@ function v(e, t) {
166
181
  }
167
182
  /* @__NO_SIDE_EFFECTS__ */
168
183
  function y(e, t) {
169
- return m({
184
+ return p({
170
185
  kind: "schema",
171
186
  type: "nullable",
172
187
  reference: y,
@@ -181,7 +196,7 @@ function y(e, t) {
181
196
  }
182
197
  /* @__NO_SIDE_EFFECTS__ */
183
198
  function b(e) {
184
- return m({
199
+ return p({
185
200
  kind: "schema",
186
201
  type: "number",
187
202
  reference: b,
@@ -195,7 +210,7 @@ function b(e) {
195
210
  }
196
211
  /* @__NO_SIDE_EFFECTS__ */
197
212
  function x(e, t) {
198
- return m({
213
+ return p({
199
214
  kind: "schema",
200
215
  type: "optional",
201
216
  reference: x,
@@ -210,7 +225,7 @@ function x(e, t) {
210
225
  }
211
226
  /* @__NO_SIDE_EFFECTS__ */
212
227
  function S(e, t, n) {
213
- return m({
228
+ return p({
214
229
  kind: "schema",
215
230
  type: "record",
216
231
  reference: S,
@@ -263,7 +278,7 @@ function S(e, t, n) {
263
278
  }
264
279
  /* @__NO_SIDE_EFFECTS__ */
265
280
  function C(e, t) {
266
- return m({
281
+ return p({
267
282
  kind: "schema",
268
283
  type: "strict_object",
269
284
  reference: C,
@@ -294,7 +309,7 @@ function C(e, t) {
294
309
  }
295
310
  }
296
311
  o.typed || (e.typed = !1), e.value[r] = o.value;
297
- } else if (i.fallback !== void 0) e.value[r] = /* @__PURE__ */ ne(i);
312
+ } else if (i.fallback !== void 0) e.value[r] = /* @__PURE__ */ re(i);
298
313
  else if (i.type !== "exact_optional" && i.type !== "optional" && i.type !== "nullish" && (f(this, "key", e, t, {
299
314
  input: void 0,
300
315
  expected: `"${r}"`,
@@ -330,7 +345,7 @@ function C(e, t) {
330
345
  }
331
346
  /* @__NO_SIDE_EFFECTS__ */
332
347
  function w(e) {
333
- return m({
348
+ return p({
334
349
  kind: "schema",
335
350
  type: "string",
336
351
  reference: w,
@@ -351,11 +366,11 @@ function T(e) {
351
366
  }
352
367
  /* @__NO_SIDE_EFFECTS__ */
353
368
  function E(e, t) {
354
- return m({
369
+ return p({
355
370
  kind: "schema",
356
371
  type: "union",
357
372
  reference: E,
358
- expects: /* @__PURE__ */ p(e.map((e) => e.expects), "|"),
373
+ expects: /* @__PURE__ */ ne(e.map((e) => e.expects), "|"),
359
374
  async: !1,
360
375
  options: e,
361
376
  message: t,
@@ -381,10 +396,27 @@ function E(e, t) {
381
396
  }
382
397
  });
383
398
  }
399
+ /* @__NO_SIDE_EFFECTS__ */
400
+ function ie(...e) {
401
+ return p({
402
+ ...e[0],
403
+ pipe: e,
404
+ "~run"(t, n) {
405
+ for (let r of e) if (r.kind !== "metadata") {
406
+ if (t.issues && (r.kind === "schema" || r.kind === "transformation")) {
407
+ t.typed = !1;
408
+ break;
409
+ }
410
+ (!t.issues || !n.abortEarly && !n.abortPipeEarly) && (t = r["~run"](t, n));
411
+ }
412
+ return t;
413
+ }
414
+ });
415
+ }
384
416
  var D = /* @__PURE__ */ C({
385
417
  en: /* @__PURE__ */ w(),
386
418
  es: /* @__PURE__ */ w()
387
- }), re = {
419
+ }), O = {
388
420
  id: /* @__PURE__ */ w(),
389
421
  label: /* @__PURE__ */ C({
390
422
  en: /* @__PURE__ */ x(/* @__PURE__ */ w()),
@@ -396,7 +428,7 @@ var D = /* @__PURE__ */ C({
396
428
  }),
397
429
  icon: /* @__PURE__ */ y(/* @__PURE__ */ w()),
398
430
  iconDark: /* @__PURE__ */ y(/* @__PURE__ */ w())
399
- }, O = (e) => /* @__PURE__ */ E(e.map((e) => /* @__PURE__ */ v(e))), ie = O([
431
+ }, k = (e) => /* @__PURE__ */ E(e.map((e) => /* @__PURE__ */ v(e))), ae = k([
400
432
  "app",
401
433
  "connector",
402
434
  "connectorConnection",
@@ -418,33 +450,33 @@ var D = /* @__PURE__ */ C({
418
450
  "presenter",
419
451
  "presenterPresentation",
420
452
  "tool"
421
- ]), ae = O([
453
+ ]), oe = k([
422
454
  "danger",
423
455
  "success",
424
456
  "warning"
425
- ]), oe = O([
457
+ ]), se = k([
426
458
  "alpha",
427
459
  "beta",
428
460
  "releaseCandidate",
429
461
  "generalAvailability"
430
- ]), se = /* @__PURE__ */ C({
431
- color: ae,
462
+ ]), ce = /* @__PURE__ */ C({
463
+ color: oe,
432
464
  label: /* @__PURE__ */ w()
433
- }), k = {
434
- ...re,
435
- typeId: ie
436
- }, ce = /* @__PURE__ */ C({
437
- ...k,
465
+ }), A = {
466
+ ...O,
467
+ typeId: ae
468
+ }, le = /* @__PURE__ */ C({
469
+ ...A,
438
470
  order: /* @__PURE__ */ b(),
439
471
  path: /* @__PURE__ */ w()
440
- }), A = {
441
- ...k,
472
+ }), j = {
473
+ ...A,
442
474
  firstCreatedAt: /* @__PURE__ */ y(/* @__PURE__ */ b()),
443
475
  lastUpdatedAt: /* @__PURE__ */ y(/* @__PURE__ */ b()),
444
- status: /* @__PURE__ */ y(se),
445
- statusId: /* @__PURE__ */ y(oe)
476
+ status: /* @__PURE__ */ y(ce),
477
+ statusId: /* @__PURE__ */ y(se)
446
478
  };
447
- ({ ...A }), c({ en: "Arrow" }), c({ en: "Avro" }), c({ en: "Delimited text (CSV, TSV…)" }), c({ en: "JSON" }), c({ en: "JSON Lines (JSONL)" }), c({ en: "Markdown (MD)" }), c({ en: "OpenDocument spreadsheet (ODS)" }), c({ en: "Parquet" }), c({ en: "SPSS (SAV)" }), c({ en: "SQLite" }), c({ en: "Excel (XLSX, XLSM)" }), c({ en: "XML" }), c({ en: "Newline" }), c({ en: "Carriage Return" }), c({ en: "Carriage Return/Newline" }), c({ en: "Colon" }), c({ en: "Comma" }), c({ en: "Exclamation Mark" }), c({ en: "Record Separator" }), c({ en: "Semicolon" }), c({ en: "Space" }), c({ en: "Tab" }), c({ en: "Underscore" }), c({ en: "Unit Separator" }), c({ en: "Vertical Bar" }), O([
479
+ ({ ...j }), c({ en: "Arrow" }), c({ en: "Avro" }), c({ en: "Delimited text (CSV, TSV…)" }), c({ en: "JSON" }), c({ en: "JSON Lines (JSONL)" }), c({ en: "Markdown (MD)" }), c({ en: "OpenDocument spreadsheet (ODS)" }), c({ en: "Parquet" }), c({ en: "SPSS (SAV)" }), c({ en: "SQLite" }), c({ en: "Excel (XLSX, XLSM)" }), c({ en: "XML" }), c({ en: "Newline" }), c({ en: "Carriage Return" }), c({ en: "Carriage Return/Newline" }), c({ en: "Colon" }), c({ en: "Comma" }), c({ en: "Exclamation Mark" }), c({ en: "Record Separator" }), c({ en: "Semicolon" }), c({ en: "Space" }), c({ en: "Tab" }), c({ en: "Underscore" }), c({ en: "Unit Separator" }), c({ en: "Vertical Bar" }), k([
448
480
  "app",
449
481
  "engine",
450
482
  "connector",
@@ -452,15 +484,15 @@ var D = /* @__PURE__ */ C({
452
484
  "presenter",
453
485
  "tool"
454
486
  ]);
455
- var j = {
456
- ...A,
487
+ var M = {
488
+ ...j,
457
489
  vendorAccountURL: /* @__PURE__ */ y(/* @__PURE__ */ w()),
458
490
  vendorDocumentationURL: /* @__PURE__ */ y(/* @__PURE__ */ w()),
459
491
  vendorHomeURL: /* @__PURE__ */ y(/* @__PURE__ */ w()),
460
492
  version: /* @__PURE__ */ w()
461
493
  };
462
- ({ ...j });
463
- var le = O([
494
+ ({ ...M });
495
+ var ue = k([
464
496
  "abortOperation",
465
497
  "auditObjectContent",
466
498
  "createObject",
@@ -476,22 +508,22 @@ var le = O([
476
508
  "retrieveChunks",
477
509
  "retrieveRecords",
478
510
  "upsertRecords"
479
- ]), ue = O([
511
+ ]), de = k([
480
512
  "application",
481
513
  "curatedDataset",
482
514
  "database",
483
515
  "fileStore"
484
- ]), de = /* @__PURE__ */ C({ label: D }), fe = O([
516
+ ]), fe = /* @__PURE__ */ C({ label: D }), pe = k([
485
517
  "apiEndpoint",
486
518
  "file",
487
519
  "table"
488
- ]), pe = O([
520
+ ]), me = k([
489
521
  "bidirectional",
490
522
  "destination",
491
523
  "source",
492
524
  "unknown"
493
- ]), me = /* @__PURE__ */ C({ label: D }), he = /* @__PURE__ */ C({
494
- authMethodId: O([
525
+ ]), he = /* @__PURE__ */ C({ label: D }), ge = /* @__PURE__ */ C({
526
+ authMethodId: k([
495
527
  "apiKey",
496
528
  "disabled",
497
529
  "oAuth2",
@@ -503,17 +535,17 @@ var le = O([
503
535
  label: /* @__PURE__ */ x(D),
504
536
  maxConnectionCount: /* @__PURE__ */ y(/* @__PURE__ */ b()),
505
537
  params: /* @__PURE__ */ x(/* @__PURE__ */ g(/* @__PURE__ */ S(/* @__PURE__ */ w(), /* @__PURE__ */ w())))
506
- }), ge = /* @__PURE__ */ C({
507
- ...j,
538
+ }), _e = /* @__PURE__ */ C({
539
+ ...M,
508
540
  typeId: /* @__PURE__ */ v("connector"),
509
- actionNames: /* @__PURE__ */ g(le),
510
- category: /* @__PURE__ */ y(de),
511
- categoryId: ue,
512
- implementations: /* @__PURE__ */ S(/* @__PURE__ */ w(), he),
513
- itemTypeId: fe,
514
- usage: /* @__PURE__ */ y(me),
515
- usageId: /* @__PURE__ */ y(pe)
516
- }), M = {
541
+ actionNames: /* @__PURE__ */ g(ue),
542
+ category: /* @__PURE__ */ y(fe),
543
+ categoryId: de,
544
+ implementations: /* @__PURE__ */ S(/* @__PURE__ */ w(), ge),
545
+ itemTypeId: pe,
546
+ usage: /* @__PURE__ */ y(he),
547
+ usageId: /* @__PURE__ */ y(me)
548
+ }), N = {
517
549
  abortOperation: "Abort Operation",
518
550
  auditObjectContent: "Audit Object Content",
519
551
  createObject: "Create Object",
@@ -529,12 +561,12 @@ var le = O([
529
561
  retrieveChunks: "Retrieve Chunks",
530
562
  retrieveRecords: "Retrieve Records",
531
563
  upsertRecords: "Upsert Records"
532
- }, N = /* @__PURE__ */ new Set([
564
+ }, P = /* @__PURE__ */ new Set([
533
565
  "createObject",
534
566
  "dropObject",
535
567
  "removeRecords",
536
568
  "upsertRecords"
537
- ]), P = /* @__PURE__ */ new Set([
569
+ ]), F = /* @__PURE__ */ new Set([
538
570
  "auditObjectContent",
539
571
  "findObject",
540
572
  "getInfo",
@@ -545,29 +577,28 @@ var le = O([
545
577
  "retrieveChunks",
546
578
  "retrieveRecords"
547
579
  ]);
548
- function F(e) {
580
+ function I(e) {
549
581
  let t = !1, n = !1;
550
- for (let r of e) P.has(r) && (t = !0), N.has(r) && (n = !0);
582
+ for (let r of e) F.has(r) && (t = !0), P.has(r) && (n = !0);
551
583
  return t && n ? "bidirectional" : t ? "source" : n ? "destination" : "unknown";
552
584
  }
553
- function I(e) {
585
+ function ve(e) {
554
586
  let t = new Set(e), n = "|Action|Supported|\n";
555
587
  n += "|:----|:-------:|\n";
556
- for (let e of Object.keys(M)) n += `| ${M[e]} | ${t.has(e) ? "✓" : ""} |\n`;
588
+ for (let e of Object.keys(N)) n += `| ${N[e]} | ${t.has(e) ? "✓" : ""} |\n`;
557
589
  return n;
558
590
  }
559
- O(["list"]), { ...j };
560
- var L = O([
591
+ k(["list"]), { ...M };
592
+ var ye = k([
561
593
  "list",
562
594
  "render",
563
595
  "setColorMode"
564
- ]), _e = /* @__PURE__ */ C({
565
- ...j,
596
+ ]), be = /* @__PURE__ */ C({
597
+ ...M,
566
598
  typeId: /* @__PURE__ */ v("presenter"),
567
- actionNames: /* @__PURE__ */ g(L),
568
- presentations: /* @__PURE__ */ g(ce)
569
- });
570
- O([
599
+ actionNames: /* @__PURE__ */ g(ye),
600
+ presentations: /* @__PURE__ */ g(le)
601
+ }), xe = /* @__PURE__ */ C({ dataFormatIds: /* @__PURE__ */ ie(/* @__PURE__ */ g(k([
571
602
  "arrow",
572
603
  "avro",
573
604
  "dtv",
@@ -580,8 +611,12 @@ O([
580
611
  "sqlite",
581
612
  "xlsx",
582
613
  "xml"
583
- ]), { ...j };
584
- var R = /* @__PURE__ */ new Map([
614
+ ])), /* @__PURE__ */ m(1)) }), Se = /* @__PURE__ */ g(/* @__PURE__ */ w()), Ce = /* @__PURE__ */ C({
615
+ ...M,
616
+ typeId: /* @__PURE__ */ v("tool"),
617
+ actionNames: /* @__PURE__ */ x(Se),
618
+ parser: /* @__PURE__ */ x(xe)
619
+ }), L = /* @__PURE__ */ new Map([
585
620
  ["arrow", "application/vnd.apache.arrow.file"],
586
621
  ["avro", "application/vnd.apache.avro"],
587
622
  ["bin", "application/octet-stream"],
@@ -603,24 +638,24 @@ var R = /* @__PURE__ */ new Map([
603
638
  ["xlsx", "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"],
604
639
  ["xml", "application/xml"]
605
640
  ]);
606
- function ve(e) {
641
+ function we(e) {
607
642
  if (!e) return;
608
- let t = xe(e);
643
+ let t = De(e);
609
644
  return t === void 0 ? void 0 : e.slice(t + 1);
610
645
  }
611
- function ye(e) {
612
- return e != null && R.has(e.toLowerCase());
646
+ function Te(e) {
647
+ return e != null && L.has(e.toLowerCase());
613
648
  }
614
- function be(e) {
615
- return (e == null ? void 0 : R.get(e.toLowerCase())) ?? "application/octet-stream";
649
+ function Ee(e) {
650
+ return (e == null ? void 0 : L.get(e.toLowerCase())) ?? "application/octet-stream";
616
651
  }
617
- function xe(e) {
652
+ function De(e) {
618
653
  let t = e.lastIndexOf("/") + 1, n = e.lastIndexOf(".");
619
654
  return n > t && n < e.length - 1 ? n : void 0;
620
655
  }
621
656
  //#endregion
622
657
  //#region src/utilities/index.ts
623
- var Se = /* @__PURE__ */ new Set(["@dpuse/dpuse-development", "@dpuse/eslint-config-dpuse"]), z = "code-health-reports/fallow", Ce = `${z}/badge.json`, we = `${z}/index.md`, B = "<!-- CONTRIBUTING_LICENSE_END -->", V = "<!-- CONTRIBUTING_LICENSE_START -->", Te = "<!-- GOVERNANCE_END -->", Ee = "<!-- GOVERNANCE_START -->", H = "<!-- QUALITY_SECURITY_END -->", U = "<!-- QUALITY_SECURITY_START -->", De = "rust/Cargo.toml", Oe = [
658
+ var Oe = /* @__PURE__ */ new Set(["@dpuse/dpuse-development", "@dpuse/eslint-config-dpuse"]), R = "code-health-reports/fallow", ke = `${R}/badge.json`, Ae = `${R}/index.md`, z = "<!-- CONTRIBUTING_LICENSE_END -->", B = "<!-- CONTRIBUTING_LICENSE_START -->", je = "<!-- GOVERNANCE_END -->", Me = "<!-- GOVERNANCE_START -->", V = "<!-- QUALITY_SECURITY_END -->", H = "<!-- QUALITY_SECURITY_START -->", Ne = "rust/Cargo.toml", Pe = [
624
659
  {
625
660
  idPrefix: "dpuse-app",
626
661
  typeId: "app",
@@ -705,9 +740,9 @@ var Se = /* @__PURE__ */ new Set(["@dpuse/dpuse-development", "@dpuse/eslint-con
705
740
  publishedTo: "github",
706
741
  uploadGroupName: void 0
707
742
  }
708
- ], ke = n(r);
709
- async function Ae(n, r) {
710
- n !== void 0 && X(`${n} - clear(${r})`);
743
+ ], Fe = n(r);
744
+ async function Ie(n, r) {
745
+ n !== void 0 && J(`${n} - clear(${r})`);
711
746
  let i;
712
747
  try {
713
748
  i = await e.readdir(r, { withFileTypes: !0 });
@@ -727,16 +762,16 @@ async function Ae(n, r) {
727
762
  }
728
763
  }));
729
764
  }
730
- async function je(t, n) {
765
+ async function Le(t, n) {
731
766
  return e.readdir(t, n);
732
767
  }
733
- async function Me(t, n, r, i) {
734
- t !== void 0 && X(`${t} - exec(${n} ${r.join(" ")})`);
735
- let { stdout: a, stderr: o } = await ke(n, r);
768
+ async function Re(t, n, r, i) {
769
+ t !== void 0 && J(`${t} - exec(${n} ${r.join(" ")})`);
770
+ let { stdout: a, stderr: o } = await Fe(n, r);
736
771
  i === void 0 ? a.trim() && console.log(a.trim()) : await e.writeFile(i, a.trim(), "utf-8"), o.trim() && console.error(o.trim());
737
772
  }
738
- async function Ne(e, t, n, r = !1, a = !1) {
739
- return X(`${e} - spawn(${t} ${n.join(" ")})`), new Promise((e, o) => {
773
+ async function ze(e, t, n, r = !1, a = !1) {
774
+ return J(`${e} - spawn(${t} ${n.join(" ")})`), new Promise((e, o) => {
740
775
  i(t, n, {
741
776
  shell: a,
742
777
  stdio: "inherit"
@@ -745,8 +780,8 @@ async function Ne(e, t, n, r = !1, a = !1) {
745
780
  });
746
781
  });
747
782
  }
748
- async function Pe(e, t, n) {
749
- return X(`${e} - spawn(${t} ${n.join(" ")})`), new Promise((e, r) => {
783
+ async function Be(e, t, n) {
784
+ return J(`${e} - spawn(${t} ${n.join(" ")})`), new Promise((e, r) => {
750
785
  let a = i(t, n, {
751
786
  shell: !1,
752
787
  stdio: [
@@ -762,8 +797,8 @@ async function Pe(e, t, n) {
762
797
  });
763
798
  });
764
799
  }
765
- async function Fe(n, r, a, o, s = !1) {
766
- return X(`${n} - spawn(${r} ${a.join(" ")}) > ${o}`), new Promise((n, c) => {
800
+ async function Ve(n, r, a, o, s = !1) {
801
+ return J(`${n} - spawn(${r} ${a.join(" ")}) > ${o}`), new Promise((n, c) => {
767
802
  let l = i(r, a, {
768
803
  shell: !1,
769
804
  stdio: [
@@ -785,19 +820,19 @@ async function Fe(n, r, a, o, s = !1) {
785
820
  });
786
821
  });
787
822
  }
788
- async function Ie() {
789
- let e = await G("./README.md"), t = e.indexOf(Ee), n = e.indexOf(Te);
823
+ async function He() {
824
+ let e = await W("./README.md"), t = e.indexOf(Me), n = e.indexOf(je);
790
825
  if (t === -1 || n === -1) return;
791
- let r = `${U}\n${H}\n\n${V}\n${B}`;
792
- await J("README.md", `${e.slice(0, t)}${r}${e.slice(n + 23)}`);
826
+ let r = `${H}\n${V}\n\n${B}\n${z}`;
827
+ await q("README.md", `${e.slice(0, t)}${r}${e.slice(n + 23)}`);
793
828
  }
794
- async function W(t) {
829
+ async function U(t) {
795
830
  return JSON.parse(await e.readFile(t, "utf-8"));
796
831
  }
797
- async function G(t) {
832
+ async function W(t) {
798
833
  return await e.readFile(t, "utf-8");
799
834
  }
800
- async function K(t) {
835
+ async function G(t) {
801
836
  try {
802
837
  return await e.readFile(t, "utf-8");
803
838
  } catch (e) {
@@ -805,36 +840,36 @@ async function K(t) {
805
840
  throw e;
806
841
  }
807
842
  }
808
- function Le(e) {
843
+ function Ue(e) {
809
844
  let t = e.slice(e.lastIndexOf("/") + 1);
810
845
  if (t === "LICENSE") return "text/plain";
811
- let n = ve(t);
812
- return ye(n) || console.warn(`⚠️ No content type for '${e}', so it is treated as 'application/octet-stream'. Add its extension to dpuse-shared.`), be(n);
846
+ let n = we(t);
847
+ return Te(n) || console.warn(`⚠️ No content type for '${e}', so it is treated as 'application/octet-stream'. Add its extension to dpuse-shared.`), Ee(n);
813
848
  }
814
- async function q(n, r) {
849
+ async function K(n, r) {
815
850
  await e.mkdir(t.dirname(n), { recursive: !0 }), await e.writeFile(n, `${JSON.stringify(r, void 0, 4)}\n`, "utf-8");
816
851
  }
817
- async function Re(e, t, n) {
818
- await J("README.md", Je(await G("./README.md"), e, t, n));
852
+ async function We(e, t, n) {
853
+ await q("README.md", et(await W("./README.md"), e, t, n));
819
854
  }
820
- async function J(t, n) {
855
+ async function q(t, n) {
821
856
  await e.writeFile(t, n, "utf-8");
822
857
  }
823
- function Y(e) {
858
+ function Ge(e) {
824
859
  console.info("\x1B[36m────────────────────────────────────────────────────────────────────────────────"), console.info(`▶️ ${e}`);
825
860
  }
826
- function ze(e) {
861
+ function Ke(e) {
827
862
  console.info(`✅ ${e}`);
828
863
  }
829
- function X(e) {
864
+ function J(e) {
830
865
  console.info(e);
831
866
  }
832
- function Be(e) {
833
- let t = Oe.find((t) => e.startsWith(t.idPrefix));
867
+ function qe(e) {
868
+ let t = Pe.find((t) => e.startsWith(t.idPrefix));
834
869
  if (!t) throw Error(`Failed to locate module type configuration for identifier '${e}'.`);
835
870
  return t;
836
871
  }
837
- function Ve(e, t) {
872
+ function Je(e, t) {
838
873
  let n = e.repository, r = typeof n == "string" ? n : n?.url;
839
874
  if (r == null || r === "") throw Error(`package.json 'repository' field is required to ${t}.`);
840
875
  let i = r.replace(/^git\+/, "").replace(/\.git$/, ""), a = /github\.com[/:]([^/]+)\/([^/]+)$/.exec(i);
@@ -844,50 +879,56 @@ function Ve(e, t) {
844
879
  repository: a[2]
845
880
  };
846
881
  }
847
- async function He(t) {
882
+ async function Y(t) {
848
883
  return await e.stat(t);
849
884
  }
850
- async function Ue(e, t, n) {
885
+ async function Ye(e, t, n) {
851
886
  switch (n.typeId) {
852
- case "connector": return await Ge(e, t);
853
- case "presenter": return await Ke(e, t);
854
- default: return await qe(e, t);
887
+ case "connector": return await Ze(e, t);
888
+ case "presenter": return await Qe(e, t);
889
+ case "tool": return await $e(e, t);
890
+ default: return await Z(e, t);
855
891
  }
856
892
  }
857
- async function We(e, t, n = "./") {
858
- if (X(`${e} Bump project version`), t.version == null) t.version = "0.0.001", console.warn(`⚠️ Project version initialised to '${t.version}'.`);
893
+ async function Xe(e, t, n = "./") {
894
+ if (J(`${e} Bump project version`), t.version == null) t.version = "0.0.001", console.warn(`⚠️ Project version initialised to '${t.version}'.`);
859
895
  else {
860
896
  let e = t.version, n = t.version.split(".");
861
897
  t.version = `${n[0] ?? "unknown"}.${n[1] ?? "unknown"}.${String(Number(n[2]) + 1)}`, console.info(`Project version bumped from '${e}' to '${t.version}'.`);
862
898
  }
863
- await q(`${n}package.json`, t);
899
+ await K(`${n}package.json`, t);
864
900
  }
865
- async function Z(e) {
901
+ async function X(e) {
866
902
  let { default: t } = await import("typescript"), n = t.createSourceFile("index.ts", e, t.ScriptTarget.Latest, !0), r = [], i = (e) => {
867
903
  t.isMethodDeclaration(e) && t.isClassLike(e.parent) && t.isIdentifier(e.name) && ((e.modifiers?.some((e) => e.kind === t.SyntaxKind.PrivateKeyword) ?? !1) || r.push(e.name.text)), t.forEachChild(e, i);
868
904
  };
869
905
  return i(n), r;
870
906
  }
871
- async function Ge(e, t) {
872
- X(`${e} Build connector project configuration`);
873
- let [n, r] = await Promise.all([W("config.json"), G("src/index.ts")]), i = /* @__PURE__ */ s(ge, n);
907
+ async function Ze(e, t) {
908
+ J(`${e} Build connector project configuration`);
909
+ let [n, r] = await Promise.all([U("config.json"), W("src/index.ts")]), i = /* @__PURE__ */ s(_e, n);
874
910
  if (!i.success) throw console.error("❌ Configuration is invalid:"), console.table(i.issues), Error("Configuration is invalid");
875
- let a = await Z(r);
876
- return await Q(t, n, a, F(a));
911
+ let a = await X(r);
912
+ return await Q(t, n, a, I(a));
877
913
  }
878
- async function Ke(e, t) {
879
- X(`${e} Build presenter project configuration`);
880
- let [n, r] = await Promise.all([W("config.json"), G("src/index.ts")]), i = /* @__PURE__ */ s(_e, n);
914
+ async function Qe(e, t) {
915
+ J(`${e} Build presenter project configuration`);
916
+ let [n, r] = await Promise.all([U("config.json"), W("src/index.ts")]), i = /* @__PURE__ */ s(be, n);
881
917
  if (!i.success) throw console.error("❌ Configuration is invalid:"), console.table(i.issues), Error("Configuration is invalid");
882
- return await Q(t, n, await Z(r));
918
+ return await Q(t, n, await X(r));
919
+ }
920
+ async function $e(e, t) {
921
+ let n = await Z(e, t), r = /* @__PURE__ */ s(Ce.entries.parser, n.parser);
922
+ if (!r.success) throw console.error("❌ The 'parser' configuration is invalid:"), console.table(r.issues), Error("Configuration is invalid");
923
+ return await Q(t, n, await X(await W("src/index.ts")));
883
924
  }
884
- async function qe(e, t) {
885
- X(`${e} Build project configuration`);
886
- let n = await W("config.json");
887
- return t.name != null && (n.id = t.name.replace("@dpuse/", "")), t.version != null && (n.version = t.version), n.icon ??= await K("logo.svg"), n.iconDark ??= await K("logoDark.svg"), await q("config.json", $(n)), n;
925
+ async function Z(e, t) {
926
+ J(`${e} Build project configuration`);
927
+ let n = await U("config.json");
928
+ return t.name != null && (n.id = t.name.replace("@dpuse/", "")), t.version != null && (n.version = t.version), n.icon ??= await G("logo.svg"), n.iconDark ??= await G("logoDark.svg"), await K("config.json", $(n)), n;
888
929
  }
889
930
  async function Q(e, t, n, r) {
890
- return n.length > 0 ? (console.info(`ℹ️ Implements ${String(n.length)} operations:`), console.table(n)) : console.warn("⚠️ Implements no operations"), r === "unknown" ? console.warn("⚠️ No usage identified") : r && console.info(`ℹ️ Supports '${r}' usage.`), e.name != null && (t.id = e.name.replace("@dpuse/", "").replace("@dpuse/", "")), e.version != null && (t.version = e.version), t.actionNames = n, r !== void 0 && (t.usageId = r), await q("config.json", $(t)), t;
931
+ return n.length > 0 ? (console.info(`ℹ️ Implements ${String(n.length)} operations:`), console.table(n)) : console.warn("⚠️ Implements no operations"), r === "unknown" ? console.warn("⚠️ No usage identified") : r && console.info(`ℹ️ Supports '${r}' usage.`), e.name != null && (t.id = e.name.replace("@dpuse/", "").replace("@dpuse/", "")), e.version != null && (t.version = e.version), t.actionNames = n, r !== void 0 && (t.usageId = r), await K("config.json", $(t)), t;
891
932
  }
892
933
  function $(e) {
893
934
  let t = [
@@ -897,11 +938,11 @@ function $(e) {
897
938
  ], n = Object.entries(e), r = t.flatMap((e) => n.filter(([t]) => t === e)), i = n.filter(([e]) => !t.includes(e)).toSorted(([e], [t]) => e.localeCompare(t, "en", { sensitivity: "base" }));
898
939
  return Object.fromEntries([...r, ...i]);
899
940
  }
900
- function Je(e, t, n, r) {
941
+ function et(e, t, n, r) {
901
942
  let i = e.indexOf(n), a = e.indexOf(r);
902
943
  if (i === -1 || a === -1) throw Error(`Markers ${n}-${r} not found in content.`);
903
944
  let o = t.trim();
904
945
  return `${e.slice(0, Math.max(0, i + n.length))}\n\n${o}\n\n${e.slice(Math.max(0, a))}`;
905
946
  }
906
947
  //#endregion
907
- export { Re as A, K as C, Pe as D, Ne as E, F as M, I as N, Fe as O, G as S, Le as T, Y as _, z as a, Ie as b, U as c, We as d, Ae as f, He as g, Be as h, Ce as i, J as j, q as k, De as l, je as m, V as n, we as o, Me as p, Se as r, H as s, B as t, Ue as u, ze as v, Ve as w, W as x, X as y };
948
+ export { We as A, G as C, Be as D, ze as E, I as M, ve as N, Ve as O, W as S, Ue as T, Ge as _, R as a, He as b, H as c, Xe as d, Ie as f, Y as g, qe as h, ke as i, q as j, K as k, Ne as l, Le as m, B as n, Ae as o, Re as p, Oe as r, V as s, z as t, Ye as u, Ke as v, Je as w, U as x, J as y };