@cap-js/cds-types 0.0.1 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +13 -2
- package/apis/cds.d.ts +30 -26
- package/apis/core.d.ts +90 -83
- package/apis/cqn.d.ts +87 -65
- package/apis/csn.d.ts +25 -16
- package/apis/env.d.ts +21 -24
- package/apis/events.d.ts +82 -59
- package/apis/internal/inference.d.ts +39 -5
- package/apis/linked.d.ts +45 -38
- package/apis/log.d.ts +79 -71
- package/apis/models.d.ts +155 -162
- package/apis/ql.d.ts +256 -191
- package/apis/server.d.ts +72 -62
- package/apis/services.d.ts +164 -106
- package/apis/test.d.ts +80 -49
- package/apis/utils.d.ts +85 -90
- package/package.json +13 -3
package/apis/utils.d.ts
CHANGED
|
@@ -1,95 +1,90 @@
|
|
|
1
|
-
export = cds
|
|
2
|
-
|
|
3
1
|
import * as fs from 'node:fs'
|
|
4
2
|
|
|
5
|
-
|
|
3
|
+
/**
|
|
4
|
+
* Provides a set of utility functionss
|
|
5
|
+
*/
|
|
6
|
+
declare const utils: {
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* Generates a new v4 UUID
|
|
10
|
+
* @see https://cap.cloud.sap/docs/node.js/cds-facade#cds-utils
|
|
11
|
+
*/
|
|
12
|
+
uuid (): string,
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* @see https://cap.cloud.sap/docs/node.js/cds-utils#decodeuri
|
|
16
|
+
*/
|
|
17
|
+
decodeURI(input: string): string,
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* @see https://cap.cloud.sap/docs/node.js/cds-utils#decodeuricomponent
|
|
21
|
+
*/
|
|
22
|
+
decodeURIComponent(input: string): string,
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* @see https://cap.cloud.sap/docs/node.js/cds-utils#local-filename
|
|
26
|
+
*/
|
|
27
|
+
local(filename: string): string,
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* @see https://cap.cloud.sap/docs/node.js/cds-utils#exists-file
|
|
31
|
+
*/
|
|
32
|
+
exist(file: string): boolean,
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* @see https://cap.cloud.sap/docs/node.js/cds-utils#isdir-file
|
|
36
|
+
*/
|
|
37
|
+
isdir(file: string): string,
|
|
38
|
+
|
|
39
|
+
/**
|
|
40
|
+
* @see https://cap.cloud.sap/docs/node.js/cds-utils#isdir-file
|
|
41
|
+
*/
|
|
42
|
+
isfile(file: string): string,
|
|
43
|
+
|
|
44
|
+
/**
|
|
45
|
+
* @see https://cap.cloud.sap/docs/node.js/cds-utils#async-read-file
|
|
46
|
+
*/
|
|
47
|
+
read(file: string): Promise<Buffer | object>,
|
|
48
|
+
|
|
49
|
+
/**
|
|
50
|
+
* @see https://cap.cloud.sap/docs/node.js/cds-utils#async-write-data-to-file
|
|
51
|
+
*/
|
|
52
|
+
write: {
|
|
53
|
+
(data: object): {
|
|
54
|
+
to(...file: string[]): Promise<ReturnType<typeof fs.promises.writeFile>>,
|
|
55
|
+
},
|
|
56
|
+
(file: string, data: object): Promise<ReturnType<typeof fs.promises.writeFile>>,
|
|
57
|
+
},
|
|
58
|
+
|
|
59
|
+
/**
|
|
60
|
+
* @see https://cap.cloud.sap/docs/node.js/cds-utils#async-copy-src-to-dst
|
|
61
|
+
*/
|
|
62
|
+
copy: {
|
|
63
|
+
(src: string): {
|
|
64
|
+
to(...dst: string[]): Promise<ReturnType<typeof fs.promises.copyFile>>,
|
|
65
|
+
},
|
|
66
|
+
(dst: string, src: string): Promise<ReturnType<typeof fs.promises.copyFile>>,
|
|
67
|
+
},
|
|
68
|
+
|
|
69
|
+
/**
|
|
70
|
+
* @see https://cap.cloud.sap/docs/node.js/cds-utils#async-mkdirp-path
|
|
71
|
+
*/
|
|
72
|
+
mkdirp: (...path: string[]) => Promise<string>,
|
|
73
|
+
|
|
74
|
+
/**
|
|
75
|
+
* @see https://cap.cloud.sap/docs/node.js/cds-utils#async-rmdir-path
|
|
76
|
+
*/
|
|
77
|
+
rmdir: (...path: string[]) => Promise<ReturnType<typeof fs.promises.rm>>,
|
|
78
|
+
|
|
79
|
+
|
|
80
|
+
/**
|
|
81
|
+
* @see https://cap.cloud.sap/docs/node.js/cds-utils#async-rimraf-path
|
|
82
|
+
*/
|
|
83
|
+
rimraf: (...path: string[]) => Promise<ReturnType<typeof fs.promises.rm>>,
|
|
84
|
+
|
|
6
85
|
|
|
7
|
-
|
|
8
|
-
*
|
|
86
|
+
/**
|
|
87
|
+
* @see https://cap.cloud.sap/docs/node.js/cds-utils#async-rm-path
|
|
9
88
|
*/
|
|
10
|
-
|
|
11
|
-
/**
|
|
12
|
-
* Generates a new v4 UUID
|
|
13
|
-
* @see https://cap.cloud.sap/docs/node.js/cds-facade#cds-utils
|
|
14
|
-
*/
|
|
15
|
-
uuid () : string
|
|
16
|
-
|
|
17
|
-
/**
|
|
18
|
-
* @see https://cap.cloud.sap/docs/node.js/cds-utils#decodeuri
|
|
19
|
-
*/
|
|
20
|
-
decodeURI(input: string): string
|
|
21
|
-
|
|
22
|
-
/**
|
|
23
|
-
* @see https://cap.cloud.sap/docs/node.js/cds-utils#decodeuricomponent
|
|
24
|
-
*/
|
|
25
|
-
decodeURIComponent(input: string): string
|
|
26
|
-
|
|
27
|
-
/**
|
|
28
|
-
* @see https://cap.cloud.sap/docs/node.js/cds-utils#local-filename
|
|
29
|
-
*/
|
|
30
|
-
local(filename: string): string
|
|
31
|
-
|
|
32
|
-
/**
|
|
33
|
-
* @see https://cap.cloud.sap/docs/node.js/cds-utils#exists-file
|
|
34
|
-
*/
|
|
35
|
-
exist(file: string): boolean
|
|
36
|
-
|
|
37
|
-
/**
|
|
38
|
-
* @see https://cap.cloud.sap/docs/node.js/cds-utils#isdir-file
|
|
39
|
-
*/
|
|
40
|
-
isdir(file: string): string
|
|
41
|
-
|
|
42
|
-
/**
|
|
43
|
-
* @see https://cap.cloud.sap/docs/node.js/cds-utils#isdir-file
|
|
44
|
-
*/
|
|
45
|
-
isfile(file: string): string
|
|
46
|
-
|
|
47
|
-
/**
|
|
48
|
-
* @see https://cap.cloud.sap/docs/node.js/cds-utils#async-read-file
|
|
49
|
-
*/
|
|
50
|
-
read(file: string): Promise<Buffer | {}>
|
|
51
|
-
|
|
52
|
-
/**
|
|
53
|
-
* @see https://cap.cloud.sap/docs/node.js/cds-utils#async-write-data-to-file
|
|
54
|
-
*/
|
|
55
|
-
write: {
|
|
56
|
-
(data: Object): {
|
|
57
|
-
to(...file: string[]): Promise<ReturnType<typeof fs.promises.writeFile>>
|
|
58
|
-
}
|
|
59
|
-
(file: string, data: Object): Promise<ReturnType<typeof fs.promises.writeFile>>
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
/**
|
|
63
|
-
* @see https://cap.cloud.sap/docs/node.js/cds-utils#async-copy-src-to-dst
|
|
64
|
-
*/
|
|
65
|
-
copy: {
|
|
66
|
-
(src: string): {
|
|
67
|
-
to(...dst: string[]): Promise<ReturnType<typeof fs.promises.copyFile>>
|
|
68
|
-
}
|
|
69
|
-
(dst: string, src: string): Promise<ReturnType<typeof fs.promises.copyFile>>
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
/**
|
|
73
|
-
* @see https://cap.cloud.sap/docs/node.js/cds-utils#async-mkdirp-path
|
|
74
|
-
*/
|
|
75
|
-
mkdirp: (...path: string[]) => Promise<string>
|
|
76
|
-
|
|
77
|
-
/**
|
|
78
|
-
* @see https://cap.cloud.sap/docs/node.js/cds-utils#async-rmdir-path
|
|
79
|
-
*/
|
|
80
|
-
rmdir: (...path: string[]) => Promise<ReturnType<typeof fs.promises.rm>>
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
/**
|
|
84
|
-
* @see https://cap.cloud.sap/docs/node.js/cds-utils#async-rimraf-path
|
|
85
|
-
*/
|
|
86
|
-
rimraf: (...path: string[]) => Promise<ReturnType<typeof fs.promises.rm>>
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
/**
|
|
90
|
-
* @see https://cap.cloud.sap/docs/node.js/cds-utils#async-rm-path
|
|
91
|
-
*/
|
|
92
|
-
rm: (...path: string[]) => Promise<ReturnType<typeof fs.promises.rm>>
|
|
93
|
-
|
|
94
|
-
}
|
|
89
|
+
rm: (...path: string[]) => Promise<ReturnType<typeof fs.promises.rm>>,
|
|
95
90
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cap-js/cds-types",
|
|
3
|
-
"version": "0.0
|
|
3
|
+
"version": "0.2.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/",
|
|
@@ -18,15 +18,25 @@
|
|
|
18
18
|
"README.md"
|
|
19
19
|
],
|
|
20
20
|
"scripts": {
|
|
21
|
-
"test": "jest --silent"
|
|
21
|
+
"test": "jest --silent",
|
|
22
|
+
"api-extractor": "api-extractor run --local --verbose",
|
|
23
|
+
"lint": "eslint . --ext .ts",
|
|
24
|
+
"lint:fix": "eslint . --ext .ts --fix",
|
|
25
|
+
"setup": "npm i && npm i file:. --no-save --force"
|
|
22
26
|
},
|
|
23
27
|
"peerDependencies": {
|
|
24
28
|
"@sap/cds": ">=7"
|
|
25
29
|
},
|
|
26
30
|
"devDependencies": {
|
|
27
|
-
"@sap/cds": "^7.
|
|
31
|
+
"@sap/cds": "^7.5.0",
|
|
32
|
+
"@stylistic/eslint-plugin": "^1.5.3",
|
|
33
|
+
"@types/jest": "^29.5.11",
|
|
34
|
+
"@types/node": "^20",
|
|
35
|
+
"@typescript-eslint/eslint-plugin": "^6.18.1",
|
|
36
|
+
"@typescript-eslint/parser": "^6.18.1",
|
|
28
37
|
"axios": "^1.6.2",
|
|
29
38
|
"chai": "^4.3.10",
|
|
39
|
+
"eslint": "^8.56.0",
|
|
30
40
|
"jest": "^29.7.0",
|
|
31
41
|
"ts-jest": "^29.1.1",
|
|
32
42
|
"typescript": "^5.3.2",
|