@cap-js/cds-types 0.1.0 → 0.2.0
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 +11 -0
- package/apis/cds.d.ts +11 -11
- package/apis/core.d.ts +36 -23
- package/apis/cqn.d.ts +76 -65
- package/apis/csn.d.ts +23 -14
- package/apis/env.d.ts +11 -11
- package/apis/events.d.ts +76 -32
- package/apis/internal/inference.d.ts +39 -5
- package/apis/linked.d.ts +26 -27
- package/apis/log.d.ts +48 -39
- package/apis/models.d.ts +105 -103
- package/apis/ql.d.ts +256 -188
- package/apis/server.d.ts +67 -65
- package/apis/services.d.ts +111 -76
- package/apis/test.d.ts +70 -45
- package/apis/utils.d.ts +45 -44
- package/package.json +11 -3
|
@@ -4,14 +4,14 @@
|
|
|
4
4
|
|
|
5
5
|
|
|
6
6
|
export interface Constructable<T = any> {
|
|
7
|
-
|
|
7
|
+
new(...args: any[]): T
|
|
8
8
|
}
|
|
9
9
|
|
|
10
10
|
// any class (not value) of array to represent plural types used in cds-typer.
|
|
11
11
|
// Mainly used as pattern match for SingularType
|
|
12
|
-
//type ArrayConstructable = Constructable<Array<
|
|
12
|
+
// type ArrayConstructable = Constructable<Array<any>>
|
|
13
13
|
export interface ArrayConstructable<T = any> {
|
|
14
|
-
|
|
14
|
+
new(...args: any[]): T[]
|
|
15
15
|
}
|
|
16
16
|
|
|
17
17
|
// concrete singular type.
|
|
@@ -28,5 +28,39 @@ export type SingularType<T extends ArrayConstructable<T>> = InstanceType<T>[numb
|
|
|
28
28
|
export type Unwrap<T> = T extends ArrayConstructable
|
|
29
29
|
? SingularType<T>
|
|
30
30
|
: T extends Array<infer U>
|
|
31
|
-
|
|
32
|
-
|
|
31
|
+
? U
|
|
32
|
+
: T
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
/*
|
|
36
|
+
* the following three types are used to convert union types to intersection types.
|
|
37
|
+
* We need these as our types currently lack generics in places where we would need them to clearly decide
|
|
38
|
+
* on a subtype in the case of a union type. This leads to the following problem:
|
|
39
|
+
*
|
|
40
|
+
* ```ts
|
|
41
|
+
* type A = { a: number }
|
|
42
|
+
* type B = { b: string }
|
|
43
|
+
* type Foo = A | B
|
|
44
|
+
* function f(): Foo { ... }
|
|
45
|
+
* const x = f()
|
|
46
|
+
* x.a // error, could also be B
|
|
47
|
+
* ```
|
|
48
|
+
*
|
|
49
|
+
* While we should have:
|
|
50
|
+
*
|
|
51
|
+
* ```ts
|
|
52
|
+
* function f<T extends Foo>(): T { ... }
|
|
53
|
+
* const x = f<A>()
|
|
54
|
+
* x.a
|
|
55
|
+
* ```ts
|
|
56
|
+
*
|
|
57
|
+
* Since we don't do that yet, we opt for intersection types instead.
|
|
58
|
+
* By also wrapping it in Partial, we at least force the user to check for the presence of any
|
|
59
|
+
* attribute they try to access.
|
|
60
|
+
*
|
|
61
|
+
* Places where these types are used are subject to a rework!
|
|
62
|
+
* the idea behind the conversion can be found in this excellent writeup: https://fettblog.eu/typescript-union-to-intersection/
|
|
63
|
+
*/
|
|
64
|
+
export type Scalarise<A> = A extends Array<infer N> ? N : A
|
|
65
|
+
export type UnionToIntersection<U> = Partial<(U extends any ? (k: U) => void : never) extends (k: infer I) => void ? I : never>
|
|
66
|
+
export type UnionsToIntersections<U> = Array<UnionToIntersection<Scalarise<U>>>
|
package/apis/linked.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { CSN, FQN, Association, Definition, entity, kinds } from
|
|
1
|
+
import { CSN, FQN, Association, Definition, entity, kinds } from './csn'
|
|
2
2
|
|
|
3
3
|
export type LinkedDefinition = linked & Definition & LinkedEntity & LinkedAssociation
|
|
4
4
|
export type Definitions = { [name: string]: LinkedDefinition }
|
|
@@ -6,24 +6,23 @@ export type Definitions = { [name: string]: LinkedDefinition }
|
|
|
6
6
|
// but the name may be misleading, as it is indeed a mapping of strings to LinkedDefinition objects.
|
|
7
7
|
export type LinkedDefinitions = Definitions
|
|
8
8
|
export interface linked {
|
|
9
|
-
|
|
10
|
-
|
|
9
|
+
is(kind: kinds | 'Association' | 'Composition'): boolean
|
|
10
|
+
name: FQN
|
|
11
11
|
}
|
|
12
12
|
|
|
13
13
|
interface LinkedEntity extends linked, entity {
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
drafts: LinkedEntity
|
|
14
|
+
keys: Definitions
|
|
15
|
+
drafts?: LinkedEntity
|
|
17
16
|
}
|
|
18
17
|
|
|
19
18
|
interface LinkedAssociation extends linked, Association {
|
|
20
|
-
|
|
21
|
-
|
|
19
|
+
is2one: boolean
|
|
20
|
+
is2many: boolean
|
|
22
21
|
}
|
|
23
22
|
|
|
24
23
|
export interface LinkedCSN extends CSN {
|
|
25
24
|
|
|
26
|
-
|
|
25
|
+
/**
|
|
27
26
|
* Fetches definitions matching the given filter, returning an iterator on them.
|
|
28
27
|
* @example
|
|
29
28
|
* ```js
|
|
@@ -33,38 +32,38 @@ export interface LinkedCSN extends CSN {
|
|
|
33
32
|
* let entities = m.all('entity') //> equivalent shortcut
|
|
34
33
|
* ```
|
|
35
34
|
*/
|
|
36
|
-
|
|
35
|
+
each(x: Filter, defs?: Definitions): IterableIterator<any>
|
|
37
36
|
|
|
38
|
-
|
|
37
|
+
/**
|
|
39
38
|
* Fetches definitions matching the given filter, returning them in an array.
|
|
40
39
|
* Convenience shortcut for `[...reflect.each('entity')]`
|
|
41
40
|
*/
|
|
42
|
-
|
|
41
|
+
all(x: Filter, defs?: Definitions): any[]
|
|
43
42
|
|
|
44
|
-
|
|
43
|
+
/**
|
|
45
44
|
* Fetches definitions matching the given filter, returning the first match, if any.
|
|
46
45
|
* @example
|
|
47
46
|
* let service = model.find('service')
|
|
48
47
|
* @param x - the filter
|
|
49
48
|
* @param defs - the definitions to fetch in, default: `this.definitions`
|
|
50
49
|
*/
|
|
51
|
-
|
|
50
|
+
find(x: Filter, defs?: Definitions): any
|
|
52
51
|
|
|
53
|
-
|
|
52
|
+
/**
|
|
54
53
|
* Calls the visitor for each definition matching the given filter.
|
|
55
54
|
* @see [capire](https://github.wdf.sap.corp/pages/cap/node.js/api#cds-reflect-foreach)
|
|
56
55
|
*/
|
|
57
|
-
|
|
58
|
-
|
|
56
|
+
foreach(x: Filter, visitor: Visitor, defs?: Definitions): this
|
|
57
|
+
foreach(visitor: Visitor, defs?: Definitions): this
|
|
59
58
|
|
|
60
|
-
|
|
59
|
+
/**
|
|
61
60
|
* Same as foreach but recursively visits each element definition
|
|
62
61
|
* @see [capire](https://github.wdf.sap.corp/pages/cap/node.js/api#cds-reflect-foreach)
|
|
63
62
|
*/
|
|
64
|
-
|
|
65
|
-
|
|
63
|
+
forall(x: Filter, visitor: Visitor, defs?: Definitions): this
|
|
64
|
+
forall(visitor: Visitor, defs?: Definitions): this
|
|
66
65
|
|
|
67
|
-
|
|
66
|
+
/**
|
|
68
67
|
* Fetches definitions declared as children of a given parent context or service.
|
|
69
68
|
* It fetches all definitions whose fully-qualified names start with the parent's name.
|
|
70
69
|
* Returns the found definitions as an object with the local names as keys.
|
|
@@ -76,9 +75,9 @@ export interface LinkedCSN extends CSN {
|
|
|
76
75
|
* @param parent - either the parent itself or its fully-qualified name
|
|
77
76
|
* @param filter - an optional filter to apply before picking a child
|
|
78
77
|
*/
|
|
79
|
-
|
|
78
|
+
childrenOf(parent: any | string, filter?: ((def: LinkedDefinition) => boolean)): Definitions
|
|
80
79
|
|
|
81
|
-
|
|
80
|
+
/**
|
|
82
81
|
* Provides convenient access to the model's top-level definitions.
|
|
83
82
|
* For example, you can use it in an es6-import-like fashion to avoid
|
|
84
83
|
* working with fully-qualified names as follows:
|
|
@@ -94,10 +93,10 @@ export interface LinkedCSN extends CSN {
|
|
|
94
93
|
* SELECT.from (Books) .where ({ID:11})
|
|
95
94
|
* ```
|
|
96
95
|
*/
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
96
|
+
exports: Definitions & ((namespace: string) => Definitions)
|
|
97
|
+
entities: Definitions & ((namespace: string) => Definitions)
|
|
98
|
+
services: Definitions & ((namespace: string) => Definitions)
|
|
99
|
+
definitions: Definitions
|
|
101
100
|
|
|
102
101
|
}
|
|
103
102
|
|
package/apis/log.d.ts
CHANGED
|
@@ -16,11 +16,11 @@ export declare const log: LogFactory
|
|
|
16
16
|
*
|
|
17
17
|
* @param name - logger name
|
|
18
18
|
*/
|
|
19
|
-
export declare function debug(name: string): undefined | Log
|
|
19
|
+
export declare function debug (name: string): undefined | Log
|
|
20
20
|
|
|
21
21
|
declare type LogFactory = {
|
|
22
22
|
|
|
23
|
-
|
|
23
|
+
/**
|
|
24
24
|
* Returns a trace logger for the given module if trace is switched on for it,
|
|
25
25
|
* otherwise returns null. All cds runtime packages use this method for their
|
|
26
26
|
* trace and debug output.
|
|
@@ -47,9 +47,9 @@ declare type LogFactory = {
|
|
|
47
47
|
* @returns the logger
|
|
48
48
|
* @see [capire](https://cap.cloud.sap/docs/node.js/cds-log)
|
|
49
49
|
*/
|
|
50
|
-
|
|
50
|
+
(name: string, options?: string | number | { level?: number, label?: string, prefix?: string }): Logger,
|
|
51
51
|
|
|
52
|
-
|
|
52
|
+
/**
|
|
53
53
|
* Set a custom formatter function like that:
|
|
54
54
|
* ```js
|
|
55
55
|
* cds.log.format = (module, level, ...args) => [ '[', module, ']', ...args ]
|
|
@@ -57,76 +57,80 @@ declare type LogFactory = {
|
|
|
57
57
|
*
|
|
58
58
|
* The formatter shall return an array of arguments, which are passed to the logger (for example, `console.log()`)
|
|
59
59
|
*/
|
|
60
|
-
|
|
60
|
+
format: Formatter,
|
|
61
61
|
|
|
62
|
-
|
|
62
|
+
/**
|
|
63
63
|
* Set a custom logger.
|
|
64
64
|
* ```js
|
|
65
65
|
* cds.log.Logger = ...
|
|
66
66
|
* ```
|
|
67
67
|
*/
|
|
68
|
-
|
|
68
|
+
Logger: Logger,
|
|
69
69
|
|
|
70
|
-
|
|
70
|
+
// FIXME
|
|
71
|
+
/* eslint-disable-next-line @typescript-eslint/ban-types */
|
|
72
|
+
winstonLogger (LoggerOptions?: { level?: string, levels?: any, format?: any, transports?: any, exitOnError?: boolean | Function, silent?: boolean }),
|
|
71
73
|
}
|
|
72
74
|
|
|
73
75
|
declare class Logger {
|
|
74
|
-
/**
|
|
75
|
-
* Logs with 'trace' level
|
|
76
|
-
*/
|
|
77
|
-
trace: Log
|
|
78
76
|
|
|
79
|
-
|
|
77
|
+
|
|
78
|
+
/**
|
|
79
|
+
* Logs with 'trace' level
|
|
80
|
+
*/
|
|
81
|
+
trace: Log
|
|
82
|
+
|
|
83
|
+
/**
|
|
80
84
|
* Logs with 'debug' level
|
|
81
85
|
*/
|
|
82
|
-
|
|
86
|
+
debug: Log
|
|
83
87
|
|
|
84
|
-
|
|
88
|
+
/**
|
|
85
89
|
* Logs with 'info' level
|
|
86
90
|
*/
|
|
87
|
-
|
|
91
|
+
info: Log
|
|
88
92
|
|
|
89
|
-
|
|
93
|
+
/**
|
|
90
94
|
* Logs with 'warn' level
|
|
91
95
|
*/
|
|
92
|
-
|
|
96
|
+
warn: Log
|
|
93
97
|
|
|
94
|
-
|
|
98
|
+
/**
|
|
95
99
|
* Logs with 'error' level
|
|
96
100
|
*/
|
|
97
|
-
|
|
101
|
+
error: Log
|
|
98
102
|
|
|
99
|
-
|
|
103
|
+
/**
|
|
100
104
|
* Logs with default level
|
|
101
105
|
*/
|
|
102
|
-
|
|
106
|
+
log: Log
|
|
103
107
|
|
|
104
|
-
|
|
108
|
+
/**
|
|
105
109
|
* @returns whether 'trace' level is active
|
|
106
110
|
*/
|
|
107
|
-
|
|
111
|
+
_trace: boolean
|
|
108
112
|
|
|
109
|
-
|
|
113
|
+
/**
|
|
110
114
|
* @returns whether 'debug' level is active
|
|
111
115
|
*/
|
|
112
|
-
|
|
116
|
+
_debug: boolean
|
|
113
117
|
|
|
114
|
-
|
|
118
|
+
/**
|
|
115
119
|
* @returns whether 'info' level is active
|
|
116
120
|
*/
|
|
117
|
-
|
|
121
|
+
_info: boolean
|
|
118
122
|
|
|
119
|
-
|
|
123
|
+
/**
|
|
120
124
|
* @returns whether 'warn' level is active
|
|
121
125
|
*/
|
|
122
|
-
|
|
126
|
+
_warn: boolean
|
|
123
127
|
|
|
124
|
-
|
|
128
|
+
/**
|
|
125
129
|
* @returns whether 'error' level is active
|
|
126
130
|
*/
|
|
127
|
-
|
|
131
|
+
_error: boolean
|
|
128
132
|
|
|
129
|
-
|
|
133
|
+
/**
|
|
130
134
|
* Change the format for this logger instance:
|
|
131
135
|
* ```
|
|
132
136
|
* cds.log('foo').setFormat((module, level, ...args) => [ '[', module, ']', ...args ])
|
|
@@ -134,11 +138,13 @@ declare class Logger {
|
|
|
134
138
|
*
|
|
135
139
|
* The formatter shall return an array of arguments, which are passed to the logger (for example, `console.log()`)
|
|
136
140
|
*/
|
|
137
|
-
|
|
141
|
+
setFormat (formatter: Formatter)
|
|
142
|
+
|
|
138
143
|
}
|
|
139
144
|
|
|
140
145
|
declare type Formatter = {
|
|
141
|
-
|
|
146
|
+
|
|
147
|
+
/**
|
|
142
148
|
* Custom format function
|
|
143
149
|
*
|
|
144
150
|
* @param module - logger name
|
|
@@ -146,19 +152,22 @@ declare type Formatter = {
|
|
|
146
152
|
* @param args - additional arguments
|
|
147
153
|
* @returns an array of arguments, which are passed to the logger (for example, `console.log()`)
|
|
148
154
|
*/
|
|
149
|
-
|
|
155
|
+
(module: string, level: number, args: any[]): any[],
|
|
150
156
|
}
|
|
151
157
|
|
|
152
158
|
declare type Log = {
|
|
153
|
-
|
|
159
|
+
|
|
160
|
+
/**
|
|
154
161
|
* Logs a message
|
|
155
162
|
*
|
|
156
163
|
* @param message - text to log
|
|
157
164
|
* @param optionalParams - additional parameters, same as in `console.log(text, param1, ...)`
|
|
158
165
|
*/
|
|
159
|
-
|
|
166
|
+
(message?: any, ...optionalParams: any[]): void,
|
|
160
167
|
}
|
|
161
168
|
|
|
162
169
|
declare enum levels {
|
|
163
|
-
|
|
170
|
+
// FIXME: check if this is a copy-paste error
|
|
171
|
+
/* eslint-disable-next-line @typescript-eslint/no-duplicate-enum-values */
|
|
172
|
+
SILENT = 0, ERROR = 1, WARN = 2, INFO = 3, DEBUG = 4, TRACE = 5, SILLY = 5, VERBOSE = 5
|
|
164
173
|
}
|
package/apis/models.d.ts
CHANGED
|
@@ -1,21 +1,20 @@
|
|
|
1
|
-
import { Query as CQN, expr, _xpr } from
|
|
2
|
-
import { LinkedCSN } from
|
|
3
|
-
import { CSN } from
|
|
4
|
-
import * as cds from './cds'
|
|
1
|
+
import { Query as CQN, expr, _xpr } from './cqn'
|
|
2
|
+
import { LinkedCSN } from './linked'
|
|
3
|
+
import { CSN } from './csn'
|
|
5
4
|
|
|
6
5
|
type _flavor = 'parsed' | 'xtended' | 'inferred'
|
|
7
6
|
type _odata_options = {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
7
|
+
flavor?: 'v2' | 'v4' | 'w4' | 'x4',
|
|
8
|
+
version?: 'v2' | 'v4',
|
|
9
|
+
structs?: boolean,
|
|
10
|
+
refs?: boolean,
|
|
12
11
|
}
|
|
13
12
|
type _options = {
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
13
|
+
flavor?: _flavor,
|
|
14
|
+
plain?: boolean,
|
|
15
|
+
docs?: boolean,
|
|
16
|
+
names?: string,
|
|
17
|
+
odata?: _odata_options,
|
|
19
18
|
} | _flavor
|
|
20
19
|
|
|
21
20
|
type JSON = string
|
|
@@ -23,7 +22,7 @@ type YAML = string
|
|
|
23
22
|
type CDL = string
|
|
24
23
|
type SQL = string
|
|
25
24
|
type XML = string
|
|
26
|
-
type EDM = { $version:string }
|
|
25
|
+
type EDM = { $version: string }
|
|
27
26
|
type EDMX = XML
|
|
28
27
|
type filename = string
|
|
29
28
|
|
|
@@ -31,21 +30,23 @@ type filename = string
|
|
|
31
30
|
/**
|
|
32
31
|
* The effective CDS model loaded during bootstrapping, which contains all service and entity definitions,
|
|
33
32
|
* including required services.
|
|
33
|
+
* Should only be ever set explictly in test scenarios!
|
|
34
34
|
*/
|
|
35
|
-
export
|
|
35
|
+
export let model: LinkedCSN | undefined
|
|
36
36
|
|
|
37
37
|
/**
|
|
38
38
|
* Provides a set of methods to parse a given model, query or expression.
|
|
39
39
|
* You can also use `cds.parse()` as a shortcut to `cds.parse.cdl()`.
|
|
40
40
|
*/
|
|
41
|
-
export const parse
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
41
|
+
export const parse: {
|
|
42
|
+
|
|
43
|
+
/** Shortcut to `cds.parse.cdl()` */
|
|
44
|
+
(cdl: CDL): CSN,
|
|
45
|
+
cdl (cdl: CDL): CSN,
|
|
46
|
+
cql (src: string): CQN,
|
|
47
|
+
expr (src: string): expr,
|
|
48
|
+
xpr (src: string): _xpr,
|
|
49
|
+
ref (src: string): string[],
|
|
49
50
|
}
|
|
50
51
|
|
|
51
52
|
/**
|
|
@@ -54,13 +55,13 @@ export const parse : {
|
|
|
54
55
|
* Essentially a shortcut for `cds.compile.to.csn(files)`
|
|
55
56
|
* @param files - filenames of models or if folder containing models
|
|
56
57
|
*/
|
|
57
|
-
export function get (files: '*' | filename | filename[], o?:_options): Promise<CSN>
|
|
58
|
+
export function get (files: '*' | filename | filename[], o?: _options): Promise<CSN>
|
|
58
59
|
|
|
59
60
|
/**
|
|
60
61
|
* Shortcut for `cds.get(files, 'inferred')`
|
|
61
62
|
* @param files - filenames of models or if folder containing models
|
|
62
63
|
*/
|
|
63
|
-
export function load (files: '*' | filename | filename[], o?:_options): Promise<CSN>
|
|
64
|
+
export function load (files: '*' | filename | filename[], o?: _options): Promise<CSN>
|
|
64
65
|
|
|
65
66
|
|
|
66
67
|
/**
|
|
@@ -90,82 +91,83 @@ export const reflect: (model: CSN) => LinkedCSN
|
|
|
90
91
|
* You can also use `cds.compile(csn).to('<output>')` as a fluent variant.
|
|
91
92
|
*/
|
|
92
93
|
export const compile: {
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
94
|
+
|
|
95
|
+
/** Shortcut for `cds.compile.to.csn()` */
|
|
96
|
+
cdl (model: CDL, o?: _options): CSN,
|
|
97
|
+
|
|
98
|
+
for: {
|
|
99
|
+
odata (model: CSN, o?: _options): CSN,
|
|
100
|
+
sql (model: CSN, o?: _options): CSN,
|
|
101
|
+
},
|
|
102
|
+
to: {
|
|
103
|
+
parsed: {
|
|
104
|
+
csn (files: filename[], o?: _options): Promise<CSN>,
|
|
105
|
+
csn (model: CDL, o?: _options): CSN,
|
|
106
|
+
},
|
|
107
|
+
xtended: {
|
|
108
|
+
csn (files: filename[], o?: _options): Promise<CSN>,
|
|
109
|
+
csn (model: CDL, o?: _options): CSN,
|
|
110
|
+
},
|
|
111
|
+
inferred: {
|
|
112
|
+
csn (files: filename[], o?: _options): Promise<CSN>,
|
|
113
|
+
csn (model: CDL, o?: _options): CSN,
|
|
114
|
+
},
|
|
115
|
+
csn (files: filename[], o?: _options): Promise<CSN>,
|
|
116
|
+
csn (model: CDL, o?: _options): CSN,
|
|
117
|
+
yml (model: CSN, o?: _options): YAML,
|
|
118
|
+
yaml (model: CSN, o?: _options): YAML,
|
|
119
|
+
json (model: CSN, o?: _options): JSON,
|
|
120
|
+
sql (model: CSN, o?: _options): SQL[],
|
|
121
|
+
cdl (model: CSN, o?: _options): CDL | Iterable<[CDL, { file: filename }]>,
|
|
122
|
+
edm (model: CSN, o?: _options | _odata_options): EDM | string,
|
|
123
|
+
edmx (model: CSN, o?: _options | _odata_options): EDMX | Iterable<[EDMX, { file: filename }]>,
|
|
124
|
+
hdbcds (model: CSN, o?: _options): SQL | Iterable<[SQL, { file: filename }]>,
|
|
125
|
+
hdbtable (model: CSN, o?: _options): SQL | Iterable<[SQL, { file: filename }]>,
|
|
126
|
+
},
|
|
127
|
+
|
|
128
|
+
/** Fluent API variant */
|
|
129
|
+
(model: CSN | CDL): {
|
|
130
|
+
for: {
|
|
131
|
+
odata (o?: _options): CSN,
|
|
132
|
+
sql (o?: _options): CSN,
|
|
133
|
+
},
|
|
134
|
+
to: {
|
|
135
|
+
parsed: { csn (o?: _options): CSN },
|
|
136
|
+
xtended: { csn (o?: _options): CSN },
|
|
137
|
+
inferred: { csn (o?: _options): CSN },
|
|
138
|
+
csn (o?: _options): CSN,
|
|
139
|
+
yml (o?: _options): YAML,
|
|
140
|
+
yaml (o?: _options): YAML,
|
|
141
|
+
json (o?: _options): JSON,
|
|
142
|
+
sql (o?: _options): SQL[],
|
|
143
|
+
cdl (o?: _options): CDL | Iterable<[CDL, { file: filename }]>,
|
|
144
|
+
edm (o?: _options | _odata_options): EDM | string,
|
|
145
|
+
edmx (o?: _options | _odata_options): EDMX | Iterable<[EDMX, { file: filename }]>,
|
|
146
|
+
hdbcds (o?: _options): SQL | Iterable<[SQL, { file: filename }]>,
|
|
147
|
+
hdbtable (o?: _options): SQL | Iterable<[SQL, { file: filename }]>,
|
|
148
|
+
},
|
|
149
|
+
},
|
|
150
|
+
|
|
151
|
+
/** Async fluent variant reading from files */
|
|
152
|
+
(files: filename[]): {
|
|
153
|
+
for: {
|
|
154
|
+
odata (o?: _options): Promise<CSN>,
|
|
155
|
+
sql (o?: _options): Promise<CSN>,
|
|
156
|
+
},
|
|
157
|
+
to: {
|
|
158
|
+
parsed: { csn (o?: _options): Promise <CSN> },
|
|
159
|
+
xtended: { csn (o?: _options): Promise <CSN> },
|
|
160
|
+
inferred: { csn (o?: _options): Promise <CSN> },
|
|
161
|
+
csn (o?: _options): Promise <CSN>,
|
|
162
|
+
yml (o?: _options): Promise <YAML>,
|
|
163
|
+
yaml (o?: _options): Promise <YAML>,
|
|
164
|
+
json (o?: _options): Promise <JSON>,
|
|
165
|
+
sql (o?: _options): Promise <SQL[]>,
|
|
166
|
+
cdl (o?: _options): Promise <CDL | Iterable<[CDL, { file: filename }]>>,
|
|
167
|
+
edm (o?: _options | _odata_options): Promise <EDM | string>,
|
|
168
|
+
edmx (o?: _options | _odata_options): Promise <EDMX | Iterable<[EDMX, { file: filename }]>>,
|
|
169
|
+
hdbcds (o?: _options): Promise <SQL | Iterable<[SQL, { file: filename }]>>,
|
|
170
|
+
hdbtable (o?: _options): Promise <SQL | Iterable<[SQL, { file: filename }]>>,
|
|
171
|
+
},
|
|
172
|
+
},
|
|
171
173
|
}
|