@sap/cds-dk 9.4.3 → 9.5.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/CHANGELOG.md +77 -0
- package/bin/compile/index.js +1 -1
- package/bin/export.js +1 -1
- package/bin/help.js +0 -1
- package/bin/import.js +8 -3
- package/bin/repl.js +7 -11
- package/bin/up.js +150 -20
- package/bin/util/containerize.js +66 -25
- package/bin/version.js +4 -4
- package/lib/bind/k8s.js +1 -1
- package/lib/build/plugins/helm/files/templates/_deployment_helpers.tpl +1 -1
- package/lib/build/plugins/helm/index.js +1 -1
- package/lib/build/provider/hana/2migration.js +16 -24
- package/lib/build/provider/hana/index.js +1 -1
- package/lib/build/provider/hana/template/.hdiconfig-all +7 -1
- package/lib/build/provider/hana/template/package.json +1 -1
- package/lib/build/provider/internalBuildPlugin.js +15 -1
- package/lib/build/provider/java/index.js +12 -1
- package/lib/build/provider/mtx-sidecar/index.js +2 -1
- package/lib/build/provider/nodejs/index.js +2 -1
- package/lib/build/util.js +3 -3
- package/lib/compile/to_openapi.js +1 -5
- package/lib/import/common.js +2 -1
- package/lib/import/odata/ParserContext.js +1 -0
- package/lib/import/odata/v4parser.js +48 -3
- package/lib/import/openapi/importOpenAPI.js +6 -1
- package/lib/init/constants.js +1 -1
- package/lib/init/index.js +15 -6
- package/lib/init/merge.js +16 -0
- package/lib/init/projectReader.js +19 -4
- package/lib/init/registries/mta.js +2 -2
- package/lib/init/template/ams/index.js +1 -1
- package/lib/init/template/app-frontend/files/app-package.json.hbs +1 -7
- package/lib/init/template/app-frontend/files/ui5.yaml.hbs +20 -1
- package/lib/init/template/app-frontend/index.js +0 -4
- package/lib/init/template/application-logging/index.js +9 -14
- package/lib/init/template/approuter/files/mta.yaml.hbs +0 -2
- package/lib/init/template/approuter/index.js +6 -7
- package/lib/init/template/cloud-logging/index.js +2 -3
- package/lib/init/template/containerize/files/containerize.yaml.hbs +17 -2
- package/lib/init/template/containerize/index.js +0 -4
- package/lib/init/template/data/as-json.js +18 -20
- package/lib/init/template/dynatrace/index.js +0 -2
- package/lib/init/template/github-actions/files/workflows/cf.yaml.hbs +16 -1
- package/lib/init/template/github-actions/files/workflows/test.yaml.hbs +20 -0
- package/lib/init/template/github-actions/index.js +5 -8
- package/lib/init/template/hana/files/db/package.json +2 -2
- package/lib/init/template/hana/files/mta.yaml.hbs +0 -4
- package/lib/init/template/hana/index.js +3 -5
- package/lib/init/template/helm/index.js +2 -7
- package/lib/init/template/helm-unified-runtime/index.js +0 -4
- package/lib/init/template/html5-repo/files/app-package.json.hbs +1 -7
- package/lib/init/template/html5-repo/files/ui5.yaml.hbs +20 -1
- package/lib/init/template/html5-repo/index.js +6 -12
- package/lib/init/template/ias/files/values.yaml.hbs +6 -6
- package/lib/init/template/ias/index.js +12 -20
- package/lib/init/template/kyma/index.js +14 -1
- package/lib/init/template/malware-scanner/files/mta.yaml.hbs +3 -1
- package/lib/init/template/malware-scanner/files/values.yaml +3 -1
- package/lib/init/template/multitenancy/files/mta.yaml.hbs +1 -3
- package/lib/init/template/multitenancy/files/values.yaml.hbs +8 -0
- package/lib/init/template/multitenancy/index.js +8 -3
- package/lib/init/template/nodejs/files/package.json.hbs +1 -1
- package/lib/init/template/pipeline/files/app-package.json.hbs +1 -7
- package/lib/init/template/pipeline/files/ui5.yaml.hbs +20 -1
- package/lib/init/template/pipeline/index.js +1 -2
- package/lib/init/template/portal/files/mta.yaml.hbs +5 -3
- package/lib/init/template/portal/index.js +3 -6
- package/lib/init/template/sample/files/_i18n/i18n_de.properties +12 -0
- package/lib/init/template/sample/files/_i18n/i18n_en.properties +21 -0
- package/lib/init/template/sample/files/_i18n/i18n_fr.properties +20 -0
- package/lib/init/template/sample/files/_i18n/messages_de.properties +34 -0
- package/lib/init/template/sample/files/_i18n/messages_en.properties +34 -0
- package/lib/init/template/sample/files/_i18n/messages_fr.properties +34 -0
- package/lib/init/template/sample/files/app/_i18n/i18n_de.properties +0 -26
- package/lib/init/template/sample/files/app/_i18n/i18n_en.properties +8 -0
- package/lib/init/template/sample/files/app/admin-authors/fiori-service.cds +52 -0
- package/lib/init/template/sample/files/app/admin-authors/webapp/Component.js.hbs +3 -0
- package/lib/init/template/sample/files/app/admin-authors/webapp/i18n/i18n.properties +11 -0
- package/lib/init/template/sample/files/app/admin-authors/webapp/manifest.json +130 -0
- package/lib/init/template/sample/files/app/admin-books/fiori-service.cds +81 -88
- package/lib/init/template/sample/files/app/admin-books/webapp/Component.js.hbs +3 -0
- package/lib/init/template/sample/files/app/admin-books/webapp/i18n/i18n.properties +10 -2
- package/lib/init/template/sample/files/app/admin-books/webapp/manifest.json +24 -48
- package/lib/init/template/sample/files/app/appconfig/fioriSandboxConfig.json +54 -3
- package/lib/init/template/sample/files/app/browse/fiori-service.cds +30 -30
- package/lib/init/template/sample/files/app/browse/webapp/Component.js.hbs +3 -0
- package/lib/init/template/sample/files/app/browse/webapp/i18n/i18n.properties +10 -3
- package/lib/init/template/sample/files/app/browse/webapp/manifest.json +18 -23
- package/lib/init/template/sample/files/app/common.cds +126 -158
- package/lib/init/template/sample/files/app/fiori-apps.html +30 -0
- package/lib/init/template/sample/files/app/genres/fiori-service.cds +33 -0
- package/lib/init/template/sample/files/app/genres/tree-view.cds +42 -0
- package/lib/init/template/sample/files/app/genres/value-help.cds +6 -0
- package/lib/init/template/sample/files/app/genres/webapp/Component.js.hbs +3 -0
- package/lib/init/template/sample/files/app/genres/webapp/i18n/i18n.properties +4 -0
- package/lib/init/template/sample/files/app/genres/webapp/i18n/i18n_de.properties +2 -0
- package/lib/init/template/sample/files/app/genres/webapp/manifest.json +126 -0
- package/lib/init/template/sample/files/app/services.cds +6 -2
- package/lib/init/template/sample/files/db/currencies.cds +13 -0
- package/lib/init/template/sample/files/db/data/sap.capire.bookshop-Books.csv +5 -5
- package/lib/init/template/sample/files/db/data/{sap.capire.bookshop-Books_texts.csv → sap.capire.bookshop-Books.texts.csv} +4 -4
- package/lib/init/template/sample/files/db/data/sap.capire.bookshop-Genres.csv +42 -15
- package/lib/init/template/sample/files/db/data/sap.common-Currencies.csv +12 -0
- package/lib/init/template/sample/files/db/data/sap.common-Currencies.texts.csv +15 -0
- package/lib/init/template/sample/files/db/hana/index.cds +10 -0
- package/lib/init/template/sample/files/db/schema.cds +35 -22
- package/lib/init/template/sample/files/db/sqlite/index.cds +10 -0
- package/lib/init/template/sample/files/package.json.hbs +14 -1
- package/lib/init/template/sample/files/srv/access-control.cds +3 -0
- package/lib/init/template/sample/files/srv/admin-service.cds +3 -2
- package/lib/init/template/sample/files/srv/cat-service.cds +7 -11
- package/lib/init/template/sample/index.js +26 -17
- package/lib/init/template/telemetry/index.js +1 -3
- package/lib/init/template/typescript/files/package.json +1 -1
- package/lib/init/template/workzone-standard/files/mta.yaml.hbs +0 -5
- package/lib/init/template/workzone-standard/index.js +0 -1
- package/lib/init/template/xsuaa/files/mta.yaml.hbs +4 -0
- package/lib/init/template/xsuaa/index.js +3 -5
- package/lib/lint/Linter.js +10 -4
- package/lib/lint/eslintHelp.json +1 -1
- package/lib/mtx/tenant_action.js +12 -4
- package/lib/util/checksum.js +32 -0
- package/lib/util/question.js +60 -7
- package/npm-shrinkwrap.json +59 -35
- package/package.json +2 -2
- package/lib/init/template/app-frontend/files/ui5-deploy.yaml.hbs +0 -25
- package/lib/init/template/github-actions/files/cf-setup/action.yaml +0 -53
- package/lib/init/template/html5-repo/files/ui5-deploy.yaml.hbs +0 -25
- package/lib/init/template/pipeline/files/ui5-deploy.yaml.hbs +0 -25
- package/lib/init/template/sample/files/app/_i18n/i18n.properties +0 -29
- package/lib/init/template/sample/files/app/admin-books/webapp/Component.js +0 -8
- package/lib/init/template/sample/files/app/admin-books/webapp/i18n/i18n_de.properties +0 -3
- package/lib/init/template/sample/files/app/admin-books/webapp/i18n/i18n_en.properties +0 -3
- package/lib/init/template/sample/files/app/browse/webapp/Component.js +0 -7
- package/lib/init/template/sample/files/app/browse/webapp/i18n/i18n_de.properties +0 -3
- package/lib/init/template/sample/files/app/browse/webapp/i18n/i18n_en.properties +0 -4
- package/lib/init/template/sample/files/app/index.html +0 -32
|
@@ -1,6 +1,6 @@
|
|
|
1
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,
|
|
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,
|
|
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,
|
|
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,
|
|
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,
|
|
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,11aaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa
|
|
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,11aaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa
|
|
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,16aaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa
|
|
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,15aaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa
|
|
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,13aaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
ID_texts,ID,locale,title,descr
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
2
|
+
d2a65a27-9f2a-480f-bc38-84ee8ec5c13e,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
|
+
8c42c706-a979-41cf-9ffe-91e6cf1383a0,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
|
+
9e1c4c81-dc90-4600-85b1-e9dd4bf12ce0,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
|
+
9be0524b-4cb9-4fc1-9dc2-d65b1c13cf53,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."
|
|
@@ -1,16 +1,43 @@
|
|
|
1
1
|
ID,parent_ID,name
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
2
|
+
10aaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa,,Fiction
|
|
3
|
+
11aaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa,10aaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa,Drama
|
|
4
|
+
12aaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa,10aaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa,Poetry
|
|
5
|
+
13aaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa,10aaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa,Fantasy
|
|
6
|
+
131aaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa,13aaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa,Fairy Tale
|
|
7
|
+
132aaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa,13aaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa,Epic Fantasy
|
|
8
|
+
133aaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa,13aaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa,High Fantasy
|
|
9
|
+
134aaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa,13aaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa,Gothic
|
|
10
|
+
14aaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa,10aaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa,Science Fiction
|
|
11
|
+
141aaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa,14aaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa,Utopian and Dystopian
|
|
12
|
+
1411aaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa,141aaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa,Utopian
|
|
13
|
+
1412aaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa,141aaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa,Dystopian
|
|
14
|
+
14121aaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa,1412aaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa,Cyberpunk
|
|
15
|
+
141211aa-aaaa-aaaa-aaaa-aaaaaaaaaaaa,14121aaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa,Steampunk
|
|
16
|
+
142aaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa,14aaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa,Space Opera
|
|
17
|
+
143aaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa,14aaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa,Time Travel
|
|
18
|
+
144aaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa,14aaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa,Tech Noir
|
|
19
|
+
15aaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa,10aaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa,Romance
|
|
20
|
+
151aaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa,15aaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa,Contemporary Romance
|
|
21
|
+
152aaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa,15aaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa,Historical Romance
|
|
22
|
+
153aaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa,15aaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa,Romantic Suspense
|
|
23
|
+
16aaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa,10aaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa,Mystery
|
|
24
|
+
161aaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa,16aaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa,Crime
|
|
25
|
+
1611aaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa,161aaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa,Thriller
|
|
26
|
+
16111aaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa,1611aaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa,Police Procedural
|
|
27
|
+
16112aaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa,1611aaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa,Legal Thriller
|
|
28
|
+
16113aaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa,1611aaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa,Medical Thriller
|
|
29
|
+
16114aaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa,1611aaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa,Spy Thriller
|
|
30
|
+
1612aaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa,161aaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa,Detective
|
|
31
|
+
1613aaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa,161aaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa,Suspense
|
|
32
|
+
162aaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa,16aaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa,Noir
|
|
33
|
+
1621aaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa,162aaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa,Nordic Noir
|
|
34
|
+
1622aaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa,162aaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa,Tart Noir
|
|
35
|
+
163aaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa,16aaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa,Cozy Mystery
|
|
36
|
+
17aaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa,10aaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa,Adventure
|
|
37
|
+
18aaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa,10aaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa,Short Story
|
|
38
|
+
19aaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa,10aaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa,Graphic Novel
|
|
39
|
+
20aaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa,,Non-Fiction
|
|
40
|
+
21aaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa,20aaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa,Biography
|
|
41
|
+
22aaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa,21aaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa,Autobiography
|
|
42
|
+
23aaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa,20aaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa,Essay
|
|
43
|
+
24aaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa,20aaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa,Speech
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
code,symbol,name,descr,numcode,minor,exponent
|
|
2
|
+
EUR,€,Euro,European Euro,978,Cent,2
|
|
3
|
+
USD,$,US Dollar,United States Dollar,840,Cent,2
|
|
4
|
+
CAD,$,Canadian Dollar,Canadian Dollar,124,Cent,2
|
|
5
|
+
AUD,$,Australian Dollar,Australian Dollar,036,Cent,2
|
|
6
|
+
GBP,£,British Pound,Great Britain Pound,826,Penny,2
|
|
7
|
+
ILS,₪,Shekel,Israeli New Shekel,376,Agorat,2
|
|
8
|
+
INR,₹,Rupee,Indian Rupee,356,Paise,2
|
|
9
|
+
QAR,﷼,Riyal,Katar Riyal,356,Dirham,2
|
|
10
|
+
SAR,﷼,Riyal,Saudi Riyal,682,Halala,2
|
|
11
|
+
JPY,¥,Yen,Japanese Yen,392,Sen,2
|
|
12
|
+
CNY,¥,Yuan,Chinese Yuan Renminbi,156,Jiao,1
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
code,locale,name,descr
|
|
2
|
+
EUR,de,Euro,European Euro
|
|
3
|
+
USD,de,US-Dollar,United States Dollar
|
|
4
|
+
CAD,de,Kanadischer Dollar,Kanadischer Dollar
|
|
5
|
+
AUD,de,Australischer Dollar,Australischer Dollar
|
|
6
|
+
GBP,de,Pfund,Britische Pfund
|
|
7
|
+
ILS,de,Schekel,Israelische Schekel
|
|
8
|
+
JPY,de,Yen,Japanische Yen
|
|
9
|
+
EUR,fr,euro,de la Zone euro
|
|
10
|
+
USD,fr,dollar,dollar des États-Unis
|
|
11
|
+
CAD,fr,dollar canadien,dollar canadien
|
|
12
|
+
AUD,fr,dollar australien,dollar australien
|
|
13
|
+
GBP,fr,livre sterling,pound sterling
|
|
14
|
+
ILS,fr,Shekel,shekel israelien
|
|
15
|
+
JPY,fr,Yen,Yen japonais
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Add Author.age and .lifetime with a DB-specific function
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
using { AdminService } from '../../srv/admin-service';
|
|
6
|
+
|
|
7
|
+
extend projection AdminService.Authors with {
|
|
8
|
+
YEARS_BETWEEN(dateOfBirth, dateOfDeath) as age: Integer,
|
|
9
|
+
YEAR(dateOfBirth) || ' – ' || YEAR(dateOfDeath) as lifetime : String
|
|
10
|
+
}
|
|
@@ -1,33 +1,46 @@
|
|
|
1
|
-
using {
|
|
1
|
+
using {
|
|
2
|
+
Currency,
|
|
3
|
+
cuid,
|
|
4
|
+
managed,
|
|
5
|
+
sap
|
|
6
|
+
} from '@sap/cds/common';
|
|
2
7
|
|
|
3
8
|
namespace sap.capire.bookshop;
|
|
4
9
|
|
|
5
10
|
entity Books : managed {
|
|
6
|
-
key ID
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
11
|
+
key ID : Integer;
|
|
12
|
+
author : Association to Authors @mandatory;
|
|
13
|
+
title : localized String @mandatory;
|
|
14
|
+
descr : localized String;
|
|
15
|
+
genre : Association to Genres;
|
|
16
|
+
stock : Integer;
|
|
17
|
+
price : Price;
|
|
18
|
+
currency : Currency;
|
|
14
19
|
}
|
|
15
20
|
|
|
16
21
|
entity Authors : managed {
|
|
17
|
-
key ID
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
22
|
+
key ID : Integer;
|
|
23
|
+
name : String @mandatory;
|
|
24
|
+
dateOfBirth : Date;
|
|
25
|
+
dateOfDeath : Date;
|
|
26
|
+
placeOfBirth : String;
|
|
27
|
+
placeOfDeath : String;
|
|
28
|
+
books : Association to many Books
|
|
29
|
+
on books.author = $self;
|
|
25
30
|
}
|
|
26
31
|
|
|
27
32
|
/** Hierarchically organized Code List for Genres */
|
|
28
|
-
entity Genres : sap.common.CodeList {
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
on children.parent = $self;
|
|
33
|
+
entity Genres : cuid, sap.common.CodeList {
|
|
34
|
+
parent : Association to Genres;
|
|
35
|
+
children : Composition of many Genres
|
|
36
|
+
on children.parent = $self;
|
|
33
37
|
}
|
|
38
|
+
|
|
39
|
+
type Price : Decimal(9, 2);
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
// --------------------------------------------------------------------------------
|
|
43
|
+
// Temporary workaround for this situation:
|
|
44
|
+
// - Fiori apps in bookstore annotate Books with @fiori.draft.enabled.
|
|
45
|
+
// - Because of that .csv data has to eagerly fill in ID_texts column.
|
|
46
|
+
annotate Books with @fiori.draft.enabled;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Add Author.age and .lifetime with a DB-specific function
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
using { AdminService } from '../../srv/admin-service';
|
|
6
|
+
|
|
7
|
+
extend projection AdminService.Authors with {
|
|
8
|
+
strftime('%Y',dateOfDeath)-strftime('%Y',dateOfBirth) as age: Integer,
|
|
9
|
+
strftime('%Y',dateOfBirth) || ' – ' || strftime('%Y',dateOfDeath) as lifetime : String
|
|
10
|
+
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
using {sap.capire.bookshop as my} from '../db/schema';
|
|
2
2
|
|
|
3
|
-
service AdminService
|
|
4
|
-
entity Books as projection on my.Books;
|
|
3
|
+
service AdminService {
|
|
5
4
|
entity Authors as projection on my.Authors;
|
|
5
|
+
entity Books as projection on my.Books;
|
|
6
|
+
entity Genres as projection on my.Genres;
|
|
6
7
|
}
|
|
@@ -5,7 +5,11 @@ service CatalogService {
|
|
|
5
5
|
/** For displaying lists of Books */
|
|
6
6
|
@readonly
|
|
7
7
|
entity ListOfBooks as
|
|
8
|
-
projection on Books
|
|
8
|
+
projection on Books {
|
|
9
|
+
*,
|
|
10
|
+
genre.name as genre,
|
|
11
|
+
currency.symbol as currency,
|
|
12
|
+
}
|
|
9
13
|
excluding {
|
|
10
14
|
descr
|
|
11
15
|
};
|
|
@@ -23,15 +27,7 @@ service CatalogService {
|
|
|
23
27
|
};
|
|
24
28
|
|
|
25
29
|
@requires: 'authenticated-user'
|
|
26
|
-
action submitOrder(book
|
|
27
|
-
|
|
28
|
-
) returns {
|
|
29
|
-
stock : Integer
|
|
30
|
-
};
|
|
31
|
-
|
|
32
|
-
event OrderedBook : {
|
|
33
|
-
book : Books : ID;
|
|
34
|
-
quantity : Integer;
|
|
35
|
-
buyer : String
|
|
30
|
+
action submitOrder(book: Books:ID, quantity: Integer) returns {
|
|
31
|
+
stock : Integer
|
|
36
32
|
};
|
|
37
33
|
}
|
|
@@ -19,29 +19,38 @@ module.exports = class SampleTemplate extends require('../../plugin') {
|
|
|
19
19
|
return new ExtensionGenerator().addSample()
|
|
20
20
|
}
|
|
21
21
|
|
|
22
|
-
const
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
22
|
+
const env = env4('production')
|
|
23
|
+
const { db, srv, app } = env.folders
|
|
24
|
+
const i18n = env.i18n.folders[0]
|
|
25
|
+
const { appName, appPath } = project
|
|
26
|
+
|
|
27
|
+
if (project.language === 'java') {
|
|
28
|
+
await mvn.add('sample')
|
|
29
|
+
} else {
|
|
30
|
+
await Promise.all([
|
|
31
|
+
copy(join(__dirname, 'files/db')).to(db),
|
|
32
|
+
copy(join(__dirname, 'files/srv')).to(srv),
|
|
33
|
+
copy(join(__dirname, 'files/_i18n')).to(i18n)
|
|
34
|
+
])
|
|
35
|
+
const lang = project.isTypescript ? 'typescript' : 'javascript'
|
|
36
|
+
await renderAndCopy(join(__dirname, 'files', lang), srv, project)
|
|
37
|
+
for (const uiApp of ['admin-books', 'admin-authors', 'browse', 'genres']) {
|
|
38
|
+
project.app = uiApp
|
|
39
|
+
await renderAndCopy(join(__dirname, 'files/app', uiApp), join(app, uiApp), project)
|
|
34
40
|
}
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
41
|
+
await Promise.all([
|
|
42
|
+
copy(join(__dirname, 'files/app/common.cds')).to(app, 'common.cds'),
|
|
43
|
+
copy(join(__dirname, 'files/app/fiori-apps.html')).to(app, 'fiori-apps.html'),
|
|
44
|
+
copy(join(__dirname, 'files/app/services.cds')).to(app, 'services.cds'),
|
|
45
|
+
copy(join(__dirname, 'files/app/appconfig')).to(app, 'appconfig'),
|
|
46
|
+
copy(join(__dirname, 'files/app/_i18n')).to(app, '_i18n')
|
|
47
|
+
])
|
|
38
48
|
}
|
|
39
49
|
|
|
40
|
-
const { appName, appPath, appUIPaths } = project
|
|
41
50
|
await merge(__dirname, 'files/package.json.hbs').into('package.json', { with: { appPath }})
|
|
42
51
|
|
|
43
52
|
// manifest.json must be unique
|
|
44
|
-
await Promise.all(appUIPaths.map(async p => {
|
|
53
|
+
await Promise.all(project.appUIPaths.map(async p => {
|
|
45
54
|
const manifest = await read(join(appPath, p, 'webapp/manifest.json'))
|
|
46
55
|
manifest['sap.app'].id = appName + '.' + p
|
|
47
56
|
await write(join(appPath, p, 'webapp/manifest.json'), manifest, { spaces: 2 })
|
|
@@ -1,9 +1,7 @@
|
|
|
1
|
-
const cds = require('../../../cds')
|
|
2
|
-
|
|
3
1
|
module.exports = class extends require('../../plugin') {
|
|
4
2
|
|
|
5
3
|
static hasInProduction(env) {
|
|
6
|
-
return !!env.requires?.telemetry
|
|
4
|
+
return !!env.requires?.telemetry
|
|
7
5
|
}
|
|
8
6
|
|
|
9
7
|
requires() {
|
|
@@ -82,11 +82,6 @@ resources:
|
|
|
82
82
|
HTML5.DynamicDestination: true
|
|
83
83
|
requires:
|
|
84
84
|
- name: srv-api
|
|
85
|
-
group: destinations
|
|
86
|
-
properties:
|
|
87
|
-
name: srv-api # must be used in xs-app.json as well
|
|
88
|
-
url: ~{srv-url}
|
|
89
|
-
forwardAuthToken: true
|
|
90
85
|
|
|
91
86
|
- name: {{appName}}-html5-repo-host
|
|
92
87
|
type: org.cloudfoundry.managed-service
|
|
@@ -86,7 +86,6 @@ module.exports = class extends require('../../plugin') {
|
|
|
86
86
|
}]
|
|
87
87
|
const relationships = []
|
|
88
88
|
if (addMultitenancy) {
|
|
89
|
-
additions.push(html5RepoHost)
|
|
90
89
|
relationships.push({
|
|
91
90
|
insert: [html5RepoHost, 'name'],
|
|
92
91
|
into: [mtxSidecar4(isJava ? 'mtx/sidecar' : 'gen/mtx/sidecar'), 'requires', 'name']
|
|
@@ -22,6 +22,10 @@ resources:
|
|
|
22
22
|
config:
|
|
23
23
|
xsappname: {{appName}}-${org}-${space}
|
|
24
24
|
tenant-mode: {{#hasMultitenancy}}shared{{/hasMultitenancy}}{{^hasMultitenancy}}dedicated{{/hasMultitenancy}}
|
|
25
|
+
oauth2-configuration:
|
|
26
|
+
credential-types:
|
|
27
|
+
- "binding-secret"
|
|
28
|
+
- "x509"
|
|
25
29
|
{{#hasRoles}}{{^hasCustomRoleCollections}}
|
|
26
30
|
role-collections:
|
|
27
31
|
{{#roles}}
|
|
@@ -33,7 +33,7 @@ module.exports = class XsuaaTemplate extends require('../../plugin') {
|
|
|
33
33
|
|
|
34
34
|
async combine() {
|
|
35
35
|
const project = readProject()
|
|
36
|
-
const { addMultitenancy, addMta, hasMta, addHelm, hasHelm, hasHelmUnifiedRuntime, addHelmUnifiedRuntime, isJava, srvPath } = project
|
|
36
|
+
const { addMultitenancy, hasMultitenancy, addMta, hasMta, addHelm, hasHelm, hasHelmUnifiedRuntime, addHelmUnifiedRuntime, isJava, srvPath } = project
|
|
37
37
|
|
|
38
38
|
const cds = require('../../../../lib')
|
|
39
39
|
const xsSecurity = await (async () => {
|
|
@@ -53,16 +53,14 @@ module.exports = class XsuaaTemplate extends require('../../plugin') {
|
|
|
53
53
|
additions.push(xsuaa)
|
|
54
54
|
if (addMta) {
|
|
55
55
|
const srv = srv4(srvPath)
|
|
56
|
-
additions.push(srv)
|
|
57
56
|
relationships.push({
|
|
58
57
|
insert: [xsuaa, 'name'],
|
|
59
58
|
into: [srv, 'requires', 'name']
|
|
60
59
|
})
|
|
61
60
|
}
|
|
62
|
-
if (
|
|
61
|
+
if (hasMultitenancy) {
|
|
63
62
|
const mtxSidecar = mtxSidecar4(isJava ? 'mtx/sidecar' : 'gen/mtx/sidecar')
|
|
64
|
-
|
|
65
|
-
overwrites.push({ item: [mtxSidecar, 'parameters.tenant-mode'], withValue: 'shared' })
|
|
63
|
+
overwrites.push({ item: [xsuaa, 'parameters.config.tenant-mode'], withValue: 'shared' })
|
|
66
64
|
relationships.push({
|
|
67
65
|
insert: [xsuaa, 'name'],
|
|
68
66
|
into: [mtxSidecar, 'requires', 'name']
|
package/lib/lint/Linter.js
CHANGED
|
@@ -65,10 +65,16 @@ async function findConfigPath (currentDir = '.') {
|
|
|
65
65
|
let configDir = path.resolve(currentDir)
|
|
66
66
|
while (configDir && configDir !== path.dirname(configDir)) {
|
|
67
67
|
for (const configFile of configFiles) {
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
68
|
+
try {
|
|
69
|
+
const configPath = path.join(configDir, configFile)
|
|
70
|
+
const config = await tryRequire(configPath)
|
|
71
|
+
if ((configFile !== 'package.json' || config?.eslintConfig) && isfile(configPath)) {
|
|
72
|
+
return configPath
|
|
73
|
+
}
|
|
74
|
+
} catch {
|
|
75
|
+
// attempting to load config files may fail for various reasons we can not easily verify by error code, for example
|
|
76
|
+
// "Cannot use import statement outside a module" in a TS context, or attempting to read .mts files without properly setting them up.
|
|
77
|
+
// We just ignore these errors and treat them as "no valid config found so far, continue searching", lest the exception flys up.
|
|
72
78
|
}
|
|
73
79
|
}
|
|
74
80
|
configDir = path.dirname(configDir)
|
package/lib/lint/eslintHelp.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"version": "9.
|
|
2
|
+
"version": "9.39.1",
|
|
3
3
|
"help": "\n# SYNOPSIS\n\n *cds lint* [options] file.js [file.js] [dir]\n\n Runs environment checks and/or checks the specified models\n based on the ESLint framework\n\n# OPTIONS\n \n Basic configuration:\n --no-config-lookup Disable look up for eslint.config.js\n -c, --config path::String Use this configuration instead of eslint.config.js, eslint.config.mjs, or eslint.config.cjs\n --inspect-config Open the config inspector with the current configuration\n --ext [String] Specify additional file extensions to lint\n --global [String] Define global variables\n --parser String Specify the parser to be used\n --parser-options Object Specify parser options\n \n Specify Rules and Plugins:\n --plugin [String] Specify plugins\n --rule Object Specify rules\n \n Fix Problems:\n --fix Automatically fix problems\n --fix-dry-run Automatically fix problems without saving the changes to the file system\n --fix-type Array Specify the types of fixes to apply (directive, problem, suggestion, layout)\n \n Ignore Files:\n --no-ignore Disable use of ignore files and patterns\n --ignore-pattern [String] Patterns of files to ignore\n \n Use stdin:\n --stdin Lint code provided on <STDIN> - default: false\n --stdin-filename String Specify filename to process STDIN as\n \n Handle Warnings:\n --quiet Report errors only - default: false\n --max-warnings Int Number of warnings to trigger nonzero exit code - default: -1\n \n Output:\n -o, --output-file path::String Specify file to write report to\n -f, --format String Use a specific output format - default: stylish\n --color, --no-color Force enabling/disabling of color\n \n Inline configuration comments:\n --no-inline-config Prevent comments from changing config or rules\n --report-unused-disable-directives Adds reported errors for unused eslint-disable and eslint-enable directives\n --report-unused-disable-directives-severity String Chooses severity level for reporting unused eslint-disable and eslint-enable directives - either: off, warn, error, 0, 1, or 2\n --report-unused-inline-configs String Adds reported errors for unused eslint inline config comments - either: off, warn, error, 0, 1, or 2\n \n Caching:\n --cache Only check changed files - default: false\n --cache-file path::String Path to the cache file. Deprecated: use --cache-location - default: .eslintcache\n --cache-location path::String Path to the cache file or directory\n --cache-strategy String Strategy to use for detecting changed files in the cache - either: metadata or content - default: metadata\n \n Suppressing Violations:\n --suppress-all Suppress all violations - default: false\n --suppress-rule [String] Suppress specific rules\n --suppressions-location path::String Specify the location of the suppressions file\n --prune-suppressions Prune unused suppressions - default: false\n --pass-on-unpruned-suppressions Ignore unused suppressions - default: false\n \n Miscellaneous:\n --init Run config initialization wizard - default: false\n --env-info Output execution environment information - default: false\n --no-error-on-unmatched-pattern Prevent errors when pattern is unmatched\n --exit-on-fatal-error Exit with exit code 2 in case of fatal error - default: false\n --no-warn-ignored Suppress warnings when the file list includes ignored files\n --pass-on-no-patterns Exit with exit code 0 in case no file patterns are passed\n --debug Output debugging information\n -h, --help Show help\n -v, --version Output the version number\n --print-config path::String Print the configuration for the given file\n --stats Add statistics to the lint report - default: false\n --flag [String] Enable a feature flag\n --mcp Start the ESLint MCP server\n --concurrency Int|String Number of linting threads, auto to choose automatically, off for no multithreading - default: off\n \n",
|
|
4
4
|
"options": [
|
|
5
5
|
"--config",
|
package/lib/mtx/tenant_action.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
const cds = require('../cds');
|
|
2
2
|
const { ParamCollection } = require('./params');
|
|
3
3
|
const AuthManager = require('./auth_manager');
|
|
4
|
+
const { localhostRegex } = require('./util/urls');
|
|
4
5
|
|
|
5
6
|
require('../util/axios').pruneErrors();
|
|
6
7
|
const { getMessage } = require('./util/logging');
|
|
@@ -15,6 +16,9 @@ const COMMANDS = {
|
|
|
15
16
|
unsubscribe: 'from'
|
|
16
17
|
};
|
|
17
18
|
|
|
19
|
+
const DEFAULT_SUBSCRIBE_USER = 'yves';
|
|
20
|
+
const DEFAULT_SUBSCRIBE_PASSWORD = '';
|
|
21
|
+
|
|
18
22
|
module.exports = class TenantAction {
|
|
19
23
|
|
|
20
24
|
// TODO JSDoc
|
|
@@ -33,12 +37,19 @@ module.exports = class TenantAction {
|
|
|
33
37
|
async run(paramValues, { tenant, local } = {}) {
|
|
34
38
|
let params = new ParamCollection(paramValues);
|
|
35
39
|
params.set('skipToken', true); // Token would have insufficient scopes for this command.
|
|
40
|
+
|
|
36
41
|
if (local) {
|
|
37
42
|
// Connect to locally-served MTXS
|
|
38
43
|
await this.runWithServer(params, tenant);
|
|
39
44
|
} else {
|
|
40
|
-
// Connect to running MTXS server
|
|
41
45
|
params = await AuthManager.login(params.toEntries());
|
|
46
|
+
// subscribe: use 'yves' as default username against localhost if no username is provided
|
|
47
|
+
if (this.command === 'subscribe' && !params.has('username') && params.has('appUrl') && localhostRegex.test(params.get('appUrl'))) {
|
|
48
|
+
params.set('username', DEFAULT_SUBSCRIBE_USER);
|
|
49
|
+
params.set('password', DEFAULT_SUBSCRIBE_PASSWORD);
|
|
50
|
+
params = await AuthManager.login(params.toEntries()); // set reqAuth param
|
|
51
|
+
}
|
|
52
|
+
// Connect to running MTXS server
|
|
42
53
|
await this.runClientOnly(params, tenant);
|
|
43
54
|
}
|
|
44
55
|
console.log(`${capitalize(this.command)} successful.`);
|
|
@@ -80,9 +91,6 @@ module.exports = class TenantAction {
|
|
|
80
91
|
}
|
|
81
92
|
|
|
82
93
|
const { cds_mtx } = require(libPath);
|
|
83
|
-
if (!cds_mtx) {
|
|
84
|
-
throw '@sap/cds-mtxs outdated. Please upgrade to @sap/cds-mtxs@>=1.7.0 and re-run this command.';
|
|
85
|
-
}
|
|
86
94
|
const body = params.get('body')
|
|
87
95
|
return cds_mtx(this.command, tenant, body);
|
|
88
96
|
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
const cds = require('../../lib/cds')
|
|
2
|
+
const { read } = cds.utils
|
|
3
|
+
const crypto = require('crypto')
|
|
4
|
+
const { getFiles } = require('../build/util')
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Calculate a checksum for a directory, excluding specified patterns.
|
|
8
|
+
* @param {string} dirPath - The directory path to calculate checksum for.
|
|
9
|
+
* @param {(file: string) => boolean} [filter] - the filter function to apply to the found files
|
|
10
|
+
* @param {string} [hashFunction='sha256'] - The hash function to use (default is 'sha256').
|
|
11
|
+
* @returns {Promise<string>} - The checksum as a hex string.
|
|
12
|
+
*/
|
|
13
|
+
async function calcDirChecksum(dirPath, filter = [], hashFunction = 'sha256', optionalFiles = []) {
|
|
14
|
+
const hash = crypto.createHash(hashFunction)
|
|
15
|
+
const files = await getFiles(dirPath, filter)
|
|
16
|
+
|
|
17
|
+
for (const file of files.sort()) {
|
|
18
|
+
const content = await read(file, "binary")
|
|
19
|
+
hash.update(file)
|
|
20
|
+
hash.update(content)
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
for (const file of optionalFiles.sort()) {
|
|
24
|
+
const content = await read(file, "binary")
|
|
25
|
+
hash.update(file)
|
|
26
|
+
hash.update(content)
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
return hash.digest('hex')
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
module.exports = { calcDirChecksum }
|
package/lib/util/question.js
CHANGED
|
@@ -1,6 +1,14 @@
|
|
|
1
1
|
const readline = require('node:readline')
|
|
2
|
+
const { Writable } = require('node:stream')
|
|
2
3
|
|
|
3
|
-
async function ask4(...args) {
|
|
4
|
+
async function ask4([...args], { redacted = false } = {}) {
|
|
5
|
+
var mutableStdout = new Writable({
|
|
6
|
+
write: function (chunk, encoding, callback) {
|
|
7
|
+
if (!redacted)
|
|
8
|
+
process.stdout.write(chunk, encoding);
|
|
9
|
+
callback();
|
|
10
|
+
}
|
|
11
|
+
});
|
|
4
12
|
|
|
5
13
|
// If not in interactive mode, read all input at once.
|
|
6
14
|
if (!process.stdin.isTTY) {
|
|
@@ -13,19 +21,64 @@ async function ask4(...args) {
|
|
|
13
21
|
}
|
|
14
22
|
|
|
15
23
|
const answers = []
|
|
16
|
-
const rl = readline.createInterface({
|
|
24
|
+
const rl = readline.createInterface({
|
|
25
|
+
input: process.stdin,
|
|
26
|
+
output: mutableStdout,
|
|
27
|
+
terminal: true
|
|
28
|
+
})
|
|
17
29
|
|
|
18
30
|
const askQuestion = question =>
|
|
19
|
-
new Promise(resolve =>
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
31
|
+
new Promise(resolve => {
|
|
32
|
+
if (redacted && process.stdin.isTTY) {
|
|
33
|
+
// Set raw mode to intercept keystrokes
|
|
34
|
+
process.stdin.setRawMode(true)
|
|
35
|
+
process.stdout.write(question)
|
|
36
|
+
|
|
37
|
+
let answer = ''
|
|
38
|
+
const onData = (char) => {
|
|
39
|
+
const byte = char.toString()
|
|
40
|
+
|
|
41
|
+
// Enter key
|
|
42
|
+
if (byte === '\n' || byte === '\r') {
|
|
43
|
+
process.stdin.setRawMode(false)
|
|
44
|
+
process.stdin.removeListener('data', onData)
|
|
45
|
+
process.stdout.write('\n')
|
|
46
|
+
answers.push(answer)
|
|
47
|
+
resolve()
|
|
48
|
+
}
|
|
49
|
+
// Backspace/Delete
|
|
50
|
+
else if (byte === '\b' || byte === '\x7f') {
|
|
51
|
+
if (answer.length > 0) {
|
|
52
|
+
answer = answer.slice(0, -1)
|
|
53
|
+
process.stdout.write('\b \b')
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
// Ctrl+C
|
|
57
|
+
else if (byte === '\x03') {
|
|
58
|
+
process.stdin.setRawMode(false)
|
|
59
|
+
process.exit()
|
|
60
|
+
}
|
|
61
|
+
// Regular character
|
|
62
|
+
else if (byte >= ' ' || byte === '\t') {
|
|
63
|
+
answer += byte
|
|
64
|
+
process.stdout.write('*')
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
process.stdin.on('data', onData)
|
|
69
|
+
} else {
|
|
70
|
+
rl.question(question, answer => {
|
|
71
|
+
answers.push(answer)
|
|
72
|
+
resolve()
|
|
73
|
+
})
|
|
74
|
+
}
|
|
75
|
+
})
|
|
23
76
|
|
|
24
77
|
for (const question of args) {
|
|
25
78
|
await askQuestion(question)
|
|
26
79
|
}
|
|
27
80
|
rl.close()
|
|
28
|
-
return
|
|
81
|
+
return args.length == 1 ? answers[0] : answers
|
|
29
82
|
}
|
|
30
83
|
|
|
31
84
|
module.exports = { ask4 }
|