@sap/cds-dk 7.2.0 → 7.3.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/bin/activate.js +2 -2
- package/bin/add.js +1 -1
- package/bin/build.js +6 -3
- package/bin/compile/index.js +9 -5
- package/bin/env.js +0 -3
- package/bin/extend.js +29 -3
- package/bin/import.js +7 -3
- package/bin/init.js +31 -37
- package/bin/push.js +10 -6
- package/bin/repl.js +23 -43
- package/bin/watch.js +5 -9
- package/lib/bind/bindingResolver.js +2 -1
- package/lib/bind/index.js +1 -1
- package/lib/build/{buildTaskHandler.js → buildPlugin.js} +40 -27
- package/lib/build/buildTaskEngine.js +75 -74
- package/lib/build/buildTaskFactory.js +39 -32
- package/lib/build/buildTaskProvider.js +24 -19
- package/lib/build/buildTaskProviderFactory.js +125 -58
- package/lib/build/constants.js +6 -4
- package/lib/build/index.js +7 -3
- package/lib/build/plugins.js +35 -0
- package/lib/build/provider/{buildTaskHandlerEdmx.js → edmxBuildPlugin.js} +11 -7
- package/lib/build/provider/{buildTaskHandlerFeatureToggles.js → featureToggleBuildPlugin.js} +5 -5
- package/lib/build/provider/fiori/index.js +5 -6
- package/lib/build/provider/hana/index.js +54 -30
- package/lib/build/provider/{buildTaskHandlerInternal.js → internalBuildPlugin.js} +14 -10
- package/lib/build/provider/{buildTaskProviderInternal.js → internalBuildTaskProvider.js} +27 -28
- package/lib/build/provider/java/index.js +30 -24
- package/lib/build/provider/mtx/index.js +4 -4
- package/lib/build/provider/mtx/resourcesTarBuilder.js +8 -8
- package/lib/build/provider/mtx-extension/index.js +17 -9
- package/lib/build/provider/mtx-sidecar/index.js +17 -11
- package/lib/build/provider/nodejs/index.js +14 -13
- package/lib/build/util.js +5 -0
- package/lib/client/auth_manager.js +6 -12
- package/lib/client/base_command.js +1 -1
- package/lib/client/download_legacy.js +43 -0
- package/lib/client/params.js +6 -0
- package/lib/client/push.js +41 -1
- package/lib/client/settings_manager.js +28 -17
- package/lib/compile/openapi/csdl2openapi.js +1 -1
- package/lib/env/schema.js +36 -0
- package/lib/env/schemas/cds-rc.json +101 -0
- package/lib/import/common.js +23 -10
- package/lib/import/importapi.js +2 -2
- package/lib/import/message.js +3 -1
- package/lib/import/odata/v4parser.js +23 -7
- package/lib/index.js +11 -0
- package/lib/init/constants.js +5 -2
- package/lib/init/index.js +2 -3
- package/lib/init/template/_merging/registry-mta.js +33 -0
- package/lib/init/template/approuter/files/mta.yaml.hbs +1 -1
- package/lib/init/template/approuter/index.js +9 -9
- package/lib/init/template/connectivity/index.js +5 -4
- package/lib/init/template/destination/index.js +2 -5
- package/lib/init/template/helm/subcharts/content-deployment/Chart.yaml +4 -4
- package/lib/init/template/helm/subcharts/content-deployment/templates/_helpers.tpl +4 -2
- package/lib/init/template/helm/subcharts/content-deployment/templates/job.yaml +4 -3
- package/lib/init/template/helm/subcharts/content-deployment/values.schema.json +9 -83
- package/lib/init/template/helm/subcharts/content-deployment/values.yaml +54 -15
- package/lib/init/template/helm/subcharts/service-instance/Chart.yaml +4 -4
- package/lib/init/template/helm/subcharts/service-instance/templates/serviceinstance.yaml +1 -1
- package/lib/init/template/helm/subcharts/service-instance/values.schema.json +0 -17
- package/lib/init/template/helm/subcharts/service-instance/values.yaml +28 -0
- package/lib/init/template/helm/subcharts/web-application/Chart.yaml +5 -5
- package/lib/init/template/helm/subcharts/web-application/templates/_api.tpl +60 -0
- package/lib/init/template/helm/subcharts/web-application/templates/_helpers.tpl +34 -73
- package/lib/init/template/helm/subcharts/web-application/templates/api-rule.yaml +4 -4
- package/lib/init/template/helm/subcharts/web-application/templates/deployment.yaml +96 -17
- package/lib/init/template/helm/subcharts/web-application/templates/network-policy.yaml +19 -3
- package/lib/init/template/helm/subcharts/web-application/templates/pod-disruption-budget.yaml +3 -3
- package/lib/init/template/helm/subcharts/web-application/templates/rbac.yaml +26 -0
- package/lib/init/template/helm/subcharts/web-application/templates/secret.yaml +1 -1
- package/lib/init/template/helm/subcharts/web-application/templates/service-account.yaml +1 -1
- package/lib/init/template/helm/subcharts/web-application/templates/service-binding.yaml +1 -1
- package/lib/init/template/helm/subcharts/web-application/templates/service.yaml +21 -3
- package/lib/init/template/helm/subcharts/web-application/templates/virtual-service.yaml +36 -0
- package/lib/init/template/helm/subcharts/web-application/values.schema.json +535 -142
- package/lib/init/template/helm/subcharts/web-application/values.yaml +168 -44
- package/lib/init/template/html5-repo/index.js +27 -3
- package/lib/init/template/mta/index.js +9 -3
- package/lib/init/template/nodejs/files/.vscode/launch.json +0 -3
- package/lib/init/template/notifications/files/mta.yaml.hbs +17 -0
- package/lib/init/template/notifications/files/notificationtypes.json.hbs +16 -0
- package/lib/init/template/notifications/files/package.json.hbs +14 -0
- package/lib/init/template/notifications/index.js +52 -0
- package/lib/init/template/postgres/files/mta.yaml.hbs +27 -0
- package/lib/init/template/postgres/files/package.json.hbs +5 -0
- package/lib/init/template/postgres/index.js +52 -0
- package/lib/init/util/projectReader.js +0 -1
- package/lib/util/pruneAxiosErrors.js +25 -8
- package/lib/util/term.js +1 -2
- package/lib/watch/livereload-server.js +38 -2
- package/lib/watch/node-watch.js +3 -2
- package/npm-shrinkwrap.json +334 -335
- package/package.json +2 -2
- package/lib/init/template/helm/subcharts/content-deployment/templating.md +0 -37
- package/lib/init/template/helm/subcharts/content-deployment/values-lint.yaml +0 -5
- package/lib/init/template/helm/subcharts/content-deployment/values.md +0 -1011
- package/lib/init/template/helm/subcharts/service-instance/templating.md +0 -18
- package/lib/init/template/helm/subcharts/service-instance/values-lint.yaml +0 -2
- package/lib/init/template/helm/subcharts/service-instance/values.md +0 -186
- package/lib/init/template/helm/subcharts/web-application/templating.md +0 -51
- package/lib/init/template/helm/subcharts/web-application/values-lint.yaml +0 -8
- package/lib/init/template/helm/subcharts/web-application/values.md +0 -1363
|
@@ -1,27 +1,56 @@
|
|
|
1
|
+
# Helm global values, for more information, see https://helm.sh/docs/chart_template_guide/subcharts_and_globals/#global-chart-values
|
|
1
2
|
global:
|
|
3
|
+
# Image Pull Secret configuration, for more information, see https://kubernetes.io/docs/tasks/configure-pod-container/pull-image-private-registry/
|
|
2
4
|
imagePullSecret: {}
|
|
3
|
-
|
|
4
|
-
|
|
5
|
+
## Name of the Kubernetes Secret, used as an image pull secret (must be of type kubernetes.io/dockerconfigjson). Can't be used with the `dockerconfigjson` option.
|
|
6
|
+
# name: ""
|
|
7
|
+
## The content for the dynamically generated Kubernetes Secret, which will be used as an image pull secret. Can't be used with the `name` option.
|
|
8
|
+
# dockerconfigjson: ""
|
|
9
|
+
# Either name or repository is required.
|
|
5
10
|
image: {}
|
|
6
|
-
|
|
7
|
-
|
|
11
|
+
## Setting the imagePullPolicy, see https://kubernetes.io/docs/concepts/containers/images/#image-pull-policy
|
|
12
|
+
# imagePullPolicy: Always
|
|
13
|
+
|
|
14
|
+
sap:
|
|
15
|
+
_internal:
|
|
16
|
+
web-application:
|
|
17
|
+
versions:
|
|
18
|
+
1.8.0: true
|
|
19
|
+
## Will be used instead of the `.Chart.Name`, e.g. when generating the Deployment name.
|
|
20
|
+
# nameOverride: name
|
|
21
|
+
|
|
22
|
+
## Will be used as an override for the `.fullname` helper function (i.e. `.Release.Name-.Chart.Name`).
|
|
23
|
+
# fullnameOverride: my-name
|
|
24
|
+
|
|
25
|
+
## The UID to run the entrypoint of the container process. Defaults to user specified in image metadata if unspecified.
|
|
26
|
+
# runAsUser: 1000
|
|
8
27
|
|
|
28
|
+
# Number of desired pods within the Deployment.
|
|
9
29
|
replicaCount: 1
|
|
30
|
+
# Application's exposed port.
|
|
10
31
|
port: 8080
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
# To use a digest, change those values like that
|
|
14
|
-
# repository: nginx@sha256
|
|
15
|
-
# tag: 2834dc507516af02784808c5f48b7cbe38b8ed5d0f4837f16e78d00deb7e7767
|
|
32
|
+
## Name of the Service Account assigned to pods.
|
|
33
|
+
# serviceAccountName: my-serviceaccount
|
|
16
34
|
image: {}
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
35
|
+
## To use a digest, change those values as shown
|
|
36
|
+
# repository: nginx@sha256
|
|
37
|
+
# tag: 2834dc507516af02784808c5f48b7cbe38b8ed5d0f4837f16e78d00deb7e7767
|
|
38
|
+
## Should also include the image name (i.e. everything before the `:` sign).
|
|
39
|
+
# repository: repo/image
|
|
40
|
+
# registry: gcr.io/my-project
|
|
41
|
+
# tag: latest
|
|
20
42
|
|
|
43
|
+
# Image Pull Secret configuration, for more information, see https://kubernetes.io/docs/tasks/configure-pod-container/pull-image-private-registry/
|
|
21
44
|
imagePullSecret: {}
|
|
22
|
-
|
|
23
|
-
|
|
45
|
+
## Name of the Kubernetes Secret, used as an image pull secret (must be of type kubernetes.io/dockerconfigjson). Can't be used with the `dockerconfigjson` option.
|
|
46
|
+
# name: ""
|
|
47
|
+
## The content for the dynamically generated Kubernetes Secret, which will be used as an image pull secret. Can't be used with the `name` option.
|
|
48
|
+
# dockerconfigjson: ""
|
|
49
|
+
|
|
50
|
+
## Setting the imagePullPolicy, see https://kubernetes.io/docs/concepts/containers/images/#image-pull-policy
|
|
51
|
+
# imagePullPolicy: Always
|
|
24
52
|
|
|
53
|
+
# List of volumes, which should be mounted into Pods, see https://kubernetes.io/docs/concepts/storage/volumes/ for full list of options
|
|
25
54
|
additionalVolumes: []
|
|
26
55
|
# - name: my-volume
|
|
27
56
|
# secret:
|
|
@@ -30,6 +59,7 @@ additionalVolumes: []
|
|
|
30
59
|
# mountPath: /etc/mysecret
|
|
31
60
|
# readOnly: true
|
|
32
61
|
|
|
62
|
+
## Pod resources configuration, see https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/ for more information
|
|
33
63
|
# resources:
|
|
34
64
|
# limits:
|
|
35
65
|
# cpu: 100m
|
|
@@ -40,33 +70,40 @@ additionalVolumes: []
|
|
|
40
70
|
# ephemeral-storage: 1G
|
|
41
71
|
# memory: 1G
|
|
42
72
|
|
|
73
|
+
## Enable or disable istio sidecars for this workload (other default is taken, e.g. namespace)
|
|
74
|
+
# istio:
|
|
75
|
+
# enabled: true
|
|
76
|
+
|
|
77
|
+
# Availability related configuration
|
|
43
78
|
availability:
|
|
79
|
+
# The max disruption to the pods, see https://kubernetes.io/docs/concepts/workloads/pods/disruptions/ for details
|
|
44
80
|
podDisruptionBudget:
|
|
45
81
|
maxUnavailable: 10%
|
|
82
|
+
# How pods ought to spread across topology domains., see https://kubernetes.io/docs/concepts/scheduling-eviction/topology-spread-constraints/ for details
|
|
46
83
|
topologySpreadConstraints:
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
84
|
+
- topologyKey: topology.kubernetes.io/zone
|
|
85
|
+
maxSkew: 1
|
|
86
|
+
whenUnsatisfiable: ScheduleAnyway
|
|
87
|
+
- topologyKey: kubernetes.io/hostname
|
|
88
|
+
maxSkew: 1
|
|
89
|
+
whenUnsatisfiable: ScheduleAnyway
|
|
90
|
+
# Health-check configuration
|
|
54
91
|
health:
|
|
92
|
+
# Liveness-probe configuration.
|
|
55
93
|
liveness:
|
|
94
|
+
# HTTP path used by Kubernetes, to perform liveness-probe calls.
|
|
56
95
|
path: /healthz
|
|
96
|
+
# Readiness-probe configuration.
|
|
57
97
|
readiness:
|
|
98
|
+
# HTTP path used by Kubernetes, to perform readiness-probe calls.
|
|
58
99
|
path: /healthz
|
|
59
|
-
|
|
60
|
-
# readOnlyRootFilesystem: false
|
|
61
|
-
terminationGracePeriodSeconds: 30
|
|
100
|
+
# Initial timeout in seconds, during which the app must start giving the response to the liveness-probe.
|
|
62
101
|
startupTimeoutSeconds: 30
|
|
102
|
+
## Use read only filesystem for the Deployment.
|
|
103
|
+
# readOnlyRootFilesystem: false
|
|
63
104
|
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
# name: my-configmap1
|
|
67
|
-
# - secretRef:
|
|
68
|
-
# name: my-secret-ref1
|
|
69
|
-
|
|
105
|
+
# Time in seconds after which the pod will be forcefully stopped after receiving SIGTERM.
|
|
106
|
+
terminationGracePeriodSeconds: 30
|
|
70
107
|
env: {}
|
|
71
108
|
# env:
|
|
72
109
|
# key1: value
|
|
@@ -78,7 +115,7 @@ env: {}
|
|
|
78
115
|
# configMapKeyRef:
|
|
79
116
|
# name: my-configmap
|
|
80
117
|
# key: my-key
|
|
81
|
-
|
|
118
|
+
## Also can be specified as a list
|
|
82
119
|
# env:
|
|
83
120
|
# - name: key1
|
|
84
121
|
# value: value1
|
|
@@ -87,22 +124,53 @@ env: {}
|
|
|
87
124
|
# name: my-configmap
|
|
88
125
|
# key: my-key
|
|
89
126
|
|
|
127
|
+
envFrom: []
|
|
128
|
+
# - configMapRef:
|
|
129
|
+
# name: my-configmap1
|
|
130
|
+
# - secretRef:
|
|
131
|
+
# name: my-secret-ref1
|
|
132
|
+
|
|
90
133
|
expose:
|
|
134
|
+
## Specifies the service's dns name for inbound external traffic. If it doesn't contain a dot, the default cluster domain will be appended.
|
|
135
|
+
# host: ""
|
|
136
|
+
|
|
137
|
+
# Expose the application to the internet.
|
|
91
138
|
enabled: true
|
|
139
|
+
# Use this istio gateway for incoming traffic.
|
|
92
140
|
gateway: kyma-gateway.kyma-system.svc.cluster.local
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
- handler: allow
|
|
97
|
-
methods:
|
|
98
|
-
- GET
|
|
99
|
-
- POST
|
|
100
|
-
- PUT
|
|
101
|
-
- PATCH
|
|
102
|
-
- DELETE
|
|
103
|
-
- HEAD
|
|
104
|
-
path: /.*
|
|
141
|
+
## Custom Istio Gateway to use with the VirtualService created using the TENANT_HOST_PATTERN.
|
|
142
|
+
## If your TENANT_HOST_PATTERN uses top level domain for the tenants (like tenant-name.<provider>.<cluster-domain>), you need to create custom Certificate and Gateway since the default Kyma Gateway will not work.
|
|
143
|
+
# tenantGateway: tenants-gateway.my-ns.svc.cluster.local
|
|
105
144
|
|
|
145
|
+
# Rules represents collection of Rule to apply.
|
|
146
|
+
rules:
|
|
147
|
+
- accessStrategies:
|
|
148
|
+
- handler: allow
|
|
149
|
+
methods:
|
|
150
|
+
- GET
|
|
151
|
+
- POST
|
|
152
|
+
- PUT
|
|
153
|
+
- PATCH
|
|
154
|
+
- DELETE
|
|
155
|
+
- HEAD
|
|
156
|
+
path: /.*
|
|
157
|
+
prometheus:
|
|
158
|
+
# Add annotations to the Service for Prometheus Service Discovery
|
|
159
|
+
enabled: false
|
|
160
|
+
# URI used by Prometheus for scraping
|
|
161
|
+
path: /metrics
|
|
162
|
+
## Custom port for Prometheus scraping, defaults to the application port
|
|
163
|
+
# port: 8081
|
|
164
|
+
# Open Telemetry support
|
|
165
|
+
otlp:
|
|
166
|
+
metrics:
|
|
167
|
+
enabled: true
|
|
168
|
+
# Metrics endpoint
|
|
169
|
+
endpoint: http://telemetry-otlp-metrics.kyma-system.svc.cluster.local:4317
|
|
170
|
+
traces:
|
|
171
|
+
enabled: true
|
|
172
|
+
# Trace endpoint
|
|
173
|
+
endpoint: http://telemetry-otlp-traces.kyma-system.svc.cluster.local:4317
|
|
106
174
|
networkSecurity:
|
|
107
175
|
enabled: true
|
|
108
176
|
# allowNamespaceInternal: true
|
|
@@ -111,14 +179,25 @@ networkSecurity:
|
|
|
111
179
|
# - namespace: my-namespace
|
|
112
180
|
# podLabelsSelector:
|
|
113
181
|
# app: my-app
|
|
182
|
+
# RBAC configuration https://kubernetes.io/docs/reference/access-authn-authz/rbac/. Only one of "role", "clusterRole" or "rules" can be specified.
|
|
183
|
+
rbac: {}
|
|
184
|
+
## Name of the existing Role to use
|
|
185
|
+
# role: existing-role-name
|
|
186
|
+
|
|
187
|
+
## Name of the existing ClusterRole to use
|
|
188
|
+
# clusterRole: existingClusterRoleName
|
|
114
189
|
|
|
190
|
+
## List of RBAC rules assigned to the new Role.
|
|
191
|
+
# rules:
|
|
192
|
+
# - apiGroups: [""]
|
|
193
|
+
# resources: ["pods"]
|
|
194
|
+
# verbs: ["get", "watch", "list"]
|
|
115
195
|
bindings:
|
|
116
196
|
defaultProperties:
|
|
117
197
|
credentialsRotationPolicy:
|
|
118
198
|
enabled: false
|
|
119
199
|
rotationFrequency: "720h"
|
|
120
200
|
rotatedBindingTTL: "24h"
|
|
121
|
-
|
|
122
201
|
# ui5-repo-servicerepo:
|
|
123
202
|
# serviceInstanceName: ui5-repo-instance
|
|
124
203
|
# externalName: ui5-kyma-binding
|
|
@@ -135,3 +214,48 @@ bindings:
|
|
|
135
214
|
# serviceInstanceName: hana-manual
|
|
136
215
|
# portal:
|
|
137
216
|
# fromSecret: manual-secret # user-provided-service
|
|
217
|
+
|
|
218
|
+
## Annotations to add to objects
|
|
219
|
+
annotations:
|
|
220
|
+
## Annotations to add to the Deployment and underlying Pods
|
|
221
|
+
deployment: {}
|
|
222
|
+
# sidecars:
|
|
223
|
+
# sidecar-1:
|
|
224
|
+
# image:
|
|
225
|
+
# repository: gcr.io/my-sidecar-1
|
|
226
|
+
# tag: latest
|
|
227
|
+
# imagePullPolicy: Always
|
|
228
|
+
# resources:
|
|
229
|
+
# limits:
|
|
230
|
+
# cpu: 100m
|
|
231
|
+
# ephemeral-storage: 1G
|
|
232
|
+
# memory: 1G
|
|
233
|
+
# requests:
|
|
234
|
+
# cpu: 100m
|
|
235
|
+
# ephemeral-storage: 1G
|
|
236
|
+
# memory: 1G
|
|
237
|
+
# env:
|
|
238
|
+
# - name: SIDECAR_PROXY_REQUEST_TIMEOUT
|
|
239
|
+
# value: "60000"
|
|
240
|
+
# envFrom:
|
|
241
|
+
# - configMapRef:
|
|
242
|
+
# name: my-configmap1
|
|
243
|
+
# sidecar-2:
|
|
244
|
+
# image:
|
|
245
|
+
# repository: gcr.io/my-sidecar-2
|
|
246
|
+
# tag: latest
|
|
247
|
+
# imagePullPolicy: Always
|
|
248
|
+
# resources:
|
|
249
|
+
# limits:
|
|
250
|
+
# cpu: 100m
|
|
251
|
+
# ephemeral-storage: 1G
|
|
252
|
+
# memory: 1G
|
|
253
|
+
# requests:
|
|
254
|
+
# cpu: 100m
|
|
255
|
+
# ephemeral-storage: 1G
|
|
256
|
+
# memory: 1G
|
|
257
|
+
# env:
|
|
258
|
+
# SIDECAR_PROXY_REQUEST_TIMEOUT: 30000
|
|
259
|
+
# envFrom:
|
|
260
|
+
# - configMapRef:
|
|
261
|
+
# name: my-configmap1
|
|
@@ -27,7 +27,7 @@ module.exports = class Html5RepoTemplate extends require('../templateBase') {
|
|
|
27
27
|
}
|
|
28
28
|
|
|
29
29
|
async runDependentMerging(context = {}) {
|
|
30
|
-
const { appName, hasHelm } = await readProject()
|
|
30
|
+
const { appName, hasHelm, hasApprouter} = await readProject()
|
|
31
31
|
|
|
32
32
|
if (hasHelm) {
|
|
33
33
|
//in case facet is being added to the already exisiting charts folder
|
|
@@ -69,14 +69,38 @@ module.exports = class Html5RepoTemplate extends require('../templateBase') {
|
|
|
69
69
|
}
|
|
70
70
|
},
|
|
71
71
|
backendDestinations: {},
|
|
72
|
+
destination: {
|
|
73
|
+
parameters: {
|
|
74
|
+
HTML5Runtime_enabled: true
|
|
75
|
+
}
|
|
76
|
+
}
|
|
72
77
|
}
|
|
73
78
|
)
|
|
74
|
-
|
|
79
|
+
|
|
75
80
|
// copy content deployment chart if it is not present
|
|
76
81
|
const HelmTemplate = require(`../helm`);
|
|
77
82
|
const helmTemplate = new HelmTemplate(context.oldTrackingData, context.newTrackingData);
|
|
78
|
-
isIndependentCommand = isIndependentCommand | await helmTemplate.addSubChart('content-deployment');
|
|
79
83
|
|
|
84
|
+
if (hasApprouter) {
|
|
85
|
+
await mergeYAML(
|
|
86
|
+
join('chart', 'values.yaml'),
|
|
87
|
+
{
|
|
88
|
+
'html5-apps-repo-runtime': {
|
|
89
|
+
serviceOfferingName: 'html5-apps-repo',
|
|
90
|
+
servicePlanName: 'app-runtime'
|
|
91
|
+
},
|
|
92
|
+
approuter: {
|
|
93
|
+
bindings: {
|
|
94
|
+
'html5-apps-repo-runtime': { serviceInstanceName: 'html5-apps-repo-runtime' }
|
|
95
|
+
}
|
|
96
|
+
},
|
|
97
|
+
}
|
|
98
|
+
)
|
|
99
|
+
await helmTemplate.addDependency('service-instance', 'html5-apps-repo-runtime');
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
isIndependentCommand = isIndependentCommand | await helmTemplate.addSubChart('content-deployment');
|
|
103
|
+
|
|
80
104
|
// add dependency entry in chart.yaml
|
|
81
105
|
await helmTemplate.addDependency('content-deployment', 'html5-apps-deployer');
|
|
82
106
|
|
|
@@ -4,17 +4,23 @@ const { exists } = cds.utils
|
|
|
4
4
|
const { copyRenderedYAML } = require('../../../util/fs')
|
|
5
5
|
const { readProject } = require('../../util/projectReader')
|
|
6
6
|
const { mergeJSON, sort } = require('../../util/merge')
|
|
7
|
-
|
|
7
|
+
const {
|
|
8
|
+
APPROUTER, XSUAA, MULTITENANCY, EXTENSIBILITY,
|
|
9
|
+
MTA, HELM,
|
|
10
|
+
HANA, POSTGRES,
|
|
11
|
+
ENTERPRISE_MESSAGING, ENTERPRISE_MESSAGING_SHARED, REDIS_MESSAGING,
|
|
12
|
+
CONNECTIVITY, DESTINATION, NOTIFICATIONS
|
|
13
|
+
} = require('../../constants').OPTIONS
|
|
8
14
|
module.exports = class MtaTemplate extends require('../templateBase') {
|
|
9
15
|
|
|
10
16
|
static hasFacet() {
|
|
11
17
|
const { options } = cds.cli
|
|
12
|
-
if (!options?.add.has(
|
|
18
|
+
if (!options?.add.has(MTA) && options?.add.has(HELM)) return false
|
|
13
19
|
return exists('mta.yaml')
|
|
14
20
|
}
|
|
15
21
|
|
|
16
22
|
getRelatedFacets() {
|
|
17
|
-
return [
|
|
23
|
+
return [APPROUTER, XSUAA, MULTITENANCY, HANA, POSTGRES, EXTENSIBILITY, ENTERPRISE_MESSAGING, ENTERPRISE_MESSAGING_SHARED, REDIS_MESSAGING, CONNECTIVITY, DESTINATION, NOTIFICATIONS]
|
|
18
24
|
}
|
|
19
25
|
|
|
20
26
|
async run() {
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
---
|
|
2
|
+
modules:
|
|
3
|
+
- name: notification-content-deployment
|
|
4
|
+
type: nodejs
|
|
5
|
+
path: gen/srv
|
|
6
|
+
parameters:
|
|
7
|
+
no-route: true
|
|
8
|
+
no-start: true
|
|
9
|
+
memory: 256MB
|
|
10
|
+
disk-quota: 256MB
|
|
11
|
+
tasks:
|
|
12
|
+
- name: notification-content-deployment
|
|
13
|
+
command: "node node_modules/@cap-js/notifications/lib/content-deployment.js"
|
|
14
|
+
memory: 256MB
|
|
15
|
+
disk-quota: 256MB
|
|
16
|
+
requires:
|
|
17
|
+
- name: {{appName}}-destination
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
[
|
|
2
|
+
{
|
|
3
|
+
"NotificationTypeKey": "{{ appName }}-notification",
|
|
4
|
+
"NotificationTypeVersion": "1",
|
|
5
|
+
"Templates": [
|
|
6
|
+
{
|
|
7
|
+
"Language": "en",
|
|
8
|
+
"TemplatePublic": "Hello world!",
|
|
9
|
+
"TemplateSensitive": "Hello SAP!",
|
|
10
|
+
"TemplateGrouped": "Hello universe!",
|
|
11
|
+
"TemplateLanguage": "mustache",
|
|
12
|
+
"Subtitle": "Hello {{ appName }}!"
|
|
13
|
+
}
|
|
14
|
+
]
|
|
15
|
+
}
|
|
16
|
+
]
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
const { join } = require('path')
|
|
2
|
+
const cds = require('../../../cds')
|
|
3
|
+
const { exists } = cds.utils
|
|
4
|
+
const { readProject } = require('../../util/projectReader')
|
|
5
|
+
const { mergeJSON, mergeYAML } = require('../../util/merge')
|
|
6
|
+
const { DESTINATION } = require('../../constants').OPTIONS
|
|
7
|
+
|
|
8
|
+
const { notificationTypesDeployer } = require('../_merging/registry-mta')
|
|
9
|
+
|
|
10
|
+
module.exports = class NotificationsTemplate extends require('../templateBase') {
|
|
11
|
+
|
|
12
|
+
static hasFacet(env) {
|
|
13
|
+
return !!env.requires?.notifications;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
async canRun() {
|
|
17
|
+
const project = await readProject()
|
|
18
|
+
const { isJava } = project
|
|
19
|
+
if (isJava) {
|
|
20
|
+
throw `'cds add notifications' is not available for JAVA yet`
|
|
21
|
+
}
|
|
22
|
+
return true
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
getDependencies() {
|
|
26
|
+
return [DESTINATION]
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
async run() {
|
|
30
|
+
const project = await readProject();
|
|
31
|
+
const { configFile } = project;
|
|
32
|
+
|
|
33
|
+
// create notificationtypes if it doesn't exist
|
|
34
|
+
if (!exists('notificationtypes.json')) {
|
|
35
|
+
await mergeJSON('notificationtypes.json', join(__dirname, 'files', 'notificationtypes.json.hbs'), project);
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
//update package.json
|
|
39
|
+
await mergeJSON(configFile, join(__dirname, 'files', 'package.json.hbs'), project);
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
async runDependentMerging() {
|
|
43
|
+
const project = await readProject();
|
|
44
|
+
const { hasMta } = project;
|
|
45
|
+
|
|
46
|
+
if (hasMta) {
|
|
47
|
+
await mergeYAML('mta.yaml', join(__dirname, 'files', 'mta.yaml.hbs'), project, {
|
|
48
|
+
additions: [notificationTypesDeployer]
|
|
49
|
+
});
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
---
|
|
2
|
+
modules:
|
|
3
|
+
- name: {{appName}}-srv
|
|
4
|
+
type: {{language}}
|
|
5
|
+
path: {{& srvPath}}
|
|
6
|
+
requires:
|
|
7
|
+
- name: {{appName}}-postgres
|
|
8
|
+
|
|
9
|
+
- name: {{appName}}-postgres-deployer
|
|
10
|
+
type: nodejs
|
|
11
|
+
path: gen/pg
|
|
12
|
+
parameters:
|
|
13
|
+
buildpack: nodejs_buildpack
|
|
14
|
+
no-route: true
|
|
15
|
+
no-start: true
|
|
16
|
+
tasks:
|
|
17
|
+
- name: deploy-to-postgresql
|
|
18
|
+
command: npm start
|
|
19
|
+
requires:
|
|
20
|
+
- name: {{appName}}-postgres
|
|
21
|
+
|
|
22
|
+
resources:
|
|
23
|
+
- name: {{appName}}-postgres
|
|
24
|
+
type: org.cloudfoundry.managed-service
|
|
25
|
+
parameters:
|
|
26
|
+
service: postgresql-db
|
|
27
|
+
service-plan: development
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
const { join } = require('path')
|
|
2
|
+
const cds = require('../../../cds')
|
|
3
|
+
const { read } = cds.utils
|
|
4
|
+
const { readProject } = require('../../util/projectReader')
|
|
5
|
+
const { mergeJSON, mergeYAML } = require('../../util/merge')
|
|
6
|
+
const { srvNode4, srvJava4, postgres, postgresDeployer } = require('../_merging/registry-mta')
|
|
7
|
+
|
|
8
|
+
module.exports = class PostgresTemplate extends require('../templateBase') {
|
|
9
|
+
|
|
10
|
+
async canRun() {
|
|
11
|
+
const { hasMta, hasHelm, isJava } = await readProject(this.options)
|
|
12
|
+
if (isJava) throw `'cds add postgres' is not available for Java yet`
|
|
13
|
+
if (hasHelm && !hasMta) throw `'cds add postgres' is not available for Kyma yet`
|
|
14
|
+
return true
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
static hasFacet(env) {
|
|
18
|
+
return env.requires?.db?.kind === 'postgres'
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
async run() {
|
|
22
|
+
const project = await readProject(this.options)
|
|
23
|
+
const { configFile } = project
|
|
24
|
+
project.shortcut = !(await read(configFile)).cds?.requires?.db?.kind
|
|
25
|
+
await mergeJSON(configFile, join(__dirname, 'files', 'package.json.hbs'), project)
|
|
26
|
+
await this.runDependentMerging()
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
async runDependentMerging() {
|
|
30
|
+
const project = await readProject(this.options)
|
|
31
|
+
const { hasMta, isNodejs, srvPath } = project
|
|
32
|
+
|
|
33
|
+
if (hasMta) {
|
|
34
|
+
const srv = (isNodejs ? srvNode4 : srvJava4)(srvPath)
|
|
35
|
+
await mergeYAML(
|
|
36
|
+
'mta.yaml',
|
|
37
|
+
join(__dirname, 'files', 'mta.yaml.hbs'),
|
|
38
|
+
project,
|
|
39
|
+
{
|
|
40
|
+
additions: [srv, postgres, postgresDeployer],
|
|
41
|
+
relationships: [{
|
|
42
|
+
insert: [postgres, 'name'],
|
|
43
|
+
into: [srv, 'requires', 'name']
|
|
44
|
+
}, {
|
|
45
|
+
insert: [postgres, 'name'],
|
|
46
|
+
into: [postgresDeployer, 'requires', 'name']
|
|
47
|
+
}]
|
|
48
|
+
}
|
|
49
|
+
)
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
}
|
|
@@ -81,7 +81,6 @@ module.exports = new class ProjectReader {
|
|
|
81
81
|
get hasMta() { return _hasFacet('mta') },
|
|
82
82
|
get hasHelm() { return _hasFacet('helm') },
|
|
83
83
|
get appPath() { return env.folders.app ?? 'app' },
|
|
84
|
-
get approuterPath() { return join(env.folders.app ?? 'app', 'router') },
|
|
85
84
|
get appVersion() { return appVersion },
|
|
86
85
|
get appName() { return appName },
|
|
87
86
|
get appId() { return appId },
|
|
@@ -1,19 +1,36 @@
|
|
|
1
|
+
function stacklessError(message) {
|
|
2
|
+
const { stackTraceLimit } = Error;
|
|
3
|
+
Error.stackTraceLimit = 0;
|
|
4
|
+
const error = new Error(message);
|
|
5
|
+
Error.stackTraceLimit = stackTraceLimit;
|
|
6
|
+
return error;
|
|
7
|
+
}
|
|
8
|
+
|
|
1
9
|
require('axios').interceptors.response.use(
|
|
2
10
|
response => response,
|
|
3
11
|
axError => {
|
|
12
|
+
const { inspect } = require('util');
|
|
4
13
|
const { url, method } = axError.config ?? {};
|
|
5
|
-
const {
|
|
6
|
-
const { status,
|
|
7
|
-
|
|
14
|
+
const { response = {} } = axError;
|
|
15
|
+
const { status, statusText } = response;
|
|
16
|
+
let { data } = response;
|
|
17
|
+
if (Buffer.isBuffer(data)) {
|
|
18
|
+
data = data.toString();
|
|
19
|
+
try {
|
|
20
|
+
data = JSON.parse(data);
|
|
21
|
+
} catch (error) { /* unexpected; data will be included in error below */ }
|
|
22
|
+
}
|
|
23
|
+
const reason = data?.error /* RFC 6749 */ && (typeof data.error === 'string' ? data.error : inspect(data.error));
|
|
8
24
|
const message = (url && method ? `${method.toUpperCase()} ${url} ` : '') +
|
|
9
25
|
'failed' +
|
|
10
|
-
(status ||
|
|
26
|
+
(status || statusText ? ':' : '') +
|
|
11
27
|
(status ? ` ${status}` : '') +
|
|
12
|
-
(
|
|
13
|
-
`. ${reason}
|
|
14
|
-
(data ?
|
|
28
|
+
(statusText ? ` ${statusText}` : '') +
|
|
29
|
+
(reason ? `. ${reason}` : '') +
|
|
30
|
+
(data ? `. Details: '${data.error_description /* RFC 6749 */ || inspect(data)}'` : '');
|
|
15
31
|
|
|
16
|
-
const error =
|
|
32
|
+
const error = stacklessError(message);
|
|
33
|
+
error.status = status;
|
|
17
34
|
if (require('../').debug('req')) {
|
|
18
35
|
error.cause = axError;
|
|
19
36
|
}
|
package/lib/util/term.js
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
// FIXME: Nicht gut, das wir das zweimal redundant haben!
|
|
2
1
|
const DEBUG = /\b(y|all|cli)\b/.test(process.env.DEBUG) ? console.debug : undefined
|
|
3
2
|
|
|
4
3
|
// https://docs.microsoft.com/en-us/windows/console/console-virtual-terminal-sequences
|
|
@@ -16,7 +15,7 @@ const t = module.exports.codes = {
|
|
|
16
15
|
Object.defineProperty(module.exports, 'isTTY', { get: () => process.stdin.isTTY && process.stderr.isTTY })
|
|
17
16
|
|
|
18
17
|
const as = module.exports.as = (codes, o) => {
|
|
19
|
-
return module.exports.isTTY ? (codes + o + t.reset) : ('' + o)
|
|
18
|
+
return module.exports.isTTY && !process.env.NO_COLOR ? (codes + o + t.reset) : ('' + o)
|
|
20
19
|
}
|
|
21
20
|
|
|
22
21
|
const asErr = module.exports.error = o => DEBUG ? o : as(t.red + t.bold, o)
|