@magda/connector-sdk 2.3.3 → 3.0.0-alpha.1
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/dist/index-web.d.ts +7 -185
- package/dist/index.d.ts +92 -107
- package/dist/index.js +57071 -93460
- package/package.json +20 -15
- package/dist/index-web.js +0 -33304
package/dist/index-web.d.ts
CHANGED
|
@@ -1,185 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
export
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
/**
|
|
10
|
-
* A type of aspect in the registry, unique for a tenant.
|
|
11
|
-
*/
|
|
12
|
-
export declare class AspectDefinition {
|
|
13
|
-
/**
|
|
14
|
-
* The identifier for the aspect type.
|
|
15
|
-
*/
|
|
16
|
-
'id': string;
|
|
17
|
-
/**
|
|
18
|
-
* The name of the aspect.
|
|
19
|
-
*/
|
|
20
|
-
'name': string;
|
|
21
|
-
/**
|
|
22
|
-
* The JSON Schema of this aspect.
|
|
23
|
-
*/
|
|
24
|
-
'jsonSchema': any;
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
export declare abstract class BuilderFunctionParameters {
|
|
28
|
-
/**
|
|
29
|
-
* The result of invoking the {@link AspectBuilder#setupFunctionString}, or undefined if there is no
|
|
30
|
-
* {@link AspectBuilder#setupFunctionString} defined for this builder.
|
|
31
|
-
*
|
|
32
|
-
* @type {*}
|
|
33
|
-
* @memberOf BuilderFunctionParameters
|
|
34
|
-
*/
|
|
35
|
-
setup: any;
|
|
36
|
-
/**
|
|
37
|
-
* The transformer that is building aspects.
|
|
38
|
-
*
|
|
39
|
-
* @type {JsonTransformer}
|
|
40
|
-
* @memberof BuilderFunctionParameters
|
|
41
|
-
*/
|
|
42
|
-
transformer: JsonTransformer;
|
|
43
|
-
/**
|
|
44
|
-
* Reports a non-fatal problem creating an aspect.
|
|
45
|
-
*
|
|
46
|
-
* @type {ReportProblem}
|
|
47
|
-
* @memberOf BuilderFunctionParameters
|
|
48
|
-
*/
|
|
49
|
-
reportProblem: ReportProblem;
|
|
50
|
-
/**
|
|
51
|
-
* Provides access to utility libraries that may be helpful in building aspects.
|
|
52
|
-
*
|
|
53
|
-
* @type {BuilderFunctionLibraries}
|
|
54
|
-
* @memberOf BuilderFunctionParameters
|
|
55
|
-
*/
|
|
56
|
-
libraries: object;
|
|
57
|
-
[propName: string]: any;
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
export declare interface BuilderSetupFunctionParameters {
|
|
61
|
-
/**
|
|
62
|
-
* The transformer that is building aspects.
|
|
63
|
-
*
|
|
64
|
-
* @type {JsonTransformer}
|
|
65
|
-
* @memberof BuilderFunctionParameters
|
|
66
|
-
*/
|
|
67
|
-
transformer: JsonTransformer;
|
|
68
|
-
/**
|
|
69
|
-
* Provides access to utility libraries that may be helpful in setting up the builder.
|
|
70
|
-
*
|
|
71
|
-
* @type {BuilderFunctionLibraries}
|
|
72
|
-
* @memberOf BuilderFunctionParameters
|
|
73
|
-
*/
|
|
74
|
-
libraries: object;
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
export declare function buildersToCompiledAspects(builders: AspectBuilder[], setupParameters: BuilderSetupFunctionParameters, buildParameters: BuilderFunctionParameters): CompiledAspects;
|
|
78
|
-
|
|
79
|
-
export declare function cleanOrgTitle(title: string): string;
|
|
80
|
-
|
|
81
|
-
declare interface CompiledAspect {
|
|
82
|
-
id: string;
|
|
83
|
-
builderFunction: Function;
|
|
84
|
-
setupResult: any;
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
export declare interface CompiledAspects {
|
|
88
|
-
parameterNames: string[];
|
|
89
|
-
parameters: BuilderFunctionParameters;
|
|
90
|
-
aspects: CompiledAspect[];
|
|
91
|
-
}
|
|
92
|
-
|
|
93
|
-
export declare class ConnectorRecordId {
|
|
94
|
-
readonly id: string;
|
|
95
|
-
readonly type: RecordType;
|
|
96
|
-
readonly sourceId: string;
|
|
97
|
-
constructor(id: string, type: RecordType, sourceId: string);
|
|
98
|
-
toString(): string;
|
|
99
|
-
private get typeId();
|
|
100
|
-
}
|
|
101
|
-
|
|
102
|
-
/**
|
|
103
|
-
* A base class for transformers for most any JSON-based catalog source.
|
|
104
|
-
* A transformer takes source data and transforms it to registry records and aspects.
|
|
105
|
-
*/
|
|
106
|
-
export declare abstract class JsonTransformer {
|
|
107
|
-
readonly sourceId: string;
|
|
108
|
-
private datasetAspectBuilders;
|
|
109
|
-
private distributionAspectBuilders;
|
|
110
|
-
private organizationAspectBuilders;
|
|
111
|
-
private organizationAspects;
|
|
112
|
-
private datasetAspects;
|
|
113
|
-
private distributionAspects;
|
|
114
|
-
private tenantId;
|
|
115
|
-
constructor({ sourceId, libraries, datasetAspectBuilders, distributionAspectBuilders, organizationAspectBuilders }: JsonTransformerOptions);
|
|
116
|
-
/**
|
|
117
|
-
* Create a {@link Record} from JSON data representing an organization.
|
|
118
|
-
*
|
|
119
|
-
* @param {string} id The ID of the record.
|
|
120
|
-
* @param {string} name The name of the record.
|
|
121
|
-
* @param {object} jsonOrganization The JSON data representing the organization.
|
|
122
|
-
* @returns {Record} The record.
|
|
123
|
-
*
|
|
124
|
-
* @memberof JsonConnector
|
|
125
|
-
*/
|
|
126
|
-
organizationJsonToRecord(jsonOrganization: object): Record_2;
|
|
127
|
-
datasetJsonToRecord(jsonDataset: object): Record_2;
|
|
128
|
-
distributionJsonToRecord(jsonDistribution: object, jsonDataset: object): Record_2;
|
|
129
|
-
getRequiredAspectDefinitions(): AspectDefinition[];
|
|
130
|
-
abstract getIdFromJsonOrganization(jsonOrganization: any, sourceId: string): ConnectorRecordId;
|
|
131
|
-
abstract getIdFromJsonDataset(jsonDataset: any, sourceId: string): ConnectorRecordId;
|
|
132
|
-
abstract getIdFromJsonDistribution(jsonDistribution: any, jsonDataset: any, sourceId: string): ConnectorRecordId;
|
|
133
|
-
abstract getNameFromJsonOrganization(jsonOrganization: any): string;
|
|
134
|
-
abstract getNameFromJsonDataset(jsonDataset: any): string;
|
|
135
|
-
abstract getNameFromJsonDistribution(jsonDistribution: any, jsonDataset: any): string;
|
|
136
|
-
reviseOrganizationRecord(record: Record_2): Record_2;
|
|
137
|
-
jsonToRecord(id: ConnectorRecordId, name: string, json: any, aspects: CompiledAspects): Record_2;
|
|
138
|
-
}
|
|
139
|
-
|
|
140
|
-
export declare interface JsonTransformerOptions {
|
|
141
|
-
sourceId: string;
|
|
142
|
-
libraries?: object;
|
|
143
|
-
datasetAspectBuilders?: AspectBuilder[];
|
|
144
|
-
distributionAspectBuilders?: AspectBuilder[];
|
|
145
|
-
organizationAspectBuilders?: AspectBuilder[];
|
|
146
|
-
maxConcurrency?: number;
|
|
147
|
-
tenantId: number;
|
|
148
|
-
}
|
|
149
|
-
|
|
150
|
-
/**
|
|
151
|
-
* A record in the registry, usually including data for one or more aspects, unique for a tenant.
|
|
152
|
-
*/
|
|
153
|
-
declare class Record_2 {
|
|
154
|
-
/**
|
|
155
|
-
* The identifier of the record
|
|
156
|
-
*/
|
|
157
|
-
'id': string;
|
|
158
|
-
/**
|
|
159
|
-
* The name of the record
|
|
160
|
-
*/
|
|
161
|
-
'name': string;
|
|
162
|
-
/**
|
|
163
|
-
* The aspects included in this record
|
|
164
|
-
*/
|
|
165
|
-
'aspects': any;
|
|
166
|
-
/**
|
|
167
|
-
* A tag representing the action by the source of this record (e.g. an id for a individual crawl of a data portal).
|
|
168
|
-
*/
|
|
169
|
-
'sourceTag': string;
|
|
170
|
-
/**
|
|
171
|
-
* The identifier of a tenant
|
|
172
|
-
*/
|
|
173
|
-
'tenantId': number;
|
|
174
|
-
}
|
|
175
|
-
export { Record_2 as Record }
|
|
176
|
-
|
|
177
|
-
declare type RecordType = "Organization" | "Dataset" | "Distribution" | "Group";
|
|
178
|
-
|
|
179
|
-
declare interface ReportProblem {
|
|
180
|
-
(title: string, message?: string, additionalInfo?: any): void;
|
|
181
|
-
}
|
|
182
|
-
|
|
183
|
-
export declare const TenantConsts: any;
|
|
184
|
-
|
|
185
|
-
export { }
|
|
1
|
+
export { Record, AspectDefinition } from "@magda/typescript-common/dist/generated/registry/api.js";
|
|
2
|
+
export { default as ConnectorRecordId } from "@magda/typescript-common/dist/ConnectorRecordId.js";
|
|
3
|
+
export { default as cleanOrgTitle } from "@magda/typescript-common/dist/util/cleanOrgTitle.js";
|
|
4
|
+
export { default as JsonTransformer, buildersToCompiledAspects, JsonTransformerOptions, CompiledAspects, BuilderSetupFunctionParameters, BuilderFunctionParameters } from "@magda/typescript-common/dist/JsonTransformer.js";
|
|
5
|
+
import AspectBuilder from "@magda/typescript-common/dist/AspectBuilder.js";
|
|
6
|
+
export { AspectBuilder };
|
|
7
|
+
export declare const TenantConsts: any;
|