@sap/cds 7.5.2 → 7.6.1
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/CHANGELOG.md +79 -22
- package/app/index.js +1 -1
- package/lib/auth/index.js +3 -0
- package/lib/compile/extend.js +9 -4
- package/lib/compile/for/lean_drafts.js +3 -4
- package/lib/compile/load.js +11 -15
- package/lib/compile/minify.js +2 -4
- package/lib/compile/to/sql.js +6 -4
- package/lib/compile/to/srvinfo.js +25 -3
- package/lib/compile/to/yaml.js +1 -1
- package/lib/dbs/cds-deploy.js +7 -13
- package/lib/env/defaults.js +1 -10
- package/lib/env/schemas/cds-package.js +27 -0
- package/lib/env/schemas/cds-rc.js +693 -0
- package/lib/env/schemas/index.js +6 -4
- package/lib/i18n/localize.js +15 -1
- package/lib/index.js +40 -47
- package/lib/log/cds-error.js +6 -0
- package/lib/ql/Query.js +2 -1
- package/lib/ql/cds-ql.js +1 -2
- package/lib/ql/infer.js +0 -2
- package/lib/req/request.js +3 -6
- package/lib/srv/middlewares/trace.js +2 -2
- package/lib/srv/protocols/hcql.js +44 -30
- package/lib/srv/protocols/http.js +60 -0
- package/lib/srv/protocols/index.js +0 -7
- package/lib/srv/protocols/odata-v4.js +8 -2
- package/lib/srv/srv-api.js +129 -62
- package/lib/srv/srv-handlers.js +0 -1
- package/lib/srv/srv-models.js +1 -0
- package/lib/utils/cds-test.js +1 -1
- package/lib/utils/cds-utils.js +26 -0
- package/lib/utils/check-version.js +10 -13
- package/libx/_runtime/cds-services/adapter/odata-v4/ODataRequest.js +22 -6
- package/libx/_runtime/cds-services/adapter/odata-v4/handlers/metadata.js +3 -4
- package/libx/_runtime/cds-services/adapter/odata-v4/handlers/read.js +89 -21
- package/libx/_runtime/cds-services/adapter/odata-v4/odata-to-cqn/boundToCQN.js +4 -2
- package/libx/_runtime/cds-services/adapter/odata-v4/odata-to-cqn/readToCQN.js +1 -24
- package/libx/_runtime/cds-services/adapter/odata-v4/odata-to-cqn/updateToCQN.js +1 -7
- package/libx/_runtime/cds-services/adapter/odata-v4/okra/odata-commons/uri/ApplyParser.js +3 -3
- package/libx/_runtime/cds-services/adapter/odata-v4/okra/odata-server/serializer/TrustedResourceJsonSerializer.js +7 -0
- package/libx/_runtime/cds-services/adapter/odata-v4/to.js +0 -5
- package/libx/_runtime/cds-services/adapter/odata-v4/utils/handlerUtils.js +2 -0
- package/libx/_runtime/cds-services/adapter/odata-v4/utils/metaInfo.js +17 -1
- package/libx/_runtime/cds-services/adapter/odata-v4/utils/result.js +22 -2
- package/libx/_runtime/cds-services/services/utils/columns.js +1 -2
- package/libx/_runtime/common/aspects/Association.js +17 -9
- package/libx/_runtime/common/generic/crud.js +13 -22
- package/libx/_runtime/common/generic/etag.js +1 -1
- package/libx/_runtime/common/generic/input.js +9 -1
- package/libx/_runtime/common/generic/paging.js +3 -3
- package/libx/_runtime/common/generic/sorting.js +25 -15
- package/libx/_runtime/common/generic/stream.js +2 -16
- package/libx/_runtime/common/utils/copy.js +5 -0
- package/libx/_runtime/common/utils/cqn.js +1 -1
- package/libx/_runtime/common/utils/cqn2cqn4sql.js +4 -3
- package/libx/_runtime/common/utils/csn.js +0 -49
- package/libx/_runtime/common/utils/foreignKeyPropagations.js +5 -5
- package/libx/_runtime/common/utils/generateOnCond.js +50 -25
- package/libx/_runtime/common/utils/resolveView.js +5 -44
- package/libx/_runtime/common/utils/rewriteAsterisks.js +17 -4
- package/libx/_runtime/common/utils/stream.js +16 -15
- package/libx/_runtime/common/utils/streamProp.js +25 -22
- package/libx/_runtime/db/Service.js +27 -8
- package/libx/_runtime/db/generic/input.js +6 -1
- package/libx/_runtime/db/generic/rewrite.js +3 -2
- package/libx/_runtime/db/query/read.js +15 -5
- package/libx/_runtime/db/sql-builder/ExpressionBuilder.js +0 -11
- package/libx/_runtime/db/utils/columns.js +1 -0
- package/libx/_runtime/db/utils/stream.js +41 -0
- package/libx/_runtime/fiori/generic/read.js +2 -1
- package/libx/_runtime/fiori/generic/readOverDraft.js +1 -1
- package/libx/_runtime/fiori/lean-draft.js +216 -59
- package/libx/_runtime/hana/Service.js +1 -1
- package/libx/_runtime/hana/execute.js +53 -14
- package/libx/_runtime/messaging/enterprise-messaging-utils/registerEndpoints.js +34 -15
- package/libx/_runtime/remote/Service.js +2 -1
- package/libx/_runtime/remote/utils/client.js +1 -1
- package/libx/_runtime/sqlite/Service.js +1 -1
- package/libx/_runtime/sqlite/execute.js +17 -5
- package/libx/odata/afterburner.js +58 -19
- package/libx/odata/cqn2odata.js +6 -8
- package/libx/odata/create.js +44 -0
- package/libx/odata/delete.js +25 -0
- package/libx/odata/error.js +8 -3
- package/libx/odata/metadata.js +6 -8
- package/libx/odata/service-document.js +1 -1
- package/libx/odata/update.js +110 -0
- package/libx/odata/utils.js +9 -6
- package/libx/outbox/index.js +48 -78
- package/libx/rest/RestAdapter.js +0 -3
- package/package.json +1 -1
- package/lib/env/schemas/cds-package.json +0 -17
- package/lib/env/schemas/cds-rc.json +0 -740
- package/lib/ql/STREAM.js +0 -90
|
@@ -0,0 +1,693 @@
|
|
|
1
|
+
const cds = require('../../index')
|
|
2
|
+
|
|
3
|
+
module.exports = {
|
|
4
|
+
_version: cds.version,
|
|
5
|
+
|
|
6
|
+
title: 'JSON schema for CDS configuration',
|
|
7
|
+
$schema: 'https://json-schema.org/draft/2020-12/schema',
|
|
8
|
+
description: 'This is a JSON schema representation for CDS project configuration',
|
|
9
|
+
type: 'object',
|
|
10
|
+
additionalProperties: true,
|
|
11
|
+
|
|
12
|
+
allOf: [
|
|
13
|
+
// allow cds configuration in root of .cds-rc.js...
|
|
14
|
+
{
|
|
15
|
+
$ref: '#/$defs/cdsRoot'
|
|
16
|
+
},
|
|
17
|
+
|
|
18
|
+
// ...and underneath cds section
|
|
19
|
+
{
|
|
20
|
+
properties: {
|
|
21
|
+
cds: {
|
|
22
|
+
$ref: '#/$defs/cdsRoot'
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
],
|
|
27
|
+
|
|
28
|
+
$defs: {
|
|
29
|
+
cdsRoot: {
|
|
30
|
+
properties: {
|
|
31
|
+
'[development]': {
|
|
32
|
+
type: 'object'
|
|
33
|
+
},
|
|
34
|
+
'[production]': {
|
|
35
|
+
type: 'object'
|
|
36
|
+
},
|
|
37
|
+
'[hybrid]': {
|
|
38
|
+
type: 'object'
|
|
39
|
+
},
|
|
40
|
+
profile: {
|
|
41
|
+
description: 'A single static profile',
|
|
42
|
+
anyOf: [
|
|
43
|
+
{
|
|
44
|
+
enum: [
|
|
45
|
+
'mtx-sidecar',
|
|
46
|
+
'with-mtx-sidecar',
|
|
47
|
+
'java'
|
|
48
|
+
]
|
|
49
|
+
},
|
|
50
|
+
{
|
|
51
|
+
type: 'string'
|
|
52
|
+
}
|
|
53
|
+
]
|
|
54
|
+
},
|
|
55
|
+
profiles: {
|
|
56
|
+
description: 'An array of profiles',
|
|
57
|
+
type: 'array',
|
|
58
|
+
uniqueItems: true,
|
|
59
|
+
items: {
|
|
60
|
+
$ref: '#/$defs/cdsRoot/properties/profile'
|
|
61
|
+
}
|
|
62
|
+
},
|
|
63
|
+
folders: {
|
|
64
|
+
type: 'object',
|
|
65
|
+
description: 'Only set folders if you don\'t want to use the defaults \'app/\', \'db/\', \'srv/\'.',
|
|
66
|
+
additionalProperties: true,
|
|
67
|
+
properties: {
|
|
68
|
+
app: {
|
|
69
|
+
type: 'string',
|
|
70
|
+
format: 'uri-reference',
|
|
71
|
+
description: 'Add a custom path for the app property, which becomes \'cds.roots\'.'
|
|
72
|
+
},
|
|
73
|
+
db: {
|
|
74
|
+
type: 'string',
|
|
75
|
+
format: 'uri-reference',
|
|
76
|
+
description: 'Add a custom path for the db property, which becomes \'cds.roots\'.'
|
|
77
|
+
},
|
|
78
|
+
srv: {
|
|
79
|
+
type: 'string',
|
|
80
|
+
format: 'uri-reference',
|
|
81
|
+
description: 'Add a custom path for the srv property, which becomes \'cds.roots\'.'
|
|
82
|
+
}
|
|
83
|
+
},
|
|
84
|
+
patternProperties: {
|
|
85
|
+
'.+': {
|
|
86
|
+
description: 'A static name identifying this folder.'
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
},
|
|
90
|
+
i18n: {
|
|
91
|
+
type: 'object',
|
|
92
|
+
description: 'Customize CDS translation settings.',
|
|
93
|
+
additionalProperties: true,
|
|
94
|
+
properties: {
|
|
95
|
+
default_language: {
|
|
96
|
+
type: 'string'
|
|
97
|
+
},
|
|
98
|
+
folders: {
|
|
99
|
+
description: 'Define the list of folders containing language files. Defaults are \'_i18n/\', \'i18n/\', and \'assets/i18n/\'. First valid entry wins.',
|
|
100
|
+
default: [],
|
|
101
|
+
$ref: '#/$defs/foldersStringArray'
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
},
|
|
105
|
+
requires: {
|
|
106
|
+
type: 'object',
|
|
107
|
+
description: 'List CDS dependencies to databases and services within the requires section.',
|
|
108
|
+
additionalProperties: true,
|
|
109
|
+
properties: {
|
|
110
|
+
auth: {
|
|
111
|
+
oneOf: [
|
|
112
|
+
{
|
|
113
|
+
type: 'string',
|
|
114
|
+
description: 'Use standard auth-specific settings via shortcut.',
|
|
115
|
+
anyOf: [
|
|
116
|
+
{
|
|
117
|
+
$ref: '#/$defs/authType'
|
|
118
|
+
},
|
|
119
|
+
{
|
|
120
|
+
minLength: 1
|
|
121
|
+
}
|
|
122
|
+
]
|
|
123
|
+
},
|
|
124
|
+
{
|
|
125
|
+
type: 'object',
|
|
126
|
+
description: 'Use custom authentication settings.',
|
|
127
|
+
default: {},
|
|
128
|
+
additionalProperties: true,
|
|
129
|
+
properties: {
|
|
130
|
+
kind: {
|
|
131
|
+
type: 'string',
|
|
132
|
+
description: 'Define the kind of strategy.',
|
|
133
|
+
anyOf: [
|
|
134
|
+
{
|
|
135
|
+
$ref: '#/$defs/authType'
|
|
136
|
+
},
|
|
137
|
+
{
|
|
138
|
+
minLength: 1
|
|
139
|
+
}
|
|
140
|
+
]
|
|
141
|
+
},
|
|
142
|
+
users: {
|
|
143
|
+
$ref: '#/$defs/mockUsers'
|
|
144
|
+
},
|
|
145
|
+
credentials: {
|
|
146
|
+
type: 'object',
|
|
147
|
+
description: 'You can explicitly configure credentials, but this is overruled by VCAP_SERVICES if a matching entry is found therein.',
|
|
148
|
+
additionalProperties: true,
|
|
149
|
+
properties: {
|
|
150
|
+
database: {
|
|
151
|
+
type: 'string',
|
|
152
|
+
format: 'uri-reference'
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
]
|
|
159
|
+
},
|
|
160
|
+
db: {
|
|
161
|
+
oneOf: [
|
|
162
|
+
{
|
|
163
|
+
type: 'string',
|
|
164
|
+
description: 'Use standard database-specific settings via shortcut.',
|
|
165
|
+
anyOf: [
|
|
166
|
+
{
|
|
167
|
+
$ref: '#/$defs/databaseType'
|
|
168
|
+
},
|
|
169
|
+
{
|
|
170
|
+
minLength: 1
|
|
171
|
+
}
|
|
172
|
+
]
|
|
173
|
+
},
|
|
174
|
+
{
|
|
175
|
+
type: 'object',
|
|
176
|
+
description: 'Use custom database-specific settings.',
|
|
177
|
+
default: {},
|
|
178
|
+
additionalProperties: true,
|
|
179
|
+
properties: {
|
|
180
|
+
kind: {
|
|
181
|
+
type: 'string',
|
|
182
|
+
description: 'Define the kind of dependency.',
|
|
183
|
+
anyOf: [
|
|
184
|
+
{
|
|
185
|
+
$ref: '#/$defs/databaseType'
|
|
186
|
+
},
|
|
187
|
+
{
|
|
188
|
+
minLength: 1
|
|
189
|
+
}
|
|
190
|
+
]
|
|
191
|
+
},
|
|
192
|
+
model: {
|
|
193
|
+
description: 'Define the assigned model. Interpreted like Node.js \'requires\' logic.',
|
|
194
|
+
$ref: '#/$defs/foldersStringArray'
|
|
195
|
+
},
|
|
196
|
+
credentials: {
|
|
197
|
+
type: 'object',
|
|
198
|
+
description: 'You can explicitly configure credentials, but this is overruled by VCAP_SERVICES if a matching entry is found therein.',
|
|
199
|
+
additionalProperties: true,
|
|
200
|
+
properties: {
|
|
201
|
+
database: {
|
|
202
|
+
type: 'string',
|
|
203
|
+
format: 'uri-reference'
|
|
204
|
+
}
|
|
205
|
+
}
|
|
206
|
+
},
|
|
207
|
+
vcap: {
|
|
208
|
+
type: 'object',
|
|
209
|
+
description: 'Optional: Used to select an entry in VCAP_SERVICES.',
|
|
210
|
+
additionalProperties: true,
|
|
211
|
+
properties: {
|
|
212
|
+
name: {
|
|
213
|
+
type: 'string',
|
|
214
|
+
minLength: 1
|
|
215
|
+
}
|
|
216
|
+
}
|
|
217
|
+
}
|
|
218
|
+
}
|
|
219
|
+
}
|
|
220
|
+
]
|
|
221
|
+
},
|
|
222
|
+
middlewares: {
|
|
223
|
+
type: 'boolean',
|
|
224
|
+
description: 'Enables new middlewares support (experimental).'
|
|
225
|
+
},
|
|
226
|
+
multitenancy: {
|
|
227
|
+
oneOf: [
|
|
228
|
+
{
|
|
229
|
+
type: 'boolean',
|
|
230
|
+
description: 'Shortcut to enable multitenancy.'
|
|
231
|
+
},
|
|
232
|
+
{
|
|
233
|
+
type: 'object',
|
|
234
|
+
description: 'Multitenancy configuration options.',
|
|
235
|
+
properties: {
|
|
236
|
+
jobs: {
|
|
237
|
+
type: 'object',
|
|
238
|
+
description: 'Configuration options for the built-in async job executor.',
|
|
239
|
+
properties: {
|
|
240
|
+
workerSize: {
|
|
241
|
+
type: 'number',
|
|
242
|
+
description: 'Number of workers running in parallel per database.'
|
|
243
|
+
},
|
|
244
|
+
clusterSize: {
|
|
245
|
+
type: 'number',
|
|
246
|
+
description: 'Number of databases executing parallel tasks.'
|
|
247
|
+
}
|
|
248
|
+
}
|
|
249
|
+
}
|
|
250
|
+
}
|
|
251
|
+
}
|
|
252
|
+
]
|
|
253
|
+
},
|
|
254
|
+
extensibility: {
|
|
255
|
+
oneOf: [
|
|
256
|
+
{
|
|
257
|
+
type: 'boolean',
|
|
258
|
+
description: 'Shortcut to enable extensibility.'
|
|
259
|
+
},
|
|
260
|
+
{
|
|
261
|
+
type: 'object',
|
|
262
|
+
description: 'Extensibility configuration options.',
|
|
263
|
+
properties: {
|
|
264
|
+
tenantCheckInterval: {
|
|
265
|
+
type: 'number',
|
|
266
|
+
description: 'Time interval in ms to check for new extensions and refreshed models.'
|
|
267
|
+
},
|
|
268
|
+
evictionInterval: {
|
|
269
|
+
type: 'number',
|
|
270
|
+
description: 'Time interval in ms after which to evict models for inactive tenants.'
|
|
271
|
+
}
|
|
272
|
+
}
|
|
273
|
+
}
|
|
274
|
+
]
|
|
275
|
+
},
|
|
276
|
+
toggles: {
|
|
277
|
+
type: 'boolean',
|
|
278
|
+
description: 'Shortcut to enable feature toggles.'
|
|
279
|
+
},
|
|
280
|
+
'cds.xt.ModelProviderService': {
|
|
281
|
+
description: 'Configure if/how the ModelProviderService serves model variants that may include tenant-specific extensions and/or feature-toggled aspects.',
|
|
282
|
+
oneOf: [
|
|
283
|
+
{
|
|
284
|
+
$ref: '#/$defs/serviceActivation'
|
|
285
|
+
},
|
|
286
|
+
{
|
|
287
|
+
$ref: '#/$defs/servicePresetSidecar'
|
|
288
|
+
},
|
|
289
|
+
{
|
|
290
|
+
type: 'object',
|
|
291
|
+
description: 'ModelProviderService configuration options.',
|
|
292
|
+
additionalProperties: true,
|
|
293
|
+
properties: {
|
|
294
|
+
root: {
|
|
295
|
+
type: 'string',
|
|
296
|
+
description: 'A directory name, absolute or relative to the package.json\'s location, specifying the location to search for models and resources to be served by the model provider services. Default is undefined, for embedded usage of model provider. In case of a sidecar, it refers to the main app\'s model; usually \'../..\' during development, and \'_main\' in production.',
|
|
297
|
+
format: 'uri-reference'
|
|
298
|
+
}
|
|
299
|
+
}
|
|
300
|
+
}
|
|
301
|
+
]
|
|
302
|
+
},
|
|
303
|
+
'cds.xt.ExtensibilityService': {
|
|
304
|
+
description: 'Configure if/how the ExtensibilityService allows to add and activate tenant-specific extensions at runtime.',
|
|
305
|
+
oneOf: [
|
|
306
|
+
{
|
|
307
|
+
$ref: '#/$defs/serviceActivation'
|
|
308
|
+
},
|
|
309
|
+
{
|
|
310
|
+
$ref: '#/$defs/extensionRestrictions'
|
|
311
|
+
}
|
|
312
|
+
]
|
|
313
|
+
},
|
|
314
|
+
'cds.xt.DeploymentService': {
|
|
315
|
+
description: 'Configure if/how the DeploymentService handles subscribe, unsubscribe, and upgrade events for single tenants and single apps/micro-services.',
|
|
316
|
+
oneOf: [
|
|
317
|
+
{
|
|
318
|
+
$ref: '#/$defs/serviceActivation'
|
|
319
|
+
},
|
|
320
|
+
{
|
|
321
|
+
$ref: '#/$defs/servicePresetSidecar'
|
|
322
|
+
},
|
|
323
|
+
{
|
|
324
|
+
type: 'object',
|
|
325
|
+
description: 'DeploymentService configuration options.',
|
|
326
|
+
properties: {
|
|
327
|
+
hdi: {
|
|
328
|
+
type: 'object',
|
|
329
|
+
description: 'Bundles HDI-specific settings.',
|
|
330
|
+
properties: {
|
|
331
|
+
create: {
|
|
332
|
+
type: 'object',
|
|
333
|
+
description: 'HDI container provisioning parameters.',
|
|
334
|
+
properties: {
|
|
335
|
+
database_id: {
|
|
336
|
+
type: 'string',
|
|
337
|
+
description: 'HANA Cloud instance ID.'
|
|
338
|
+
},
|
|
339
|
+
additionalProperties: true
|
|
340
|
+
}
|
|
341
|
+
},
|
|
342
|
+
bind: {
|
|
343
|
+
type: 'object',
|
|
344
|
+
description: 'HDI container binding parameters.'
|
|
345
|
+
},
|
|
346
|
+
deploy: {
|
|
347
|
+
type: 'object',
|
|
348
|
+
description: 'HDI deployment parameters as defined on https://www.npmjs.com/package/@sap/hdi-deploy#supported-features'
|
|
349
|
+
}
|
|
350
|
+
}
|
|
351
|
+
},
|
|
352
|
+
lazyT0: {
|
|
353
|
+
type: 'boolean',
|
|
354
|
+
description: 'Onboard bookkeeping t0 container at the first subscription.'
|
|
355
|
+
}
|
|
356
|
+
}
|
|
357
|
+
}
|
|
358
|
+
]
|
|
359
|
+
},
|
|
360
|
+
'cds.xt.SaasProvisioningService': {
|
|
361
|
+
description: 'De-/Activate the facade for the DeploymentService to adapt to the API expected by SAP BTP’s SaaS Provisioning Service, hence providing out-of-the-box integration.',
|
|
362
|
+
oneOf: [
|
|
363
|
+
{
|
|
364
|
+
$ref: '#/$defs/serviceActivation'
|
|
365
|
+
},
|
|
366
|
+
{
|
|
367
|
+
type: 'object',
|
|
368
|
+
description: 'SaasProvisioningService configuration options.',
|
|
369
|
+
additionalProperties: true,
|
|
370
|
+
properties: {
|
|
371
|
+
jobs: {
|
|
372
|
+
type: 'object',
|
|
373
|
+
description: 'Configuration options for the built-in async job executor.',
|
|
374
|
+
properties: {
|
|
375
|
+
workerSize: {
|
|
376
|
+
type: 'number',
|
|
377
|
+
description: 'Number of workers running in parallel per database.'
|
|
378
|
+
},
|
|
379
|
+
clusterSize: {
|
|
380
|
+
type: 'number',
|
|
381
|
+
description: 'Number of databases executing parallel tasks.'
|
|
382
|
+
}
|
|
383
|
+
},
|
|
384
|
+
additionalProperties: true
|
|
385
|
+
}
|
|
386
|
+
}
|
|
387
|
+
}
|
|
388
|
+
]
|
|
389
|
+
}
|
|
390
|
+
},
|
|
391
|
+
patternProperties: {
|
|
392
|
+
'.+': {
|
|
393
|
+
oneOf: [
|
|
394
|
+
{
|
|
395
|
+
type: 'boolean',
|
|
396
|
+
description: 'Add this type with default settings during runtime.'
|
|
397
|
+
},
|
|
398
|
+
{
|
|
399
|
+
type: 'string',
|
|
400
|
+
description: 'A shortcut referencing a predefined configuration.',
|
|
401
|
+
anyOf: [
|
|
402
|
+
{
|
|
403
|
+
$ref: '#/$defs/authType'
|
|
404
|
+
},
|
|
405
|
+
{
|
|
406
|
+
$ref: '#/$defs/databaseType'
|
|
407
|
+
},
|
|
408
|
+
{
|
|
409
|
+
$ref: '#/$defs/serviceType'
|
|
410
|
+
},
|
|
411
|
+
{
|
|
412
|
+
minLength: 1
|
|
413
|
+
}
|
|
414
|
+
]
|
|
415
|
+
},
|
|
416
|
+
{
|
|
417
|
+
type: 'object',
|
|
418
|
+
default: {},
|
|
419
|
+
additionalProperties: true,
|
|
420
|
+
properties: {
|
|
421
|
+
kind: {
|
|
422
|
+
type: 'string',
|
|
423
|
+
description: 'Kind of dependency.',
|
|
424
|
+
anyOf: [
|
|
425
|
+
{
|
|
426
|
+
$ref: '#/$defs/authType'
|
|
427
|
+
},
|
|
428
|
+
{
|
|
429
|
+
$ref: '#/$defs/databaseType'
|
|
430
|
+
},
|
|
431
|
+
{
|
|
432
|
+
$ref: '#/$defs/serviceType'
|
|
433
|
+
},
|
|
434
|
+
{
|
|
435
|
+
minLength: 1
|
|
436
|
+
}
|
|
437
|
+
]
|
|
438
|
+
},
|
|
439
|
+
model: {
|
|
440
|
+
description: 'Assigned model. Interpreted like Node.js \'requires\' logic.',
|
|
441
|
+
$ref: '#/$defs/foldersStringArray'
|
|
442
|
+
}
|
|
443
|
+
}
|
|
444
|
+
}
|
|
445
|
+
]
|
|
446
|
+
}
|
|
447
|
+
}
|
|
448
|
+
},
|
|
449
|
+
protocols: {
|
|
450
|
+
type: 'object',
|
|
451
|
+
description: 'List protocols to enable in addition to the default protocol adaptors.',
|
|
452
|
+
additionalProperties: true,
|
|
453
|
+
patternProperties: {
|
|
454
|
+
'.+': {
|
|
455
|
+
oneOf: [
|
|
456
|
+
{
|
|
457
|
+
type: 'boolean',
|
|
458
|
+
description: 'Enables a built-in protocol adapter with defaults'
|
|
459
|
+
},
|
|
460
|
+
{
|
|
461
|
+
type: 'string',
|
|
462
|
+
description: 'The endpoint to serve this protocol at.'
|
|
463
|
+
},
|
|
464
|
+
{
|
|
465
|
+
type: 'object',
|
|
466
|
+
default: {},
|
|
467
|
+
additionalProperties: true,
|
|
468
|
+
properties: {
|
|
469
|
+
path: {
|
|
470
|
+
type: 'string',
|
|
471
|
+
description: 'The endpoint to serve this protocol at.'
|
|
472
|
+
},
|
|
473
|
+
impl: {
|
|
474
|
+
type: 'string',
|
|
475
|
+
description: 'The module pathname of the protocol adapter implementation.'
|
|
476
|
+
}
|
|
477
|
+
}
|
|
478
|
+
}
|
|
479
|
+
]
|
|
480
|
+
}
|
|
481
|
+
}
|
|
482
|
+
}
|
|
483
|
+
}
|
|
484
|
+
},
|
|
485
|
+
|
|
486
|
+
serviceType: {
|
|
487
|
+
enum: [
|
|
488
|
+
'app-service',
|
|
489
|
+
'odata',
|
|
490
|
+
'odata-v2',
|
|
491
|
+
'odata-v4',
|
|
492
|
+
'rest'
|
|
493
|
+
],
|
|
494
|
+
enumDescriptions: [
|
|
495
|
+
'Standard app service',
|
|
496
|
+
'OData service',
|
|
497
|
+
'OData service version 2',
|
|
498
|
+
'OData service version 4',
|
|
499
|
+
'REST service'
|
|
500
|
+
]
|
|
501
|
+
},
|
|
502
|
+
|
|
503
|
+
authType: {
|
|
504
|
+
default: 'mocked',
|
|
505
|
+
enum: [
|
|
506
|
+
'mocked',
|
|
507
|
+
'basic',
|
|
508
|
+
'jwt',
|
|
509
|
+
'xsuaa',
|
|
510
|
+
'dummy'
|
|
511
|
+
],
|
|
512
|
+
enumDescriptions: [
|
|
513
|
+
'Mocked authentication',
|
|
514
|
+
'Basic authentication',
|
|
515
|
+
'JWT authentication',
|
|
516
|
+
'Authentication using XSUAA',
|
|
517
|
+
'Dummy authentication'
|
|
518
|
+
]
|
|
519
|
+
},
|
|
520
|
+
|
|
521
|
+
mockUsers: {
|
|
522
|
+
type: 'object',
|
|
523
|
+
description: 'List of users for local usage.',
|
|
524
|
+
properties: {
|
|
525
|
+
'*': {
|
|
526
|
+
default: true,
|
|
527
|
+
enum: [
|
|
528
|
+
true,
|
|
529
|
+
false
|
|
530
|
+
],
|
|
531
|
+
enumDescriptions: [
|
|
532
|
+
'Allow other users than the ones specified.',
|
|
533
|
+
'Block other users than the ones specified.'
|
|
534
|
+
]
|
|
535
|
+
}
|
|
536
|
+
},
|
|
537
|
+
patternProperties: {
|
|
538
|
+
'.+': {
|
|
539
|
+
type: 'object',
|
|
540
|
+
additionalProperties: true,
|
|
541
|
+
properties: {
|
|
542
|
+
roles: {
|
|
543
|
+
type: 'array',
|
|
544
|
+
description: 'Roles of the user.',
|
|
545
|
+
uniqueItems: true,
|
|
546
|
+
items: {
|
|
547
|
+
type: 'string'
|
|
548
|
+
}
|
|
549
|
+
},
|
|
550
|
+
features: {
|
|
551
|
+
type: 'array',
|
|
552
|
+
description: 'Feature toggle values of the user.',
|
|
553
|
+
uniqueItems: true,
|
|
554
|
+
items: {
|
|
555
|
+
type: 'string'
|
|
556
|
+
}
|
|
557
|
+
},
|
|
558
|
+
tenant: {
|
|
559
|
+
type: 'string',
|
|
560
|
+
description: 'SaaS tenant of the user.'
|
|
561
|
+
},
|
|
562
|
+
attr: {
|
|
563
|
+
type: 'object',
|
|
564
|
+
description: 'Additional user attributes.',
|
|
565
|
+
patternProperties: {
|
|
566
|
+
'.+': {
|
|
567
|
+
type: 'string',
|
|
568
|
+
description: 'Attribute value'
|
|
569
|
+
}
|
|
570
|
+
}
|
|
571
|
+
},
|
|
572
|
+
password: {
|
|
573
|
+
type: 'string',
|
|
574
|
+
description: 'User password'
|
|
575
|
+
}
|
|
576
|
+
}
|
|
577
|
+
}
|
|
578
|
+
}
|
|
579
|
+
},
|
|
580
|
+
|
|
581
|
+
databaseType: {
|
|
582
|
+
default: 'sqlite',
|
|
583
|
+
enum: [
|
|
584
|
+
'hana',
|
|
585
|
+
'sql',
|
|
586
|
+
'sqlite'
|
|
587
|
+
],
|
|
588
|
+
enumDescriptions: [
|
|
589
|
+
'SAP HANA',
|
|
590
|
+
'In-memory SQLite (development), SAP HANA (production)',
|
|
591
|
+
'File-based SQLite'
|
|
592
|
+
]
|
|
593
|
+
},
|
|
594
|
+
|
|
595
|
+
foldersStringArray: {
|
|
596
|
+
oneOf: [
|
|
597
|
+
{
|
|
598
|
+
type: 'string',
|
|
599
|
+
format: 'uri-reference'
|
|
600
|
+
},
|
|
601
|
+
{
|
|
602
|
+
type: 'array',
|
|
603
|
+
uniqueItems: true,
|
|
604
|
+
items: {
|
|
605
|
+
type: 'string',
|
|
606
|
+
format: 'uri-reference'
|
|
607
|
+
}
|
|
608
|
+
}
|
|
609
|
+
]
|
|
610
|
+
},
|
|
611
|
+
|
|
612
|
+
serviceActivation: {
|
|
613
|
+
type: 'boolean',
|
|
614
|
+
description: 'De-/Activate this service.'
|
|
615
|
+
},
|
|
616
|
+
|
|
617
|
+
servicePresetSidecar: {
|
|
618
|
+
type: 'string',
|
|
619
|
+
description: '\'in-sidecar\' preset provides defaults for usage in sidecars.\n\'from-sidecar\' preset is a shortcut for \'{ kind: rest }\'.',
|
|
620
|
+
enum: [
|
|
621
|
+
'in-sidecar',
|
|
622
|
+
'from-sidecar'
|
|
623
|
+
]
|
|
624
|
+
},
|
|
625
|
+
|
|
626
|
+
extensionRestrictions: {
|
|
627
|
+
type: 'object',
|
|
628
|
+
description: 'Extension restrictions',
|
|
629
|
+
additionalProperties: false,
|
|
630
|
+
properties: {
|
|
631
|
+
'element-prefix': {
|
|
632
|
+
type: 'array',
|
|
633
|
+
description: 'Field names must start with one of these strings.',
|
|
634
|
+
uniqueItems: true,
|
|
635
|
+
items: {
|
|
636
|
+
type: 'string'
|
|
637
|
+
}
|
|
638
|
+
},
|
|
639
|
+
'namespace-blocklist': {
|
|
640
|
+
type: 'array',
|
|
641
|
+
description: 'Namespaces must not start with these strings.',
|
|
642
|
+
uniqueItems: true,
|
|
643
|
+
items: {
|
|
644
|
+
type: 'string'
|
|
645
|
+
}
|
|
646
|
+
},
|
|
647
|
+
'extension-allowlist': {
|
|
648
|
+
type: 'array',
|
|
649
|
+
description: 'Restrictions for model entities, types, etc.',
|
|
650
|
+
uniqueItems: true,
|
|
651
|
+
items: {
|
|
652
|
+
type: 'object',
|
|
653
|
+
additionalProperties: false,
|
|
654
|
+
properties: {
|
|
655
|
+
for: {
|
|
656
|
+
type: 'array',
|
|
657
|
+
description: 'Restriction applies to these namespaces.',
|
|
658
|
+
uniqueItems: true,
|
|
659
|
+
items: {
|
|
660
|
+
type: 'string'
|
|
661
|
+
}
|
|
662
|
+
},
|
|
663
|
+
kind: {
|
|
664
|
+
type: 'string',
|
|
665
|
+
description: 'Type of definition',
|
|
666
|
+
default: 'entity',
|
|
667
|
+
enum: [
|
|
668
|
+
'action',
|
|
669
|
+
'annotation',
|
|
670
|
+
'context',
|
|
671
|
+
'entity',
|
|
672
|
+
'function',
|
|
673
|
+
'service',
|
|
674
|
+
'type'
|
|
675
|
+
]
|
|
676
|
+
},
|
|
677
|
+
'new-fields': {
|
|
678
|
+
type: 'integer',
|
|
679
|
+
description: 'Number of fields to be added at most.',
|
|
680
|
+
minimum: 1
|
|
681
|
+
},
|
|
682
|
+
'new-entities': {
|
|
683
|
+
type: 'integer',
|
|
684
|
+
description: 'Number of entities to be added at most',
|
|
685
|
+
minimum: 1
|
|
686
|
+
}
|
|
687
|
+
}
|
|
688
|
+
}
|
|
689
|
+
}
|
|
690
|
+
}
|
|
691
|
+
}
|
|
692
|
+
}
|
|
693
|
+
}
|
package/lib/env/schemas/index.js
CHANGED
|
@@ -1,10 +1,12 @@
|
|
|
1
|
-
const { readFile } = require('fs').promises
|
|
2
1
|
const { join } = require('path')
|
|
3
2
|
|
|
4
3
|
module.exports = new class {
|
|
5
4
|
async default4(name) {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
5
|
+
const file = join(__dirname, name.replace(/\.\w+$/, ''))
|
|
6
|
+
try {
|
|
7
|
+
return structuredClone(require(file))
|
|
8
|
+
} catch (err) {
|
|
9
|
+
throw new Error(`ENOENT: Could not load schema '${name}' from ${file}`)
|
|
10
|
+
}
|
|
9
11
|
}
|
|
10
12
|
}
|