@hpcc-js/ddl-shim 3.3.2 → 3.3.4

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,395 +1,395 @@
1
- export type RowType = { [key: string]: any; };
2
-
3
- // Fields ==============================================================
4
- export type Number64 = string;
5
- export type Range = [number | string, number | string];
6
- export type Dataset = any[];
7
- export type IFieldType = "boolean" | "number" | "number64" | "string" | "range" | "dataset" | "object";
8
-
9
- export interface IFieldBoolean {
10
- type: "boolean";
11
- id: string;
12
- default?: boolean;
13
- }
14
-
15
- export interface IFieldNumber {
16
- type: "number";
17
- id: string;
18
- default?: number;
19
- }
20
-
21
- export interface IFieldNumber64 {
22
- type: "number64";
23
- id: string;
24
- default?: Number64;
25
- }
26
-
27
- export interface IFieldString {
28
- type: "string";
29
- id: string;
30
- default?: string;
31
- }
32
-
33
- export interface IFieldRange {
34
- type: "range";
35
- id: string;
36
- default?: Range;
37
- }
38
-
39
- export interface IFieldDataset {
40
- type: "dataset";
41
- id: string;
42
- default?: Dataset;
43
- children: IField[];
44
- }
45
-
46
- export interface IFieldObject {
47
- type: "object";
48
- id: string;
49
- default?: object;
50
- fields: { [key: string]: IField };
51
- }
52
-
53
- export type IField = IFieldBoolean | IFieldNumber | IFieldNumber64 | IFieldString | IFieldRange | IFieldDataset | IFieldObject;
54
-
55
- // Datasources ==============================================================
56
- export type IServiceType = "wuresult" | "hipie" | "roxie";
57
- export type IDatasourceType = IServiceType | "logicalfile" | "form" | "databomb";
58
- export type DatasourceType = ILogicalFile | IForm | IDatabomb | IWUResult | IHipieService | IRoxieService;
59
-
60
- export interface IDatasource {
61
- type: IDatasourceType;
62
- id: string;
63
- fields: IField[];
64
- }
65
-
66
- export interface IESPService extends IDatasource {
67
- url: string;
68
- }
69
-
70
- export interface IService {
71
- type: IServiceType;
72
- id: string;
73
- url: string;
74
- }
75
-
76
- export interface IOutput {
77
- fields: IField[];
78
- }
79
-
80
- export type OutputDict = { [key: string]: IOutput };
81
-
82
- export interface IWUResult extends IService {
83
- type: "wuresult";
84
- wuid: string;
85
- outputs: OutputDict;
86
- }
87
-
88
- export interface ILogicalFile extends IESPService {
89
- type: "logicalfile";
90
- logicalFile: string;
91
- }
92
-
93
- export interface IRoxieService extends IService {
94
- type: "roxie";
95
- querySet: string;
96
- queryID: string;
97
- inputs: IField[];
98
- outputs: OutputDict;
99
- }
100
-
101
- export interface IHipieService extends IService {
102
- type: "hipie";
103
- querySet: string;
104
- queryID: string;
105
- inputs: IField[];
106
- outputs: OutputDict;
107
- }
108
-
109
- export interface IForm extends IDatasource {
110
- type: "form";
111
- }
112
-
113
- export type IDatabombFormat = "csv" | "tsv" | "json";
114
- export interface IDatabomb extends IDatasource {
115
- type: "databomb";
116
- format: IDatabombFormat;
117
- payload?: string;
118
- }
119
-
120
- // IDatasorceRef ---
121
- export interface IDatasourceBaseRef {
122
- id: string;
123
- }
124
-
125
- export interface IDatabombRef extends IDatasourceBaseRef {
126
- }
127
-
128
- export interface IWUResultRef extends IDatasourceBaseRef {
129
- output: string;
130
- }
131
-
132
- export interface IRequestField {
133
- source: string;
134
- remoteFieldID: string;
135
- localFieldID: string;
136
- }
137
-
138
- export interface IRoxieServiceRef extends IDatasourceBaseRef {
139
- request: IRequestField[];
140
- output: string;
141
- }
142
-
143
- export type IDatasourceRef = IDatabombRef | IWUResultRef | IRoxieServiceRef;
144
-
145
- export function isDatabombRef(ref: IDatasourceRef): ref is IDatabombRef {
146
- return !isWUResultRef(ref) && !isRoxieServiceRef(ref);
147
- }
148
-
149
- export function isWUResultRef(ref: IDatasourceRef): ref is IWUResultRef {
150
- return (ref as IWUResultRef).output !== undefined && !isRoxieServiceRef(ref);
151
- }
152
-
153
- export function isRoxieServiceRef(ref: IDatasourceRef): ref is IRoxieServiceRef {
154
- return (ref as IRoxieServiceRef).request !== undefined;
155
- }
156
-
157
- // Activities ===============================================================
158
- export type IActivityType = "filter" | "project" | "groupby" | "sort" | "limit" | "mappings";
159
- export type ActivityType = IFilter | IProject | IGroupBy | ISort | ILimit | IMappings;
160
-
161
- export interface IActivity {
162
- type: IActivityType;
163
- }
164
-
165
- // Filter ===================================================================
166
- export type IMappingConditionType = "==" | "!=" | ">" | ">=" | "<" | "<=" | "range" | "in";
167
- export interface IMapping {
168
- remoteFieldID: string;
169
- localFieldID: string;
170
- condition: IMappingConditionType;
171
- nullable: boolean;
172
- }
173
-
174
- export interface IFilterCondition {
175
- viewID: string;
176
- mappings: IMapping[];
177
- }
178
-
179
- export interface IFilter extends IActivity {
180
- type: "filter";
181
- conditions: IFilterCondition[];
182
- }
183
- export function isFilterActivity(activity: IActivity): activity is IFilter {
184
- return activity.type === "filter";
185
- }
186
-
187
- // Project ==================================================================
188
- export interface IEquals {
189
- fieldID: string;
190
- type: "=";
191
- sourceFieldID: string;
192
- transformations?: MultiTransformationType[];
193
- }
194
- export type ICalculatedType = "+" | "-" | "*" | "/";
195
- export interface ICalculated {
196
- fieldID: string;
197
- type: ICalculatedType;
198
- sourceFieldID1: string;
199
- sourceFieldID2: string;
200
- }
201
-
202
- export interface IScale {
203
- fieldID: string;
204
- type: "scale";
205
- sourceFieldID: string;
206
- factor: number;
207
- }
208
-
209
- export interface ITemplate {
210
- fieldID: string;
211
- type: "template";
212
- template: string;
213
- }
214
-
215
- export interface IMapMapping {
216
- value: any;
217
- newValue: any;
218
- }
219
-
220
- export interface IMap {
221
- fieldID: string;
222
- type: "map";
223
- sourceFieldID: string;
224
- default: any;
225
- mappings: IMapMapping[];
226
- }
227
-
228
- export type MultiTransformationType = IEquals | ICalculated | IScale | ITemplate | IMap;
229
- export interface IMulti {
230
- fieldID: string;
231
- type: "multi";
232
- transformations: MultiTransformationType[];
233
- }
234
-
235
- export type ProjectTransformationType = MultiTransformationType | IMulti;
236
- export interface IProject extends IActivity {
237
- type: "project";
238
- transformations: ProjectTransformationType[];
239
- }
240
- export function isProjectActivity(activity: IActivity): activity is IProject {
241
- return activity.type === "project";
242
- }
243
- export interface IMappings extends IActivity {
244
- type: "mappings";
245
- transformations: ProjectTransformationType[];
246
- }
247
- export function isMappingsActivity(activity: IActivity): activity is IMappings {
248
- return activity.type === "mappings";
249
- }
250
- // GroupBy ==================================================================
251
- export type IAggregateType = "min" | "max" | "sum" | "mean" | "variance" | "deviation";
252
- export interface IAggregate {
253
- fieldID: string;
254
- type: IAggregateType;
255
- inFieldID: string;
256
- baseCountFieldID?: string;
257
- }
258
-
259
- export interface ICount {
260
- fieldID: string;
261
- type: "count";
262
- }
263
-
264
- export type AggregateType = IAggregate | ICount;
265
-
266
- export interface IGroupBy extends IActivity {
267
- type: "groupby";
268
- groupByIDs: string[];
269
- aggregates: AggregateType[];
270
- }
271
- export function isGroupByActivity(activity: IActivity): activity is IGroupBy {
272
- return activity.type === "groupby";
273
- }
274
-
275
- // Sort =====================================================================
276
- export interface ISortCondition {
277
- fieldID: string;
278
- descending: boolean;
279
- }
280
-
281
- export interface ISort extends IActivity {
282
- type: "sort";
283
- conditions: ISortCondition[];
284
- }
285
- export function isSortActivity(activity: IActivity): activity is ISort {
286
- return activity.type === "sort";
287
- }
288
-
289
- // Limit ====================================================================
290
- export interface ILimit extends IActivity {
291
- type: "limit";
292
- limit: number;
293
- }
294
- export function isLimitActivity(activity: IActivity): activity is ILimit {
295
- return activity.type === "limit";
296
- }
297
-
298
- // Visualization ============================================================
299
- export interface IWidgetProperties {
300
- __class: string;
301
- [propID: string]: string | string[] | number | boolean | undefined | IWidgetProperties | IWidgetProperties[];
302
- }
303
-
304
- export interface IWidget {
305
- id: string;
306
- chartType: string;
307
- __class: string;
308
- properties: IWidgetProperties;
309
- }
310
-
311
- export type VisibilityType = "normal" | "flyout";
312
- export const VisibilitySet: VisibilityType[] = ["normal", "flyout"];
313
-
314
- export interface IVisualization extends IWidget {
315
- title: string;
316
- description?: string;
317
- visibility: VisibilityType;
318
- mappings: IMappings;
319
- }
320
-
321
- // View =====================================================================
322
- export interface IView {
323
- id: string;
324
- datasource: IDatasourceRef;
325
- activities: ActivityType[];
326
- visualization: IVisualization;
327
- }
328
-
329
- // DDL ======================================================================
330
- export interface IProperties {
331
- [propID: string]: any;
332
- }
333
-
334
- export interface Schema {
335
- version: "2.0.23";
336
- createdBy: {
337
- name: string;
338
- version: string;
339
- };
340
- datasources: DatasourceType[];
341
- dataviews: IView[];
342
- properties?: IProperties;
343
- hipieProperties?: IProperties;
344
-
345
- // The following defs are only provided to assist the Java code generation (from the the generated schema) ---
346
- defs?: {
347
- fieldTypes: {
348
- number64: Number64;
349
- range: Range;
350
- dataset: Dataset;
351
- fieldType: IFieldType;
352
- fieldBoolean: IFieldBoolean;
353
- fieldNumber: IFieldNumber;
354
- fieldNumber64: IFieldNumber64
355
- fieldString: IFieldString;
356
- fieldRange: IFieldRange;
357
- fieldDataset: IFieldDataset;
358
- fieldObject: IFieldObject;
359
- field: IField;
360
- };
361
- datasourceTypes: {
362
- datasource: IDatasource;
363
- logicalFile: ILogicalFile;
364
- form: IForm;
365
- databomb: IDatabomb;
366
- wuresult: IWUResult;
367
- hipieService: IHipieService;
368
- roxieService: IRoxieService;
369
- };
370
- datasourceRefTypes: {
371
- wuResultRef: IWUResultRef;
372
- roxieServiceRef: IRoxieServiceRef;
373
- };
374
- activityTypes: {
375
- filter: IFilter;
376
- project: IProject;
377
- groupby: IGroupBy;
378
- sort: ISort;
379
- limit: ILimit;
380
- mappings: IMappings;
381
- };
382
- aggregateTypes: {
383
- aggregate: IAggregate;
384
- count: ICount;
385
- };
386
- transformationTypes: {
387
- equals: IEquals;
388
- calculated: ICalculated;
389
- scale: IScale;
390
- template: ITemplate;
391
- map: IMap;
392
- multi: IMulti;
393
- };
394
- };
395
- }
1
+ export type RowType = { [key: string]: any; };
2
+
3
+ // Fields ==============================================================
4
+ export type Number64 = string;
5
+ export type Range = [number | string, number | string];
6
+ export type Dataset = any[];
7
+ export type IFieldType = "boolean" | "number" | "number64" | "string" | "range" | "dataset" | "object";
8
+
9
+ export interface IFieldBoolean {
10
+ type: "boolean";
11
+ id: string;
12
+ default?: boolean;
13
+ }
14
+
15
+ export interface IFieldNumber {
16
+ type: "number";
17
+ id: string;
18
+ default?: number;
19
+ }
20
+
21
+ export interface IFieldNumber64 {
22
+ type: "number64";
23
+ id: string;
24
+ default?: Number64;
25
+ }
26
+
27
+ export interface IFieldString {
28
+ type: "string";
29
+ id: string;
30
+ default?: string;
31
+ }
32
+
33
+ export interface IFieldRange {
34
+ type: "range";
35
+ id: string;
36
+ default?: Range;
37
+ }
38
+
39
+ export interface IFieldDataset {
40
+ type: "dataset";
41
+ id: string;
42
+ default?: Dataset;
43
+ children: IField[];
44
+ }
45
+
46
+ export interface IFieldObject {
47
+ type: "object";
48
+ id: string;
49
+ default?: object;
50
+ fields: { [key: string]: IField };
51
+ }
52
+
53
+ export type IField = IFieldBoolean | IFieldNumber | IFieldNumber64 | IFieldString | IFieldRange | IFieldDataset | IFieldObject;
54
+
55
+ // Datasources ==============================================================
56
+ export type IServiceType = "wuresult" | "hipie" | "roxie";
57
+ export type IDatasourceType = IServiceType | "logicalfile" | "form" | "databomb";
58
+ export type DatasourceType = ILogicalFile | IForm | IDatabomb | IWUResult | IHipieService | IRoxieService;
59
+
60
+ export interface IDatasource {
61
+ type: IDatasourceType;
62
+ id: string;
63
+ fields: IField[];
64
+ }
65
+
66
+ export interface IESPService extends IDatasource {
67
+ url: string;
68
+ }
69
+
70
+ export interface IService {
71
+ type: IServiceType;
72
+ id: string;
73
+ url: string;
74
+ }
75
+
76
+ export interface IOutput {
77
+ fields: IField[];
78
+ }
79
+
80
+ export type OutputDict = { [key: string]: IOutput };
81
+
82
+ export interface IWUResult extends IService {
83
+ type: "wuresult";
84
+ wuid: string;
85
+ outputs: OutputDict;
86
+ }
87
+
88
+ export interface ILogicalFile extends IESPService {
89
+ type: "logicalfile";
90
+ logicalFile: string;
91
+ }
92
+
93
+ export interface IRoxieService extends IService {
94
+ type: "roxie";
95
+ querySet: string;
96
+ queryID: string;
97
+ inputs: IField[];
98
+ outputs: OutputDict;
99
+ }
100
+
101
+ export interface IHipieService extends IService {
102
+ type: "hipie";
103
+ querySet: string;
104
+ queryID: string;
105
+ inputs: IField[];
106
+ outputs: OutputDict;
107
+ }
108
+
109
+ export interface IForm extends IDatasource {
110
+ type: "form";
111
+ }
112
+
113
+ export type IDatabombFormat = "csv" | "tsv" | "json";
114
+ export interface IDatabomb extends IDatasource {
115
+ type: "databomb";
116
+ format: IDatabombFormat;
117
+ payload?: string;
118
+ }
119
+
120
+ // IDatasorceRef ---
121
+ export interface IDatasourceBaseRef {
122
+ id: string;
123
+ }
124
+
125
+ export interface IDatabombRef extends IDatasourceBaseRef {
126
+ }
127
+
128
+ export interface IWUResultRef extends IDatasourceBaseRef {
129
+ output: string;
130
+ }
131
+
132
+ export interface IRequestField {
133
+ source: string;
134
+ remoteFieldID: string;
135
+ localFieldID: string;
136
+ }
137
+
138
+ export interface IRoxieServiceRef extends IDatasourceBaseRef {
139
+ request: IRequestField[];
140
+ output: string;
141
+ }
142
+
143
+ export type IDatasourceRef = IDatabombRef | IWUResultRef | IRoxieServiceRef;
144
+
145
+ export function isDatabombRef(ref: IDatasourceRef): ref is IDatabombRef {
146
+ return !isWUResultRef(ref) && !isRoxieServiceRef(ref);
147
+ }
148
+
149
+ export function isWUResultRef(ref: IDatasourceRef): ref is IWUResultRef {
150
+ return (ref as IWUResultRef).output !== undefined && !isRoxieServiceRef(ref);
151
+ }
152
+
153
+ export function isRoxieServiceRef(ref: IDatasourceRef): ref is IRoxieServiceRef {
154
+ return (ref as IRoxieServiceRef).request !== undefined;
155
+ }
156
+
157
+ // Activities ===============================================================
158
+ export type IActivityType = "filter" | "project" | "groupby" | "sort" | "limit" | "mappings";
159
+ export type ActivityType = IFilter | IProject | IGroupBy | ISort | ILimit | IMappings;
160
+
161
+ export interface IActivity {
162
+ type: IActivityType;
163
+ }
164
+
165
+ // Filter ===================================================================
166
+ export type IMappingConditionType = "==" | "!=" | ">" | ">=" | "<" | "<=" | "range" | "in";
167
+ export interface IMapping {
168
+ remoteFieldID: string;
169
+ localFieldID: string;
170
+ condition: IMappingConditionType;
171
+ nullable: boolean;
172
+ }
173
+
174
+ export interface IFilterCondition {
175
+ viewID: string;
176
+ mappings: IMapping[];
177
+ }
178
+
179
+ export interface IFilter extends IActivity {
180
+ type: "filter";
181
+ conditions: IFilterCondition[];
182
+ }
183
+ export function isFilterActivity(activity: IActivity): activity is IFilter {
184
+ return activity.type === "filter";
185
+ }
186
+
187
+ // Project ==================================================================
188
+ export interface IEquals {
189
+ fieldID: string;
190
+ type: "=";
191
+ sourceFieldID: string;
192
+ transformations?: MultiTransformationType[];
193
+ }
194
+ export type ICalculatedType = "+" | "-" | "*" | "/";
195
+ export interface ICalculated {
196
+ fieldID: string;
197
+ type: ICalculatedType;
198
+ sourceFieldID1: string;
199
+ sourceFieldID2: string;
200
+ }
201
+
202
+ export interface IScale {
203
+ fieldID: string;
204
+ type: "scale";
205
+ sourceFieldID: string;
206
+ factor: number;
207
+ }
208
+
209
+ export interface ITemplate {
210
+ fieldID: string;
211
+ type: "template";
212
+ template: string;
213
+ }
214
+
215
+ export interface IMapMapping {
216
+ value: any;
217
+ newValue: any;
218
+ }
219
+
220
+ export interface IMap {
221
+ fieldID: string;
222
+ type: "map";
223
+ sourceFieldID: string;
224
+ default: any;
225
+ mappings: IMapMapping[];
226
+ }
227
+
228
+ export type MultiTransformationType = IEquals | ICalculated | IScale | ITemplate | IMap;
229
+ export interface IMulti {
230
+ fieldID: string;
231
+ type: "multi";
232
+ transformations: MultiTransformationType[];
233
+ }
234
+
235
+ export type ProjectTransformationType = MultiTransformationType | IMulti;
236
+ export interface IProject extends IActivity {
237
+ type: "project";
238
+ transformations: ProjectTransformationType[];
239
+ }
240
+ export function isProjectActivity(activity: IActivity): activity is IProject {
241
+ return activity.type === "project";
242
+ }
243
+ export interface IMappings extends IActivity {
244
+ type: "mappings";
245
+ transformations: ProjectTransformationType[];
246
+ }
247
+ export function isMappingsActivity(activity: IActivity): activity is IMappings {
248
+ return activity.type === "mappings";
249
+ }
250
+ // GroupBy ==================================================================
251
+ export type IAggregateType = "min" | "max" | "sum" | "mean" | "variance" | "deviation";
252
+ export interface IAggregate {
253
+ fieldID: string;
254
+ type: IAggregateType;
255
+ inFieldID: string;
256
+ baseCountFieldID?: string;
257
+ }
258
+
259
+ export interface ICount {
260
+ fieldID: string;
261
+ type: "count";
262
+ }
263
+
264
+ export type AggregateType = IAggregate | ICount;
265
+
266
+ export interface IGroupBy extends IActivity {
267
+ type: "groupby";
268
+ groupByIDs: string[];
269
+ aggregates: AggregateType[];
270
+ }
271
+ export function isGroupByActivity(activity: IActivity): activity is IGroupBy {
272
+ return activity.type === "groupby";
273
+ }
274
+
275
+ // Sort =====================================================================
276
+ export interface ISortCondition {
277
+ fieldID: string;
278
+ descending: boolean;
279
+ }
280
+
281
+ export interface ISort extends IActivity {
282
+ type: "sort";
283
+ conditions: ISortCondition[];
284
+ }
285
+ export function isSortActivity(activity: IActivity): activity is ISort {
286
+ return activity.type === "sort";
287
+ }
288
+
289
+ // Limit ====================================================================
290
+ export interface ILimit extends IActivity {
291
+ type: "limit";
292
+ limit: number;
293
+ }
294
+ export function isLimitActivity(activity: IActivity): activity is ILimit {
295
+ return activity.type === "limit";
296
+ }
297
+
298
+ // Visualization ============================================================
299
+ export interface IWidgetProperties {
300
+ __class: string;
301
+ [propID: string]: string | string[] | number | boolean | undefined | IWidgetProperties | IWidgetProperties[];
302
+ }
303
+
304
+ export interface IWidget {
305
+ id: string;
306
+ chartType: string;
307
+ __class: string;
308
+ properties: IWidgetProperties;
309
+ }
310
+
311
+ export type VisibilityType = "normal" | "flyout";
312
+ export const VisibilitySet: VisibilityType[] = ["normal", "flyout"];
313
+
314
+ export interface IVisualization extends IWidget {
315
+ title: string;
316
+ description?: string;
317
+ visibility: VisibilityType;
318
+ mappings: IMappings;
319
+ }
320
+
321
+ // View =====================================================================
322
+ export interface IView {
323
+ id: string;
324
+ datasource: IDatasourceRef;
325
+ activities: ActivityType[];
326
+ visualization: IVisualization;
327
+ }
328
+
329
+ // DDL ======================================================================
330
+ export interface IProperties {
331
+ [propID: string]: any;
332
+ }
333
+
334
+ export interface Schema {
335
+ version: "2.0.23";
336
+ createdBy: {
337
+ name: string;
338
+ version: string;
339
+ };
340
+ datasources: DatasourceType[];
341
+ dataviews: IView[];
342
+ properties?: IProperties;
343
+ hipieProperties?: IProperties;
344
+
345
+ // The following defs are only provided to assist the Java code generation (from the the generated schema) ---
346
+ defs?: {
347
+ fieldTypes: {
348
+ number64: Number64;
349
+ range: Range;
350
+ dataset: Dataset;
351
+ fieldType: IFieldType;
352
+ fieldBoolean: IFieldBoolean;
353
+ fieldNumber: IFieldNumber;
354
+ fieldNumber64: IFieldNumber64
355
+ fieldString: IFieldString;
356
+ fieldRange: IFieldRange;
357
+ fieldDataset: IFieldDataset;
358
+ fieldObject: IFieldObject;
359
+ field: IField;
360
+ };
361
+ datasourceTypes: {
362
+ datasource: IDatasource;
363
+ logicalFile: ILogicalFile;
364
+ form: IForm;
365
+ databomb: IDatabomb;
366
+ wuresult: IWUResult;
367
+ hipieService: IHipieService;
368
+ roxieService: IRoxieService;
369
+ };
370
+ datasourceRefTypes: {
371
+ wuResultRef: IWUResultRef;
372
+ roxieServiceRef: IRoxieServiceRef;
373
+ };
374
+ activityTypes: {
375
+ filter: IFilter;
376
+ project: IProject;
377
+ groupby: IGroupBy;
378
+ sort: ISort;
379
+ limit: ILimit;
380
+ mappings: IMappings;
381
+ };
382
+ aggregateTypes: {
383
+ aggregate: IAggregate;
384
+ count: ICount;
385
+ };
386
+ transformationTypes: {
387
+ equals: IEquals;
388
+ calculated: ICalculated;
389
+ scale: IScale;
390
+ template: ITemplate;
391
+ map: IMap;
392
+ multi: IMulti;
393
+ };
394
+ };
395
+ }