@cap-js/cds-types 0.5.0 → 0.6.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/dist/cds-types.d.ts +312 -316
- package/package.json +5 -3
- package/scripts/postinstall.js +14 -0
package/dist/cds-types.d.ts
CHANGED
|
@@ -1,85 +1,79 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
import chai from 'chai';
|
|
4
|
-
import * as express from 'express';
|
|
5
|
-
import * as fs from 'node:fs';
|
|
6
|
-
import * as http from 'http';
|
|
7
|
-
import { ReadableStream } from 'node:stream/web';
|
|
8
|
-
import { RequestHandler } from 'express';
|
|
1
|
+
declare module '@sap/cds' {
|
|
2
|
+
|
|
9
3
|
|
|
10
|
-
export
|
|
4
|
+
export type __any_ = classes.any_
|
|
11
5
|
|
|
12
|
-
export
|
|
6
|
+
export type __array = classes.array
|
|
13
7
|
|
|
14
|
-
export
|
|
8
|
+
export type __aspect = classes.aspect
|
|
15
9
|
|
|
16
|
-
export
|
|
10
|
+
export type __Association = classes.Association
|
|
17
11
|
|
|
18
|
-
export
|
|
12
|
+
export type __Binary = classes.Binary
|
|
19
13
|
|
|
20
|
-
export
|
|
14
|
+
export type __Boolean = classes.Boolean
|
|
21
15
|
|
|
22
|
-
export
|
|
16
|
+
export type __Composition = classes.Composition
|
|
23
17
|
|
|
24
|
-
export
|
|
18
|
+
export type __context_ = classes.context_
|
|
25
19
|
|
|
26
|
-
export
|
|
20
|
+
export type __Date = classes.Date
|
|
27
21
|
|
|
28
|
-
export
|
|
22
|
+
export type __date = classes.date
|
|
29
23
|
|
|
30
|
-
export
|
|
24
|
+
export type __DateTime = classes.DateTime
|
|
31
25
|
|
|
32
|
-
export
|
|
26
|
+
export type __Decimal = classes.Decimal
|
|
33
27
|
|
|
34
|
-
export
|
|
28
|
+
export type __Double = classes.Double
|
|
35
29
|
|
|
36
|
-
export
|
|
30
|
+
export type __entity = classes.entity
|
|
37
31
|
|
|
38
|
-
export
|
|
32
|
+
export type __Float = classes.Float
|
|
39
33
|
|
|
40
|
-
export
|
|
34
|
+
export type __Int16 = classes.Int16
|
|
41
35
|
|
|
42
|
-
export
|
|
36
|
+
export type __Int32 = classes.Int32
|
|
43
37
|
|
|
44
|
-
export
|
|
38
|
+
export type __Int64 = classes.Int64
|
|
45
39
|
|
|
46
|
-
export
|
|
40
|
+
export type __Integer = classes.Integer
|
|
47
41
|
|
|
48
|
-
export
|
|
42
|
+
export type __LargeBinary = classes.LargeBinary
|
|
49
43
|
|
|
50
|
-
export
|
|
44
|
+
export type __LargeString = classes.LargeString
|
|
51
45
|
|
|
52
|
-
export
|
|
46
|
+
export type __scalar = classes.scalar
|
|
53
47
|
|
|
54
|
-
export
|
|
48
|
+
export type __service = classes.service_
|
|
55
49
|
|
|
56
|
-
export
|
|
50
|
+
export type __String = classes.String
|
|
57
51
|
|
|
58
|
-
export
|
|
52
|
+
export type __struct = classes.struct
|
|
59
53
|
|
|
60
|
-
export
|
|
54
|
+
export type __Time = classes.Time
|
|
61
55
|
|
|
62
|
-
export
|
|
56
|
+
export type __TimeStamp = classes.TimeStamp
|
|
63
57
|
|
|
64
|
-
export
|
|
58
|
+
export type __type = classes.type
|
|
65
59
|
|
|
66
|
-
export
|
|
60
|
+
export type __UInt8 = classes.UInt8
|
|
67
61
|
|
|
68
|
-
export
|
|
62
|
+
export type __UUID = classes.UUID
|
|
69
63
|
|
|
70
|
-
export
|
|
64
|
+
export type __Vector = classes.Vector
|
|
71
65
|
|
|
72
|
-
|
|
66
|
+
class action extends any_<'action' | 'function'> {}
|
|
73
67
|
|
|
74
|
-
export
|
|
68
|
+
export interface ActionEventHandler<P, R> {
|
|
75
69
|
(req: Omit<Request_2, 'data'> & { data: P }, next: Function): Promise<R> | R
|
|
76
70
|
}
|
|
77
71
|
|
|
78
|
-
|
|
72
|
+
const any: typeof any_;
|
|
79
73
|
|
|
80
|
-
|
|
74
|
+
interface any_ extends csn.any_ {}
|
|
81
75
|
|
|
82
|
-
|
|
76
|
+
class any_<K extends kinds = kinds> {
|
|
83
77
|
private _: K // break covariance
|
|
84
78
|
constructor (...aspects: any[])
|
|
85
79
|
|
|
@@ -88,15 +82,15 @@ declare class any_<K extends kinds = kinds> {
|
|
|
88
82
|
// is (kind: kinds | 'Association' | 'Composition'): boolean
|
|
89
83
|
}
|
|
90
84
|
|
|
91
|
-
|
|
85
|
+
interface any__2 {
|
|
92
86
|
kind?: kinds
|
|
93
87
|
}
|
|
94
88
|
|
|
95
|
-
export
|
|
89
|
+
export class ApplicationService extends Service {}
|
|
96
90
|
|
|
97
|
-
export
|
|
91
|
+
export class array extends type<'type' | 'elements'> { }
|
|
98
92
|
|
|
99
|
-
|
|
93
|
+
interface ArrayConstructable<T = any> {
|
|
100
94
|
new(...args: any[]): T[]
|
|
101
95
|
}
|
|
102
96
|
|
|
@@ -106,7 +100,7 @@ declare interface ArrayConstructable<T = any> {
|
|
|
106
100
|
* @internal
|
|
107
101
|
* @since cds 7.9
|
|
108
102
|
*/
|
|
109
|
-
|
|
103
|
+
type _ArrayLike<T> = Iterable<T> & {
|
|
110
104
|
forEach: (handler: (element: T) => any) => void,
|
|
111
105
|
filter: (predicate: (element: T) => boolean) => Array<T>,
|
|
112
106
|
map: <R>(converter: (element: T) => R) => Array<R>,
|
|
@@ -114,16 +108,16 @@ declare type _ArrayLike<T> = Iterable<T> & {
|
|
|
114
108
|
find: (predicate: (element: T) => boolean) => T | undefined,
|
|
115
109
|
}
|
|
116
110
|
|
|
117
|
-
|
|
111
|
+
class aspect<K extends kinds = 'aspect'> extends type<K> implements WithElements {
|
|
118
112
|
elements: Definitions<type<'type'>>
|
|
119
113
|
}
|
|
120
114
|
|
|
121
115
|
/**
|
|
122
116
|
* @see [capire](https://cap.cloud.sap/docs/node.js/cds-reflect#cds-association)
|
|
123
117
|
*/
|
|
124
|
-
export
|
|
118
|
+
export interface Association extends Omit<csn.Association, 'type' | 'items'> {}
|
|
125
119
|
|
|
126
|
-
export
|
|
120
|
+
export class Association extends type {
|
|
127
121
|
_target: entity
|
|
128
122
|
|
|
129
123
|
isAssociation: true
|
|
@@ -134,7 +128,7 @@ export declare class Association extends type {
|
|
|
134
128
|
|
|
135
129
|
}
|
|
136
130
|
|
|
137
|
-
|
|
131
|
+
interface Association_2 extends type_2 {
|
|
138
132
|
type: 'cds.Association' | 'cds.Composition'
|
|
139
133
|
target: FQN
|
|
140
134
|
|
|
@@ -154,22 +148,22 @@ declare interface Association_2 extends type_2 {
|
|
|
154
148
|
keys?: (ref & { as: string })[]
|
|
155
149
|
}
|
|
156
150
|
|
|
157
|
-
|
|
151
|
+
type Awaitable<T, I> = T & Promise<I>
|
|
158
152
|
|
|
159
|
-
|
|
153
|
+
class Axios {
|
|
160
154
|
|
|
161
|
-
get axios (): AxiosInstance
|
|
162
|
-
get: AxiosInstance['get'];
|
|
155
|
+
get axios (): import('axios').AxiosInstance
|
|
156
|
+
get: import('axios').AxiosInstance['get'];
|
|
163
157
|
|
|
164
|
-
put: AxiosInstance['put']
|
|
158
|
+
put: import('axios').AxiosInstance['put']
|
|
165
159
|
|
|
166
|
-
post: AxiosInstance['post']
|
|
160
|
+
post: import('axios').AxiosInstance['post']
|
|
167
161
|
|
|
168
|
-
patch: AxiosInstance['patch']
|
|
162
|
+
patch: import('axios').AxiosInstance['patch']
|
|
169
163
|
|
|
170
|
-
delete: AxiosInstance['delete']
|
|
164
|
+
delete: import('axios').AxiosInstance['delete']
|
|
171
165
|
|
|
172
|
-
options: AxiosInstance['options']
|
|
166
|
+
options: import('axios').AxiosInstance['options']
|
|
173
167
|
|
|
174
168
|
get GET (): Axios['get']
|
|
175
169
|
|
|
@@ -185,15 +179,15 @@ declare class Axios {
|
|
|
185
179
|
|
|
186
180
|
}
|
|
187
181
|
|
|
188
|
-
|
|
182
|
+
class Binary extends string { }
|
|
189
183
|
|
|
190
|
-
|
|
184
|
+
const boolean: typeof boolean_;
|
|
191
185
|
|
|
192
|
-
|
|
186
|
+
class boolean_ extends scalar { }
|
|
193
187
|
|
|
194
|
-
|
|
188
|
+
class Boolean_2 extends boolean { }
|
|
195
189
|
|
|
196
|
-
export
|
|
190
|
+
export const builtin: {
|
|
197
191
|
|
|
198
192
|
/**
|
|
199
193
|
* @see {@link models.linked.classes}
|
|
@@ -202,9 +196,9 @@ export declare const builtin: {
|
|
|
202
196
|
types: Record<string, object>, // FIXME: value should be any class part of linked.classes
|
|
203
197
|
};
|
|
204
198
|
|
|
205
|
-
export
|
|
199
|
+
export type CDL = string
|
|
206
200
|
|
|
207
|
-
|
|
201
|
+
namespace cds {
|
|
208
202
|
export {
|
|
209
203
|
log,
|
|
210
204
|
debug,
|
|
@@ -366,11 +360,11 @@ declare namespace cds {
|
|
|
366
360
|
}
|
|
367
361
|
}
|
|
368
362
|
|
|
369
|
-
export
|
|
363
|
+
export type _cds = typeof cds
|
|
370
364
|
|
|
371
|
-
|
|
365
|
+
type _cds_2 = typeof cds
|
|
372
366
|
|
|
373
|
-
export
|
|
367
|
+
export interface cds_connect_options {
|
|
374
368
|
impl?: string
|
|
375
369
|
service?: string
|
|
376
370
|
kind?: string
|
|
@@ -378,24 +372,24 @@ export declare interface cds_connect_options {
|
|
|
378
372
|
credentials?: object
|
|
379
373
|
}
|
|
380
374
|
|
|
381
|
-
export
|
|
375
|
+
export interface cds_serve_fluent {
|
|
382
376
|
from (model: string | CSN): cds_serve_fluent
|
|
383
377
|
to (protocol: string): cds_serve_fluent
|
|
384
378
|
at (path: string): cds_serve_fluent
|
|
385
|
-
in (app: Application): cds_serve_fluent
|
|
379
|
+
in (app: import('express').Application): cds_serve_fluent
|
|
386
380
|
with (impl: ServiceImpl | string): cds_serve_fluent
|
|
387
381
|
// (req,res) : void
|
|
388
382
|
}
|
|
389
383
|
|
|
390
|
-
export
|
|
384
|
+
export type cds_services = { [name: string]: Service }
|
|
391
385
|
|
|
392
|
-
export
|
|
386
|
+
export type CdsFunction = {
|
|
393
387
|
(...args: any[]): any,
|
|
394
388
|
__parameters: object,
|
|
395
389
|
__returns: any,
|
|
396
390
|
}
|
|
397
391
|
|
|
398
|
-
|
|
392
|
+
namespace classes {
|
|
399
393
|
export {
|
|
400
394
|
mixin,
|
|
401
395
|
Protocol,
|
|
@@ -444,15 +438,15 @@ declare namespace classes {
|
|
|
444
438
|
}
|
|
445
439
|
}
|
|
446
440
|
|
|
447
|
-
|
|
441
|
+
type Column = { ref: [string], as?: string }
|
|
448
442
|
|
|
449
|
-
export
|
|
443
|
+
export type column_expr = UnionToIntersection<expr> & { as?: name, cast?: any, expand?: column_expr[], inline?: column_expr[] }
|
|
450
444
|
|
|
451
445
|
/**
|
|
452
446
|
* Provides a set of methods to parse a given model, query or expression.
|
|
453
447
|
* You can also use `cds.compile(csn).to('<output>')` as a fluent variant.
|
|
454
448
|
*/
|
|
455
|
-
export
|
|
449
|
+
export const compile: {
|
|
456
450
|
|
|
457
451
|
/** Shortcut for `cds.compile.to.csn()` */
|
|
458
452
|
cdl (model: CDL, o?: _options): csn.CSN,
|
|
@@ -534,11 +528,11 @@ export declare const compile: {
|
|
|
534
528
|
},
|
|
535
529
|
};
|
|
536
530
|
|
|
537
|
-
export
|
|
531
|
+
export class Composition extends Association {
|
|
538
532
|
isComposition: true
|
|
539
533
|
}
|
|
540
534
|
|
|
541
|
-
export
|
|
535
|
+
export const connect: {
|
|
542
536
|
|
|
543
537
|
/**
|
|
544
538
|
* Connects to a specific datasource.
|
|
@@ -560,11 +554,11 @@ export declare const connect: {
|
|
|
560
554
|
(options?: string | cds_connect_options): Promise<_cds>, // > cds.connect(<options>)
|
|
561
555
|
};
|
|
562
556
|
|
|
563
|
-
|
|
557
|
+
interface Constructable<T = any> {
|
|
564
558
|
new(...args: any[]): T
|
|
565
559
|
}
|
|
566
560
|
|
|
567
|
-
|
|
561
|
+
class ConstructedQuery {
|
|
568
562
|
|
|
569
563
|
then (_resolved: (x: any) => any, _rejected: (e: Error) => any): any
|
|
570
564
|
|
|
@@ -573,15 +567,15 @@ declare class ConstructedQuery {
|
|
|
573
567
|
/**
|
|
574
568
|
* @see [docs](https://cap.cloud.sap/docs/node.js/cds-tx#event-contexts
|
|
575
569
|
*/
|
|
576
|
-
export
|
|
570
|
+
export let context: EventContext | undefined;
|
|
577
571
|
|
|
578
|
-
|
|
572
|
+
interface context_ extends csn.context {}
|
|
579
573
|
|
|
580
|
-
|
|
574
|
+
class context_ extends any_ { }
|
|
581
575
|
|
|
582
|
-
|
|
576
|
+
interface context_2 extends any__2 { }
|
|
583
577
|
|
|
584
|
-
|
|
578
|
+
namespace CQN {
|
|
585
579
|
export {
|
|
586
580
|
Query,
|
|
587
581
|
SELECT_2 as SELECT,
|
|
@@ -610,15 +604,15 @@ declare namespace CQN {
|
|
|
610
604
|
}
|
|
611
605
|
}
|
|
612
606
|
|
|
613
|
-
export
|
|
607
|
+
export const create: Service['create'];
|
|
614
608
|
|
|
615
|
-
|
|
609
|
+
type CREATE_2 = { CREATE: {
|
|
616
610
|
entity: entity_2 | name,
|
|
617
611
|
as: SELECT_2,
|
|
618
612
|
}, }
|
|
619
613
|
export { CREATE_2 as CREATE }
|
|
620
614
|
|
|
621
|
-
|
|
615
|
+
class CREATE_3<T> extends ConstructedQuery {
|
|
622
616
|
|
|
623
617
|
static entity (entity: Target): CREATE_3<any>
|
|
624
618
|
|
|
@@ -626,7 +620,7 @@ declare class CREATE_3<T> extends ConstructedQuery {
|
|
|
626
620
|
|
|
627
621
|
}
|
|
628
622
|
|
|
629
|
-
export
|
|
623
|
+
export namespace CRUDEventHandler {
|
|
630
624
|
export type Before<P, R = P | void | Error> = (req: TypedRequest<P>) => Promise<R> | R
|
|
631
625
|
export type On<P, R = P | void | Error> = (req: TypedRequest<P>, next: (...args: any[]) => Promise<R> | R) => Promise<R> | R
|
|
632
626
|
export type After<P, R = P | void | Error> = (data: undefined | P, req: TypedRequest<P>) => Promise<R> | R
|
|
@@ -635,7 +629,7 @@ export declare namespace CRUDEventHandler {
|
|
|
635
629
|
/**
|
|
636
630
|
* A parsed CDS model in CSN object notation.
|
|
637
631
|
*/
|
|
638
|
-
|
|
632
|
+
interface CSN {
|
|
639
633
|
|
|
640
634
|
/**
|
|
641
635
|
* The assigned namespace. If parsed from multiple sources,
|
|
@@ -667,7 +661,7 @@ declare interface CSN {
|
|
|
667
661
|
$sources?: string[]
|
|
668
662
|
}
|
|
669
663
|
|
|
670
|
-
|
|
664
|
+
namespace csn {
|
|
671
665
|
export {
|
|
672
666
|
CSN,
|
|
673
667
|
FQN,
|
|
@@ -688,16 +682,16 @@ declare namespace csn {
|
|
|
688
682
|
export { csn }
|
|
689
683
|
|
|
690
684
|
/** @private */
|
|
691
|
-
export
|
|
685
|
+
export type data = Record<string, any>
|
|
692
686
|
|
|
693
|
-
export
|
|
687
|
+
export class DatabaseService extends Service {
|
|
694
688
|
deploy (model?: csn.CSN | string): Promise<csn.CSN>
|
|
695
689
|
begin (): Promise<void>
|
|
696
690
|
commit (): Promise<void>
|
|
697
691
|
rollback (): Promise<void>
|
|
698
692
|
}
|
|
699
693
|
|
|
700
|
-
|
|
694
|
+
class DataUtil {
|
|
701
695
|
|
|
702
696
|
delete (db?: Service): Promise<void>
|
|
703
697
|
|
|
@@ -710,13 +704,13 @@ declare class DataUtil {
|
|
|
710
704
|
|
|
711
705
|
}
|
|
712
706
|
|
|
713
|
-
|
|
707
|
+
class date extends scalar { }
|
|
714
708
|
|
|
715
|
-
|
|
709
|
+
class Date_2 extends date { }
|
|
716
710
|
|
|
717
|
-
|
|
711
|
+
class DateTime extends date { }
|
|
718
712
|
|
|
719
|
-
export
|
|
713
|
+
export const db: DatabaseService;
|
|
720
714
|
|
|
721
715
|
/**
|
|
722
716
|
* Shortcut to `cds.log(...).debug`, returning `undefined` if `cds.log(...)._debug` is `false`.
|
|
@@ -730,32 +724,32 @@ export declare const db: DatabaseService;
|
|
|
730
724
|
*
|
|
731
725
|
* @param name - logger name
|
|
732
726
|
*/
|
|
733
|
-
export
|
|
727
|
+
export function debug (name: string): undefined | Log
|
|
734
728
|
|
|
735
|
-
|
|
729
|
+
class Decimal extends Float { }
|
|
736
730
|
|
|
737
731
|
/**
|
|
738
732
|
* Definitions are the central elements of a CDS model.
|
|
739
733
|
*/
|
|
740
|
-
|
|
734
|
+
type Definition = context_2 & service_2 & type_2 & struct_2 & entity_2 & Association_2
|
|
741
735
|
|
|
742
|
-
|
|
736
|
+
type Definition_2 = any_
|
|
743
737
|
|
|
744
738
|
/**
|
|
745
739
|
* @see [capire](https://cap.cloud.sap/docs/node.js/cds-reflect#iterable)
|
|
746
740
|
*/
|
|
747
|
-
|
|
741
|
+
type Definitions<T extends any_ = any_> = IterableMap<T>
|
|
748
742
|
|
|
749
|
-
|
|
743
|
+
const delete_: Service['delete'];
|
|
750
744
|
export { delete_ as delete };
|
|
751
745
|
|
|
752
|
-
|
|
746
|
+
type DELETE_2 = { DELETE: {
|
|
753
747
|
from: ref | name,
|
|
754
748
|
where?: predicate,
|
|
755
749
|
}, }
|
|
756
750
|
export { DELETE_2 as DELETE }
|
|
757
751
|
|
|
758
|
-
|
|
752
|
+
class DELETE_3<T> extends ConstructedQuery {
|
|
759
753
|
|
|
760
754
|
static from:
|
|
761
755
|
TaggedTemplateQueryPart<Awaitable<SELECT_3<unknown>, InstanceType<any>>>
|
|
@@ -775,16 +769,16 @@ declare class DELETE_3<T> extends ConstructedQuery {
|
|
|
775
769
|
|
|
776
770
|
}
|
|
777
771
|
|
|
778
|
-
|
|
772
|
+
class Double extends Float { }
|
|
779
773
|
|
|
780
|
-
|
|
774
|
+
type DROP_2 = { DROP: {
|
|
781
775
|
entity: name,
|
|
782
776
|
table: ref,
|
|
783
777
|
view: ref,
|
|
784
778
|
}, }
|
|
785
779
|
export { DROP_2 as DROP }
|
|
786
780
|
|
|
787
|
-
|
|
781
|
+
class DROP_3<T> extends ConstructedQuery {
|
|
788
782
|
|
|
789
783
|
static entity (entity: Target): DROP_3<any>
|
|
790
784
|
|
|
@@ -792,20 +786,20 @@ declare class DROP_3<T> extends ConstructedQuery {
|
|
|
792
786
|
|
|
793
787
|
}
|
|
794
788
|
|
|
795
|
-
export
|
|
789
|
+
export type EDM = { $version: string }
|
|
796
790
|
|
|
797
|
-
export
|
|
791
|
+
export type EDMX = XML
|
|
798
792
|
|
|
799
|
-
|
|
793
|
+
type Element = type_2 & struct_2 & Association_2
|
|
800
794
|
|
|
801
|
-
export
|
|
795
|
+
export const entities: Service['entities'];
|
|
802
796
|
|
|
803
797
|
/**
|
|
804
798
|
* @see [capire](https://cap.cloud.sap/docs/node.js/cds-reflect#cds-entity)
|
|
805
799
|
*/
|
|
806
|
-
export
|
|
800
|
+
export interface entity extends Omit<csn.entity, 'elements' | 'items' | 'keys' | 'drafts'> {}
|
|
807
801
|
|
|
808
|
-
export
|
|
802
|
+
export class entity extends struct<'entity'> {
|
|
809
803
|
is_entity: true
|
|
810
804
|
|
|
811
805
|
keys: Definitions<type>
|
|
@@ -821,7 +815,7 @@ export declare class entity extends struct<'entity'> {
|
|
|
821
815
|
drafts?: entity
|
|
822
816
|
}
|
|
823
817
|
|
|
824
|
-
|
|
818
|
+
interface entity_2 extends Omit<struct_2, 'elements'> {
|
|
825
819
|
|
|
826
820
|
/**
|
|
827
821
|
* Entities with a query signify a view
|
|
@@ -837,7 +831,7 @@ declare interface entity_2 extends Omit<struct_2, 'elements'> {
|
|
|
837
831
|
drafts?: entity_2
|
|
838
832
|
}
|
|
839
833
|
|
|
840
|
-
|
|
834
|
+
type EntityElements = {
|
|
841
835
|
[name: string]: Element & {
|
|
842
836
|
key?: boolean,
|
|
843
837
|
virtual?: boolean,
|
|
@@ -846,7 +840,7 @@ declare type EntityElements = {
|
|
|
846
840
|
},
|
|
847
841
|
}
|
|
848
842
|
|
|
849
|
-
export
|
|
843
|
+
export type enum_literal = { '#': string }
|
|
850
844
|
|
|
851
845
|
/**
|
|
852
846
|
* Access to the configuration for Node.js runtime and tools.
|
|
@@ -854,7 +848,7 @@ export declare type enum_literal = { '#': string }
|
|
|
854
848
|
* filtered through the currently active profiles, thus highly dependent on the current working
|
|
855
849
|
* directory and process environment.
|
|
856
850
|
*/
|
|
857
|
-
export
|
|
851
|
+
export const env: {
|
|
858
852
|
build: _TODO,
|
|
859
853
|
hana: _TODO,
|
|
860
854
|
i18n: {
|
|
@@ -876,7 +870,7 @@ export declare const env: {
|
|
|
876
870
|
sql: _TODO,
|
|
877
871
|
} & { [key: string]: any };
|
|
878
872
|
|
|
879
|
-
export
|
|
873
|
+
export namespace env {
|
|
880
874
|
|
|
881
875
|
export interface MockUser {
|
|
882
876
|
tenant?: string
|
|
@@ -954,12 +948,12 @@ export declare namespace env {
|
|
|
954
948
|
}
|
|
955
949
|
}
|
|
956
950
|
|
|
957
|
-
export
|
|
951
|
+
export class event extends aspect<'event'> {}
|
|
958
952
|
|
|
959
953
|
/**
|
|
960
954
|
* @see [capire docs](https://cap.cloud.sap/docs/node.js/events)
|
|
961
955
|
*/
|
|
962
|
-
|
|
956
|
+
class Event_2 extends EventContext {
|
|
963
957
|
|
|
964
958
|
event: string
|
|
965
959
|
|
|
@@ -974,10 +968,10 @@ export { Event_2 as Event }
|
|
|
974
968
|
* Represents the invocation context of incoming request and event messages.
|
|
975
969
|
* @see [capire docs](https://cap.cloud.sap/docs/node.js/events)
|
|
976
970
|
*/
|
|
977
|
-
export
|
|
971
|
+
export class EventContext {
|
|
978
972
|
|
|
979
973
|
constructor (properties: { event: string, data?: object, query?: object, headers?: object })
|
|
980
|
-
http?: { req: express.Request, res: express.Response }
|
|
974
|
+
http?: { req: import('express').Request, res: import('express').Response }
|
|
981
975
|
|
|
982
976
|
tenant: string
|
|
983
977
|
|
|
@@ -993,7 +987,7 @@ export declare class EventContext {
|
|
|
993
987
|
|
|
994
988
|
}
|
|
995
989
|
|
|
996
|
-
export
|
|
990
|
+
export interface EventHandler {
|
|
997
991
|
// (msg : types.EventMessage) : Promise<any> | any | void
|
|
998
992
|
(req: Request_2): Promise<any> | any | void
|
|
999
993
|
}
|
|
@@ -1002,11 +996,11 @@ export declare interface EventHandler {
|
|
|
1002
996
|
* Provides a graceful shutdown for running servers, by first emitting `cds.emit('shutdown')`.
|
|
1003
997
|
* @see [capire](https://cap.cloud.sap/docs/node.js/cds-facade#cds-exit)
|
|
1004
998
|
*/
|
|
1005
|
-
export
|
|
999
|
+
export function exit (): void
|
|
1006
1000
|
|
|
1007
|
-
export
|
|
1001
|
+
export type expr = ref | val | xpr | function_call | SELECT_2
|
|
1008
1002
|
|
|
1009
|
-
export
|
|
1003
|
+
export type expr_literal = { '=': string }
|
|
1010
1004
|
|
|
1011
1005
|
/**
|
|
1012
1006
|
* Add aspects to a given object, for example:
|
|
@@ -1019,30 +1013,30 @@ export declare type expr_literal = { '=': string }
|
|
|
1019
1013
|
* }.prototype)
|
|
1020
1014
|
* ```
|
|
1021
1015
|
*/
|
|
1022
|
-
export
|
|
1016
|
+
export function extend<T> (target: T): {
|
|
1023
1017
|
with<E extends readonly any[]>(...ext: E): T & Intersect<E>,
|
|
1024
1018
|
}
|
|
1025
1019
|
|
|
1026
1020
|
/**
|
|
1027
1021
|
* Extensions capture `extend Foo with { ... }` directives.
|
|
1028
1022
|
*/
|
|
1029
|
-
|
|
1023
|
+
type Extension = {
|
|
1030
1024
|
extend: FQN,
|
|
1031
1025
|
elements?: { [name: string]: Element },
|
|
1032
1026
|
includes?: FQN[],
|
|
1033
1027
|
}
|
|
1034
1028
|
|
|
1035
|
-
export
|
|
1029
|
+
export type filename = string
|
|
1036
1030
|
|
|
1037
|
-
|
|
1031
|
+
type Filter = string | (<T extends any_ = any_>(def: T) => boolean)
|
|
1038
1032
|
|
|
1039
|
-
export
|
|
1033
|
+
export type _flavor = 'parsed' | 'xtended' | 'inferred'
|
|
1040
1034
|
|
|
1041
|
-
|
|
1035
|
+
class Float extends number { }
|
|
1042
1036
|
|
|
1043
|
-
export
|
|
1037
|
+
export const foreach: Service['foreach'];
|
|
1044
1038
|
|
|
1045
|
-
|
|
1039
|
+
type Formatter = {
|
|
1046
1040
|
|
|
1047
1041
|
/**
|
|
1048
1042
|
* Custom format function
|
|
@@ -1058,10 +1052,10 @@ declare type Formatter = {
|
|
|
1058
1052
|
/**
|
|
1059
1053
|
* The fully-quality name of a definition.
|
|
1060
1054
|
*/
|
|
1061
|
-
|
|
1055
|
+
type FQN = string
|
|
1062
1056
|
|
|
1063
1057
|
/** @private */
|
|
1064
|
-
export
|
|
1058
|
+
export type function_call = { func: string, args: { [key: string]: any }[] }
|
|
1065
1059
|
|
|
1066
1060
|
/**
|
|
1067
1061
|
* Loads and parses models from the specified files.
|
|
@@ -1069,13 +1063,13 @@ export declare type function_call = { func: string, args: { [key: string]: any }
|
|
|
1069
1063
|
* Essentially a shortcut for `cds.compile.to.csn(files)`
|
|
1070
1064
|
* @param files - filenames of models or if folder containing models
|
|
1071
1065
|
*/
|
|
1072
|
-
export
|
|
1066
|
+
export function get (files: '*' | filename | filename[], o?: _options): Promise<csn.CSN>
|
|
1073
1067
|
|
|
1074
|
-
export
|
|
1068
|
+
export const home: string;
|
|
1075
1069
|
|
|
1076
|
-
export
|
|
1070
|
+
export const insert: Service['insert'];
|
|
1077
1071
|
|
|
1078
|
-
|
|
1072
|
+
type INSERT_2 = { INSERT: {
|
|
1079
1073
|
into: ref | name,
|
|
1080
1074
|
entries: data[],
|
|
1081
1075
|
columns: string[],
|
|
@@ -1085,7 +1079,7 @@ declare type INSERT_2 = { INSERT: {
|
|
|
1085
1079
|
}, }
|
|
1086
1080
|
export { INSERT_2 as INSERT }
|
|
1087
1081
|
|
|
1088
|
-
|
|
1082
|
+
class INSERT_3<T> extends ConstructedQuery {
|
|
1089
1083
|
|
|
1090
1084
|
static into: (<T extends ArrayConstructable<any>> (entity: T, entries?: object | object[]) => INSERT_3<SingularType<T>>)
|
|
1091
1085
|
& (TaggedTemplateQueryPart<INSERT_3<unknown>>)
|
|
@@ -1114,15 +1108,15 @@ declare class INSERT_3<T> extends ConstructedQuery {
|
|
|
1114
1108
|
|
|
1115
1109
|
}
|
|
1116
1110
|
|
|
1117
|
-
|
|
1111
|
+
class Int16 extends Integer { }
|
|
1118
1112
|
|
|
1119
|
-
|
|
1113
|
+
class Int32 extends Integer { }
|
|
1120
1114
|
|
|
1121
|
-
|
|
1115
|
+
class Int64 extends Integer { }
|
|
1122
1116
|
|
|
1123
|
-
|
|
1117
|
+
class Integer extends number { }
|
|
1124
1118
|
|
|
1125
|
-
|
|
1119
|
+
type Intersect<T extends readonly unknown[]> = T extends [infer Head, ...infer Tail]
|
|
1126
1120
|
? Head & Intersect<Tail>
|
|
1127
1121
|
: unknown
|
|
1128
1122
|
|
|
@@ -1130,18 +1124,18 @@ declare type Intersect<T extends readonly unknown[]> = T extends [infer Head, ..
|
|
|
1130
1124
|
* Object structure that exposes both array-like and object-like behaviour.
|
|
1131
1125
|
* @see [capire](https://cap.cloud.sap/docs/node.js/cds-reflect#iterable)
|
|
1132
1126
|
*/
|
|
1133
|
-
|
|
1127
|
+
type IterableMap<T> = { [name: string]: T } & _ArrayLike<T>
|
|
1134
1128
|
|
|
1135
|
-
|
|
1129
|
+
type JSON_2 = string
|
|
1136
1130
|
export { JSON_2 as JSON }
|
|
1137
1131
|
|
|
1138
|
-
export
|
|
1132
|
+
export type Key = number | string | any
|
|
1139
1133
|
|
|
1140
|
-
|
|
1134
|
+
type kinds = 'aspect' | 'entity' | 'type' | 'event' | 'action' | 'function' | 'service' | 'context' | 'elements'
|
|
1141
1135
|
|
|
1142
|
-
|
|
1136
|
+
class LargeBinary extends Binary { }
|
|
1143
1137
|
|
|
1144
|
-
|
|
1138
|
+
class LargeString extends String_2 { }
|
|
1145
1139
|
|
|
1146
1140
|
/**
|
|
1147
1141
|
* Prepare a node module for lazy-loading submodules instead
|
|
@@ -1158,7 +1152,7 @@ declare class LargeString extends String_2 { }
|
|
|
1158
1152
|
* The first usage of `facade.sub` will load the sub module
|
|
1159
1153
|
* using standard Node.js's `module.require` functions.
|
|
1160
1154
|
*/
|
|
1161
|
-
export
|
|
1155
|
+
export function lazified<T> (target: T): T
|
|
1162
1156
|
|
|
1163
1157
|
/**
|
|
1164
1158
|
* Equip a given facade object with getters for lazy-loading modules instead
|
|
@@ -1174,15 +1168,15 @@ export declare function lazified<T> (target: T): T
|
|
|
1174
1168
|
* The first usage of `facade.sub` will load the sub module
|
|
1175
1169
|
* using standard Node.js's `module.require` functions.
|
|
1176
1170
|
*/
|
|
1177
|
-
export
|
|
1171
|
+
export function lazify<T> (target: T): T
|
|
1178
1172
|
|
|
1179
|
-
|
|
1173
|
+
enum levels {
|
|
1180
1174
|
// SILLY and VERBOSE are aliases for TRACE
|
|
1181
1175
|
/* eslint-disable-next-line @typescript-eslint/no-duplicate-enum-values */
|
|
1182
1176
|
SILENT = 0, ERROR = 1, WARN = 2, INFO = 3, DEBUG = 4, TRACE = 5, SILLY = 5, VERBOSE = 5
|
|
1183
1177
|
}
|
|
1184
1178
|
|
|
1185
|
-
export
|
|
1179
|
+
export const linked: {
|
|
1186
1180
|
|
|
1187
1181
|
/**
|
|
1188
1182
|
* Turns the given plain CSN model into a linked model
|
|
@@ -1207,7 +1201,7 @@ export declare const linked: {
|
|
|
1207
1201
|
LinkedDefinitions: IterableMap<linked_2.classes.any_>,
|
|
1208
1202
|
};
|
|
1209
1203
|
|
|
1210
|
-
export
|
|
1204
|
+
export namespace linked {
|
|
1211
1205
|
export type LinkedDefinitions = IterableMap<linked_2.classes.any_>
|
|
1212
1206
|
export type LinkedCSN = linked_2.LinkedCSN
|
|
1213
1207
|
|
|
@@ -1257,7 +1251,7 @@ export declare namespace linked {
|
|
|
1257
1251
|
}
|
|
1258
1252
|
}
|
|
1259
1253
|
|
|
1260
|
-
|
|
1254
|
+
namespace linked_2 {
|
|
1261
1255
|
export {
|
|
1262
1256
|
ModelPart,
|
|
1263
1257
|
Definition_2 as Definition,
|
|
@@ -1266,7 +1260,7 @@ declare namespace linked_2 {
|
|
|
1266
1260
|
}
|
|
1267
1261
|
}
|
|
1268
1262
|
|
|
1269
|
-
|
|
1263
|
+
interface LinkedCSN extends Omit<csn.CSN, 'definitions'> {
|
|
1270
1264
|
|
|
1271
1265
|
/**
|
|
1272
1266
|
* Fetches definitions matching the given filter, returning an iterator on them.
|
|
@@ -1350,9 +1344,9 @@ declare interface LinkedCSN extends Omit<csn.CSN, 'definitions'> {
|
|
|
1350
1344
|
* Shortcut for `cds.get(files, 'inferred')`
|
|
1351
1345
|
* @param files - filenames of models or if folder containing models
|
|
1352
1346
|
*/
|
|
1353
|
-
export
|
|
1347
|
+
export function load (files: '*' | filename | filename[], o?: _options): Promise<csn.CSN>
|
|
1354
1348
|
|
|
1355
|
-
|
|
1349
|
+
type Log = {
|
|
1356
1350
|
|
|
1357
1351
|
/**
|
|
1358
1352
|
* Logs a message
|
|
@@ -1366,9 +1360,9 @@ declare type Log = {
|
|
|
1366
1360
|
/**
|
|
1367
1361
|
* Create a new logger, or install a custom log formatter
|
|
1368
1362
|
*/
|
|
1369
|
-
export
|
|
1363
|
+
export const log: LogFactory;
|
|
1370
1364
|
|
|
1371
|
-
|
|
1365
|
+
type LogFactory = {
|
|
1372
1366
|
|
|
1373
1367
|
/**
|
|
1374
1368
|
* Returns a trace logger for the given module if trace is switched on for it,
|
|
@@ -1422,7 +1416,7 @@ declare type LogFactory = {
|
|
|
1422
1416
|
winstonLogger (LoggerOptions?: { level?: string, levels?: any, format?: any, transports?: any, exitOnError?: boolean | Function, silent?: boolean }),
|
|
1423
1417
|
}
|
|
1424
1418
|
|
|
1425
|
-
|
|
1419
|
+
class Logger {
|
|
1426
1420
|
|
|
1427
1421
|
|
|
1428
1422
|
/**
|
|
@@ -1492,19 +1486,19 @@ declare class Logger {
|
|
|
1492
1486
|
|
|
1493
1487
|
}
|
|
1494
1488
|
|
|
1495
|
-
|
|
1489
|
+
type LogLevel = keyof typeof levels | Lowercase<keyof typeof levels> | levels
|
|
1496
1490
|
|
|
1497
|
-
|
|
1491
|
+
type ManagedAssociation = Association & {
|
|
1498
1492
|
foreignKeys: Definitions<type>,
|
|
1499
1493
|
keys: Column[],
|
|
1500
1494
|
}
|
|
1501
1495
|
|
|
1502
|
-
export
|
|
1496
|
+
export class MessagingService extends Service {}
|
|
1503
1497
|
|
|
1504
|
-
export
|
|
1498
|
+
export type Middleswares = 'context' | 'trace' | 'auth' | 'ctx_model' | string
|
|
1505
1499
|
|
|
1506
|
-
export
|
|
1507
|
-
add: (middleware: RequestHandler, pos?: XOR<XOR<{ at: number }, { after: Middleswares }>, { before: Middleswares }>) => void,
|
|
1500
|
+
export const middlewares: {
|
|
1501
|
+
add: (middleware: import('express').RequestHandler, pos?: XOR<XOR<{ at: number }, { after: Middleswares }>, { before: Middleswares }>) => void,
|
|
1508
1502
|
};
|
|
1509
1503
|
|
|
1510
1504
|
/**
|
|
@@ -1527,7 +1521,7 @@ export declare const middlewares: {
|
|
|
1527
1521
|
* s2.bar // error :)
|
|
1528
1522
|
* ```
|
|
1529
1523
|
*/
|
|
1530
|
-
|
|
1524
|
+
type MixedIn<T> = T & { [key: string | number | symbol]: unknown }
|
|
1531
1525
|
|
|
1532
1526
|
/**
|
|
1533
1527
|
* Using this will require you to explicitly cast all classes you added mixins to
|
|
@@ -1535,18 +1529,18 @@ declare type MixedIn<T> = T & { [key: string | number | symbol]: unknown }
|
|
|
1535
1529
|
* properties, you can use the {@link MixedIn} type.
|
|
1536
1530
|
* @see [capire](https://cap.cloud.sap/docs/node.js/cds-reflect#mixin)
|
|
1537
1531
|
*/
|
|
1538
|
-
|
|
1532
|
+
function mixin (...classes: (new () => any)[]): void
|
|
1539
1533
|
|
|
1540
1534
|
/**
|
|
1541
1535
|
* The effective CDS model loaded during bootstrapping, which contains all service and entity definitions,
|
|
1542
1536
|
* including required services.
|
|
1543
1537
|
* Should only be ever set explictly in test scenarios!
|
|
1544
1538
|
*/
|
|
1545
|
-
export
|
|
1539
|
+
export let model: linked_2.LinkedCSN | undefined;
|
|
1546
1540
|
|
|
1547
|
-
|
|
1541
|
+
type ModelPart<T extends any_> = IterableMap<T> & ((namespace: string) => IterableMap<T>)
|
|
1548
1542
|
|
|
1549
|
-
|
|
1543
|
+
namespace models {
|
|
1550
1544
|
export {
|
|
1551
1545
|
get,
|
|
1552
1546
|
load,
|
|
@@ -1602,13 +1596,13 @@ declare namespace models {
|
|
|
1602
1596
|
}
|
|
1603
1597
|
|
|
1604
1598
|
/** @private */
|
|
1605
|
-
export
|
|
1599
|
+
export type name = string
|
|
1606
1600
|
|
|
1607
|
-
|
|
1601
|
+
const number: typeof number_;
|
|
1608
1602
|
|
|
1609
|
-
|
|
1603
|
+
class number_ extends scalar { }
|
|
1610
1604
|
|
|
1611
|
-
export
|
|
1605
|
+
export type _odata_options = {
|
|
1612
1606
|
flavor?: 'v2' | 'v4' | 'w4' | 'x4',
|
|
1613
1607
|
version?: 'v2' | 'v4',
|
|
1614
1608
|
structs?: boolean,
|
|
@@ -1620,65 +1614,65 @@ export declare type _odata_options = {
|
|
|
1620
1614
|
*/
|
|
1621
1615
|
// FIXME: this is actually supposed to be part of models.d.ts
|
|
1622
1616
|
// but had to be moved here so export * would not clash their definitions
|
|
1623
|
-
export
|
|
1617
|
+
export function on (event: 'loaded', listener: (model: CSN) => void): _cds
|
|
1624
1618
|
|
|
1625
1619
|
/**
|
|
1626
1620
|
* Emitted whenever a specific service is connected for the first time.
|
|
1627
1621
|
*/
|
|
1628
|
-
export
|
|
1622
|
+
export function on (event: 'connect', listener: (srv: Service) => void): _cds
|
|
1629
1623
|
|
|
1630
1624
|
/**
|
|
1631
1625
|
* Emitted at the very beginning of the bootsrapping process, when the
|
|
1632
1626
|
* express application has been constructed but no middlewares or routes
|
|
1633
1627
|
* added yet.
|
|
1634
1628
|
*/
|
|
1635
|
-
export
|
|
1629
|
+
export function on (event: 'bootstrap', listener: (app: import('express').Application) => void): _cds
|
|
1636
1630
|
|
|
1637
1631
|
/**
|
|
1638
1632
|
* Emitted for each service served by cds.serve().
|
|
1639
1633
|
*/
|
|
1640
|
-
export
|
|
1634
|
+
export function on (event: 'serving', listener: (srv: Service) => void): _cds
|
|
1641
1635
|
|
|
1642
1636
|
/**
|
|
1643
1637
|
* Emitted by the default, built-in `server.js` when all services are
|
|
1644
1638
|
* constructed and mounted by cds.serve().
|
|
1645
1639
|
*/
|
|
1646
|
-
export
|
|
1640
|
+
export function on (event: 'served', listener: (all: cds_services) => void): _cds
|
|
1647
1641
|
|
|
1648
1642
|
/**
|
|
1649
1643
|
* Emitted by the default, built-in `server.js` when the http server
|
|
1650
1644
|
* is started and listening for incoming requests.
|
|
1651
1645
|
*/
|
|
1652
|
-
export
|
|
1646
|
+
export function on (event: 'listening', listener: (args: { server: import('http').Server, url: string }) => void): _cds
|
|
1653
1647
|
|
|
1654
1648
|
/**
|
|
1655
1649
|
* Emitted by the default, built-in `server.js` when the http server
|
|
1656
1650
|
* is shutdown.
|
|
1657
1651
|
*/
|
|
1658
|
-
export
|
|
1652
|
+
export function on (event: 'shutdown', listener: () => void): _cds
|
|
1659
1653
|
|
|
1660
|
-
export
|
|
1654
|
+
export function once (event: 'bootstrap', listener: (app: import('express').Application) => void): _cds
|
|
1661
1655
|
|
|
1662
|
-
export
|
|
1656
|
+
export function once (event: 'served', listener: (all: cds_services) => void): _cds
|
|
1663
1657
|
|
|
1664
|
-
export
|
|
1658
|
+
export function once (event: 'listening', listener: (args: { server: import('http').Server, url: string }) => void): _cds
|
|
1665
1659
|
|
|
1666
|
-
export
|
|
1660
|
+
export function once (event: 'shutdown', listener: () => void): _cds
|
|
1667
1661
|
|
|
1668
|
-
export
|
|
1662
|
+
export type OneOrMany<T> = T | T[]
|
|
1669
1663
|
|
|
1670
|
-
export
|
|
1664
|
+
export interface OnErrorHandler {
|
|
1671
1665
|
(err: Error, req: Request_2): any | void
|
|
1672
1666
|
}
|
|
1673
1667
|
|
|
1674
|
-
export
|
|
1668
|
+
export interface OnEventHandler {
|
|
1675
1669
|
(req: Request_2, next: Function): Promise<any> | any | void
|
|
1676
1670
|
}
|
|
1677
1671
|
|
|
1678
1672
|
/** @private */
|
|
1679
|
-
export
|
|
1673
|
+
export type operator = string
|
|
1680
1674
|
|
|
1681
|
-
export
|
|
1675
|
+
export type _options = {
|
|
1682
1676
|
flavor?: _flavor,
|
|
1683
1677
|
plain?: boolean,
|
|
1684
1678
|
docs?: boolean,
|
|
@@ -1687,15 +1681,15 @@ export declare type _options = {
|
|
|
1687
1681
|
} | _flavor
|
|
1688
1682
|
|
|
1689
1683
|
/** @private */
|
|
1690
|
-
export
|
|
1684
|
+
export type ordering_term = expr & { sort?: 'asc' | 'desc', nulls?: 'first' | 'last' }
|
|
1691
1685
|
|
|
1692
|
-
export
|
|
1686
|
+
export const outboxed: (service: Service) => Service;
|
|
1693
1687
|
|
|
1694
1688
|
/**
|
|
1695
1689
|
* Provides a set of methods to parse a given model, query or expression.
|
|
1696
1690
|
* You can also use `cds.parse()` as a shortcut to `cds.parse.cdl()`.
|
|
1697
1691
|
*/
|
|
1698
|
-
export
|
|
1692
|
+
export const parse: {
|
|
1699
1693
|
|
|
1700
1694
|
/** Shortcut to `cds.parse.cdl()` */
|
|
1701
1695
|
(cdl: CDL): csn.CSN,
|
|
@@ -1706,24 +1700,24 @@ export declare const parse: {
|
|
|
1706
1700
|
ref (src: string): string[],
|
|
1707
1701
|
};
|
|
1708
1702
|
|
|
1709
|
-
|
|
1703
|
+
type Partial_2<T> = { [Key in keyof T]: undefined | T[Key] }
|
|
1710
1704
|
export { Partial_2 as Partial }
|
|
1711
1705
|
|
|
1712
|
-
|
|
1706
|
+
type PK = number | string | object
|
|
1713
1707
|
|
|
1714
|
-
|
|
1708
|
+
type PluralType<T extends Constructable> = Array<InstanceType<T>>
|
|
1715
1709
|
|
|
1716
|
-
export
|
|
1710
|
+
export type predicate = UnionsToIntersections<_xpr>
|
|
1717
1711
|
|
|
1718
|
-
|
|
1712
|
+
type Primitive = string | number | boolean | Date
|
|
1719
1713
|
|
|
1720
1714
|
/** @private */
|
|
1721
|
-
export
|
|
1715
|
+
export type primitive = number | string | boolean | null
|
|
1722
1716
|
|
|
1723
1717
|
/**
|
|
1724
1718
|
* Subclass for executing code with superuser privileges.
|
|
1725
1719
|
*/
|
|
1726
|
-
export
|
|
1720
|
+
export class Privileged extends User {
|
|
1727
1721
|
|
|
1728
1722
|
constructor ()
|
|
1729
1723
|
|
|
@@ -1731,15 +1725,15 @@ export declare class Privileged extends User {
|
|
|
1731
1725
|
|
|
1732
1726
|
}
|
|
1733
1727
|
|
|
1734
|
-
|
|
1728
|
+
type Projection<T> = (e: QLExtensions<T extends ArrayConstructable ? SingularType<T> : T>) => void
|
|
1735
1729
|
|
|
1736
1730
|
/**
|
|
1737
1731
|
* @alpha
|
|
1738
1732
|
* related to .protocols getters
|
|
1739
1733
|
*/
|
|
1740
|
-
|
|
1734
|
+
type Protocol = 'odata' | 'rest'
|
|
1741
1735
|
|
|
1742
|
-
|
|
1736
|
+
class QL<T> {
|
|
1743
1737
|
|
|
1744
1738
|
SELECT: StaticSELECT<T>
|
|
1745
1739
|
|
|
@@ -1761,7 +1755,7 @@ declare class QL<T> {
|
|
|
1761
1755
|
|
|
1762
1756
|
}
|
|
1763
1757
|
|
|
1764
|
-
|
|
1758
|
+
namespace ql {
|
|
1765
1759
|
export {
|
|
1766
1760
|
Query_2 as Query,
|
|
1767
1761
|
ConstructedQuery,
|
|
@@ -1789,13 +1783,13 @@ declare namespace ql {
|
|
|
1789
1783
|
}
|
|
1790
1784
|
export { ql }
|
|
1791
1785
|
|
|
1792
|
-
export
|
|
1786
|
+
export type QLExtensions<T> = T extends QLExtensions_<any> ? T : QLExtensions_<T>
|
|
1793
1787
|
|
|
1794
1788
|
/**
|
|
1795
1789
|
* QLExtensions are properties that are attached to entities in CQL contexts.
|
|
1796
1790
|
* They are passed down to all properties recursively.
|
|
1797
1791
|
*/
|
|
1798
|
-
|
|
1792
|
+
type QLExtensions_<T> = {
|
|
1799
1793
|
[Key in keyof T]: QLExtensions<T[Key]>
|
|
1800
1794
|
} & {
|
|
1801
1795
|
|
|
@@ -1817,11 +1811,11 @@ declare type QLExtensions_<T> = {
|
|
|
1817
1811
|
// over T and undefined, which gives us zero code completion within the callable.
|
|
1818
1812
|
} & Subqueryable<Exclude<T, undefined>>
|
|
1819
1813
|
|
|
1820
|
-
export
|
|
1814
|
+
export type Query = Partial<SELECT_2 & INSERT_2 & UPDATE_2 & DELETE_2 & CREATE_2 & DROP_2 & UPSERT_2>
|
|
1821
1815
|
|
|
1822
|
-
|
|
1816
|
+
type Query_2 = CQN.Query
|
|
1823
1817
|
|
|
1824
|
-
export
|
|
1818
|
+
export class QueryAPI {
|
|
1825
1819
|
|
|
1826
1820
|
entities: linked_2.LinkedCSN['entities']
|
|
1827
1821
|
|
|
@@ -1880,10 +1874,10 @@ export declare class QueryAPI {
|
|
|
1880
1874
|
stream: {
|
|
1881
1875
|
(column: string): {
|
|
1882
1876
|
from(entity: linked_2.Definition | string): {
|
|
1883
|
-
where(filter: any): ReadableStream,
|
|
1877
|
+
where(filter: any): import('node:stream/web').ReadableStream,
|
|
1884
1878
|
},
|
|
1885
1879
|
},
|
|
1886
|
-
(query: Query_2): Promise<ReadableStream>,
|
|
1880
|
+
(query: Query_2): Promise<import('node:stream/web').ReadableStream>,
|
|
1887
1881
|
}
|
|
1888
1882
|
|
|
1889
1883
|
/**
|
|
@@ -1909,23 +1903,23 @@ export declare class QueryAPI {
|
|
|
1909
1903
|
|
|
1910
1904
|
}
|
|
1911
1905
|
|
|
1912
|
-
export
|
|
1906
|
+
export const read: Service['read'];
|
|
1913
1907
|
|
|
1914
1908
|
/** @private */
|
|
1915
|
-
export
|
|
1909
|
+
export type ref = { ref: (name & { id?: string, where?: expr, args?: expr[] })[] }
|
|
1916
1910
|
|
|
1917
1911
|
/**
|
|
1918
1912
|
* Turns the given plain CSN model into a reflected model
|
|
1919
1913
|
* @see [capire](https://cap.cloud.sap/docs/node.js/cds-reflect)
|
|
1920
1914
|
*/
|
|
1921
|
-
export
|
|
1915
|
+
export function reflect (model: csn.CSN): linked_2.LinkedCSN
|
|
1922
1916
|
|
|
1923
|
-
export
|
|
1917
|
+
export class RemoteService extends Service {}
|
|
1924
1918
|
|
|
1925
1919
|
/**
|
|
1926
1920
|
* @see [capire docs](https://cap.cloud.sap/docs/node.js/events)
|
|
1927
1921
|
*/
|
|
1928
|
-
|
|
1922
|
+
class Request_2 extends Event_2 {
|
|
1929
1923
|
|
|
1930
1924
|
params: (string | object)[]
|
|
1931
1925
|
|
|
@@ -1990,7 +1984,7 @@ declare class Request_2 extends Event_2 {
|
|
|
1990
1984
|
}
|
|
1991
1985
|
export { Request_2 as Request }
|
|
1992
1986
|
|
|
1993
|
-
export
|
|
1987
|
+
export const requires: env.Requires;
|
|
1994
1988
|
|
|
1995
1989
|
/**
|
|
1996
1990
|
* Resolves given file or module name(s) to an array of absolute file names.
|
|
@@ -2000,24 +1994,24 @@ export declare const requires: env.Requires;
|
|
|
2000
1994
|
* @param files - The file or module name(s) of a model or a folder containing models. Specify `'*'` to fetch moels from default locations, i.e. `[ 'db/', 'srv/', 'app/' ]`
|
|
2001
1995
|
* @returns An array of absolute file names or `undefined` if none could be resolved.
|
|
2002
1996
|
*/
|
|
2003
|
-
export
|
|
1997
|
+
export function resolve (files: '*' | filename | filename[]): filename[] | undefined
|
|
2004
1998
|
|
|
2005
|
-
export
|
|
1999
|
+
export interface ResultSet extends Array<object> {}
|
|
2006
2000
|
|
|
2007
|
-
export
|
|
2001
|
+
export interface ResultsHandler {
|
|
2008
2002
|
(results: any[], req: Request_2): void
|
|
2009
2003
|
(each: any, req: Request_2): void
|
|
2010
2004
|
}
|
|
2011
2005
|
|
|
2012
|
-
export
|
|
2006
|
+
export const root: string;
|
|
2013
2007
|
|
|
2014
|
-
export
|
|
2008
|
+
export const run: Service['run'];
|
|
2015
2009
|
|
|
2016
|
-
|
|
2010
|
+
class scalar extends type { }
|
|
2017
2011
|
|
|
2018
|
-
|
|
2012
|
+
type Scalarise<A> = A extends Array<infer N> ? N : A
|
|
2019
2013
|
|
|
2020
|
-
|
|
2014
|
+
type SELECT_2 = { SELECT: {
|
|
2021
2015
|
distinct?: true,
|
|
2022
2016
|
one?: boolean,
|
|
2023
2017
|
from: source,
|
|
@@ -2032,7 +2026,7 @@ declare type SELECT_2 = { SELECT: {
|
|
|
2032
2026
|
}, }
|
|
2033
2027
|
export { SELECT_2 as SELECT }
|
|
2034
2028
|
|
|
2035
|
-
|
|
2029
|
+
class SELECT_3<T> extends ConstructedQuery {
|
|
2036
2030
|
|
|
2037
2031
|
static one: SELECT_one & { from: SELECT_one }
|
|
2038
2032
|
|
|
@@ -2098,7 +2092,7 @@ declare class SELECT_3<T> extends ConstructedQuery {
|
|
|
2098
2092
|
|
|
2099
2093
|
}
|
|
2100
2094
|
|
|
2101
|
-
|
|
2095
|
+
type SELECT_from =
|
|
2102
2096
|
// tagged template
|
|
2103
2097
|
TaggedTemplateQueryPart<Awaitable<SELECT_3<unknown>, InstanceType<any>>>
|
|
2104
2098
|
&
|
|
@@ -2128,7 +2122,7 @@ primaryKey: PK,
|
|
|
2128
2122
|
projection?: Projection<InstanceType<T>>
|
|
2129
2123
|
) => Awaitable<SELECT_3<PluralType<T>>, PluralType<T>>)
|
|
2130
2124
|
|
|
2131
|
-
|
|
2125
|
+
type SELECT_one =
|
|
2132
2126
|
TaggedTemplateQueryPart<Awaitable<SELECT_3<unknown>, InstanceType<any>>>
|
|
2133
2127
|
&
|
|
2134
2128
|
// calling with class
|
|
@@ -2151,7 +2145,7 @@ TaggedTemplateQueryPart<Awaitable<SELECT_3<unknown>, InstanceType<any>>>
|
|
|
2151
2145
|
* Constructs service providers from respective service definitions
|
|
2152
2146
|
* @see [capire](https://cap.cloud.sap/docs/node.js/cds-serve)
|
|
2153
2147
|
*/
|
|
2154
|
-
export
|
|
2148
|
+
export const serve: (service: string, options?: {
|
|
2155
2149
|
service?: string,
|
|
2156
2150
|
from?: '*' | 'all' | string,
|
|
2157
2151
|
[key: string]: any,
|
|
@@ -2160,13 +2154,13 @@ export declare const serve: (service: string, options?: {
|
|
|
2160
2154
|
/**
|
|
2161
2155
|
* The default bootstrap function as loaded from server.js
|
|
2162
2156
|
*/
|
|
2163
|
-
export
|
|
2157
|
+
export const server: Function;
|
|
2164
2158
|
|
|
2165
2159
|
/**
|
|
2166
2160
|
* Class cds.Service
|
|
2167
2161
|
* @see [capire docs](https://cap.cloud.sap/docs/node.js/core-services)
|
|
2168
2162
|
*/
|
|
2169
|
-
export
|
|
2163
|
+
export class Service extends QueryAPI {
|
|
2170
2164
|
|
|
2171
2165
|
constructor (
|
|
2172
2166
|
name?: string,
|
|
@@ -2325,9 +2319,9 @@ export declare class Service extends QueryAPI {
|
|
|
2325
2319
|
* Shortcut to base class for all service definitions from linked models.
|
|
2326
2320
|
* Plus accessors to impl functions and constructed providers.
|
|
2327
2321
|
*/
|
|
2328
|
-
export
|
|
2322
|
+
export const service: service;
|
|
2329
2323
|
|
|
2330
|
-
export
|
|
2324
|
+
export type service = {
|
|
2331
2325
|
|
|
2332
2326
|
/**
|
|
2333
2327
|
* Dummy wrapper for service implementation functions.
|
|
@@ -2345,9 +2339,9 @@ export declare type service = {
|
|
|
2345
2339
|
/**
|
|
2346
2340
|
* @see [capire](https://cap.cloud.sap/docs/node.js/cds-reflect#cds-service)
|
|
2347
2341
|
*/
|
|
2348
|
-
|
|
2342
|
+
interface service_ extends csn.service {}
|
|
2349
2343
|
|
|
2350
|
-
|
|
2344
|
+
class service_ extends context_ {
|
|
2351
2345
|
is_service: true
|
|
2352
2346
|
get entities (): Definitions<entity>
|
|
2353
2347
|
get types (): Definitions<type>
|
|
@@ -2366,28 +2360,28 @@ declare class service_ extends context_ {
|
|
|
2366
2360
|
get protocols (): { [protocol in Protocol]?: boolean | undefined }
|
|
2367
2361
|
}
|
|
2368
2362
|
|
|
2369
|
-
|
|
2363
|
+
interface service_2 extends any__2 { }
|
|
2370
2364
|
|
|
2371
|
-
export
|
|
2365
|
+
export interface ServiceImpl {
|
|
2372
2366
|
(this: Service, srv: Service): any
|
|
2373
2367
|
}
|
|
2374
2368
|
|
|
2375
2369
|
/**
|
|
2376
2370
|
* Dictionary of all services constructed and/or connected.
|
|
2377
2371
|
*/
|
|
2378
|
-
export
|
|
2372
|
+
export const services: cds_services;
|
|
2379
2373
|
|
|
2380
|
-
|
|
2374
|
+
type SingularType<T extends ArrayConstructable<T>> = InstanceType<T>[number]
|
|
2381
2375
|
|
|
2382
2376
|
/** @private */
|
|
2383
|
-
export
|
|
2377
|
+
export type source = UnionToIntersection<ref | SELECT_2> & { as?: name, join?: name, on?: xpr }
|
|
2384
2378
|
|
|
2385
2379
|
/**
|
|
2386
2380
|
* @see [docs](https://cap.cloud.sap/docs/node.js/cds-tx#cds-spawn)
|
|
2387
2381
|
*/
|
|
2388
|
-
export
|
|
2382
|
+
export function spawn (options: SpawnOptions, fn: (tx: Transaction) => object): SpawnEventEmitter
|
|
2389
2383
|
|
|
2390
|
-
export
|
|
2384
|
+
export class SpawnEventEmitter {
|
|
2391
2385
|
|
|
2392
2386
|
on<U extends keyof SpawnEvents>(
|
|
2393
2387
|
event: U, listener: SpawnEvents[U]
|
|
@@ -2400,21 +2394,21 @@ export declare class SpawnEventEmitter {
|
|
|
2400
2394
|
|
|
2401
2395
|
}
|
|
2402
2396
|
|
|
2403
|
-
export
|
|
2397
|
+
export interface SpawnEvents {
|
|
2404
2398
|
succeeded: (res: any) => void
|
|
2405
2399
|
failed: (error: any) => void
|
|
2406
2400
|
done: () => void
|
|
2407
2401
|
}
|
|
2408
2402
|
|
|
2409
|
-
export
|
|
2403
|
+
export type SpawnOptions = {
|
|
2410
2404
|
[key: string]: any,
|
|
2411
2405
|
every?: number,
|
|
2412
2406
|
after?: number,
|
|
2413
2407
|
}
|
|
2414
2408
|
|
|
2415
|
-
export
|
|
2409
|
+
export type SQL = string
|
|
2416
2410
|
|
|
2417
|
-
|
|
2411
|
+
type StaticSELECT<T> = typeof SELECT_3
|
|
2418
2412
|
& ((...columns: (T extends ArrayConstructable<any> ? keyof SingularType<T> : keyof T)[]) => SELECT_3<T>)
|
|
2419
2413
|
& ((...columns: string[]) => SELECT_3<T>)
|
|
2420
2414
|
& ((columns: string[]) => SELECT_3<T>)
|
|
@@ -2422,26 +2416,26 @@ declare type StaticSELECT<T> = typeof SELECT_3
|
|
|
2422
2416
|
& SELECT_from // as it is not directly quantified, ...
|
|
2423
2417
|
& SELECT_one
|
|
2424
2418
|
|
|
2425
|
-
export
|
|
2419
|
+
export const stream: Service['stream'];
|
|
2426
2420
|
|
|
2427
|
-
|
|
2421
|
+
const string: typeof string_;
|
|
2428
2422
|
|
|
2429
|
-
|
|
2423
|
+
class string_ extends scalar { }
|
|
2430
2424
|
|
|
2431
|
-
|
|
2425
|
+
class String_2 extends string { }
|
|
2432
2426
|
|
|
2433
2427
|
/**
|
|
2434
2428
|
* @see [capire](https://cap.cloud.sap/docs/node.js/cds-reflect#cds-struct)
|
|
2435
2429
|
*/
|
|
2436
|
-
export
|
|
2430
|
+
export interface struct extends Omit<csn.struct, 'items' | 'elements'> {}
|
|
2437
2431
|
|
|
2438
|
-
export
|
|
2432
|
+
export class struct<K extends kinds = 'elements' | 'type'> extends type<K> implements WithElements {
|
|
2439
2433
|
is_struct: true
|
|
2440
2434
|
|
|
2441
2435
|
elements: Definitions<type<'type'>>
|
|
2442
2436
|
}
|
|
2443
2437
|
|
|
2444
|
-
|
|
2438
|
+
interface struct_2 extends type_2 {
|
|
2445
2439
|
|
|
2446
2440
|
/**
|
|
2447
2441
|
* References to definitions to be included.
|
|
@@ -2456,7 +2450,7 @@ declare interface struct_2 extends type_2 {
|
|
|
2456
2450
|
* The final result of each subquery will be the property itself:
|
|
2457
2451
|
* `Book.title` == `Subqueryable<Book>.title()`
|
|
2458
2452
|
*/
|
|
2459
|
-
|
|
2453
|
+
type Subqueryable<T> = T extends Primitive ? unknown
|
|
2460
2454
|
// composition of many/ association to many
|
|
2461
2455
|
: T extends readonly unknown[] ? {
|
|
2462
2456
|
|
|
@@ -2498,14 +2492,14 @@ declare type Subqueryable<T> = T extends Primitive ? unknown
|
|
|
2498
2492
|
(fn: ((a: QLExtensions<T>) => any) | '*'): T,
|
|
2499
2493
|
}
|
|
2500
2494
|
|
|
2501
|
-
|
|
2495
|
+
type TaggedTemplateQueryPart<T> = (strings: TemplateStringsArray, ...params: unknown[]) => T
|
|
2502
2496
|
|
|
2503
2497
|
/**
|
|
2504
2498
|
* Target for any QL operation
|
|
2505
2499
|
*/
|
|
2506
|
-
|
|
2500
|
+
type Target = linked_2.classes.entity | Definition | string
|
|
2507
2501
|
|
|
2508
|
-
|
|
2502
|
+
class Test extends Axios {
|
|
2509
2503
|
|
|
2510
2504
|
test: Test
|
|
2511
2505
|
|
|
@@ -2520,11 +2514,11 @@ declare class Test extends Axios {
|
|
|
2520
2514
|
*/
|
|
2521
2515
|
verbose (v: boolean): this
|
|
2522
2516
|
|
|
2523
|
-
get chai (): typeof chai
|
|
2517
|
+
get chai (): typeof import('chai')
|
|
2524
2518
|
|
|
2525
|
-
get expect (): typeof chai.expect
|
|
2519
|
+
get expect (): typeof import('chai').expect
|
|
2526
2520
|
|
|
2527
|
-
get assert (): typeof chai.assert
|
|
2521
|
+
get assert (): typeof import('chai').assert
|
|
2528
2522
|
|
|
2529
2523
|
get data (): DataUtil
|
|
2530
2524
|
|
|
@@ -2536,7 +2530,7 @@ declare class Test extends Axios {
|
|
|
2536
2530
|
release(): void,
|
|
2537
2531
|
}
|
|
2538
2532
|
|
|
2539
|
-
then (r: (args: { server: http.Server, url: string }) => void): void
|
|
2533
|
+
then (r: (args: { server: import('http').Server, url: string }) => void): void
|
|
2540
2534
|
|
|
2541
2535
|
// get sleep(): (ms: number) => Promise<void>;
|
|
2542
2536
|
// get spy(): <T, K extends keyof T>(o: T, f: K) => T[K] extends (...args: infer TArgs) => infer TReturnValue
|
|
@@ -2545,7 +2539,7 @@ declare class Test extends Axios {
|
|
|
2545
2539
|
|
|
2546
2540
|
}
|
|
2547
2541
|
|
|
2548
|
-
export
|
|
2542
|
+
export const test: {
|
|
2549
2543
|
Test: typeof Test,
|
|
2550
2544
|
|
|
2551
2545
|
/**
|
|
@@ -2561,47 +2555,47 @@ export declare const test: {
|
|
|
2561
2555
|
in (dirname: string): Test,
|
|
2562
2556
|
};
|
|
2563
2557
|
|
|
2564
|
-
|
|
2558
|
+
class Time extends date { }
|
|
2565
2559
|
|
|
2566
|
-
|
|
2560
|
+
class TimeStamp extends DateTime { }
|
|
2567
2561
|
|
|
2568
2562
|
/**
|
|
2569
2563
|
* DO NOT USE
|
|
2570
2564
|
* @internal
|
|
2571
2565
|
*/
|
|
2572
|
-
export
|
|
2566
|
+
export type _TODO = any
|
|
2573
2567
|
|
|
2574
|
-
export
|
|
2568
|
+
export interface Transaction extends Service {
|
|
2575
2569
|
commit(): Promise<void>
|
|
2576
2570
|
rollback(): Promise<void>
|
|
2577
2571
|
}
|
|
2578
2572
|
|
|
2579
|
-
export
|
|
2573
|
+
export const transaction: Service['transaction'];
|
|
2580
2574
|
|
|
2581
2575
|
/**
|
|
2582
2576
|
* Starts or joins a transaction
|
|
2583
2577
|
* @see [docs](https://cap.cloud.sap/docs/node.js/cds-tx)
|
|
2584
2578
|
*/
|
|
2585
|
-
export
|
|
2579
|
+
export const tx: {
|
|
2586
2580
|
(fn: (tx: Transaction) => object): Promise<any>,
|
|
2587
2581
|
(context?: object): Transaction,
|
|
2588
2582
|
(context: object, fn: (tx: Transaction) => object): Promise<any>,
|
|
2589
2583
|
};
|
|
2590
2584
|
|
|
2591
|
-
export
|
|
2585
|
+
export interface type extends Omit<csn.type, 'items'> {
|
|
2592
2586
|
items: type
|
|
2593
2587
|
}
|
|
2594
2588
|
|
|
2595
|
-
export
|
|
2589
|
+
export class type<K extends kinds = 'type'> extends any_<K> { }
|
|
2596
2590
|
|
|
2597
|
-
|
|
2591
|
+
interface type_2 extends any__2 {
|
|
2598
2592
|
type?: FQN
|
|
2599
2593
|
items?: type_2
|
|
2600
2594
|
}
|
|
2601
2595
|
|
|
2602
|
-
export
|
|
2596
|
+
export type TypedRequest<T> = Omit<Request_2, 'data'> & { data: T }
|
|
2603
2597
|
|
|
2604
|
-
export
|
|
2598
|
+
export namespace types {
|
|
2605
2599
|
export type event = eventName | eventName[]
|
|
2606
2600
|
export type eventName = string
|
|
2607
2601
|
| 'CREATE' | 'READ' | 'UPDATE' | 'DELETE'
|
|
@@ -2611,30 +2605,30 @@ export declare namespace types {
|
|
|
2611
2605
|
export type target = string | linked_2.Definition | linked_2.classes.entity | (string | linked_2.Definition | linked_2.classes.entity)[] | ArrayConstructable
|
|
2612
2606
|
}
|
|
2613
2607
|
|
|
2614
|
-
|
|
2608
|
+
class UInt8 extends Integer { }
|
|
2615
2609
|
|
|
2616
|
-
export
|
|
2610
|
+
export const unboxed: (service: Service) => Service;
|
|
2617
2611
|
|
|
2618
|
-
|
|
2612
|
+
type UnionsToIntersections<U> = Array<UnionToIntersection<Scalarise<U>>>
|
|
2619
2613
|
|
|
2620
|
-
|
|
2614
|
+
type UnionToIntersection<U> = Partial<(U extends any ? (k: U) => void : never) extends (k: infer I) => void ? I : never>
|
|
2621
2615
|
|
|
2622
|
-
|
|
2616
|
+
type Unwrap<T> = T extends ArrayConstructable
|
|
2623
2617
|
? SingularType<T>
|
|
2624
2618
|
: T extends Array<infer U>
|
|
2625
2619
|
? U
|
|
2626
2620
|
: T
|
|
2627
2621
|
|
|
2628
|
-
export
|
|
2622
|
+
export const update: Service['update'];
|
|
2629
2623
|
|
|
2630
|
-
|
|
2624
|
+
type UPDATE_2 = { UPDATE: {
|
|
2631
2625
|
entity: ref | name,
|
|
2632
2626
|
data: { [key: string]: expr },
|
|
2633
2627
|
where?: predicate,
|
|
2634
2628
|
}, }
|
|
2635
2629
|
export { UPDATE_2 as UPDATE }
|
|
2636
2630
|
|
|
2637
|
-
|
|
2631
|
+
class UPDATE_3<T> extends ConstructedQuery {
|
|
2638
2632
|
|
|
2639
2633
|
// cds-typer plural
|
|
2640
2634
|
static entity<T extends ArrayConstructable<any>> (entity: T, primaryKey?: PK): UPDATE_3<SingularType<T>>
|
|
@@ -2665,7 +2659,7 @@ declare class UPDATE_3<T> extends ConstructedQuery {
|
|
|
2665
2659
|
|
|
2666
2660
|
}
|
|
2667
2661
|
|
|
2668
|
-
|
|
2662
|
+
type UPSERT_2 = { UPSERT: {
|
|
2669
2663
|
into: ref | name,
|
|
2670
2664
|
columns: string[],
|
|
2671
2665
|
entries: data[],
|
|
@@ -2674,7 +2668,7 @@ declare type UPSERT_2 = { UPSERT: {
|
|
|
2674
2668
|
}, }
|
|
2675
2669
|
export { UPSERT_2 as UPSERT }
|
|
2676
2670
|
|
|
2677
|
-
|
|
2671
|
+
class UPSERT_3<T> extends ConstructedQuery {
|
|
2678
2672
|
|
|
2679
2673
|
static into: (<T extends ArrayConstructable<any>> (entity: T, entries?: object | object[]) => UPSERT_3<SingularType<T>>)
|
|
2680
2674
|
& (TaggedTemplateQueryPart<UPSERT_3<unknown>>)
|
|
@@ -2705,7 +2699,7 @@ declare class UPSERT_3<T> extends ConstructedQuery {
|
|
|
2705
2699
|
* Represents the user in a given context.
|
|
2706
2700
|
* @see [capire docs](https://cap.cloud.sap/docs/node.js/authentication#cds-user)
|
|
2707
2701
|
*/
|
|
2708
|
-
export
|
|
2702
|
+
export class User {
|
|
2709
2703
|
|
|
2710
2704
|
constructor (obj?: string | { id: string, attr: Record<string, string>, roles: Array<string> | Record<string, string> } | User)
|
|
2711
2705
|
id: string
|
|
@@ -2733,7 +2727,7 @@ export declare class User {
|
|
|
2733
2727
|
/**
|
|
2734
2728
|
* Provides a set of utility functionss
|
|
2735
2729
|
*/
|
|
2736
|
-
export
|
|
2730
|
+
export const utils: {
|
|
2737
2731
|
|
|
2738
2732
|
/**
|
|
2739
2733
|
* Generates a new v4 UUID
|
|
@@ -2781,9 +2775,9 @@ export declare const utils: {
|
|
|
2781
2775
|
*/
|
|
2782
2776
|
write: {
|
|
2783
2777
|
(data: object): {
|
|
2784
|
-
to(...file: string[]): Promise<ReturnType<typeof fs.promises.writeFile>>,
|
|
2778
|
+
to(...file: string[]): Promise<ReturnType<typeof import('node:fs').promises.writeFile>>,
|
|
2785
2779
|
},
|
|
2786
|
-
(file: string, data: object): Promise<ReturnType<typeof fs.promises.writeFile>>,
|
|
2780
|
+
(file: string, data: object): Promise<ReturnType<typeof import('node:fs').promises.writeFile>>,
|
|
2787
2781
|
},
|
|
2788
2782
|
|
|
2789
2783
|
/**
|
|
@@ -2791,9 +2785,9 @@ export declare const utils: {
|
|
|
2791
2785
|
*/
|
|
2792
2786
|
copy: {
|
|
2793
2787
|
(src: string): {
|
|
2794
|
-
to(...dst: string[]): Promise<ReturnType<typeof fs.promises.copyFile>>,
|
|
2788
|
+
to(...dst: string[]): Promise<ReturnType<typeof import('node:fs').promises.copyFile>>,
|
|
2795
2789
|
},
|
|
2796
|
-
(dst: string, src: string): Promise<ReturnType<typeof fs.promises.copyFile>>,
|
|
2790
|
+
(dst: string, src: string): Promise<ReturnType<typeof import('node:fs').promises.copyFile>>,
|
|
2797
2791
|
},
|
|
2798
2792
|
|
|
2799
2793
|
/**
|
|
@@ -2804,33 +2798,33 @@ export declare const utils: {
|
|
|
2804
2798
|
/**
|
|
2805
2799
|
* @see https://cap.cloud.sap/docs/node.js/cds-utils#async-rmdir-path
|
|
2806
2800
|
*/
|
|
2807
|
-
rmdir: (...path: string[]) => Promise<ReturnType<typeof fs.promises.rm>>,
|
|
2801
|
+
rmdir: (...path: string[]) => Promise<ReturnType<typeof import('node:fs').promises.rm>>,
|
|
2808
2802
|
|
|
2809
2803
|
|
|
2810
2804
|
/**
|
|
2811
2805
|
* @see https://cap.cloud.sap/docs/node.js/cds-utils#async-rimraf-path
|
|
2812
2806
|
*/
|
|
2813
|
-
rimraf: (...path: string[]) => Promise<ReturnType<typeof fs.promises.rm>>,
|
|
2807
|
+
rimraf: (...path: string[]) => Promise<ReturnType<typeof import('node:fs').promises.rm>>,
|
|
2814
2808
|
|
|
2815
2809
|
|
|
2816
2810
|
/**
|
|
2817
2811
|
* @see https://cap.cloud.sap/docs/node.js/cds-utils#async-rm-path
|
|
2818
2812
|
*/
|
|
2819
|
-
rm: (...path: string[]) => Promise<ReturnType<typeof fs.promises.rm>>,
|
|
2813
|
+
rm: (...path: string[]) => Promise<ReturnType<typeof import('node:fs').promises.rm>>,
|
|
2820
2814
|
};
|
|
2821
2815
|
|
|
2822
|
-
|
|
2816
|
+
class UUID extends string { }
|
|
2823
2817
|
|
|
2824
2818
|
/** @private */
|
|
2825
|
-
export
|
|
2819
|
+
export type val = { val: any }
|
|
2826
2820
|
|
|
2827
|
-
|
|
2821
|
+
class Vector extends Binary { }
|
|
2828
2822
|
|
|
2829
|
-
export
|
|
2823
|
+
export const version: string;
|
|
2830
2824
|
|
|
2831
|
-
|
|
2825
|
+
type Visitor = (def: any_, name: string, parent: any_, defs: Definitions) => void
|
|
2832
2826
|
|
|
2833
|
-
|
|
2827
|
+
interface WithElements {
|
|
2834
2828
|
elements: Definitions<type>
|
|
2835
2829
|
}
|
|
2836
2830
|
|
|
@@ -2838,24 +2832,24 @@ declare interface WithElements {
|
|
|
2838
2832
|
* https://stackoverflow.com/a/53229567
|
|
2839
2833
|
* @internal
|
|
2840
2834
|
*/
|
|
2841
|
-
|
|
2835
|
+
type Without<T, U> = { [P in Exclude<keyof T, keyof U>]?: never }
|
|
2842
2836
|
|
|
2843
|
-
export
|
|
2837
|
+
export type XML = string
|
|
2844
2838
|
|
|
2845
2839
|
/** @internal */
|
|
2846
|
-
|
|
2840
|
+
type XOR<T, U> = (T | U) extends object ? (Without<T, U> & U) | (Without<U, T> & T) : T | U
|
|
2847
2841
|
|
|
2848
2842
|
/** @private */
|
|
2849
|
-
export
|
|
2843
|
+
export type xpr = { xpr: _xpr }
|
|
2850
2844
|
|
|
2851
2845
|
/** @private */
|
|
2852
|
-
export
|
|
2846
|
+
export type _xpr = (expr | operator) []
|
|
2853
2847
|
|
|
2854
|
-
export
|
|
2848
|
+
export type YAML = string
|
|
2855
2849
|
|
|
2856
2850
|
export { }
|
|
2857
2851
|
|
|
2858
|
-
|
|
2852
|
+
global {
|
|
2859
2853
|
// these provide the functionality from SELECT, INSERT, etc in the global facade
|
|
2860
2854
|
const SELECT: ql.QL<any>['SELECT']
|
|
2861
2855
|
const INSERT: ql.QL<any>['INSERT']
|
|
@@ -2874,3 +2868,5 @@ declare global {
|
|
|
2874
2868
|
type CREATE<T> = ql.CREATE<T>
|
|
2875
2869
|
type DROP<T> = ql.DROP<T>
|
|
2876
2870
|
}
|
|
2871
|
+
|
|
2872
|
+
}
|