@datapos/datapos-shared 0.3.356 → 0.3.362

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.
@@ -1,610 +1,9 @@
1
- let M;
2
- // @__NO_SIDE_EFFECTS__
3
- function U(t) {
4
- return {
5
- lang: t?.lang ?? M?.lang,
6
- message: t?.message,
7
- abortEarly: t?.abortEarly ?? M?.abortEarly,
8
- abortPipeEarly: t?.abortPipeEarly ?? M?.abortPipeEarly
9
- };
10
- }
11
- let F;
12
- // @__NO_SIDE_EFFECTS__
13
- function G(t) {
14
- return F?.get(t);
15
- }
16
- let z;
17
- // @__NO_SIDE_EFFECTS__
18
- function V(t) {
19
- return z?.get(t);
20
- }
21
- let X;
22
- // @__NO_SIDE_EFFECTS__
23
- function K(t, n) {
24
- return X?.get(t)?.get(n);
25
- }
26
- // @__NO_SIDE_EFFECTS__
27
- function N(t) {
28
- const n = typeof t;
29
- return n === "string" ? `"${t}"` : n === "number" || n === "bigint" || n === "boolean" ? `${t}` : n === "object" || n === "function" ? (t && Object.getPrototypeOf(t)?.constructor?.name) ?? "null" : n;
30
- }
31
- function g(t, n, e, r, o) {
32
- const s = o && "input" in o ? o.input : e.value, i = o?.expected ?? t.expects ?? null, u = o?.received ?? /* @__PURE__ */ N(s), l = {
33
- kind: t.kind,
34
- type: t.type,
35
- input: s,
36
- expected: i,
37
- received: u,
38
- message: `Invalid ${n}: ${i ? `Expected ${i} but r` : "R"}eceived ${u}`,
39
- requirement: t.requirement,
40
- path: o?.path,
41
- issues: o?.issues,
42
- lang: r.lang,
43
- abortEarly: r.abortEarly,
44
- abortPipeEarly: r.abortPipeEarly
45
- }, p = t.kind === "schema", d = o?.message ?? t.message ?? /* @__PURE__ */ K(t.reference, l.lang) ?? (p ? /* @__PURE__ */ V(l.lang) : null) ?? r.message ?? /* @__PURE__ */ G(l.lang);
46
- d !== void 0 && (l.message = typeof d == "function" ? d(l) : d), p && (e.typed = !1), e.issues ? e.issues.push(l) : e.issues = [l];
47
- }
48
- // @__NO_SIDE_EFFECTS__
49
- function h(t) {
50
- return {
51
- version: 1,
52
- vendor: "valibot",
53
- validate(n) {
54
- return t["~run"]({ value: n }, /* @__PURE__ */ U());
55
- }
56
- };
57
- }
58
- // @__NO_SIDE_EFFECTS__
59
- function q(t, n) {
60
- return Object.hasOwn(t, n) && n !== "__proto__" && n !== "prototype" && n !== "constructor";
61
- }
62
- // @__NO_SIDE_EFFECTS__
63
- function H(t, n) {
64
- const e = [...new Set(t)];
65
- return e.length > 1 ? `(${e.join(` ${n} `)})` : e[0] ?? "never";
66
- }
67
- // @__NO_SIDE_EFFECTS__
68
- function J(t, n, e) {
69
- return typeof t.fallback == "function" ? t.fallback(n, e) : t.fallback;
70
- }
71
- // @__NO_SIDE_EFFECTS__
72
- function j(t, n, e) {
73
- return typeof t.default == "function" ? t.default(n, e) : t.default;
74
- }
75
- // @__NO_SIDE_EFFECTS__
76
- function S(t, n) {
77
- return {
78
- kind: "schema",
79
- type: "array",
80
- reference: S,
81
- expects: "Array",
82
- async: !1,
83
- item: t,
84
- message: n,
85
- get "~standard"() {
86
- return /* @__PURE__ */ h(this);
87
- },
88
- "~run"(e, r) {
89
- const o = e.value;
90
- if (Array.isArray(o)) {
91
- e.typed = !0, e.value = [];
92
- for (let s = 0; s < o.length; s++) {
93
- const i = o[s], u = this.item["~run"]({ value: i }, r);
94
- if (u.issues) {
95
- const l = {
96
- type: "array",
97
- origin: "value",
98
- input: o,
99
- key: s,
100
- value: i
101
- };
102
- for (const p of u.issues)
103
- p.path ? p.path.unshift(l) : p.path = [l], e.issues?.push(p);
104
- if (e.issues || (e.issues = u.issues), r.abortEarly) {
105
- e.typed = !1;
106
- break;
107
- }
108
- }
109
- u.typed || (e.typed = !1), e.value.push(u.value);
110
- }
111
- } else g(this, "type", e, r);
112
- return e;
113
- }
114
- };
115
- }
116
- // @__NO_SIDE_EFFECTS__
117
- function w(t) {
118
- return {
119
- kind: "schema",
120
- type: "boolean",
121
- reference: w,
122
- expects: "boolean",
123
- async: !1,
124
- message: t,
125
- get "~standard"() {
126
- return /* @__PURE__ */ h(this);
127
- },
128
- "~run"(n, e) {
129
- return typeof n.value == "boolean" ? n.typed = !0 : g(this, "type", n, e), n;
130
- }
131
- };
132
- }
133
- // @__NO_SIDE_EFFECTS__
134
- function E(t, n) {
135
- return {
136
- kind: "schema",
137
- type: "literal",
138
- reference: E,
139
- expects: /* @__PURE__ */ N(t),
140
- async: !1,
141
- literal: t,
142
- message: n,
143
- get "~standard"() {
144
- return /* @__PURE__ */ h(this);
145
- },
146
- "~run"(e, r) {
147
- return e.value === this.literal ? e.typed = !0 : g(this, "type", e, r), e;
148
- }
149
- };
150
- }
151
- // @__NO_SIDE_EFFECTS__
152
- function y(t, n) {
153
- return {
154
- kind: "schema",
155
- type: "nullable",
156
- reference: y,
157
- expects: `(${t.expects} | null)`,
158
- async: !1,
159
- wrapped: t,
160
- default: n,
161
- get "~standard"() {
162
- return /* @__PURE__ */ h(this);
163
- },
164
- "~run"(e, r) {
165
- return e.value === null && (this.default !== void 0 && (e.value = /* @__PURE__ */ j(this, e, r)), e.value === null) ? (e.typed = !0, e) : this.wrapped["~run"](e, r);
166
- }
167
- };
168
- }
169
- // @__NO_SIDE_EFFECTS__
170
- function C(t) {
171
- return {
172
- kind: "schema",
173
- type: "number",
174
- reference: C,
175
- expects: "number",
176
- async: !1,
177
- message: t,
178
- get "~standard"() {
179
- return /* @__PURE__ */ h(this);
180
- },
181
- "~run"(n, e) {
182
- return typeof n.value == "number" && !isNaN(n.value) ? n.typed = !0 : g(this, "type", n, e), n;
183
- }
184
- };
185
- }
186
- // @__NO_SIDE_EFFECTS__
187
- function f(t, n) {
188
- return {
189
- kind: "schema",
190
- type: "object",
191
- reference: f,
192
- expects: "Object",
193
- async: !1,
194
- entries: t,
195
- message: n,
196
- get "~standard"() {
197
- return /* @__PURE__ */ h(this);
198
- },
199
- "~run"(e, r) {
200
- const o = e.value;
201
- if (o && typeof o == "object") {
202
- e.typed = !0, e.value = {};
203
- for (const s in this.entries) {
204
- const i = this.entries[s];
205
- if (s in o || (i.type === "exact_optional" || i.type === "optional" || i.type === "nullish") && i.default !== void 0) {
206
- const u = s in o ? o[s] : /* @__PURE__ */ j(i), l = i["~run"]({ value: u }, r);
207
- if (l.issues) {
208
- const p = {
209
- type: "object",
210
- origin: "value",
211
- input: o,
212
- key: s,
213
- value: u
214
- };
215
- for (const d of l.issues)
216
- d.path ? d.path.unshift(p) : d.path = [p], e.issues?.push(d);
217
- if (e.issues || (e.issues = l.issues), r.abortEarly) {
218
- e.typed = !1;
219
- break;
220
- }
221
- }
222
- l.typed || (e.typed = !1), e.value[s] = l.value;
223
- } else if (i.fallback !== void 0) e.value[s] = /* @__PURE__ */ J(i);
224
- else if (i.type !== "exact_optional" && i.type !== "optional" && i.type !== "nullish" && (g(this, "key", e, r, {
225
- input: void 0,
226
- expected: `"${s}"`,
227
- path: [{
228
- type: "object",
229
- origin: "key",
230
- input: o,
231
- key: s,
232
- value: o[s]
233
- }]
234
- }), r.abortEarly))
235
- break;
236
- }
237
- } else g(this, "type", e, r);
238
- return e;
239
- }
240
- };
241
- }
242
- // @__NO_SIDE_EFFECTS__
243
- function b(t, n) {
244
- return {
245
- kind: "schema",
246
- type: "optional",
247
- reference: b,
248
- expects: `(${t.expects} | undefined)`,
249
- async: !1,
250
- wrapped: t,
251
- default: n,
252
- get "~standard"() {
253
- return /* @__PURE__ */ h(this);
254
- },
255
- "~run"(e, r) {
256
- return e.value === void 0 && (this.default !== void 0 && (e.value = /* @__PURE__ */ j(this, e, r)), e.value === void 0) ? (e.typed = !0, e) : this.wrapped["~run"](e, r);
257
- }
258
- };
259
- }
260
- // @__NO_SIDE_EFFECTS__
261
- function R(t, n, e) {
262
- return {
263
- kind: "schema",
264
- type: "record",
265
- reference: R,
266
- expects: "Object",
267
- async: !1,
268
- key: t,
269
- value: n,
270
- message: e,
271
- get "~standard"() {
272
- return /* @__PURE__ */ h(this);
273
- },
274
- "~run"(r, o) {
275
- const s = r.value;
276
- if (s && typeof s == "object") {
277
- r.typed = !0, r.value = {};
278
- for (const i in s) if (/* @__PURE__ */ q(s, i)) {
279
- const u = s[i], l = this.key["~run"]({ value: i }, o);
280
- if (l.issues) {
281
- const d = {
282
- type: "object",
283
- origin: "key",
284
- input: s,
285
- key: i,
286
- value: u
287
- };
288
- for (const x of l.issues)
289
- x.path = [d], r.issues?.push(x);
290
- if (r.issues || (r.issues = l.issues), o.abortEarly) {
291
- r.typed = !1;
292
- break;
293
- }
294
- }
295
- const p = this.value["~run"]({ value: u }, o);
296
- if (p.issues) {
297
- const d = {
298
- type: "object",
299
- origin: "value",
300
- input: s,
301
- key: i,
302
- value: u
303
- };
304
- for (const x of p.issues)
305
- x.path ? x.path.unshift(d) : x.path = [d], r.issues?.push(x);
306
- if (r.issues || (r.issues = p.issues), o.abortEarly) {
307
- r.typed = !1;
308
- break;
309
- }
310
- }
311
- (!l.typed || !p.typed) && (r.typed = !1), l.typed && (r.value[l.value] = p.value);
312
- }
313
- } else g(this, "type", r, o);
314
- return r;
315
- }
316
- };
317
- }
318
- // @__NO_SIDE_EFFECTS__
319
- function a(t) {
320
- return {
321
- kind: "schema",
322
- type: "string",
323
- reference: a,
324
- expects: "string",
325
- async: !1,
326
- message: t,
327
- get "~standard"() {
328
- return /* @__PURE__ */ h(this);
329
- },
330
- "~run"(n, e) {
331
- return typeof n.value == "string" ? n.typed = !0 : g(this, "type", n, e), n;
332
- }
333
- };
334
- }
335
- // @__NO_SIDE_EFFECTS__
336
- function _(t) {
337
- let n;
338
- if (t) for (const e of t) n ? n.push(...e.issues) : n = e.issues;
339
- return n;
340
- }
341
- // @__NO_SIDE_EFFECTS__
342
- function P(t, n) {
343
- return {
344
- kind: "schema",
345
- type: "union",
346
- reference: P,
347
- expects: /* @__PURE__ */ H(t.map((e) => e.expects), "|"),
348
- async: !1,
349
- options: t,
350
- message: n,
351
- get "~standard"() {
352
- return /* @__PURE__ */ h(this);
353
- },
354
- "~run"(e, r) {
355
- let o, s, i;
356
- for (const u of this.options) {
357
- const l = u["~run"]({ value: e.value }, r);
358
- if (l.typed) if (l.issues) s ? s.push(l) : s = [l];
359
- else {
360
- o = l;
361
- break;
362
- }
363
- else i ? i.push(l) : i = [l];
364
- }
365
- if (o) return o;
366
- if (s) {
367
- if (s.length === 1) return s[0];
368
- g(this, "type", e, r, { issues: /* @__PURE__ */ _(s) }), e.typed = !0;
369
- } else {
370
- if (i?.length === 1) return i[0];
371
- g(this, "type", e, r, { issues: /* @__PURE__ */ _(i) });
372
- }
373
- return e;
374
- }
375
- };
376
- }
377
- const m = (t) => /* @__PURE__ */ P(t.map((n) => /* @__PURE__ */ E(n))), B = /* @__PURE__ */ f({
378
- "en-au": /* @__PURE__ */ a(),
379
- "en-gb": /* @__PURE__ */ a(),
380
- "en-us": /* @__PURE__ */ a(),
381
- "es-es": /* @__PURE__ */ a()
382
- }), k = /* @__PURE__ */ f({
383
- "en-au": /* @__PURE__ */ b(/* @__PURE__ */ a()),
384
- "en-gb": /* @__PURE__ */ b(/* @__PURE__ */ a()),
385
- "en-us": /* @__PURE__ */ b(/* @__PURE__ */ a()),
386
- "es-es": /* @__PURE__ */ b(/* @__PURE__ */ a())
387
- }), Q = m(["amber", "green", "red", "other"]), W = m([
388
- "alpha",
389
- "beta",
390
- "generalAvailability",
391
- "notApplicable",
392
- "preAlpha",
393
- "proposed",
394
- "releaseCandidate",
395
- "unavailable",
396
- "underReview"
397
- ]), Y = m([
398
- "app",
399
- "connector",
400
- "connectorConnection",
401
- "context",
402
- "contextModelGroup",
403
- "contextModel",
404
- "contextModelDimensionGroup",
405
- "contextModelDimension",
406
- "contextModelDimensionHierarchy",
407
- "contextModelEntityGroup",
408
- "contextModelEntity",
409
- "contextModelEntityDataItem",
410
- "contextModelEntityEvent",
411
- "contextModelEntityPrimaryMeasure",
412
- "contextModelSecondaryMeasureGroup",
413
- "contextModelSecondaryMeasure",
414
- "dataView",
415
- "dimension",
416
- "engine",
417
- "eventQuery",
418
- "presenter",
419
- "presenterPresentation",
420
- "tool"
421
- ]);
422
- m(["app", "engine", "connector", "context", "presenter", "tool"]);
423
- const Z = /* @__PURE__ */ f({
424
- id: /* @__PURE__ */ a(),
425
- color: Q,
426
- label: /* @__PURE__ */ a()
427
- }), I = {
428
- id: /* @__PURE__ */ a(),
429
- label: k,
430
- description: k,
431
- firstCreatedAt: /* @__PURE__ */ b(/* @__PURE__ */ C()),
432
- icon: /* @__PURE__ */ y(/* @__PURE__ */ a()),
433
- iconDark: /* @__PURE__ */ y(/* @__PURE__ */ a()),
434
- lastUpdatedAt: /* @__PURE__ */ y(/* @__PURE__ */ C()),
435
- status: /* @__PURE__ */ y(Z),
436
- statusId: W
437
- }, fe = /* @__PURE__ */ f({
438
- ...I,
439
- typeId: Y
440
- }), A = {
441
- ...I,
442
- version: /* @__PURE__ */ a()
443
- }, T = /* @__PURE__ */ f({
444
- id: /* @__PURE__ */ a(),
445
- label: k,
446
- description: k,
447
- icon: /* @__PURE__ */ y(/* @__PURE__ */ a()),
448
- iconDark: /* @__PURE__ */ y(/* @__PURE__ */ a()),
449
- order: /* @__PURE__ */ C(),
450
- path: /* @__PURE__ */ a()
451
- }), v = (t) => {
452
- const n = Object.entries(t).filter((e) => typeof e[1] == "string");
453
- return new Map(n);
454
- }, $ = (t, n, e = O) => {
455
- const r = t.get(n);
456
- if (r !== void 0) return r;
457
- if (e !== n)
458
- return t.get(e);
459
- }, ee = [
460
- { id: "alpha", color: "red", labels: v({ "en-gb": "alpha" }) },
461
- { id: "beta", color: "amber", labels: v({ "en-gb": "beta" }) },
462
- { id: "generalAvailability", color: "green", labels: v({ "en-gb": "" }) },
463
- { id: "notApplicable", color: "green", labels: v({ "en-gb": "not-applicable" }) },
464
- { id: "preAlpha", color: "red", labels: v({ "en-gb": "pre-alpha" }) },
465
- { id: "proposed", color: "other", labels: v({ "en-gb": "proposed" }) },
466
- { id: "releaseCandidate", color: "green", labels: v({ "en-gb": "release-candidate" }) },
467
- { id: "unavailable", color: "other", labels: v({ "en-gb": "unavailable" }) },
468
- { id: "underReview", color: "other", labels: v({ "en-gb": "under-review" }) }
469
- ], ye = (t, n = O) => {
470
- const e = ee.find((r) => r.id === t);
471
- if (e) {
472
- const r = $(e.labels, n);
473
- return { id: e.id, color: e.color, label: r ?? e.id };
474
- }
475
- return { id: t, color: "other", label: t };
476
- }, te = m(["apiKey", "disabled", "oAuth2", "none"]), ne = m(["application", "curatedDataset", "database", "fileStore"]), re = m([
477
- "abortOperation",
478
- "authenticateConnection",
479
- "createObject",
480
- "describeConnection",
481
- "dropObject",
482
- "findObject",
483
- "getReadableStream",
484
- "getRecord",
485
- "listNodes",
486
- "previewObject",
487
- "removeRecords",
488
- "retrieveChunks",
489
- "retrieveRecords",
490
- "upsertRecords"
491
- ]), se = m(["bidirectional", "destination", "source", "unknown"]), oe = /* @__PURE__ */ f({
492
- authMethodId: te,
493
- activeConnectionCount: /* @__PURE__ */ b(/* @__PURE__ */ C()),
494
- canDescribe: /* @__PURE__ */ b(/* @__PURE__ */ w()),
495
- id: /* @__PURE__ */ b(/* @__PURE__ */ a()),
496
- label: /* @__PURE__ */ b(B),
497
- maxConnectionCount: /* @__PURE__ */ b(/* @__PURE__ */ C()),
498
- params: /* @__PURE__ */ b(/* @__PURE__ */ S(/* @__PURE__ */ R(/* @__PURE__ */ a(), /* @__PURE__ */ a())))
499
- }), ge = /* @__PURE__ */ f({
500
- ...A,
501
- typeId: /* @__PURE__ */ E("connector"),
502
- category: /* @__PURE__ */ y(/* @__PURE__ */ f({ id: /* @__PURE__ */ a(), label: /* @__PURE__ */ a() })),
503
- categoryId: ne,
504
- implementations: /* @__PURE__ */ R(/* @__PURE__ */ a(), oe),
505
- operations: /* @__PURE__ */ S(re),
506
- usageId: se,
507
- vendorAccountURL: /* @__PURE__ */ y(/* @__PURE__ */ a()),
508
- vendorDocumentationURL: /* @__PURE__ */ y(/* @__PURE__ */ a()),
509
- vendorHomeURL: /* @__PURE__ */ y(/* @__PURE__ */ a())
510
- }), he = ["createObject", "dropObject", "removeRecords", "upsertRecords"], me = ["findObject", "getRecord", "listNodes", "previewObject", "retrieveRecords"], D = (t) => {
511
- const n = Object.entries(t).filter((e) => typeof e[1] == "string");
512
- return new Map(n);
1
+ import { connectorConfigSchema as r } from "./datapos-shared.es.js";
2
+ const e = (a) => {
3
+ const t = Object.entries(a).filter((n) => typeof n[1] == "string");
4
+ return new Map(t);
513
5
  };
514
- D({ "en-gb": "Application" }), D({ "en-gb": "Curated Dataset" }), D({ "en-gb": "Database" }), D({ "en-gb": "File Store" });
515
- const ie = m(["list"]), le = /* @__PURE__ */ f({
516
- ...I,
517
- typeId: /* @__PURE__ */ E("contextModelGroup"),
518
- modelRefs: /* @__PURE__ */ S(T),
519
- order: /* @__PURE__ */ C()
520
- }), ve = /* @__PURE__ */ f({
521
- ...A,
522
- typeId: /* @__PURE__ */ E("context"),
523
- models: /* @__PURE__ */ S(le),
524
- operations: /* @__PURE__ */ S(ie)
525
- }), ae = m(["list", "render", "setColorMode"]), Se = /* @__PURE__ */ f({
526
- ...A,
527
- typeId: /* @__PURE__ */ E("presenter"),
528
- presentations: /* @__PURE__ */ S(T),
529
- operations: /* @__PURE__ */ S(ae)
530
- });
531
- function xe() {
532
- return { render: ce };
533
- }
534
- function ce(t, n, e) {
535
- e.textContent = "Cytoscape.js diagram goes here...";
536
- }
537
- function Ce() {
538
- return { render: ue };
539
- }
540
- function ue(t, n) {
541
- console.log(1111, t), console.log(2222, n), console.log(3333, n.childNodes), console.log(4444, n.children);
542
- }
543
- const c = (t) => new Map(Object.entries(t)), L = (t, n, e = O) => {
544
- const r = t.get(n);
545
- if (r !== void 0) return r;
546
- if (e !== n)
547
- return t.get(e);
548
- }, pe = [
549
- { id: "dtv", labels: c({ "en-gb": "Delimited Text" }) },
550
- { id: "e/e", labels: c({ "en-gb": "Entity/Event" }) },
551
- { id: "jsonArray", labels: c({ "en-gb": "JSON Array" }) },
552
- { id: "spss", labels: c({ "en-gb": "SPSS" }) },
553
- { id: "xls", labels: c({ "en-gb": "XLS" }) },
554
- { id: "xlsx", labels: c({ "en-gb": "XLSX" }) },
555
- { id: "xml", labels: c({ "en-gb": "XML" }) }
556
- ], Ee = (t = O) => {
557
- const n = [];
558
- for (const e of pe) {
559
- const r = L(e.labels, t);
560
- n.push({ id: e.id, label: r ?? e.id });
561
- }
562
- return n;
563
- }, de = [
564
- { id: `
565
- `, labels: c({ "en-gb": "Newline" }) },
566
- { id: "\r", labels: c({ "en-gb": "Carriage Return" }) },
567
- { id: `\r
568
- `, labels: c({ "en-gb": "Carriage Return/Newline" }) }
569
- ], Oe = (t = O) => {
570
- const n = [];
571
- for (const e of de) {
572
- const r = L(e.labels, t);
573
- n.push({ id: e.id, label: r ?? e.id });
574
- }
575
- return n;
576
- }, be = [
577
- { id: ":", labels: c({ "en-gb": "Colon" }) },
578
- { id: ",", labels: c({ "en-gb": "Comma" }) },
579
- { id: "!", labels: c({ "en-gb": "Exclamation Mark" }) },
580
- // { id: '', label: { 'en-gb': 'Other' } }, // TODO: Maybe set this to a 'not printing' or special ascii character when there is a user supplied delimited, rather than ''?
581
- { id: "0x1E", labels: c({ "en-gb": "Record Separator" }) },
582
- { id: ";", labels: c({ "en-gb": "Semicolon" }) },
583
- { id: " ", labels: c({ "en-gb": "Space" }) },
584
- { id: " ", labels: c({ "en-gb": "Tab" }) },
585
- { id: "_", labels: c({ "en-gb": "Underscore" }) },
586
- { id: "0x1F", labels: c({ "en-gb": "Unit Separator" }) },
587
- { id: "|", labels: c({ "en-gb": "Vertical Bar" }) }
588
- ], De = (t = O) => {
589
- const n = [];
590
- for (const e of be) {
591
- const r = L(e.labels, t);
592
- n.push({ id: e.id, label: r ?? e.id });
593
- }
594
- return n;
595
- }, O = "en-gb";
6
+ e({ "en-gb": "Application" }), e({ "en-gb": "Curated Dataset" }), e({ "en-gb": "Database" }), e({ "en-gb": "File Store" });
596
7
  export {
597
- he as CONNECTOR_DESTINATION_OPERATIONS,
598
- me as CONNECTOR_SOURCE_OPERATIONS,
599
- O as D,
600
- ve as a,
601
- Ce as b,
602
- fe as c,
603
- ge as connectorConfigSchema,
604
- Oe as d,
605
- De as e,
606
- ye as f,
607
- Ee as g,
608
- Se as p,
609
- xe as u
8
+ r as connectorConfigSchema
610
9
  };
@@ -1,16 +1,603 @@
1
- import { CONNECTOR_DESTINATION_OPERATIONS as t, CONNECTOR_SOURCE_OPERATIONS as s, D as o, c as C, connectorConfigSchema as n, a as O, f as c, g as m, d as S, e as g, p as r, u as E, b as i } from "./datapos-shared-connector.es.js";
1
+ let M;
2
+ // @__NO_SIDE_EFFECTS__
3
+ function F(n) {
4
+ return {
5
+ lang: n?.lang ?? M?.lang,
6
+ message: n?.message,
7
+ abortEarly: n?.abortEarly ?? M?.abortEarly,
8
+ abortPipeEarly: n?.abortPipeEarly ?? M?.abortPipeEarly
9
+ };
10
+ }
11
+ let G;
12
+ // @__NO_SIDE_EFFECTS__
13
+ function N(n) {
14
+ return G?.get(n);
15
+ }
16
+ let T;
17
+ // @__NO_SIDE_EFFECTS__
18
+ function z(n) {
19
+ return T?.get(n);
20
+ }
21
+ let V;
22
+ // @__NO_SIDE_EFFECTS__
23
+ function X(n, t) {
24
+ return V?.get(n)?.get(t);
25
+ }
26
+ // @__NO_SIDE_EFFECTS__
27
+ function _(n) {
28
+ const t = typeof n;
29
+ return t === "string" ? `"${n}"` : t === "number" || t === "bigint" || t === "boolean" ? `${n}` : t === "object" || t === "function" ? (n && Object.getPrototypeOf(n)?.constructor?.name) ?? "null" : t;
30
+ }
31
+ function g(n, t, e, r, o) {
32
+ const s = o && "input" in o ? o.input : e.value, i = o?.expected ?? n.expects ?? null, c = o?.received ?? /* @__PURE__ */ _(s), l = {
33
+ kind: n.kind,
34
+ type: n.type,
35
+ input: s,
36
+ expected: i,
37
+ received: c,
38
+ message: `Invalid ${t}: ${i ? `Expected ${i} but r` : "R"}eceived ${c}`,
39
+ requirement: n.requirement,
40
+ path: o?.path,
41
+ issues: o?.issues,
42
+ lang: r.lang,
43
+ abortEarly: r.abortEarly,
44
+ abortPipeEarly: r.abortPipeEarly
45
+ }, p = n.kind === "schema", d = o?.message ?? n.message ?? /* @__PURE__ */ X(n.reference, l.lang) ?? (p ? /* @__PURE__ */ z(l.lang) : null) ?? r.message ?? /* @__PURE__ */ N(l.lang);
46
+ d !== void 0 && (l.message = typeof d == "function" ? d(l) : d), p && (e.typed = !1), e.issues ? e.issues.push(l) : e.issues = [l];
47
+ }
48
+ // @__NO_SIDE_EFFECTS__
49
+ function h(n) {
50
+ return {
51
+ version: 1,
52
+ vendor: "valibot",
53
+ validate(t) {
54
+ return n["~run"]({ value: t }, /* @__PURE__ */ F());
55
+ }
56
+ };
57
+ }
58
+ // @__NO_SIDE_EFFECTS__
59
+ function K(n, t) {
60
+ return Object.hasOwn(n, t) && t !== "__proto__" && t !== "prototype" && t !== "constructor";
61
+ }
62
+ // @__NO_SIDE_EFFECTS__
63
+ function q(n, t) {
64
+ const e = [...new Set(n)];
65
+ return e.length > 1 ? `(${e.join(` ${t} `)})` : e[0] ?? "never";
66
+ }
67
+ // @__NO_SIDE_EFFECTS__
68
+ function H(n, t, e) {
69
+ return typeof n.fallback == "function" ? n.fallback(t, e) : n.fallback;
70
+ }
71
+ // @__NO_SIDE_EFFECTS__
72
+ function j(n, t, e) {
73
+ return typeof n.default == "function" ? n.default(t, e) : n.default;
74
+ }
75
+ // @__NO_SIDE_EFFECTS__
76
+ function S(n, t) {
77
+ return {
78
+ kind: "schema",
79
+ type: "array",
80
+ reference: S,
81
+ expects: "Array",
82
+ async: !1,
83
+ item: n,
84
+ message: t,
85
+ get "~standard"() {
86
+ return /* @__PURE__ */ h(this);
87
+ },
88
+ "~run"(e, r) {
89
+ const o = e.value;
90
+ if (Array.isArray(o)) {
91
+ e.typed = !0, e.value = [];
92
+ for (let s = 0; s < o.length; s++) {
93
+ const i = o[s], c = this.item["~run"]({ value: i }, r);
94
+ if (c.issues) {
95
+ const l = {
96
+ type: "array",
97
+ origin: "value",
98
+ input: o,
99
+ key: s,
100
+ value: i
101
+ };
102
+ for (const p of c.issues)
103
+ p.path ? p.path.unshift(l) : p.path = [l], e.issues?.push(p);
104
+ if (e.issues || (e.issues = c.issues), r.abortEarly) {
105
+ e.typed = !1;
106
+ break;
107
+ }
108
+ }
109
+ c.typed || (e.typed = !1), e.value.push(c.value);
110
+ }
111
+ } else g(this, "type", e, r);
112
+ return e;
113
+ }
114
+ };
115
+ }
116
+ // @__NO_SIDE_EFFECTS__
117
+ function w(n) {
118
+ return {
119
+ kind: "schema",
120
+ type: "boolean",
121
+ reference: w,
122
+ expects: "boolean",
123
+ async: !1,
124
+ message: n,
125
+ get "~standard"() {
126
+ return /* @__PURE__ */ h(this);
127
+ },
128
+ "~run"(t, e) {
129
+ return typeof t.value == "boolean" ? t.typed = !0 : g(this, "type", t, e), t;
130
+ }
131
+ };
132
+ }
133
+ // @__NO_SIDE_EFFECTS__
134
+ function k(n, t) {
135
+ return {
136
+ kind: "schema",
137
+ type: "literal",
138
+ reference: k,
139
+ expects: /* @__PURE__ */ _(n),
140
+ async: !1,
141
+ literal: n,
142
+ message: t,
143
+ get "~standard"() {
144
+ return /* @__PURE__ */ h(this);
145
+ },
146
+ "~run"(e, r) {
147
+ return e.value === this.literal ? e.typed = !0 : g(this, "type", e, r), e;
148
+ }
149
+ };
150
+ }
151
+ // @__NO_SIDE_EFFECTS__
152
+ function y(n, t) {
153
+ return {
154
+ kind: "schema",
155
+ type: "nullable",
156
+ reference: y,
157
+ expects: `(${n.expects} | null)`,
158
+ async: !1,
159
+ wrapped: n,
160
+ default: t,
161
+ get "~standard"() {
162
+ return /* @__PURE__ */ h(this);
163
+ },
164
+ "~run"(e, r) {
165
+ return e.value === null && (this.default !== void 0 && (e.value = /* @__PURE__ */ j(this, e, r)), e.value === null) ? (e.typed = !0, e) : this.wrapped["~run"](e, r);
166
+ }
167
+ };
168
+ }
169
+ // @__NO_SIDE_EFFECTS__
170
+ function C(n) {
171
+ return {
172
+ kind: "schema",
173
+ type: "number",
174
+ reference: C,
175
+ expects: "number",
176
+ async: !1,
177
+ message: n,
178
+ get "~standard"() {
179
+ return /* @__PURE__ */ h(this);
180
+ },
181
+ "~run"(t, e) {
182
+ return typeof t.value == "number" && !isNaN(t.value) ? t.typed = !0 : g(this, "type", t, e), t;
183
+ }
184
+ };
185
+ }
186
+ // @__NO_SIDE_EFFECTS__
187
+ function f(n, t) {
188
+ return {
189
+ kind: "schema",
190
+ type: "object",
191
+ reference: f,
192
+ expects: "Object",
193
+ async: !1,
194
+ entries: n,
195
+ message: t,
196
+ get "~standard"() {
197
+ return /* @__PURE__ */ h(this);
198
+ },
199
+ "~run"(e, r) {
200
+ const o = e.value;
201
+ if (o && typeof o == "object") {
202
+ e.typed = !0, e.value = {};
203
+ for (const s in this.entries) {
204
+ const i = this.entries[s];
205
+ if (s in o || (i.type === "exact_optional" || i.type === "optional" || i.type === "nullish") && i.default !== void 0) {
206
+ const c = s in o ? o[s] : /* @__PURE__ */ j(i), l = i["~run"]({ value: c }, r);
207
+ if (l.issues) {
208
+ const p = {
209
+ type: "object",
210
+ origin: "value",
211
+ input: o,
212
+ key: s,
213
+ value: c
214
+ };
215
+ for (const d of l.issues)
216
+ d.path ? d.path.unshift(p) : d.path = [p], e.issues?.push(d);
217
+ if (e.issues || (e.issues = l.issues), r.abortEarly) {
218
+ e.typed = !1;
219
+ break;
220
+ }
221
+ }
222
+ l.typed || (e.typed = !1), e.value[s] = l.value;
223
+ } else if (i.fallback !== void 0) e.value[s] = /* @__PURE__ */ H(i);
224
+ else if (i.type !== "exact_optional" && i.type !== "optional" && i.type !== "nullish" && (g(this, "key", e, r, {
225
+ input: void 0,
226
+ expected: `"${s}"`,
227
+ path: [{
228
+ type: "object",
229
+ origin: "key",
230
+ input: o,
231
+ key: s,
232
+ value: o[s]
233
+ }]
234
+ }), r.abortEarly))
235
+ break;
236
+ }
237
+ } else g(this, "type", e, r);
238
+ return e;
239
+ }
240
+ };
241
+ }
242
+ // @__NO_SIDE_EFFECTS__
243
+ function b(n, t) {
244
+ return {
245
+ kind: "schema",
246
+ type: "optional",
247
+ reference: b,
248
+ expects: `(${n.expects} | undefined)`,
249
+ async: !1,
250
+ wrapped: n,
251
+ default: t,
252
+ get "~standard"() {
253
+ return /* @__PURE__ */ h(this);
254
+ },
255
+ "~run"(e, r) {
256
+ return e.value === void 0 && (this.default !== void 0 && (e.value = /* @__PURE__ */ j(this, e, r)), e.value === void 0) ? (e.typed = !0, e) : this.wrapped["~run"](e, r);
257
+ }
258
+ };
259
+ }
260
+ // @__NO_SIDE_EFFECTS__
261
+ function I(n, t, e) {
262
+ return {
263
+ kind: "schema",
264
+ type: "record",
265
+ reference: I,
266
+ expects: "Object",
267
+ async: !1,
268
+ key: n,
269
+ value: t,
270
+ message: e,
271
+ get "~standard"() {
272
+ return /* @__PURE__ */ h(this);
273
+ },
274
+ "~run"(r, o) {
275
+ const s = r.value;
276
+ if (s && typeof s == "object") {
277
+ r.typed = !0, r.value = {};
278
+ for (const i in s) if (/* @__PURE__ */ K(s, i)) {
279
+ const c = s[i], l = this.key["~run"]({ value: i }, o);
280
+ if (l.issues) {
281
+ const d = {
282
+ type: "object",
283
+ origin: "key",
284
+ input: s,
285
+ key: i,
286
+ value: c
287
+ };
288
+ for (const x of l.issues)
289
+ x.path = [d], r.issues?.push(x);
290
+ if (r.issues || (r.issues = l.issues), o.abortEarly) {
291
+ r.typed = !1;
292
+ break;
293
+ }
294
+ }
295
+ const p = this.value["~run"]({ value: c }, o);
296
+ if (p.issues) {
297
+ const d = {
298
+ type: "object",
299
+ origin: "value",
300
+ input: s,
301
+ key: i,
302
+ value: c
303
+ };
304
+ for (const x of p.issues)
305
+ x.path ? x.path.unshift(d) : x.path = [d], r.issues?.push(x);
306
+ if (r.issues || (r.issues = p.issues), o.abortEarly) {
307
+ r.typed = !1;
308
+ break;
309
+ }
310
+ }
311
+ (!l.typed || !p.typed) && (r.typed = !1), l.typed && (r.value[l.value] = p.value);
312
+ }
313
+ } else g(this, "type", r, o);
314
+ return r;
315
+ }
316
+ };
317
+ }
318
+ // @__NO_SIDE_EFFECTS__
319
+ function a(n) {
320
+ return {
321
+ kind: "schema",
322
+ type: "string",
323
+ reference: a,
324
+ expects: "string",
325
+ async: !1,
326
+ message: n,
327
+ get "~standard"() {
328
+ return /* @__PURE__ */ h(this);
329
+ },
330
+ "~run"(t, e) {
331
+ return typeof t.value == "string" ? t.typed = !0 : g(this, "type", t, e), t;
332
+ }
333
+ };
334
+ }
335
+ // @__NO_SIDE_EFFECTS__
336
+ function R(n) {
337
+ let t;
338
+ if (n) for (const e of n) t ? t.push(...e.issues) : t = e.issues;
339
+ return t;
340
+ }
341
+ // @__NO_SIDE_EFFECTS__
342
+ function P(n, t) {
343
+ return {
344
+ kind: "schema",
345
+ type: "union",
346
+ reference: P,
347
+ expects: /* @__PURE__ */ q(n.map((e) => e.expects), "|"),
348
+ async: !1,
349
+ options: n,
350
+ message: t,
351
+ get "~standard"() {
352
+ return /* @__PURE__ */ h(this);
353
+ },
354
+ "~run"(e, r) {
355
+ let o, s, i;
356
+ for (const c of this.options) {
357
+ const l = c["~run"]({ value: e.value }, r);
358
+ if (l.typed) if (l.issues) s ? s.push(l) : s = [l];
359
+ else {
360
+ o = l;
361
+ break;
362
+ }
363
+ else i ? i.push(l) : i = [l];
364
+ }
365
+ if (o) return o;
366
+ if (s) {
367
+ if (s.length === 1) return s[0];
368
+ g(this, "type", e, r, { issues: /* @__PURE__ */ R(s) }), e.typed = !0;
369
+ } else {
370
+ if (i?.length === 1) return i[0];
371
+ g(this, "type", e, r, { issues: /* @__PURE__ */ R(i) });
372
+ }
373
+ return e;
374
+ }
375
+ };
376
+ }
377
+ const m = (n) => /* @__PURE__ */ P(n.map((t) => /* @__PURE__ */ k(t))), J = /* @__PURE__ */ f({
378
+ "en-au": /* @__PURE__ */ a(),
379
+ "en-gb": /* @__PURE__ */ a(),
380
+ "en-us": /* @__PURE__ */ a(),
381
+ "es-es": /* @__PURE__ */ a()
382
+ }), D = /* @__PURE__ */ f({
383
+ "en-au": /* @__PURE__ */ b(/* @__PURE__ */ a()),
384
+ "en-gb": /* @__PURE__ */ b(/* @__PURE__ */ a()),
385
+ "en-us": /* @__PURE__ */ b(/* @__PURE__ */ a()),
386
+ "es-es": /* @__PURE__ */ b(/* @__PURE__ */ a())
387
+ }), B = m(["amber", "green", "red", "other"]), Q = m([
388
+ "alpha",
389
+ "beta",
390
+ "generalAvailability",
391
+ "notApplicable",
392
+ "preAlpha",
393
+ "proposed",
394
+ "releaseCandidate",
395
+ "unavailable",
396
+ "underReview"
397
+ ]), W = m([
398
+ "app",
399
+ "connector",
400
+ "connectorConnection",
401
+ "context",
402
+ "contextModelGroup",
403
+ "contextModel",
404
+ "contextModelDimensionGroup",
405
+ "contextModelDimension",
406
+ "contextModelDimensionHierarchy",
407
+ "contextModelEntityGroup",
408
+ "contextModelEntity",
409
+ "contextModelEntityDataItem",
410
+ "contextModelEntityEvent",
411
+ "contextModelEntityPrimaryMeasure",
412
+ "contextModelSecondaryMeasureGroup",
413
+ "contextModelSecondaryMeasure",
414
+ "dataView",
415
+ "dimension",
416
+ "engine",
417
+ "eventQuery",
418
+ "presenter",
419
+ "presenterPresentation",
420
+ "tool"
421
+ ]);
422
+ m(["app", "engine", "connector", "context", "presenter", "tool"]);
423
+ const Y = /* @__PURE__ */ f({
424
+ id: /* @__PURE__ */ a(),
425
+ color: B,
426
+ label: /* @__PURE__ */ a()
427
+ }), L = {
428
+ id: /* @__PURE__ */ a(),
429
+ label: D,
430
+ description: D,
431
+ firstCreatedAt: /* @__PURE__ */ b(/* @__PURE__ */ C()),
432
+ icon: /* @__PURE__ */ y(/* @__PURE__ */ a()),
433
+ iconDark: /* @__PURE__ */ y(/* @__PURE__ */ a()),
434
+ lastUpdatedAt: /* @__PURE__ */ y(/* @__PURE__ */ C()),
435
+ status: /* @__PURE__ */ y(Y),
436
+ statusId: Q
437
+ }, be = /* @__PURE__ */ f({
438
+ ...L,
439
+ typeId: W
440
+ }), O = {
441
+ ...L,
442
+ version: /* @__PURE__ */ a()
443
+ }, U = /* @__PURE__ */ f({
444
+ id: /* @__PURE__ */ a(),
445
+ label: D,
446
+ description: D,
447
+ icon: /* @__PURE__ */ y(/* @__PURE__ */ a()),
448
+ iconDark: /* @__PURE__ */ y(/* @__PURE__ */ a()),
449
+ order: /* @__PURE__ */ C(),
450
+ path: /* @__PURE__ */ a()
451
+ }), v = (n) => {
452
+ const t = Object.entries(n).filter((e) => typeof e[1] == "string");
453
+ return new Map(t);
454
+ }, Z = (n, t, e = E) => {
455
+ const r = n.get(t);
456
+ if (r !== void 0) return r;
457
+ if (e !== t)
458
+ return n.get(e);
459
+ }, $ = [
460
+ { id: "alpha", color: "red", labels: v({ "en-gb": "alpha" }) },
461
+ { id: "beta", color: "amber", labels: v({ "en-gb": "beta" }) },
462
+ { id: "generalAvailability", color: "green", labels: v({ "en-gb": "" }) },
463
+ { id: "notApplicable", color: "green", labels: v({ "en-gb": "not-applicable" }) },
464
+ { id: "preAlpha", color: "red", labels: v({ "en-gb": "pre-alpha" }) },
465
+ { id: "proposed", color: "other", labels: v({ "en-gb": "proposed" }) },
466
+ { id: "releaseCandidate", color: "green", labels: v({ "en-gb": "release-candidate" }) },
467
+ { id: "unavailable", color: "other", labels: v({ "en-gb": "unavailable" }) },
468
+ { id: "underReview", color: "other", labels: v({ "en-gb": "under-review" }) }
469
+ ], fe = (n, t = E) => {
470
+ const e = $.find((r) => r.id === n);
471
+ if (e) {
472
+ const r = Z(e.labels, t);
473
+ return { id: e.id, color: e.color, label: r ?? e.id };
474
+ }
475
+ return { id: n, color: "other", label: n };
476
+ }, ee = m(["apiKey", "disabled", "oAuth2", "none"]), ne = /* @__PURE__ */ f({
477
+ authMethodId: ee,
478
+ activeConnectionCount: /* @__PURE__ */ b(/* @__PURE__ */ C()),
479
+ canDescribe: /* @__PURE__ */ b(/* @__PURE__ */ w()),
480
+ id: /* @__PURE__ */ b(/* @__PURE__ */ a()),
481
+ label: /* @__PURE__ */ b(J),
482
+ maxConnectionCount: /* @__PURE__ */ b(/* @__PURE__ */ C()),
483
+ params: /* @__PURE__ */ b(/* @__PURE__ */ S(/* @__PURE__ */ I(/* @__PURE__ */ a(), /* @__PURE__ */ a())))
484
+ }), te = m(["application", "curatedDataset", "database", "fileStore"]), re = m([
485
+ "abortOperation",
486
+ "authenticateConnection",
487
+ "createObject",
488
+ "describeConnection",
489
+ "dropObject",
490
+ "findObject",
491
+ "getReadableStream",
492
+ "getRecord",
493
+ "listNodes",
494
+ "previewObject",
495
+ "removeRecords",
496
+ "retrieveChunks",
497
+ "retrieveRecords",
498
+ "upsertRecords"
499
+ ]), se = m(["bidirectional", "destination", "source", "unknown"]), ye = /* @__PURE__ */ f({
500
+ ...O,
501
+ typeId: /* @__PURE__ */ k("connector"),
502
+ category: /* @__PURE__ */ y(/* @__PURE__ */ f({ id: /* @__PURE__ */ a(), label: /* @__PURE__ */ a() })),
503
+ categoryId: te,
504
+ implementations: /* @__PURE__ */ I(/* @__PURE__ */ a(), ne),
505
+ operations: /* @__PURE__ */ S(re),
506
+ usageId: se,
507
+ vendorAccountURL: /* @__PURE__ */ y(/* @__PURE__ */ a()),
508
+ vendorDocumentationURL: /* @__PURE__ */ y(/* @__PURE__ */ a()),
509
+ vendorHomeURL: /* @__PURE__ */ y(/* @__PURE__ */ a())
510
+ }), oe = m(["list"]), ie = /* @__PURE__ */ f({
511
+ ...L,
512
+ typeId: /* @__PURE__ */ k("contextModelGroup"),
513
+ modelRefs: /* @__PURE__ */ S(U),
514
+ order: /* @__PURE__ */ C()
515
+ }), ge = /* @__PURE__ */ f({
516
+ ...O,
517
+ typeId: /* @__PURE__ */ k("context"),
518
+ models: /* @__PURE__ */ S(ie),
519
+ operations: /* @__PURE__ */ S(oe)
520
+ }), le = m(["list", "render", "setColorMode"]), he = /* @__PURE__ */ f({
521
+ ...O,
522
+ typeId: /* @__PURE__ */ k("presenter"),
523
+ presentations: /* @__PURE__ */ S(U),
524
+ operations: /* @__PURE__ */ S(le)
525
+ });
526
+ function me() {
527
+ return { render: ae };
528
+ }
529
+ function ae(n, t, e) {
530
+ e.textContent = "Cytoscape.js diagram goes here...";
531
+ }
532
+ function ve() {
533
+ return { render: ue };
534
+ }
535
+ function ue(n, t) {
536
+ console.log(1111, n), console.log(2222, t), console.log(3333, t.childNodes), console.log(4444, t.children);
537
+ }
538
+ const u = (n) => new Map(Object.entries(n)), A = (n, t, e = E) => {
539
+ const r = n.get(t);
540
+ if (r !== void 0) return r;
541
+ if (e !== t)
542
+ return n.get(e);
543
+ }, ce = [
544
+ { id: "dtv", labels: u({ "en-gb": "Delimited Text" }) },
545
+ { id: "e/e", labels: u({ "en-gb": "Entity/Event" }) },
546
+ { id: "jsonArray", labels: u({ "en-gb": "JSON Array" }) },
547
+ { id: "spss", labels: u({ "en-gb": "SPSS" }) },
548
+ { id: "xls", labels: u({ "en-gb": "XLS" }) },
549
+ { id: "xlsx", labels: u({ "en-gb": "XLSX" }) },
550
+ { id: "xml", labels: u({ "en-gb": "XML" }) }
551
+ ], Se = (n = E) => {
552
+ const t = [];
553
+ for (const e of ce) {
554
+ const r = A(e.labels, n);
555
+ t.push({ id: e.id, label: r ?? e.id });
556
+ }
557
+ return t;
558
+ }, pe = [
559
+ { id: `
560
+ `, labels: u({ "en-gb": "Newline" }) },
561
+ { id: "\r", labels: u({ "en-gb": "Carriage Return" }) },
562
+ { id: `\r
563
+ `, labels: u({ "en-gb": "Carriage Return/Newline" }) }
564
+ ], xe = (n = E) => {
565
+ const t = [];
566
+ for (const e of pe) {
567
+ const r = A(e.labels, n);
568
+ t.push({ id: e.id, label: r ?? e.id });
569
+ }
570
+ return t;
571
+ }, de = [
572
+ { id: ":", labels: u({ "en-gb": "Colon" }) },
573
+ { id: ",", labels: u({ "en-gb": "Comma" }) },
574
+ { id: "!", labels: u({ "en-gb": "Exclamation Mark" }) },
575
+ // { id: '', label: { 'en-gb': 'Other' } }, // TODO: Maybe set this to a 'not printing' or special ascii character when there is a user supplied delimited, rather than ''?
576
+ { id: "0x1E", labels: u({ "en-gb": "Record Separator" }) },
577
+ { id: ";", labels: u({ "en-gb": "Semicolon" }) },
578
+ { id: " ", labels: u({ "en-gb": "Space" }) },
579
+ { id: " ", labels: u({ "en-gb": "Tab" }) },
580
+ { id: "_", labels: u({ "en-gb": "Underscore" }) },
581
+ { id: "0x1F", labels: u({ "en-gb": "Unit Separator" }) },
582
+ { id: "|", labels: u({ "en-gb": "Vertical Bar" }) }
583
+ ], Ce = (n = E) => {
584
+ const t = [];
585
+ for (const e of de) {
586
+ const r = A(e.labels, n);
587
+ t.push({ id: e.id, label: r ?? e.id });
588
+ }
589
+ return t;
590
+ }, E = "en-gb";
2
591
  export {
3
- t as CONNECTOR_DESTINATION_OPERATIONS,
4
- s as CONNECTOR_SOURCE_OPERATIONS,
5
- o as DEFAULT_LOCALE_CODE,
6
- C as componentConfigSchema,
7
- n as connectorConfigSchema,
8
- O as contextConfigSchema,
9
- c as getComponentStatus,
10
- m as getDataFormats,
11
- S as getRecordDelimiters,
12
- g as getValueDelimiters,
13
- r as presenterConfigSchema,
14
- E as useCytoscapeJS,
15
- i as useDataTable
592
+ E as DEFAULT_LOCALE_CODE,
593
+ be as componentConfigSchema,
594
+ ye as connectorConfigSchema,
595
+ ge as contextConfigSchema,
596
+ fe as getComponentStatus,
597
+ Se as getDataFormats,
598
+ xe as getRecordDelimiters,
599
+ Ce as getValueDelimiters,
600
+ he as presenterConfigSchema,
601
+ me as useCytoscapeJS,
602
+ ve as useDataTable
16
603
  };
@@ -1,13 +1,14 @@
1
1
  /**
2
- * Connector schema (drafted by Copilot).
2
+ * Connector configuration schema.
3
+ *
4
+ * Defines the configuration metadata for a connector. Used for validation
5
+ * of connector manifests and capability discovery at runtime.
6
+ */
7
+ /** Authentication method identifiers supported by a connector implementation. */
8
+ export declare const connectorAuthMethodIdSchema: import('valibot').UnionSchema<readonly [import('valibot').LiteralSchema<"apiKey", undefined>, import('valibot').LiteralSchema<"disabled", undefined>, import('valibot').LiteralSchema<"oAuth2", undefined>, import('valibot').LiteralSchema<"none", undefined>], undefined>;
9
+ /** A connector implementation variant. A single connector may expose multiple
10
+ * implementations differing by auth method, limits, or vendor-specific behavior.
3
11
  */
4
- /** Schema Literal Unions - Connector category identifier. */
5
- export declare const connectorCategoryIdSchema: import('valibot').UnionSchema<readonly [import('valibot').LiteralSchema<"application", undefined>, import('valibot').LiteralSchema<"curatedDataset", undefined>, import('valibot').LiteralSchema<"database", undefined>, import('valibot').LiteralSchema<"fileStore", undefined>], undefined>;
6
- /** Schema Literal Unions - Connector operation name. */
7
- export declare const connectorOperationNameSchema: import('valibot').UnionSchema<readonly [import('valibot').LiteralSchema<"abortOperation", undefined>, import('valibot').LiteralSchema<"authenticateConnection", undefined>, import('valibot').LiteralSchema<"createObject", undefined>, import('valibot').LiteralSchema<"describeConnection", undefined>, import('valibot').LiteralSchema<"dropObject", undefined>, import('valibot').LiteralSchema<"findObject", undefined>, import('valibot').LiteralSchema<"getReadableStream", undefined>, import('valibot').LiteralSchema<"getRecord", undefined>, import('valibot').LiteralSchema<"listNodes", undefined>, import('valibot').LiteralSchema<"previewObject", undefined>, import('valibot').LiteralSchema<"removeRecords", undefined>, import('valibot').LiteralSchema<"retrieveChunks", undefined>, import('valibot').LiteralSchema<"retrieveRecords", undefined>, import('valibot').LiteralSchema<"upsertRecords", undefined>], undefined>;
8
- /** Schema Literal Unions - Connector usage identifier. */
9
- export declare const connectorUsageIdSchema: import('valibot').UnionSchema<readonly [import('valibot').LiteralSchema<"bidirectional", undefined>, import('valibot').LiteralSchema<"destination", undefined>, import('valibot').LiteralSchema<"source", undefined>, import('valibot').LiteralSchema<"unknown", undefined>], undefined>;
10
- /** Schema Objects - Connector implementation. */
11
12
  export declare const connectorImplementationSchema: import('valibot').ObjectSchema<{
12
13
  readonly authMethodId: import('valibot').UnionSchema<readonly [import('valibot').LiteralSchema<"apiKey", undefined>, import('valibot').LiteralSchema<"disabled", undefined>, import('valibot').LiteralSchema<"oAuth2", undefined>, import('valibot').LiteralSchema<"none", undefined>], undefined>;
13
14
  readonly activeConnectionCount: import('valibot').OptionalSchema<import('valibot').NumberSchema<undefined>, undefined>;
@@ -22,7 +23,13 @@ export declare const connectorImplementationSchema: import('valibot').ObjectSche
22
23
  readonly maxConnectionCount: import('valibot').OptionalSchema<import('valibot').NumberSchema<undefined>, undefined>;
23
24
  readonly params: import('valibot').OptionalSchema<import('valibot').ArraySchema<import('valibot').RecordSchema<import('valibot').StringSchema<undefined>, import('valibot').StringSchema<undefined>, undefined>, undefined>, undefined>;
24
25
  }, undefined>;
25
- /** Schema Objects - Connector configuration. */
26
+ /** Category identifiers used for grouping and filtering connectors. */
27
+ export declare const connectorCategoryIdSchema: import('valibot').UnionSchema<readonly [import('valibot').LiteralSchema<"application", undefined>, import('valibot').LiteralSchema<"curatedDataset", undefined>, import('valibot').LiteralSchema<"database", undefined>, import('valibot').LiteralSchema<"fileStore", undefined>], undefined>;
28
+ /** Operation names a connector may support. */
29
+ export declare const connectorOperationNameSchema: import('valibot').UnionSchema<readonly [import('valibot').LiteralSchema<"abortOperation", undefined>, import('valibot').LiteralSchema<"authenticateConnection", undefined>, import('valibot').LiteralSchema<"createObject", undefined>, import('valibot').LiteralSchema<"describeConnection", undefined>, import('valibot').LiteralSchema<"dropObject", undefined>, import('valibot').LiteralSchema<"findObject", undefined>, import('valibot').LiteralSchema<"getReadableStream", undefined>, import('valibot').LiteralSchema<"getRecord", undefined>, import('valibot').LiteralSchema<"listNodes", undefined>, import('valibot').LiteralSchema<"previewObject", undefined>, import('valibot').LiteralSchema<"removeRecords", undefined>, import('valibot').LiteralSchema<"retrieveChunks", undefined>, import('valibot').LiteralSchema<"retrieveRecords", undefined>, import('valibot').LiteralSchema<"upsertRecords", undefined>], undefined>;
30
+ /** Connector data pipeline usage identifiers. */
31
+ export declare const connectorUsageIdSchema: import('valibot').UnionSchema<readonly [import('valibot').LiteralSchema<"bidirectional", undefined>, import('valibot').LiteralSchema<"destination", undefined>, import('valibot').LiteralSchema<"source", undefined>, import('valibot').LiteralSchema<"unknown", undefined>], undefined>;
32
+ /** Top-level connector configuration object. */
26
33
  export declare const connectorConfigSchema: import('valibot').ObjectSchema<{
27
34
  readonly typeId: import('valibot').LiteralSchema<"connector", undefined>;
28
35
  readonly category: import('valibot').NullableSchema<import('valibot').ObjectSchema<{
@@ -1,33 +1,26 @@
1
- import { parse as csvParse } from 'csv-parse/browser/esm';
2
- import { parse as dateFnsParse } from 'date-fns';
3
1
  import { InferOutput } from 'valibot';
4
- import { nanoid } from 'nanoid';
5
2
  import { Component } from '..';
6
- import { buildFetchError, OperationalError } from '../../errors';
3
+ import { connectorConfigSchema } from './connectorConfig.schema';
7
4
  import { ConnectionConfig, ConnectionDescription, ConnectionNodeConfig } from './connection';
8
- import { connectorCategoryIdSchema, connectorConfigSchema, connectorImplementationSchema, connectorOperationNameSchema, connectorUsageIdSchema } from './connectorConfig.schema';
9
5
  import { DataViewContentAuditConfig, ValueDelimiterId } from '../dataView';
10
- import { extractExtensionFromPath, extractNameFromPath, lookupMimeTypeForExtension } from '../../utilities';
11
- /** Interfaces/Types - Connector category identifier. */
12
- export type ConnectorCategoryId = InferOutput<typeof connectorCategoryIdSchema>;
13
- /** Interfaces/Types - Connector operation name. */
14
- export type ConnectorOperationName = InferOutput<typeof connectorOperationNameSchema>;
15
- /** Interfaces/Types - Connector usage identifier. */
16
- export type ConnectorUsageId = InferOutput<typeof connectorUsageIdSchema>;
17
- /** Interfaces/Types - Connector implementation. */
18
- export type ConnectorImplementation = InferOutput<typeof connectorImplementationSchema>;
19
- /** Interfaces/Types - Connector configuration. */
20
- export type ConnectorConfig = InferOutput<typeof connectorConfigSchema>;
21
- export type ConnectorLocalisedConfig = Omit<ConnectorConfig, 'label' | 'description'> & {
6
+ import { ToolConfig } from '../../index';
7
+ /** Authentication method identifiers supported by a connector implementation. */
8
+ /** Connector implementation. */
9
+ /** Category identifiers used for grouping and filtering connectors. */
10
+ /** Operation names a connector may support. */
11
+ /** Connector data pipeline usage identifiers. */
12
+ /** Connector configuration. */
13
+ type ConnectorConfig = InferOutput<typeof connectorConfigSchema>;
14
+ type ConnectorLocalisedConfig = Omit<ConnectorConfig, 'label' | 'description'> & {
22
15
  label: string;
23
16
  description: string;
24
17
  };
25
- /** Interfaces/Types - Connector. */
26
- export interface Connector extends Component {
18
+ /** Connector runtime interface. */
19
+ interface Connector extends Component {
27
20
  abortController?: AbortController;
28
21
  readonly config: ConnectorConfig;
29
22
  readonly connectionConfig: ConnectionConfig;
30
- readonly tools: ConnectorTools;
23
+ readonly toolConfigs: ToolConfig[];
31
24
  abortOperation?(connector: Connector): void;
32
25
  authenticateConnection?(accountId: string, windowCenterX: number, windowCenterY: number): Window;
33
26
  createObject?(connector: Connector, settings: CreateSettings): Promise<void>;
@@ -43,23 +36,6 @@ export interface Connector extends Component {
43
36
  retrieveRecords?(connector: Connector, settings: RetrieveRecordsSettings, chunk: (records: (string[] | Record<string, unknown>)[]) => void, complete: (result: RetrieveRecordsSummary) => void): Promise<void>;
44
37
  upsertRecords?(connector: Connector, settings: UpsertSettings): Promise<void>;
45
38
  }
46
- export interface ConnectorTools {
47
- csvParse: typeof csvParse;
48
- dataPos: {
49
- buildFetchError: typeof buildFetchError;
50
- extractExtensionFromPath: typeof extractExtensionFromPath;
51
- extractNameFromPath: typeof extractNameFromPath;
52
- lookupMimeTypeForExtension: typeof lookupMimeTypeForExtension;
53
- OperationalError: typeof OperationalError;
54
- };
55
- dateFns: {
56
- parse: typeof dateFnsParse;
57
- };
58
- nanoid: typeof nanoid;
59
- }
60
- /** Constants */
61
- export declare const CONNECTOR_DESTINATION_OPERATIONS: string[];
62
- export declare const CONNECTOR_SOURCE_OPERATIONS: string[];
63
39
  export interface InitialiseSettings {
64
40
  connectorStorageURLPrefix: string;
65
41
  }
@@ -174,5 +150,6 @@ export interface ConnectorCallbackData {
174
150
  typeId: string;
175
151
  properties: Record<string, unknown>;
176
152
  }
177
- /** Exposures */
153
+ /** Exports */
154
+ export type { Connector, ConnectorConfig, ConnectorLocalisedConfig };
178
155
  export { connectorConfigSchema } from './connectorConfig.schema';
@@ -8,10 +8,8 @@ export type LocalisedString = Record<LocaleCode, string>;
8
8
  export type { ComponentConfig, ComponentReference, ComponentStatus, ComponentStatusId, ComponentTypeId, ModuleConfig, ModuleTypeId, ComponentStatusColorId } from './component';
9
9
  /** Schemas - Component */
10
10
  export { componentConfigSchema } from './component';
11
- /** Constants - Connector */
12
- export { CONNECTOR_DESTINATION_OPERATIONS, CONNECTOR_SOURCE_OPERATIONS } from './component/connector';
13
11
  /** Interfaces/Types Component - Connector */
14
- export type { AuditContentResult, AuditContentSettings, Connector, ConnectorCallbackData, ConnectorConfig, ConnectorImplementation, ConnectorLocalisedConfig, ConnectorOperationName, ConnectorOperationSettings, ConnectorTools, ConnectorUsageId, CreateSettings, DropSettings, FindResult, FindSettings, GetReadableStreamResult, GetReadableStreamSettings, GetRecordResult, GetRecordSettings, InitialiseSettings, ListResult, ListSettings, PreviewResult, PreviewSettings, RemoveSettings, RetrieveChunksSettings, RetrieveChunksSummary, RetrieveRecordsResult, RetrieveRecordsSettings, RetrieveRecordsSummary, UpsertSettings } from './component/connector';
12
+ export type { AuditContentResult, AuditContentSettings, Connector, ConnectorCallbackData, ConnectorConfig, ConnectorLocalisedConfig, ConnectorOperationSettings, CreateSettings, DropSettings, FindResult, FindSettings, GetReadableStreamResult, GetReadableStreamSettings, GetRecordResult, GetRecordSettings, InitialiseSettings, ListResult, ListSettings, PreviewResult, PreviewSettings, RemoveSettings, RetrieveChunksSettings, RetrieveChunksSummary, RetrieveRecordsResult, RetrieveRecordsSettings, RetrieveRecordsSummary, UpsertSettings } from './component/connector';
15
13
  /** Interfaces/Types - Connection */
16
14
  export type { ConnectionAuthorizationConfig, ConnectionColumnConfig, ConnectionConfig, ConnectionNodeConfig, DPAFileSystemFileHandle, Encoding, StorageTypeId, UsageTypeId } from './component/connector/connection';
17
15
  /** Schemas - Connector */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@datapos/datapos-shared",
3
- "version": "0.3.356",
3
+ "version": "0.3.362",
4
4
  "description": "A library containing common constants, types and utilities used across all Data Positioning projects.",
5
5
  "license": "MIT",
6
6
  "author": "Jonathan Terrell <terrell.jm@gmail.com>",