@dpuse/dpuse-shared 0.3.815 → 0.3.821
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +45 -9
- package/dist/{componentConfig.schema-Dxqinpxy.js → componentConfig.schema-DT3mO5rS.js} +80 -64
- package/dist/componentConfig.schema-DT3mO5rS.js.map +1 -0
- package/dist/dpuse-shared-component.es.js +2 -2
- package/dist/dpuse-shared-component.es.js.map +1 -0
- package/dist/dpuse-shared-componentDataView.es.js +1 -1
- package/dist/dpuse-shared-componentDataView.es.js.map +1 -0
- package/dist/dpuse-shared-componentModuleConnector.es.js +31 -31
- package/dist/dpuse-shared-componentModuleConnector.es.js.map +1 -0
- package/dist/dpuse-shared-componentModuleCookbook.es.js +5 -5
- package/dist/dpuse-shared-componentModuleCookbook.es.js.map +1 -0
- package/dist/dpuse-shared-componentModulePresenter.es.js +6 -6
- package/dist/dpuse-shared-componentModulePresenter.es.js.map +1 -0
- package/dist/dpuse-shared-componentModuleTool.es.js.map +1 -0
- package/dist/dpuse-shared-componentRecipe.es.js.map +1 -0
- package/dist/dpuse-shared-encoding.es.js +229 -121
- package/dist/dpuse-shared-encoding.es.js.map +1 -0
- package/dist/dpuse-shared-errors.es.js.map +1 -0
- package/dist/dpuse-shared-locale.es.js +8 -24
- package/dist/dpuse-shared-locale.es.js.map +1 -0
- package/dist/dpuse-shared-utilities.es.js +4 -11
- package/dist/dpuse-shared-utilities.es.js.map +1 -0
- package/dist/label-DexpXrnC.js +19 -0
- package/dist/label-DexpXrnC.js.map +1 -0
- package/dist/moduleConfig.schema-aYmFWSrn.js +22 -0
- package/dist/moduleConfig.schema-aYmFWSrn.js.map +1 -0
- package/dist/types/src/baseConfig.schema.d.ts +2 -2
- package/dist/types/src/component/componentConfig.schema.d.ts +13 -14
- package/dist/types/src/component/connection/index.d.ts +1 -1
- package/dist/types/src/component/context/model/dimension/hierarchy/index.d.ts +1 -1
- package/dist/types/src/component/context/model/entity/dataItem/index.d.ts +1 -1
- package/dist/types/src/component/context/model/entity/event/index.d.ts +1 -1
- package/dist/types/src/component/context/model/entity/index.d.ts +1 -1
- package/dist/types/src/component/context/model/entity/primaryMeasure/index.d.ts +1 -1
- package/dist/types/src/component/index.d.ts +3 -3
- package/dist/types/src/component/module/connector/connectorConfig.schema.d.ts +14 -14
- package/dist/types/src/component/module/cookbook/cookbookConfig.schema.d.ts +7 -7
- package/dist/types/src/component/module/engine/index.d.ts +3 -2
- package/dist/types/src/component/module/moduleConfig.schema.d.ts +7 -7
- package/dist/types/src/component/module/presenter/presenterConfig.schema.d.ts +7 -7
- package/dist/types/src/encoding/index.d.ts +22 -6
- package/dist/types/src/index.d.ts +2 -2
- package/dist/types/src/locale/index.d.ts +2 -14
- package/dist/types/src/locale/label.d.ts +13 -0
- package/dist/types/src/locale/locale.schema.d.ts +3 -3
- package/package.json +15 -9
- package/dist/moduleConfig.schema-B_EBeUaj.js +0 -22
- package/dist/types/eslint.config.d.ts +0 -3
- package/dist/types/tests/errors/index.test.d.ts +0 -1
- package/dist/types/tests/locale/index.test.d.ts +0 -1
- package/dist/types/tests/schema/index.test.d.ts +0 -1
- package/dist/types/tests/utilities/index.test.d.ts +0 -1
- package/dist/types/vite.config.d.ts +0 -2
- package/dist/types/vitest.config.d.ts +0 -2
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dpuse-shared-component.es.js","names":[],"sources":["../src/component/index.ts"],"sourcesContent":["// ── External Dependencies & Registrations\nimport type { InferOutput } from 'valibot';\nimport { strictObject } from 'valibot';\n\n// ── DPUse Framework\nimport { componentBaseConfigSchema } from '@/component/componentConfig.schema';\nimport { DEFAULT_LOCALE_ID } from '@/locale/label';\nimport type { componentInstanceConfigSchema, componentReferenceConfigSchema, componentStatusColorIdSchema, componentStatusConfigSchema } from '@/component/componentConfig.schema';\nimport type { LocaleId, LocaleLabel } from '@/locale/label';\n\n// ── Schemas ──────────────────────────────────────────────────────────────────────────────────────────────────────────\n\nexport { componentInstanceConfigSchema } from '@/component/componentConfig.schema';\n\n// ── Types ────────────────────────────────────────────────────────────────────────────────────────────────────────────\n\nexport interface Component {\n readonly config: ComponentInstanceConfig;\n}\n\n// ── Types - Base ─────────────────────────────────────────────────────────────────────────────────────────────────────\n\nexport type ComponentBaseConfig = InferOutput<ReturnType<typeof strictObject<typeof componentBaseConfigSchema>>>;\n\n// ── Types - Instance Configuration ───────────────────────────────────────────────────────────────────────────────────\n\nexport type ComponentInstanceConfig = InferOutput<typeof componentInstanceConfigSchema>;\n\n// ── Types - Reference Configuration ──────────────────────────────────────────────────────────────────────────────────\n\nexport type ComponentReferenceConfig = InferOutput<typeof componentReferenceConfigSchema>;\n\n// ── Types - Status ───────────────────────────────────────────────────────────────────────────────────────────────────\n\nexport type ComponentStatus = InferOutput<typeof componentStatusConfigSchema>;\nexport type ComponentStatusColorId = InferOutput<typeof componentStatusColorIdSchema>;\n\n// ── Constants - Status ───────────────────────────────────────────────────────────────────────────────────────────────\n\nconst COMPONENT_STATUS_CONFIGS: { id: string; color: ComponentStatusColorId; labels: LocaleLabel }[] = [\n { id: 'alpha', color: 'danger', labels: { en: 'alpha', es: 'alfa' } },\n { id: 'beta', color: 'warning', labels: { en: 'beta', es: 'beta' } },\n { id: 'releaseCandidate', color: 'success', labels: { en: 'release-candidate', es: 'candidato-de-lanzamiento' } },\n { id: 'generalAvailability', color: 'success', labels: { en: '', es: '' } }\n];\n\n// ── Actions - Status ─────────────────────────────────────────────────────────────────────────────────────────────────\n\nexport function getComponentStatus(id: string, localeId: LocaleId = DEFAULT_LOCALE_ID): ComponentStatus {\n const componentStatus = COMPONENT_STATUS_CONFIGS.find((componentStatus) => componentStatus.id === id);\n if (componentStatus) {\n const label = componentStatus.labels[localeId] ?? componentStatus.labels[DEFAULT_LOCALE_ID] ?? componentStatus.id;\n return { color: componentStatus.color, label };\n }\n return { color: 'danger', label: id };\n}\n"],"mappings":";;;AAuCA,IAAM,IAAiG;CACnG;EAAE,IAAI;EAAS,OAAO;EAAU,QAAQ;GAAE,IAAI;GAAS,IAAI;EAAO;CAAE;CACpE;EAAE,IAAI;EAAQ,OAAO;EAAW,QAAQ;GAAE,IAAI;GAAQ,IAAI;EAAO;CAAE;CACnE;EAAE,IAAI;EAAoB,OAAO;EAAW,QAAQ;GAAE,IAAI;GAAqB,IAAI;EAA2B;CAAE;CAChH;EAAE,IAAI;EAAuB,OAAO;EAAW,QAAQ;GAAE,IAAI;GAAI,IAAI;EAAG;CAAE;AAC9E;AAIA,SAAgB,EAAmB,GAAY,IAAA,MAAyD;CACpG,IAAM,IAAkB,EAAyB,MAAM,MAAoB,EAAgB,OAAO,CAAE;CACpG,IAAI,GAAiB;EACjB,IAAM,IAAQ,EAAgB,OAAO,MAAa,EAAgB,OAAA,MAA6B,EAAgB;EAC/G,OAAO;GAAE,OAAO,EAAgB;GAAO;EAAM;CACjD;CACA,OAAO;EAAE,OAAO;EAAU,OAAO;CAAG;AACxC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { r as e } from "./label-DexpXrnC.js";
|
|
2
2
|
//#region src/component/dataView/index.ts
|
|
3
3
|
e({ en: "Data Positioning Events" }), e({ en: "Delimited Text" }), e({ en: "JSON" }), e({ en: "SPSS" }), e({ en: "XLSX" }), e({ en: "XML" });
|
|
4
4
|
var t = [
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dpuse-shared-componentDataView.es.js","names":[],"sources":["../src/component/dataView/index.ts"],"sourcesContent":["// ── External Dependencies & Registrations\nimport type { FileTypeResult } from 'file-type';\n\n// ── DPUse Framework\nimport type { Component, ComponentInstanceConfig } from '@/component';\nimport type { ConnectionNodeConfig, ObjectColumnConfig } from '@/component/connection';\nimport { createLabelMap, DEFAULT_LOCALE_ID, type LocaleLabelMap, resolveLabel } from '@/locale/label';\n\n// ── Types - Interface ────────────────────────────────────────────────────────────────────────────────────────────────\n\ntype DataViewInterface = Component;\n\n// ── Types - Configuration ────────────────────────────────────────────────────────────────────────────────────────────\n\nexport interface DataViewConfig extends ComponentInstanceConfig {\n typeId: 'dataView';\n connectionId: string | undefined;\n connectionNodeConfig: ConnectionNodeConfig | undefined;\n previewConfig: PreviewConfig | undefined;\n contentAuditConfig: ContentAuditConfig | undefined;\n relationshipsAuditConfig: RelationshipsAuditConfig | undefined;\n}\n\n// ── Types - Preview Configuration ────────────────────────────────────────────────────────────────────────────────────\n\nexport interface PreviewConfig {\n asAt: number;\n commentMarkId?: string | undefined; // TODO: under review.\n commentMarkOtherCharSeq?: string | undefined; // TODO: under review.\n columnConfigs: ObjectColumnConfig[];\n dataFormatId: DataFormatId;\n duration: number;\n encodingConfidenceLevel: number | undefined;\n encodingId: string | undefined;\n errorMessage?: string | undefined; // TODO: under review.\n fileType: FileTypeResult | undefined;\n hasHeaders: boolean | undefined;\n inferenceRecords: InferenceRecord[];\n linesToSkipAtStart?: number | undefined; // TODO: under review.\n parsedRecords: ParsingRecord[];\n quoteEscapeChar?: string | undefined; // TODO: under review.\n quoteMarkId?: string | undefined; // TODO: under review.\n quoteMarkOtherCharSeq?: string | undefined; // TODO: under review.\n recordDelimiterId: RecordDelimiterId | undefined;\n recordDelimiterOtherCharSeq?: string | undefined; // TODO: under review.\n size: number | undefined;\n skipEmptyLines?: boolean | undefined; // TODO: under review.\n skipLinesWithEmptyValues?: boolean | undefined; // TODO: under review.\n skipLinesWithErrors?: boolean | undefined; // TODO: under review.\n text: string | undefined;\n valueDelimiterId: ValueDelimiterId | undefined;\n valueDelimiterOtherCharSeq?: string | undefined; // TODO: under review.\n valueTrimMethodId?: ValueTrimMethodId | undefined; // TODO: under review.\n}\n\nexport type DataFormatId = 'dpe' | 'dtv' | 'json' | 'spss' | 'xlsx' | 'xml' | 'unknown';\n\nexport type ParsingRecord = ParsingResult[];\n\nexport interface ParsingResult {\n value: string | null;\n valueWasQuoted: boolean;\n}\n\nexport type RecordDelimiterId = '\\n' | '\\r' | '\\r\\n'; // TODO: We need a special value here (NOT '') for when a user specified delimiter is implemented.\n\nexport type ValueDelimiterId = '' | ':' | ',' | '!' | '0x1E' | ';' | ' ' | '\\t' | '_' | '0x1F' | '|'; // TODO: We need a special value here (NOT '') for when a user specified delimiter is implemented.\n\nexport type ValueTrimMethodId = 'both' | 'left' | 'right' | 'none';\n\n// ── Types - Content Audit Configuration ──────────────────────────────────────────────────────────────────────────────\n\nexport interface ContentAuditConfig {\n asAt: number;\n columns: ObjectColumnConfig[];\n commentLineCount: number;\n emptyLineCount: number;\n invalidFieldLengthCount: number;\n duration: number;\n lineCount: number;\n recordCount: number;\n}\n\n// ── Types - Relationships Audit Configuration ────────────────────────────────────────────────────────────────────────\n\nexport interface RelationshipsAuditConfig {\n placeholder: string; // TODO\n}\n\n// ── Types - Data Type Identifiers ────────────────────────────────────────────────────────────────────────────────────\n\nexport type DataTypeId = 'boolean' | 'numeric' | 'string' | 'temporal' | 'unknown';\n\nexport type DataSubtypeId = NumericSubtypeId | StringSubtypeId | TemporalSubtypeId;\n\nexport type NumericSubtypeId = 'bigint' | 'integer' | 'decimal';\n\nexport type StringSubtypeId = 'email' | 'ipv4' | 'ipv6' | 'ulid' | 'uuid' | 'url' | 'plain';\n\nexport type TemporalSubtypeId = 'date' | 'dateTime' | 'time';\n\n// ── Types - Data Type Inference ──────────────────────────────────────────────────────────────────────────────────────\n\nexport interface InferenceSummary {\n columnConfigs: ObjectColumnConfig[];\n hasHeaderRow: boolean;\n typedRecords: InferenceRecord[];\n}\n\nexport type InferenceRecord = InferenceResult[];\n\nexport type InferenceResult = BooleanInferenceResult | NumericInferenceResult | StringInferenceResult | TemporalInferenceResult | UnknownInferenceResult;\n\nexport interface BooleanInferenceResult {\n dataTypeId: 'boolean';\n dataSubtypeId: undefined;\n inputValue: string;\n inputValueWasQuoted: boolean;\n inferredValue: boolean;\n}\n\nexport type NumericInferenceResult = BigIntInferenceResult | NumberInferenceResult;\n\nexport interface BigIntInferenceResult {\n dataTypeId: 'numeric';\n dataSubtypeId: 'bigint';\n format: string;\n inputValue: string;\n inputValueWasQuoted: boolean;\n inferredValue: bigint;\n currencySymbolId: string | undefined;\n decimalPlaces: number;\n signId: NumericSignId;\n unitsId: NumericUnitsId;\n}\n\nexport interface NumberInferenceResult {\n dataTypeId: 'numeric';\n dataSubtypeId: 'integer' | 'decimal';\n format: string;\n inputValue: string;\n inputValueWasQuoted: boolean;\n inferredValue: number;\n currencySymbolId: string | undefined;\n decimalPlaces: number;\n signId: NumericSignId;\n unitsId: NumericUnitsId;\n}\n\nexport type NumericSignId = 'negative' | 'zero' | 'positive';\n\nexport type NumericUnitsId = 'currency' | 'percentage' | 'plain';\n\nexport interface StringInferenceResult {\n dataTypeId: 'string';\n dataSubtypeId: StringSubtypeId;\n format: string | undefined;\n inputValue: string;\n inputValueWasQuoted: boolean;\n inferredValue: string;\n}\n\nexport interface TemporalInferenceResult {\n dataTypeId: 'temporal';\n dataSubtypeId: TemporalSubtypeId;\n format: string;\n inputValue: string;\n inputValueWasQuoted: boolean;\n inferredValue: Date;\n}\n\nexport interface UnknownInferenceResult {\n dataTypeId: 'unknown';\n dataSubtypeId: undefined;\n inputValue: string | null;\n inputValueWasQuoted: boolean;\n inferredValue: null;\n}\n\n// ── Constants ────────────────────────────────────────────────────────────────────────────────────────────────────────\n\nconst DATA_FORMATS_CONFIG: { id: DataFormatId; labels: LocaleLabelMap }[] = [\n { id: 'dpe', labels: createLabelMap({ en: 'Data Positioning Events' }) },\n { id: 'dtv', labels: createLabelMap({ en: 'Delimited Text' }) },\n { id: 'json', labels: createLabelMap({ en: 'JSON' }) },\n { id: 'spss', labels: createLabelMap({ en: 'SPSS' }) },\n { id: 'xlsx', labels: createLabelMap({ en: 'XLSX' }) },\n { id: 'xml', labels: createLabelMap({ en: 'XML' }) }\n];\n\nexport const ORDERED_VALUE_DELIMITER_IDS: ValueDelimiterId[] = [',', ';', '\\t', '|', ' ', ':', '_', '!', '0x1F', '0x1E']; // Ordered from estimated most common to least common.\n\nconst RECORD_DELIMITERS_CONFIG: { id: RecordDelimiterId; labels: LocaleLabelMap }[] = [\n { id: '\\n', labels: createLabelMap({ en: 'Newline' }) },\n { id: '\\r', labels: createLabelMap({ en: 'Carriage Return' }) },\n { id: '\\r\\n', labels: createLabelMap({ en: 'Carriage Return/Newline' }) }\n];\n\nconst VALUE_DELIMITERS_CONFIG: { id: ValueDelimiterId; labels: LocaleLabelMap }[] = [\n { id: ':', labels: createLabelMap({ en: 'Colon' }) },\n { id: ',', labels: createLabelMap({ en: 'Comma' }) },\n { id: '!', labels: createLabelMap({ en: 'Exclamation Mark' }) },\n // { id: '', label: { 'en': 'Other' } }, // TODO: Maybe set this to a 'not printing' or special ascii character when there is a user supplied delimited, rather than ''?\n { id: '0x1E', labels: createLabelMap({ en: 'Record Separator' }) },\n { id: ';', labels: createLabelMap({ en: 'Semicolon' }) },\n { id: ' ', labels: createLabelMap({ en: 'Space' }) },\n { id: '\\t', labels: createLabelMap({ en: 'Tab' }) },\n { id: '_', labels: createLabelMap({ en: 'Underscore' }) },\n { id: '0x1F', labels: createLabelMap({ en: 'Unit Separator' }) },\n { id: '|', labels: createLabelMap({ en: 'Vertical Bar' }) }\n];\n\n// ── Actions - Data Format(s) ─────────────────────────────────────────────────────────────────────────────────────────\n\ninterface ObjectDataFormat {\n id: DataFormatId;\n label: string;\n}\n\nfunction getDataFormat(id: DataFormatId, localeId = DEFAULT_LOCALE_ID): ObjectDataFormat {\n const dataFormat = DATA_FORMATS_CONFIG.find((dataFormat) => dataFormat.id === id);\n if (dataFormat) {\n const localizedLabel = resolveLabel(dataFormat.labels, localeId);\n return { id: dataFormat.id, label: localizedLabel ?? dataFormat.id };\n }\n return { id, label: id };\n}\n\nfunction getDataFormats(localeId = DEFAULT_LOCALE_ID): ObjectDataFormat[] {\n const items: ObjectDataFormat[] = [];\n for (const dataFormat of DATA_FORMATS_CONFIG) {\n const localizedLabel = resolveLabel(dataFormat.labels, localeId);\n items.push({ id: dataFormat.id, label: localizedLabel ?? dataFormat.id });\n }\n return items.toSorted((first, second) => first.label.localeCompare(second.label));\n}\n\n// ── Actions - Record Delimiter(s) ────────────────────────────────────────────────────────────────────────────────────\n\ninterface ObjectRecordDelimiter {\n id: RecordDelimiterId;\n label: string;\n}\n\nconst getRecordDelimiter = (id: RecordDelimiterId, localeId = DEFAULT_LOCALE_ID): ObjectRecordDelimiter => {\n const recordDelimiter = RECORD_DELIMITERS_CONFIG.find((recordDelimiter) => recordDelimiter.id === id);\n if (recordDelimiter) {\n const localizedLabel = resolveLabel(recordDelimiter.labels, localeId);\n return { id: recordDelimiter.id, label: localizedLabel ?? recordDelimiter.id };\n }\n return { id, label: id };\n};\n\nconst getRecordDelimiters = (localeId = DEFAULT_LOCALE_ID): ObjectRecordDelimiter[] => {\n const items: ObjectRecordDelimiter[] = [];\n for (const recordDelimiter of RECORD_DELIMITERS_CONFIG) {\n const localizedLabel = resolveLabel(recordDelimiter.labels, localeId);\n items.push({ id: recordDelimiter.id, label: localizedLabel ?? recordDelimiter.id });\n }\n return items.toSorted((first, second) => first.label.localeCompare(second.label));\n};\n\n// ── Actions - Value Delimiter(s) ─────────────────────────────────────────────────────────────────────────────────────\n\ninterface ValueDelimiter {\n id: ValueDelimiterId;\n label: string;\n}\nconst getValueDelimiter = (id: ValueDelimiterId, localeId = DEFAULT_LOCALE_ID): ValueDelimiter => {\n const valueDelimiter = VALUE_DELIMITERS_CONFIG.find((valueDelimiter) => valueDelimiter.id === id);\n if (valueDelimiter) {\n const localizedLabel = resolveLabel(valueDelimiter.labels, localeId);\n return { id: valueDelimiter.id, label: localizedLabel ?? valueDelimiter.id };\n }\n return { id, label: id };\n};\n\nconst getValueDelimiters = (localeId = DEFAULT_LOCALE_ID): ValueDelimiter[] => {\n const items: ValueDelimiter[] = [];\n for (const valueDelimiter of VALUE_DELIMITERS_CONFIG) {\n const localizedLabel = resolveLabel(valueDelimiter.labels, localeId);\n items.push({ id: valueDelimiter.id, label: localizedLabel ?? valueDelimiter.id });\n }\n return items.toSorted((first, second) => first.label.localeCompare(second.label));\n};\n"],"mappings":";;AAsLyB,EAAe,EAAE,IAAI,0BAA0B,CAAC,GAChD,EAAe,EAAE,IAAI,iBAAiB,CAAC,GACtC,EAAe,EAAE,IAAI,OAAO,CAAC,GAC7B,EAAe,EAAE,IAAI,OAAO,CAAC,GAC7B,EAAe,EAAE,IAAI,OAAO,CAAC,GAC9B,EAAe,EAAE,IAAI,MAAM,CAAC;AAGrD,IAAa,IAAkD;CAAC;CAAK;CAAK;CAAM;CAAK;CAAK;CAAK;CAAK;CAAK;CAAQ;AAAM;AAG/F,EAAe,EAAE,IAAI,UAAU,CAAC,GAChC,EAAe,EAAE,IAAI,kBAAkB,CAAC,GACtC,EAAe,EAAE,IAAI,0BAA0B,CAAC,GAInD,EAAe,EAAE,IAAI,QAAQ,CAAC,GAC9B,EAAe,EAAE,IAAI,QAAQ,CAAC,GAC9B,EAAe,EAAE,IAAI,mBAAmB,CAAC,GAEtC,EAAe,EAAE,IAAI,mBAAmB,CAAC,GAC5C,EAAe,EAAE,IAAI,YAAY,CAAC,GAClC,EAAe,EAAE,IAAI,QAAQ,CAAC,GAC7B,EAAe,EAAE,IAAI,MAAM,CAAC,GAC7B,EAAe,EAAE,IAAI,aAAa,CAAC,GAChC,EAAe,EAAE,IAAI,iBAAiB,CAAC,GAC1C,EAAe,EAAE,IAAI,eAAe,CAAC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { a as n, c as r, d as i, f as a, i as o, l as s, m as c, o as l, p as u, s as d, u as f } from "./componentConfig.schema-
|
|
3
|
-
import { t as p } from "./moduleConfig.schema-
|
|
1
|
+
import { i as e, r as t } from "./label-DexpXrnC.js";
|
|
2
|
+
import { a as n, c as r, d as i, f as a, i as o, l as s, m as c, o as l, p as u, s as d, u as f } from "./componentConfig.schema-DT3mO5rS.js";
|
|
3
|
+
import { t as p } from "./moduleConfig.schema-aYmFWSrn.js";
|
|
4
4
|
//#region src/component/module/connector/connectorConfig.schema.ts
|
|
5
5
|
var m = o([
|
|
6
6
|
"abortOperation",
|
|
@@ -23,33 +23,33 @@ var m = o([
|
|
|
23
23
|
"curatedDataset",
|
|
24
24
|
"database",
|
|
25
25
|
"fileStore"
|
|
26
|
-
]), g =
|
|
26
|
+
]), g = u({ label: n }), _ = o([
|
|
27
27
|
"bidirectional",
|
|
28
28
|
"destination",
|
|
29
29
|
"source"
|
|
30
|
-
]), v =
|
|
30
|
+
]), v = u({ label: n }), y = o([
|
|
31
31
|
"apiKey",
|
|
32
32
|
"disabled",
|
|
33
33
|
"oAuth2",
|
|
34
34
|
"none"
|
|
35
|
-
]), b =
|
|
35
|
+
]), b = a(c(), c()), x = u({
|
|
36
36
|
authMethodId: y,
|
|
37
|
-
activeConnectionCount:
|
|
38
|
-
canDescribe:
|
|
39
|
-
id:
|
|
40
|
-
label:
|
|
37
|
+
activeConnectionCount: i(f()),
|
|
38
|
+
canDescribe: i(d()),
|
|
39
|
+
id: i(c()),
|
|
40
|
+
label: i(n),
|
|
41
41
|
maxConnectionCount: s(f()),
|
|
42
|
-
params:
|
|
43
|
-
}),
|
|
42
|
+
params: i(l(b))
|
|
43
|
+
}), S = u({
|
|
44
44
|
...p,
|
|
45
45
|
typeId: r("connector"),
|
|
46
46
|
actionNames: l(m),
|
|
47
47
|
category: s(g),
|
|
48
48
|
categoryId: h,
|
|
49
|
-
implementations:
|
|
49
|
+
implementations: a(c(), x),
|
|
50
50
|
usage: s(v),
|
|
51
51
|
usageId: s(_)
|
|
52
|
-
}),
|
|
52
|
+
}), C = [
|
|
53
53
|
{
|
|
54
54
|
id: "application",
|
|
55
55
|
label: {
|
|
@@ -78,7 +78,7 @@ var m = o([
|
|
|
78
78
|
es: "Almacén de Archivos"
|
|
79
79
|
}
|
|
80
80
|
}
|
|
81
|
-
],
|
|
81
|
+
], w = {
|
|
82
82
|
abortOperation: "Abort Operation",
|
|
83
83
|
auditObjectContent: "Audit Object Content",
|
|
84
84
|
createObject: "Create Object",
|
|
@@ -94,7 +94,7 @@ var m = o([
|
|
|
94
94
|
retrieveChunks: "Retrieve Chunks",
|
|
95
95
|
retrieveRecords: "Retrieve Records",
|
|
96
96
|
upsertRecords: "Upsert Records"
|
|
97
|
-
},
|
|
97
|
+
}, T = [
|
|
98
98
|
{
|
|
99
99
|
id: "bidirectional",
|
|
100
100
|
label: {
|
|
@@ -123,12 +123,12 @@ var m = o([
|
|
|
123
123
|
es: "Desconocido"
|
|
124
124
|
}
|
|
125
125
|
}
|
|
126
|
-
],
|
|
126
|
+
], E = /* @__PURE__ */ new Set([
|
|
127
127
|
"createObject",
|
|
128
128
|
"dropObject",
|
|
129
129
|
"removeRecords",
|
|
130
130
|
"upsertRecords"
|
|
131
|
-
]),
|
|
131
|
+
]), D = /* @__PURE__ */ new Set([
|
|
132
132
|
"auditObjectContent",
|
|
133
133
|
"findObject",
|
|
134
134
|
"getInfo",
|
|
@@ -139,17 +139,17 @@ var m = o([
|
|
|
139
139
|
"retrieveChunks",
|
|
140
140
|
"retrieveRecords"
|
|
141
141
|
]);
|
|
142
|
-
function
|
|
142
|
+
function O(e) {
|
|
143
143
|
let t = !1, n = !1;
|
|
144
|
-
for (let r of e)
|
|
144
|
+
for (let r of e) D.has(r) && (t = !0), E.has(r) && (n = !0);
|
|
145
145
|
return t && n ? "bidirectional" : t ? "source" : n ? "destination" : "source";
|
|
146
146
|
}
|
|
147
|
-
var
|
|
148
|
-
let i =
|
|
147
|
+
var k = (n, r = "en") => {
|
|
148
|
+
let i = C.find((e) => e.id === n);
|
|
149
149
|
if (i) {
|
|
150
|
-
let n =
|
|
150
|
+
let n = t(i.label);
|
|
151
151
|
return {
|
|
152
|
-
label:
|
|
152
|
+
label: e(n, r) ?? i.id,
|
|
153
153
|
description: ""
|
|
154
154
|
};
|
|
155
155
|
}
|
|
@@ -157,12 +157,12 @@ var O = (n, r = "en") => {
|
|
|
157
157
|
label: n,
|
|
158
158
|
description: ""
|
|
159
159
|
};
|
|
160
|
-
},
|
|
161
|
-
let i =
|
|
160
|
+
}, A = (n, r = "en") => {
|
|
161
|
+
let i = T.find((e) => e.id === n);
|
|
162
162
|
if (i) {
|
|
163
|
-
let n =
|
|
163
|
+
let n = t(i.label);
|
|
164
164
|
return {
|
|
165
|
-
label:
|
|
165
|
+
label: e(n, r) ?? i.id,
|
|
166
166
|
description: ""
|
|
167
167
|
};
|
|
168
168
|
}
|
|
@@ -171,11 +171,11 @@ var O = (n, r = "en") => {
|
|
|
171
171
|
description: ""
|
|
172
172
|
};
|
|
173
173
|
};
|
|
174
|
-
function
|
|
174
|
+
function j(e) {
|
|
175
175
|
let t = new Set(e), n = "|Action|Supported|\n";
|
|
176
176
|
n += "|:----|:-------:|\n";
|
|
177
|
-
for (let e of Object.keys(
|
|
177
|
+
for (let e of Object.keys(w)) n += `| ${w[e]} | ${t.has(e) ? "✓" : ""} |\n`;
|
|
178
178
|
return n;
|
|
179
179
|
}
|
|
180
180
|
//#endregion
|
|
181
|
-
export {
|
|
181
|
+
export { w as CONNECTOR_ACTION_NAME_MAP, S as connectorConfigSchema, k as constructConnectorCategoryConfig, A as constructConnectorUsageConfig, O as determineConnectorUsageId, j as getConnectorActionsTable };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dpuse-shared-componentModuleConnector.es.js","names":[],"sources":["../src/component/module/connector/connectorConfig.schema.ts","../src/component/module/connector/index.ts"],"sourcesContent":["/**\n * Defines the configuration metadata for a connector. Used for validation\n * of connector manifests and capability discovery at runtime.\n */\n\n// ── External Dependencies & Registrations\nimport { array, boolean, literal, nullable, number, optional, record, strictObject, string } from 'valibot';\n\n// ── DPUse Framework\nimport { literalUnion } from '@/schema';\nimport { localeLabelSchema } from '@/locale/locale.schema';\nimport { moduleConfigCoreFields } from '@/component/module/moduleConfig.schema';\n\n// ── Schemas - Action Name ────────────────────────────────────────────────────────────────────────────────────────────\n\n// Names of the operations a connector may implement.\nexport const connectorActionNameSchema = literalUnion([\n 'abortOperation',\n 'auditObjectContent',\n 'createObject',\n 'describeConnection',\n 'dropObject',\n 'findObject',\n 'getInfo',\n 'getReadableStream',\n 'getRecord',\n 'listNodes',\n 'previewObject',\n 'removeRecords',\n 'retrieveChunks',\n 'retrieveRecords',\n 'upsertRecords'\n]);\n\n// ── Schemas - Category Configuration ─────────────────────────────────────────────────────────────────────────────────\n\nconst connectorCategoryIdSchema = literalUnion(['application', 'curatedDataset', 'database', 'fileStore']); // Category identifiers used for grouping and filtering connectors.\n\nexport const connectorCategoryConfigSchema = strictObject({\n label: localeLabelSchema\n});\n\n// ── Schemas - Usage ──────────────────────────────────────────────────────────────────────────────────────────────────\n\nexport const connectorUsageIdSchema = literalUnion(['bidirectional', 'destination', 'source']); // Connector data pipeline usage identifiers.\n\nexport const connectorUsageConfigSchema = strictObject({\n label: localeLabelSchema\n});\n\n// ── Schemas - Implementation ─────────────────────────────────────────────────────────────────────────────────────────\n\nconst connectorAuthMethodIdSchema = literalUnion(['apiKey', 'disabled', 'oAuth2', 'none']); // Authentication method identifiers supported by a connector implementation.\n\nconst connectorImplementationParametersSchema = record(string(), string()); // One set of implementation parameters, keyed by name.\n\n// A connector implementation variant. A single connector may expose multiple implementations differing by auth method, limits, or vendor-specific behavior.\nconst connectorImplementationSchema = strictObject({\n authMethodId: connectorAuthMethodIdSchema,\n activeConnectionCount: optional(number()),\n canDescribe: optional(boolean()),\n id: optional(string()),\n label: optional(localeLabelSchema),\n maxConnectionCount: nullable(number()),\n params: optional(array(connectorImplementationParametersSchema))\n});\n\n// ── Schemas - Configuration ──────────────────────────────────────────────────────────────────────────────────────────\n\nexport const connectorConfigSchema = strictObject({\n ...moduleConfigCoreFields,\n typeId: literal('connector'),\n actionNames: array(connectorActionNameSchema),\n category: nullable(connectorCategoryConfigSchema),\n categoryId: connectorCategoryIdSchema,\n implementations: record(string(), connectorImplementationSchema),\n usage: nullable(connectorUsageConfigSchema),\n usageId: nullable(connectorUsageIdSchema)\n});\n","// ── External Dependencies & Registrations\nimport type { InferOutput } from 'valibot';\n\n// ── DPUse Framework\nimport type { Component } from '@/component';\nimport type { EngineConnectorActionOptions } from '@/component/module/engine';\nimport type { ToolConfig } from '@/component/module/tool';\nimport type { ConnectionDescriptionConfig, ConnectionNodeConfig, ObjectColumnConfig } from '@/component/connection';\nimport type {\n connectorActionNameSchema,\n connectorCategoryConfigSchema,\n connectorConfigSchema,\n connectorUsageConfigSchema,\n connectorUsageIdSchema\n} from '@/component/module/connector/connectorConfig.schema';\nimport type { ContentAuditConfig, InferenceRecord, InferenceSummary, ParsingRecord, PreviewConfig, ValueDelimiterId } from '@/component/dataView';\nimport { createLabelMap, DEFAULT_LOCALE_ID, type LocaleLabel, resolveLabel } from '@/locale/label';\nimport type { LocalisedConfig } from '@/locale';\n\n// ── Schemas ──────────────────────────────────────────────────────────────────────────────────────────────────────────\n\nexport { connectorConfigSchema } from '@/component/module/connector/connectorConfig.schema';\n\n// ── Types - Interface ────────────────────────────────────────────────────────────────────────────────────────────────\n\nexport interface ConnectorInterface extends Component {\n abortController: AbortController | undefined;\n readonly config: ConnectorConfig;\n readonly toolConfigs: ToolConfig[];\n abortOperation?(): void; // Abort the active long running action.\n auditObjectContent?(options: AuditObjectContentOptions, chunk: (rowCount: number) => void): Promise<AuditObjectContentResult>;\n createObject?(options: CreateObjectOptions): Promise<void>; // Create an object for a specified connection.\n describeConnection?(options: DescribeConnectionOptions): Promise<DescribeConnectionResult>; // Describe a specified connection.\n dropObject?(options: DropObjectOptions): Promise<void>; // Drop (delete) an object for a specified connection.\n findObject?(options: FindObjectOptions): Promise<FindObjectResult>; // Find an object for a specified connection.\n getInfo?(options: GetInfoOptions): Promise<GetInfoResult>; // Get metadata/info for a node (at any hierarchy level) for a specified connection.\n getReadableStream?(options: GetReadableStreamOptions): Promise<ReadableStream<Uint8Array>>; // Get a reader that can retrieve all records from an object for a specified connection.\n getRecord?(options: GetRecordOptions): Promise<GetRecordResult>; // Get a record for an object for a specified connection.\n listNodes?(options: ListNodesOptions): Promise<ListNodesResult>; // List nodes in a folder for a specified connection.\n previewObject?(options: PreviewObjectOptions): Promise<PreviewConfig>; // Preview an object for a specified connection.\n removeRecords?(options: RemoveRecordsOptions): Promise<void>; // Remove one or more records from an object for a specified connection.\n retrieveChunks?(options: RetrieveChunksOptions, chunk: (data: Uint8Array) => void, complete: () => void): Promise<void>; // Retrieve all chunks from an object for a specified connection.\n retrieveRecords?(\n options: RetrieveRecordsOptions,\n chunk: (typeId: RecordRetrievalTypeId, records: Record<string, unknown>[] | ParsingRecord[]) => void,\n complete: (result: RetrieveRecordsSummary) => void\n ): Promise<void>; // Retrieve all records from an object for a specified connection.\n upsertRecords?(options: UpsertRecordsOptions): Promise<void>; // Upsert one or more records into an object for a specified connection.\n}\n\nexport type ConnectorActionName = InferOutput<typeof connectorActionNameSchema>; // Names of the actions a connector may implement.\n\nexport type ConnectorConstructor = new (connectorUtilities: ConnectorUtilities, toolConfigs: ToolConfig[]) => ConnectorInterface;\n\nexport interface ConnectorUtilities {\n hasReadableStreamTransferSupport(): boolean;\n inferValues: (parsedRecord: ParsingRecord, columnConfigs: ObjectColumnConfig[], hasLeadingRecord: boolean) => InferenceRecord;\n inferDataTypes: (parsedRecords: ParsingRecord[]) => InferenceSummary;\n}\n\n// ── Types - Configuration ────────────────────────────────────────────────────────────────────────────────────────────\n\nexport type ConnectorConfig = InferOutput<typeof connectorConfigSchema>;\n\ntype ConnectorCategoryConfig = InferOutput<typeof connectorCategoryConfigSchema>;\n\ntype ConnectorUsageConfig = InferOutput<typeof connectorUsageConfigSchema>;\n\n// ── Types - Action - Audit Object Content ────────────────────────────────────────────────────────────────────────────\n\nexport interface AuditObjectContentOptions1 extends EngineConnectorActionOptions {\n chunkSize: number | undefined;\n encodingId: string;\n path: string;\n valueDelimiterId: ValueDelimiterId;\n}\nexport interface AuditObjectContentResult1 {\n contentAuditConfig: ContentAuditConfig;\n}\n\nexport interface AuditObjectContentOptions extends EngineConnectorActionOptions {\n chunkSize: number | undefined;\n encodingId: string;\n parsingToolName: string | undefined;\n path: string;\n supportsTransferableStreams: boolean;\n valueDelimiterId: ValueDelimiterId;\n}\nexport interface AuditObjectContentResult {\n processedRowCount: number;\n durationMs: number;\n}\n\n// ── Types - Action - Create Object ───────────────────────────────────────────────────────────────────────────────────\n\nexport interface CreateObjectOptions extends EngineConnectorActionOptions {\n path: string;\n structure: string;\n}\n\n// ── Types - Action - Describe Connection ─────────────────────────────────────────────────────────────────────────────\n\nexport type DescribeConnectionOptions = EngineConnectorActionOptions;\n\ninterface DescribeConnectionResult {\n descriptionConfig: ConnectionDescriptionConfig;\n}\n\n// ── Types - Action - Drop Object ─────────────────────────────────────────────────────────────────────────────────────\n\nexport interface DropObjectOptions extends EngineConnectorActionOptions {\n path: string;\n}\n\n// ── Types - Action - Find Object ─────────────────────────────────────────────────────────────────────────────────────\n\nexport interface FindObjectOptions extends EngineConnectorActionOptions {\n storeId: string | undefined;\n nodeId: string;\n}\nexport interface FindObjectResult {\n path: string | undefined;\n}\n\n// ── Types - Action - Get Info ────────────────────────────────────────────────────────────────────────────────────────\n\nexport interface GetInfoOptions extends EngineConnectorActionOptions {\n path: string;\n}\nexport interface GetInfoResult {\n info: Record<string, unknown>; // Raw, connector-specific metadata — not yet normalized to a common shape.\n}\n\n// ── Types - Action - Get Readable Stream ─────────────────────────────────────────────────────────────────────────────\n\nexport interface GetReadableStreamOptions extends EngineConnectorActionOptions {\n id: string;\n path: string;\n}\n\n// ── Types - Action - Get Record ──────────────────────────────────────────────────────────────────────────────────────\n\nexport interface GetRecordOptions extends EngineConnectorActionOptions {\n id: string;\n path: string;\n}\nexport interface GetRecordResult {\n record?: string[] | Record<string, unknown>;\n}\n\n// ── Types - Action - List Nodes ──────────────────────────────────────────────────────────────────────────────────────\n\nexport interface ListNodesOptions extends EngineConnectorActionOptions {\n folderPath: string;\n limit?: number;\n offset?: number;\n totalCount?: number;\n}\nexport interface ListNodesResult {\n cursor: string | number | undefined;\n connectionNodeConfigs: ConnectionNodeConfig[];\n isMore: boolean;\n totalCount: number;\n}\n\n// ── Types - Action - Preview Object ──────────────────────────────────────────────────────────────────────────────────\n\nexport interface PreviewObjectOptions extends EngineConnectorActionOptions {\n chunkSize: number | undefined;\n extension: string | undefined;\n path: string;\n}\n\n// ── Types - Action - Remove Records ──────────────────────────────────────────────────────────────────────────────────\n\nexport interface RemoveRecordsOptions extends EngineConnectorActionOptions {\n keys: string[];\n path: string;\n}\n\n// ── Types - Action - Retrieve Chunks ─────────────────────────────────────────────────────────────────────────────────\n\nexport interface RetrieveChunksOptions extends EngineConnectorActionOptions {\n chunkSize: number | undefined;\n encodingId: string;\n path: string;\n valueDelimiterId: ValueDelimiterId;\n}\n\n// ── Types - Action - Retrieve Records ────────────────────────────────────────────────────────────────────────────────\n\nexport interface RetrieveRecordsOptions extends EngineConnectorActionOptions {\n chunkSize: number | undefined;\n encodingId: string;\n path: string;\n valueDelimiterId: ValueDelimiterId;\n}\nexport interface RetrieveRecordsSummary {\n byteCount: number; // Number of processed bytes.\n commentLineCount: number; // Count the number of lines being fully commented.\n emptyLineCount: number; // Count the number of processed empty lines; work only with the skip_empty_lines option or an error will be thrown if an empty line is found.\n lineCount: number; // Number of lines encountered in the source dataset, start at 1 for the first line.\n nonUniformRecordCount: number; // Number of non uniform records when relax_column_count is true.\n recordCount: number; // Count the number of processed records.\n}\n\nexport type RecordRetrievalTypeId = 'jsonRecordArray' | 'parsingRecordArray';\n\n// ── Types - Action - Upsert Records ──────────────────────────────────────────────────────────────────────────────────\n\nexport interface UpsertRecordsOptions extends EngineConnectorActionOptions {\n records: Record<string, unknown>[];\n path: string;\n}\n\n// ── Constants ────────────────────────────────────────────────────────────────────────────────────────────────────────\n\nconst CONNECTOR_CATEGORY_CONFIGS: { id: string; label: LocaleLabel }[] = [\n { id: 'application', label: { en: 'Application', es: 'Aplicación' } },\n { id: 'curatedDataset', label: { en: 'Curated Dataset', es: 'Conjunto de Datos Curado' } },\n { id: 'database', label: { en: 'Database', es: 'Base de Datos' } },\n { id: 'fileStore', label: { en: 'File Store', es: 'Almacén de Archivos' } }\n];\n\nexport const CONNECTOR_ACTION_NAME_MAP: Record<ConnectorActionName, string> = {\n abortOperation: 'Abort Operation',\n auditObjectContent: 'Audit Object Content',\n createObject: 'Create Object',\n describeConnection: 'Describe Connection',\n dropObject: 'Drop Object',\n findObject: 'Find Object',\n getInfo: 'Get Info',\n getReadableStream: 'Get Readable Stream',\n getRecord: 'Get Record',\n listNodes: 'List Nodes',\n previewObject: 'Preview Object',\n removeRecords: 'Remove Records',\n retrieveChunks: 'Retrieve Chunks',\n retrieveRecords: 'Retrieve Records',\n upsertRecords: 'Upsert Records'\n};\n\nconst CONNECTOR_USAGE_CONFIGS: { id: string; label: LocaleLabel }[] = [\n { id: 'bidirectional', label: { en: 'Bidirectional', es: 'Bidireccional' } },\n { id: 'destination', label: { en: 'Destination', es: 'Destino' } },\n { id: 'source', label: { en: 'Source', es: 'Origen' } },\n { id: 'unknown', label: { en: 'Unknown', es: 'Desconocido' } }\n];\n\nconst CONNECTOR_DESTINATION_OPERATIONS = new Set<ConnectorActionName>(['createObject', 'dropObject', 'removeRecords', 'upsertRecords']);\nconst CONNECTOR_SOURCE_OPERATIONS = new Set<ConnectorActionName>([\n 'auditObjectContent',\n 'findObject',\n 'getInfo',\n 'getReadableStream',\n 'getRecord',\n 'listNodes',\n 'previewObject',\n 'retrieveChunks',\n 'retrieveRecords'\n]);\n\n// ── Types - Usage ────────────────────────────────────────────────────────────────────────────────────────────────────\n\nexport type ConnectorUsageId = InferOutput<typeof connectorUsageIdSchema>;\n\n// ── Actions ──────────────────────────────────────────────────────────────────────────────────────────────────────────\n\n// Determines whether a connector is a source, destination, or bidirectional connector, based on the actions it implements.\nexport function determineConnectorUsageId(actionNames: ConnectorActionName[]): ConnectorUsageId {\n let isSourceOperation = false;\n let isDestinationOperation = false;\n for (const actionName of actionNames) {\n if (CONNECTOR_SOURCE_OPERATIONS.has(actionName)) isSourceOperation = true;\n if (CONNECTOR_DESTINATION_OPERATIONS.has(actionName)) isDestinationOperation = true;\n }\n if (isSourceOperation && isDestinationOperation) return 'bidirectional';\n if (isSourceOperation) return 'source';\n return isDestinationOperation ? 'destination' : 'source';\n}\n\nexport const constructConnectorCategoryConfig = (id: string, localeId = DEFAULT_LOCALE_ID): LocalisedConfig<ConnectorCategoryConfig> => {\n const connectorCategory = CONNECTOR_CATEGORY_CONFIGS.find((connectorCategory) => connectorCategory.id === id);\n if (connectorCategory) {\n const labelMap = createLabelMap(connectorCategory.label);\n const localizedLabel = resolveLabel(labelMap, localeId);\n return { label: localizedLabel ?? connectorCategory.id, description: '' };\n }\n return { label: id, description: '' };\n};\n\nexport const constructConnectorUsageConfig = (id: string, localeId = DEFAULT_LOCALE_ID): LocalisedConfig<ConnectorUsageConfig> => {\n const connectorUsage = CONNECTOR_USAGE_CONFIGS.find((connectorUsage) => connectorUsage.id === id);\n if (connectorUsage) {\n const labelMap = createLabelMap(connectorUsage.label);\n const localizedLabel = resolveLabel(labelMap, localeId);\n return { label: localizedLabel ?? connectorUsage.id, description: '' };\n }\n return { label: id, description: '' };\n};\n\nexport function getConnectorActionsTable(supported: ConnectorActionName[]): string {\n const supportedSet = new Set(supported);\n let md = '|Action|Supported|\\n';\n md += '|:----|:-------:|\\n';\n for (const id of Object.keys(CONNECTOR_ACTION_NAME_MAP) as ConnectorActionName[]) {\n md += `| ${CONNECTOR_ACTION_NAME_MAP[id]} | ${supportedSet.has(id) ? '✓' : ''} |\\n`;\n }\n return md;\n}\n"],"mappings":"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"}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { c as e,
|
|
2
|
-
import { t as a } from "./moduleConfig.schema-
|
|
1
|
+
import { c as e, i as t, o as n, p as r, r as i } from "./componentConfig.schema-DT3mO5rS.js";
|
|
2
|
+
import { t as a } from "./moduleConfig.schema-aYmFWSrn.js";
|
|
3
3
|
//#region src/component/module/cookbook/cookbookConfig.schema.ts
|
|
4
|
-
var o =
|
|
4
|
+
var o = t(["list"]), s = r({
|
|
5
5
|
...a,
|
|
6
6
|
typeId: e("cookbook"),
|
|
7
|
-
actionNames:
|
|
8
|
-
recipes:
|
|
7
|
+
actionNames: n(o),
|
|
8
|
+
recipes: n(i)
|
|
9
9
|
});
|
|
10
10
|
//#endregion
|
|
11
11
|
export { s as cookbookConfigSchema };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dpuse-shared-componentModuleCookbook.es.js","names":[],"sources":["../src/component/module/cookbook/cookbookConfig.schema.ts"],"sourcesContent":["// ── External Dependencies & Registrations\nimport { array, literal, strictObject } from 'valibot';\n\n// ── DPUse Framework\nimport { componentReferenceConfigSchema } from '@/component/componentConfig.schema';\nimport { literalUnion } from '@/schema';\nimport { moduleConfigCoreFields } from '@/component/module/moduleConfig.schema';\n\n// ── Schemas - Action Name ────────────────────────────────────────────────────────────────────────────────────────────\n\nexport const cookbookActionNameSchema = literalUnion(['list']);\n\n// ── Schemas - Configuration ──────────────────────────────────────────────────────────────────────────────────────────\n\nexport const cookbookConfigSchema = strictObject({\n ...moduleConfigCoreFields,\n typeId: literal('cookbook'),\n actionNames: array(cookbookActionNameSchema),\n recipes: array(componentReferenceConfigSchema)\n});\n"],"mappings":";;;AAUA,IAAa,IAA2B,EAAa,CAAC,MAAM,CAAC,GAIhD,IAAuB,EAAa;CAC7C,GAAG;CACH,QAAQ,EAAQ,UAAU;CAC1B,aAAa,EAAM,CAAwB;CAC3C,SAAS,EAAM,CAA8B;AACjD,CAAC"}
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import { c as e,
|
|
2
|
-
import { t as a } from "./moduleConfig.schema-
|
|
1
|
+
import { c as e, i as t, o as n, p as r, r as i } from "./componentConfig.schema-DT3mO5rS.js";
|
|
2
|
+
import { t as a } from "./moduleConfig.schema-aYmFWSrn.js";
|
|
3
3
|
//#region src/component/module/presenter/presenterConfig.schema.ts
|
|
4
|
-
var o =
|
|
4
|
+
var o = t([
|
|
5
5
|
"list",
|
|
6
6
|
"render",
|
|
7
7
|
"setColorMode"
|
|
8
|
-
]), s =
|
|
8
|
+
]), s = r({
|
|
9
9
|
...a,
|
|
10
10
|
typeId: e("presenter"),
|
|
11
|
-
actionNames:
|
|
12
|
-
presentations:
|
|
11
|
+
actionNames: n(o),
|
|
12
|
+
presentations: n(i)
|
|
13
13
|
});
|
|
14
14
|
//#endregion
|
|
15
15
|
export { s as presenterConfigSchema };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dpuse-shared-componentModulePresenter.es.js","names":[],"sources":["../src/component/module/presenter/presenterConfig.schema.ts"],"sourcesContent":["// ── External Dependencies & Registrations\nimport { array, literal, strictObject } from 'valibot';\n\n// ── DPUse Framework\nimport { componentReferenceConfigSchema } from '@/component/componentConfig.schema';\nimport { literalUnion } from '@/schema';\nimport { moduleConfigCoreFields } from '@/component/module/moduleConfig.schema';\n\n// ── Schemas - Action Name ────────────────────────────────────────────────────────────────────────────────────────────\n\nexport const presenterActionNameSchema = literalUnion(['list', 'render', 'setColorMode']);\n\n// ── Schemas - Configuration ──────────────────────────────────────────────────────────────────────────────────────────\n\nexport const presenterConfigSchema = strictObject({\n ...moduleConfigCoreFields,\n typeId: literal('presenter'),\n actionNames: array(presenterActionNameSchema),\n presentations: array(componentReferenceConfigSchema)\n});\n"],"mappings":";;;AAUA,IAAa,IAA4B,EAAa;CAAC;CAAQ;CAAU;AAAc,CAAC,GAI3E,IAAwB,EAAa;CAC9C,GAAG;CACH,QAAQ,EAAQ,WAAW;CAC3B,aAAa,EAAM,CAAyB;CAC5C,eAAe,EAAM,CAA8B;AACvD,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dpuse-shared-componentModuleTool.es.js","names":[],"sources":["../src/component/module/tool/index.ts"],"sourcesContent":["// ── DPUse Framework\nimport { AppError } from '@/errors';\nimport type { Component } from '@/component';\nimport type { ModuleConfig } from '@/component/module';\n\n// ── Types - Interface ────────────────────────────────────────────────────────────────────────────────────────────────\n\ntype ToolInterface = Component;\n\n// ── Types - Configuration ────────────────────────────────────────────────────────────────────────────────────────────\n\nexport interface ToolConfig extends ModuleConfig {\n typeId: 'tool';\n}\n\n// ── Constants ────────────────────────────────────────────────────────────────────────────────────────────────────────\n\nconst LOAD_URL_PREFIX = 'https://engine-eu.dpuse.app/tools';\n\n// ── Actions ──────────────────────────────────────────────────────────────────────────────────────────────────────────\n\n// Dynamically load tool.\nexport async function loadTool<T>(toolConfigs: ToolConfig[], toolId: string): Promise<T> {\n const toolName = `dpuse-tool-${toolId}`;\n const toolModuleConfig = toolConfigs.find((config) => config.id === toolName);\n // Carries a locator and the ids that were available for the same reason the import failure below does: this is\n // thrown out of a shared module into a caller that can only report what the error itself says.\n if (!toolModuleConfig) {\n const data = { availableToolIds: toolConfigs.map((config) => config.id), toolName };\n throw new AppError(`Tool '${toolId}' not found.`, 'dpuse-shared.component.module.tool.loadTool', data);\n }\n\n const url = `${LOAD_URL_PREFIX}/${toolId}_v${toolModuleConfig.version}/${toolName}.es.js`;\n try {\n const toolModule = (await import(/* @vite-ignore */ url)) as { Tool: new () => T };\n return new toolModule.Tool();\n } catch (error) {\n // A bare import rejection says only 'Failed to fetch dynamically imported module', which names neither the\n // tool nor the version. The caller reports and displays this error but has no other way to identify the\n // module that went missing, so the identifying detail has to be attached here.\n const data = { toolName, url, version: toolModuleConfig.version };\n throw new AppError(`Failed to load tool '${toolName}' v${toolModuleConfig.version}.`, 'dpuse-shared.component.module.tool.loadTool', data, { cause: error });\n }\n}\n"],"mappings":";;AAiBA,IAAM,IAAkB;AAKxB,eAAsB,EAAY,GAA2B,GAA4B;CACrF,IAAM,IAAW,cAAc,KACzB,IAAmB,EAAY,MAAM,MAAW,EAAO,OAAO,CAAQ;CAG5E,IAAI,CAAC,GAAkB;EACnB,IAAM,IAAO;GAAE,kBAAkB,EAAY,KAAK,MAAW,EAAO,EAAE;GAAG;EAAS;EAClF,MAAM,IAAI,EAAS,SAAS,EAAO,eAAe,+CAA+C,CAAI;CACzG;CAEA,IAAM,IAAM,GAAG,EAAgB,GAAG,EAAO,IAAI,EAAiB,QAAQ,GAAG,EAAS;CAClF,IAAI;EAEA,OAAO,KAAI,OADe;;GAA0B;GACzC,CAAW,KAAK;CAC/B,SAAS,GAAO;EAIZ,IAAM,IAAO;GAAE;GAAU;GAAK,SAAS,EAAiB;EAAQ;EAChE,MAAM,IAAI,EAAS,wBAAwB,EAAS,KAAK,EAAiB,QAAQ,IAAI,+CAA+C,GAAM,EAAE,OAAO,EAAM,CAAC;CAC/J;AACJ"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dpuse-shared-componentRecipe.es.js","names":[],"sources":["../src/component/recipe/index.ts"],"sourcesContent":["const PLACEHOLDER = '';\nexport { PLACEHOLDER };\n"],"mappings":";AAAA,IAAM,IAAc"}
|