@dpuse/dpuse-shared 0.3.673 → 0.3.675

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.
@@ -35,23 +35,17 @@ var m = n([
35
35
  "retrieveChunks",
36
36
  "retrieveRecords",
37
37
  "upsertRecords"
38
- ]), v = n([
39
- "bidirectional",
40
- "destination",
41
- "source",
42
- "unknown"
43
- ]), y = i({
38
+ ]), v = i({
44
39
  ...p,
45
40
  typeId: r("connector"),
46
41
  category: s(h),
47
42
  categoryId: m,
48
43
  implementations: u(c(), g),
49
44
  operations: l(_),
50
- usageId: v,
51
45
  vendorAccountURL: s(c()),
52
46
  vendorDocumentationURL: s(c()),
53
47
  vendorHomeURL: s(c())
54
- }), b = [
48
+ }), y = [
55
49
  {
56
50
  id: "application",
57
51
  label: {
@@ -80,8 +74,8 @@ var m = n([
80
74
  es: "Almacén de Archivos"
81
75
  }
82
76
  }
83
- ], x = (n, r = "en") => {
84
- let i = b.find((e) => e.id === n);
77
+ ], b = (n, r = "en") => {
78
+ let i = y.find((e) => e.id === n);
85
79
  return i ? {
86
80
  label: t(e(i.label), r) ?? i.id,
87
81
  description: []
@@ -89,6 +83,27 @@ var m = n([
89
83
  label: n,
90
84
  description: []
91
85
  };
86
+ }, x = {
87
+ abortOperation: "Abort Operation",
88
+ auditObjectContent: "Audit Object Content",
89
+ createObject: "Create Object",
90
+ describeConnection: "Describe Connection",
91
+ dropObject: "Drop Object",
92
+ findObject: "Find Object",
93
+ getReadableStream: "Get Readable Stream",
94
+ getRecord: "Get Record",
95
+ listNodes: "List Nodes",
96
+ previewObject: "Preview Object",
97
+ removeRecords: "Remove Records",
98
+ retrieveChunks: "Retrieve Chunks",
99
+ retrieveRecords: "Retrieve Records",
100
+ upsertRecords: "Upsert Records"
92
101
  };
102
+ function S(e) {
103
+ let t = new Set(e), n = "| Operation | Supported |\n";
104
+ n += "| --------- | --------- |\n";
105
+ for (let e of Object.keys(x)) n += `| ${x[e]} | ${t.has(e) ? "✓" : ""} |\n`;
106
+ return n;
107
+ }
93
108
  //#endregion
94
- export { y as connectorConfigSchema, x as constructConnectorCategoryConfig };
109
+ export { x as CONNECTOR_OPERATION_LABELS, v as connectorConfigSchema, b as constructConnectorCategoryConfig, S as generateConnectorOperationsTable };
@@ -11,27 +11,30 @@ var e = "en", t = [{
11
11
  function n(e) {
12
12
  return new Map(Object.entries(e));
13
13
  }
14
- function r(e, t) {
14
+ function r(e) {
15
+ return Array.isArray(e) ? e : e == null ? [] : [e];
16
+ }
17
+ function i(e, t) {
15
18
  return {
16
19
  ...e,
17
20
  label: e.label[t] ?? e.id,
18
- description: e.description[t] ?? [],
21
+ description: r(e.description[t]),
19
22
  verb: e.verb?.[t] ?? void 0
20
23
  };
21
24
  }
22
- function i(e, t, n = !1) {
23
- let r = e.map((e) => ({
25
+ function a(e, t, n = !1) {
26
+ let i = e.map((e) => ({
24
27
  ...e,
25
28
  label: e.label[t] ?? e.id,
26
- description: e.description[t] ?? [],
29
+ description: r(e.description[t]),
27
30
  verb: e.verb?.[t] ?? void 0
28
31
  }));
29
- return n ? r.toSorted((e, t) => e.label.localeCompare(t.label) || e.id.localeCompare(t.id)) : r;
32
+ return n ? i.toSorted((e, t) => e.label.localeCompare(t.label) || e.id.localeCompare(t.id)) : i;
30
33
  }
31
- function a(e, t, n = "en") {
34
+ function o(e, t, n = "en") {
32
35
  let r = e.get(t);
33
36
  if (r !== void 0) return r;
34
37
  if (n !== t) return e.get(n);
35
38
  }
36
39
  //#endregion
37
- export { e as DEFAULT_LOCALE_ID, t as SUPPORTED_LANGUAGES, n as createLabelMap, r as localiseConfig, i as localiseConfigs, a as resolveLabel };
40
+ export { e as DEFAULT_LOCALE_ID, t as SUPPORTED_LANGUAGES, n as createLabelMap, i as localiseConfig, a as localiseConfigs, o as resolveLabel };
@@ -9,7 +9,6 @@ export declare const connectorCategoryConfigSchema: import('valibot').ObjectSche
9
9
  }, undefined>;
10
10
  }, undefined>;
11
11
  export declare const connectorOperationNameSchema: import('valibot').UnionSchema<readonly [import('valibot').LiteralSchema<"abortOperation", undefined>, import('valibot').LiteralSchema<"auditObjectContent", 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>;
12
- 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>;
13
12
  export declare const connectorConfigSchema: import('valibot').ObjectSchema<{
14
13
  readonly typeId: import('valibot').LiteralSchema<"connector", undefined>;
15
14
  readonly category: import('valibot').NullableSchema<import('valibot').ObjectSchema<{
@@ -32,7 +31,6 @@ export declare const connectorConfigSchema: import('valibot').ObjectSchema<{
32
31
  readonly params: import('valibot').OptionalSchema<import('valibot').ArraySchema<import('valibot').RecordSchema<import('valibot').StringSchema<undefined>, import('valibot').StringSchema<undefined>, undefined>, undefined>, undefined>;
33
32
  }, undefined>, undefined>;
34
33
  readonly operations: import('valibot').ArraySchema<import('valibot').UnionSchema<readonly [import('valibot').LiteralSchema<"abortOperation", undefined>, import('valibot').LiteralSchema<"auditObjectContent", 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>, undefined>;
35
- readonly usageId: 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>;
36
34
  readonly vendorAccountURL: import('valibot').NullableSchema<import('valibot').StringSchema<undefined>, undefined>;
37
35
  readonly vendorDocumentationURL: import('valibot').NullableSchema<import('valibot').StringSchema<undefined>, undefined>;
38
36
  readonly vendorHomeURL: import('valibot').NullableSchema<import('valibot').StringSchema<undefined>, undefined>;
@@ -3,7 +3,7 @@ import { Component } from '../..';
3
3
  import { EngineConnectorActionOptions } from '../../../engine';
4
4
  import { ToolConfig } from '../tool';
5
5
  import { ConnectionDescriptionConfig, ConnectionNodeConfig, ObjectColumnConfig } from '../../connection';
6
- import { connectorCategoryConfigSchema, connectorConfigSchema, connectorOperationNameSchema, connectorUsageIdSchema } from './connectorConfig.schema';
6
+ import { connectorCategoryConfigSchema, connectorConfigSchema, connectorOperationNameSchema } from './connectorConfig.schema';
7
7
  import { ContentAuditConfig, InferenceRecord, InferenceSummary, ParsingRecord, PreviewConfig, ValueDelimiterId } from '../../dataView';
8
8
  import { LocalisedConfig } from '../../../locale';
9
9
  export { connectorConfigSchema } from './connectorConfig.schema';
@@ -31,6 +31,8 @@ export type ConnectorConfig = InferOutput<typeof connectorConfigSchema>;
31
31
  type ConnectorCategoryConfig = InferOutput<typeof connectorCategoryConfigSchema>;
32
32
  export declare const constructConnectorCategoryConfig: (id: string, localeId?: import('../../../locale').LocaleId) => LocalisedConfig<ConnectorCategoryConfig>;
33
33
  export type ConnectorOperationName = InferOutput<typeof connectorOperationNameSchema>;
34
+ export declare const CONNECTOR_OPERATION_LABELS: Record<ConnectorOperationName, string>;
35
+ export declare function generateConnectorOperationsTable(supported: ConnectorOperationName[]): string;
34
36
  export interface AuditObjectContentOptions1 extends EngineConnectorActionOptions {
35
37
  chunkSize: number | undefined;
36
38
  encodingId: string;
@@ -127,7 +129,6 @@ export interface UpsertRecordsOptions extends EngineConnectorActionOptions {
127
129
  path: string;
128
130
  }
129
131
  export type RetrievalTypeId = 'jsonRecordArray' | 'parsingRecordArray';
130
- export type ConnectorUsageId = InferOutput<typeof connectorUsageIdSchema>;
131
132
  export interface ConnectorUtilities {
132
133
  hasReadableStreamTransferSupport(): boolean;
133
134
  inferValues: (parsedRecord: ParsingRecord, columnConfigs: ObjectColumnConfig[], leadingRecord: boolean) => InferenceRecord;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dpuse/dpuse-shared",
3
- "version": "0.3.673",
3
+ "version": "0.3.675",
4
4
  "description": "Common constants, types and utilities used across all DPUse projects.",
5
5
  "license": "MIT",
6
6
  "author": "Jonathan Terrell <terrell.jm@gmail.com>",