@cap-js/cds-types 0.14.0 → 0.15.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 +38 -3
- package/package.json +1 -1
package/dist/cds-types.d.ts
CHANGED
|
@@ -254,6 +254,7 @@ namespace cds {
|
|
|
254
254
|
on,
|
|
255
255
|
once,
|
|
256
256
|
exit,
|
|
257
|
+
error,
|
|
257
258
|
_cds,
|
|
258
259
|
cds_services,
|
|
259
260
|
connect,
|
|
@@ -367,6 +368,8 @@ namespace cds {
|
|
|
367
368
|
EventContext,
|
|
368
369
|
Event_2 as Event,
|
|
369
370
|
Request_2 as Request,
|
|
371
|
+
GetRequest,
|
|
372
|
+
PostRequest,
|
|
370
373
|
User,
|
|
371
374
|
Anonymous,
|
|
372
375
|
Privileged,
|
|
@@ -391,6 +394,7 @@ namespace cds {
|
|
|
391
394
|
_segment,
|
|
392
395
|
_named,
|
|
393
396
|
val,
|
|
397
|
+
list,
|
|
394
398
|
xpr,
|
|
395
399
|
_xpr,
|
|
396
400
|
operator,
|
|
@@ -438,6 +442,7 @@ namespace cds_2 {
|
|
|
438
442
|
on,
|
|
439
443
|
once,
|
|
440
444
|
exit,
|
|
445
|
+
error,
|
|
441
446
|
_cds,
|
|
442
447
|
cds_services,
|
|
443
448
|
connect,
|
|
@@ -551,6 +556,8 @@ namespace cds_2 {
|
|
|
551
556
|
EventContext,
|
|
552
557
|
Event_2 as Event,
|
|
553
558
|
Request_2 as Request,
|
|
559
|
+
GetRequest,
|
|
560
|
+
PostRequest,
|
|
554
561
|
User,
|
|
555
562
|
Anonymous,
|
|
556
563
|
Privileged,
|
|
@@ -575,6 +582,7 @@ namespace cds_2 {
|
|
|
575
582
|
_segment,
|
|
576
583
|
_named,
|
|
577
584
|
val,
|
|
585
|
+
list,
|
|
578
586
|
xpr,
|
|
579
587
|
_xpr,
|
|
580
588
|
operator,
|
|
@@ -888,6 +896,7 @@ namespace CQN {
|
|
|
888
896
|
_segment,
|
|
889
897
|
_named,
|
|
890
898
|
val,
|
|
899
|
+
list,
|
|
891
900
|
xpr,
|
|
892
901
|
_xpr,
|
|
893
902
|
operator,
|
|
@@ -1293,6 +1302,17 @@ export namespace env {
|
|
|
1293
1302
|
}
|
|
1294
1303
|
}
|
|
1295
1304
|
|
|
1305
|
+
/**
|
|
1306
|
+
* @see [capire](https://cap.cloud.sap/docs/node.js/cds-facade#cds-error)
|
|
1307
|
+
*/
|
|
1308
|
+
export function error (code: number, message: string, details?: {stack?: unknown}, caller?: (...args: any[]) => unknown): Error
|
|
1309
|
+
|
|
1310
|
+
export function error (message: string, details?: {code: number, stack?: unknown}, caller?: (...args: any[]) => unknown): Error
|
|
1311
|
+
|
|
1312
|
+
export function error (details: {code: number, message: string}, caller?: (...args: any[]) => unknown): Error
|
|
1313
|
+
|
|
1314
|
+
export function error (string: TemplateStringsArray, ...args: any[]): Error
|
|
1315
|
+
|
|
1296
1316
|
export class event extends aspect<'event'> {}
|
|
1297
1317
|
|
|
1298
1318
|
/**
|
|
@@ -1349,7 +1369,7 @@ export interface EventHandler {
|
|
|
1349
1369
|
*/
|
|
1350
1370
|
export function exit (): void
|
|
1351
1371
|
|
|
1352
|
-
export type expr = ref | val | xpr | function_call | SELECT_2
|
|
1372
|
+
export type expr = ref | val | list | xpr | function_call | SELECT_2
|
|
1353
1373
|
|
|
1354
1374
|
export type expr_literal = { '=': string }
|
|
1355
1375
|
|
|
@@ -1430,6 +1450,10 @@ export type function_call = { func: string, args: { [key: string]: any }[] }
|
|
|
1430
1450
|
*/
|
|
1431
1451
|
export function get (files: '*' | filename | filename[], o?: _options): Promise<csn.CSN>
|
|
1432
1452
|
|
|
1453
|
+
export type GetRequest<
|
|
1454
|
+
P extends Record<string, any>[]
|
|
1455
|
+
> = Request_2<Record<never, never>, P>;
|
|
1456
|
+
|
|
1433
1457
|
interface GroupBy {
|
|
1434
1458
|
groupBy: TaggedTemplateQueryPart<this>
|
|
1435
1459
|
& ((columns: Partial<{[column in KeyOfTarget<this extends ConstructedQuery<infer E> ? E : never, never>]: any}>) => this)
|
|
@@ -1825,6 +1849,9 @@ interface LinkedCSN extends Omit<csn.CSN, 'definitions'> {
|
|
|
1825
1849
|
|
|
1826
1850
|
}
|
|
1827
1851
|
|
|
1852
|
+
/** @private */
|
|
1853
|
+
export type list = { list: any[] }
|
|
1854
|
+
|
|
1828
1855
|
/**
|
|
1829
1856
|
* Shortcut for `cds.get(files, 'inferred')`
|
|
1830
1857
|
* @param files - filenames of models or if folder containing models
|
|
@@ -2246,6 +2273,11 @@ type PK = number | string | object
|
|
|
2246
2273
|
|
|
2247
2274
|
type PluralInstanceType<T extends Constructable> = Array<InstanceType<T>>
|
|
2248
2275
|
|
|
2276
|
+
export type PostRequest<
|
|
2277
|
+
D = any,
|
|
2278
|
+
P extends Record<string, any>[] = Record<string, any>[]
|
|
2279
|
+
> = Request_2<D, P>;
|
|
2280
|
+
|
|
2249
2281
|
export type predicate = _xpr
|
|
2250
2282
|
|
|
2251
2283
|
type Primitive = string | number | boolean | Date
|
|
@@ -2460,9 +2492,12 @@ export class RemoteService extends Service {}
|
|
|
2460
2492
|
/**
|
|
2461
2493
|
* @see [capire docs](https://cap.cloud.sap/docs/node.js/events)
|
|
2462
2494
|
*/
|
|
2463
|
-
class Request_2<
|
|
2495
|
+
class Request_2<
|
|
2496
|
+
D = any,
|
|
2497
|
+
P extends Record<string, any>[] = Record<string, any>[]
|
|
2498
|
+
> extends Event_2<D> {
|
|
2464
2499
|
|
|
2465
|
-
params:
|
|
2500
|
+
params: P
|
|
2466
2501
|
|
|
2467
2502
|
method: string
|
|
2468
2503
|
|
package/package.json
CHANGED