@cap-js/cds-types 0.11.0 → 0.13.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.
Files changed (2) hide show
  1. package/dist/cds-types.d.ts +29 -7
  2. package/package.json +11 -3
@@ -1,4 +1,5 @@
1
1
  declare module '@sap/cds' {
2
+ export * from "@sap/cds-dk";
2
3
 
3
4
 
4
5
  export type __any_ = classes.any_
@@ -1185,7 +1186,6 @@ export namespace env {
1185
1186
  [key: string]: MockUser | undefined
1186
1187
  }
1187
1188
 
1188
- /* eslint-disable-next-line @typescript-eslint/no-unused-vars */
1189
1189
  export type Requires = {
1190
1190
  auth: {
1191
1191
  kind: 'dummy' | 'mocked' | 'basic' | 'xsuaa' | 'ias' | string,
@@ -1519,7 +1519,7 @@ type INSERT_2 = { INSERT: {
1519
1519
  columns: string[],
1520
1520
  values: primitive[],
1521
1521
  rows: primitive[][],
1522
- as: SELECT_2,
1522
+ from: SELECT_2,
1523
1523
  }, }
1524
1524
  export { INSERT_2 as INSERT }
1525
1525
 
@@ -1536,10 +1536,6 @@ class INSERT_3<T> extends ConstructedQuery<T> {
1536
1536
  & (<T> (entity: Constructable<T>, ...entries: T[]) => INSERT_3<T>)
1537
1537
  & (<T> (entity: Constructable<T>, entries?: T[]) => INSERT_3<T>)
1538
1538
 
1539
- /**
1540
- * @deprected
1541
- */
1542
- as (select: SELECT_3<T>): this
1543
1539
  from (select: SELECT_3<T>): this
1544
1540
  INSERT: CQN.INSERT['INSERT']
1545
1541
 
@@ -2112,6 +2108,24 @@ export function on (event: 'connect', listener: (srv: Service) => void): _cds
2112
2108
  */
2113
2109
  export function on (event: 'bootstrap', listener: (app: import('express').Application) => void): _cds
2114
2110
 
2111
+ /**
2112
+ * Emitted before the model is compiled for usage in Node.js or Java runtime.
2113
+ * @beta
2114
+ */
2115
+ export function on (event: 'compile.for.runtime', listener: (model: CSN) => void): _cds
2116
+
2117
+ /**
2118
+ * Emitted before database-specific artifacts, i.e. SQL DDL scripts, are generated from the model.
2119
+ * @beta
2120
+ */
2121
+ export function on (event: 'compile.to.dbx', listener: (model: CSN) => void): _cds
2122
+
2123
+ /**
2124
+ * Emitted immediately before the model is compiled to edmx.
2125
+ * @beta
2126
+ */
2127
+ export function on (event: 'compile.to.edmx', listener: (model: CSN) => void): _cds
2128
+
2115
2129
  /**
2116
2130
  * Emitted for each service served by cds.serve().
2117
2131
  */
@@ -2137,6 +2151,12 @@ export function on (event: 'shutdown', listener: () => void): _cds
2137
2151
 
2138
2152
  export function once (event: 'bootstrap', listener: (app: import('express').Application) => void): _cds
2139
2153
 
2154
+ export function once (event: 'compile.for.runtime', listener: (model: CSN) => void): _cds
2155
+
2156
+ export function once (event: 'compile.to.dbx', listener: (model: CSN) => void): _cds
2157
+
2158
+ export function once (event: 'compile.to.edmx', listener: (model: CSN) => void): _cds
2159
+
2140
2160
  export function once (event: 'served', listener: (all: cds_services) => void): _cds
2141
2161
 
2142
2162
  export function once (event: 'listening', listener: (args: { server: import('http').Server, url: string }) => void): _cds
@@ -2414,7 +2434,7 @@ export class RemoteService extends Service {}
2414
2434
  */
2415
2435
  class Request_2<T = any> extends Event_2<T> {
2416
2436
 
2417
- params: (string | object)[]
2437
+ params: Record<string, any>[]
2418
2438
 
2419
2439
  method: string
2420
2440
 
@@ -2433,6 +2453,8 @@ class Request_2<T = any> extends Event_2<T> {
2433
2453
  subject: ref
2434
2454
 
2435
2455
  reply (results: any): void
2456
+ /** @beta */
2457
+ reply (results: any, options: { mimetype?: string, filename?: string, [key: string]: any }): void
2436
2458
 
2437
2459
  notify (code: number, message: string, target?: string, args?: any[]): Error
2438
2460
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cap-js/cds-types",
3
- "version": "0.11.0",
3
+ "version": "0.13.0",
4
4
  "description": "Type definitions for main packages of CAP, like `@sap/cds`",
5
5
  "repository": "github:cap-js/cds-types",
6
6
  "homepage": "https://cap.cloud.sap/",
@@ -29,7 +29,7 @@
29
29
  "test": "npm run test:setup && npm run test:rollup-on",
30
30
  "test:rollup-on": "npm run rollup && npm run rollup:on && npm run test:all --silent",
31
31
  "test:rollup-off": "npm run rollup:off && npm run test:all --silent",
32
- "rollup": "rm -rf dist/ && mkdir -p etc/ && npx -y @microsoft/api-extractor run --local --verbose && .github/rollup-patch.js",
32
+ "rollup": "rm -rf dist/ && mkdir -p etc/ && .github/api-extractor/run-api-extractor.js",
33
33
  "rollup:on": "npm pkg set typings=dist/cds-types.d.ts && [ -d 'apis' ] && mv -- apis -apis || true",
34
34
  "rollup:off": "npm pkg set typings=apis/cds.d.ts && [ -d '-apis' ] && mv -- -apis apis || true",
35
35
  "lint": "npx eslint .",
@@ -40,11 +40,19 @@
40
40
  "dependencies": "node ./scripts/postinstall.js"
41
41
  },
42
42
  "peerDependencies": {
43
- "@sap/cds": ">=8.0.0",
43
+ "@sap/cds": ">=9.0.0",
44
+ "@sap/cds-dk": "^9",
44
45
  "@types/express": ">=4"
45
46
  },
47
+ "peerDependenciesMeta": {
48
+ "@sap/cds-dk": {
49
+ "optional": true
50
+ }
51
+ },
46
52
  "devDependencies": {
47
53
  "@cap-js/cds-test": "^0",
54
+ "@microsoft/api-extractor": "^7.52.8",
55
+ "@sap/cds-dk": "^9",
48
56
  "@stylistic/eslint-plugin-js": "^4.0.1",
49
57
  "@stylistic/eslint-plugin-ts": "^4.0.1",
50
58
  "axios": "^1.6.2",