@sap/cds-dk 6.8.2 → 7.0.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/bin/activate.js +15 -7
- package/bin/add.js +29 -15
- package/bin/bind.js +49 -116
- package/bin/build.js +114 -0
- package/bin/cds.js +67 -24
- package/bin/compile/index.js +2 -2
- package/bin/deploy/index.js +46 -39
- package/bin/deploy/to-hana.js +11 -8
- package/bin/deploy/to-postgres.js +8 -2
- package/bin/deploy/to-sqlite.js +0 -1
- package/bin/env.js +75 -41
- package/bin/eval.js +3 -3
- package/bin/extend.js +17 -10
- package/bin/help.js +22 -21
- package/bin/import.js +10 -7
- package/bin/init.js +38 -17
- package/bin/login.js +69 -55
- package/bin/logout.js +12 -9
- package/bin/migrate.js +10 -4
- package/bin/pull.js +12 -5
- package/bin/push.js +24 -13
- package/bin/repl.js +1 -0
- package/bin/run.js +25 -0
- package/bin/subscribe.js +13 -8
- package/bin/unsubscribe.js +15 -8
- package/bin/upgrade.js +15 -9
- package/bin/util/log.js +24 -0
- package/bin/version.js +124 -0
- package/bin/watch.js +1 -35
- package/bin/watched.js +39 -0
- package/lib/bind/KubernetesApiAccessor.js +2 -2
- package/lib/bind/bindingManager.js +1 -1
- package/lib/bind/bindingUtil.js +0 -9
- package/lib/bind/cfKeyProvider.js +10 -72
- package/lib/bind/index.js +114 -0
- package/lib/bind/kubernetesCredentialsProvider.js +2 -2
- package/lib/bind/userCdsrcJsonStorageProvider.js +7 -44
- package/lib/build/buildTaskEngine.js +355 -0
- package/lib/build/buildTaskFactory.js +284 -0
- package/lib/build/buildTaskHandler.js +240 -0
- package/lib/build/buildTaskProvider.js +22 -0
- package/lib/build/buildTaskProviderFactory.js +182 -0
- package/lib/build/constants.js +56 -0
- package/lib/build/index.js +21 -0
- package/lib/build/provider/buildTaskHandlerEdmx.js +83 -0
- package/lib/build/provider/buildTaskHandlerFeatureToggles.js +132 -0
- package/lib/build/provider/buildTaskHandlerInternal.js +228 -0
- package/lib/build/provider/buildTaskProviderInternal.js +370 -0
- package/lib/build/provider/fiori/index.js +167 -0
- package/lib/build/provider/hana/2migration.js +179 -0
- package/lib/build/provider/hana/index.js +522 -0
- package/lib/build/provider/hana/migrationtable.js +472 -0
- package/lib/build/provider/hana/template/.hdiconfig-all +163 -0
- package/lib/build/provider/hana/template/.hdiconfig-cloud +137 -0
- package/lib/build/provider/hana/template/.hdinamespace +4 -0
- package/lib/build/provider/hana/template/package.json +12 -0
- package/lib/build/provider/hana/template/undeploy.json +5 -0
- package/lib/build/provider/java/index.js +93 -0
- package/lib/build/provider/java-cf/index.js +1 -0
- package/lib/build/provider/mtx/index.js +37 -0
- package/lib/build/provider/mtx/resourcesTarBuilder.js +94 -0
- package/lib/build/provider/mtx-extension/index.js +131 -0
- package/lib/build/provider/mtx-sidecar/index.js +138 -0
- package/lib/build/provider/node-cf/index.js +1 -0
- package/lib/build/provider/nodejs/index.js +178 -0
- package/lib/build/util.js +263 -0
- package/lib/cds.js +9 -21
- package/lib/client/auth_manager.js +39 -16
- package/lib/client/helper/dependency_helper.js +7 -6
- package/lib/client/push.js +2 -1
- package/lib/client/settings_manager.js +10 -39
- package/lib/deploy/to-hana/hana.js +273 -0
- package/lib/deploy/to-hana/hdiDeployUtil.js +68 -0
- package/lib/deploy/to-hana/mtaUtil.js +171 -0
- package/lib/import/asyncapi/importAsyncAPI.js +3 -2
- package/lib/import/asyncapi/index.js +5 -2
- package/lib/import/asyncapi/parserContext.js +67 -26
- package/lib/import/asyncapi/utils.js +34 -3
- package/lib/import/common.js +40 -30
- package/lib/import/importapi.js +36 -35
- package/lib/index.js +12 -17
- package/lib/init/constants.js +36 -71
- package/lib/init/index.js +18 -52
- package/lib/init/template/_merging/registry-mta.js +21 -3
- package/lib/init/template/approuter/files/mta.yaml.hbs +29 -29
- package/lib/init/template/approuter/files/values.yaml.hbs +5 -5
- package/lib/init/template/approuter/files/xs-app.json.hbs +8 -2
- package/lib/init/template/approuter/index.js +7 -8
- package/lib/init/template/auditlog/files/mta.yaml.hbs +5 -5
- package/lib/init/template/auditlog/files/package.json.hbs +13 -13
- package/lib/init/template/auditlog/index.js +3 -3
- package/lib/init/template/cf-manifest/files/manifest.yml.hbs +22 -22
- package/lib/init/template/cf-manifest/files/services-manifest.yml.hbs +3 -3
- package/lib/init/template/connectivity/files/mta.yaml.hbs +14 -0
- package/lib/init/template/connectivity/files/package.json.hbs +17 -0
- package/lib/init/template/connectivity/index.js +21 -4
- package/lib/init/template/data/index.js +5 -1
- package/lib/init/template/destination/files/mta.yaml.hbs +14 -0
- package/lib/init/template/destination/files/package.json.hbs +17 -0
- package/lib/init/template/{destinations → destination}/index.js +19 -13
- package/lib/init/template/enterprise-messaging/files/event-mesh.json.hbs +3 -3
- package/lib/init/template/enterprise-messaging/files/mta.yaml.hbs +5 -5
- package/lib/init/template/enterprise-messaging/files/package.json.hbs +9 -9
- package/lib/init/template/enterprise-messaging/files/xs-security.json.hbs +19 -0
- package/lib/init/template/enterprise-messaging/index.js +27 -6
- package/lib/init/template/enterprise-messaging-shared/files/event-mesh.json.hbs +3 -3
- package/lib/init/template/enterprise-messaging-shared/files/mta.yaml.hbs +5 -5
- package/lib/init/template/enterprise-messaging-shared/files/package.json.hbs +9 -9
- package/lib/init/template/enterprise-messaging-shared/index.js +4 -5
- package/lib/init/template/extensibility/files/package.json.hbs +10 -10
- package/lib/init/template/extensibility/index.js +8 -9
- package/lib/init/template/file-based-messaging/files/package.json.hbs +9 -9
- package/lib/init/template/file-based-messaging/index.js +3 -4
- package/lib/init/template/hana/files/db/package.json +1 -1
- package/lib/init/template/hana/files/mta.yaml.hbs +21 -21
- package/lib/init/template/hana/files/package.json.hbs +16 -22
- package/lib/init/template/hana/files/values.yaml.hbs +1 -1
- package/lib/init/template/hana/index.js +5 -15
- package/lib/init/template/helm/files/Chart.yaml.hbs +4 -4
- package/lib/init/template/helm/files/values.yaml.hbs +6 -6
- package/lib/init/template/helm/index.js +5 -10
- package/lib/init/template/helm/subcharts/content-deployment/Chart.yaml +2 -0
- package/lib/init/template/helm/subcharts/content-deployment/templates/_helpers.tpl +37 -31
- package/lib/init/template/helm/subcharts/content-deployment/templates/job.yaml +13 -14
- package/lib/init/template/helm/subcharts/content-deployment/templates/secret.yaml +2 -2
- package/lib/init/template/helm/subcharts/content-deployment/templates/service-account.yaml +1 -1
- package/lib/init/template/helm/subcharts/content-deployment/templates/service-binding.yaml +3 -3
- package/lib/init/template/helm/subcharts/content-deployment/values.md +116 -116
- package/lib/init/template/helm/subcharts/service-instance/Chart.yaml +2 -0
- package/lib/init/template/helm/subcharts/service-instance/templates/_helpers.tpl +9 -9
- package/lib/init/template/helm/subcharts/service-instance/templates/serviceinstance.yaml +2 -2
- package/lib/init/template/helm/subcharts/service-instance/values.md +15 -15
- package/lib/init/template/helm/subcharts/web-application/Chart.yaml +2 -0
- package/lib/init/template/helm/subcharts/web-application/templates/NOTES.txt +15 -0
- package/lib/init/template/helm/subcharts/web-application/templates/_helpers.tpl +23 -23
- 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 +17 -17
- package/lib/init/template/helm/subcharts/web-application/templates/network-policy.yaml +24 -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/secret.yaml +2 -2
- 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 +3 -3
- package/lib/init/template/helm/subcharts/web-application/templates/service.yaml +3 -3
- package/lib/init/template/helm/subcharts/web-application/values.md +141 -123
- package/lib/init/template/helm/subcharts/web-application/values.schema.json +7 -0
- package/lib/init/template/helm/subcharts/web-application/values.yaml +1 -0
- package/lib/init/template/html5-repo/index.js +4 -5
- package/lib/init/template/java/index.js +5 -5
- package/lib/init/template/kibana-logging/files/mta.yaml.hbs +5 -5
- package/lib/init/template/kibana-logging/files/package.json.hbs +9 -9
- package/lib/init/template/kibana-logging/index.js +3 -4
- package/lib/init/template/lint/index.js +3 -3
- package/lib/init/template/mta/files/mta.yaml.hbs +14 -14
- package/lib/init/template/mta/files/package.json +5 -0
- package/lib/init/template/mta/index.js +12 -13
- package/lib/init/template/mtx/index.js +2 -2
- package/lib/init/template/multitenancy/files/mta.yaml.hbs +29 -27
- package/lib/init/template/multitenancy/files/package.json.hbs +17 -14
- package/lib/init/template/multitenancy/files/package.sidecar.json.hbs +7 -7
- package/lib/init/template/multitenancy/files/values.yaml.hbs +19 -19
- package/lib/init/template/multitenancy/index.js +14 -16
- package/lib/init/template/nodejs/files/package.json.hbs +1 -1
- package/lib/init/template/nodejs/index.js +5 -8
- package/lib/init/template/redis-messaging/files/mta.yaml.hbs +5 -5
- package/lib/init/template/redis-messaging/files/package.json.hbs +9 -9
- package/lib/init/template/redis-messaging/index.js +4 -5
- package/lib/init/template/sample/files/app/_i18n/i18n.properties +43 -0
- package/lib/init/template/sample/files/app/_i18n/i18n_de.properties +14 -0
- package/lib/init/template/sample/files/app/admin-books/fiori-service.cds +114 -0
- package/lib/init/template/sample/files/app/admin-books/webapp/Component.js +8 -0
- package/lib/init/template/sample/files/app/admin-books/webapp/i18n/i18n.properties +11 -0
- package/lib/init/template/sample/files/app/admin-books/webapp/manifest.json +129 -0
- package/lib/init/template/sample/files/app/appconfig/fioriSandboxConfig.json +57 -0
- package/lib/init/template/sample/files/app/common.cds +263 -0
- package/lib/init/template/sample/files/app/index.html +30 -0
- package/lib/init/template/sample/files/app/services.cds +5 -0
- package/lib/init/template/sample/files/db/data/sap.capire.bookshop-Authors.csv +5 -0
- package/lib/init/template/sample/files/db/data/sap.capire.bookshop-Books.csv +6 -0
- package/lib/init/template/sample/files/db/data/sap.capire.bookshop-Books_texts.csv +5 -0
- package/lib/init/template/sample/files/db/data/sap.capire.bookshop-Genres.csv +16 -0
- package/lib/init/template/sample/files/db/schema.cds +31 -0
- package/lib/init/template/sample/files/nodejs/admin-service.js +12 -0
- package/lib/init/template/sample/files/nodejs/cat-service.js +26 -0
- package/lib/init/template/sample/files/srv/admin-service.cds +5 -0
- package/lib/init/template/sample/files/srv/cat-service.cds +16 -0
- package/lib/init/template/sample/index.js +24 -0
- package/lib/init/template/sample-tiny/index.js +39 -0
- package/lib/init/template/samples/index.js +5 -56
- package/lib/init/template/sqlite/files/package.json.hbs +13 -13
- package/lib/init/template/sqlite/index.js +2 -2
- package/lib/init/template/templateBase.js +24 -1
- package/lib/init/template/toggles/files/package.json.hbs +10 -10
- package/lib/init/template/toggles/index.js +3 -3
- package/lib/init/template/typer/files/gitignore +1 -0
- package/lib/init/template/typer/files/package.json +8 -0
- package/lib/init/template/typer/files/xsconfig.json +9 -0
- package/lib/init/template/typer/index.js +36 -0
- package/lib/init/template/xsuaa/files/mta.yaml.hbs +12 -12
- package/lib/init/template/xsuaa/files/package.json.hbs +13 -13
- package/lib/init/template/xsuaa/files/values.yaml.hbs +8 -8
- package/lib/init/template/xsuaa/index.js +8 -19
- package/lib/init/util/merge.js +73 -59
- package/lib/init/util/mvn.js +21 -17
- package/lib/init/util/projectReader.js +49 -87
- package/lib/init/util/xml.js +14 -23
- package/lib/util/cfUtil.js +366 -0
- package/lib/util/command.js +3 -3
- package/lib/util/gitUtil.js +55 -0
- package/lib/util/version.js +27 -0
- package/npm-shrinkwrap.json +339 -277
- package/package.json +6 -6
- package/CHANGELOG.md +0 -1453
- package/bin/build/all.js +0 -88
- package/bin/build/index.js +0 -82
- package/lib/compile/index.js +0 -14
- /package/lib/init/template/{samples → sample-tiny}/files/nodejs/db/data/my.bookshop-Books.csv +0 -0
- /package/lib/init/template/{samples → sample-tiny}/files/nodejs/db/data-model.cds +0 -0
- /package/lib/init/template/{samples → sample-tiny}/files/nodejs/srv/cat-service.cds.hbs +0 -0
|
@@ -0,0 +1,263 @@
|
|
|
1
|
+
/*
|
|
2
|
+
Common Annotations shared by all apps
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
using { sap.capire.bookshop as my } from '../db/schema';
|
|
6
|
+
using { sap.common, sap.common.Currencies } from '@sap/cds/common';
|
|
7
|
+
|
|
8
|
+
////////////////////////////////////////////////////////////////////////////
|
|
9
|
+
//
|
|
10
|
+
// Books Lists
|
|
11
|
+
//
|
|
12
|
+
annotate my.Books with @(
|
|
13
|
+
Common.SemanticKey : [ID],
|
|
14
|
+
UI : {
|
|
15
|
+
Identification : [{ Value: title }],
|
|
16
|
+
SelectionFields : [
|
|
17
|
+
ID,
|
|
18
|
+
author_ID,
|
|
19
|
+
price,
|
|
20
|
+
currency_code
|
|
21
|
+
],
|
|
22
|
+
LineItem : [
|
|
23
|
+
{ Value: ID, Label: '{i18n>Title}' },
|
|
24
|
+
{ Value: author.ID, Label: '{i18n>Author}' },
|
|
25
|
+
{ Value: genre.name },
|
|
26
|
+
{ Value: stock },
|
|
27
|
+
{ Value: price },
|
|
28
|
+
{ Value: currency.symbol },
|
|
29
|
+
]
|
|
30
|
+
}
|
|
31
|
+
) {
|
|
32
|
+
ID @Common: {
|
|
33
|
+
SemanticObject : 'Books',
|
|
34
|
+
Text: title,
|
|
35
|
+
TextArrangement : #TextOnly
|
|
36
|
+
};
|
|
37
|
+
author @ValueList.entity : 'Authors';
|
|
38
|
+
};
|
|
39
|
+
|
|
40
|
+
annotate Currencies with {
|
|
41
|
+
symbol @Common.Label : '{i18n>Currency}';
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
////////////////////////////////////////////////////////////////////////////
|
|
45
|
+
//
|
|
46
|
+
// Books Details
|
|
47
|
+
//
|
|
48
|
+
annotate my.Books with @(UI : {HeaderInfo : {
|
|
49
|
+
TypeName : '{i18n>Book}',
|
|
50
|
+
TypeNamePlural : '{i18n>Books}',
|
|
51
|
+
Title : { Value: title },
|
|
52
|
+
Description : { Value: author.name }
|
|
53
|
+
}, });
|
|
54
|
+
|
|
55
|
+
|
|
56
|
+
////////////////////////////////////////////////////////////////////////////
|
|
57
|
+
//
|
|
58
|
+
// Books Elements
|
|
59
|
+
//
|
|
60
|
+
annotate my.Books with {
|
|
61
|
+
ID @title: '{i18n>ID}';
|
|
62
|
+
title @title: '{i18n>Title}';
|
|
63
|
+
genre @title: '{i18n>Genre}' @Common: { Text: genre.name, TextArrangement: #TextOnly };
|
|
64
|
+
author @title: '{i18n>Author}' @Common: { Text: author.name, TextArrangement: #TextOnly };
|
|
65
|
+
price @title: '{i18n>Price}' @Measures.ISOCurrency : currency_code;
|
|
66
|
+
stock @title: '{i18n>Stock}';
|
|
67
|
+
descr @title: '{i18n>Description}' @UI.MultiLineText;
|
|
68
|
+
image @title: '{i18n>Image}';
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
////////////////////////////////////////////////////////////////////////////
|
|
72
|
+
//
|
|
73
|
+
// Genres List
|
|
74
|
+
//
|
|
75
|
+
annotate my.Genres with @(
|
|
76
|
+
Common.SemanticKey : [name],
|
|
77
|
+
UI : {
|
|
78
|
+
SelectionFields : [name],
|
|
79
|
+
LineItem : [
|
|
80
|
+
{ Value: name },
|
|
81
|
+
{
|
|
82
|
+
Value : parent.name,
|
|
83
|
+
Label: 'Main Genre'
|
|
84
|
+
},
|
|
85
|
+
],
|
|
86
|
+
}
|
|
87
|
+
);
|
|
88
|
+
|
|
89
|
+
annotate my.Genres with {
|
|
90
|
+
ID @Common.Text : name @Common.TextArrangement : #TextOnly;
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
////////////////////////////////////////////////////////////////////////////
|
|
94
|
+
//
|
|
95
|
+
// Genre Details
|
|
96
|
+
//
|
|
97
|
+
annotate my.Genres with @(UI : {
|
|
98
|
+
Identification : [{ Value: name}],
|
|
99
|
+
HeaderInfo : {
|
|
100
|
+
TypeName : '{i18n>Genre}',
|
|
101
|
+
TypeNamePlural : '{i18n>Genres}',
|
|
102
|
+
Title : { Value: name },
|
|
103
|
+
Description : { Value: ID }
|
|
104
|
+
},
|
|
105
|
+
Facets : [{
|
|
106
|
+
$Type : 'UI.ReferenceFacet',
|
|
107
|
+
Label : '{i18n>SubGenres}',
|
|
108
|
+
Target : 'children/@UI.LineItem'
|
|
109
|
+
}, ],
|
|
110
|
+
});
|
|
111
|
+
|
|
112
|
+
////////////////////////////////////////////////////////////////////////////
|
|
113
|
+
//
|
|
114
|
+
// Genres Elements
|
|
115
|
+
//
|
|
116
|
+
annotate my.Genres with {
|
|
117
|
+
ID @title: '{i18n>ID}';
|
|
118
|
+
name @title: '{i18n>Genre}';
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
////////////////////////////////////////////////////////////////////////////
|
|
122
|
+
//
|
|
123
|
+
// Authors List
|
|
124
|
+
//
|
|
125
|
+
annotate my.Authors with @(
|
|
126
|
+
Common.SemanticKey : [ID],
|
|
127
|
+
UI : {
|
|
128
|
+
Identification : [{ Value: name}],
|
|
129
|
+
SelectionFields : [name],
|
|
130
|
+
LineItem : [
|
|
131
|
+
{ Value: ID },
|
|
132
|
+
{ Value: dateOfBirth },
|
|
133
|
+
{ Value: dateOfDeath },
|
|
134
|
+
{ Value: placeOfBirth },
|
|
135
|
+
{ Value: placeOfDeath },
|
|
136
|
+
],
|
|
137
|
+
}
|
|
138
|
+
) {
|
|
139
|
+
ID @Common: {
|
|
140
|
+
SemanticObject : 'Authors',
|
|
141
|
+
Text: name,
|
|
142
|
+
TextArrangement : #TextOnly,
|
|
143
|
+
};
|
|
144
|
+
};
|
|
145
|
+
|
|
146
|
+
////////////////////////////////////////////////////////////////////////////
|
|
147
|
+
//
|
|
148
|
+
// Author Details
|
|
149
|
+
//
|
|
150
|
+
annotate my.Authors with @(UI : {
|
|
151
|
+
HeaderInfo : {
|
|
152
|
+
TypeName : '{i18n>Author}',
|
|
153
|
+
TypeNamePlural : '{i18n>Authors}',
|
|
154
|
+
Title : { Value: name },
|
|
155
|
+
Description : { Value: dateOfBirth }
|
|
156
|
+
},
|
|
157
|
+
Facets : [{
|
|
158
|
+
$Type : 'UI.ReferenceFacet',
|
|
159
|
+
Target : 'books/@UI.LineItem'
|
|
160
|
+
}, ],
|
|
161
|
+
});
|
|
162
|
+
|
|
163
|
+
|
|
164
|
+
////////////////////////////////////////////////////////////////////////////
|
|
165
|
+
//
|
|
166
|
+
// Authors Elements
|
|
167
|
+
//
|
|
168
|
+
annotate my.Authors with {
|
|
169
|
+
ID @title: '{i18n>ID}';
|
|
170
|
+
name @title: '{i18n>Name}';
|
|
171
|
+
dateOfBirth @title: '{i18n>DateOfBirth}';
|
|
172
|
+
dateOfDeath @title: '{i18n>DateOfDeath}';
|
|
173
|
+
placeOfBirth @title: '{i18n>PlaceOfBirth}';
|
|
174
|
+
placeOfDeath @title: '{i18n>PlaceOfDeath}';
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
////////////////////////////////////////////////////////////////////////////
|
|
178
|
+
//
|
|
179
|
+
// Languages List
|
|
180
|
+
//
|
|
181
|
+
annotate common.Languages with @(
|
|
182
|
+
Common.SemanticKey : [code],
|
|
183
|
+
Identification : [{ Value: code}],
|
|
184
|
+
UI : {
|
|
185
|
+
SelectionFields : [
|
|
186
|
+
name,
|
|
187
|
+
descr
|
|
188
|
+
],
|
|
189
|
+
LineItem : [
|
|
190
|
+
{ Value: code },
|
|
191
|
+
{ Value: name },
|
|
192
|
+
],
|
|
193
|
+
}
|
|
194
|
+
);
|
|
195
|
+
|
|
196
|
+
////////////////////////////////////////////////////////////////////////////
|
|
197
|
+
//
|
|
198
|
+
// Language Details
|
|
199
|
+
//
|
|
200
|
+
annotate common.Languages with @(UI : {
|
|
201
|
+
HeaderInfo : {
|
|
202
|
+
TypeName : '{i18n>Language}',
|
|
203
|
+
TypeNamePlural : '{i18n>Languages}',
|
|
204
|
+
Title : { Value: name },
|
|
205
|
+
Description : { Value: descr }
|
|
206
|
+
},
|
|
207
|
+
Facets : [{
|
|
208
|
+
$Type : 'UI.ReferenceFacet',
|
|
209
|
+
Label : '{i18n>Details}',
|
|
210
|
+
Target : '@UI.FieldGroup#Details'
|
|
211
|
+
}, ],
|
|
212
|
+
FieldGroup #Details : {Data : [
|
|
213
|
+
{ Value: code },
|
|
214
|
+
{ Value: name },
|
|
215
|
+
{ Value: descr }
|
|
216
|
+
]},
|
|
217
|
+
});
|
|
218
|
+
|
|
219
|
+
////////////////////////////////////////////////////////////////////////////
|
|
220
|
+
//
|
|
221
|
+
// Currencies List
|
|
222
|
+
//
|
|
223
|
+
annotate common.Currencies with @(
|
|
224
|
+
Common.SemanticKey : [code],
|
|
225
|
+
Identification : [{ Value: code}],
|
|
226
|
+
UI : {
|
|
227
|
+
SelectionFields : [
|
|
228
|
+
name,
|
|
229
|
+
descr
|
|
230
|
+
],
|
|
231
|
+
LineItem : [
|
|
232
|
+
{ Value: descr },
|
|
233
|
+
{ Value: symbol },
|
|
234
|
+
{ Value: code },
|
|
235
|
+
],
|
|
236
|
+
}
|
|
237
|
+
);
|
|
238
|
+
|
|
239
|
+
////////////////////////////////////////////////////////////////////////////
|
|
240
|
+
//
|
|
241
|
+
// Currency Details
|
|
242
|
+
//
|
|
243
|
+
annotate common.Currencies with @(UI : {
|
|
244
|
+
HeaderInfo : {
|
|
245
|
+
TypeName : '{i18n>Currency}',
|
|
246
|
+
TypeNamePlural : '{i18n>Currencies}',
|
|
247
|
+
Title : { Value: descr },
|
|
248
|
+
Description : { Value: code }
|
|
249
|
+
},
|
|
250
|
+
Facets : [
|
|
251
|
+
{
|
|
252
|
+
$Type : 'UI.ReferenceFacet',
|
|
253
|
+
Label : '{i18n>Details}',
|
|
254
|
+
Target : '@UI.FieldGroup#Details'
|
|
255
|
+
}
|
|
256
|
+
],
|
|
257
|
+
FieldGroup #Details : {Data : [
|
|
258
|
+
{ Value: name },
|
|
259
|
+
{ Value: symbol },
|
|
260
|
+
{ Value: code },
|
|
261
|
+
{ Value: descr }
|
|
262
|
+
]}
|
|
263
|
+
});
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
<!DOCTYPE html>
|
|
2
|
+
<html>
|
|
3
|
+
<head>
|
|
4
|
+
|
|
5
|
+
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
|
|
6
|
+
<meta http-equiv="Content-Type" content="text/html;charset=UTF-8" />
|
|
7
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
8
|
+
<title>Bookshop</title>
|
|
9
|
+
|
|
10
|
+
<script>
|
|
11
|
+
window["sap-ushell-config"] = {
|
|
12
|
+
defaultRenderer: "fiori2",
|
|
13
|
+
applications: {}
|
|
14
|
+
};
|
|
15
|
+
</script>
|
|
16
|
+
|
|
17
|
+
<script id="sap-ushell-bootstrap" src="https://sapui5.hana.ondemand.com/test-resources/sap/ushell/bootstrap/sandbox.js"></script>
|
|
18
|
+
<script id="sap-ui-bootstrap" src="https://sapui5.hana.ondemand.com/resources/sap-ui-core.js"
|
|
19
|
+
data-sap-ui-libs="sap.m, sap.ushell, sap.collaboration, sap.ui.layout"
|
|
20
|
+
data-sap-ui-compatVersion="edge"
|
|
21
|
+
data-sap-ui-theme="sap_horizon"
|
|
22
|
+
data-sap-ui-frameOptions="allow"
|
|
23
|
+
></script>
|
|
24
|
+
<script>
|
|
25
|
+
sap.ui.getCore().attachInit(()=> sap.ushell.Container.createRenderer().placeAt("content"))
|
|
26
|
+
</script>
|
|
27
|
+
|
|
28
|
+
</head>
|
|
29
|
+
<body class="sapUiBody" id="content"></body>
|
|
30
|
+
</html>
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
ID;name;dateOfBirth;placeOfBirth;dateOfDeath;placeOfDeath
|
|
2
|
+
101;Emily Brontë;1818-07-30;Thornton, Yorkshire;1848-12-19;Haworth, Yorkshire
|
|
3
|
+
107;Charlotte Brontë;1818-04-21;Thornton, Yorkshire;1855-03-31;Haworth, Yorkshire
|
|
4
|
+
150;Edgar Allen Poe;1809-01-19;Boston, Massachusetts;1849-10-07;Baltimore, Maryland
|
|
5
|
+
170;Richard Carpenter;1929-08-14;King’s Lynn, Norfolk;2012-02-26;Hertfordshire, England
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
ID;title;descr;author_ID;stock;price;currency_code;genre_ID
|
|
2
|
+
201;Wuthering Heights;"Wuthering Heights, Emily Brontë's only novel, was published in 1847 under the pseudonym ""Ellis Bell"". It was written between October 1845 and June 1846. Wuthering Heights and Anne Brontë's Agnes Grey were accepted by publisher Thomas Newby before the success of their sister Charlotte's novel Jane Eyre. After Emily's death, Charlotte edited the manuscript of Wuthering Heights and arranged for the edited version to be published as a posthumous second edition in 1850.";101;12;11.11;GBP;11
|
|
3
|
+
207;Jane Eyre;"Jane Eyre /ɛər/ (originally published as Jane Eyre: An Autobiography) is a novel by English writer Charlotte Brontë, published under the pen name ""Currer Bell"", on 16 October 1847, by Smith, Elder & Co. of London. The first American edition was published the following year by Harper & Brothers of New York. Primarily a bildungsroman, Jane Eyre follows the experiences of its eponymous heroine, including her growth to adulthood and her love for Mr. Rochester, the brooding master of Thornfield Hall. The novel revolutionised prose fiction in that the focus on Jane's moral and spiritual development is told through an intimate, first-person narrative, where actions and events are coloured by a psychological intensity. The book contains elements of social criticism, with a strong sense of Christian morality at its core and is considered by many to be ahead of its time because of Jane's individualistic character and how the novel approaches the topics of class, sexuality, religion and feminism.";107;11;12.34;GBP;11
|
|
4
|
+
251;The Raven;"""The Raven"" is a narrative poem by American writer Edgar Allan Poe. First published in January 1845, the poem is often noted for its musicality, stylized language, and supernatural atmosphere. It tells of a talking raven's mysterious visit to a distraught lover, tracing the man's slow fall into madness. The lover, often identified as being a student, is lamenting the loss of his love, Lenore. Sitting on a bust of Pallas, the raven seems to further distress the protagonist with its constant repetition of the word ""Nevermore"". The poem makes use of folk, mythological, religious, and classical references.";150;333;13.13;USD;16
|
|
5
|
+
252;Eleonora;"""Eleonora"" is a short story by Edgar Allan Poe, first published in 1842 in Philadelphia in the literary annual The Gift. It is often regarded as somewhat autobiographical and has a relatively ""happy"" ending.";150;555;14;USD;16
|
|
6
|
+
271;Catweazle;Catweazle is a British fantasy television series, starring Geoffrey Bayldon in the title role, and created by Richard Carpenter for London Weekend Television. The first series, produced and directed by Quentin Lawrence, was screened in the UK on ITV in 1970. The second series, directed by David Reid and David Lane, was shown in 1971. Each series had thirteen episodes, most but not all written by Carpenter, who also published two books based on the scripts.;170;22;150;JPY;13
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
ID_texts;ID;locale;title;descr
|
|
2
|
+
52eee553-266d-4fdd-a5ca-909910e76ae4;201;de;Sturmhöhe;Sturmhöhe (Originaltitel: Wuthering Heights) ist der einzige Roman der englischen Schriftstellerin Emily Brontë (1818–1848). Der 1847 unter dem Pseudonym Ellis Bell veröffentlichte Roman wurde vom viktorianischen Publikum weitgehend abgelehnt, heute gilt er als ein Klassiker der britischen Romanliteratur des 19. Jahrhunderts.
|
|
3
|
+
54e58142-f06e-49c1-a51d-138f86cea34e;201;fr;Les Hauts de Hurlevent;Les Hauts de Hurlevent (titre original : Wuthering Heights), parfois orthographié Les Hauts de Hurle-Vent, est l'unique roman d'Emily Brontë, publié pour la première fois en 1847 sous le pseudonyme d’Ellis Bell. Loin d'être un récit moralisateur, Emily Brontë achève néanmoins le roman dans une atmosphère sereine, suggérant le triomphe de la paix et du Bien sur la vengeance et le Mal.
|
|
4
|
+
bbbf8a88-797d-4790-af1c-1cc857718ee0;207;de;Jane Eyre;Jane Eyre. Eine Autobiographie (Originaltitel: Jane Eyre. An Autobiography), erstmals erschienen im Jahr 1847 unter dem Pseudonym Currer Bell, ist der erste veröffentlichte Roman der britischen Autorin Charlotte Brontë und ein Klassiker der viktorianischen Romanliteratur des 19. Jahrhunderts. Der Roman erzählt in Form einer Ich-Erzählung die Lebensgeschichte von Jane Eyre (ausgesprochen /ˌdʒeɪn ˈɛə/), die nach einer schweren Kindheit eine Stelle als Gouvernante annimmt und sich in ihren Arbeitgeber verliebt, jedoch immer wieder um ihre Freiheit und Selbstbestimmung kämpfen muss. Als klein, dünn, blass, stets schlicht dunkel gekleidet und mit strengem Mittelscheitel beschrieben, gilt die Heldin des Romans Jane Eyre nicht zuletzt aufgrund der Kino- und Fernsehversionen der melodramatischen Romanvorlage als die bekannteste englische Gouvernante der Literaturgeschichte
|
|
5
|
+
a90d4378-1a3e-48e7-b60b-5670e78807e1;252;de;Eleonora;“Eleonora” ist eine Erzählung von Edgar Allan Poe. Sie wurde 1841 erstveröffentlicht. In ihr geht es um das Paradox der Treue in der Treulosigkeit.
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
ID;parent_ID;name
|
|
2
|
+
10;;Fiction
|
|
3
|
+
11;10;Drama
|
|
4
|
+
12;10;Poetry
|
|
5
|
+
13;10;Fantasy
|
|
6
|
+
14;10;Science Fiction
|
|
7
|
+
15;10;Romance
|
|
8
|
+
16;10;Mystery
|
|
9
|
+
17;10;Thriller
|
|
10
|
+
18;10;Dystopia
|
|
11
|
+
19;10;Fairy Tale
|
|
12
|
+
20;;Non-Fiction
|
|
13
|
+
21;20;Biography
|
|
14
|
+
22;21;Autobiography
|
|
15
|
+
23;20;Essay
|
|
16
|
+
24;20;Speech
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
using { Currency, managed, sap } from '@sap/cds/common';
|
|
2
|
+
namespace sap.capire.bookshop;
|
|
3
|
+
|
|
4
|
+
entity Books : managed {
|
|
5
|
+
key ID : Integer;
|
|
6
|
+
@mandatory title : localized String(111);
|
|
7
|
+
descr : localized String(1111);
|
|
8
|
+
@mandatory author : Association to Authors;
|
|
9
|
+
genre : Association to Genres;
|
|
10
|
+
stock : Integer;
|
|
11
|
+
price : Decimal;
|
|
12
|
+
currency : Currency;
|
|
13
|
+
image : LargeBinary @Core.MediaType : 'image/png';
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
entity Authors : managed {
|
|
17
|
+
key ID : Integer;
|
|
18
|
+
@mandatory name : String(111);
|
|
19
|
+
dateOfBirth : Date;
|
|
20
|
+
dateOfDeath : Date;
|
|
21
|
+
placeOfBirth : String;
|
|
22
|
+
placeOfDeath : String;
|
|
23
|
+
books : Association to many Books on books.author = $self;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
/** Hierarchically organized Code List for Genres */
|
|
27
|
+
entity Genres : sap.common.CodeList {
|
|
28
|
+
key ID : Integer;
|
|
29
|
+
parent : Association to Genres;
|
|
30
|
+
children : Composition of many Genres on children.parent = $self;
|
|
31
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
const cds = require('@sap/cds/lib')
|
|
2
|
+
|
|
3
|
+
module.exports = class AdminService extends cds.ApplicationService { init(){
|
|
4
|
+
this.before ('NEW','Books.drafts', genid)
|
|
5
|
+
return super.init()
|
|
6
|
+
}}
|
|
7
|
+
|
|
8
|
+
/** Generate primary keys for target entity in request */
|
|
9
|
+
async function genid (req) {
|
|
10
|
+
const {ID} = await cds.tx(req).run (SELECT.one.from(req.target.actives).columns('max(ID) as ID'))
|
|
11
|
+
req.data.ID = ID - ID % 100 + 100 + 1
|
|
12
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
const cds = require('@sap/cds')
|
|
2
|
+
const { Books } = cds.entities ('sap.capire.bookshop')
|
|
3
|
+
|
|
4
|
+
class CatalogService extends cds.ApplicationService { init(){
|
|
5
|
+
|
|
6
|
+
// Reduce stock of ordered books if available stock suffices
|
|
7
|
+
this.on ('submitOrder', async req => {
|
|
8
|
+
const {book,quantity} = req.data
|
|
9
|
+
let {stock} = await SELECT `stock` .from (Books,book)
|
|
10
|
+
if (stock >= quantity) {
|
|
11
|
+
await UPDATE (Books,book) .with (`stock -=`, quantity)
|
|
12
|
+
await this.emit ('OrderedBook', { book, quantity, buyer:req.user.id })
|
|
13
|
+
return { stock }
|
|
14
|
+
}
|
|
15
|
+
else return req.error (409,`${quantity} exceeds stock for book #${book}`)
|
|
16
|
+
})
|
|
17
|
+
|
|
18
|
+
// Add some discount for overstocked books
|
|
19
|
+
this.after ('READ','ListOfBooks', each => {
|
|
20
|
+
if (each.stock > 111) each.title += ` -- 11% discount!`
|
|
21
|
+
})
|
|
22
|
+
|
|
23
|
+
return super.init()
|
|
24
|
+
}}
|
|
25
|
+
|
|
26
|
+
module.exports = { CatalogService }
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
using { sap.capire.bookshop as my } from '../db/schema';
|
|
2
|
+
service CatalogService @(path:'/browse') {
|
|
3
|
+
|
|
4
|
+
/** For displaying lists of Books */
|
|
5
|
+
@readonly entity ListOfBooks as projection on Books
|
|
6
|
+
excluding { descr };
|
|
7
|
+
|
|
8
|
+
/** For display in details pages */
|
|
9
|
+
@readonly entity Books as projection on my.Books { *,
|
|
10
|
+
author.name as author
|
|
11
|
+
} excluding { createdBy, modifiedBy };
|
|
12
|
+
|
|
13
|
+
@requires: 'authenticated-user'
|
|
14
|
+
action submitOrder ( book: Books:ID, quantity: Integer ) returns { stock: Integer };
|
|
15
|
+
event OrderedBook : { book: Books:ID; quantity: Integer; buyer: String };
|
|
16
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
const { join } = require('path')
|
|
2
|
+
const cds = require('../../../cds'), { exists } = cds.utils
|
|
3
|
+
const { readProject } = require('../../util/projectReader')
|
|
4
|
+
const { copyFiles } = require('../../util/template')
|
|
5
|
+
|
|
6
|
+
module.exports = class SampleTemplate extends require('../templateBase') {
|
|
7
|
+
|
|
8
|
+
async canRun() {
|
|
9
|
+
const { isJava } = await readProject(this.options)
|
|
10
|
+
if (isJava) throw `'cds add sample' is not available for Java yet`
|
|
11
|
+
return true
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
async run() {
|
|
15
|
+
const { db, srv, app } = (await this.getEnv()).folders
|
|
16
|
+
const language = exists('pom.xml') ? 'java' : 'nodejs'
|
|
17
|
+
await Promise.all([
|
|
18
|
+
copyFiles(join(__dirname, 'files', 'db'), db, {}, this.options.force),
|
|
19
|
+
copyFiles(join(__dirname, 'files', 'app'), app, {}, this.options.force),
|
|
20
|
+
copyFiles(join(__dirname, 'files', 'srv'), srv, {}, this.options.force),
|
|
21
|
+
copyFiles(join(__dirname, 'files', language), srv, {}, this.options.force)
|
|
22
|
+
])
|
|
23
|
+
}
|
|
24
|
+
}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
const { join } = require('path')
|
|
2
|
+
const cds = require('../../../cds')
|
|
3
|
+
const { copyFiles } = require('../../util/template')
|
|
4
|
+
const commandUtil = require('../../../util/command')
|
|
5
|
+
const mvnArchetypes = require('../../util/mvn')
|
|
6
|
+
const term = require('../../../util/term')
|
|
7
|
+
const { PROJECT_TYPE: { java, nodejs }, OPTIONS: { JAVA }, URLS } = require('../../constants')
|
|
8
|
+
|
|
9
|
+
module.exports = class SampleTinyTemplate extends require('../templateBase') {
|
|
10
|
+
|
|
11
|
+
async run() {
|
|
12
|
+
switch (this.getProjectType()) {
|
|
13
|
+
case java: return this._addJavaSamples()
|
|
14
|
+
case nodejs: return this._addNodejsSamples()
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
async _addJavaSamples() {
|
|
19
|
+
if (!this.options.add.has(JAVA)) {
|
|
20
|
+
const mvnAddSamplesArgs = mvnArchetypes.getAddSamplesCmdArgs(this.options)
|
|
21
|
+
try {
|
|
22
|
+
await commandUtil.spawnCommand('mvn', mvnAddSamplesArgs, { cwd: cds.root })
|
|
23
|
+
const mvnAddTestsArgs = mvnArchetypes.getAddTestsCmdArgs(this.options)
|
|
24
|
+
await commandUtil.spawnCommand('mvn', mvnAddTestsArgs, { cwd: cds.root })
|
|
25
|
+
} catch (err) {
|
|
26
|
+
if (err.code === 'ENOENT' && err.path === 'mvn') {
|
|
27
|
+
throw new Error(`Maven executable 'mvn' not found, follow ${term.info(URLS.MAVEN_INSTALL_HELP)} and install Maven on your machine.`)
|
|
28
|
+
}
|
|
29
|
+
throw err
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
async _addNodejsSamples() {
|
|
35
|
+
const { db, srv } = (await this.getEnv()).folders
|
|
36
|
+
await copyFiles(join(__dirname, 'files', 'nodejs', 'db'), db, {}, this.options.force)
|
|
37
|
+
await copyFiles(join(__dirname, 'files', 'nodejs', 'srv'), srv, { dbFolder: db.replace(/[\\/]+$/, '') }, this.options.force)
|
|
38
|
+
}
|
|
39
|
+
}
|
|
@@ -1,60 +1,9 @@
|
|
|
1
|
-
const
|
|
2
|
-
const
|
|
3
|
-
const { copyFiles } = require('../../util/template')
|
|
4
|
-
const commandUtil = require('../../../util/command');
|
|
5
|
-
const mvnArchetypes = require('../../util/mvn');
|
|
6
|
-
const term = require('../../../util/term');
|
|
7
|
-
const { PROJECT_TYPE, OPTION_JAVA, URLS } = require('../../constants');
|
|
1
|
+
const term = require('../../../util/term')
|
|
2
|
+
const { SAMPLE_TINY } = require('../../constants').OPTIONS
|
|
8
3
|
|
|
9
4
|
module.exports = class SamplesTemplate extends require('../templateBase') {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
switch (this.getProjectType()) {
|
|
14
|
-
case PROJECT_TYPE.java:
|
|
15
|
-
return await this._addJavaSamples();
|
|
16
|
-
|
|
17
|
-
case PROJECT_TYPE.nodejs:
|
|
18
|
-
return await this._addNodejsSamples();
|
|
19
|
-
|
|
20
|
-
case PROJECT_TYPE.unknown:
|
|
21
|
-
default:
|
|
22
|
-
// issue warning?
|
|
23
|
-
}
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
async _addJavaSamples() {
|
|
27
|
-
// only execute if not add via cds init --add java, otherwise samples would be added twice
|
|
28
|
-
// do not check in canRun since log output "> adding samples" wouldn't appear
|
|
29
|
-
if (!this.options.add.has(OPTION_JAVA)) {
|
|
30
|
-
// keep sequence since plugin needs samples to generate test classes
|
|
31
|
-
const mvnAddSamplesArgs = mvnArchetypes.getAddSamplesCmdArgs(this.options);
|
|
32
|
-
try {
|
|
33
|
-
await commandUtil.spawnCommand('mvn', mvnAddSamplesArgs, {
|
|
34
|
-
cwd: cds.root
|
|
35
|
-
});
|
|
36
|
-
|
|
37
|
-
const mvnAddTestsArgs = mvnArchetypes.getAddTestsCmdArgs(this.options);
|
|
38
|
-
await commandUtil.spawnCommand('mvn', mvnAddTestsArgs, {
|
|
39
|
-
cwd: cds.root
|
|
40
|
-
});
|
|
41
|
-
} catch (err) {
|
|
42
|
-
if (err.code === 'ENOENT' && err.path === 'mvn') {
|
|
43
|
-
throw new Error(`Maven executable 'mvn' not found, follow ${term.info(URLS.MAVEN_INSTALL_HELP)} and install Maven on your machine.`);
|
|
44
|
-
}
|
|
45
|
-
throw err;
|
|
46
|
-
}
|
|
47
|
-
}
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
async _addNodejsSamples() {
|
|
51
|
-
const { db, srv } = (await this.getEnv()).folders;
|
|
52
|
-
const dbFolder = join(cds.root, db);
|
|
53
|
-
await copyFiles(join(__dirname, 'files', 'nodejs', 'db'), dbFolder, {}, this.options.force);
|
|
54
|
-
|
|
55
|
-
const srvFolder = join(cds.root, srv);
|
|
56
|
-
await copyFiles(join(__dirname, 'files', 'nodejs', 'srv'), srvFolder, {
|
|
57
|
-
dbFolder: db.replace(/[\\/]+$/, '')
|
|
58
|
-
}, this.options.force);
|
|
5
|
+
getDependencies() {
|
|
6
|
+
console.warn(term.warn(`'cds add samples' is deprecated and will be removed in future versions. Please use 'cds add sample-tiny' instead.\n`))
|
|
7
|
+
return [SAMPLE_TINY]
|
|
59
8
|
}
|
|
60
9
|
}
|
|
@@ -1,27 +1,27 @@
|
|
|
1
1
|
{
|
|
2
|
-
{{#
|
|
2
|
+
{{#isNodejs}}
|
|
3
3
|
"devDependencies": {
|
|
4
4
|
"sqlite3": "^5"
|
|
5
5
|
},
|
|
6
6
|
"cds": {
|
|
7
|
-
{{/
|
|
7
|
+
{{/isNodejs}}
|
|
8
8
|
"requires": {
|
|
9
|
-
{{#
|
|
10
|
-
"[{{
|
|
11
|
-
{{/
|
|
12
|
-
{{#
|
|
9
|
+
{{#profile}}
|
|
10
|
+
"[{{profile}}]": {
|
|
11
|
+
{{/profile}}
|
|
12
|
+
{{#shortcut}}
|
|
13
13
|
"db": "sqlite"
|
|
14
|
-
{{/
|
|
15
|
-
{{^
|
|
14
|
+
{{/shortcut}}
|
|
15
|
+
{{^shortcut}}
|
|
16
16
|
"db": {
|
|
17
17
|
"kind": "sqlite"
|
|
18
18
|
}
|
|
19
|
-
{{/
|
|
20
|
-
{{#
|
|
19
|
+
{{/shortcut}}
|
|
20
|
+
{{#profile}}
|
|
21
21
|
}
|
|
22
|
-
{{/
|
|
22
|
+
{{/profile}}
|
|
23
23
|
}
|
|
24
|
-
{{#
|
|
24
|
+
{{#isNodejs}}
|
|
25
25
|
}
|
|
26
|
-
{{/
|
|
26
|
+
{{/isNodejs}}
|
|
27
27
|
}
|
|
@@ -8,8 +8,8 @@ module.exports = class SQLiteTemplate extends require('../templateBase') {
|
|
|
8
8
|
|
|
9
9
|
async run() {
|
|
10
10
|
const projectDescriptor = await readProject(this.options)
|
|
11
|
-
const { configFile } = projectDescriptor
|
|
12
|
-
projectDescriptor.
|
|
11
|
+
const { configFile } = projectDescriptor
|
|
12
|
+
projectDescriptor.shortcut = !(await read(configFile)).cds?.requires?.db?.kind
|
|
13
13
|
await mergeJSON(configFile, join(__dirname, 'files', `package.json.hbs`), projectDescriptor)
|
|
14
14
|
}
|
|
15
15
|
}
|