@cap-js/cds-types 0.14.0 → 0.16.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 +133 -76
- package/package.json +1 -1
package/dist/cds-types.d.ts
CHANGED
|
@@ -64,13 +64,15 @@ export type __UUID = classes.UUID
|
|
|
64
64
|
|
|
65
65
|
export type __Vector = classes.Vector
|
|
66
66
|
|
|
67
|
-
class action extends
|
|
67
|
+
class action extends any__2<'action' | 'function'> {}
|
|
68
68
|
|
|
69
69
|
export interface ActionEventHandler<S, P, R> {
|
|
70
70
|
// eslint-disable-next-line @typescript-eslint/no-unsafe-function-type
|
|
71
|
-
(req:
|
|
71
|
+
(req: ActionRequest<P, S>, next: Function): Promise<R> | R
|
|
72
72
|
}
|
|
73
73
|
|
|
74
|
+
export type ActionRequest<P, S> = Omit<Request_2, 'data'> & { data: P, subject: S }
|
|
75
|
+
|
|
74
76
|
interface And {
|
|
75
77
|
and: TaggedTemplateQueryPart<this>
|
|
76
78
|
& ((predicate: object) => this)
|
|
@@ -88,11 +90,20 @@ export class Anonymous extends User {
|
|
|
88
90
|
|
|
89
91
|
}
|
|
90
92
|
|
|
91
|
-
const any: typeof
|
|
93
|
+
const any: typeof any__2;
|
|
94
|
+
|
|
95
|
+
interface any_ {
|
|
96
|
+
kind?: kinds
|
|
97
|
+
/**
|
|
98
|
+
* only available when compiled with docs:true
|
|
99
|
+
* @see [capire docs](https://cap.cloud.sap/docs/cds/cdl#comments)
|
|
100
|
+
*/
|
|
101
|
+
doc?: string
|
|
102
|
+
}
|
|
92
103
|
|
|
93
|
-
interface
|
|
104
|
+
interface any__2 extends csn.any_ {}
|
|
94
105
|
|
|
95
|
-
class
|
|
106
|
+
class any__2<K extends kinds = kinds> {
|
|
96
107
|
private _: K // break covariance
|
|
97
108
|
constructor (...aspects: any[])
|
|
98
109
|
|
|
@@ -101,15 +112,6 @@ class any_<K extends kinds = kinds> {
|
|
|
101
112
|
// is (kind: kinds | 'Association' | 'Composition'): boolean
|
|
102
113
|
}
|
|
103
114
|
|
|
104
|
-
interface any__2 {
|
|
105
|
-
kind?: kinds
|
|
106
|
-
/**
|
|
107
|
-
* only available when compiled with docs:true
|
|
108
|
-
* @see [capire docs](https://cap.cloud.sap/docs/cds/cdl#comments)
|
|
109
|
-
*/
|
|
110
|
-
doc?: string
|
|
111
|
-
}
|
|
112
|
-
|
|
113
115
|
/**
|
|
114
116
|
* The {@link https://expressjs.com/en/4x/api.html#app| express.js application} constructed by the server implementation.
|
|
115
117
|
*
|
|
@@ -254,6 +256,7 @@ namespace cds {
|
|
|
254
256
|
on,
|
|
255
257
|
once,
|
|
256
258
|
exit,
|
|
259
|
+
error,
|
|
257
260
|
_cds,
|
|
258
261
|
cds_services,
|
|
259
262
|
connect,
|
|
@@ -342,6 +345,7 @@ namespace cds {
|
|
|
342
345
|
CdsFunctions,
|
|
343
346
|
HandlerFunction,
|
|
344
347
|
CRUDEventHandler,
|
|
348
|
+
ActionRequest,
|
|
345
349
|
ActionEventHandler,
|
|
346
350
|
ResultsHandler,
|
|
347
351
|
SpawnEvents,
|
|
@@ -350,7 +354,6 @@ namespace cds {
|
|
|
350
354
|
SpawnOptions,
|
|
351
355
|
context,
|
|
352
356
|
tx,
|
|
353
|
-
entities,
|
|
354
357
|
run,
|
|
355
358
|
foreach,
|
|
356
359
|
stream,
|
|
@@ -360,6 +363,7 @@ namespace cds {
|
|
|
360
363
|
update,
|
|
361
364
|
transaction,
|
|
362
365
|
db,
|
|
366
|
+
entities,
|
|
363
367
|
queued,
|
|
364
368
|
unqueued,
|
|
365
369
|
outboxed,
|
|
@@ -367,6 +371,8 @@ namespace cds {
|
|
|
367
371
|
EventContext,
|
|
368
372
|
Event_2 as Event,
|
|
369
373
|
Request_2 as Request,
|
|
374
|
+
GetRequest,
|
|
375
|
+
PostRequest,
|
|
370
376
|
User,
|
|
371
377
|
Anonymous,
|
|
372
378
|
Privileged,
|
|
@@ -391,6 +397,7 @@ namespace cds {
|
|
|
391
397
|
_segment,
|
|
392
398
|
_named,
|
|
393
399
|
val,
|
|
400
|
+
list,
|
|
394
401
|
xpr,
|
|
395
402
|
_xpr,
|
|
396
403
|
operator,
|
|
@@ -438,6 +445,7 @@ namespace cds_2 {
|
|
|
438
445
|
on,
|
|
439
446
|
once,
|
|
440
447
|
exit,
|
|
448
|
+
error,
|
|
441
449
|
_cds,
|
|
442
450
|
cds_services,
|
|
443
451
|
connect,
|
|
@@ -526,6 +534,7 @@ namespace cds_2 {
|
|
|
526
534
|
CdsFunctions,
|
|
527
535
|
HandlerFunction,
|
|
528
536
|
CRUDEventHandler,
|
|
537
|
+
ActionRequest,
|
|
529
538
|
ActionEventHandler,
|
|
530
539
|
ResultsHandler,
|
|
531
540
|
SpawnEvents,
|
|
@@ -534,7 +543,6 @@ namespace cds_2 {
|
|
|
534
543
|
SpawnOptions,
|
|
535
544
|
context,
|
|
536
545
|
tx,
|
|
537
|
-
entities,
|
|
538
546
|
run,
|
|
539
547
|
foreach,
|
|
540
548
|
stream,
|
|
@@ -544,6 +552,7 @@ namespace cds_2 {
|
|
|
544
552
|
update,
|
|
545
553
|
transaction,
|
|
546
554
|
db,
|
|
555
|
+
entities,
|
|
547
556
|
queued,
|
|
548
557
|
unqueued,
|
|
549
558
|
outboxed,
|
|
@@ -551,6 +560,8 @@ namespace cds_2 {
|
|
|
551
560
|
EventContext,
|
|
552
561
|
Event_2 as Event,
|
|
553
562
|
Request_2 as Request,
|
|
563
|
+
GetRequest,
|
|
564
|
+
PostRequest,
|
|
554
565
|
User,
|
|
555
566
|
Anonymous,
|
|
556
567
|
Privileged,
|
|
@@ -575,6 +586,7 @@ namespace cds_2 {
|
|
|
575
586
|
_segment,
|
|
576
587
|
_named,
|
|
577
588
|
val,
|
|
589
|
+
list,
|
|
578
590
|
xpr,
|
|
579
591
|
_xpr,
|
|
580
592
|
operator,
|
|
@@ -635,7 +647,7 @@ namespace classes {
|
|
|
635
647
|
Column,
|
|
636
648
|
Definitions,
|
|
637
649
|
WithElements,
|
|
638
|
-
any_,
|
|
650
|
+
any__2 as any_,
|
|
639
651
|
any,
|
|
640
652
|
aspect,
|
|
641
653
|
type,
|
|
@@ -862,9 +874,9 @@ export let context: EventContext | undefined;
|
|
|
862
874
|
|
|
863
875
|
interface context_ extends csn.context {}
|
|
864
876
|
|
|
865
|
-
class context_ extends
|
|
877
|
+
class context_ extends any__2 { }
|
|
866
878
|
|
|
867
|
-
interface context_2 extends
|
|
879
|
+
interface context_2 extends any_ { }
|
|
868
880
|
|
|
869
881
|
namespace CQN {
|
|
870
882
|
export {
|
|
@@ -888,6 +900,7 @@ namespace CQN {
|
|
|
888
900
|
_segment,
|
|
889
901
|
_named,
|
|
890
902
|
val,
|
|
903
|
+
list,
|
|
891
904
|
xpr,
|
|
892
905
|
_xpr,
|
|
893
906
|
operator,
|
|
@@ -963,7 +976,7 @@ namespace csn {
|
|
|
963
976
|
Extension,
|
|
964
977
|
Element,
|
|
965
978
|
kinds,
|
|
966
|
-
|
|
979
|
+
any_,
|
|
967
980
|
context_2 as context,
|
|
968
981
|
service_2 as service,
|
|
969
982
|
type_2 as type,
|
|
@@ -1043,12 +1056,12 @@ type DeepPartial<T> = T extends object
|
|
|
1043
1056
|
*/
|
|
1044
1057
|
type Definition = context_2 & service_2 & type_2 & struct_2 & entity_2 & Association_2
|
|
1045
1058
|
|
|
1046
|
-
type Definition_2 =
|
|
1059
|
+
type Definition_2 = any__2
|
|
1047
1060
|
|
|
1048
1061
|
/**
|
|
1049
1062
|
* @see [capire](https://cap.cloud.sap/docs/node.js/cds-reflect#iterable)
|
|
1050
1063
|
*/
|
|
1051
|
-
type Definitions<T extends
|
|
1064
|
+
type Definitions<T extends any__2 = any__2> = IterableMap<T>
|
|
1052
1065
|
|
|
1053
1066
|
const delete_: Service['delete'];
|
|
1054
1067
|
export { delete_ as delete };
|
|
@@ -1097,7 +1110,7 @@ export type EDMX = XML
|
|
|
1097
1110
|
|
|
1098
1111
|
type Element = type_2 & struct_2 & Association_2
|
|
1099
1112
|
|
|
1100
|
-
export const entities:
|
|
1113
|
+
export const entities: linked_2.LinkedCSN['entities'];
|
|
1101
1114
|
|
|
1102
1115
|
/**
|
|
1103
1116
|
* @see [capire](https://cap.cloud.sap/docs/node.js/cds-reflect#cds-entity)
|
|
@@ -1293,6 +1306,17 @@ export namespace env {
|
|
|
1293
1306
|
}
|
|
1294
1307
|
}
|
|
1295
1308
|
|
|
1309
|
+
/**
|
|
1310
|
+
* @see [capire](https://cap.cloud.sap/docs/node.js/cds-facade#cds-error)
|
|
1311
|
+
*/
|
|
1312
|
+
export function error (status: number, message: string, details?: {stack?: unknown}, caller?: (...args: any[]) => unknown): Error
|
|
1313
|
+
|
|
1314
|
+
export function error (message: string, details?: {status: number, stack?: unknown}, caller?: (...args: any[]) => unknown): Error
|
|
1315
|
+
|
|
1316
|
+
export function error (details: {status: number, message: string}, caller?: (...args: any[]) => unknown): Error
|
|
1317
|
+
|
|
1318
|
+
export function error (string: TemplateStringsArray, ...args: any[]): Error
|
|
1319
|
+
|
|
1296
1320
|
export class event extends aspect<'event'> {}
|
|
1297
1321
|
|
|
1298
1322
|
/**
|
|
@@ -1349,7 +1373,7 @@ export interface EventHandler {
|
|
|
1349
1373
|
*/
|
|
1350
1374
|
export function exit (): void
|
|
1351
1375
|
|
|
1352
|
-
export type expr = ref | val | xpr | function_call | SELECT_2
|
|
1376
|
+
export type expr = ref | val | list | xpr | function_call | SELECT_2
|
|
1353
1377
|
|
|
1354
1378
|
export type expr_literal = { '=': string }
|
|
1355
1379
|
|
|
@@ -1388,7 +1412,7 @@ type Extension = {
|
|
|
1388
1412
|
|
|
1389
1413
|
export type filename = string
|
|
1390
1414
|
|
|
1391
|
-
type Filter = string | (<T extends
|
|
1415
|
+
type Filter = string | (<T extends any__2 = any__2>(def: T) => boolean)
|
|
1392
1416
|
|
|
1393
1417
|
export type _flavor = 'parsed' | 'xtended' | 'inferred'
|
|
1394
1418
|
|
|
@@ -1430,6 +1454,10 @@ export type function_call = { func: string, args: { [key: string]: any }[] }
|
|
|
1430
1454
|
*/
|
|
1431
1455
|
export function get (files: '*' | filename | filename[], o?: _options): Promise<csn.CSN>
|
|
1432
1456
|
|
|
1457
|
+
export type GetRequest<
|
|
1458
|
+
P extends Record<string, any>[]
|
|
1459
|
+
> = Request_2<Record<never, never>, P>;
|
|
1460
|
+
|
|
1433
1461
|
interface GroupBy {
|
|
1434
1462
|
groupBy: TaggedTemplateQueryPart<this>
|
|
1435
1463
|
& ((columns: Partial<{[column in KeyOfTarget<this extends ConstructedQuery<infer E> ? E : never, never>]: any}>) => this)
|
|
@@ -1739,6 +1767,7 @@ export namespace linked {
|
|
|
1739
1767
|
namespace linked_2 {
|
|
1740
1768
|
export {
|
|
1741
1769
|
ModelPart,
|
|
1770
|
+
ModelPartFn,
|
|
1742
1771
|
Definition_2 as Definition,
|
|
1743
1772
|
LinkedCSN,
|
|
1744
1773
|
classes
|
|
@@ -1757,13 +1786,13 @@ interface LinkedCSN extends Omit<csn.CSN, 'definitions'> {
|
|
|
1757
1786
|
* let entities = m.all('entity') //> equivalent shortcut
|
|
1758
1787
|
* ```
|
|
1759
1788
|
*/
|
|
1760
|
-
each<T extends
|
|
1789
|
+
each<T extends any__2>(x: Filter, defs?: Definitions<T>): IterableIterator<T>
|
|
1761
1790
|
|
|
1762
1791
|
/**
|
|
1763
1792
|
* Fetches definitions matching the given filter, returning them in an array.
|
|
1764
1793
|
* Convenience shortcut for `[...reflect.each('entity')]`
|
|
1765
1794
|
*/
|
|
1766
|
-
all<T extends
|
|
1795
|
+
all<T extends any__2>(x: Filter, defs?: Definitions<T>): T[]
|
|
1767
1796
|
|
|
1768
1797
|
/**
|
|
1769
1798
|
* Fetches definitions matching the given filter, returning the first match, if any.
|
|
@@ -1772,7 +1801,7 @@ interface LinkedCSN extends Omit<csn.CSN, 'definitions'> {
|
|
|
1772
1801
|
* @param x - the filter
|
|
1773
1802
|
* @param defs - the definitions to fetch in, default: `this.definitions`
|
|
1774
1803
|
*/
|
|
1775
|
-
find<T extends
|
|
1804
|
+
find<T extends any__2>(x: Filter, defs?: Definitions<T>): T | undefined
|
|
1776
1805
|
|
|
1777
1806
|
/**
|
|
1778
1807
|
* Calls the visitor for each definition matching the given filter.
|
|
@@ -1800,7 +1829,7 @@ interface LinkedCSN extends Omit<csn.CSN, 'definitions'> {
|
|
|
1800
1829
|
* @param parent - either the parent itself or its fully-qualified name
|
|
1801
1830
|
* @param filter - an optional filter to apply before picking a child
|
|
1802
1831
|
*/
|
|
1803
|
-
childrenOf(parent: any | string, filter?: ((def:
|
|
1832
|
+
childrenOf(parent: any | string, filter?: ((def: any__2) => boolean)): Definitions
|
|
1804
1833
|
|
|
1805
1834
|
/**
|
|
1806
1835
|
* Provides convenient access to the model's top-level definitions.
|
|
@@ -1818,13 +1847,16 @@ interface LinkedCSN extends Omit<csn.CSN, 'definitions'> {
|
|
|
1818
1847
|
* SELECT.from (Books) .where ({ID:11})
|
|
1819
1848
|
* ```
|
|
1820
1849
|
*/
|
|
1821
|
-
exports: IterableMap<
|
|
1822
|
-
definitions: IterableMap<
|
|
1823
|
-
entities:
|
|
1850
|
+
exports: IterableMap<any__2>
|
|
1851
|
+
definitions: IterableMap<any__2>
|
|
1852
|
+
entities: ModelPartFn<entity>
|
|
1824
1853
|
services: ModelPart<service_>
|
|
1825
1854
|
|
|
1826
1855
|
}
|
|
1827
1856
|
|
|
1857
|
+
/** @private */
|
|
1858
|
+
export type list = { list: any[] }
|
|
1859
|
+
|
|
1828
1860
|
/**
|
|
1829
1861
|
* Shortcut for `cds.get(files, 'inferred')`
|
|
1830
1862
|
* @param files - filenames of models or if folder containing models
|
|
@@ -1995,6 +2027,7 @@ export type Middlewares = 'context' | 'trace' | 'auth' | 'ctx_model' | string
|
|
|
1995
2027
|
|
|
1996
2028
|
export const middlewares: {
|
|
1997
2029
|
add: (middleware: import('express').RequestHandler, pos?: XOR<XOR<{ at: number }, { after: Middlewares }>, { before: Middlewares }>) => void,
|
|
2030
|
+
before: import('express').RequestHandler[],
|
|
1998
2031
|
};
|
|
1999
2032
|
|
|
2000
2033
|
/**
|
|
@@ -2040,7 +2073,12 @@ function mixin (...classes: (new () => any)[]): void
|
|
|
2040
2073
|
*/
|
|
2041
2074
|
export let model: linked_2.LinkedCSN | undefined;
|
|
2042
2075
|
|
|
2043
|
-
type ModelPart<T extends
|
|
2076
|
+
type ModelPart<T extends any__2> = IterableMap<T> & {
|
|
2077
|
+
/** @deprecated undocumented variant that will be removed in cds^10 */
|
|
2078
|
+
(namespace: string): IterableMap<T>,
|
|
2079
|
+
}
|
|
2080
|
+
|
|
2081
|
+
type ModelPartFn<T extends any__2> = IterableMap<T> & ((namespace: string) => IterableMap<T>)
|
|
2044
2082
|
|
|
2045
2083
|
namespace models {
|
|
2046
2084
|
export {
|
|
@@ -2135,7 +2173,7 @@ export function on (event: 'connect', listener: (srv: Service) => void): _cds
|
|
|
2135
2173
|
export function on (event: 'bootstrap', listener: (app: import('express').Application) => void): _cds
|
|
2136
2174
|
|
|
2137
2175
|
/**
|
|
2138
|
-
* Emitted
|
|
2176
|
+
* Emitted the model is compiled for usage in Node.js or Java runtime.
|
|
2139
2177
|
* @beta
|
|
2140
2178
|
*/
|
|
2141
2179
|
export function on (event: 'compile.for.runtime', listener: (model: CSN) => void): _cds
|
|
@@ -2246,6 +2284,11 @@ type PK = number | string | object
|
|
|
2246
2284
|
|
|
2247
2285
|
type PluralInstanceType<T extends Constructable> = Array<InstanceType<T>>
|
|
2248
2286
|
|
|
2287
|
+
export type PostRequest<
|
|
2288
|
+
D = any,
|
|
2289
|
+
P extends Record<string, any>[] = Record<string, any>[]
|
|
2290
|
+
> = Request_2<D, P>;
|
|
2291
|
+
|
|
2249
2292
|
export type predicate = _xpr
|
|
2250
2293
|
|
|
2251
2294
|
type Primitive = string | number | boolean | Date
|
|
@@ -2337,8 +2380,6 @@ type Query_2 = CQN.Query
|
|
|
2337
2380
|
|
|
2338
2381
|
export class QueryAPI {
|
|
2339
2382
|
|
|
2340
|
-
entities: linked_2.LinkedCSN['entities']
|
|
2341
|
-
|
|
2342
2383
|
/**
|
|
2343
2384
|
* @see [docs](https://cap.cloud.sap/docs/node.js/core-services#crud-style-api)
|
|
2344
2385
|
*/
|
|
@@ -2460,9 +2501,24 @@ export class RemoteService extends Service {}
|
|
|
2460
2501
|
/**
|
|
2461
2502
|
* @see [capire docs](https://cap.cloud.sap/docs/node.js/events)
|
|
2462
2503
|
*/
|
|
2463
|
-
class Request_2<
|
|
2504
|
+
class Request_2<
|
|
2505
|
+
D = any,
|
|
2506
|
+
P extends Record<string, any>[] = Record<string, any>[]
|
|
2507
|
+
> extends Event_2<D> {
|
|
2508
|
+
|
|
2509
|
+
messages: {message: string, numericSeverity: levels}[]
|
|
2510
|
+
|
|
2511
|
+
errors: {
|
|
2512
|
+
code?: number,
|
|
2513
|
+
message: string,
|
|
2514
|
+
stack: string,
|
|
2515
|
+
target?: string,
|
|
2516
|
+
args?: unknown[],
|
|
2517
|
+
}[]
|
|
2464
2518
|
|
|
2465
|
-
|
|
2519
|
+
results: D[]
|
|
2520
|
+
|
|
2521
|
+
params: P
|
|
2466
2522
|
|
|
2467
2523
|
method: string
|
|
2468
2524
|
|
|
@@ -2484,45 +2540,38 @@ class Request_2<T = any> extends Event_2<T> {
|
|
|
2484
2540
|
/** @beta */
|
|
2485
2541
|
reply (results: any, options: { mimetype?: string, filename?: string, [key: string]: any }): void
|
|
2486
2542
|
|
|
2487
|
-
|
|
2488
|
-
|
|
2489
|
-
info (code: number, message: string, target?: string, args?: any[]): Error
|
|
2490
|
-
|
|
2491
|
-
warn (code: number, message: string, target?: string, args?: any[]): Error
|
|
2492
|
-
|
|
2493
|
-
error (code: number, message: string, target?: string, args?: any[]): Error
|
|
2494
|
-
|
|
2495
|
-
reject (code: number, message: string, target?: string, args?: any[]): never
|
|
2496
|
-
|
|
2497
|
-
notify (code: number, message: string, args?: any[]): Error
|
|
2498
|
-
|
|
2499
|
-
info (code: number, message: string, args?: any[]): Error
|
|
2500
|
-
|
|
2501
|
-
warn (code: number, message: string, args?: any[]): Error
|
|
2502
|
-
|
|
2503
|
-
error (code: number, message: string, args?: any[]): Error
|
|
2504
|
-
|
|
2505
|
-
reject (code: number, message: string, args?: any[]): never
|
|
2506
|
-
|
|
2543
|
+
// positional args
|
|
2507
2544
|
notify (message: string, target?: string, args?: any[]): Error
|
|
2545
|
+
notify (status: number, message?: string, target?: string, args?: any[]): Error
|
|
2508
2546
|
|
|
2509
2547
|
info (message: string, target?: string, args?: any[]): Error
|
|
2548
|
+
info (status: number, message?: string, target?: string, args?: any[]): Error
|
|
2510
2549
|
|
|
2511
2550
|
warn (message: string, target?: string, args?: any[]): Error
|
|
2551
|
+
warn (status: number, message?: string, target?: string, args?: any[]): Error
|
|
2512
2552
|
|
|
2513
2553
|
error (message: string, target?: string, args?: any[]): Error
|
|
2554
|
+
error (status: number, message?: string, target?: string, args?: any[]): Error
|
|
2555
|
+
error (status: number, target?: string, args?: any[]): Error
|
|
2514
2556
|
|
|
2515
2557
|
reject (message: string, target?: string, args?: any[]): never
|
|
2558
|
+
reject (status: number, message?: string, target?: string, args?: any[]): never
|
|
2516
2559
|
|
|
2517
|
-
|
|
2560
|
+
// single object arg
|
|
2561
|
+
notify (message: { status?: number, code?: number | string, message: string, target?: string, args?: any[] }): Error
|
|
2562
|
+
notify (message: { status?: number, code: number | string, message?: string, target?: string, args?: any[] }): Error
|
|
2518
2563
|
|
|
2519
|
-
info (message: { code?: number | string, message: string, target?: string, args?: any[] }): Error
|
|
2564
|
+
info (message: { status?: number, code?: number | string, message: string, target?: string, args?: any[] }): Error
|
|
2565
|
+
info (message: { status?: number, code: number | string, message?: string, target?: string, args?: any[] }): Error
|
|
2520
2566
|
|
|
2521
|
-
warn (message: { code?: number | string, message: string, target?: string, args?: any[] }): Error
|
|
2567
|
+
warn (message: { status?: number, code?: number | string, message: string, target?: string, args?: any[] }): Error
|
|
2568
|
+
warn (message: { status?: number, code: number | string, message?: string, target?: string, args?: any[] }): Error
|
|
2522
2569
|
|
|
2523
|
-
error (message: { code?: number | string, message: string, target?: string, args?: any[]
|
|
2570
|
+
error (message: { status?: number, code?: number | string, message: string, target?: string, args?: any[] }): Error
|
|
2571
|
+
error (message: { status?: number, code: number | string, message?: string, target?: string, args?: any[] }): Error
|
|
2524
2572
|
|
|
2525
|
-
reject (message: { code?: number | string, message: string, target?: string, args?: any[]
|
|
2573
|
+
reject (message: { status?: number, code?: number | string, message: string, target?: string, args?: any[] }): never
|
|
2574
|
+
reject (message: { status?: number, code: number | string, message?: string, target?: string, args?: any[] }): never
|
|
2526
2575
|
|
|
2527
2576
|
}
|
|
2528
2577
|
export { Request_2 as Request }
|
|
@@ -2618,24 +2667,25 @@ class SELECT_3<T, Q = SELECT_from> extends ConstructedQuery<T> {
|
|
|
2618
2667
|
}
|
|
2619
2668
|
|
|
2620
2669
|
/**
|
|
2621
|
-
*
|
|
2622
|
-
*
|
|
2623
|
-
* If no parameter is given, the raw data stream is returned.
|
|
2670
|
+
* Pipes the raw data stream into the given writable stream.
|
|
2624
2671
|
* @param stream the writable stream to pipe the raw data into
|
|
2625
2672
|
* @see [capire docs](https://cap.cloud.sap/docs/node.js/cds-ql#pipeline)
|
|
2626
2673
|
* @since 9.3.0
|
|
2627
2674
|
*/
|
|
2628
2675
|
pipeline(stream: import('node:stream').Writable): Promise<void>
|
|
2629
2676
|
/**
|
|
2630
|
-
*
|
|
2631
|
-
*
|
|
2632
|
-
* If no parameter is given, the raw data stream is returned.
|
|
2633
|
-
* @see [capire docs](https://cap.cloud.sap/docs/node.js/cds-ql#pipeline)
|
|
2634
|
-
* @since 9.3.0
|
|
2635
|
-
* @returns Readable
|
|
2677
|
+
* @deprecated use `.stream()` instead
|
|
2636
2678
|
*/
|
|
2637
2679
|
pipeline(): Promise<import('node:stream').Readable>
|
|
2638
2680
|
|
|
2681
|
+
/**
|
|
2682
|
+
* Returns the raw data stream.
|
|
2683
|
+
* @see [capire docs](https://cap.cloud.sap/docs/node.js/cds-ql#stream)
|
|
2684
|
+
* @since 9.4.0
|
|
2685
|
+
* @returns Readable
|
|
2686
|
+
*/
|
|
2687
|
+
stream(): Promise<import('node:stream').Readable>
|
|
2688
|
+
|
|
2639
2689
|
/**
|
|
2640
2690
|
* Calls the given callback function for each row in the result set.
|
|
2641
2691
|
* @param cb the callback function to call for each row
|
|
@@ -2777,11 +2827,18 @@ export class Service extends QueryAPI {
|
|
|
2777
2827
|
types: linked_2.ModelPart<linked_2.classes.type>
|
|
2778
2828
|
|
|
2779
2829
|
/**
|
|
2830
|
+
* @deprecated use {@link actions} instead
|
|
2780
2831
|
* Provides access to the operations, i.e. actions and functions, exposed by a service
|
|
2781
2832
|
* @see [capire docs](https://cap.cloud.sap/docs/node.js/core-services)
|
|
2782
2833
|
*/
|
|
2783
2834
|
operations: linked_2.ModelPart<linked_2.classes.action>
|
|
2784
2835
|
|
|
2836
|
+
/**
|
|
2837
|
+
* Provides access to the actions and functions, exposed by a service
|
|
2838
|
+
* @see [capire docs](https://cap.cloud.sap/docs/node.js/core-services)
|
|
2839
|
+
*/
|
|
2840
|
+
actions: linked_2.ModelPart<linked_2.classes.action>
|
|
2841
|
+
|
|
2785
2842
|
/**
|
|
2786
2843
|
* Acts like a parameter-less constructor. Ensure to call `await super.init()` to have the base class’s handlers added.
|
|
2787
2844
|
* You may register own handlers before the base class’s ones, to intercept requests before the default handlers snap in.
|
|
@@ -2950,7 +3007,7 @@ class service_ extends context_ {
|
|
|
2950
3007
|
get protocols (): { [protocol in Protocol]?: boolean | undefined }
|
|
2951
3008
|
}
|
|
2952
3009
|
|
|
2953
|
-
interface service_2 extends
|
|
3010
|
+
interface service_2 extends any_ { }
|
|
2954
3011
|
|
|
2955
3012
|
export interface ServiceImpl {
|
|
2956
3013
|
(this: Service, srv: Service): any
|
|
@@ -3189,9 +3246,9 @@ export interface type extends Omit<csn.type, 'items'> {
|
|
|
3189
3246
|
virtual?: boolean
|
|
3190
3247
|
}
|
|
3191
3248
|
|
|
3192
|
-
export class type<K extends kinds = 'type'> extends
|
|
3249
|
+
export class type<K extends kinds = 'type'> extends any__2<K> { }
|
|
3193
3250
|
|
|
3194
|
-
interface type_2 extends
|
|
3251
|
+
interface type_2 extends any_ {
|
|
3195
3252
|
type?: 'cds.Boolean' |
|
|
3196
3253
|
'cds.UUID' | 'cds.String' | 'cds.LargeString' | 'cds.Binary' | 'cds.LargeBinary' | 'cds.Vector' |
|
|
3197
3254
|
'cds.Integer' | 'cds.UInt8' | 'cds.Int16' | 'cds.Int32' | 'cds.Int64' | 'cds.Double' | 'cds.Decimal' |
|
|
@@ -3493,7 +3550,7 @@ class Vector extends Binary { }
|
|
|
3493
3550
|
|
|
3494
3551
|
export const version: string;
|
|
3495
3552
|
|
|
3496
|
-
type Visitor = (def:
|
|
3553
|
+
type Visitor = (def: any__2, name: string, parent: any__2, defs: Definitions) => void
|
|
3497
3554
|
|
|
3498
3555
|
interface Where<T> {
|
|
3499
3556
|
where: HavingWhere<this, T>
|
package/package.json
CHANGED