@sap/cds-dk 9.9.3 → 10.0.4
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 +94 -0
- package/bin/add.js +1 -1
- package/bin/cds.js +4 -1
- package/bin/data-products/import.js +1 -1
- package/bin/data-products/{index.js → load.js} +0 -3
- package/bin/debug.js +19 -0
- package/bin/export.js +21 -15
- package/bin/login.js +4 -8
- package/bin/logout.js +4 -9
- package/bin/pull.js +4 -8
- package/bin/push.js +8 -23
- package/bin/up.js +50 -1
- package/bin/upgrade-tenant.js +78 -0
- package/bin/upgrade.js +55 -53
- package/bin/util/log.js +1 -2
- package/bin/version.js +44 -60
- package/lib/bind/shared.js +5 -1
- package/lib/build/index.js +3 -3
- package/lib/build/plugins/fiori/index.js +5 -5
- package/lib/build/plugins/hana/index.js +13 -12
- package/lib/build/plugins/hana/template/package.json +1 -1
- package/lib/build/plugins/internal.js +4 -3
- package/lib/build/plugins/mtx-sidecar/index.js +8 -25
- package/lib/build/plugins/nodejs/index.js +4 -2
- package/lib/build/plugins/plugin.js +4 -10
- package/lib/build/util.js +0 -41
- package/lib/import/openapi/importOpenAPI.js +15 -3
- package/lib/index.js +1 -1
- package/lib/init/bas.js +2 -3
- package/lib/init/constants.js +8 -7
- package/lib/init/index.js +1 -17
- package/lib/init/projectReader.js +14 -5
- package/lib/init/registries/mta.js +12 -0
- package/lib/init/template/ai/files/mta.yaml.hbs +14 -0
- package/lib/init/template/ai/files/package.json.hbs +25 -0
- package/lib/init/template/ai/files/values.yaml +7 -0
- package/lib/init/template/ai/index.js +48 -0
- package/lib/init/template/ams/files/Chart.yaml.hbs +2 -2
- package/lib/init/template/ams/files/containerize.yaml.hbs +5 -5
- package/lib/init/template/ams/files/mta.yaml.hbs +1 -1
- package/lib/init/template/ams/files/package.json.hbs +3 -0
- package/lib/init/template/ams/index.js +2 -2
- package/lib/init/template/app-frontend/files/app-package.json.hbs +2 -2
- package/lib/init/template/app-frontend/files/containerize.yaml.hbs +13 -0
- package/lib/init/template/app-frontend/files/index.html.hbs +1 -1
- package/lib/init/template/app-frontend/files/mta.yaml.hbs +1 -1
- package/lib/init/template/app-frontend/files/ui5.yaml.hbs +4 -4
- package/lib/init/template/app-frontend/files/values.yaml.hbs +21 -9
- package/lib/init/template/app-frontend/index.js +37 -29
- package/lib/init/template/application-logging/files/mta.yaml.hbs +1 -1
- package/lib/init/template/application-logging/index.js +3 -3
- package/lib/init/template/approuter/files/containerize.yaml.hbs +4 -4
- package/lib/init/template/approuter/files/mta.yaml.hbs +1 -1
- package/lib/init/template/approuter/index.js +5 -5
- package/lib/init/template/attachments/files/mta.yaml.hbs +1 -1
- package/lib/init/template/attachments/files/values.yaml +1 -1
- package/lib/init/template/attachments/index.js +4 -4
- package/lib/init/template/audit-logging/files/mta.yaml.hbs +1 -1
- package/lib/init/template/audit-logging/index.js +4 -4
- package/lib/init/template/cf-manifest/files/manifest.yml.hbs +3 -3
- package/lib/init/template/cjs/files/package.json.hbs +3 -0
- package/lib/init/template/{esm → cjs}/index.js +2 -2
- package/lib/init/template/cloud-logging/files/mta.yaml.hbs +1 -1
- package/lib/init/template/cloud-logging/index.js +3 -3
- package/lib/init/template/completion/completionSetup.js +1 -1
- package/lib/init/template/connectivity/files/mta.yaml.hbs +1 -1
- package/lib/init/template/connectivity/index.js +4 -4
- package/lib/init/template/data/as-json.js +0 -10
- package/lib/init/template/destination/files/mta.yaml.hbs +1 -1
- package/lib/init/template/destination/index.js +4 -4
- package/lib/init/template/dynatrace/files/mta.yaml.hbs +1 -1
- package/lib/init/template/dynatrace/index.js +3 -3
- package/lib/init/template/enterprise-messaging/files/mta.yaml.hbs +1 -1
- package/lib/init/template/enterprise-messaging/index.js +39 -23
- package/lib/init/template/enterprise-messaging-shared/files/mta.yaml.hbs +1 -1
- package/lib/init/template/enterprise-messaging-shared/index.js +22 -44
- package/lib/init/template/event-mesh/files/event-mesh.json.hbs +31 -0
- package/lib/init/template/event-mesh/files/mta.yaml.hbs +22 -0
- package/lib/init/template/event-mesh/files/package.json.hbs +20 -0
- package/lib/init/template/event-mesh/files/values.yaml +7 -0
- package/lib/init/template/event-mesh/files/xs-security.json.hbs +19 -0
- package/lib/init/template/event-mesh/index.js +16 -0
- package/lib/init/template/event-mesh-shared/files/event-mesh.json.hbs +31 -0
- package/lib/init/template/event-mesh-shared/files/mta.yaml.hbs +15 -0
- package/lib/init/template/event-mesh-shared/files/package.json.hbs +23 -0
- package/lib/init/template/event-mesh-shared/files/values.yaml +7 -0
- package/lib/init/template/event-mesh-shared/index.js +16 -0
- package/lib/init/template/extensibility/files/package.json.hbs +1 -1
- package/lib/init/template/github-actions/files/workflows/cf.yaml.hbs +2 -2
- package/lib/init/template/github-actions/files/workflows/test.yaml.hbs +2 -2
- package/lib/init/template/hana/files/containerize.yaml.hbs +5 -5
- package/lib/init/template/hana/files/mta.yaml.hbs +1 -1
- package/lib/init/template/hana/files/package.json.hbs +1 -1
- package/lib/init/template/hana/files/src/.hdiconfig +1 -1
- package/lib/init/template/hana/index.js +5 -8
- package/lib/init/template/handler/files/extension/handler.xs.hbs +1 -1
- package/lib/init/template/handler/index.js +1 -19
- package/lib/init/template/html5-repo/files/app-package.json.hbs +2 -2
- package/lib/init/template/html5-repo/files/containerize.yaml.hbs +5 -7
- package/lib/init/template/html5-repo/files/mta.yaml.hbs +4 -4
- package/lib/init/template/html5-repo/files/ui5.yaml.hbs +4 -4
- package/lib/init/template/html5-repo/files/values.yaml.hbs +9 -0
- package/lib/init/template/html5-repo/index.js +23 -22
- package/lib/init/template/ias/files/Chart.yaml.hbs +2 -2
- package/lib/init/template/ias/files/mta.yaml.hbs +1 -1
- package/lib/init/template/ias/index.js +5 -5
- package/lib/init/template/initial/index.js +2 -10
- package/lib/init/template/kafka/files/mta.yaml.hbs +1 -1
- package/lib/init/template/kafka/files/values.yaml +1 -1
- package/lib/init/template/kafka/index.js +4 -4
- package/lib/init/template/kyma/files/containerize.yaml.hbs +11 -11
- package/lib/init/template/kyma/files/values.schema.json +1 -1
- package/lib/init/template/kyma/index.js +10 -10
- package/lib/init/template/lint/files/package.json +1 -1
- package/lib/init/template/malware-scanner/files/mta.yaml.hbs +2 -2
- package/lib/init/template/malware-scanner/files/package.json.hbs +1 -1
- package/lib/init/template/malware-scanner/files/values.yaml +1 -1
- package/lib/init/template/malware-scanner/index.js +4 -4
- package/lib/init/template/mta/files/mta.yaml.hbs +1 -1
- package/lib/init/template/mta/files/package.json +1 -1
- package/lib/init/template/multitenancy/files/containerize.yaml.hbs +5 -5
- package/lib/init/template/multitenancy/files/mta.yaml.hbs +1 -1
- package/lib/init/template/multitenancy/files/package.json.hbs +1 -1
- package/lib/init/template/multitenancy/files/package.sidecar.json.hbs +5 -5
- package/lib/init/template/multitenancy/index.js +10 -11
- package/lib/init/template/nodejs/files/package.json.hbs +3 -2
- package/lib/init/template/portal/files/containerize.yaml.hbs +4 -4
- package/lib/init/template/portal/files/mta.yaml.hbs +1 -1
- package/lib/init/template/portal/files/values.yaml.hbs +3 -32
- package/lib/init/template/portal/index.js +5 -13
- package/lib/init/template/postgres/files/containerize.yaml.hbs +4 -4
- package/lib/init/template/postgres/files/mta.yml.hbs +1 -1
- package/lib/init/template/postgres/files/package.json.hbs +1 -1
- package/lib/init/template/postgres/index.js +4 -4
- package/lib/init/template/react/files/{index.html → index.html.hbs} +1 -1
- package/lib/init/template/react/files/{vite.config.js → vite.config.js.hbs} +2 -1
- package/lib/init/template/react/index.js +15 -7
- package/lib/init/template/redis/files/mta.yaml.hbs +1 -1
- package/lib/init/template/redis/index.js +4 -4
- package/lib/init/template/sample/files/app/admin-books/webapp/manifest.json +2 -1
- package/lib/init/template/side-by-side-extensibility/files/mta.yaml.hbs +1 -1
- package/lib/init/template/sqlite/files/package.json.hbs +2 -2
- package/lib/init/template/toggles/files/package.json.hbs +1 -1
- package/lib/init/template/typer/files/gitignore +1 -1
- package/lib/init/template/typescript/files/package.json +1 -1
- package/lib/init/template/vue/files/{index.html → index.html.hbs} +1 -1
- package/lib/init/template/vue/files/{vite.config.js → vite.config.js.hbs} +2 -1
- package/lib/init/template/vue/index.js +16 -8
- package/lib/init/template/workzone-standard/files/mta.yaml.hbs +1 -1
- package/lib/init/template/workzone-standard/index.js +3 -3
- package/lib/init/template/xsuaa/files/mta.yaml.hbs +1 -1
- package/lib/init/template/xsuaa/index.js +3 -3
- package/lib/lint/Linter.js +5 -4
- package/lib/lint/eslintHelp.json +1 -1
- package/lib/mtx/params.js +0 -4
- package/lib/mtx/pull.js +1 -1
- package/lib/mtx/push.js +4 -3
- package/lib/mtx/settings_manager.js +9 -14
- package/lib/mtx/tenant_action.js +6 -6
- package/lib/mtx/util/question.js +0 -18
- package/lib/upgrade/constants.js +102 -0
- package/lib/upgrade/context.js +24 -0
- package/lib/upgrade/index.js +65 -0
- package/lib/upgrade/migrations/cds10/migrations.json +705 -0
- package/lib/upgrade/preflight/cds-version.js +61 -0
- package/lib/upgrade/preflight/consistency.js +94 -0
- package/lib/upgrade/preflight/index.js +49 -0
- package/lib/upgrade/preflight/project-type.js +224 -0
- package/lib/upgrade/steps/analyze/classification.js +92 -0
- package/lib/upgrade/steps/analyze/detector.js +22 -0
- package/lib/upgrade/steps/analyze/evaluator.js +91 -0
- package/lib/upgrade/steps/analyze/index.js +124 -0
- package/lib/upgrade/steps/analyze/reporter.js +339 -0
- package/lib/upgrade/steps/analyze/setup.js +71 -0
- package/lib/upgrade/steps/analyze/utils/detection.js +63 -0
- package/lib/upgrade/steps/analyze/utils/files.js +114 -0
- package/lib/upgrade/steps/analyze/utils/grep.js +95 -0
- package/lib/upgrade/steps/analyze/utils/yaml.js +58 -0
- package/lib/upgrade/steps/install.js +115 -0
- package/lib/upgrade/steps/openrewrite.js +293 -0
- package/lib/upgrade/steps/removals.js +88 -0
- package/lib/upgrade/steps/rewrite.js +167 -0
- package/lib/upgrade/steps/verify.js +96 -0
- package/lib/upgrade/util/pom.js +46 -0
- package/lib/upgrade/util/prompt.js +28 -0
- package/lib/upgrade/util/workspaces.js +111 -0
- package/lib/util/cf.js +23 -12
- package/lib/util/term.js +1 -1
- package/lib/watch/vite-watch.js +33 -8
- package/node_modules/@cap-js/asyncapi/LICENSE +201 -0
- package/node_modules/@cap-js/asyncapi/README.md +46 -0
- package/node_modules/@cap-js/asyncapi/index.js +4 -0
- package/node_modules/@cap-js/asyncapi/lib/compile/channels.js +18 -0
- package/node_modules/@cap-js/asyncapi/lib/compile/components/messageTraits/index.js +89 -0
- package/node_modules/@cap-js/asyncapi/lib/compile/components/messages/index.js +179 -0
- package/node_modules/@cap-js/asyncapi/lib/compile/components/schemas/annotations.js +36 -0
- package/node_modules/@cap-js/asyncapi/lib/compile/components/schemas/array.js +8 -0
- package/node_modules/@cap-js/asyncapi/lib/compile/components/schemas/cache.js +16 -0
- package/node_modules/@cap-js/asyncapi/lib/compile/components/schemas/definition.js +191 -0
- package/node_modules/@cap-js/asyncapi/lib/compile/components/schemas/enum.js +15 -0
- package/node_modules/@cap-js/asyncapi/lib/compile/components/schemas/examples.js +10 -0
- package/node_modules/@cap-js/asyncapi/lib/compile/components/schemas/index.js +14 -0
- package/node_modules/@cap-js/asyncapi/lib/compile/components/schemas/localized.js +29 -0
- package/node_modules/@cap-js/asyncapi/lib/compile/components/schemas/primitiveElement.js +41 -0
- package/node_modules/@cap-js/asyncapi/lib/compile/components/schemas/ref.js +45 -0
- package/node_modules/@cap-js/asyncapi/lib/compile/components/schemas/utils.js +108 -0
- package/node_modules/@cap-js/asyncapi/lib/compile/index.js +277 -0
- package/node_modules/@cap-js/asyncapi/lib/compile/message.js +13 -0
- package/node_modules/@cap-js/asyncapi/lib/compile/utils.js +77 -0
- package/node_modules/@cap-js/asyncapi/package.json +34 -0
- package/node_modules/@cap-js/db-service/CHANGELOG.md +768 -0
- package/node_modules/@cap-js/db-service/LICENSE +201 -0
- package/node_modules/@cap-js/db-service/README.md +26 -0
- package/node_modules/@cap-js/db-service/index.js +19 -0
- package/node_modules/@cap-js/db-service/lib/InsertResults.js +122 -0
- package/node_modules/@cap-js/db-service/lib/SQLService.js +581 -0
- package/node_modules/@cap-js/db-service/lib/common/DatabaseService.js +179 -0
- package/node_modules/@cap-js/db-service/lib/common/factory.d.ts +5 -0
- package/node_modules/@cap-js/db-service/lib/common/generic-pool.js +310 -0
- package/node_modules/@cap-js/db-service/lib/common/session-context.js +46 -0
- package/node_modules/@cap-js/db-service/lib/converters.d.ts +24 -0
- package/node_modules/@cap-js/db-service/lib/cql-functions.js +464 -0
- package/node_modules/@cap-js/db-service/lib/cqn2pql.js +116 -0
- package/node_modules/@cap-js/db-service/lib/cqn2sql.js +1612 -0
- package/node_modules/@cap-js/db-service/lib/cqn4sql.js +2895 -0
- package/node_modules/@cap-js/db-service/lib/deep-queries.js +290 -0
- package/node_modules/@cap-js/db-service/lib/fill-in-keys.js +75 -0
- package/node_modules/@cap-js/db-service/lib/infer/cqn.d.ts +42 -0
- package/node_modules/@cap-js/db-service/lib/infer/index.js +1290 -0
- package/node_modules/@cap-js/db-service/lib/infer/join-tree.js +278 -0
- package/node_modules/@cap-js/db-service/lib/infer/pseudos.js +24 -0
- package/node_modules/@cap-js/db-service/lib/search.js +220 -0
- package/node_modules/@cap-js/db-service/lib/utils.js +177 -0
- package/node_modules/@cap-js/db-service/package.json +36 -0
- package/node_modules/@cap-js/openapi/LICENSE +201 -0
- package/node_modules/@cap-js/openapi/README.md +96 -0
- package/node_modules/@cap-js/openapi/index.js +5 -0
- package/node_modules/@cap-js/openapi/lib/compile/csdl-types.d.ts +546 -0
- package/node_modules/@cap-js/openapi/lib/compile/csdl.js +212 -0
- package/node_modules/@cap-js/openapi/lib/compile/csdl2openapi.js +2753 -0
- package/node_modules/@cap-js/openapi/lib/compile/diagram.js +112 -0
- package/node_modules/@cap-js/openapi/lib/compile/index.js +259 -0
- package/node_modules/@cap-js/openapi/lib/compile/string-util.js +20 -0
- package/node_modules/@cap-js/openapi/lib/compile/types.d.ts +117 -0
- package/node_modules/@cap-js/openapi/package.json +44 -0
- package/node_modules/@cap-js/sqlite/CHANGELOG.md +404 -0
- package/node_modules/@cap-js/sqlite/LICENSE +201 -0
- package/node_modules/@cap-js/sqlite/README.md +34 -0
- package/node_modules/@cap-js/sqlite/cds-plugin.js +0 -0
- package/node_modules/@cap-js/sqlite/index.js +2 -0
- package/node_modules/@cap-js/sqlite/lib/SQLiteService.js +324 -0
- package/node_modules/@cap-js/sqlite/lib/cql-functions.js +160 -0
- package/node_modules/@cap-js/sqlite/lib/node-sqlite.js +36 -0
- package/node_modules/@cap-js/sqlite/lib/session.json +3 -0
- package/node_modules/@cap-js/sqlite/lib/sql.js.js +99 -0
- package/node_modules/@cap-js/sqlite/package.json +68 -0
- package/node_modules/@eslint/js/LICENSE +19 -0
- package/node_modules/@eslint/js/README.md +103 -0
- package/node_modules/@eslint/js/package.json +44 -0
- package/node_modules/@eslint/js/src/configs/eslint-all.js +210 -0
- package/node_modules/@eslint/js/src/configs/eslint-recommended.js +75 -0
- package/node_modules/@eslint/js/src/index.js +23 -0
- package/node_modules/@eslint/js/types/index.d.ts +14 -0
- package/node_modules/@sap/cds/CHANGELOG.md +810 -0
- package/node_modules/@sap/cds/LICENSE +32 -0
- package/node_modules/@sap/cds/README.md +13 -0
- package/node_modules/@sap/cds/_i18n/i18n.properties +113 -0
- package/node_modules/@sap/cds/_i18n/i18n_ar.properties +58 -0
- package/node_modules/@sap/cds/_i18n/i18n_bg.properties +58 -0
- package/node_modules/@sap/cds/_i18n/i18n_cs.properties +58 -0
- package/node_modules/@sap/cds/_i18n/i18n_da.properties +58 -0
- package/node_modules/@sap/cds/_i18n/i18n_de.properties +58 -0
- package/node_modules/@sap/cds/_i18n/i18n_el.properties +58 -0
- package/node_modules/@sap/cds/_i18n/i18n_en.properties +58 -0
- package/node_modules/@sap/cds/_i18n/i18n_en_US_saptrc.properties +58 -0
- package/node_modules/@sap/cds/_i18n/i18n_es.properties +58 -0
- package/node_modules/@sap/cds/_i18n/i18n_es_MX.properties +58 -0
- package/node_modules/@sap/cds/_i18n/i18n_fi.properties +58 -0
- package/node_modules/@sap/cds/_i18n/i18n_fr.properties +58 -0
- package/node_modules/@sap/cds/_i18n/i18n_he.properties +58 -0
- package/node_modules/@sap/cds/_i18n/i18n_hr.properties +58 -0
- package/node_modules/@sap/cds/_i18n/i18n_hu.properties +58 -0
- package/node_modules/@sap/cds/_i18n/i18n_it.properties +58 -0
- package/node_modules/@sap/cds/_i18n/i18n_ja.properties +58 -0
- package/node_modules/@sap/cds/_i18n/i18n_kk.properties +58 -0
- package/node_modules/@sap/cds/_i18n/i18n_ko.properties +58 -0
- package/node_modules/@sap/cds/_i18n/i18n_ms.properties +58 -0
- package/node_modules/@sap/cds/_i18n/i18n_nl.properties +58 -0
- package/node_modules/@sap/cds/_i18n/i18n_no.properties +58 -0
- package/node_modules/@sap/cds/_i18n/i18n_pl.properties +58 -0
- package/node_modules/@sap/cds/_i18n/i18n_pt.properties +58 -0
- package/node_modules/@sap/cds/_i18n/i18n_ro.properties +58 -0
- package/node_modules/@sap/cds/_i18n/i18n_ru.properties +58 -0
- package/node_modules/@sap/cds/_i18n/i18n_sh.properties +58 -0
- package/node_modules/@sap/cds/_i18n/i18n_sk.properties +58 -0
- package/node_modules/@sap/cds/_i18n/i18n_sl.properties +58 -0
- package/node_modules/@sap/cds/_i18n/i18n_sv.properties +58 -0
- package/node_modules/@sap/cds/_i18n/i18n_th.properties +58 -0
- package/node_modules/@sap/cds/_i18n/i18n_tr.properties +58 -0
- package/node_modules/@sap/cds/_i18n/i18n_uk.properties +58 -0
- package/node_modules/@sap/cds/_i18n/i18n_vi.properties +58 -0
- package/node_modules/@sap/cds/_i18n/i18n_zh_CN.properties +58 -0
- package/node_modules/@sap/cds/_i18n/i18n_zh_TW.properties +58 -0
- package/node_modules/@sap/cds/_i18n/messages.properties +196 -0
- package/node_modules/@sap/cds/_i18n/messages_ar.properties +103 -0
- package/node_modules/@sap/cds/_i18n/messages_bg.properties +103 -0
- package/node_modules/@sap/cds/_i18n/messages_cs.properties +103 -0
- package/node_modules/@sap/cds/_i18n/messages_da.properties +103 -0
- package/node_modules/@sap/cds/_i18n/messages_de.properties +103 -0
- package/node_modules/@sap/cds/_i18n/messages_el.properties +103 -0
- package/node_modules/@sap/cds/_i18n/messages_en.properties +103 -0
- package/node_modules/@sap/cds/_i18n/messages_en_US_saptrc.properties +103 -0
- package/node_modules/@sap/cds/_i18n/messages_es.properties +103 -0
- package/node_modules/@sap/cds/_i18n/messages_es_MX.properties +103 -0
- package/node_modules/@sap/cds/_i18n/messages_fi.properties +103 -0
- package/node_modules/@sap/cds/_i18n/messages_fr.properties +103 -0
- package/node_modules/@sap/cds/_i18n/messages_he.properties +103 -0
- package/node_modules/@sap/cds/_i18n/messages_hr.properties +103 -0
- package/node_modules/@sap/cds/_i18n/messages_hu.properties +103 -0
- package/node_modules/@sap/cds/_i18n/messages_it.properties +103 -0
- package/node_modules/@sap/cds/_i18n/messages_ja.properties +103 -0
- package/node_modules/@sap/cds/_i18n/messages_kk.properties +103 -0
- package/node_modules/@sap/cds/_i18n/messages_ko.properties +103 -0
- package/node_modules/@sap/cds/_i18n/messages_ms.properties +103 -0
- package/node_modules/@sap/cds/_i18n/messages_nl.properties +103 -0
- package/node_modules/@sap/cds/_i18n/messages_no.properties +103 -0
- package/node_modules/@sap/cds/_i18n/messages_pl.properties +103 -0
- package/node_modules/@sap/cds/_i18n/messages_pt.properties +103 -0
- package/node_modules/@sap/cds/_i18n/messages_ro.properties +103 -0
- package/node_modules/@sap/cds/_i18n/messages_ru.properties +103 -0
- package/node_modules/@sap/cds/_i18n/messages_sh.properties +103 -0
- package/node_modules/@sap/cds/_i18n/messages_sk.properties +103 -0
- package/node_modules/@sap/cds/_i18n/messages_sl.properties +103 -0
- package/node_modules/@sap/cds/_i18n/messages_sv.properties +103 -0
- package/node_modules/@sap/cds/_i18n/messages_th.properties +103 -0
- package/node_modules/@sap/cds/_i18n/messages_tr.properties +103 -0
- package/node_modules/@sap/cds/_i18n/messages_uk.properties +103 -0
- package/node_modules/@sap/cds/_i18n/messages_vi.properties +103 -0
- package/node_modules/@sap/cds/_i18n/messages_zh_CN.properties +103 -0
- package/node_modules/@sap/cds/_i18n/messages_zh_TW.properties +103 -0
- package/node_modules/@sap/cds/app/etc/livereload.js +9 -0
- package/node_modules/@sap/cds/app/favicon.ico +0 -0
- package/node_modules/@sap/cds/app/index.css +132 -0
- package/node_modules/@sap/cds/app/index.html +32 -0
- package/node_modules/@sap/cds/app/index.js +100 -0
- package/node_modules/@sap/cds/bin/args.js +34 -0
- package/node_modules/@sap/cds/bin/deploy.js +29 -0
- package/node_modules/@sap/cds/bin/serve.js +398 -0
- package/node_modules/@sap/cds/common.cds +216 -0
- package/node_modules/@sap/cds/eslint.config.mjs +153 -0
- package/node_modules/@sap/cds/lib/compile/cds-compile.js +63 -0
- package/node_modules/@sap/cds/lib/compile/cdsc.js +166 -0
- package/node_modules/@sap/cds/lib/compile/etc/_localized.js +75 -0
- package/node_modules/@sap/cds/lib/compile/etc/csv.js +87 -0
- package/node_modules/@sap/cds/lib/compile/etc/properties.js +44 -0
- package/node_modules/@sap/cds/lib/compile/etc/yaml.js +9 -0
- package/node_modules/@sap/cds/lib/compile/extend.js +39 -0
- package/node_modules/@sap/cds/lib/compile/for/assert.js +64 -0
- package/node_modules/@sap/cds/lib/compile/for/direct_crud.js +49 -0
- package/node_modules/@sap/cds/lib/compile/for/flows.js +396 -0
- package/node_modules/@sap/cds/lib/compile/for/java.js +49 -0
- package/node_modules/@sap/cds/lib/compile/for/lean_drafts.js +230 -0
- package/node_modules/@sap/cds/lib/compile/for/nodejs.js +94 -0
- package/node_modules/@sap/cds/lib/compile/for/odata.js +19 -0
- package/node_modules/@sap/cds/lib/compile/for/sql.js +9 -0
- package/node_modules/@sap/cds/lib/compile/load.js +59 -0
- package/node_modules/@sap/cds/lib/compile/minify.js +112 -0
- package/node_modules/@sap/cds/lib/compile/parse.js +140 -0
- package/node_modules/@sap/cds/lib/compile/resolve.js +166 -0
- package/node_modules/@sap/cds/lib/compile/to/cdl.js +22 -0
- package/node_modules/@sap/cds/lib/compile/to/csn.js +80 -0
- package/node_modules/@sap/cds/lib/compile/to/edm-files.js +80 -0
- package/node_modules/@sap/cds/lib/compile/to/edm.js +97 -0
- package/node_modules/@sap/cds/lib/compile/to/hana.js +31 -0
- package/node_modules/@sap/cds/lib/compile/to/hdbtabledata.js +152 -0
- package/node_modules/@sap/cds/lib/compile/to/json.js +63 -0
- package/node_modules/@sap/cds/lib/compile/to/sql.js +62 -0
- package/node_modules/@sap/cds/lib/compile/to/srvinfo.js +135 -0
- package/node_modules/@sap/cds/lib/core/classes.js +230 -0
- package/node_modules/@sap/cds/lib/core/entities.js +132 -0
- package/node_modules/@sap/cds/lib/core/linked-csn.js +188 -0
- package/node_modules/@sap/cds/lib/core/types.js +67 -0
- package/node_modules/@sap/cds/lib/dbs/cds-deploy.js +420 -0
- package/node_modules/@sap/cds/lib/env/cds-env.js +584 -0
- package/node_modules/@sap/cds/lib/env/cds-requires.js +315 -0
- package/node_modules/@sap/cds/lib/env/compat.js +95 -0
- package/node_modules/@sap/cds/lib/env/defaults.js +227 -0
- package/node_modules/@sap/cds/lib/env/schemas/cds-package.js +27 -0
- package/node_modules/@sap/cds/lib/env/schemas/cds-rc.js +1124 -0
- package/node_modules/@sap/cds/lib/env/schemas/index.js +12 -0
- package/node_modules/@sap/cds/lib/env/serviceBindings.js +157 -0
- package/node_modules/@sap/cds/lib/i18n/bundles.js +114 -0
- package/node_modules/@sap/cds/lib/i18n/files.js +140 -0
- package/node_modules/@sap/cds/lib/i18n/index.js +63 -0
- package/node_modules/@sap/cds/lib/i18n/locale.js +42 -0
- package/node_modules/@sap/cds/lib/i18n/localize.js +137 -0
- package/node_modules/@sap/cds/lib/index.js +156 -0
- package/node_modules/@sap/cds/lib/log/cds-error.js +114 -0
- package/node_modules/@sap/cds/lib/log/cds-log.js +215 -0
- package/node_modules/@sap/cds/lib/log/format/aspects/als.js +27 -0
- package/node_modules/@sap/cds/lib/log/format/aspects/cf.js +36 -0
- package/node_modules/@sap/cds/lib/log/format/aspects/cls.js +19 -0
- package/node_modules/@sap/cds/lib/log/format/json.js +143 -0
- package/node_modules/@sap/cds/lib/log/service/index.js +96 -0
- package/node_modules/@sap/cds/lib/log/service/model.cds +21 -0
- package/node_modules/@sap/cds/lib/log/service/test.http +16 -0
- package/node_modules/@sap/cds/lib/log/service/vue.html +73 -0
- package/node_modules/@sap/cds/lib/plugins.js +45 -0
- package/node_modules/@sap/cds/lib/ql/CREATE.js +30 -0
- package/node_modules/@sap/cds/lib/ql/DELETE.js +26 -0
- package/node_modules/@sap/cds/lib/ql/DROP.js +33 -0
- package/node_modules/@sap/cds/lib/ql/INSERT.js +57 -0
- package/node_modules/@sap/cds/lib/ql/SELECT.js +207 -0
- package/node_modules/@sap/cds/lib/ql/UPDATE.js +111 -0
- package/node_modules/@sap/cds/lib/ql/UPSERT.js +17 -0
- package/node_modules/@sap/cds/lib/ql/Whereable.js +58 -0
- package/node_modules/@sap/cds/lib/ql/cds-ql.js +228 -0
- package/node_modules/@sap/cds/lib/ql/cds.ql-Query.js +111 -0
- package/node_modules/@sap/cds/lib/ql/cds.ql-infer.js +148 -0
- package/node_modules/@sap/cds/lib/ql/cds.ql-predicates.js +136 -0
- package/node_modules/@sap/cds/lib/ql/cds.ql-projections.js +111 -0
- package/node_modules/@sap/cds/lib/ql/cqn.d.ts +146 -0
- package/node_modules/@sap/cds/lib/req/assert.js +71 -0
- package/node_modules/@sap/cds/lib/req/context.js +216 -0
- package/node_modules/@sap/cds/lib/req/event.js +14 -0
- package/node_modules/@sap/cds/lib/req/request.js +183 -0
- package/node_modules/@sap/cds/lib/req/response.js +54 -0
- package/node_modules/@sap/cds/lib/req/spawn.js +38 -0
- package/node_modules/@sap/cds/lib/req/user.js +77 -0
- package/node_modules/@sap/cds/lib/req/validate.js +339 -0
- package/node_modules/@sap/cds/lib/srv/bindings.js +170 -0
- package/node_modules/@sap/cds/lib/srv/cds-connect.js +79 -0
- package/node_modules/@sap/cds/lib/srv/cds-serve.js +84 -0
- package/node_modules/@sap/cds/lib/srv/cds.Service.js +214 -0
- package/node_modules/@sap/cds/lib/srv/factory.js +78 -0
- package/node_modules/@sap/cds/lib/srv/middlewares/auth/basic-auth.js +55 -0
- package/node_modules/@sap/cds/lib/srv/middlewares/auth/dummy-auth.js +8 -0
- package/node_modules/@sap/cds/lib/srv/middlewares/auth/ias-auth.js +167 -0
- package/node_modules/@sap/cds/lib/srv/middlewares/auth/index.js +53 -0
- package/node_modules/@sap/cds/lib/srv/middlewares/auth/jwt-auth.js +89 -0
- package/node_modules/@sap/cds/lib/srv/middlewares/auth/mocked-users.js +73 -0
- package/node_modules/@sap/cds/lib/srv/middlewares/auth/xssec.js +7 -0
- package/node_modules/@sap/cds/lib/srv/middlewares/cds-context.js +17 -0
- package/node_modules/@sap/cds/lib/srv/middlewares/ctx-model.js +25 -0
- package/node_modules/@sap/cds/lib/srv/middlewares/errors.js +42 -0
- package/node_modules/@sap/cds/lib/srv/middlewares/index.js +51 -0
- package/node_modules/@sap/cds/lib/srv/middlewares/trace.js +117 -0
- package/node_modules/@sap/cds/lib/srv/protocols/hcql.js +170 -0
- package/node_modules/@sap/cds/lib/srv/protocols/http.js +207 -0
- package/node_modules/@sap/cds/lib/srv/protocols/index.js +186 -0
- package/node_modules/@sap/cds/lib/srv/protocols/odata-v4.js +1 -0
- package/node_modules/@sap/cds/lib/srv/protocols/rest.js +1 -0
- package/node_modules/@sap/cds/lib/srv/srv-dispatch.js +117 -0
- package/node_modules/@sap/cds/lib/srv/srv-handlers.js +173 -0
- package/node_modules/@sap/cds/lib/srv/srv-methods.js +86 -0
- package/node_modules/@sap/cds/lib/srv/srv-models.js +167 -0
- package/node_modules/@sap/cds/lib/srv/srv-resolve.js +21 -0
- package/node_modules/@sap/cds/lib/srv/srv-tx.js +204 -0
- package/node_modules/@sap/cds/lib/test/cds-test.js +5 -0
- package/node_modules/@sap/cds/lib/utils/cds-utils.js +411 -0
- package/node_modules/@sap/cds/lib/utils/colors.js +56 -0
- package/node_modules/@sap/cds/lib/utils/csv-reader.js +100 -0
- package/node_modules/@sap/cds/lib/utils/extend.js +20 -0
- package/node_modules/@sap/cds/lib/utils/inflect.js +25 -0
- package/node_modules/@sap/cds/lib/utils/lazify.js +33 -0
- package/node_modules/@sap/cds/lib/utils/tar-lib.js +58 -0
- package/node_modules/@sap/cds/lib/utils/tar-win.js +106 -0
- package/node_modules/@sap/cds/lib/utils/tar.js +180 -0
- package/node_modules/@sap/cds/lib/utils/version.js +11 -0
- package/node_modules/@sap/cds/libx/_runtime/cds.js +25 -0
- package/node_modules/@sap/cds/libx/_runtime/common/Service.js +96 -0
- package/node_modules/@sap/cds/libx/_runtime/common/aspects/Association.js +82 -0
- package/node_modules/@sap/cds/libx/_runtime/common/aspects/any.js +34 -0
- package/node_modules/@sap/cds/libx/_runtime/common/aspects/entity.js +41 -0
- package/node_modules/@sap/cds/libx/_runtime/common/aspects/service.js +25 -0
- package/node_modules/@sap/cds/libx/_runtime/common/constants/draft.js +48 -0
- package/node_modules/@sap/cds/libx/_runtime/common/constants/events.js +6 -0
- package/node_modules/@sap/cds/libx/_runtime/common/generic/assert.js +225 -0
- package/node_modules/@sap/cds/libx/_runtime/common/generic/auth/autoexpose.js +26 -0
- package/node_modules/@sap/cds/libx/_runtime/common/generic/auth/capabilities.js +87 -0
- package/node_modules/@sap/cds/libx/_runtime/common/generic/auth/expand.js +74 -0
- package/node_modules/@sap/cds/libx/_runtime/common/generic/auth/index.js +84 -0
- package/node_modules/@sap/cds/libx/_runtime/common/generic/auth/insertOnly.js +13 -0
- package/node_modules/@sap/cds/libx/_runtime/common/generic/auth/readOnly.js +13 -0
- package/node_modules/@sap/cds/libx/_runtime/common/generic/auth/requires.js +40 -0
- package/node_modules/@sap/cds/libx/_runtime/common/generic/auth/restrict.js +296 -0
- package/node_modules/@sap/cds/libx/_runtime/common/generic/auth/restrictions.js +124 -0
- package/node_modules/@sap/cds/libx/_runtime/common/generic/auth/service.js +18 -0
- package/node_modules/@sap/cds/libx/_runtime/common/generic/auth/utils.js +200 -0
- package/node_modules/@sap/cds/libx/_runtime/common/generic/crud.js +82 -0
- package/node_modules/@sap/cds/libx/_runtime/common/generic/etag.js +100 -0
- package/node_modules/@sap/cds/libx/_runtime/common/generic/flows.js +235 -0
- package/node_modules/@sap/cds/libx/_runtime/common/generic/input.js +441 -0
- package/node_modules/@sap/cds/libx/_runtime/common/generic/media.js +25 -0
- package/node_modules/@sap/cds/libx/_runtime/common/generic/paging.js +47 -0
- package/node_modules/@sap/cds/libx/_runtime/common/generic/sorting.js +83 -0
- package/node_modules/@sap/cds/libx/_runtime/common/generic/temporal.js +86 -0
- package/node_modules/@sap/cds/libx/_runtime/common/utils/binary.js +9 -0
- package/node_modules/@sap/cds/libx/_runtime/common/utils/compareJson.js +378 -0
- package/node_modules/@sap/cds/libx/_runtime/common/utils/copy.js +44 -0
- package/node_modules/@sap/cds/libx/_runtime/common/utils/cqn.js +73 -0
- package/node_modules/@sap/cds/libx/_runtime/common/utils/csn.js +153 -0
- package/node_modules/@sap/cds/libx/_runtime/common/utils/differ.js +183 -0
- package/node_modules/@sap/cds/libx/_runtime/common/utils/draft.js +82 -0
- package/node_modules/@sap/cds/libx/_runtime/common/utils/entityFromCqn.js +42 -0
- package/node_modules/@sap/cds/libx/_runtime/common/utils/etag.js +30 -0
- package/node_modules/@sap/cds/libx/_runtime/common/utils/foreignKeyPropagations.js +299 -0
- package/node_modules/@sap/cds/libx/_runtime/common/utils/keys.js +105 -0
- package/node_modules/@sap/cds/libx/_runtime/common/utils/normalizeTimestamp.js +34 -0
- package/node_modules/@sap/cds/libx/_runtime/common/utils/postProcess.js +102 -0
- package/node_modules/@sap/cds/libx/_runtime/common/utils/propagateForeignKeys.js +108 -0
- package/node_modules/@sap/cds/libx/_runtime/common/utils/resolveStructured.js +58 -0
- package/node_modules/@sap/cds/libx/_runtime/common/utils/resolveView.js +732 -0
- package/node_modules/@sap/cds/libx/_runtime/common/utils/rewriteAsterisks.js +199 -0
- package/node_modules/@sap/cds/libx/_runtime/common/utils/rowUUIDGenerator.js +21 -0
- package/node_modules/@sap/cds/libx/_runtime/common/utils/streamProp.js +72 -0
- package/node_modules/@sap/cds/libx/_runtime/common/utils/structured.js +314 -0
- package/node_modules/@sap/cds/libx/_runtime/common/utils/template.js +154 -0
- package/node_modules/@sap/cds/libx/_runtime/common/utils/templateDelimiter.js +1 -0
- package/node_modules/@sap/cds/libx/_runtime/common/utils/templateProcessor.js +83 -0
- package/node_modules/@sap/cds/libx/_runtime/common/utils/templateProcessorPathSerializer.js +51 -0
- package/node_modules/@sap/cds/libx/_runtime/common/utils/vcap.js +28 -0
- package/node_modules/@sap/cds/libx/_runtime/common/utils/waitingTime.js +14 -0
- package/node_modules/@sap/cds/libx/_runtime/fiori/lean-draft.js +2604 -0
- package/node_modules/@sap/cds/libx/_runtime/messaging/AMQPWebhookMessaging.js +71 -0
- package/node_modules/@sap/cds/libx/_runtime/messaging/common-utils/AMQPClient.js +90 -0
- package/node_modules/@sap/cds/libx/_runtime/messaging/common-utils/appId.js +9 -0
- package/node_modules/@sap/cds/libx/_runtime/messaging/common-utils/authorizedRequest.js +66 -0
- package/node_modules/@sap/cds/libx/_runtime/messaging/common-utils/connections.js +81 -0
- package/node_modules/@sap/cds/libx/_runtime/messaging/common-utils/normalizeIncomingMessage.js +29 -0
- package/node_modules/@sap/cds/libx/_runtime/messaging/common-utils/optionsForSubdomain.js +14 -0
- package/node_modules/@sap/cds/libx/_runtime/messaging/common-utils/runInSequence.js +6 -0
- package/node_modules/@sap/cds/libx/_runtime/messaging/composite.js +47 -0
- package/node_modules/@sap/cds/libx/_runtime/messaging/enterprise-messaging-shared.js +61 -0
- package/node_modules/@sap/cds/libx/_runtime/messaging/enterprise-messaging-utils/EMManagement.js +473 -0
- package/node_modules/@sap/cds/libx/_runtime/messaging/enterprise-messaging-utils/cloudEvents.js +31 -0
- package/node_modules/@sap/cds/libx/_runtime/messaging/enterprise-messaging-utils/getTenantInfo.js +24 -0
- package/node_modules/@sap/cds/libx/_runtime/messaging/enterprise-messaging-utils/options-management.js +24 -0
- package/node_modules/@sap/cds/libx/_runtime/messaging/enterprise-messaging-utils/options-messaging.js +73 -0
- package/node_modules/@sap/cds/libx/_runtime/messaging/enterprise-messaging-utils/registerEndpoints.js +158 -0
- package/node_modules/@sap/cds/libx/_runtime/messaging/enterprise-messaging.js +209 -0
- package/node_modules/@sap/cds/libx/_runtime/messaging/file-based.js +104 -0
- package/node_modules/@sap/cds/libx/_runtime/messaging/http-utils/token.js +75 -0
- package/node_modules/@sap/cds/libx/_runtime/messaging/kafka.js +273 -0
- package/node_modules/@sap/cds/libx/_runtime/messaging/message-queuing-utils/options-management.js +34 -0
- package/node_modules/@sap/cds/libx/_runtime/messaging/message-queuing-utils/options-messaging.js +40 -0
- package/node_modules/@sap/cds/libx/_runtime/messaging/message-queuing.js +238 -0
- package/node_modules/@sap/cds/libx/_runtime/messaging/redis-messaging.js +95 -0
- package/node_modules/@sap/cds/libx/_runtime/messaging/service.js +147 -0
- package/node_modules/@sap/cds/libx/_runtime/remote/Service.js +330 -0
- package/node_modules/@sap/cds/libx/_runtime/remote/utils/client.js +287 -0
- package/node_modules/@sap/cds/libx/_runtime/remote/utils/cloudSdkProvider.js +60 -0
- package/node_modules/@sap/cds/libx/_runtime/remote/utils/data.js +177 -0
- package/node_modules/@sap/cds/libx/_runtime/remote/utils/fetchClient.js +180 -0
- package/node_modules/@sap/cds/libx/_runtime/remote/utils/query.js +196 -0
- package/node_modules/@sap/cds/libx/_runtime/ucl/Service.js +450 -0
- package/node_modules/@sap/cds/libx/_runtime/ucl/queries.js +61 -0
- package/node_modules/@sap/cds/libx/common/utils/path.js +47 -0
- package/node_modules/@sap/cds/libx/common/utils/streaming.js +72 -0
- package/node_modules/@sap/cds/libx/http/body-parser.js +44 -0
- package/node_modules/@sap/cds/libx/http/location.js +42 -0
- package/node_modules/@sap/cds/libx/http/put.js +36 -0
- package/node_modules/@sap/cds/libx/odata/ODataAdapter.js +129 -0
- package/node_modules/@sap/cds/libx/odata/index.js +137 -0
- package/node_modules/@sap/cds/libx/odata/middleware/batch.js +695 -0
- package/node_modules/@sap/cds/libx/odata/middleware/create.js +113 -0
- package/node_modules/@sap/cds/libx/odata/middleware/delete.js +73 -0
- package/node_modules/@sap/cds/libx/odata/middleware/error.js +19 -0
- package/node_modules/@sap/cds/libx/odata/middleware/metadata.js +138 -0
- package/node_modules/@sap/cds/libx/odata/middleware/operation.js +192 -0
- package/node_modules/@sap/cds/libx/odata/middleware/parse.js +49 -0
- package/node_modules/@sap/cds/libx/odata/middleware/read.js +311 -0
- package/node_modules/@sap/cds/libx/odata/middleware/service-document.js +79 -0
- package/node_modules/@sap/cds/libx/odata/middleware/stream.js +180 -0
- package/node_modules/@sap/cds/libx/odata/middleware/update.js +178 -0
- package/node_modules/@sap/cds/libx/odata/parse/afterburner.js +1033 -0
- package/node_modules/@sap/cds/libx/odata/parse/cqn2odata.js +615 -0
- package/node_modules/@sap/cds/libx/odata/parse/grammar.peggy +1416 -0
- package/node_modules/@sap/cds/libx/odata/parse/multipartToJson.js +220 -0
- package/node_modules/@sap/cds/libx/odata/parse/parser.js +1 -0
- package/node_modules/@sap/cds/libx/odata/utils/etag.js +21 -0
- package/node_modules/@sap/cds/libx/odata/utils/index.js +348 -0
- package/node_modules/@sap/cds/libx/odata/utils/metadata.js +223 -0
- package/node_modules/@sap/cds/libx/odata/utils/normalizeTimeData.js +43 -0
- package/node_modules/@sap/cds/libx/odata/utils/odataBind.js +43 -0
- package/node_modules/@sap/cds/libx/odata/utils/postProcess.js +86 -0
- package/node_modules/@sap/cds/libx/odata/utils/readAfterWrite.js +144 -0
- package/node_modules/@sap/cds/libx/odata/utils/result.js +91 -0
- package/node_modules/@sap/cds/libx/queue/JobExecutor.js +80 -0
- package/node_modules/@sap/cds/libx/queue/SchedulingService.js +213 -0
- package/node_modules/@sap/cds/libx/queue/TaskRunner.js +92 -0
- package/node_modules/@sap/cds/libx/queue/api.js +28 -0
- package/node_modules/@sap/cds/libx/queue/consts.js +13 -0
- package/node_modules/@sap/cds/libx/queue/index.js +608 -0
- package/node_modules/@sap/cds/libx/queue/processing.js +645 -0
- package/node_modules/@sap/cds/libx/queue/utils.js +159 -0
- package/node_modules/@sap/cds/libx/rest/RestAdapter.js +102 -0
- package/node_modules/@sap/cds/libx/rest/middleware/create.js +50 -0
- package/node_modules/@sap/cds/libx/rest/middleware/delete.js +17 -0
- package/node_modules/@sap/cds/libx/rest/middleware/operation.js +54 -0
- package/node_modules/@sap/cds/libx/rest/middleware/parse.js +142 -0
- package/node_modules/@sap/cds/libx/rest/middleware/read.js +34 -0
- package/node_modules/@sap/cds/libx/rest/middleware/update.js +28 -0
- package/node_modules/@sap/cds/libx/rest/middleware/upsert.js +35 -0
- package/node_modules/@sap/cds/libx/rest/post-processing.js +33 -0
- package/node_modules/@sap/cds/libx/rest/pre-processing.js +28 -0
- package/node_modules/@sap/cds/package.json +49 -0
- package/node_modules/@sap/cds/server.js +119 -0
- package/node_modules/@sap/cds/srv/app-service.js +1 -0
- package/node_modules/@sap/cds/srv/db-service.js +1 -0
- package/node_modules/@sap/cds/srv/msg-service.js +1 -0
- package/node_modules/@sap/cds/srv/outbox.cds +15 -0
- package/node_modules/@sap/cds/srv/remote-service.js +1 -0
- package/node_modules/@sap/cds/srv/ucl-service.cds +58 -0
- package/node_modules/@sap/cds/srv/ucl-service.js +1 -0
- package/node_modules/@sap/cds/tasks/enterprise-messaging-deploy.js +52 -0
- package/node_modules/@sap/cds-compiler/CHANGELOG.md +987 -0
- package/node_modules/@sap/cds-compiler/LICENSE +32 -0
- package/node_modules/@sap/cds-compiler/README.md +44 -0
- package/node_modules/@sap/cds-compiler/bin/cds_update_identifiers.js +141 -0
- package/node_modules/@sap/cds-compiler/bin/cdsc.js +776 -0
- package/node_modules/@sap/cds-compiler/bin/cdshi.js +83 -0
- package/node_modules/@sap/cds-compiler/bin/cdsse.js +210 -0
- package/node_modules/@sap/cds-compiler/bin/cdsv2m.js +52 -0
- package/node_modules/@sap/cds-compiler/doc/API.md +16 -0
- package/node_modules/@sap/cds-compiler/doc/IncompatibleChanges_v5.md +436 -0
- package/node_modules/@sap/cds-compiler/doc/IncompatibleChanges_v6.md +659 -0
- package/node_modules/@sap/cds-compiler/doc/IncompatibleChanges_v7.md +639 -0
- package/node_modules/@sap/cds-compiler/doc/Versioning.md +79 -0
- package/node_modules/@sap/cds-compiler/lib/api/main.js +1415 -0
- package/node_modules/@sap/cds-compiler/lib/api/options.js +275 -0
- package/node_modules/@sap/cds-compiler/lib/api/validate.js +209 -0
- package/node_modules/@sap/cds-compiler/lib/base/builtins.js +122 -0
- package/node_modules/@sap/cds-compiler/lib/base/cloneCsn.js +226 -0
- package/node_modules/@sap/cds-compiler/lib/base/csnRefs.js +1420 -0
- package/node_modules/@sap/cds-compiler/lib/base/error.js +30 -0
- package/node_modules/@sap/cds-compiler/lib/base/keywords.js +930 -0
- package/node_modules/@sap/cds-compiler/lib/base/location.js +304 -0
- package/node_modules/@sap/cds-compiler/lib/base/message-registry.js +1635 -0
- package/node_modules/@sap/cds-compiler/lib/base/messages.js +1994 -0
- package/node_modules/@sap/cds-compiler/lib/base/meta.js +10 -0
- package/node_modules/@sap/cds-compiler/lib/base/model-api.js +82 -0
- package/node_modules/@sap/cds-compiler/lib/base/optionProcessor.js +593 -0
- package/node_modules/@sap/cds-compiler/lib/base/specialOptions.js +125 -0
- package/node_modules/@sap/cds-compiler/lib/base/trace.js +91 -0
- package/node_modules/@sap/cds-compiler/lib/base/xprAsTree.js +85 -0
- package/node_modules/@sap/cds-compiler/lib/checks/actionsFunctions.js +128 -0
- package/node_modules/@sap/cds-compiler/lib/checks/annotationsOData.js +126 -0
- package/node_modules/@sap/cds-compiler/lib/checks/arrayOfs.js +52 -0
- package/node_modules/@sap/cds-compiler/lib/checks/assocOutsideService.js +29 -0
- package/node_modules/@sap/cds-compiler/lib/checks/cdsMap.js +27 -0
- package/node_modules/@sap/cds-compiler/lib/checks/cdsPersistence.js +24 -0
- package/node_modules/@sap/cds-compiler/lib/checks/checkForTypes.js +35 -0
- package/node_modules/@sap/cds-compiler/lib/checks/checkPathsInStoredCalcElement.js +84 -0
- package/node_modules/@sap/cds-compiler/lib/checks/defaultValues.js +34 -0
- package/node_modules/@sap/cds-compiler/lib/checks/elements.js +345 -0
- package/node_modules/@sap/cds-compiler/lib/checks/enricher.js +225 -0
- package/node_modules/@sap/cds-compiler/lib/checks/enums.js +31 -0
- package/node_modules/@sap/cds-compiler/lib/checks/existsExpressionsOnlyForeignKeys.js +77 -0
- package/node_modules/@sap/cds-compiler/lib/checks/existsInForbiddenPlaces.js +32 -0
- package/node_modules/@sap/cds-compiler/lib/checks/existsMustEndInAssoc.js +32 -0
- package/node_modules/@sap/cds-compiler/lib/checks/existsMustNotStartWithDollarSelf.js +31 -0
- package/node_modules/@sap/cds-compiler/lib/checks/featureFlags.js +69 -0
- package/node_modules/@sap/cds-compiler/lib/checks/foreignKeys.js +80 -0
- package/node_modules/@sap/cds-compiler/lib/checks/hasPersistedElements.js +69 -0
- package/node_modules/@sap/cds-compiler/lib/checks/invalidTarget.js +64 -0
- package/node_modules/@sap/cds-compiler/lib/checks/managedInType.js +84 -0
- package/node_modules/@sap/cds-compiler/lib/checks/managedWithoutKeys.js +20 -0
- package/node_modules/@sap/cds-compiler/lib/checks/manyExpand.js +28 -0
- package/node_modules/@sap/cds-compiler/lib/checks/manyNavigations.js +33 -0
- package/node_modules/@sap/cds-compiler/lib/checks/nullableKeys.js +13 -0
- package/node_modules/@sap/cds-compiler/lib/checks/onConditions.js +268 -0
- package/node_modules/@sap/cds-compiler/lib/checks/parameters.js +46 -0
- package/node_modules/@sap/cds-compiler/lib/checks/queryNoDbArtifacts.js +225 -0
- package/node_modules/@sap/cds-compiler/lib/checks/selectItems.js +57 -0
- package/node_modules/@sap/cds-compiler/lib/checks/sql-snippets.js +117 -0
- package/node_modules/@sap/cds-compiler/lib/checks/structuredAnnoExpressions.js +26 -0
- package/node_modules/@sap/cds-compiler/lib/checks/typeParameters.js +162 -0
- package/node_modules/@sap/cds-compiler/lib/checks/types.js +198 -0
- package/node_modules/@sap/cds-compiler/lib/checks/utils.js +96 -0
- package/node_modules/@sap/cds-compiler/lib/checks/validator.js +292 -0
- package/node_modules/@sap/cds-compiler/lib/compiler/assert-consistency.js +1115 -0
- package/node_modules/@sap/cds-compiler/lib/compiler/base.js +153 -0
- package/node_modules/@sap/cds-compiler/lib/compiler/builtins.js +499 -0
- package/node_modules/@sap/cds-compiler/lib/compiler/checks.js +1447 -0
- package/node_modules/@sap/cds-compiler/lib/compiler/cycle-detector.js +135 -0
- package/node_modules/@sap/cds-compiler/lib/compiler/define.js +1190 -0
- package/node_modules/@sap/cds-compiler/lib/compiler/dictionaries.js +109 -0
- package/node_modules/@sap/cds-compiler/lib/compiler/extend.js +1928 -0
- package/node_modules/@sap/cds-compiler/lib/compiler/finalize-parse-cdl.js +170 -0
- package/node_modules/@sap/cds-compiler/lib/compiler/generate.js +910 -0
- package/node_modules/@sap/cds-compiler/lib/compiler/index.js +695 -0
- package/node_modules/@sap/cds-compiler/lib/compiler/kick-start.js +142 -0
- package/node_modules/@sap/cds-compiler/lib/compiler/lsp-api.js +506 -0
- package/node_modules/@sap/cds-compiler/lib/compiler/moduleLayers.js +75 -0
- package/node_modules/@sap/cds-compiler/lib/compiler/populate.js +1425 -0
- package/node_modules/@sap/cds-compiler/lib/compiler/propagator.js +457 -0
- package/node_modules/@sap/cds-compiler/lib/compiler/resolve.js +1996 -0
- package/node_modules/@sap/cds-compiler/lib/compiler/shared.js +2272 -0
- package/node_modules/@sap/cds-compiler/lib/compiler/tweak-assocs.js +1388 -0
- package/node_modules/@sap/cds-compiler/lib/compiler/utils.js +929 -0
- package/node_modules/@sap/cds-compiler/lib/compiler/xpr-rewrite.js +778 -0
- package/node_modules/@sap/cds-compiler/lib/compiler/xsn-model.js +50 -0
- package/node_modules/@sap/cds-compiler/lib/edm/EdmPrimitiveTypeDefinitions.js +263 -0
- package/node_modules/@sap/cds-compiler/lib/edm/annotations/edmJson.js +1245 -0
- package/node_modules/@sap/cds-compiler/lib/edm/annotations/genericTranslation.js +1873 -0
- package/node_modules/@sap/cds-compiler/lib/edm/annotations/preprocessAnnotations.js +308 -0
- package/node_modules/@sap/cds-compiler/lib/edm/annotations/vocabularyDefinitions.js +166 -0
- package/node_modules/@sap/cds-compiler/lib/edm/csn2edm.js +1226 -0
- package/node_modules/@sap/cds-compiler/lib/edm/edm.js +1628 -0
- package/node_modules/@sap/cds-compiler/lib/edm/edmAnnoPreprocessor.js +312 -0
- package/node_modules/@sap/cds-compiler/lib/edm/edmInboundChecks.js +182 -0
- package/node_modules/@sap/cds-compiler/lib/edm/edmPreprocessor.js +2320 -0
- package/node_modules/@sap/cds-compiler/lib/edm/edmUtils.js +949 -0
- package/node_modules/@sap/cds-compiler/lib/gen/BaseParser.js +892 -0
- package/node_modules/@sap/cds-compiler/lib/gen/CdlGrammar.checksum +1 -0
- package/node_modules/@sap/cds-compiler/lib/gen/CdlParser.js +4549 -0
- package/node_modules/@sap/cds-compiler/lib/gen/Dictionary.json +5124 -0
- package/node_modules/@sap/cds-compiler/lib/gen/cdlKeywords.json +26 -0
- package/node_modules/@sap/cds-compiler/lib/json/csnVersion.js +53 -0
- package/node_modules/@sap/cds-compiler/lib/json/from-csn.js +2217 -0
- package/node_modules/@sap/cds-compiler/lib/json/to-csn.js +1621 -0
- package/node_modules/@sap/cds-compiler/lib/language/docCommentParser.js +181 -0
- package/node_modules/@sap/cds-compiler/lib/language/genericAntlrParser.js +0 -0
- package/node_modules/@sap/cds-compiler/lib/language/multiLineStringParser.js +525 -0
- package/node_modules/@sap/cds-compiler/lib/language/textUtils.js +61 -0
- package/node_modules/@sap/cds-compiler/lib/main.d.ts +1631 -0
- package/node_modules/@sap/cds-compiler/lib/main.js +212 -0
- package/node_modules/@sap/cds-compiler/lib/model/csnUtils.js +1532 -0
- package/node_modules/@sap/cds-compiler/lib/model/sortViews.js +121 -0
- package/node_modules/@sap/cds-compiler/lib/modelCompare/compare.js +475 -0
- package/node_modules/@sap/cds-compiler/lib/modelCompare/utils/filter.js +230 -0
- package/node_modules/@sap/cds-compiler/lib/parsers/AstBuildingParser.js +1696 -0
- package/node_modules/@sap/cds-compiler/lib/parsers/Lexer.js +253 -0
- package/node_modules/@sap/cds-compiler/lib/parsers/XprTree.js +269 -0
- package/node_modules/@sap/cds-compiler/lib/parsers/identifiers.js +22 -0
- package/node_modules/@sap/cds-compiler/lib/parsers/index.js +120 -0
- package/node_modules/@sap/cds-compiler/lib/render/DuplicateChecker.js +126 -0
- package/node_modules/@sap/cds-compiler/lib/render/manageConstraints.js +257 -0
- package/node_modules/@sap/cds-compiler/lib/render/toCdl.js +3084 -0
- package/node_modules/@sap/cds-compiler/lib/render/toRename.js +115 -0
- package/node_modules/@sap/cds-compiler/lib/render/toSql.js +1789 -0
- package/node_modules/@sap/cds-compiler/lib/render/utils/common.js +784 -0
- package/node_modules/@sap/cds-compiler/lib/render/utils/delta.js +291 -0
- package/node_modules/@sap/cds-compiler/lib/render/utils/operators.js +160 -0
- package/node_modules/@sap/cds-compiler/lib/render/utils/pretty.js +337 -0
- package/node_modules/@sap/cds-compiler/lib/render/utils/sql.js +225 -0
- package/node_modules/@sap/cds-compiler/lib/render/utils/standardDatabaseFunctions.js +834 -0
- package/node_modules/@sap/cds-compiler/lib/render/utils/stringEscapes.js +112 -0
- package/node_modules/@sap/cds-compiler/lib/render/utils/unique.js +52 -0
- package/node_modules/@sap/cds-compiler/lib/sql-identifier.js +109 -0
- package/node_modules/@sap/cds-compiler/lib/tool-lib/enrichCsn.js +383 -0
- package/node_modules/@sap/cds-compiler/lib/tool-lib/index.js +14 -0
- package/node_modules/@sap/cds-compiler/lib/tool-lib/inspectModelStatistics.js +82 -0
- package/node_modules/@sap/cds-compiler/lib/tool-lib/inspectPropagation.js +191 -0
- package/node_modules/@sap/cds-compiler/lib/tool-lib/inspectUtils.js +44 -0
- package/node_modules/@sap/cds-compiler/lib/tool-lib/revealInternalProperties.js +419 -0
- package/node_modules/@sap/cds-compiler/lib/transform/addTenantFields.js +431 -0
- package/node_modules/@sap/cds-compiler/lib/transform/db/applyTransformations.js +444 -0
- package/node_modules/@sap/cds-compiler/lib/transform/db/assertUnique.js +307 -0
- package/node_modules/@sap/cds-compiler/lib/transform/db/associations.js +270 -0
- package/node_modules/@sap/cds-compiler/lib/transform/db/assocsToQueries/normalizeFrom.js +33 -0
- package/node_modules/@sap/cds-compiler/lib/transform/db/assocsToQueries/transformExists.js +401 -0
- package/node_modules/@sap/cds-compiler/lib/transform/db/assocsToQueries/utils.js +449 -0
- package/node_modules/@sap/cds-compiler/lib/transform/db/backlinks.js +333 -0
- package/node_modules/@sap/cds-compiler/lib/transform/db/cdsPersistence.js +127 -0
- package/node_modules/@sap/cds-compiler/lib/transform/db/constraints.js +619 -0
- package/node_modules/@sap/cds-compiler/lib/transform/db/expansion.js +913 -0
- package/node_modules/@sap/cds-compiler/lib/transform/db/flattening.js +814 -0
- package/node_modules/@sap/cds-compiler/lib/transform/db/groupByOrderBy.js +84 -0
- package/node_modules/@sap/cds-compiler/lib/transform/db/killAnnotations.js +44 -0
- package/node_modules/@sap/cds-compiler/lib/transform/db/processSqlServices.js +135 -0
- package/node_modules/@sap/cds-compiler/lib/transform/db/rewriteCalculatedElements.js +507 -0
- package/node_modules/@sap/cds-compiler/lib/transform/db/temporal.js +263 -0
- package/node_modules/@sap/cds-compiler/lib/transform/db/views.js +404 -0
- package/node_modules/@sap/cds-compiler/lib/transform/draft/db.js +381 -0
- package/node_modules/@sap/cds-compiler/lib/transform/draft/odata.js +302 -0
- package/node_modules/@sap/cds-compiler/lib/transform/effective/annotations.js +342 -0
- package/node_modules/@sap/cds-compiler/lib/transform/effective/associations.js +81 -0
- package/node_modules/@sap/cds-compiler/lib/transform/effective/flattening.js +124 -0
- package/node_modules/@sap/cds-compiler/lib/transform/effective/main.js +164 -0
- package/node_modules/@sap/cds-compiler/lib/transform/effective/misc.js +106 -0
- package/node_modules/@sap/cds-compiler/lib/transform/effective/queries.js +40 -0
- package/node_modules/@sap/cds-compiler/lib/transform/effective/service.js +34 -0
- package/node_modules/@sap/cds-compiler/lib/transform/effective/types.js +168 -0
- package/node_modules/@sap/cds-compiler/lib/transform/featureFlags.js +10 -0
- package/node_modules/@sap/cds-compiler/lib/transform/fioriTreeViews.js +196 -0
- package/node_modules/@sap/cds-compiler/lib/transform/forOdata.js +687 -0
- package/node_modules/@sap/cds-compiler/lib/transform/forRelationalDB.js +658 -0
- package/node_modules/@sap/cds-compiler/lib/transform/localized.js +758 -0
- package/node_modules/@sap/cds-compiler/lib/transform/odata/adaptAnnotationRefs.js +101 -0
- package/node_modules/@sap/cds-compiler/lib/transform/odata/createForeignKeys.js +203 -0
- package/node_modules/@sap/cds-compiler/lib/transform/odata/flattening.js +730 -0
- package/node_modules/@sap/cds-compiler/lib/transform/odata/foreignKeyRefsInXprAnnos.js +124 -0
- package/node_modules/@sap/cds-compiler/lib/transform/odata/toFinalBaseType.js +297 -0
- package/node_modules/@sap/cds-compiler/lib/transform/odata/typesExposure.js +455 -0
- package/node_modules/@sap/cds-compiler/lib/transform/odata/utils.js +65 -0
- package/node_modules/@sap/cds-compiler/lib/transform/transformUtils.js +1000 -0
- package/node_modules/@sap/cds-compiler/lib/transform/translateAssocsToJoins.js +1905 -0
- package/node_modules/@sap/cds-compiler/lib/transform/tupleExpansion.js +548 -0
- package/node_modules/@sap/cds-compiler/lib/transform/universalCsn/coreComputed.js +194 -0
- package/node_modules/@sap/cds-compiler/lib/transform/universalCsn/universalCsnEnricher.js +800 -0
- package/node_modules/@sap/cds-compiler/lib/transform/universalCsn/utils.js +63 -0
- package/node_modules/@sap/cds-compiler/lib/utils/file.js +267 -0
- package/node_modules/@sap/cds-compiler/lib/utils/lazyload.js +37 -0
- package/node_modules/@sap/cds-compiler/lib/utils/moduleResolve.js +608 -0
- package/node_modules/@sap/cds-compiler/lib/utils/node-helpers.js +44 -0
- package/node_modules/@sap/cds-compiler/lib/utils/objectUtils.js +112 -0
- package/node_modules/@sap/cds-compiler/lib/utils/optionProcessorHelper.js +652 -0
- package/node_modules/@sap/cds-compiler/lib/utils/shuffle.js +54 -0
- package/node_modules/@sap/cds-compiler/lib/utils/term.js +102 -0
- package/node_modules/@sap/cds-compiler/lib/utils/timetrace.js +158 -0
- package/node_modules/@sap/cds-compiler/package.json +30 -0
- package/node_modules/@sap/cds-compiler/share/messages/.markdownlintrc +13 -0
- package/node_modules/@sap/cds-compiler/share/messages/README.md +62 -0
- package/node_modules/@sap/cds-compiler/share/messages/anno-duplicate-unrelated-layer.md +69 -0
- package/node_modules/@sap/cds-compiler/share/messages/anno-missing-rewrite.md +45 -0
- package/node_modules/@sap/cds-compiler/share/messages/check-proper-type-of.md +46 -0
- package/node_modules/@sap/cds-compiler/share/messages/def-duplicate-autoexposed.md +82 -0
- package/node_modules/@sap/cds-compiler/share/messages/def-missing-type.md +48 -0
- package/node_modules/@sap/cds-compiler/share/messages/def-upcoming-virtual-change.md +55 -0
- package/node_modules/@sap/cds-compiler/share/messages/extend-repeated-intralayer.md +47 -0
- package/node_modules/@sap/cds-compiler/share/messages/extend-unrelated-layer.md +58 -0
- package/node_modules/@sap/cds-compiler/share/messages/file-unexpected-case-mismatch.md +61 -0
- package/node_modules/@sap/cds-compiler/share/messages/message-explanations.json +22 -0
- package/node_modules/@sap/cds-compiler/share/messages/redirected-to-ambiguous.md +72 -0
- package/node_modules/@sap/cds-compiler/share/messages/redirected-to-complex.md +66 -0
- package/node_modules/@sap/cds-compiler/share/messages/redirected-to-unrelated.md +78 -0
- package/node_modules/@sap/cds-compiler/share/messages/rewrite-not-supported.md +61 -0
- package/node_modules/@sap/cds-compiler/share/messages/rewrite-undefined-key.md +94 -0
- package/node_modules/@sap/cds-compiler/share/messages/syntax-expecting-unsigned-int.md +41 -0
- package/node_modules/@sap/cds-compiler/share/messages/type-missing-enum-value.md +59 -0
- package/node_modules/@sap/cds-compiler/share/messages/wildcard-excluding-one.md +37 -0
- package/node_modules/@sap/cds-fiori/CHANGELOG.md +163 -0
- package/node_modules/@sap/cds-fiori/LICENSE +32 -0
- package/node_modules/@sap/cds-fiori/README.md +11 -0
- package/node_modules/@sap/cds-fiori/app/preview.js +360 -0
- package/node_modules/@sap/cds-fiori/app/routes.js +74 -0
- package/node_modules/@sap/cds-fiori/cds-plugin.js +5 -0
- package/node_modules/@sap/cds-fiori/package.json +42 -0
- package/node_modules/@sap/cds-mtxs/CHANGELOG.md +1322 -0
- package/node_modules/@sap/cds-mtxs/LICENSE +32 -0
- package/node_modules/@sap/cds-mtxs/README.md +9 -0
- package/node_modules/@sap/cds-mtxs/bin/cds-mtx-migrate.js +115 -0
- package/node_modules/@sap/cds-mtxs/bin/cds-mtx.js +134 -0
- package/node_modules/@sap/cds-mtxs/cds-plugin.js +30 -0
- package/node_modules/@sap/cds-mtxs/db/extensions.cds +10 -0
- package/node_modules/@sap/cds-mtxs/db/t0.cds +46 -0
- package/node_modules/@sap/cds-mtxs/lib/index.js +26 -0
- package/node_modules/@sap/cds-mtxs/lib/migration/extension-project-builder.js +129 -0
- package/node_modules/@sap/cds-mtxs/lib/migration/extension-project.js +89 -0
- package/node_modules/@sap/cds-mtxs/lib/migration/migration.js +485 -0
- package/node_modules/@sap/cds-mtxs/lib/migration/mtx-adapter.js +230 -0
- package/node_modules/@sap/cds-mtxs/lib/utils.js +255 -0
- package/node_modules/@sap/cds-mtxs/package.json +257 -0
- package/node_modules/@sap/cds-mtxs/srv/bootstrap.cds +2 -0
- package/node_modules/@sap/cds-mtxs/srv/bootstrap.js +33 -0
- package/node_modules/@sap/cds-mtxs/srv/cf/abstract-provisioning-service.js +307 -0
- package/node_modules/@sap/cds-mtxs/srv/cf/saas-provisioning-service.cds +30 -0
- package/node_modules/@sap/cds-mtxs/srv/cf/saas-provisioning-service.js +59 -0
- package/node_modules/@sap/cds-mtxs/srv/cf/sms-provisioning-service.cds +37 -0
- package/node_modules/@sap/cds-mtxs/srv/cf/sms-provisioning-service.js +115 -0
- package/node_modules/@sap/cds-mtxs/srv/config.js +16 -0
- package/node_modules/@sap/cds-mtxs/srv/dberrors.js +45 -0
- package/node_modules/@sap/cds-mtxs/srv/deployment-service.cds +54 -0
- package/node_modules/@sap/cds-mtxs/srv/deployment-service.js +26 -0
- package/node_modules/@sap/cds-mtxs/srv/extensibility/compat/update.js +95 -0
- package/node_modules/@sap/cds-mtxs/srv/extensibility/linter/allowlist.js +292 -0
- package/node_modules/@sap/cds-mtxs/srv/extensibility/linter/annotations.js +168 -0
- package/node_modules/@sap/cds-mtxs/srv/extensibility/linter/config.js +98 -0
- package/node_modules/@sap/cds-mtxs/srv/extensibility/linter/index.js +76 -0
- package/node_modules/@sap/cds-mtxs/srv/extensibility/linter/message.js +57 -0
- package/node_modules/@sap/cds-mtxs/srv/extensibility/linter/namespace.js +94 -0
- package/node_modules/@sap/cds-mtxs/srv/extensibility-service.cds +82 -0
- package/node_modules/@sap/cds-mtxs/srv/extensibility-service.js +550 -0
- package/node_modules/@sap/cds-mtxs/srv/jobs-service.cds +37 -0
- package/node_modules/@sap/cds-mtxs/srv/jobs-service.js +346 -0
- package/node_modules/@sap/cds-mtxs/srv/model-provider.cds +85 -0
- package/node_modules/@sap/cds-mtxs/srv/model-provider.js +412 -0
- package/node_modules/@sap/cds-mtxs/srv/plugins/common.js +130 -0
- package/node_modules/@sap/cds-mtxs/srv/plugins/hana/ctnr-mgr-base.js +154 -0
- package/node_modules/@sap/cds-mtxs/srv/plugins/hana/hdi-ctnr-mgr.js +15 -0
- package/node_modules/@sap/cds-mtxs/srv/plugins/hana/hdi.js +167 -0
- package/node_modules/@sap/cds-mtxs/srv/plugins/hana/srv-mgr.js +323 -0
- package/node_modules/@sap/cds-mtxs/srv/plugins/hana/tms.js +542 -0
- package/node_modules/@sap/cds-mtxs/srv/plugins/hana.js +381 -0
- package/node_modules/@sap/cds-mtxs/srv/plugins/sqlite.js +122 -0
- package/node_modules/@sap/cds-mtxs/srv/worker/load.js +14 -0
- package/node_modules/@sap/cds-mtxs/srv/worker/pool.js +54 -0
- package/node_modules/@sap/hdi/CHANGELOG.md +159 -0
- package/node_modules/@sap/hdi/LICENSE +38 -0
- package/node_modules/@sap/hdi/README.md +244 -0
- package/node_modules/@sap/hdi/index.js +58 -0
- package/node_modules/@sap/hdi/lib/ResultTuple.js +33 -0
- package/node_modules/@sap/hdi/lib/main/Container.js +1107 -0
- package/node_modules/@sap/hdi/lib/main/ContainerGroup.js +147 -0
- package/node_modules/@sap/hdi/lib/main/ContainerGroupBase.js +788 -0
- package/node_modules/@sap/hdi/lib/main/HDI.js +437 -0
- package/node_modules/@sap/hdi/lib/main/HDIBase.js +592 -0
- package/node_modules/@sap/hdi/lib/main/promises/ContainerGroupPromises.js +401 -0
- package/node_modules/@sap/hdi/lib/main/promises/ContainerPromises.js +454 -0
- package/node_modules/@sap/hdi/lib/main/promises/HDIPromises.js +218 -0
- package/node_modules/@sap/hdi/lib/parameter/APIPrivilege.js +47 -0
- package/node_modules/@sap/hdi/lib/parameter/File.js +25 -0
- package/node_modules/@sap/hdi/lib/parameter/FileWithContent.js +24 -0
- package/node_modules/@sap/hdi/lib/parameter/Folder.js +25 -0
- package/node_modules/@sap/hdi/lib/parameter/FolderWithContent.js +24 -0
- package/node_modules/@sap/hdi/lib/parameter/HDIObject.js +40 -0
- package/node_modules/@sap/hdi/lib/parameter/LibraryConfiguration.js +62 -0
- package/node_modules/@sap/hdi/lib/parameter/Parameter.js +73 -0
- package/node_modules/@sap/hdi/lib/parameter/Path.js +39 -0
- package/node_modules/@sap/hdi/lib/parameter/PathParameter.js +43 -0
- package/node_modules/@sap/hdi/lib/parameter/PathWithContent.js +41 -0
- package/node_modules/@sap/hdi/lib/parameter/SchemaPrivilege.js +44 -0
- package/node_modules/@sap/hdi/lib/parameter/SchemaRole.js +44 -0
- package/node_modules/@sap/hdi/lib/parameter/TableRow.js +72 -0
- package/node_modules/@sap/hdi/lib/parameter/parameterCheck.js +41 -0
- package/node_modules/@sap/hdi/lib/result/DependencyResultTuple.js +105 -0
- package/node_modules/@sap/hdi/lib/result/LibraryInformationResultTuple.js +62 -0
- package/node_modules/@sap/hdi/lib/result/MakeGroupResultTuple.js +57 -0
- package/node_modules/@sap/hdi/lib/result/MetadataContentResultTuple.js +56 -0
- package/node_modules/@sap/hdi/lib/result/MetadataResult.js +40 -0
- package/node_modules/@sap/hdi/lib/result/MetadataResultTuple.js +37 -0
- package/node_modules/@sap/hdi/lib/result/StatusResultTuple.js +59 -0
- package/node_modules/@sap/hdi/lib/util/Constants.js +55 -0
- package/node_modules/@sap/hdi/lib/util/callback.js +18 -0
- package/node_modules/@sap/hdi/lib/util/connection.js +20 -0
- package/node_modules/@sap/hdi/lib/util/schema_escaping.js +11 -0
- package/node_modules/@sap/hdi/lib/util/typeCheck.js +43 -0
- package/node_modules/@sap/hdi/lib/util/wrap.js +23 -0
- package/node_modules/@sap/hdi/package.json +37 -0
- package/node_modules/@sap/hdi-deploy/CHANGELOG.md +672 -0
- package/node_modules/@sap/hdi-deploy/LICENSE +38 -0
- package/node_modules/@sap/hdi-deploy/README.md +1237 -0
- package/node_modules/@sap/hdi-deploy/deploy.js +1070 -0
- package/node_modules/@sap/hdi-deploy/lib/IgnoreFile.js +56 -0
- package/node_modules/@sap/hdi-deploy/lib/arguments.js +203 -0
- package/node_modules/@sap/hdi-deploy/lib/check_client.js +31 -0
- package/node_modules/@sap/hdi-deploy/lib/client-info.js +80 -0
- package/node_modules/@sap/hdi-deploy/lib/connections.js +4 -0
- package/node_modules/@sap/hdi-deploy/lib/content.js +478 -0
- package/node_modules/@sap/hdi-deploy/lib/deploy.js +113 -0
- package/node_modules/@sap/hdi-deploy/lib/features.client.js +59 -0
- package/node_modules/@sap/hdi-deploy/lib/fileWalker.js +58 -0
- package/node_modules/@sap/hdi-deploy/lib/fileWorker.js +85 -0
- package/node_modules/@sap/hdi-deploy/lib/filters/PathFilter.js +211 -0
- package/node_modules/@sap/hdi-deploy/lib/filters/regex-helper.js +87 -0
- package/node_modules/@sap/hdi-deploy/lib/hana-helper.js +1055 -0
- package/node_modules/@sap/hdi-deploy/lib/hdi.js +77 -0
- package/node_modules/@sap/hdi-deploy/lib/hdiTables.js +32 -0
- package/node_modules/@sap/hdi-deploy/lib/hdi_utils.js +356 -0
- package/node_modules/@sap/hdi-deploy/lib/info.js +44 -0
- package/node_modules/@sap/hdi-deploy/lib/json-comment-stripper.js +147 -0
- package/node_modules/@sap/hdi-deploy/lib/liveness-ping.js +53 -0
- package/node_modules/@sap/hdi-deploy/lib/logger.js +434 -0
- package/node_modules/@sap/hdi-deploy/lib/make.js +460 -0
- package/node_modules/@sap/hdi-deploy/lib/messages.hdi.js +7 -0
- package/node_modules/@sap/hdi-deploy/lib/options.js +49 -0
- package/node_modules/@sap/hdi-deploy/lib/ownership_checker.js +87 -0
- package/node_modules/@sap/hdi-deploy/lib/paths.js +71 -0
- package/node_modules/@sap/hdi-deploy/lib/privileges/grantor.js +94 -0
- package/node_modules/@sap/hdi-deploy/lib/privileges/privilege_utils.js +414 -0
- package/node_modules/@sap/hdi-deploy/lib/privileges/privileges.js +73 -0
- package/node_modules/@sap/hdi-deploy/lib/privileges/revoker.js +94 -0
- package/node_modules/@sap/hdi-deploy/lib/privileges/strategies.js +1049 -0
- package/node_modules/@sap/hdi-deploy/lib/services.js +253 -0
- package/node_modules/@sap/hdi-deploy/lib/shared-password-service.js +62 -0
- package/node_modules/@sap/hdi-deploy/lib/status.js +113 -0
- package/node_modules/@sap/hdi-deploy/lib/tasks.js +985 -0
- package/node_modules/@sap/hdi-deploy/lib/template.js +91 -0
- package/node_modules/@sap/hdi-deploy/lib/utils.js +717 -0
- package/node_modules/@sap/hdi-deploy/lib/version.cloud.js +71 -0
- package/node_modules/@sap/hdi-deploy/lib/version.container-api.js +100 -0
- package/node_modules/@sap/hdi-deploy/lib/version.hdi-version.js +101 -0
- package/node_modules/@sap/hdi-deploy/lib/version.server.js +145 -0
- package/node_modules/@sap/hdi-deploy/lib/zdm/generator/Generator.js +598 -0
- package/node_modules/@sap/hdi-deploy/lib/zdm/generator/artifact-visitors/AccessArtifactParserVisitor.js +68 -0
- package/node_modules/@sap/hdi-deploy/lib/zdm/generator/artifact-visitors/ArtifactVisitor.js +11 -0
- package/node_modules/@sap/hdi-deploy/lib/zdm/generator/artifact-visitors/DataArtifactParserVisitor.js +75 -0
- package/node_modules/@sap/hdi-deploy/lib/zdm/generator/file-artifacts/AccessContainerDuplicate.js +16 -0
- package/node_modules/@sap/hdi-deploy/lib/zdm/generator/file-artifacts/DataContainerDuplicate.js +16 -0
- package/node_modules/@sap/hdi-deploy/lib/zdm/generator/file-artifacts/FileArtifact.js +228 -0
- package/node_modules/@sap/hdi-deploy/lib/zdm/generator/file-artifacts/FileArtifactsFactory.js +243 -0
- package/node_modules/@sap/hdi-deploy/lib/zdm/generator/file-artifacts/HDBCDS.js +182 -0
- package/node_modules/@sap/hdi-deploy/lib/zdm/generator/file-artifacts/HDBRole.js +26 -0
- package/node_modules/@sap/hdi-deploy/lib/zdm/generator/file-artifacts/HDBSequence.js +29 -0
- package/node_modules/@sap/hdi-deploy/lib/zdm/generator/file-artifacts/HDBTable.js +82 -0
- package/node_modules/@sap/hdi-deploy/lib/zdm/generator/file-artifacts/HDIConfig.js +203 -0
- package/node_modules/@sap/hdi-deploy/lib/zdm/generator/file-artifacts/HDINamespace.js +16 -0
- package/node_modules/@sap/hdi-deploy/lib/zdm/generator/model/Model.js +306 -0
- package/node_modules/@sap/hdi-deploy/lib/zdm/generator/model/ModelSerializer.js +132 -0
- package/node_modules/@sap/hdi-deploy/lib/zdm/generator/model-artifacts/Column.js +19 -0
- package/node_modules/@sap/hdi-deploy/lib/zdm/generator/model-artifacts/Context.js +117 -0
- package/node_modules/@sap/hdi-deploy/lib/zdm/generator/model-artifacts/DataControlLanguageModelArtifact.js +14 -0
- package/node_modules/@sap/hdi-deploy/lib/zdm/generator/model-artifacts/DerivedType.js +23 -0
- package/node_modules/@sap/hdi-deploy/lib/zdm/generator/model-artifacts/Entity.js +14 -0
- package/node_modules/@sap/hdi-deploy/lib/zdm/generator/model-artifacts/ModelArtifact.js +22 -0
- package/node_modules/@sap/hdi-deploy/lib/zdm/generator/model-artifacts/ModelArtifactsFactory.js +80 -0
- package/node_modules/@sap/hdi-deploy/lib/zdm/generator/model-artifacts/StructuredType.js +23 -0
- package/node_modules/@sap/hdi-deploy/lib/zdm/generator/model-artifacts/TableModelArtifact.js +41 -0
- package/node_modules/@sap/hdi-deploy/lib/zdm/generator/model-artifacts/View.js +14 -0
- package/node_modules/@sap/hdi-deploy/lib/zdm/resources/cfg/projectionViewConfig.hdbprojectionviewconfig.template +8 -0
- package/node_modules/@sap/hdi-deploy/lib/zdm/resources/cfg/synonym.hdbsynonymconfig.template +8 -0
- package/node_modules/@sap/hdi-deploy/lib/zdm/resources/cfg/zdm_data_access.hdbgrants.template +10 -0
- package/node_modules/@sap/hdi-deploy/lib/zdm/resources/src/namespace.hdinamespace.template +4 -0
- package/node_modules/@sap/hdi-deploy/lib/zdm/resources/src/projectionView.hdbprojectionview.template +5 -0
- package/node_modules/@sap/hdi-deploy/lib/zdm/resources/src/synonym.hdbsynonym.template +4 -0
- package/node_modules/@sap/hdi-deploy/lib/zdm/resources/src/zdm_access.hdbrole.template +10 -0
- package/node_modules/@sap/hdi-deploy/lib/zdm/resources/src/zdm_sequences.hdbrole.template +12 -0
- package/node_modules/@sap/hdi-deploy/lib/zdm/tasks/FinalizeTask.js +80 -0
- package/node_modules/@sap/hdi-deploy/lib/zdm/tasks/InstallTask.js +93 -0
- package/node_modules/@sap/hdi-deploy/lib/zdm/tasks/StartTask.js +101 -0
- package/node_modules/@sap/hdi-deploy/lib/zdm/tasks/Task.js +110 -0
- package/node_modules/@sap/hdi-deploy/lib/zdm/tasks/taskFactory.js +23 -0
- package/node_modules/@sap/hdi-deploy/lib/zdm/zdmDeployer.js +34 -0
- package/node_modules/@sap/hdi-deploy/lib/zdm/zdmUtils.js +257 -0
- package/node_modules/@sap/hdi-deploy/library.js +129 -0
- package/node_modules/@sap/hdi-deploy/package.json +42 -0
- package/node_modules/@sap/xsenv/CHANGELOG.md +236 -0
- package/node_modules/@sap/xsenv/LICENSE +37 -0
- package/node_modules/@sap/xsenv/README.md +548 -0
- package/node_modules/@sap/xsenv/index.js +17 -0
- package/node_modules/@sap/xsenv/lib/cacert.js +26 -0
- package/node_modules/@sap/xsenv/lib/cfservice.js +59 -0
- package/node_modules/@sap/xsenv/lib/filter.js +42 -0
- package/node_modules/@sap/xsenv/lib/k8sservice.js +121 -0
- package/node_modules/@sap/xsenv/lib/loadEnv.js +31 -0
- package/node_modules/@sap/xsenv/lib/redactServiceData.js +32 -0
- package/node_modules/@sap/xsenv/lib/serviceBindingService.js +146 -0
- package/node_modules/@sap/xsenv/lib/xsservices.js +180 -0
- package/node_modules/@sap/xsenv/migration.md +49 -0
- package/node_modules/@sap/xsenv/package.json +49 -0
- package/node_modules/accepts/HISTORY.md +250 -0
- package/node_modules/accepts/LICENSE +23 -0
- package/node_modules/accepts/README.md +140 -0
- package/node_modules/accepts/index.js +238 -0
- package/node_modules/accepts/package.json +47 -0
- package/node_modules/assert-plus/AUTHORS +6 -0
- package/node_modules/assert-plus/CHANGES.md +14 -0
- package/node_modules/assert-plus/README.md +162 -0
- package/node_modules/assert-plus/assert.js +211 -0
- package/node_modules/assert-plus/package.json +23 -0
- package/node_modules/async/CHANGELOG.md +351 -0
- package/node_modules/async/LICENSE +19 -0
- package/node_modules/async/README.md +59 -0
- package/node_modules/async/all.js +119 -0
- package/node_modules/async/allLimit.js +46 -0
- package/node_modules/async/allSeries.js +45 -0
- package/node_modules/async/any.js +122 -0
- package/node_modules/async/anyLimit.js +47 -0
- package/node_modules/async/anySeries.js +46 -0
- package/node_modules/async/apply.js +11 -0
- package/node_modules/async/applyEach.js +57 -0
- package/node_modules/async/applyEachSeries.js +37 -0
- package/node_modules/async/asyncify.js +118 -0
- package/node_modules/async/auto.js +333 -0
- package/node_modules/async/autoInject.js +182 -0
- package/node_modules/async/bower.json +17 -0
- package/node_modules/async/cargo.js +63 -0
- package/node_modules/async/cargoQueue.js +71 -0
- package/node_modules/async/compose.js +55 -0
- package/node_modules/async/concat.js +115 -0
- package/node_modules/async/concatLimit.js +60 -0
- package/node_modules/async/concatSeries.js +41 -0
- package/node_modules/async/constant.js +14 -0
- package/node_modules/async/detect.js +96 -0
- package/node_modules/async/detectLimit.js +48 -0
- package/node_modules/async/detectSeries.js +47 -0
- package/node_modules/async/dir.js +43 -0
- package/node_modules/async/dist/async.js +6061 -0
- package/node_modules/async/dist/async.min.js +1 -0
- package/node_modules/async/dist/async.mjs +5948 -0
- package/node_modules/async/doDuring.js +68 -0
- package/node_modules/async/doUntil.js +46 -0
- package/node_modules/async/doWhilst.js +68 -0
- package/node_modules/async/during.js +78 -0
- package/node_modules/async/each.js +129 -0
- package/node_modules/async/eachLimit.js +50 -0
- package/node_modules/async/eachOf.js +185 -0
- package/node_modules/async/eachOfLimit.js +47 -0
- package/node_modules/async/eachOfSeries.js +39 -0
- package/node_modules/async/eachSeries.js +44 -0
- package/node_modules/async/ensureAsync.js +67 -0
- package/node_modules/async/every.js +119 -0
- package/node_modules/async/everyLimit.js +46 -0
- package/node_modules/async/everySeries.js +45 -0
- package/node_modules/async/filter.js +93 -0
- package/node_modules/async/filterLimit.js +45 -0
- package/node_modules/async/filterSeries.js +43 -0
- package/node_modules/async/find.js +96 -0
- package/node_modules/async/findLimit.js +48 -0
- package/node_modules/async/findSeries.js +47 -0
- package/node_modules/async/flatMap.js +115 -0
- package/node_modules/async/flatMapLimit.js +60 -0
- package/node_modules/async/flatMapSeries.js +41 -0
- package/node_modules/async/foldl.js +153 -0
- package/node_modules/async/foldr.js +41 -0
- package/node_modules/async/forEach.js +129 -0
- package/node_modules/async/forEachLimit.js +50 -0
- package/node_modules/async/forEachOf.js +185 -0
- package/node_modules/async/forEachOfLimit.js +47 -0
- package/node_modules/async/forEachOfSeries.js +39 -0
- package/node_modules/async/forEachSeries.js +44 -0
- package/node_modules/async/forever.js +68 -0
- package/node_modules/async/groupBy.js +108 -0
- package/node_modules/async/groupByLimit.js +71 -0
- package/node_modules/async/groupBySeries.js +36 -0
- package/node_modules/async/index.js +588 -0
- package/node_modules/async/inject.js +153 -0
- package/node_modules/async/internal/DoublyLinkedList.js +92 -0
- package/node_modules/async/internal/Heap.js +120 -0
- package/node_modules/async/internal/applyEach.js +29 -0
- package/node_modules/async/internal/asyncEachOfLimit.js +75 -0
- package/node_modules/async/internal/awaitify.js +28 -0
- package/node_modules/async/internal/breakLoop.js +10 -0
- package/node_modules/async/internal/consoleFunc.js +31 -0
- package/node_modules/async/internal/createTester.js +40 -0
- package/node_modules/async/internal/eachOfLimit.js +90 -0
- package/node_modules/async/internal/filter.js +55 -0
- package/node_modules/async/internal/getIterator.js +11 -0
- package/node_modules/async/internal/initialParams.js +14 -0
- package/node_modules/async/internal/isArrayLike.js +10 -0
- package/node_modules/async/internal/iterator.js +57 -0
- package/node_modules/async/internal/map.js +30 -0
- package/node_modules/async/internal/once.js +17 -0
- package/node_modules/async/internal/onlyOnce.js +15 -0
- package/node_modules/async/internal/parallel.js +34 -0
- package/node_modules/async/internal/promiseCallback.js +23 -0
- package/node_modules/async/internal/queue.js +294 -0
- package/node_modules/async/internal/range.js +14 -0
- package/node_modules/async/internal/reject.js +26 -0
- package/node_modules/async/internal/setImmediate.js +34 -0
- package/node_modules/async/internal/withoutIndex.js +10 -0
- package/node_modules/async/internal/wrapAsync.js +34 -0
- package/node_modules/async/log.js +41 -0
- package/node_modules/async/map.js +142 -0
- package/node_modules/async/mapLimit.js +45 -0
- package/node_modules/async/mapSeries.js +44 -0
- package/node_modules/async/mapValues.js +152 -0
- package/node_modules/async/mapValuesLimit.js +61 -0
- package/node_modules/async/mapValuesSeries.js +37 -0
- package/node_modules/async/memoize.js +91 -0
- package/node_modules/async/nextTick.js +52 -0
- package/node_modules/async/package.json +75 -0
- package/node_modules/async/parallel.js +180 -0
- package/node_modules/async/parallelLimit.js +41 -0
- package/node_modules/async/priorityQueue.js +60 -0
- package/node_modules/async/queue.js +24 -0
- package/node_modules/async/race.js +67 -0
- package/node_modules/async/reduce.js +153 -0
- package/node_modules/async/reduceRight.js +41 -0
- package/node_modules/async/reflect.js +78 -0
- package/node_modules/async/reflectAll.js +93 -0
- package/node_modules/async/reject.js +87 -0
- package/node_modules/async/rejectLimit.js +45 -0
- package/node_modules/async/rejectSeries.js +43 -0
- package/node_modules/async/retry.js +159 -0
- package/node_modules/async/retryable.js +77 -0
- package/node_modules/async/select.js +93 -0
- package/node_modules/async/selectLimit.js +45 -0
- package/node_modules/async/selectSeries.js +43 -0
- package/node_modules/async/seq.js +79 -0
- package/node_modules/async/series.js +186 -0
- package/node_modules/async/setImmediate.js +45 -0
- package/node_modules/async/some.js +122 -0
- package/node_modules/async/someLimit.js +47 -0
- package/node_modules/async/someSeries.js +46 -0
- package/node_modules/async/sortBy.js +190 -0
- package/node_modules/async/timeout.js +89 -0
- package/node_modules/async/times.js +50 -0
- package/node_modules/async/timesLimit.js +43 -0
- package/node_modules/async/timesSeries.js +32 -0
- package/node_modules/async/transform.js +173 -0
- package/node_modules/async/tryEach.js +78 -0
- package/node_modules/async/unmemoize.js +25 -0
- package/node_modules/async/until.js +61 -0
- package/node_modules/async/waterfall.js +105 -0
- package/node_modules/async/whilst.js +78 -0
- package/node_modules/async/wrapSync.js +118 -0
- package/node_modules/body-parser/LICENSE +23 -0
- package/node_modules/body-parser/README.md +509 -0
- package/node_modules/body-parser/index.js +55 -0
- package/node_modules/body-parser/lib/read.js +247 -0
- package/node_modules/body-parser/lib/types/json.js +186 -0
- package/node_modules/body-parser/lib/types/raw.js +42 -0
- package/node_modules/body-parser/lib/types/text.js +36 -0
- package/node_modules/body-parser/lib/types/urlencoded.js +138 -0
- package/node_modules/body-parser/lib/utils.js +100 -0
- package/node_modules/body-parser/node_modules/content-type/LICENSE +22 -0
- package/node_modules/body-parser/node_modules/content-type/README.md +69 -0
- package/node_modules/body-parser/node_modules/content-type/dist/index.d.ts +26 -0
- package/node_modules/body-parser/node_modules/content-type/dist/index.js +170 -0
- package/node_modules/body-parser/node_modules/content-type/dist/index.js.map +1 -0
- package/node_modules/body-parser/node_modules/content-type/package.json +52 -0
- package/node_modules/body-parser/package.json +65 -0
- package/node_modules/braces/LICENSE +21 -0
- package/node_modules/braces/README.md +586 -0
- package/node_modules/braces/index.js +170 -0
- package/node_modules/braces/lib/compile.js +60 -0
- package/node_modules/braces/lib/constants.js +57 -0
- package/node_modules/braces/lib/expand.js +113 -0
- package/node_modules/braces/lib/parse.js +331 -0
- package/node_modules/braces/lib/stringify.js +32 -0
- package/node_modules/braces/lib/utils.js +122 -0
- package/node_modules/braces/package.json +77 -0
- package/node_modules/bytes/History.md +97 -0
- package/node_modules/bytes/LICENSE +23 -0
- package/node_modules/bytes/Readme.md +152 -0
- package/node_modules/bytes/index.js +170 -0
- package/node_modules/bytes/package.json +42 -0
- package/node_modules/call-bind-apply-helpers/.eslintrc +17 -0
- package/node_modules/call-bind-apply-helpers/.github/FUNDING.yml +12 -0
- package/node_modules/call-bind-apply-helpers/.nycrc +9 -0
- package/node_modules/call-bind-apply-helpers/CHANGELOG.md +30 -0
- package/node_modules/call-bind-apply-helpers/LICENSE +21 -0
- package/node_modules/call-bind-apply-helpers/README.md +62 -0
- package/node_modules/call-bind-apply-helpers/actualApply.d.ts +1 -0
- package/node_modules/call-bind-apply-helpers/actualApply.js +10 -0
- package/node_modules/call-bind-apply-helpers/applyBind.d.ts +19 -0
- package/node_modules/call-bind-apply-helpers/applyBind.js +10 -0
- package/node_modules/call-bind-apply-helpers/functionApply.d.ts +1 -0
- package/node_modules/call-bind-apply-helpers/functionApply.js +4 -0
- package/node_modules/call-bind-apply-helpers/functionCall.d.ts +1 -0
- package/node_modules/call-bind-apply-helpers/functionCall.js +4 -0
- package/node_modules/call-bind-apply-helpers/index.d.ts +64 -0
- package/node_modules/call-bind-apply-helpers/index.js +15 -0
- package/node_modules/call-bind-apply-helpers/package.json +85 -0
- package/node_modules/call-bind-apply-helpers/reflectApply.d.ts +3 -0
- package/node_modules/call-bind-apply-helpers/reflectApply.js +4 -0
- package/node_modules/call-bind-apply-helpers/test/index.js +63 -0
- package/node_modules/call-bind-apply-helpers/tsconfig.json +9 -0
- package/node_modules/call-bound/.eslintrc +13 -0
- package/node_modules/call-bound/.github/FUNDING.yml +12 -0
- package/node_modules/call-bound/.nycrc +9 -0
- package/node_modules/call-bound/CHANGELOG.md +42 -0
- package/node_modules/call-bound/LICENSE +21 -0
- package/node_modules/call-bound/README.md +53 -0
- package/node_modules/call-bound/index.d.ts +94 -0
- package/node_modules/call-bound/index.js +19 -0
- package/node_modules/call-bound/package.json +99 -0
- package/node_modules/call-bound/test/index.js +61 -0
- package/node_modules/call-bound/tsconfig.json +10 -0
- package/node_modules/clone/.npmignore +4 -0
- package/node_modules/clone/LICENSE +18 -0
- package/node_modules/clone/README.md +194 -0
- package/node_modules/clone/clone.iml +10 -0
- package/node_modules/clone/clone.js +257 -0
- package/node_modules/clone/package.json +56 -0
- package/node_modules/content-disposition/LICENSE +22 -0
- package/node_modules/content-disposition/README.md +141 -0
- package/node_modules/content-disposition/index.js +536 -0
- package/node_modules/content-disposition/package.json +40 -0
- package/node_modules/content-type/HISTORY.md +29 -0
- package/node_modules/content-type/LICENSE +22 -0
- package/node_modules/content-type/README.md +94 -0
- package/node_modules/content-type/index.js +225 -0
- package/node_modules/content-type/package.json +42 -0
- package/node_modules/cookie/LICENSE +24 -0
- package/node_modules/cookie/README.md +317 -0
- package/node_modules/cookie/SECURITY.md +25 -0
- package/node_modules/cookie/index.js +335 -0
- package/node_modules/cookie/package.json +44 -0
- package/node_modules/cookie-signature/History.md +70 -0
- package/node_modules/cookie-signature/LICENSE +22 -0
- package/node_modules/cookie-signature/Readme.md +23 -0
- package/node_modules/cookie-signature/index.js +47 -0
- package/node_modules/cookie-signature/package.json +28 -0
- package/node_modules/core-util-is/LICENSE +19 -0
- package/node_modules/core-util-is/README.md +3 -0
- package/node_modules/core-util-is/float.patch +604 -0
- package/node_modules/core-util-is/lib/util.js +107 -0
- package/node_modules/core-util-is/package.json +32 -0
- package/node_modules/core-util-is/test.js +68 -0
- package/node_modules/debug/LICENSE +20 -0
- package/node_modules/debug/README.md +481 -0
- package/node_modules/debug/package.json +64 -0
- package/node_modules/debug/src/browser.js +272 -0
- package/node_modules/debug/src/common.js +292 -0
- package/node_modules/debug/src/index.js +10 -0
- package/node_modules/debug/src/node.js +263 -0
- package/node_modules/depd/History.md +103 -0
- package/node_modules/depd/LICENSE +22 -0
- package/node_modules/depd/Readme.md +280 -0
- package/node_modules/depd/index.js +538 -0
- package/node_modules/depd/lib/browser/index.js +77 -0
- package/node_modules/depd/package.json +45 -0
- package/node_modules/dotenv/CHANGELOG.md +520 -0
- package/node_modules/dotenv/LICENSE +23 -0
- package/node_modules/dotenv/README-es.md +411 -0
- package/node_modules/dotenv/README.md +645 -0
- package/node_modules/dotenv/SECURITY.md +1 -0
- package/node_modules/dotenv/config.d.ts +1 -0
- package/node_modules/dotenv/config.js +9 -0
- package/node_modules/dotenv/lib/cli-options.js +17 -0
- package/node_modules/dotenv/lib/env-options.js +28 -0
- package/node_modules/dotenv/lib/main.d.ts +162 -0
- package/node_modules/dotenv/lib/main.js +386 -0
- package/node_modules/dotenv/package.json +62 -0
- package/node_modules/dunder-proto/.eslintrc +5 -0
- package/node_modules/dunder-proto/.github/FUNDING.yml +12 -0
- package/node_modules/dunder-proto/.nycrc +13 -0
- package/node_modules/dunder-proto/CHANGELOG.md +24 -0
- package/node_modules/dunder-proto/LICENSE +21 -0
- package/node_modules/dunder-proto/README.md +54 -0
- package/node_modules/dunder-proto/get.d.ts +5 -0
- package/node_modules/dunder-proto/get.js +30 -0
- package/node_modules/dunder-proto/package.json +76 -0
- package/node_modules/dunder-proto/set.d.ts +5 -0
- package/node_modules/dunder-proto/set.js +35 -0
- package/node_modules/dunder-proto/test/get.js +34 -0
- package/node_modules/dunder-proto/test/index.js +4 -0
- package/node_modules/dunder-proto/test/set.js +50 -0
- package/node_modules/dunder-proto/tsconfig.json +9 -0
- package/node_modules/ee-first/LICENSE +22 -0
- package/node_modules/ee-first/README.md +80 -0
- package/node_modules/ee-first/index.js +95 -0
- package/node_modules/ee-first/package.json +29 -0
- package/node_modules/encodeurl/LICENSE +22 -0
- package/node_modules/encodeurl/README.md +109 -0
- package/node_modules/encodeurl/index.js +60 -0
- package/node_modules/encodeurl/package.json +40 -0
- package/node_modules/es-define-property/.eslintrc +13 -0
- package/node_modules/es-define-property/.github/FUNDING.yml +12 -0
- package/node_modules/es-define-property/.nycrc +9 -0
- package/node_modules/es-define-property/CHANGELOG.md +29 -0
- package/node_modules/es-define-property/LICENSE +21 -0
- package/node_modules/es-define-property/README.md +49 -0
- package/node_modules/es-define-property/index.d.ts +3 -0
- package/node_modules/es-define-property/index.js +14 -0
- package/node_modules/es-define-property/package.json +81 -0
- package/node_modules/es-define-property/test/index.js +56 -0
- package/node_modules/es-define-property/tsconfig.json +10 -0
- package/node_modules/es-errors/.eslintrc +5 -0
- package/node_modules/es-errors/.github/FUNDING.yml +12 -0
- package/node_modules/es-errors/CHANGELOG.md +40 -0
- package/node_modules/es-errors/LICENSE +21 -0
- package/node_modules/es-errors/README.md +55 -0
- package/node_modules/es-errors/eval.d.ts +3 -0
- package/node_modules/es-errors/eval.js +4 -0
- package/node_modules/es-errors/index.d.ts +3 -0
- package/node_modules/es-errors/index.js +4 -0
- package/node_modules/es-errors/package.json +80 -0
- package/node_modules/es-errors/range.d.ts +3 -0
- package/node_modules/es-errors/range.js +4 -0
- package/node_modules/es-errors/ref.d.ts +3 -0
- package/node_modules/es-errors/ref.js +4 -0
- package/node_modules/es-errors/syntax.d.ts +3 -0
- package/node_modules/es-errors/syntax.js +4 -0
- package/node_modules/es-errors/test/index.js +19 -0
- package/node_modules/es-errors/tsconfig.json +49 -0
- package/node_modules/es-errors/type.d.ts +3 -0
- package/node_modules/es-errors/type.js +4 -0
- package/node_modules/es-errors/uri.d.ts +3 -0
- package/node_modules/es-errors/uri.js +4 -0
- package/node_modules/es-object-atoms/.eslintrc +16 -0
- package/node_modules/es-object-atoms/.github/FUNDING.yml +12 -0
- package/node_modules/es-object-atoms/CHANGELOG.md +44 -0
- package/node_modules/es-object-atoms/LICENSE +21 -0
- package/node_modules/es-object-atoms/README.md +63 -0
- package/node_modules/es-object-atoms/RequireObjectCoercible.d.ts +3 -0
- package/node_modules/es-object-atoms/RequireObjectCoercible.js +11 -0
- package/node_modules/es-object-atoms/ToObject.d.ts +7 -0
- package/node_modules/es-object-atoms/ToObject.js +10 -0
- package/node_modules/es-object-atoms/index.d.ts +3 -0
- package/node_modules/es-object-atoms/index.js +4 -0
- package/node_modules/es-object-atoms/isObject.d.ts +3 -0
- package/node_modules/es-object-atoms/isObject.js +6 -0
- package/node_modules/es-object-atoms/package.json +79 -0
- package/node_modules/es-object-atoms/test/index.js +38 -0
- package/node_modules/es-object-atoms/tsconfig.json +7 -0
- package/node_modules/escape-html/LICENSE +24 -0
- package/node_modules/escape-html/Readme.md +43 -0
- package/node_modules/escape-html/index.js +78 -0
- package/node_modules/escape-html/package.json +24 -0
- package/node_modules/etag/HISTORY.md +83 -0
- package/node_modules/etag/LICENSE +22 -0
- package/node_modules/etag/README.md +159 -0
- package/node_modules/etag/index.js +131 -0
- package/node_modules/etag/package.json +47 -0
- package/node_modules/express/LICENSE +24 -0
- package/node_modules/express/Readme.md +276 -0
- package/node_modules/express/index.js +11 -0
- package/node_modules/express/lib/application.js +631 -0
- package/node_modules/express/lib/express.js +81 -0
- package/node_modules/express/lib/request.js +514 -0
- package/node_modules/express/lib/response.js +1053 -0
- package/node_modules/express/lib/utils.js +271 -0
- package/node_modules/express/lib/view.js +205 -0
- package/node_modules/express/package.json +99 -0
- package/node_modules/extsprintf/.gitmodules +3 -0
- package/node_modules/extsprintf/CHANGES.md +10 -0
- package/node_modules/extsprintf/CONTRIBUTING.md +17 -0
- package/node_modules/extsprintf/LICENSE +19 -0
- package/node_modules/extsprintf/Makefile +30 -0
- package/node_modules/extsprintf/Makefile.targ +285 -0
- package/node_modules/extsprintf/README.md +46 -0
- package/node_modules/extsprintf/jsl.node.conf +137 -0
- package/node_modules/extsprintf/lib/extsprintf.js +225 -0
- package/node_modules/extsprintf/package.json +14 -0
- package/node_modules/extsprintf/test/tst.basic.js +118 -0
- package/node_modules/extsprintf/test/tst.invalid.js +78 -0
- package/node_modules/fill-range/LICENSE +21 -0
- package/node_modules/fill-range/README.md +237 -0
- package/node_modules/fill-range/index.js +248 -0
- package/node_modules/fill-range/package.json +74 -0
- package/node_modules/finalhandler/HISTORY.md +239 -0
- package/node_modules/finalhandler/LICENSE +22 -0
- package/node_modules/finalhandler/README.md +150 -0
- package/node_modules/finalhandler/index.js +293 -0
- package/node_modules/finalhandler/package.json +47 -0
- package/node_modules/forwarded/HISTORY.md +21 -0
- package/node_modules/forwarded/LICENSE +22 -0
- package/node_modules/forwarded/README.md +57 -0
- package/node_modules/forwarded/index.js +90 -0
- package/node_modules/forwarded/package.json +45 -0
- package/node_modules/fresh/HISTORY.md +80 -0
- package/node_modules/fresh/LICENSE +23 -0
- package/node_modules/fresh/README.md +117 -0
- package/node_modules/fresh/index.js +136 -0
- package/node_modules/fresh/package.json +46 -0
- package/node_modules/function-bind/.eslintrc +21 -0
- package/node_modules/function-bind/.github/FUNDING.yml +12 -0
- package/node_modules/function-bind/.github/SECURITY.md +3 -0
- package/node_modules/function-bind/.nycrc +13 -0
- package/node_modules/function-bind/CHANGELOG.md +136 -0
- package/node_modules/function-bind/LICENSE +20 -0
- package/node_modules/function-bind/README.md +46 -0
- package/node_modules/function-bind/implementation.js +84 -0
- package/node_modules/function-bind/index.js +5 -0
- package/node_modules/function-bind/package.json +87 -0
- package/node_modules/function-bind/test/.eslintrc +9 -0
- package/node_modules/function-bind/test/index.js +252 -0
- package/node_modules/get-intrinsic/.eslintrc +42 -0
- package/node_modules/get-intrinsic/.github/FUNDING.yml +12 -0
- package/node_modules/get-intrinsic/.nycrc +9 -0
- package/node_modules/get-intrinsic/CHANGELOG.md +186 -0
- package/node_modules/get-intrinsic/LICENSE +21 -0
- package/node_modules/get-intrinsic/README.md +71 -0
- package/node_modules/get-intrinsic/index.js +378 -0
- package/node_modules/get-intrinsic/package.json +97 -0
- package/node_modules/get-intrinsic/test/GetIntrinsic.js +274 -0
- package/node_modules/get-proto/.eslintrc +10 -0
- package/node_modules/get-proto/.github/FUNDING.yml +12 -0
- package/node_modules/get-proto/.nycrc +9 -0
- package/node_modules/get-proto/CHANGELOG.md +21 -0
- package/node_modules/get-proto/LICENSE +21 -0
- package/node_modules/get-proto/Object.getPrototypeOf.d.ts +5 -0
- package/node_modules/get-proto/Object.getPrototypeOf.js +6 -0
- package/node_modules/get-proto/README.md +50 -0
- package/node_modules/get-proto/Reflect.getPrototypeOf.d.ts +3 -0
- package/node_modules/get-proto/Reflect.getPrototypeOf.js +4 -0
- package/node_modules/get-proto/index.d.ts +5 -0
- package/node_modules/get-proto/index.js +27 -0
- package/node_modules/get-proto/package.json +81 -0
- package/node_modules/get-proto/test/index.js +68 -0
- package/node_modules/get-proto/tsconfig.json +9 -0
- package/node_modules/gopd/.eslintrc +16 -0
- package/node_modules/gopd/.github/FUNDING.yml +12 -0
- package/node_modules/gopd/CHANGELOG.md +45 -0
- package/node_modules/gopd/LICENSE +21 -0
- package/node_modules/gopd/README.md +40 -0
- package/node_modules/gopd/gOPD.d.ts +1 -0
- package/node_modules/gopd/gOPD.js +4 -0
- package/node_modules/gopd/index.d.ts +5 -0
- package/node_modules/gopd/index.js +15 -0
- package/node_modules/gopd/package.json +77 -0
- package/node_modules/gopd/test/index.js +36 -0
- package/node_modules/gopd/tsconfig.json +9 -0
- package/node_modules/handlebars/LICENSE +19 -0
- package/node_modules/handlebars/README.markdown +167 -0
- package/node_modules/handlebars/bin/.eslintrc.js +6 -0
- package/node_modules/handlebars/bin/handlebars +176 -0
- package/node_modules/handlebars/dist/amd/handlebars/base.js +106 -0
- package/node_modules/handlebars/dist/amd/handlebars/compiler/ast.js +31 -0
- package/node_modules/handlebars/dist/amd/handlebars/compiler/base.js +102 -0
- package/node_modules/handlebars/dist/amd/handlebars/compiler/code-gen.js +165 -0
- package/node_modules/handlebars/dist/amd/handlebars/compiler/compiler.js +562 -0
- package/node_modules/handlebars/dist/amd/handlebars/compiler/helpers.js +228 -0
- package/node_modules/handlebars/dist/amd/handlebars/compiler/javascript-compiler.js +1158 -0
- package/node_modules/handlebars/dist/amd/handlebars/compiler/parser.js +737 -0
- package/node_modules/handlebars/dist/amd/handlebars/compiler/printer.js +186 -0
- package/node_modules/handlebars/dist/amd/handlebars/compiler/visitor.js +138 -0
- package/node_modules/handlebars/dist/amd/handlebars/compiler/whitespace-control.js +219 -0
- package/node_modules/handlebars/dist/amd/handlebars/decorators/inline.js +25 -0
- package/node_modules/handlebars/dist/amd/handlebars/decorators.js +16 -0
- package/node_modules/handlebars/dist/amd/handlebars/exception.js +64 -0
- package/node_modules/handlebars/dist/amd/handlebars/helpers/block-helper-missing.js +35 -0
- package/node_modules/handlebars/dist/amd/handlebars/helpers/each.js +99 -0
- package/node_modules/handlebars/dist/amd/handlebars/helpers/helper-missing.js +22 -0
- package/node_modules/handlebars/dist/amd/handlebars/helpers/if.js +41 -0
- package/node_modules/handlebars/dist/amd/handlebars/helpers/log.js +24 -0
- package/node_modules/handlebars/dist/amd/handlebars/helpers/lookup.js +14 -0
- package/node_modules/handlebars/dist/amd/handlebars/helpers/with.js +38 -0
- package/node_modules/handlebars/dist/amd/handlebars/helpers.js +45 -0
- package/node_modules/handlebars/dist/amd/handlebars/internal/proto-access.js +76 -0
- package/node_modules/handlebars/dist/amd/handlebars/internal/wrapHelper.js +21 -0
- package/node_modules/handlebars/dist/amd/handlebars/logger.js +44 -0
- package/node_modules/handlebars/dist/amd/handlebars/no-conflict.js +28 -0
- package/node_modules/handlebars/dist/amd/handlebars/runtime.js +363 -0
- package/node_modules/handlebars/dist/amd/handlebars/safe-string.js +15 -0
- package/node_modules/handlebars/dist/amd/handlebars/utils.js +126 -0
- package/node_modules/handlebars/dist/amd/handlebars.js +52 -0
- package/node_modules/handlebars/dist/amd/handlebars.runtime.js +44 -0
- package/node_modules/handlebars/dist/amd/precompiler.js +345 -0
- package/node_modules/handlebars/dist/cjs/handlebars/base.js +116 -0
- package/node_modules/handlebars/dist/cjs/handlebars/compiler/ast.js +31 -0
- package/node_modules/handlebars/dist/cjs/handlebars/compiler/base.js +116 -0
- package/node_modules/handlebars/dist/cjs/handlebars/compiler/code-gen.js +168 -0
- package/node_modules/handlebars/dist/cjs/handlebars/compiler/compiler.js +566 -0
- package/node_modules/handlebars/dist/cjs/handlebars/compiler/helpers.js +228 -0
- package/node_modules/handlebars/dist/cjs/handlebars/compiler/javascript-compiler.js +1166 -0
- package/node_modules/handlebars/dist/cjs/handlebars/compiler/parser.js +737 -0
- package/node_modules/handlebars/dist/cjs/handlebars/compiler/printer.js +186 -0
- package/node_modules/handlebars/dist/cjs/handlebars/compiler/visitor.js +140 -0
- package/node_modules/handlebars/dist/cjs/handlebars/compiler/whitespace-control.js +221 -0
- package/node_modules/handlebars/dist/cjs/handlebars/decorators/inline.js +29 -0
- package/node_modules/handlebars/dist/cjs/handlebars/decorators.js +16 -0
- package/node_modules/handlebars/dist/cjs/handlebars/exception.js +64 -0
- package/node_modules/handlebars/dist/cjs/handlebars/helpers/block-helper-missing.js +39 -0
- package/node_modules/handlebars/dist/cjs/handlebars/helpers/each.js +104 -0
- package/node_modules/handlebars/dist/cjs/handlebars/helpers/helper-missing.js +25 -0
- package/node_modules/handlebars/dist/cjs/handlebars/helpers/if.js +46 -0
- package/node_modules/handlebars/dist/cjs/handlebars/helpers/log.js +26 -0
- package/node_modules/handlebars/dist/cjs/handlebars/helpers/lookup.js +16 -0
- package/node_modules/handlebars/dist/cjs/handlebars/helpers/with.js +43 -0
- package/node_modules/handlebars/dist/cjs/handlebars/helpers.js +57 -0
- package/node_modules/handlebars/dist/cjs/handlebars/internal/proto-access.js +78 -0
- package/node_modules/handlebars/dist/cjs/handlebars/internal/wrapHelper.js +19 -0
- package/node_modules/handlebars/dist/cjs/handlebars/logger.js +47 -0
- package/node_modules/handlebars/dist/cjs/handlebars/no-conflict.js +30 -0
- package/node_modules/handlebars/dist/cjs/handlebars/runtime.js +379 -0
- package/node_modules/handlebars/dist/cjs/handlebars/safe-string.js +15 -0
- package/node_modules/handlebars/dist/cjs/handlebars/utils.js +124 -0
- package/node_modules/handlebars/dist/cjs/handlebars.js +66 -0
- package/node_modules/handlebars/dist/cjs/handlebars.runtime.js +66 -0
- package/node_modules/handlebars/dist/cjs/precompiler.js +359 -0
- package/node_modules/handlebars/dist/handlebars.amd.js +4694 -0
- package/node_modules/handlebars/dist/handlebars.amd.min.js +29 -0
- package/node_modules/handlebars/dist/handlebars.js +6026 -0
- package/node_modules/handlebars/dist/handlebars.min.js +29 -0
- package/node_modules/handlebars/dist/handlebars.runtime.amd.js +1292 -0
- package/node_modules/handlebars/dist/handlebars.runtime.amd.min.js +27 -0
- package/node_modules/handlebars/dist/handlebars.runtime.js +2548 -0
- package/node_modules/handlebars/dist/handlebars.runtime.min.js +27 -0
- package/node_modules/handlebars/lib/.eslintrc.js +8 -0
- package/node_modules/handlebars/lib/handlebars/base.js +94 -0
- package/node_modules/handlebars/lib/handlebars/compiler/ast.js +32 -0
- package/node_modules/handlebars/lib/handlebars/compiler/base.js +101 -0
- package/node_modules/handlebars/lib/handlebars/compiler/code-gen.js +171 -0
- package/node_modules/handlebars/lib/handlebars/compiler/compiler.js +594 -0
- package/node_modules/handlebars/lib/handlebars/compiler/helpers.js +219 -0
- package/node_modules/handlebars/lib/handlebars/compiler/javascript-compiler.js +1306 -0
- package/node_modules/handlebars/lib/handlebars/compiler/parser.js +622 -0
- package/node_modules/handlebars/lib/handlebars/compiler/printer.js +178 -0
- package/node_modules/handlebars/lib/handlebars/compiler/visitor.js +136 -0
- package/node_modules/handlebars/lib/handlebars/compiler/whitespace-control.js +234 -0
- package/node_modules/handlebars/lib/handlebars/decorators/inline.js +22 -0
- package/node_modules/handlebars/lib/handlebars/decorators.js +5 -0
- package/node_modules/handlebars/lib/handlebars/exception.js +68 -0
- package/node_modules/handlebars/lib/handlebars/helpers/block-helper-missing.js +35 -0
- package/node_modules/handlebars/lib/handlebars/helpers/each.js +101 -0
- package/node_modules/handlebars/lib/handlebars/helpers/helper-missing.js +15 -0
- package/node_modules/handlebars/lib/handlebars/helpers/if.js +33 -0
- package/node_modules/handlebars/lib/handlebars/helpers/log.js +19 -0
- package/node_modules/handlebars/lib/handlebars/helpers/lookup.js +9 -0
- package/node_modules/handlebars/lib/handlebars/helpers/with.js +39 -0
- package/node_modules/handlebars/lib/handlebars/helpers.js +27 -0
- package/node_modules/handlebars/lib/handlebars/internal/proto-access.js +69 -0
- package/node_modules/handlebars/lib/handlebars/internal/wrapHelper.js +13 -0
- package/node_modules/handlebars/lib/handlebars/logger.js +39 -0
- package/node_modules/handlebars/lib/handlebars/no-conflict.js +23 -0
- package/node_modules/handlebars/lib/handlebars/runtime.js +452 -0
- package/node_modules/handlebars/lib/handlebars/safe-string.js +10 -0
- package/node_modules/handlebars/lib/handlebars/utils.js +116 -0
- package/node_modules/handlebars/lib/handlebars.js +46 -0
- package/node_modules/handlebars/lib/handlebars.runtime.js +37 -0
- package/node_modules/handlebars/lib/index.js +26 -0
- package/node_modules/handlebars/lib/precompiler.js +378 -0
- package/node_modules/handlebars/package.json +134 -0
- package/node_modules/handlebars/release-notes.md +1112 -0
- package/node_modules/handlebars/runtime.d.ts +5 -0
- package/node_modules/handlebars/runtime.js +3 -0
- package/node_modules/handlebars/types/index.d.ts +422 -0
- package/node_modules/has-symbols/.eslintrc +11 -0
- package/node_modules/has-symbols/.github/FUNDING.yml +12 -0
- package/node_modules/has-symbols/.nycrc +9 -0
- package/node_modules/has-symbols/CHANGELOG.md +91 -0
- package/node_modules/has-symbols/LICENSE +21 -0
- package/node_modules/has-symbols/README.md +46 -0
- package/node_modules/has-symbols/index.d.ts +3 -0
- package/node_modules/has-symbols/index.js +14 -0
- package/node_modules/has-symbols/package.json +111 -0
- package/node_modules/has-symbols/shams.d.ts +3 -0
- package/node_modules/has-symbols/shams.js +45 -0
- package/node_modules/has-symbols/test/index.js +22 -0
- package/node_modules/has-symbols/test/shams/core-js.js +29 -0
- package/node_modules/has-symbols/test/shams/get-own-property-symbols.js +29 -0
- package/node_modules/has-symbols/test/tests.js +58 -0
- package/node_modules/has-symbols/tsconfig.json +10 -0
- package/node_modules/hasown/.github/FUNDING.yml +12 -0
- package/node_modules/hasown/.nycrc +13 -0
- package/node_modules/hasown/CHANGELOG.md +58 -0
- package/node_modules/hasown/LICENSE +21 -0
- package/node_modules/hasown/README.md +40 -0
- package/node_modules/hasown/eslint.config.mjs +6 -0
- package/node_modules/hasown/index.d.ts +3 -0
- package/node_modules/hasown/index.js +8 -0
- package/node_modules/hasown/package.json +91 -0
- package/node_modules/hasown/tsconfig.json +6 -0
- package/node_modules/hdb/.claude/skills/hdb-commit-msg/SKILL.md +132 -0
- package/node_modules/hdb/.hyperspace/pull_request_bot.json +26 -0
- package/node_modules/hdb/.jshintrc +41 -0
- package/node_modules/hdb/.pipeline/config.yml +21 -0
- package/node_modules/hdb/.reuse/dep5 +28 -0
- package/node_modules/hdb/CLAUDE.md +41 -0
- package/node_modules/hdb/LICENSE +202 -0
- package/node_modules/hdb/LICENSES/Apache-2.0.txt +73 -0
- package/node_modules/hdb/Makefile +41 -0
- package/node_modules/hdb/README.md +778 -0
- package/node_modules/hdb/cfg/VERSION +1 -0
- package/node_modules/hdb/cfg/xmake.cfg +7 -0
- package/node_modules/hdb/chrome/sockets/tcp.js +28 -0
- package/node_modules/hdb/index.js +21 -0
- package/node_modules/hdb/lib/Client.js +327 -0
- package/node_modules/hdb/lib/index.js +37 -0
- package/node_modules/hdb/lib/protocol/ClientInfo.js +77 -0
- package/node_modules/hdb/lib/protocol/Compressor.js +122 -0
- package/node_modules/hdb/lib/protocol/Connection.js +707 -0
- package/node_modules/hdb/lib/protocol/ConnectionManager.js +124 -0
- package/node_modules/hdb/lib/protocol/ConnectionTopology.js +303 -0
- package/node_modules/hdb/lib/protocol/ExecuteTask.js +266 -0
- package/node_modules/hdb/lib/protocol/Lob.js +168 -0
- package/node_modules/hdb/lib/protocol/MessageBuffer.js +74 -0
- package/node_modules/hdb/lib/protocol/Parser.js +258 -0
- package/node_modules/hdb/lib/protocol/PhysicalConnection.js +442 -0
- package/node_modules/hdb/lib/protocol/Proxy.js +373 -0
- package/node_modules/hdb/lib/protocol/Reader.js +470 -0
- package/node_modules/hdb/lib/protocol/Result.js +287 -0
- package/node_modules/hdb/lib/protocol/ResultSet.js +490 -0
- package/node_modules/hdb/lib/protocol/ResultSetTransform.js +126 -0
- package/node_modules/hdb/lib/protocol/Statement.js +219 -0
- package/node_modules/hdb/lib/protocol/Stringifier.js +82 -0
- package/node_modules/hdb/lib/protocol/Transaction.js +64 -0
- package/node_modules/hdb/lib/protocol/Writer.js +1205 -0
- package/node_modules/hdb/lib/protocol/auth/JWT.js +40 -0
- package/node_modules/hdb/lib/protocol/auth/LDAP.js +133 -0
- package/node_modules/hdb/lib/protocol/auth/Manager.js +162 -0
- package/node_modules/hdb/lib/protocol/auth/SAML.js +40 -0
- package/node_modules/hdb/lib/protocol/auth/SCRAMSHA256.js +175 -0
- package/node_modules/hdb/lib/protocol/auth/SessionCookie.js +43 -0
- package/node_modules/hdb/lib/protocol/auth/X509.js +211 -0
- package/node_modules/hdb/lib/protocol/auth/index.js +20 -0
- package/node_modules/hdb/lib/protocol/common/ClientContextOption.js +20 -0
- package/node_modules/hdb/lib/protocol/common/ClientDistributionMode.js +21 -0
- package/node_modules/hdb/lib/protocol/common/CommandOption.js +21 -0
- package/node_modules/hdb/lib/protocol/common/CommitOption.js +18 -0
- package/node_modules/hdb/lib/protocol/common/ConnectOption.js +43 -0
- package/node_modules/hdb/lib/protocol/common/ConnectOptionType.js +45 -0
- package/node_modules/hdb/lib/protocol/common/Constants.js +32 -0
- package/node_modules/hdb/lib/protocol/common/DataFormatVersion.js +29 -0
- package/node_modules/hdb/lib/protocol/common/DbConnectInfoOption.js +21 -0
- package/node_modules/hdb/lib/protocol/common/DistributionProtocolVersion.js +19 -0
- package/node_modules/hdb/lib/protocol/common/ErrorLevel.js +20 -0
- package/node_modules/hdb/lib/protocol/common/FunctionCode.js +41 -0
- package/node_modules/hdb/lib/protocol/common/IoType.js +20 -0
- package/node_modules/hdb/lib/protocol/common/LobOptions.js +20 -0
- package/node_modules/hdb/lib/protocol/common/LobSourceType.js +21 -0
- package/node_modules/hdb/lib/protocol/common/MessageType.js +41 -0
- package/node_modules/hdb/lib/protocol/common/NormalizedTypeCode.js +83 -0
- package/node_modules/hdb/lib/protocol/common/ParameterMode.js +23 -0
- package/node_modules/hdb/lib/protocol/common/PartAttributes.js +23 -0
- package/node_modules/hdb/lib/protocol/common/PartKind.js +70 -0
- package/node_modules/hdb/lib/protocol/common/ProxyConstants.js +129 -0
- package/node_modules/hdb/lib/protocol/common/ReadFunction.js +85 -0
- package/node_modules/hdb/lib/protocol/common/RedirectType.js +21 -0
- package/node_modules/hdb/lib/protocol/common/SegmentKind.js +21 -0
- package/node_modules/hdb/lib/protocol/common/SessionContext.js +23 -0
- package/node_modules/hdb/lib/protocol/common/StatementContext.js +19 -0
- package/node_modules/hdb/lib/protocol/common/StatementContextType.js +21 -0
- package/node_modules/hdb/lib/protocol/common/TopologyInformation.js +31 -0
- package/node_modules/hdb/lib/protocol/common/TransactionFlag.js +24 -0
- package/node_modules/hdb/lib/protocol/common/TransactionFlagType.js +26 -0
- package/node_modules/hdb/lib/protocol/common/TypeCode.js +93 -0
- package/node_modules/hdb/lib/protocol/common/index.js +70 -0
- package/node_modules/hdb/lib/protocol/data/Binary.js +42 -0
- package/node_modules/hdb/lib/protocol/data/Default.js +42 -0
- package/node_modules/hdb/lib/protocol/data/Fields.js +139 -0
- package/node_modules/hdb/lib/protocol/data/Int32.js +55 -0
- package/node_modules/hdb/lib/protocol/data/MultilineOptions.js +74 -0
- package/node_modules/hdb/lib/protocol/data/Options.js +188 -0
- package/node_modules/hdb/lib/protocol/data/ParameterMetadata.js +76 -0
- package/node_modules/hdb/lib/protocol/data/Parameters.js +52 -0
- package/node_modules/hdb/lib/protocol/data/ReadLobReply.js +72 -0
- package/node_modules/hdb/lib/protocol/data/ReadLobRequest.js +69 -0
- package/node_modules/hdb/lib/protocol/data/ResultSetMetadata.js +101 -0
- package/node_modules/hdb/lib/protocol/data/SqlError.js +70 -0
- package/node_modules/hdb/lib/protocol/data/Text.js +44 -0
- package/node_modules/hdb/lib/protocol/data/Text20.js +44 -0
- package/node_modules/hdb/lib/protocol/data/TextList.js +82 -0
- package/node_modules/hdb/lib/protocol/data/TransactionFlags.js +26 -0
- package/node_modules/hdb/lib/protocol/data/WriteLobReply.js +32 -0
- package/node_modules/hdb/lib/protocol/data/index.js +76 -0
- package/node_modules/hdb/lib/protocol/index.js +38 -0
- package/node_modules/hdb/lib/protocol/part/AbstractOptions.js +55 -0
- package/node_modules/hdb/lib/protocol/part/ClientContextOptions.js +46 -0
- package/node_modules/hdb/lib/protocol/part/ConnectOptions.js +155 -0
- package/node_modules/hdb/lib/protocol/part/DbConnectInfoOptions.js +41 -0
- package/node_modules/hdb/lib/protocol/part/StatementContext.js +52 -0
- package/node_modules/hdb/lib/protocol/part/index.js +19 -0
- package/node_modules/hdb/lib/protocol/reply/Part.js +126 -0
- package/node_modules/hdb/lib/protocol/reply/Segment.js +204 -0
- package/node_modules/hdb/lib/protocol/reply/index.js +17 -0
- package/node_modules/hdb/lib/protocol/request/Part.js +52 -0
- package/node_modules/hdb/lib/protocol/request/Segment.js +120 -0
- package/node_modules/hdb/lib/protocol/request/index.js +209 -0
- package/node_modules/hdb/lib/protocol/tcp.js +186 -0
- package/node_modules/hdb/lib/util/Network.js +230 -0
- package/node_modules/hdb/lib/util/Queue.js +124 -0
- package/node_modules/hdb/lib/util/bignum.js +844 -0
- package/node_modules/hdb/lib/util/calendar.js +121 -0
- package/node_modules/hdb/lib/util/convert.js +36 -0
- package/node_modules/hdb/lib/util/index.js +314 -0
- package/node_modules/hdb/lib/util/zeropad.js +110 -0
- package/node_modules/hdb/node_modules/iconv-lite/Changelog.md +236 -0
- package/node_modules/hdb/node_modules/iconv-lite/LICENSE +21 -0
- package/node_modules/hdb/node_modules/iconv-lite/README.md +138 -0
- package/node_modules/hdb/node_modules/iconv-lite/encodings/dbcs-codec.js +532 -0
- package/node_modules/hdb/node_modules/iconv-lite/encodings/dbcs-data.js +185 -0
- package/node_modules/hdb/node_modules/iconv-lite/encodings/index.js +23 -0
- package/node_modules/hdb/node_modules/iconv-lite/encodings/internal.js +218 -0
- package/node_modules/hdb/node_modules/iconv-lite/encodings/sbcs-codec.js +75 -0
- package/node_modules/hdb/node_modules/iconv-lite/encodings/sbcs-data-generated.js +451 -0
- package/node_modules/hdb/node_modules/iconv-lite/encodings/sbcs-data.js +178 -0
- package/node_modules/hdb/node_modules/iconv-lite/encodings/tables/big5-added.json +122 -0
- package/node_modules/hdb/node_modules/iconv-lite/encodings/tables/cp936.json +264 -0
- package/node_modules/hdb/node_modules/iconv-lite/encodings/tables/cp949.json +273 -0
- package/node_modules/hdb/node_modules/iconv-lite/encodings/tables/cp950.json +177 -0
- package/node_modules/hdb/node_modules/iconv-lite/encodings/tables/eucjp.json +182 -0
- package/node_modules/hdb/node_modules/iconv-lite/encodings/tables/gb18030-ranges.json +1 -0
- package/node_modules/hdb/node_modules/iconv-lite/encodings/tables/gbk-added.json +56 -0
- package/node_modules/hdb/node_modules/iconv-lite/encodings/tables/shiftjis.json +125 -0
- package/node_modules/hdb/node_modules/iconv-lite/encodings/utf16.js +187 -0
- package/node_modules/hdb/node_modules/iconv-lite/encodings/utf32.js +307 -0
- package/node_modules/hdb/node_modules/iconv-lite/encodings/utf7.js +283 -0
- package/node_modules/hdb/node_modules/iconv-lite/lib/bom-handling.js +48 -0
- package/node_modules/hdb/node_modules/iconv-lite/lib/helpers/merge-exports.js +13 -0
- package/node_modules/hdb/node_modules/iconv-lite/lib/index.d.ts +41 -0
- package/node_modules/hdb/node_modules/iconv-lite/lib/index.js +183 -0
- package/node_modules/hdb/node_modules/iconv-lite/lib/streams.js +105 -0
- package/node_modules/hdb/node_modules/iconv-lite/package.json +59 -0
- package/node_modules/hdb/package.json +58 -0
- package/node_modules/http-errors/HISTORY.md +186 -0
- package/node_modules/http-errors/LICENSE +23 -0
- package/node_modules/http-errors/README.md +169 -0
- package/node_modules/http-errors/index.js +290 -0
- package/node_modules/http-errors/package.json +54 -0
- package/node_modules/iconv-lite/LICENSE +21 -0
- package/node_modules/iconv-lite/README.md +138 -0
- package/node_modules/iconv-lite/encodings/dbcs-codec.js +532 -0
- package/node_modules/iconv-lite/encodings/dbcs-data.js +185 -0
- package/node_modules/iconv-lite/encodings/index.js +23 -0
- package/node_modules/iconv-lite/encodings/internal.js +218 -0
- package/node_modules/iconv-lite/encodings/sbcs-codec.js +75 -0
- package/node_modules/iconv-lite/encodings/sbcs-data-generated.js +451 -0
- package/node_modules/iconv-lite/encodings/sbcs-data.js +180 -0
- package/node_modules/iconv-lite/encodings/tables/big5-added.json +122 -0
- package/node_modules/iconv-lite/encodings/tables/cp936.json +264 -0
- package/node_modules/iconv-lite/encodings/tables/cp949.json +273 -0
- package/node_modules/iconv-lite/encodings/tables/cp950.json +177 -0
- package/node_modules/iconv-lite/encodings/tables/eucjp.json +182 -0
- package/node_modules/iconv-lite/encodings/tables/gb18030-ranges.json +1 -0
- package/node_modules/iconv-lite/encodings/tables/gbk-added.json +56 -0
- package/node_modules/iconv-lite/encodings/tables/shiftjis.json +125 -0
- package/node_modules/iconv-lite/encodings/utf16.js +187 -0
- package/node_modules/iconv-lite/encodings/utf32.js +314 -0
- package/node_modules/iconv-lite/encodings/utf7.js +283 -0
- package/node_modules/iconv-lite/lib/bom-handling.js +48 -0
- package/node_modules/iconv-lite/lib/helpers/merge-exports.js +13 -0
- package/node_modules/iconv-lite/lib/index.d.ts +129 -0
- package/node_modules/iconv-lite/lib/index.js +182 -0
- package/node_modules/iconv-lite/lib/streams.js +105 -0
- package/node_modules/iconv-lite/package.json +70 -0
- package/node_modules/iconv-lite/types/encodings.d.ts +425 -0
- package/node_modules/inherits/LICENSE +16 -0
- package/node_modules/inherits/README.md +42 -0
- package/node_modules/inherits/inherits.js +9 -0
- package/node_modules/inherits/inherits_browser.js +27 -0
- package/node_modules/inherits/package.json +29 -0
- package/node_modules/ipaddr.js/LICENSE +19 -0
- package/node_modules/ipaddr.js/README.md +233 -0
- package/node_modules/ipaddr.js/ipaddr.min.js +1 -0
- package/node_modules/ipaddr.js/lib/ipaddr.js +673 -0
- package/node_modules/ipaddr.js/lib/ipaddr.js.d.ts +68 -0
- package/node_modules/ipaddr.js/package.json +35 -0
- package/node_modules/is-number/LICENSE +21 -0
- package/node_modules/is-number/README.md +187 -0
- package/node_modules/is-number/index.js +18 -0
- package/node_modules/is-number/package.json +82 -0
- package/node_modules/is-promise/LICENSE +19 -0
- package/node_modules/is-promise/index.d.ts +2 -0
- package/node_modules/is-promise/index.js +6 -0
- package/node_modules/is-promise/index.mjs +3 -0
- package/node_modules/is-promise/package.json +30 -0
- package/node_modules/is-promise/readme.md +33 -0
- package/node_modules/livereload-js/.github/workflows/main.yml +23 -0
- package/node_modules/livereload-js/LICENSE +20 -0
- package/node_modules/livereload-js/README.md +250 -0
- package/node_modules/livereload-js/dist/livereload.js +3795 -0
- package/node_modules/livereload-js/dist/livereload.min.js +1 -0
- package/node_modules/livereload-js/package.json +53 -0
- package/node_modules/livereload-js/src/connector.js +169 -0
- package/node_modules/livereload-js/src/customevents.js +37 -0
- package/node_modules/livereload-js/src/less.js +60 -0
- package/node_modules/livereload-js/src/livereload.js +245 -0
- package/node_modules/livereload-js/src/options.js +96 -0
- package/node_modules/livereload-js/src/protocol.js +98 -0
- package/node_modules/livereload-js/src/reloader.js +611 -0
- package/node_modules/livereload-js/src/startup.js +16 -0
- package/node_modules/livereload-js/src/timer.js +35 -0
- package/node_modules/lz4-wasm-nodejs/LICENSE_APACHE +176 -0
- package/node_modules/lz4-wasm-nodejs/LICENSE_MIT +25 -0
- package/node_modules/lz4-wasm-nodejs/README.md +71 -0
- package/node_modules/lz4-wasm-nodejs/lz4_wasm_nodejs.d.ts +12 -0
- package/node_modules/lz4-wasm-nodejs/lz4_wasm_nodejs.js +127 -0
- package/node_modules/lz4-wasm-nodejs/lz4_wasm_nodejs_bg.wasm +0 -0
- package/node_modules/lz4-wasm-nodejs/package.json +26 -0
- package/node_modules/math-intrinsics/.eslintrc +16 -0
- package/node_modules/math-intrinsics/.github/FUNDING.yml +12 -0
- package/node_modules/math-intrinsics/CHANGELOG.md +24 -0
- package/node_modules/math-intrinsics/LICENSE +21 -0
- package/node_modules/math-intrinsics/README.md +50 -0
- package/node_modules/math-intrinsics/abs.d.ts +1 -0
- package/node_modules/math-intrinsics/abs.js +4 -0
- package/node_modules/math-intrinsics/constants/maxArrayLength.d.ts +3 -0
- package/node_modules/math-intrinsics/constants/maxArrayLength.js +4 -0
- package/node_modules/math-intrinsics/constants/maxSafeInteger.d.ts +3 -0
- package/node_modules/math-intrinsics/constants/maxSafeInteger.js +5 -0
- package/node_modules/math-intrinsics/constants/maxValue.d.ts +3 -0
- package/node_modules/math-intrinsics/constants/maxValue.js +5 -0
- package/node_modules/math-intrinsics/floor.d.ts +1 -0
- package/node_modules/math-intrinsics/floor.js +4 -0
- package/node_modules/math-intrinsics/isFinite.d.ts +3 -0
- package/node_modules/math-intrinsics/isFinite.js +12 -0
- package/node_modules/math-intrinsics/isInteger.d.ts +3 -0
- package/node_modules/math-intrinsics/isInteger.js +16 -0
- package/node_modules/math-intrinsics/isNaN.d.ts +1 -0
- package/node_modules/math-intrinsics/isNaN.js +6 -0
- package/node_modules/math-intrinsics/isNegativeZero.d.ts +3 -0
- package/node_modules/math-intrinsics/isNegativeZero.js +6 -0
- package/node_modules/math-intrinsics/max.d.ts +1 -0
- package/node_modules/math-intrinsics/max.js +4 -0
- package/node_modules/math-intrinsics/min.d.ts +1 -0
- package/node_modules/math-intrinsics/min.js +4 -0
- package/node_modules/math-intrinsics/mod.d.ts +3 -0
- package/node_modules/math-intrinsics/mod.js +9 -0
- package/node_modules/math-intrinsics/package.json +86 -0
- package/node_modules/math-intrinsics/pow.d.ts +1 -0
- package/node_modules/math-intrinsics/pow.js +4 -0
- package/node_modules/math-intrinsics/round.d.ts +1 -0
- package/node_modules/math-intrinsics/round.js +4 -0
- package/node_modules/math-intrinsics/sign.d.ts +3 -0
- package/node_modules/math-intrinsics/sign.js +11 -0
- package/node_modules/math-intrinsics/test/index.js +192 -0
- package/node_modules/math-intrinsics/tsconfig.json +3 -0
- package/node_modules/media-typer/HISTORY.md +50 -0
- package/node_modules/media-typer/LICENSE +22 -0
- package/node_modules/media-typer/README.md +93 -0
- package/node_modules/media-typer/index.js +143 -0
- package/node_modules/media-typer/package.json +33 -0
- package/node_modules/merge-descriptors/index.d.ts +11 -0
- package/node_modules/merge-descriptors/index.js +26 -0
- package/node_modules/merge-descriptors/license +11 -0
- package/node_modules/merge-descriptors/package.json +50 -0
- package/node_modules/merge-descriptors/readme.md +55 -0
- package/node_modules/micromatch/LICENSE +21 -0
- package/node_modules/micromatch/README.md +1024 -0
- package/node_modules/micromatch/index.js +474 -0
- package/node_modules/micromatch/node_modules/picomatch/LICENSE +21 -0
- package/node_modules/micromatch/node_modules/picomatch/README.md +716 -0
- package/node_modules/micromatch/node_modules/picomatch/index.js +3 -0
- package/node_modules/micromatch/node_modules/picomatch/lib/constants.js +184 -0
- package/node_modules/micromatch/node_modules/picomatch/lib/parse.js +1392 -0
- package/node_modules/micromatch/node_modules/picomatch/lib/picomatch.js +342 -0
- package/node_modules/micromatch/node_modules/picomatch/lib/scan.js +391 -0
- package/node_modules/micromatch/node_modules/picomatch/lib/utils.js +64 -0
- package/node_modules/micromatch/node_modules/picomatch/package.json +81 -0
- package/node_modules/micromatch/package.json +119 -0
- package/node_modules/mime-db/HISTORY.md +541 -0
- package/node_modules/mime-db/LICENSE +23 -0
- package/node_modules/mime-db/README.md +109 -0
- package/node_modules/mime-db/db.json +9342 -0
- package/node_modules/mime-db/index.js +12 -0
- package/node_modules/mime-db/package.json +56 -0
- package/node_modules/mime-types/HISTORY.md +428 -0
- package/node_modules/mime-types/LICENSE +23 -0
- package/node_modules/mime-types/README.md +126 -0
- package/node_modules/mime-types/index.js +211 -0
- package/node_modules/mime-types/mimeScore.js +57 -0
- package/node_modules/mime-types/package.json +49 -0
- package/node_modules/minimist/.eslintrc +29 -0
- package/node_modules/minimist/.github/FUNDING.yml +12 -0
- package/node_modules/minimist/.nycrc +14 -0
- package/node_modules/minimist/CHANGELOG.md +298 -0
- package/node_modules/minimist/LICENSE +18 -0
- package/node_modules/minimist/README.md +121 -0
- package/node_modules/minimist/example/parse.js +4 -0
- package/node_modules/minimist/index.js +263 -0
- package/node_modules/minimist/package.json +75 -0
- package/node_modules/minimist/test/all_bool.js +34 -0
- package/node_modules/minimist/test/bool.js +177 -0
- package/node_modules/minimist/test/dash.js +43 -0
- package/node_modules/minimist/test/default_bool.js +37 -0
- package/node_modules/minimist/test/dotted.js +24 -0
- package/node_modules/minimist/test/kv_short.js +32 -0
- package/node_modules/minimist/test/long.js +33 -0
- package/node_modules/minimist/test/num.js +38 -0
- package/node_modules/minimist/test/parse.js +209 -0
- package/node_modules/minimist/test/parse_modified.js +11 -0
- package/node_modules/minimist/test/proto.js +64 -0
- package/node_modules/minimist/test/short.js +69 -0
- package/node_modules/minimist/test/stop_early.js +17 -0
- package/node_modules/minimist/test/unknown.js +104 -0
- package/node_modules/minimist/test/whitespace.js +10 -0
- package/node_modules/ms/index.js +162 -0
- package/node_modules/ms/license.md +21 -0
- package/node_modules/ms/package.json +38 -0
- package/node_modules/ms/readme.md +59 -0
- package/node_modules/mustache/CHANGELOG.md +618 -0
- package/node_modules/mustache/LICENSE +11 -0
- package/node_modules/mustache/README.md +621 -0
- package/node_modules/mustache/bin/mustache +150 -0
- package/node_modules/mustache/mustache.js +772 -0
- package/node_modules/mustache/mustache.min.js +1 -0
- package/node_modules/mustache/mustache.mjs +764 -0
- package/node_modules/mustache/package.json +67 -0
- package/node_modules/mustache/wrappers/dojo/mustache.js.post +4 -0
- package/node_modules/mustache/wrappers/dojo/mustache.js.pre +9 -0
- package/node_modules/mustache/wrappers/jquery/mustache.js.post +13 -0
- package/node_modules/mustache/wrappers/jquery/mustache.js.pre +9 -0
- package/node_modules/mustache/wrappers/mootools/mustache.js.post +5 -0
- package/node_modules/mustache/wrappers/mootools/mustache.js.pre +2 -0
- package/node_modules/mustache/wrappers/qooxdoo/mustache.js.post +9 -0
- package/node_modules/mustache/wrappers/qooxdoo/mustache.js.pre +172 -0
- package/node_modules/mustache/wrappers/yui3/mustache.js.post +4 -0
- package/node_modules/mustache/wrappers/yui3/mustache.js.pre +1 -0
- package/node_modules/negotiator/HISTORY.md +114 -0
- package/node_modules/negotiator/LICENSE +24 -0
- package/node_modules/negotiator/README.md +212 -0
- package/node_modules/negotiator/index.js +83 -0
- package/node_modules/negotiator/lib/charset.js +169 -0
- package/node_modules/negotiator/lib/encoding.js +205 -0
- package/node_modules/negotiator/lib/language.js +179 -0
- package/node_modules/negotiator/lib/mediaType.js +294 -0
- package/node_modules/negotiator/package.json +43 -0
- package/node_modules/neo-async/LICENSE +22 -0
- package/node_modules/neo-async/README.md +273 -0
- package/node_modules/neo-async/all.js +3 -0
- package/node_modules/neo-async/allLimit.js +3 -0
- package/node_modules/neo-async/allSeries.js +3 -0
- package/node_modules/neo-async/angelFall.js +3 -0
- package/node_modules/neo-async/any.js +3 -0
- package/node_modules/neo-async/anyLimit.js +3 -0
- package/node_modules/neo-async/anySeries.js +3 -0
- package/node_modules/neo-async/apply.js +3 -0
- package/node_modules/neo-async/applyEach.js +3 -0
- package/node_modules/neo-async/applyEachSeries.js +3 -0
- package/node_modules/neo-async/async.js +9184 -0
- package/node_modules/neo-async/async.min.js +80 -0
- package/node_modules/neo-async/asyncify.js +3 -0
- package/node_modules/neo-async/auto.js +3 -0
- package/node_modules/neo-async/autoInject.js +3 -0
- package/node_modules/neo-async/cargo.js +3 -0
- package/node_modules/neo-async/compose.js +3 -0
- package/node_modules/neo-async/concat.js +3 -0
- package/node_modules/neo-async/concatLimit.js +3 -0
- package/node_modules/neo-async/concatSeries.js +3 -0
- package/node_modules/neo-async/constant.js +3 -0
- package/node_modules/neo-async/createLogger.js +3 -0
- package/node_modules/neo-async/detect.js +3 -0
- package/node_modules/neo-async/detectLimit.js +3 -0
- package/node_modules/neo-async/detectSeries.js +3 -0
- package/node_modules/neo-async/dir.js +3 -0
- package/node_modules/neo-async/doDuring.js +3 -0
- package/node_modules/neo-async/doUntil.js +3 -0
- package/node_modules/neo-async/doWhilst.js +3 -0
- package/node_modules/neo-async/during.js +3 -0
- package/node_modules/neo-async/each.js +3 -0
- package/node_modules/neo-async/eachLimit.js +3 -0
- package/node_modules/neo-async/eachOf.js +3 -0
- package/node_modules/neo-async/eachOfLimit.js +3 -0
- package/node_modules/neo-async/eachOfSeries.js +3 -0
- package/node_modules/neo-async/eachSeries.js +3 -0
- package/node_modules/neo-async/ensureAsync.js +3 -0
- package/node_modules/neo-async/every.js +3 -0
- package/node_modules/neo-async/everyLimit.js +3 -0
- package/node_modules/neo-async/everySeries.js +3 -0
- package/node_modules/neo-async/fast.js +3 -0
- package/node_modules/neo-async/filter.js +3 -0
- package/node_modules/neo-async/filterLimit.js +3 -0
- package/node_modules/neo-async/filterSeries.js +3 -0
- package/node_modules/neo-async/find.js +3 -0
- package/node_modules/neo-async/findLimit.js +3 -0
- package/node_modules/neo-async/findSeries.js +3 -0
- package/node_modules/neo-async/foldl.js +3 -0
- package/node_modules/neo-async/foldr.js +3 -0
- package/node_modules/neo-async/forEach.js +3 -0
- package/node_modules/neo-async/forEachLimit.js +3 -0
- package/node_modules/neo-async/forEachOf.js +3 -0
- package/node_modules/neo-async/forEachOfLimit.js +3 -0
- package/node_modules/neo-async/forEachOfSeries.js +3 -0
- package/node_modules/neo-async/forEachSeries.js +3 -0
- package/node_modules/neo-async/forever.js +3 -0
- package/node_modules/neo-async/groupBy.js +3 -0
- package/node_modules/neo-async/groupByLimit.js +3 -0
- package/node_modules/neo-async/groupBySeries.js +3 -0
- package/node_modules/neo-async/inject.js +3 -0
- package/node_modules/neo-async/iterator.js +3 -0
- package/node_modules/neo-async/log.js +3 -0
- package/node_modules/neo-async/map.js +3 -0
- package/node_modules/neo-async/mapLimit.js +3 -0
- package/node_modules/neo-async/mapSeries.js +3 -0
- package/node_modules/neo-async/mapValues.js +3 -0
- package/node_modules/neo-async/mapValuesLimit.js +3 -0
- package/node_modules/neo-async/mapValuesSeries.js +3 -0
- package/node_modules/neo-async/memoize.js +3 -0
- package/node_modules/neo-async/nextTick.js +3 -0
- package/node_modules/neo-async/omit.js +3 -0
- package/node_modules/neo-async/omitLimit.js +3 -0
- package/node_modules/neo-async/omitSeries.js +3 -0
- package/node_modules/neo-async/package.json +57 -0
- package/node_modules/neo-async/parallel.js +3 -0
- package/node_modules/neo-async/parallelLimit.js +3 -0
- package/node_modules/neo-async/pick.js +3 -0
- package/node_modules/neo-async/pickLimit.js +3 -0
- package/node_modules/neo-async/pickSeries.js +3 -0
- package/node_modules/neo-async/priorityQueue.js +3 -0
- package/node_modules/neo-async/queue.js +3 -0
- package/node_modules/neo-async/race.js +3 -0
- package/node_modules/neo-async/reduce.js +3 -0
- package/node_modules/neo-async/reduceRight.js +3 -0
- package/node_modules/neo-async/reflect.js +3 -0
- package/node_modules/neo-async/reflectAll.js +3 -0
- package/node_modules/neo-async/reject.js +3 -0
- package/node_modules/neo-async/rejectLimit.js +3 -0
- package/node_modules/neo-async/rejectSeries.js +3 -0
- package/node_modules/neo-async/retry.js +3 -0
- package/node_modules/neo-async/retryable.js +3 -0
- package/node_modules/neo-async/safe.js +3 -0
- package/node_modules/neo-async/select.js +3 -0
- package/node_modules/neo-async/selectLimit.js +3 -0
- package/node_modules/neo-async/selectSeries.js +3 -0
- package/node_modules/neo-async/seq.js +3 -0
- package/node_modules/neo-async/series.js +3 -0
- package/node_modules/neo-async/setImmediate.js +3 -0
- package/node_modules/neo-async/some.js +3 -0
- package/node_modules/neo-async/someLimit.js +3 -0
- package/node_modules/neo-async/someSeries.js +3 -0
- package/node_modules/neo-async/sortBy.js +3 -0
- package/node_modules/neo-async/sortByLimit.js +3 -0
- package/node_modules/neo-async/sortBySeries.js +3 -0
- package/node_modules/neo-async/timeout.js +3 -0
- package/node_modules/neo-async/times.js +3 -0
- package/node_modules/neo-async/timesLimit.js +3 -0
- package/node_modules/neo-async/timesSeries.js +3 -0
- package/node_modules/neo-async/transform.js +3 -0
- package/node_modules/neo-async/transformLimit.js +3 -0
- package/node_modules/neo-async/transformSeries.js +3 -0
- package/node_modules/neo-async/tryEach.js +3 -0
- package/node_modules/neo-async/unmemoize.js +3 -0
- package/node_modules/neo-async/until.js +3 -0
- package/node_modules/neo-async/waterfall.js +3 -0
- package/node_modules/neo-async/whilst.js +3 -0
- package/node_modules/neo-async/wrapSync.js +3 -0
- package/node_modules/node-cache/.nvmrc +1 -0
- package/node_modules/node-cache/.nycrc.yaml +7 -0
- package/node_modules/node-cache/LICENSE +21 -0
- package/node_modules/node-cache/README.md +497 -0
- package/node_modules/node-cache/_src/test/typedefinition_test.ts +108 -0
- package/node_modules/node-cache/index.d.ts +380 -0
- package/node_modules/node-cache/index.js +17 -0
- package/node_modules/node-cache/lib/node_cache.js +802 -0
- package/node_modules/node-cache/package.json +68 -0
- package/node_modules/node-cache/tsconfig.json +8 -0
- package/node_modules/object-inspect/.eslintrc +53 -0
- package/node_modules/object-inspect/.github/FUNDING.yml +12 -0
- package/node_modules/object-inspect/.nycrc +13 -0
- package/node_modules/object-inspect/CHANGELOG.md +424 -0
- package/node_modules/object-inspect/LICENSE +21 -0
- package/node_modules/object-inspect/example/all.js +23 -0
- package/node_modules/object-inspect/example/circular.js +6 -0
- package/node_modules/object-inspect/example/fn.js +5 -0
- package/node_modules/object-inspect/example/inspect.js +10 -0
- package/node_modules/object-inspect/index.js +544 -0
- package/node_modules/object-inspect/package-support.json +20 -0
- package/node_modules/object-inspect/package.json +105 -0
- package/node_modules/object-inspect/readme.markdown +84 -0
- package/node_modules/object-inspect/test/bigint.js +58 -0
- package/node_modules/object-inspect/test/browser/dom.js +15 -0
- package/node_modules/object-inspect/test/circular.js +16 -0
- package/node_modules/object-inspect/test/deep.js +12 -0
- package/node_modules/object-inspect/test/element.js +53 -0
- package/node_modules/object-inspect/test/err.js +48 -0
- package/node_modules/object-inspect/test/fakes.js +29 -0
- package/node_modules/object-inspect/test/fn.js +76 -0
- package/node_modules/object-inspect/test/global.js +17 -0
- package/node_modules/object-inspect/test/has.js +15 -0
- package/node_modules/object-inspect/test/holes.js +15 -0
- package/node_modules/object-inspect/test/indent-option.js +271 -0
- package/node_modules/object-inspect/test/inspect.js +139 -0
- package/node_modules/object-inspect/test/lowbyte.js +12 -0
- package/node_modules/object-inspect/test/number.js +58 -0
- package/node_modules/object-inspect/test/quoteStyle.js +26 -0
- package/node_modules/object-inspect/test/toStringTag.js +40 -0
- package/node_modules/object-inspect/test/undef.js +12 -0
- package/node_modules/object-inspect/test/values.js +261 -0
- package/node_modules/object-inspect/test-core-js.js +26 -0
- package/node_modules/object-inspect/util.inspect.js +1 -0
- package/node_modules/on-finished/HISTORY.md +98 -0
- package/node_modules/on-finished/LICENSE +23 -0
- package/node_modules/on-finished/README.md +162 -0
- package/node_modules/on-finished/index.js +234 -0
- package/node_modules/on-finished/package.json +39 -0
- package/node_modules/once/LICENSE +15 -0
- package/node_modules/once/README.md +79 -0
- package/node_modules/once/once.js +42 -0
- package/node_modules/once/package.json +33 -0
- package/node_modules/parseurl/HISTORY.md +58 -0
- package/node_modules/parseurl/LICENSE +24 -0
- package/node_modules/parseurl/README.md +133 -0
- package/node_modules/parseurl/index.js +158 -0
- package/node_modules/parseurl/package.json +40 -0
- package/node_modules/path-to-regexp/LICENSE +21 -0
- package/node_modules/path-to-regexp/Readme.md +224 -0
- package/node_modules/path-to-regexp/dist/index.d.ts +147 -0
- package/node_modules/path-to-regexp/dist/index.js +431 -0
- package/node_modules/path-to-regexp/dist/index.js.map +1 -0
- package/node_modules/path-to-regexp/package.json +64 -0
- package/node_modules/pluralize/LICENSE +21 -0
- package/node_modules/pluralize/Readme.md +100 -0
- package/node_modules/pluralize/package.json +40 -0
- package/node_modules/pluralize/pluralize.js +503 -0
- package/node_modules/proxy-addr/HISTORY.md +161 -0
- package/node_modules/proxy-addr/LICENSE +22 -0
- package/node_modules/proxy-addr/README.md +139 -0
- package/node_modules/proxy-addr/index.js +327 -0
- package/node_modules/proxy-addr/package.json +47 -0
- package/node_modules/qs/.editorconfig +46 -0
- package/node_modules/qs/.github/FUNDING.yml +12 -0
- package/node_modules/qs/.github/SECURITY.md +11 -0
- package/node_modules/qs/.github/THREAT_MODEL.md +78 -0
- package/node_modules/qs/.nycrc +13 -0
- package/node_modules/qs/CHANGELOG.md +833 -0
- package/node_modules/qs/LICENSE.md +29 -0
- package/node_modules/qs/README.md +758 -0
- package/node_modules/qs/dist/qs.js +141 -0
- package/node_modules/qs/eslint.config.mjs +57 -0
- package/node_modules/qs/lib/formats.js +23 -0
- package/node_modules/qs/lib/index.js +11 -0
- package/node_modules/qs/lib/parse.js +414 -0
- package/node_modules/qs/lib/stringify.js +363 -0
- package/node_modules/qs/lib/utils.js +381 -0
- package/node_modules/qs/package.json +95 -0
- package/node_modules/qs/test/empty-keys-cases.js +267 -0
- package/node_modules/qs/test/parse.js +1933 -0
- package/node_modules/qs/test/stringify.js +1448 -0
- package/node_modules/qs/test/utils.js +626 -0
- package/node_modules/range-parser/HISTORY.md +56 -0
- package/node_modules/range-parser/LICENSE +23 -0
- package/node_modules/range-parser/README.md +85 -0
- package/node_modules/range-parser/index.js +181 -0
- package/node_modules/range-parser/package.json +48 -0
- package/node_modules/raw-body/LICENSE +22 -0
- package/node_modules/raw-body/README.md +223 -0
- package/node_modules/raw-body/index.d.ts +85 -0
- package/node_modules/raw-body/index.js +336 -0
- package/node_modules/raw-body/package.json +46 -0
- package/node_modules/router/HISTORY.md +228 -0
- package/node_modules/router/LICENSE +23 -0
- package/node_modules/router/README.md +416 -0
- package/node_modules/router/index.js +748 -0
- package/node_modules/router/lib/layer.js +247 -0
- package/node_modules/router/lib/route.js +242 -0
- package/node_modules/router/package.json +44 -0
- package/node_modules/safer-buffer/LICENSE +21 -0
- package/node_modules/safer-buffer/Porting-Buffer.md +268 -0
- package/node_modules/safer-buffer/Readme.md +156 -0
- package/node_modules/safer-buffer/dangerous.js +58 -0
- package/node_modules/safer-buffer/package.json +34 -0
- package/node_modules/safer-buffer/safer.js +77 -0
- package/node_modules/safer-buffer/tests.js +406 -0
- package/node_modules/sax/LICENSE.md +55 -0
- package/node_modules/sax/README.md +227 -0
- package/node_modules/sax/lib/sax.js +1848 -0
- package/node_modules/sax/package.json +34 -0
- package/node_modules/semver/LICENSE +15 -0
- package/node_modules/semver/README.md +680 -0
- package/node_modules/semver/bin/semver.js +195 -0
- package/node_modules/semver/classes/comparator.js +143 -0
- package/node_modules/semver/classes/index.js +7 -0
- package/node_modules/semver/classes/range.js +577 -0
- package/node_modules/semver/classes/semver.js +350 -0
- package/node_modules/semver/functions/clean.js +8 -0
- package/node_modules/semver/functions/cmp.js +54 -0
- package/node_modules/semver/functions/coerce.js +62 -0
- package/node_modules/semver/functions/compare-build.js +9 -0
- package/node_modules/semver/functions/compare-loose.js +5 -0
- package/node_modules/semver/functions/compare.js +7 -0
- package/node_modules/semver/functions/diff.js +60 -0
- package/node_modules/semver/functions/eq.js +5 -0
- package/node_modules/semver/functions/gt.js +5 -0
- package/node_modules/semver/functions/gte.js +5 -0
- package/node_modules/semver/functions/inc.js +21 -0
- package/node_modules/semver/functions/lt.js +5 -0
- package/node_modules/semver/functions/lte.js +5 -0
- package/node_modules/semver/functions/major.js +5 -0
- package/node_modules/semver/functions/minor.js +5 -0
- package/node_modules/semver/functions/neq.js +5 -0
- package/node_modules/semver/functions/parse.js +18 -0
- package/node_modules/semver/functions/patch.js +5 -0
- package/node_modules/semver/functions/prerelease.js +8 -0
- package/node_modules/semver/functions/rcompare.js +5 -0
- package/node_modules/semver/functions/rsort.js +5 -0
- package/node_modules/semver/functions/satisfies.js +12 -0
- package/node_modules/semver/functions/sort.js +5 -0
- package/node_modules/semver/functions/truncate.js +48 -0
- package/node_modules/semver/functions/valid.js +8 -0
- package/node_modules/semver/index.js +93 -0
- package/node_modules/semver/internal/constants.js +37 -0
- package/node_modules/semver/internal/debug.js +11 -0
- package/node_modules/semver/internal/identifiers.js +29 -0
- package/node_modules/semver/internal/lrucache.js +42 -0
- package/node_modules/semver/internal/parse-options.js +17 -0
- package/node_modules/semver/internal/re.js +223 -0
- package/node_modules/semver/package.json +78 -0
- package/node_modules/semver/preload.js +4 -0
- package/node_modules/semver/range.bnf +17 -0
- package/node_modules/semver/ranges/gtr.js +6 -0
- package/node_modules/semver/ranges/intersects.js +9 -0
- package/node_modules/semver/ranges/ltr.js +6 -0
- package/node_modules/semver/ranges/max-satisfying.js +27 -0
- package/node_modules/semver/ranges/min-satisfying.js +26 -0
- package/node_modules/semver/ranges/min-version.js +63 -0
- package/node_modules/semver/ranges/outside.js +82 -0
- package/node_modules/semver/ranges/simplify.js +49 -0
- package/node_modules/semver/ranges/subset.js +249 -0
- package/node_modules/semver/ranges/to-comparators.js +10 -0
- package/node_modules/semver/ranges/valid.js +13 -0
- package/node_modules/send/LICENSE +23 -0
- package/node_modules/send/README.md +317 -0
- package/node_modules/send/index.js +997 -0
- package/node_modules/send/package.json +63 -0
- package/node_modules/serve-static/LICENSE +25 -0
- package/node_modules/serve-static/README.md +253 -0
- package/node_modules/serve-static/index.js +208 -0
- package/node_modules/serve-static/package.json +44 -0
- package/node_modules/setprototypeof/LICENSE +13 -0
- package/node_modules/setprototypeof/README.md +31 -0
- package/node_modules/setprototypeof/index.d.ts +2 -0
- package/node_modules/setprototypeof/index.js +17 -0
- package/node_modules/setprototypeof/package.json +38 -0
- package/node_modules/setprototypeof/test/index.js +24 -0
- package/node_modules/side-channel/.editorconfig +9 -0
- package/node_modules/side-channel/.eslintrc +12 -0
- package/node_modules/side-channel/.github/FUNDING.yml +12 -0
- package/node_modules/side-channel/.nycrc +13 -0
- package/node_modules/side-channel/CHANGELOG.md +120 -0
- package/node_modules/side-channel/LICENSE +21 -0
- package/node_modules/side-channel/README.md +61 -0
- package/node_modules/side-channel/index.d.ts +14 -0
- package/node_modules/side-channel/index.js +46 -0
- package/node_modules/side-channel/package.json +85 -0
- package/node_modules/side-channel/test/index.js +120 -0
- package/node_modules/side-channel/tsconfig.json +9 -0
- package/node_modules/side-channel-list/.editorconfig +9 -0
- package/node_modules/side-channel-list/.eslintrc +11 -0
- package/node_modules/side-channel-list/.github/FUNDING.yml +12 -0
- package/node_modules/side-channel-list/.nycrc +13 -0
- package/node_modules/side-channel-list/CHANGELOG.md +36 -0
- package/node_modules/side-channel-list/LICENSE +21 -0
- package/node_modules/side-channel-list/README.md +62 -0
- package/node_modules/side-channel-list/index.d.ts +13 -0
- package/node_modules/side-channel-list/index.js +111 -0
- package/node_modules/side-channel-list/list.d.ts +14 -0
- package/node_modules/side-channel-list/package.json +77 -0
- package/node_modules/side-channel-list/test/index.js +154 -0
- package/node_modules/side-channel-list/tsconfig.json +9 -0
- package/node_modules/side-channel-map/.editorconfig +9 -0
- package/node_modules/side-channel-map/.eslintrc +11 -0
- package/node_modules/side-channel-map/.github/FUNDING.yml +12 -0
- package/node_modules/side-channel-map/.nycrc +13 -0
- package/node_modules/side-channel-map/CHANGELOG.md +22 -0
- package/node_modules/side-channel-map/LICENSE +21 -0
- package/node_modules/side-channel-map/README.md +62 -0
- package/node_modules/side-channel-map/index.d.ts +15 -0
- package/node_modules/side-channel-map/index.js +68 -0
- package/node_modules/side-channel-map/package.json +80 -0
- package/node_modules/side-channel-map/test/index.js +114 -0
- package/node_modules/side-channel-map/tsconfig.json +9 -0
- package/node_modules/side-channel-weakmap/.editorconfig +9 -0
- package/node_modules/side-channel-weakmap/.eslintrc +12 -0
- package/node_modules/side-channel-weakmap/.github/FUNDING.yml +12 -0
- package/node_modules/side-channel-weakmap/.nycrc +13 -0
- package/node_modules/side-channel-weakmap/CHANGELOG.md +28 -0
- package/node_modules/side-channel-weakmap/LICENSE +21 -0
- package/node_modules/side-channel-weakmap/README.md +62 -0
- package/node_modules/side-channel-weakmap/index.d.ts +15 -0
- package/node_modules/side-channel-weakmap/index.js +84 -0
- package/node_modules/side-channel-weakmap/package.json +87 -0
- package/node_modules/side-channel-weakmap/test/index.js +114 -0
- package/node_modules/side-channel-weakmap/tsconfig.json +9 -0
- package/node_modules/source-map/CHANGELOG.md +301 -0
- package/node_modules/source-map/LICENSE +28 -0
- package/node_modules/source-map/README.md +742 -0
- package/node_modules/source-map/dist/source-map.debug.js +3234 -0
- package/node_modules/source-map/dist/source-map.js +3233 -0
- package/node_modules/source-map/dist/source-map.min.js +2 -0
- package/node_modules/source-map/dist/source-map.min.js.map +1 -0
- package/node_modules/source-map/lib/array-set.js +121 -0
- package/node_modules/source-map/lib/base64-vlq.js +140 -0
- package/node_modules/source-map/lib/base64.js +67 -0
- package/node_modules/source-map/lib/binary-search.js +111 -0
- package/node_modules/source-map/lib/mapping-list.js +79 -0
- package/node_modules/source-map/lib/quick-sort.js +114 -0
- package/node_modules/source-map/lib/source-map-consumer.js +1145 -0
- package/node_modules/source-map/lib/source-map-generator.js +425 -0
- package/node_modules/source-map/lib/source-node.js +413 -0
- package/node_modules/source-map/lib/util.js +488 -0
- package/node_modules/source-map/package.json +73 -0
- package/node_modules/source-map/source-map.d.ts +98 -0
- package/node_modules/source-map/source-map.js +8 -0
- package/node_modules/statuses/HISTORY.md +87 -0
- package/node_modules/statuses/LICENSE +23 -0
- package/node_modules/statuses/README.md +139 -0
- package/node_modules/statuses/codes.json +65 -0
- package/node_modules/statuses/index.js +146 -0
- package/node_modules/statuses/package.json +49 -0
- package/node_modules/to-regex-range/LICENSE +21 -0
- package/node_modules/to-regex-range/README.md +305 -0
- package/node_modules/to-regex-range/index.js +288 -0
- package/node_modules/to-regex-range/package.json +88 -0
- package/node_modules/toidentifier/HISTORY.md +9 -0
- package/node_modules/toidentifier/LICENSE +21 -0
- package/node_modules/toidentifier/README.md +61 -0
- package/node_modules/toidentifier/index.js +32 -0
- package/node_modules/toidentifier/package.json +38 -0
- package/node_modules/type-is/HISTORY.md +292 -0
- package/node_modules/type-is/LICENSE +23 -0
- package/node_modules/type-is/README.md +198 -0
- package/node_modules/type-is/index.js +240 -0
- package/node_modules/type-is/node_modules/content-type/LICENSE +22 -0
- package/node_modules/type-is/node_modules/content-type/README.md +69 -0
- package/node_modules/type-is/node_modules/content-type/dist/index.d.ts +26 -0
- package/node_modules/type-is/node_modules/content-type/dist/index.js +170 -0
- package/node_modules/type-is/node_modules/content-type/dist/index.js.map +1 -0
- package/node_modules/type-is/node_modules/content-type/package.json +52 -0
- package/node_modules/type-is/package.json +51 -0
- package/node_modules/uglify-js/LICENSE +29 -0
- package/node_modules/uglify-js/README.md +1479 -0
- package/node_modules/uglify-js/bin/uglifyjs +624 -0
- package/node_modules/uglify-js/lib/ast.js +2357 -0
- package/node_modules/uglify-js/lib/compress.js +14650 -0
- package/node_modules/uglify-js/lib/minify.js +278 -0
- package/node_modules/uglify-js/lib/mozilla-ast.js +1338 -0
- package/node_modules/uglify-js/lib/output.js +1983 -0
- package/node_modules/uglify-js/lib/parse.js +2589 -0
- package/node_modules/uglify-js/lib/propmangle.js +328 -0
- package/node_modules/uglify-js/lib/scope.js +883 -0
- package/node_modules/uglify-js/lib/sourcemap.js +195 -0
- package/node_modules/uglify-js/lib/transform.js +250 -0
- package/node_modules/uglify-js/lib/utils.js +300 -0
- package/node_modules/uglify-js/package.json +52 -0
- package/node_modules/uglify-js/tools/domprops.html +456 -0
- package/node_modules/uglify-js/tools/domprops.json +8327 -0
- package/node_modules/uglify-js/tools/exports.js +8 -0
- package/node_modules/uglify-js/tools/node.js +115 -0
- package/node_modules/uglify-js/tools/tty.js +22 -0
- package/node_modules/unpipe/HISTORY.md +4 -0
- package/node_modules/unpipe/LICENSE +22 -0
- package/node_modules/unpipe/README.md +43 -0
- package/node_modules/unpipe/index.js +69 -0
- package/node_modules/unpipe/package.json +27 -0
- package/node_modules/vary/HISTORY.md +39 -0
- package/node_modules/vary/LICENSE +22 -0
- package/node_modules/vary/README.md +101 -0
- package/node_modules/vary/index.js +149 -0
- package/node_modules/vary/package.json +43 -0
- package/node_modules/verror/CHANGES.md +28 -0
- package/node_modules/verror/CONTRIBUTING.md +16 -0
- package/node_modules/verror/LICENSE +19 -0
- package/node_modules/verror/README.md +528 -0
- package/node_modules/verror/lib/verror.js +451 -0
- package/node_modules/verror/package.json +30 -0
- package/node_modules/wordwrap/LICENSE +18 -0
- package/node_modules/wordwrap/README.markdown +70 -0
- package/node_modules/wordwrap/example/center.js +10 -0
- package/node_modules/wordwrap/example/meat.js +3 -0
- package/node_modules/wordwrap/index.js +76 -0
- package/node_modules/wordwrap/package.json +34 -0
- package/node_modules/wordwrap/test/break.js +32 -0
- package/node_modules/wordwrap/test/idleness.txt +63 -0
- package/node_modules/wordwrap/test/wrap.js +33 -0
- package/node_modules/wrappy/LICENSE +15 -0
- package/node_modules/wrappy/README.md +36 -0
- package/node_modules/wrappy/package.json +29 -0
- package/node_modules/wrappy/wrappy.js +33 -0
- package/node_modules/ws/LICENSE +20 -0
- package/node_modules/ws/README.md +548 -0
- package/node_modules/ws/browser.js +8 -0
- package/node_modules/ws/index.js +22 -0
- package/node_modules/ws/lib/buffer-util.js +131 -0
- package/node_modules/ws/lib/constants.js +19 -0
- package/node_modules/ws/lib/event-target.js +292 -0
- package/node_modules/ws/lib/extension.js +203 -0
- package/node_modules/ws/lib/limiter.js +55 -0
- package/node_modules/ws/lib/permessage-deflate.js +528 -0
- package/node_modules/ws/lib/receiver.js +760 -0
- package/node_modules/ws/lib/sender.js +607 -0
- package/node_modules/ws/lib/stream.js +161 -0
- package/node_modules/ws/lib/subprotocol.js +62 -0
- package/node_modules/ws/lib/validation.js +152 -0
- package/node_modules/ws/lib/websocket-server.js +562 -0
- package/node_modules/ws/lib/websocket.js +1407 -0
- package/node_modules/ws/package.json +70 -0
- package/node_modules/ws/wrapper.mjs +21 -0
- package/node_modules/xml-js/LICENSE +21 -0
- package/node_modules/xml-js/README.md +390 -0
- package/node_modules/xml-js/bin/cli-helper.js +47 -0
- package/node_modules/xml-js/bin/cli.js +83 -0
- package/node_modules/xml-js/bin/test.json +23 -0
- package/node_modules/xml-js/bin/test.xml +3 -0
- package/node_modules/xml-js/dist/xml-js.js +8310 -0
- package/node_modules/xml-js/dist/xml-js.min.js +8 -0
- package/node_modules/xml-js/index.js +1 -0
- package/node_modules/xml-js/lib/array-helper.js +11 -0
- package/node_modules/xml-js/lib/index.js +13 -0
- package/node_modules/xml-js/lib/js2xml.js +320 -0
- package/node_modules/xml-js/lib/json2xml.js +18 -0
- package/node_modules/xml-js/lib/options-helper.js +43 -0
- package/node_modules/xml-js/lib/xml2js.js +362 -0
- package/node_modules/xml-js/lib/xml2json.js +22 -0
- package/node_modules/xml-js/package.json +111 -0
- package/node_modules/xml-js/types/index.d.ts +154 -0
- package/node_modules/xml-js/types/tsconfig.json +14 -0
- package/node_modules/xml-js/types/typings.json +4 -0
- package/node_modules/xml-js/types/xml-js-tests.ts +60 -0
- package/node_modules/xml-js/webpack.config.js +28 -0
- package/node_modules/yaml/LICENSE +13 -0
- package/node_modules/yaml/README.md +172 -0
- package/node_modules/yaml/bin.mjs +11 -0
- package/node_modules/yaml/browser/dist/compose/compose-collection.js +88 -0
- package/node_modules/yaml/browser/dist/compose/compose-doc.js +43 -0
- package/node_modules/yaml/browser/dist/compose/compose-node.js +109 -0
- package/node_modules/yaml/browser/dist/compose/compose-scalar.js +86 -0
- package/node_modules/yaml/browser/dist/compose/composer.js +219 -0
- package/node_modules/yaml/browser/dist/compose/resolve-block-map.js +115 -0
- package/node_modules/yaml/browser/dist/compose/resolve-block-scalar.js +198 -0
- package/node_modules/yaml/browser/dist/compose/resolve-block-seq.js +49 -0
- package/node_modules/yaml/browser/dist/compose/resolve-end.js +37 -0
- package/node_modules/yaml/browser/dist/compose/resolve-flow-collection.js +207 -0
- package/node_modules/yaml/browser/dist/compose/resolve-flow-scalar.js +225 -0
- package/node_modules/yaml/browser/dist/compose/resolve-props.js +146 -0
- package/node_modules/yaml/browser/dist/compose/util-contains-newline.js +34 -0
- package/node_modules/yaml/browser/dist/compose/util-empty-scalar-position.js +26 -0
- package/node_modules/yaml/browser/dist/compose/util-flow-indent-check.js +15 -0
- package/node_modules/yaml/browser/dist/compose/util-map-includes.js +13 -0
- package/node_modules/yaml/browser/dist/doc/Document.js +335 -0
- package/node_modules/yaml/browser/dist/doc/anchors.js +71 -0
- package/node_modules/yaml/browser/dist/doc/applyReviver.js +55 -0
- package/node_modules/yaml/browser/dist/doc/createNode.js +88 -0
- package/node_modules/yaml/browser/dist/doc/directives.js +176 -0
- package/node_modules/yaml/browser/dist/errors.js +57 -0
- package/node_modules/yaml/browser/dist/index.js +17 -0
- package/node_modules/yaml/browser/dist/log.js +11 -0
- package/node_modules/yaml/browser/dist/nodes/Alias.js +116 -0
- package/node_modules/yaml/browser/dist/nodes/Collection.js +147 -0
- package/node_modules/yaml/browser/dist/nodes/Node.js +38 -0
- package/node_modules/yaml/browser/dist/nodes/Pair.js +36 -0
- package/node_modules/yaml/browser/dist/nodes/Scalar.js +24 -0
- package/node_modules/yaml/browser/dist/nodes/YAMLMap.js +144 -0
- package/node_modules/yaml/browser/dist/nodes/YAMLSeq.js +113 -0
- package/node_modules/yaml/browser/dist/nodes/addPairToJSMap.js +63 -0
- package/node_modules/yaml/browser/dist/nodes/identity.js +36 -0
- package/node_modules/yaml/browser/dist/nodes/toJS.js +37 -0
- package/node_modules/yaml/browser/dist/parse/cst-scalar.js +214 -0
- package/node_modules/yaml/browser/dist/parse/cst-stringify.js +61 -0
- package/node_modules/yaml/browser/dist/parse/cst-visit.js +97 -0
- package/node_modules/yaml/browser/dist/parse/cst.js +98 -0
- package/node_modules/yaml/browser/dist/parse/lexer.js +721 -0
- package/node_modules/yaml/browser/dist/parse/line-counter.js +39 -0
- package/node_modules/yaml/browser/dist/parse/parser.js +975 -0
- package/node_modules/yaml/browser/dist/public-api.js +102 -0
- package/node_modules/yaml/browser/dist/schema/Schema.js +37 -0
- package/node_modules/yaml/browser/dist/schema/common/map.js +17 -0
- package/node_modules/yaml/browser/dist/schema/common/null.js +15 -0
- package/node_modules/yaml/browser/dist/schema/common/seq.js +17 -0
- package/node_modules/yaml/browser/dist/schema/common/string.js +14 -0
- package/node_modules/yaml/browser/dist/schema/core/bool.js +19 -0
- package/node_modules/yaml/browser/dist/schema/core/float.js +43 -0
- package/node_modules/yaml/browser/dist/schema/core/int.js +38 -0
- package/node_modules/yaml/browser/dist/schema/core/schema.js +23 -0
- package/node_modules/yaml/browser/dist/schema/json/schema.js +62 -0
- package/node_modules/yaml/browser/dist/schema/tags.js +96 -0
- package/node_modules/yaml/browser/dist/schema/yaml-1.1/binary.js +58 -0
- package/node_modules/yaml/browser/dist/schema/yaml-1.1/bool.js +26 -0
- package/node_modules/yaml/browser/dist/schema/yaml-1.1/float.js +46 -0
- package/node_modules/yaml/browser/dist/schema/yaml-1.1/int.js +71 -0
- package/node_modules/yaml/browser/dist/schema/yaml-1.1/merge.js +67 -0
- package/node_modules/yaml/browser/dist/schema/yaml-1.1/omap.js +74 -0
- package/node_modules/yaml/browser/dist/schema/yaml-1.1/pairs.js +78 -0
- package/node_modules/yaml/browser/dist/schema/yaml-1.1/schema.js +39 -0
- package/node_modules/yaml/browser/dist/schema/yaml-1.1/set.js +93 -0
- package/node_modules/yaml/browser/dist/schema/yaml-1.1/timestamp.js +101 -0
- package/node_modules/yaml/browser/dist/stringify/foldFlowLines.js +146 -0
- package/node_modules/yaml/browser/dist/stringify/stringify.js +129 -0
- package/node_modules/yaml/browser/dist/stringify/stringifyCollection.js +153 -0
- package/node_modules/yaml/browser/dist/stringify/stringifyComment.js +20 -0
- package/node_modules/yaml/browser/dist/stringify/stringifyDocument.js +85 -0
- package/node_modules/yaml/browser/dist/stringify/stringifyNumber.js +25 -0
- package/node_modules/yaml/browser/dist/stringify/stringifyPair.js +150 -0
- package/node_modules/yaml/browser/dist/stringify/stringifyString.js +336 -0
- package/node_modules/yaml/browser/dist/util.js +11 -0
- package/node_modules/yaml/browser/dist/visit.js +233 -0
- package/node_modules/yaml/browser/index.js +5 -0
- package/{lib/init/template/esm/files/package.json.hbs → node_modules/yaml/browser/package.json} +1 -1
- package/node_modules/yaml/dist/cli.d.ts +8 -0
- package/node_modules/yaml/dist/cli.mjs +201 -0
- package/node_modules/yaml/dist/compose/compose-collection.d.ts +11 -0
- package/node_modules/yaml/dist/compose/compose-collection.js +90 -0
- package/node_modules/yaml/dist/compose/compose-doc.d.ts +7 -0
- package/node_modules/yaml/dist/compose/compose-doc.js +45 -0
- package/node_modules/yaml/dist/compose/compose-node.d.ts +29 -0
- package/node_modules/yaml/dist/compose/compose-node.js +112 -0
- package/node_modules/yaml/dist/compose/compose-scalar.d.ts +5 -0
- package/node_modules/yaml/dist/compose/compose-scalar.js +88 -0
- package/node_modules/yaml/dist/compose/composer.d.ts +63 -0
- package/node_modules/yaml/dist/compose/composer.js +224 -0
- package/node_modules/yaml/dist/compose/resolve-block-map.d.ts +6 -0
- package/node_modules/yaml/dist/compose/resolve-block-map.js +117 -0
- package/node_modules/yaml/dist/compose/resolve-block-scalar.d.ts +11 -0
- package/node_modules/yaml/dist/compose/resolve-block-scalar.js +200 -0
- package/node_modules/yaml/dist/compose/resolve-block-seq.d.ts +6 -0
- package/node_modules/yaml/dist/compose/resolve-block-seq.js +51 -0
- package/node_modules/yaml/dist/compose/resolve-end.d.ts +6 -0
- package/node_modules/yaml/dist/compose/resolve-end.js +39 -0
- package/node_modules/yaml/dist/compose/resolve-flow-collection.d.ts +7 -0
- package/node_modules/yaml/dist/compose/resolve-flow-collection.js +209 -0
- package/node_modules/yaml/dist/compose/resolve-flow-scalar.d.ts +10 -0
- package/node_modules/yaml/dist/compose/resolve-flow-scalar.js +227 -0
- package/node_modules/yaml/dist/compose/resolve-props.d.ts +23 -0
- package/node_modules/yaml/dist/compose/resolve-props.js +148 -0
- package/node_modules/yaml/dist/compose/util-contains-newline.d.ts +2 -0
- package/node_modules/yaml/dist/compose/util-contains-newline.js +36 -0
- package/node_modules/yaml/dist/compose/util-empty-scalar-position.d.ts +2 -0
- package/node_modules/yaml/dist/compose/util-empty-scalar-position.js +28 -0
- package/node_modules/yaml/dist/compose/util-flow-indent-check.d.ts +3 -0
- package/node_modules/yaml/dist/compose/util-flow-indent-check.js +17 -0
- package/node_modules/yaml/dist/compose/util-map-includes.d.ts +4 -0
- package/node_modules/yaml/dist/compose/util-map-includes.js +15 -0
- package/node_modules/yaml/dist/doc/Document.d.ts +141 -0
- package/node_modules/yaml/dist/doc/Document.js +337 -0
- package/node_modules/yaml/dist/doc/anchors.d.ts +24 -0
- package/node_modules/yaml/dist/doc/anchors.js +76 -0
- package/node_modules/yaml/dist/doc/applyReviver.d.ts +9 -0
- package/node_modules/yaml/dist/doc/applyReviver.js +57 -0
- package/node_modules/yaml/dist/doc/createNode.d.ts +17 -0
- package/node_modules/yaml/dist/doc/createNode.js +90 -0
- package/node_modules/yaml/dist/doc/directives.d.ts +49 -0
- package/node_modules/yaml/dist/doc/directives.js +178 -0
- package/node_modules/yaml/dist/errors.d.ts +21 -0
- package/node_modules/yaml/dist/errors.js +62 -0
- package/node_modules/yaml/dist/index.d.ts +25 -0
- package/node_modules/yaml/dist/index.js +50 -0
- package/node_modules/yaml/dist/log.d.ts +3 -0
- package/node_modules/yaml/dist/log.js +19 -0
- package/node_modules/yaml/dist/nodes/Alias.d.ts +29 -0
- package/node_modules/yaml/dist/nodes/Alias.js +118 -0
- package/node_modules/yaml/dist/nodes/Collection.d.ts +73 -0
- package/node_modules/yaml/dist/nodes/Collection.js +151 -0
- package/node_modules/yaml/dist/nodes/Node.d.ts +53 -0
- package/node_modules/yaml/dist/nodes/Node.js +40 -0
- package/node_modules/yaml/dist/nodes/Pair.d.ts +22 -0
- package/node_modules/yaml/dist/nodes/Pair.js +39 -0
- package/node_modules/yaml/dist/nodes/Scalar.d.ts +47 -0
- package/node_modules/yaml/dist/nodes/Scalar.js +27 -0
- package/node_modules/yaml/dist/nodes/YAMLMap.d.ts +53 -0
- package/node_modules/yaml/dist/nodes/YAMLMap.js +147 -0
- package/node_modules/yaml/dist/nodes/YAMLSeq.d.ts +60 -0
- package/node_modules/yaml/dist/nodes/YAMLSeq.js +115 -0
- package/node_modules/yaml/dist/nodes/addPairToJSMap.d.ts +4 -0
- package/node_modules/yaml/dist/nodes/addPairToJSMap.js +65 -0
- package/node_modules/yaml/dist/nodes/identity.d.ts +23 -0
- package/node_modules/yaml/dist/nodes/identity.js +53 -0
- package/node_modules/yaml/dist/nodes/toJS.d.ts +29 -0
- package/node_modules/yaml/dist/nodes/toJS.js +39 -0
- package/node_modules/yaml/dist/options.d.ts +350 -0
- package/node_modules/yaml/dist/parse/cst-scalar.d.ts +64 -0
- package/node_modules/yaml/dist/parse/cst-scalar.js +218 -0
- package/node_modules/yaml/dist/parse/cst-stringify.d.ts +8 -0
- package/node_modules/yaml/dist/parse/cst-stringify.js +63 -0
- package/node_modules/yaml/dist/parse/cst-visit.d.ts +39 -0
- package/node_modules/yaml/dist/parse/cst-visit.js +99 -0
- package/node_modules/yaml/dist/parse/cst.d.ts +109 -0
- package/node_modules/yaml/dist/parse/cst.js +112 -0
- package/node_modules/yaml/dist/parse/lexer.d.ts +87 -0
- package/node_modules/yaml/dist/parse/lexer.js +723 -0
- package/node_modules/yaml/dist/parse/line-counter.d.ts +22 -0
- package/node_modules/yaml/dist/parse/line-counter.js +41 -0
- package/node_modules/yaml/dist/parse/parser.d.ts +84 -0
- package/node_modules/yaml/dist/parse/parser.js +980 -0
- package/node_modules/yaml/dist/public-api.d.ts +44 -0
- package/node_modules/yaml/dist/public-api.js +107 -0
- package/node_modules/yaml/dist/schema/Schema.d.ts +17 -0
- package/node_modules/yaml/dist/schema/Schema.js +39 -0
- package/node_modules/yaml/dist/schema/common/map.d.ts +2 -0
- package/node_modules/yaml/dist/schema/common/map.js +19 -0
- package/node_modules/yaml/dist/schema/common/null.d.ts +4 -0
- package/node_modules/yaml/dist/schema/common/null.js +17 -0
- package/node_modules/yaml/dist/schema/common/seq.d.ts +2 -0
- package/node_modules/yaml/dist/schema/common/seq.js +19 -0
- package/node_modules/yaml/dist/schema/common/string.d.ts +2 -0
- package/node_modules/yaml/dist/schema/common/string.js +16 -0
- package/node_modules/yaml/dist/schema/core/bool.d.ts +4 -0
- package/node_modules/yaml/dist/schema/core/bool.js +21 -0
- package/node_modules/yaml/dist/schema/core/float.d.ts +4 -0
- package/node_modules/yaml/dist/schema/core/float.js +47 -0
- package/node_modules/yaml/dist/schema/core/int.d.ts +4 -0
- package/node_modules/yaml/dist/schema/core/int.js +42 -0
- package/node_modules/yaml/dist/schema/core/schema.d.ts +1 -0
- package/node_modules/yaml/dist/schema/core/schema.js +25 -0
- package/node_modules/yaml/dist/schema/json/schema.d.ts +2 -0
- package/node_modules/yaml/dist/schema/json/schema.js +64 -0
- package/node_modules/yaml/dist/schema/json-schema.d.ts +69 -0
- package/node_modules/yaml/dist/schema/tags.d.ts +48 -0
- package/node_modules/yaml/dist/schema/tags.js +99 -0
- package/node_modules/yaml/dist/schema/types.d.ts +92 -0
- package/node_modules/yaml/dist/schema/yaml-1.1/binary.d.ts +2 -0
- package/node_modules/yaml/dist/schema/yaml-1.1/binary.js +70 -0
- package/node_modules/yaml/dist/schema/yaml-1.1/bool.d.ts +7 -0
- package/node_modules/yaml/dist/schema/yaml-1.1/bool.js +29 -0
- package/node_modules/yaml/dist/schema/yaml-1.1/float.d.ts +4 -0
- package/node_modules/yaml/dist/schema/yaml-1.1/float.js +50 -0
- package/node_modules/yaml/dist/schema/yaml-1.1/int.d.ts +5 -0
- package/node_modules/yaml/dist/schema/yaml-1.1/int.js +76 -0
- package/node_modules/yaml/dist/schema/yaml-1.1/merge.d.ts +9 -0
- package/node_modules/yaml/dist/schema/yaml-1.1/merge.js +71 -0
- package/node_modules/yaml/dist/schema/yaml-1.1/omap.d.ts +22 -0
- package/node_modules/yaml/dist/schema/yaml-1.1/omap.js +77 -0
- package/node_modules/yaml/dist/schema/yaml-1.1/pairs.d.ts +10 -0
- package/node_modules/yaml/dist/schema/yaml-1.1/pairs.js +82 -0
- package/node_modules/yaml/dist/schema/yaml-1.1/schema.d.ts +1 -0
- package/node_modules/yaml/dist/schema/yaml-1.1/schema.js +41 -0
- package/node_modules/yaml/dist/schema/yaml-1.1/set.d.ts +28 -0
- package/node_modules/yaml/dist/schema/yaml-1.1/set.js +96 -0
- package/node_modules/yaml/dist/schema/yaml-1.1/timestamp.d.ts +6 -0
- package/node_modules/yaml/dist/schema/yaml-1.1/timestamp.js +105 -0
- package/node_modules/yaml/dist/stringify/foldFlowLines.d.ts +34 -0
- package/node_modules/yaml/dist/stringify/foldFlowLines.js +151 -0
- package/node_modules/yaml/dist/stringify/stringify.d.ts +21 -0
- package/node_modules/yaml/dist/stringify/stringify.js +132 -0
- package/node_modules/yaml/dist/stringify/stringifyCollection.d.ts +17 -0
- package/node_modules/yaml/dist/stringify/stringifyCollection.js +155 -0
- package/node_modules/yaml/dist/stringify/stringifyComment.d.ts +10 -0
- package/node_modules/yaml/dist/stringify/stringifyComment.js +24 -0
- package/node_modules/yaml/dist/stringify/stringifyDocument.d.ts +4 -0
- package/node_modules/yaml/dist/stringify/stringifyDocument.js +87 -0
- package/node_modules/yaml/dist/stringify/stringifyNumber.d.ts +2 -0
- package/node_modules/yaml/dist/stringify/stringifyNumber.js +27 -0
- package/node_modules/yaml/dist/stringify/stringifyPair.d.ts +3 -0
- package/node_modules/yaml/dist/stringify/stringifyPair.js +152 -0
- package/node_modules/yaml/dist/stringify/stringifyString.d.ts +9 -0
- package/node_modules/yaml/dist/stringify/stringifyString.js +338 -0
- package/node_modules/yaml/dist/test-events.d.ts +4 -0
- package/node_modules/yaml/dist/test-events.js +134 -0
- package/node_modules/yaml/dist/util.d.ts +16 -0
- package/node_modules/yaml/dist/util.js +28 -0
- package/node_modules/yaml/dist/visit.d.ts +102 -0
- package/node_modules/yaml/dist/visit.js +236 -0
- package/node_modules/yaml/package.json +97 -0
- package/node_modules/yaml/util.js +2 -0
- package/package.json +117 -8
- package/bin/data-products/get-csn-via-dp-cli.js +0 -41
- package/bin/extend.js +0 -74
- package/bin/migrate.js +0 -66
- package/lib/init/template/containerize/index.js +0 -22
- package/lib/init/template/helm/index.js +0 -163
- package/lib/init/template/helm-unified-runtime/index.js +0 -65
- package/lib/init/template/html5-repo/files/html5-deployer.package.json.hbs +0 -11
- package/lib/mtx/download_legacy.js +0 -43
- package/lib/mtx/util/legacy_ext.js +0 -15
- package/npm-shrinkwrap.json +0 -1738
|
@@ -0,0 +1,3084 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
// to.cdl() renderer
|
|
4
|
+
//
|
|
5
|
+
// This file contains the whole to.cdl(), which takes CSN and outputs CDL.
|
|
6
|
+
// It used e.g. by `cds import`.
|
|
7
|
+
//
|
|
8
|
+
//
|
|
9
|
+
// # Development Notes
|
|
10
|
+
//
|
|
11
|
+
// ## Abbreviations used
|
|
12
|
+
// - fqn : fully qualified name, i.e. a name that is a global definition reference
|
|
13
|
+
//
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
const keywords = require('../base/keywords');
|
|
17
|
+
const { cdlNewLineRegEx } = require('../language/textUtils');
|
|
18
|
+
const { findElement, createExpressionRenderer, withoutCast } = require('./utils/common');
|
|
19
|
+
const { escapeString, hasUnpairedUnicodeSurrogate } = require('./utils/stringEscapes');
|
|
20
|
+
const { checkCSNVersion } = require('../json/csnVersion');
|
|
21
|
+
const { normalizeTypeRef, forEachDefinition } = require('../model/csnUtils');
|
|
22
|
+
const enrichUniversalCsn = require('../transform/universalCsn/universalCsnEnricher');
|
|
23
|
+
const { isBetaEnabled } = require('../base/specialOptions');
|
|
24
|
+
const { ModelError, CompilerAssertion } = require('../base/error');
|
|
25
|
+
const { typeParameters, specialFunctions } = require('../compiler/builtins');
|
|
26
|
+
const { isAnnotationExpression } = require('../base/builtins');
|
|
27
|
+
const { forEach } = require('../utils/objectUtils');
|
|
28
|
+
const { isBuiltinType } = require('../base/builtins');
|
|
29
|
+
const { cloneFullCsn } = require('../base/cloneCsn');
|
|
30
|
+
const { getKeysDict, implicitAs } = require('../base/csnRefs');
|
|
31
|
+
const { undelimitedIdentifierRegex } = require('../parsers/identifiers');
|
|
32
|
+
const { getNormalizedQuery } = require('../model/csnUtils');
|
|
33
|
+
const {
|
|
34
|
+
line,
|
|
35
|
+
pretty,
|
|
36
|
+
nestBy,
|
|
37
|
+
bracketBlock,
|
|
38
|
+
joinDocuments,
|
|
39
|
+
} = require('./utils/pretty');
|
|
40
|
+
|
|
41
|
+
const specialFunctionKeywords = Object.create(null);
|
|
42
|
+
|
|
43
|
+
const MAX_LINE_WIDTH = 72;
|
|
44
|
+
const INDENT_SIZE = 2;
|
|
45
|
+
|
|
46
|
+
function format( document ) {
|
|
47
|
+
return pretty(document, MAX_LINE_WIDTH);
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
/**
|
|
51
|
+
* @param {string} path
|
|
52
|
+
* @returns {string}
|
|
53
|
+
*/
|
|
54
|
+
function rootPathSegment( path ) {
|
|
55
|
+
// RegEx is at least twice as fast as .split()[0]
|
|
56
|
+
return path.match(/^[^.]+/)[0];
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
/**
|
|
60
|
+
* Path alias to be rendered as a USING statement.
|
|
61
|
+
*/
|
|
62
|
+
class UsingAlias {
|
|
63
|
+
path;
|
|
64
|
+
alias;
|
|
65
|
+
|
|
66
|
+
/**
|
|
67
|
+
* @param {string} path
|
|
68
|
+
* @param {string} alias
|
|
69
|
+
*/
|
|
70
|
+
constructor(path, alias) {
|
|
71
|
+
this.path = path;
|
|
72
|
+
this.alias = alias;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
requiresExplicitAlias() {
|
|
76
|
+
return this.alias && implicitAs(this.path) !== this.alias;
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
class NameScopeStack {
|
|
81
|
+
/** @type {DefinitionPathTree[]} */
|
|
82
|
+
#scopes = [];
|
|
83
|
+
/** @type {Record<string, UsingAlias>} */
|
|
84
|
+
#aliasToFqn = Object.create(null);
|
|
85
|
+
/** @type {Record<string, UsingAlias>} */
|
|
86
|
+
#fqnToAlias = Object.create(null);
|
|
87
|
+
/** @type {string|null} */
|
|
88
|
+
#namespaceAlias = null;
|
|
89
|
+
|
|
90
|
+
/**
|
|
91
|
+
@param {DefinitionPathTree} root
|
|
92
|
+
@param {CSN.Model} csn
|
|
93
|
+
*/
|
|
94
|
+
setRootScope( root, csn ) {
|
|
95
|
+
root.availableRootPaths = Object.assign(Object.create(null), root.children);
|
|
96
|
+
this.#scopes = [ root ];
|
|
97
|
+
|
|
98
|
+
this.#prepareUniqueUsingsForRootPaths(csn);
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
/**
|
|
102
|
+
* @param {DefinitionPathTree} scope
|
|
103
|
+
*/
|
|
104
|
+
pushNameEnv(scope) {
|
|
105
|
+
const outerScope = this.#scopes.at(-1);
|
|
106
|
+
|
|
107
|
+
const isNamespace = this.#scopes.length === 1 && !scope.definition;
|
|
108
|
+
if (isNamespace)
|
|
109
|
+
this.#namespaceAlias = implicitAs(scope.name);
|
|
110
|
+
|
|
111
|
+
// Own children are always available.
|
|
112
|
+
// Root paths of the outer scope are also available in the inner scope.
|
|
113
|
+
scope.availableRootPaths = Object.assign(Object.create(null), outerScope.availableRootPaths, scope.children);
|
|
114
|
+
this.#scopes.push(scope);
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
popNameEnv() {
|
|
118
|
+
const popped = this.#scopes.pop();
|
|
119
|
+
const wasNamespace = this.#scopes.length === 1 && !popped.definition;
|
|
120
|
+
if (wasNamespace)
|
|
121
|
+
this.#namespaceAlias = null;
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
/**
|
|
125
|
+
* To be able to refer to definitions outside the current scope, we need to have
|
|
126
|
+
* unique USING statements. The most stable way is to create a USING statement for
|
|
127
|
+
* root path-segments on-demand and give it an alias by having it unique in the set
|
|
128
|
+
* of all path segments of all definitions.
|
|
129
|
+
*
|
|
130
|
+
* While this will still lead to some long paths here and there, it is the most
|
|
131
|
+
* secure way to avoid ambiguities due to shadowing names.
|
|
132
|
+
*
|
|
133
|
+
* @param {CSN.Model} csn
|
|
134
|
+
*/
|
|
135
|
+
#prepareUniqueUsingsForRootPaths(csn) {
|
|
136
|
+
// We include vocabularies here, too, because their names are affected by a global "namespace".
|
|
137
|
+
const names = [
|
|
138
|
+
...Object.keys(csn.definitions || {}),
|
|
139
|
+
...Object.keys(csn.vocabularies || {}),
|
|
140
|
+
...(csn.extensions || []).map(ext => ext.extend || ext.annotate || ''),
|
|
141
|
+
];
|
|
142
|
+
const segmentedNames = names.map(name => name.split('.'));
|
|
143
|
+
this.nonRootSegments = new Set(segmentedNames.map(segments => segments.slice(1)).flat(1));
|
|
144
|
+
// Don't use `this.#scopes[0].availableRootPaths`, as that will contain unreachable paths,
|
|
145
|
+
// e.g. for a file that contains `namespace a.b`, `a` is not reachable.
|
|
146
|
+
this.rootSegments = new Set(segmentedNames.map(name => name[0]));
|
|
147
|
+
this.rootSegments.add('cds'); // builtin namespaces
|
|
148
|
+
this.rootSegments.add('hana');
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
/**
|
|
152
|
+
* @param {string} fqn Path for which we want to add an alias.
|
|
153
|
+
*/
|
|
154
|
+
#addUsingAlias( fqn ) {
|
|
155
|
+
const segments = fqn.split('.');
|
|
156
|
+
let aliasName = segments.at(-1);
|
|
157
|
+
// An explicit alias only needs to be used if the implicit one has the possibility of
|
|
158
|
+
// being shadowed in any scope or if there is already an alias of that name.
|
|
159
|
+
if (this.nonRootSegments.has(aliasName) || this.#aliasToFqn[aliasName]) {
|
|
160
|
+
// There is a non-root segment of the same root name, hence the need for aliases.
|
|
161
|
+
let counter = 0;
|
|
162
|
+
aliasName += '_';
|
|
163
|
+
const baseAlias = aliasName;
|
|
164
|
+
while (this.nonRootSegments.has(aliasName) || this.rootSegments.has(aliasName) || this.#aliasToFqn[aliasName]) {
|
|
165
|
+
// Alias must be unique among _all_ segments and existing USINGs.
|
|
166
|
+
aliasName = `${ baseAlias }${ ++counter }`;
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
// Always add an alias, even if unnecessary, as we'd otherwise try to create
|
|
171
|
+
// it in #useAliasForPath() again if the same rootName is seen again.
|
|
172
|
+
if (this.#aliasToFqn[aliasName])
|
|
173
|
+
throw new CompilerAssertion(`to.cdl: Alias "${ aliasName }" already exists; collision for ${ fqn } and ${ this.#aliasToFqn[aliasName].path }`);
|
|
174
|
+
const alias = new UsingAlias(fqn, aliasName);
|
|
175
|
+
this.#aliasToFqn[aliasName] = alias;
|
|
176
|
+
this.#fqnToAlias[fqn] = alias;
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
/**
|
|
180
|
+
* We assume that definition names, when rendered, are always relative
|
|
181
|
+
* to the current name environment.
|
|
182
|
+
*
|
|
183
|
+
* This function must only be used for statements that _create_ definitions
|
|
184
|
+
* and not for references _to_ definitions.
|
|
185
|
+
*
|
|
186
|
+
* @param {string} fqn
|
|
187
|
+
* @returns {string}
|
|
188
|
+
*/
|
|
189
|
+
definitionName(fqn) {
|
|
190
|
+
const leaf = this.#scopes.at(-1);
|
|
191
|
+
if (!leaf?.name)
|
|
192
|
+
return fqn;
|
|
193
|
+
if (isBuiltinType(fqn)) {
|
|
194
|
+
// For e.g. `annotate` statements:
|
|
195
|
+
// - `annotate String;` is invalid
|
|
196
|
+
// - `annotate cds.String;` works
|
|
197
|
+
return fqn;
|
|
198
|
+
}
|
|
199
|
+
if (fqn.startsWith(`${ leaf.name }.`))
|
|
200
|
+
return fqn.substring(leaf.name.length + 1); // '+1' => also remove '.'
|
|
201
|
+
throw new CompilerAssertion('to.cdl: Definition to be rendered is not in current name scope!');
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
/**
|
|
205
|
+
* Get a relative reference to the given definition name in the current name environment.
|
|
206
|
+
*
|
|
207
|
+
* This function must only be used for references _to_ definitions and not
|
|
208
|
+
* for statements that _create_ definitions, i.e _introduce_ a new name.
|
|
209
|
+
*
|
|
210
|
+
* @param {string} fqn
|
|
211
|
+
* @returns {string}
|
|
212
|
+
*/
|
|
213
|
+
definitionReference(fqn) {
|
|
214
|
+
if (isBuiltinType(fqn)) {
|
|
215
|
+
const ref = this.builtinShorthandReference(fqn);
|
|
216
|
+
if (ref !== null)
|
|
217
|
+
return ref;
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
const name = rootPathSegment(fqn);
|
|
221
|
+
// Go through all scopes except the root one, since in there, paths are always absolute.
|
|
222
|
+
for (let i = this.#scopes.length - 1; i >= 1; i--) {
|
|
223
|
+
const tree = this.#scopes[i];
|
|
224
|
+
|
|
225
|
+
if (tree.name && fqn.startsWith(`${ tree.name }.`)) {
|
|
226
|
+
// FQN is in current scope.
|
|
227
|
+
const relativeName = fqn.substring(tree.name.length + 1);
|
|
228
|
+
const relativeRoot = rootPathSegment(relativeName);
|
|
229
|
+
|
|
230
|
+
// Since CDS requires root path segments to be _known within a CDL document_, we
|
|
231
|
+
// need to check if the root path is _known_. If not, we need a USING statement.
|
|
232
|
+
// Example: `namespace ns; entity C : ns.D {};` -> must render alias, as 'D' would
|
|
233
|
+
// be invalid! Required for parseCdl.
|
|
234
|
+
if (!tree.children[relativeRoot])
|
|
235
|
+
return this.#useAliasForPathInScope(fqn, tree);
|
|
236
|
+
|
|
237
|
+
// Name can be used relative to scope 'tree'. We now need to check if the relative
|
|
238
|
+
// name does not collide with more inner scopes by checking for direct children.
|
|
239
|
+
for (let j = this.#scopes.length - 1; j > i; j--) {
|
|
240
|
+
if (this.#scopes[j].children[relativeRoot]) {
|
|
241
|
+
// collision; requires alias
|
|
242
|
+
return this.#useAliasForPathInScope(fqn, tree);
|
|
243
|
+
}
|
|
244
|
+
}
|
|
245
|
+
|
|
246
|
+
return relativeName;
|
|
247
|
+
}
|
|
248
|
+
else if (name in tree.children) {
|
|
249
|
+
// Name is in current scope, but it is not the artifact we're looking for.
|
|
250
|
+
// Use a global alias to avoid confusing it.
|
|
251
|
+
return this.#useAliasForPathInScope(fqn, null);
|
|
252
|
+
}
|
|
253
|
+
}
|
|
254
|
+
|
|
255
|
+
// At this point, the path is unknown and outside any non-root scope.
|
|
256
|
+
|
|
257
|
+
if (this.#namespaceAlias && (name !== 'cds' || this.#namespaceAlias === 'cds')) {
|
|
258
|
+
// There is a namespace. We need a USING for all non-builtin paths, but also for
|
|
259
|
+
// builtins if the namespace alias collides. Builtin collision, e.g.
|
|
260
|
+
// `type my.cds.String : cds.String;` with common namespace "my.cds".
|
|
261
|
+
return this.#useAliasForPathInScope(fqn, null);
|
|
262
|
+
}
|
|
263
|
+
if (name !== 'cds' && !this.#scopes[0].availableRootPaths?.[name]) {
|
|
264
|
+
// In case the non-builtin path is unknown, add a using statement. Required for parseCdl.
|
|
265
|
+
// Completely unknown: -> alias
|
|
266
|
+
return this.#useAliasForPathInScope(fqn, null);
|
|
267
|
+
}
|
|
268
|
+
// Builtin or root path is known.
|
|
269
|
+
return fqn;
|
|
270
|
+
}
|
|
271
|
+
|
|
272
|
+
/**
|
|
273
|
+
* Adapt the FQN to use a global alias. The alias is created for either
|
|
274
|
+
* the scope in which the FQN resides or the root path segment.
|
|
275
|
+
*
|
|
276
|
+
* @param {string} fqn
|
|
277
|
+
* @param {DefinitionPathTree} [scope]
|
|
278
|
+
* @returns {string}
|
|
279
|
+
*/
|
|
280
|
+
#useAliasForPathInScope( fqn, scope ) {
|
|
281
|
+
const path = scope?.name ? scope.name : rootPathSegment(fqn);
|
|
282
|
+
if (!this.#fqnToAlias[path]?.path)
|
|
283
|
+
this.#addUsingAlias(path);
|
|
284
|
+
|
|
285
|
+
if (this.#fqnToAlias[path].alias === path)
|
|
286
|
+
return fqn; // shortcut to avoid substring()
|
|
287
|
+
|
|
288
|
+
return this.#fqnToAlias[path].alias + fqn.substring(path.length);
|
|
289
|
+
}
|
|
290
|
+
|
|
291
|
+
/**
|
|
292
|
+
* Returns a shorthand reference to the builtin type if possible or
|
|
293
|
+
* null otherwise, in which case the caller must ensure that the full type
|
|
294
|
+
* can be used.
|
|
295
|
+
*
|
|
296
|
+
* Example:
|
|
297
|
+
* cds.Integer -> Integer
|
|
298
|
+
* cds.hana.NCHAR -> hana.NCHAR
|
|
299
|
+
*
|
|
300
|
+
* @param {string} type
|
|
301
|
+
* @returns {string|null}
|
|
302
|
+
*/
|
|
303
|
+
builtinShorthandReference(type) {
|
|
304
|
+
const shortHand = type.slice(4); // remove 'cds.'
|
|
305
|
+
const root = rootPathSegment(shortHand);
|
|
306
|
+
if (this.#scopes.at(-1).availableRootPaths[root])
|
|
307
|
+
return null; // there is already an artifact of the same name
|
|
308
|
+
if (this.#namespaceAlias === root)
|
|
309
|
+
return null; // alias collides with shorthand
|
|
310
|
+
return shortHand;
|
|
311
|
+
}
|
|
312
|
+
|
|
313
|
+
/**
|
|
314
|
+
* Get a list of objects meant to be rendered as USING statements.
|
|
315
|
+
*
|
|
316
|
+
* @returns {UsingAlias[]}
|
|
317
|
+
*/
|
|
318
|
+
getUsings() {
|
|
319
|
+
const result = [];
|
|
320
|
+
for (const alias in this.#aliasToFqn)
|
|
321
|
+
result.push(this.#aliasToFqn[alias]);
|
|
322
|
+
return result;
|
|
323
|
+
}
|
|
324
|
+
}
|
|
325
|
+
|
|
326
|
+
/**
|
|
327
|
+
* @see createDefinitionPathTree()
|
|
328
|
+
*/
|
|
329
|
+
class DefinitionPathTree {
|
|
330
|
+
name = null;
|
|
331
|
+
/** @type {Record<string, DefinitionPathTree>} */
|
|
332
|
+
children = Object.create(null);
|
|
333
|
+
definition = null;
|
|
334
|
+
/** @type {Record<string, DefinitionPathTree>} */
|
|
335
|
+
availableRootPaths = null; // used in NameScopeStack
|
|
336
|
+
|
|
337
|
+
/**
|
|
338
|
+
* @param {string} fqn
|
|
339
|
+
*/
|
|
340
|
+
constructor(fqn) {
|
|
341
|
+
this.name = fqn;
|
|
342
|
+
}
|
|
343
|
+
}
|
|
344
|
+
|
|
345
|
+
/**
|
|
346
|
+
* For a CSN model, constructs a tree of all path segments of all definitions, e.g.
|
|
347
|
+
* definitions `a.b.c.d` and `a.b.e.f` will end up in:
|
|
348
|
+
* ```
|
|
349
|
+
* a
|
|
350
|
+
* └─ b
|
|
351
|
+
* ├─ c
|
|
352
|
+
* │ └─ d (link to definition)
|
|
353
|
+
* └─ e
|
|
354
|
+
* └─ f (link to definition)
|
|
355
|
+
* ```
|
|
356
|
+
*
|
|
357
|
+
* @param {CSN.Model} csn
|
|
358
|
+
* @param {CdlOptions} options
|
|
359
|
+
* @returns {DefinitionPathTree}
|
|
360
|
+
*/
|
|
361
|
+
function createDefinitionPathTree( csn, options ) {
|
|
362
|
+
const tree = new DefinitionPathTree('');
|
|
363
|
+
if (!csn.definitions)
|
|
364
|
+
return tree;
|
|
365
|
+
|
|
366
|
+
const useNesting = options.renderCdlDefinitionNesting !== false;
|
|
367
|
+
|
|
368
|
+
for (const defName in csn.definitions) {
|
|
369
|
+
const segments = defName.split('.');
|
|
370
|
+
if (!useNesting) {
|
|
371
|
+
// If we don't want nesting, don't do more work than necessary:
|
|
372
|
+
// only the first path step is relevant
|
|
373
|
+
segments.length = 1;
|
|
374
|
+
}
|
|
375
|
+
let leaf = tree;
|
|
376
|
+
for (let i = 0; i < segments.length; i++) {
|
|
377
|
+
const level = segments[i];
|
|
378
|
+
const fqn = segments.slice(0, i + 1).join('.');
|
|
379
|
+
leaf.children[level] ??= new DefinitionPathTree(fqn);
|
|
380
|
+
leaf = leaf.children[level];
|
|
381
|
+
}
|
|
382
|
+
leaf.definition = csn.definitions[defName];
|
|
383
|
+
}
|
|
384
|
+
return tree;
|
|
385
|
+
}
|
|
386
|
+
|
|
387
|
+
|
|
388
|
+
class CsnToCdl {
|
|
389
|
+
/**
|
|
390
|
+
* @param {CSN.Model} csn
|
|
391
|
+
* @param {CdlOptions} options
|
|
392
|
+
* @param {object} msg
|
|
393
|
+
*/
|
|
394
|
+
constructor(csn, options, msg) {
|
|
395
|
+
this.csn = csn;
|
|
396
|
+
this.options = options;
|
|
397
|
+
this.msg = msg;
|
|
398
|
+
|
|
399
|
+
if (this.options.csnFlavor === 'universal' && isBetaEnabled(this.options, 'enableUniversalCsn')) {
|
|
400
|
+
// Since the expander modifies the CSN, we need to clone it first or
|
|
401
|
+
// toCdl can't guarantee that the input CSN is not modified.
|
|
402
|
+
this.csn = cloneFullCsn(this.csn, this.options);
|
|
403
|
+
enrichUniversalCsn(this.csn, this.options);
|
|
404
|
+
}
|
|
405
|
+
|
|
406
|
+
checkCSNVersion(this.csn, this.options);
|
|
407
|
+
|
|
408
|
+
this.exprRenderer = this.createCdlExpressionRenderer();
|
|
409
|
+
this.subelementAnnotates = [];
|
|
410
|
+
}
|
|
411
|
+
|
|
412
|
+
render() {
|
|
413
|
+
const cdlResult = Object.create(null);
|
|
414
|
+
cdlResult.model = '';
|
|
415
|
+
|
|
416
|
+
const env = createEnv();
|
|
417
|
+
|
|
418
|
+
const useNesting = this.options.renderCdlDefinitionNesting !== false;
|
|
419
|
+
this.definitionTree = createDefinitionPathTree(this.csn, this.options);
|
|
420
|
+
this.commonNamespace = this.getCommonNamespace();
|
|
421
|
+
|
|
422
|
+
env.nameEnvStack.setRootScope(this.definitionTree, this.csn);
|
|
423
|
+
|
|
424
|
+
const useNamespace = this.commonNamespace !== this.definitionTree;
|
|
425
|
+
if (useNamespace)
|
|
426
|
+
env.nameEnvStack.pushNameEnv(this.commonNamespace);
|
|
427
|
+
|
|
428
|
+
cdlResult.model += useNesting
|
|
429
|
+
? this.renderNestedDefinitions(env)
|
|
430
|
+
: this.renderDefinitions(env);
|
|
431
|
+
// sub-element annotations that can't be written directly.
|
|
432
|
+
cdlResult.model += this.renderExtensions(this.subelementAnnotates, env);
|
|
433
|
+
|
|
434
|
+
if (this.csn.vocabularies)
|
|
435
|
+
cdlResult.model += this.renderVocabularies(this.csn.vocabularies, env);
|
|
436
|
+
if (this.csn.extensions)
|
|
437
|
+
cdlResult.model += this.renderExtensions(this.csn.extensions, env);
|
|
438
|
+
|
|
439
|
+
if (useNamespace)
|
|
440
|
+
env.nameEnvStack.popNameEnv();
|
|
441
|
+
|
|
442
|
+
cdlResult.model = this.renderUsingAliases(env.nameEnvStack.getUsings(), env) + cdlResult.model;
|
|
443
|
+
if (this.csn.requires) {
|
|
444
|
+
let usingsStr = this.csn.requires.map(req => `using from '${ req }';`).join('\n');
|
|
445
|
+
usingsStr += '\n\n';
|
|
446
|
+
cdlResult.model = usingsStr + cdlResult.model;
|
|
447
|
+
}
|
|
448
|
+
|
|
449
|
+
if (this.commonNamespace.name)
|
|
450
|
+
cdlResult.model = `namespace ${ this.renderArtifactName(this.commonNamespace.name, env) };\n\n${ cdlResult.model }`;
|
|
451
|
+
|
|
452
|
+
this.msg.throwWithError();
|
|
453
|
+
return cdlResult;
|
|
454
|
+
}
|
|
455
|
+
|
|
456
|
+
/**
|
|
457
|
+
* Determine a common namespace along all definitions.
|
|
458
|
+
* Returns this.definitionTree if there is no common namespace.
|
|
459
|
+
*
|
|
460
|
+
* @returns {DefinitionPathTree}
|
|
461
|
+
*/
|
|
462
|
+
getCommonNamespace() {
|
|
463
|
+
let root = this.definitionTree;
|
|
464
|
+
if (this.options.renderCdlDefinitionNesting === false || this.options.renderCdlCommonNamespace === false)
|
|
465
|
+
return root; // User does not want common namespace.
|
|
466
|
+
|
|
467
|
+
if (this.csn.vocabularies) {
|
|
468
|
+
// TODO: With vocabularies, we don't search for a common namespace.
|
|
469
|
+
// Reason being that `namespace` statements affect vocabularies, but
|
|
470
|
+
// we don't create definition trees for them.
|
|
471
|
+
return root;
|
|
472
|
+
}
|
|
473
|
+
if (this.csn.extensions?.length > 0) {
|
|
474
|
+
// TODO: Check for the case of `entity Unknown.E {}; annotate Unknown;`
|
|
475
|
+
// by going through all extensions.
|
|
476
|
+
return root;
|
|
477
|
+
}
|
|
478
|
+
|
|
479
|
+
while (root) {
|
|
480
|
+
const keys = Object.keys(root.children);
|
|
481
|
+
if (keys.length !== 1 || root.children[keys[0]].definition) {
|
|
482
|
+
// There is either more than one sibling path, or the path is a definition.
|
|
483
|
+
// We MUST NOT create a common namespace for `entity A {}; entity A.A {}`!
|
|
484
|
+
break;
|
|
485
|
+
}
|
|
486
|
+
if (keys[0] === 'cds') {
|
|
487
|
+
// Don't use 'cds' as common namespace _anywhere_, not even in `namespace foo.cds.bar;`
|
|
488
|
+
// While our code _does_ handle such cases, as it also needs to do so for `String`, etc.,
|
|
489
|
+
// it would make reading to.cdl() output worse.
|
|
490
|
+
return this.definitionTree;
|
|
491
|
+
}
|
|
492
|
+
root = root.children[keys[0]];
|
|
493
|
+
}
|
|
494
|
+
|
|
495
|
+
return root;
|
|
496
|
+
}
|
|
497
|
+
|
|
498
|
+
/**
|
|
499
|
+
* @param {UsingAlias[]} aliases
|
|
500
|
+
* @param {CdlRenderEnvironment} env
|
|
501
|
+
* @returns {string}
|
|
502
|
+
*/
|
|
503
|
+
renderUsingAliases(aliases, env) {
|
|
504
|
+
if (this.options.renderCdlDefinitionNesting !== false) {
|
|
505
|
+
// openAPI importer searches for a single USING statement and replaces it.
|
|
506
|
+
// Let's try to be backward compatible.
|
|
507
|
+
return aliases.length > 0 ? `using { ${ aliases.map(entry => (entry.requiresExplicitAlias()
|
|
508
|
+
? `${ this.quotePathIfRequired(entry.path, env) } as ${ this.quoteNonIdentifierOrKeyword(entry.alias, env) }`
|
|
509
|
+
: entry.path)).join(', ') } };\n\n` : '';
|
|
510
|
+
}
|
|
511
|
+
|
|
512
|
+
let result = '';
|
|
513
|
+
for (const entry of aliases) {
|
|
514
|
+
if (entry.requiresExplicitAlias())
|
|
515
|
+
result += `using { ${ this.quotePathIfRequired(entry.path, env) } as ${ this.quoteNonIdentifierOrKeyword(entry.alias, env) } };\n`;
|
|
516
|
+
else
|
|
517
|
+
result += `using { ${ entry.path } };\n`;
|
|
518
|
+
}
|
|
519
|
+
return result !== '' ? `${ result }\n` : result;
|
|
520
|
+
}
|
|
521
|
+
|
|
522
|
+
/**
|
|
523
|
+
* Render definitions in a flat list, i.e. without nesting.
|
|
524
|
+
*
|
|
525
|
+
* @param {CdlRenderEnvironment} env
|
|
526
|
+
* @returns {string}
|
|
527
|
+
*/
|
|
528
|
+
renderDefinitions(env) {
|
|
529
|
+
let result = '';
|
|
530
|
+
forEachDefinition(this.csn, (artifact, artifactName) => {
|
|
531
|
+
const sourceStr = this.renderDefinition(artifactName, artifact, env);
|
|
532
|
+
if (sourceStr !== '')
|
|
533
|
+
result += `${ sourceStr }\n`;
|
|
534
|
+
});
|
|
535
|
+
return result;
|
|
536
|
+
}
|
|
537
|
+
|
|
538
|
+
/**
|
|
539
|
+
* Render entries from the `csn.definitions` dictionary.
|
|
540
|
+
* Returns an empty string if nothing is rendered.
|
|
541
|
+
*
|
|
542
|
+
* @return {string}
|
|
543
|
+
*/
|
|
544
|
+
renderNestedDefinitions(env) {
|
|
545
|
+
const that = this;
|
|
546
|
+
let result = '';
|
|
547
|
+
renderTree(this.definitionTree);
|
|
548
|
+
return result;
|
|
549
|
+
|
|
550
|
+
/**
|
|
551
|
+
* @param {DefinitionPathTree} tree
|
|
552
|
+
*/
|
|
553
|
+
function renderTree( tree ) {
|
|
554
|
+
for (const name in tree.children) {
|
|
555
|
+
const entry = tree.children[name];
|
|
556
|
+
const def = entry.definition;
|
|
557
|
+
|
|
558
|
+
if (def?.kind === 'service' || def?.kind === 'context') {
|
|
559
|
+
// Render service/context with nested definitions.
|
|
560
|
+
env.path = [ 'definitions', entry.name ];
|
|
561
|
+
result += that.renderAnnotationAssignmentsAndDocComment(def, env);
|
|
562
|
+
result += `${ env.indent }${ def.kind } ${ that.renderArtifactName(entry.name, env) } {\n`;
|
|
563
|
+
env.increaseIndent();
|
|
564
|
+
env.nameEnvStack.pushNameEnv(entry);
|
|
565
|
+
if (entry.children)
|
|
566
|
+
renderTree(entry);
|
|
567
|
+
env.nameEnvStack.popNameEnv();
|
|
568
|
+
env.decreaseIndent();
|
|
569
|
+
if (result.at(-1) === '\n' && result.at(-2) === '\n')
|
|
570
|
+
result = result.substring(0, result.length - 1); // to get the closing brace on the next line after a definition, remove one linebreak
|
|
571
|
+
result += `${ env.indent }};\n\n`;
|
|
572
|
+
}
|
|
573
|
+
else if (def) {
|
|
574
|
+
const sourceStr = that.renderDefinition(entry.name, def, env);
|
|
575
|
+
if (sourceStr !== '')
|
|
576
|
+
result += `${ sourceStr }\n`;
|
|
577
|
+
if (entry.children)
|
|
578
|
+
renderTree(entry);
|
|
579
|
+
}
|
|
580
|
+
else if (entry.children) {
|
|
581
|
+
renderTree(entry);
|
|
582
|
+
}
|
|
583
|
+
}
|
|
584
|
+
}
|
|
585
|
+
}
|
|
586
|
+
|
|
587
|
+
/**
|
|
588
|
+
* Render annotation definitions, i.e. entries from csn.vocabularies.
|
|
589
|
+
* Returns an empty string if there isn't anything to render.
|
|
590
|
+
*
|
|
591
|
+
* @param {object} vocabularies
|
|
592
|
+
* @param {CdlRenderEnvironment} env
|
|
593
|
+
* @return {string}
|
|
594
|
+
*/
|
|
595
|
+
renderVocabularies( vocabularies, env ) {
|
|
596
|
+
let result = '';
|
|
597
|
+
for (const key in vocabularies)
|
|
598
|
+
result += this.renderVocabulariesEntry(key, vocabularies[key], env);
|
|
599
|
+
return result;
|
|
600
|
+
}
|
|
601
|
+
|
|
602
|
+
/**
|
|
603
|
+
* @param {string} name
|
|
604
|
+
* @param anno
|
|
605
|
+
* @param {CdlRenderEnvironment} env
|
|
606
|
+
* @returns {string}
|
|
607
|
+
*/
|
|
608
|
+
renderVocabulariesEntry( name, anno, env ) {
|
|
609
|
+
if (anno.$ignore)
|
|
610
|
+
return '';
|
|
611
|
+
// This environment is passed down the call hierarchy, for dealing with
|
|
612
|
+
// indentation and name resolution issues
|
|
613
|
+
env.path = [ 'vocabularies', name ];
|
|
614
|
+
const sourceStr = this.renderArtifact(name, anno, env, 'annotation');
|
|
615
|
+
return `${ sourceStr }\n`;
|
|
616
|
+
}
|
|
617
|
+
|
|
618
|
+
/**
|
|
619
|
+
* Render 'extend' and 'annotate' statements from the `extensions` array.
|
|
620
|
+
* Could be annotate-statements for sub-elements annotations or from parseCdl's
|
|
621
|
+
* extensions array or just unapplied extensions.
|
|
622
|
+
*
|
|
623
|
+
* @param {CSN.Extension[]} extensions
|
|
624
|
+
* @param {CdlRenderEnvironment} env
|
|
625
|
+
* @return {string}
|
|
626
|
+
*/
|
|
627
|
+
renderExtensions( extensions, env ) {
|
|
628
|
+
if (!env.path)
|
|
629
|
+
env = env.cloneWith({ path: [ 'extensions' ] });
|
|
630
|
+
return extensions.map((ext, index) => this.renderExtension(ext, env.withSubPath([ index ]))).join('\n');
|
|
631
|
+
}
|
|
632
|
+
|
|
633
|
+
/**
|
|
634
|
+
* Render an 'extend' and 'annotate' statement.
|
|
635
|
+
*
|
|
636
|
+
* @param {CSN.Extension} ext
|
|
637
|
+
* @param {CdlRenderEnvironment} env
|
|
638
|
+
* @return {string}
|
|
639
|
+
*/
|
|
640
|
+
renderExtension( ext, env ) {
|
|
641
|
+
if (ext.extend)
|
|
642
|
+
return this.renderExtendStatement(ext.extend, ext, env);
|
|
643
|
+
return this.renderAnnotateStatement(ext, env);
|
|
644
|
+
}
|
|
645
|
+
|
|
646
|
+
/**
|
|
647
|
+
* Render an 'extend' statement.
|
|
648
|
+
* `extName` is the extension's artifact's name, most likely `ext.extend`.
|
|
649
|
+
* This function is recursive, which is why you need to pass it explicitly.
|
|
650
|
+
*
|
|
651
|
+
* @param {string} extName
|
|
652
|
+
* @param {object} ext
|
|
653
|
+
* @param {CdlRenderEnvironment} env
|
|
654
|
+
* @return {string}
|
|
655
|
+
*/
|
|
656
|
+
renderExtendStatement( extName, ext, env ) {
|
|
657
|
+
// Element extensions have `kind` set. Don't use for enum extension.
|
|
658
|
+
const isElementExtend = (ext.kind === 'extend' && !ext.enum);
|
|
659
|
+
let result = this.renderAnnotationAssignmentsAndDocComment(ext, env);
|
|
660
|
+
extName = this.renderArtifactName(extName, env);
|
|
661
|
+
|
|
662
|
+
if (ext.includes && ext.includes.length > 0) {
|
|
663
|
+
// Includes can't be combined with anything in braces {}.
|
|
664
|
+
const affix = isElementExtend ? 'element ' : '';
|
|
665
|
+
const includes = ext.includes.map((inc, i) => this.renderDefinitionReference(inc, env.withSubPath([ 'includes', i ]))).join(', ');
|
|
666
|
+
result += `${ env.indent }extend ${ affix }${ extName } with ${ includes };\n`;
|
|
667
|
+
return result;
|
|
668
|
+
}
|
|
669
|
+
|
|
670
|
+
const typeParams = this.renderTypeParameters(ext, true);
|
|
671
|
+
if (typeParams) {
|
|
672
|
+
result += `${ env.indent }extend ${ extName } with ${ typeParams };\n`;
|
|
673
|
+
return result;
|
|
674
|
+
}
|
|
675
|
+
|
|
676
|
+
// If there is nothing to extend, e.g. only annotations, don't render an
|
|
677
|
+
// empty element list. This would end up in diffs with parseCdl CSN.
|
|
678
|
+
if (!ext.elements && !ext.columns && !ext.actions && !ext.enum &&
|
|
679
|
+
!ext.where && !ext.groupBy && !ext.having && !ext.orderBy && !ext.limit) {
|
|
680
|
+
result += `${ env.indent }extend ${ extName };\n`;
|
|
681
|
+
return result;
|
|
682
|
+
}
|
|
683
|
+
|
|
684
|
+
if (ext.elements || ext.columns || ext.actions || ext.enum) {
|
|
685
|
+
// We have the "old-style" prefix syntax and the "new-style" postfix "with <type>" syntax.
|
|
686
|
+
// The former one can not only extend (sub-)elements but also actions in the same statement whereas
|
|
687
|
+
// the latter cannot.
|
|
688
|
+
// If there are actions, check if there are also elements/columns, and if so, use the prefix notation.
|
|
689
|
+
const usePrefixNotation = ext.actions && (ext.columns || ext.elements);
|
|
690
|
+
if (usePrefixNotation)
|
|
691
|
+
result += `${ env.indent }extend ${ this.getExtendPrefixVariant(ext) } ${ extName } with {\n`;
|
|
692
|
+
else
|
|
693
|
+
result += `${ env.indent }extend ${ extName } with ${ this.getExtendPostfixVariant(ext) }{\n`;
|
|
694
|
+
|
|
695
|
+
if (ext.columns)
|
|
696
|
+
result += this.renderViewColumns(ext, env.withIncreasedIndent());
|
|
697
|
+
|
|
698
|
+
else if (ext.elements || ext.enum)
|
|
699
|
+
result += this.renderExtendStatementElements(ext, env);
|
|
700
|
+
|
|
701
|
+
// Not part of if/else cascade, because it may be in postfix notation.
|
|
702
|
+
if (ext.actions) {
|
|
703
|
+
const childEnv = env.withIncreasedIndent();
|
|
704
|
+
let actions = '';
|
|
705
|
+
forEach(ext.actions, (actionName, action) => {
|
|
706
|
+
actions += this.renderActionOrFunction(actionName, action, childEnv.withSubPath([ 'actions', actionName ]), true);
|
|
707
|
+
});
|
|
708
|
+
if (!usePrefixNotation)
|
|
709
|
+
result += actions;
|
|
710
|
+
else if (actions !== '')
|
|
711
|
+
result += `${ env.indent }} actions {\n${ actions }`;
|
|
712
|
+
}
|
|
713
|
+
|
|
714
|
+
result += `${ env.indent }}`;
|
|
715
|
+
}
|
|
716
|
+
else {
|
|
717
|
+
result += `${ env.indent }extend ${ extName } with`;
|
|
718
|
+
}
|
|
719
|
+
|
|
720
|
+
if (ext.where)
|
|
721
|
+
result += ` where ${ this.exprRenderer.renderExpr(ext.where, env.withSubPath([ 'where' ])) }`;
|
|
722
|
+
if (ext.groupBy)
|
|
723
|
+
result += ` group by ${ ext.groupBy.map((expr, i) => this.exprRenderer.renderExpr(expr, env.withSubPath([ 'groupBy', i ]))).join(', ') }`;
|
|
724
|
+
if (ext.having)
|
|
725
|
+
result += ` having ${ this.exprRenderer.renderExpr(ext.having, env.withSubPath([ 'having' ])) }`;
|
|
726
|
+
if (ext.orderBy)
|
|
727
|
+
result += ` order by ${ ext.orderBy.map((entry, i) => this.renderOrderByEntry(entry, env.withSubPath([ 'orderBy', i ]))).join(', ') }`;
|
|
728
|
+
if (ext.limit)
|
|
729
|
+
result += ` ${ this.renderLimit(ext.limit, env.withSubPath([ 'limit' ])) }`;
|
|
730
|
+
|
|
731
|
+
result += ';\n';
|
|
732
|
+
return result;
|
|
733
|
+
}
|
|
734
|
+
|
|
735
|
+
/**
|
|
736
|
+
* What <extend> prefix type to use. Used to render `extend <type> <ref>` statements.
|
|
737
|
+
*
|
|
738
|
+
* @param {object} ext
|
|
739
|
+
* @return {string}
|
|
740
|
+
*/
|
|
741
|
+
getExtendPrefixVariant( ext ) {
|
|
742
|
+
if (ext.kind === 'extend')
|
|
743
|
+
return 'element'; // element extensions inside an `extend`
|
|
744
|
+
if (ext.columns)
|
|
745
|
+
return 'projection';
|
|
746
|
+
if (ext.elements)
|
|
747
|
+
return 'entity';
|
|
748
|
+
return '';
|
|
749
|
+
}
|
|
750
|
+
|
|
751
|
+
/**
|
|
752
|
+
* What <extend> postfix type to use. Used to render `extend <ref> with <type>` statements.
|
|
753
|
+
*
|
|
754
|
+
* @param {CSN.Extension} ext
|
|
755
|
+
* @return {string}
|
|
756
|
+
*/
|
|
757
|
+
getExtendPostfixVariant( ext ) {
|
|
758
|
+
if (ext.columns)
|
|
759
|
+
return 'columns ';
|
|
760
|
+
if (ext.actions)
|
|
761
|
+
return 'actions ';
|
|
762
|
+
if (ext.enum)
|
|
763
|
+
return 'enum ';
|
|
764
|
+
if (ext.elements) { // enum/elements ambiguity -> look into elements
|
|
765
|
+
const isLikelyElement = Object.keys(ext.elements)
|
|
766
|
+
.find(name => ext.elements[name].value !== undefined);
|
|
767
|
+
if (isLikelyElement)
|
|
768
|
+
return 'elements ';
|
|
769
|
+
}
|
|
770
|
+
// ambiguity; no postfix, i.e. `extend … with { … }`.s
|
|
771
|
+
return '';
|
|
772
|
+
}
|
|
773
|
+
|
|
774
|
+
/**
|
|
775
|
+
* Render the elements inside an `extend` statement. They may themselves be `extend` statements.
|
|
776
|
+
*
|
|
777
|
+
* @param {CSN.Extension} ext
|
|
778
|
+
* @param {CdlRenderEnvironment} env
|
|
779
|
+
* @return {string}
|
|
780
|
+
*/
|
|
781
|
+
renderExtendStatementElements( ext, env ) {
|
|
782
|
+
let result = '';
|
|
783
|
+
const prop = ext.elements ? 'elements' : 'enum';
|
|
784
|
+
forEach(ext[prop] || {}, (elemName, element) => {
|
|
785
|
+
const childEnv = env.withIncreasedIndent().withSubPath([ 'elements', elemName ]);
|
|
786
|
+
if (element.kind === 'extend')
|
|
787
|
+
result += this.renderExtendStatement(elemName, element, childEnv);
|
|
788
|
+
else
|
|
789
|
+
// As soon as we are inside an element, nested `extend` are not possible,
|
|
790
|
+
// since we can't extend an existing element of a new one.
|
|
791
|
+
result += this.renderElement(elemName, element, childEnv.withSubPath([ prop, elemName ]));
|
|
792
|
+
});
|
|
793
|
+
return result;
|
|
794
|
+
}
|
|
795
|
+
|
|
796
|
+
/**
|
|
797
|
+
* Render an 'annotate' statement.
|
|
798
|
+
*
|
|
799
|
+
* @param {CSN.Extension} ext
|
|
800
|
+
* @param {CdlRenderEnvironment} env
|
|
801
|
+
* @return {string}
|
|
802
|
+
*/
|
|
803
|
+
renderAnnotateStatement( ext, env ) {
|
|
804
|
+
// Special case: Super annotate has both "returns" and "elements".
|
|
805
|
+
// Render as separate `annotate`s, but keep the order.
|
|
806
|
+
if (ext.elements && ext.returns) {
|
|
807
|
+
const [ , second ] = Object.keys(ext).filter(key => key === 'elements' || key === 'returns');
|
|
808
|
+
|
|
809
|
+
// The first of 'elements' or 'returns' gets all other properties as well.
|
|
810
|
+
// The second only gets one property (itself).
|
|
811
|
+
let result = this.renderAnnotateStatement({ ...ext, [second]: undefined }, env);
|
|
812
|
+
result += this.renderAnnotateStatement({ annotate: ext.annotate, [second]: ext[second] }, env);
|
|
813
|
+
|
|
814
|
+
return result;
|
|
815
|
+
}
|
|
816
|
+
|
|
817
|
+
// Top-level annotations of the artifact
|
|
818
|
+
const topLevelAnnotations = this.renderAnnotationAssignmentsAndDocComment(ext, env.withIncreasedIndent());
|
|
819
|
+
|
|
820
|
+
// Note: Not renderDefinitionReference, because we don't care if there
|
|
821
|
+
// are annotations to unknown things. That's allowed!
|
|
822
|
+
let result = `${ env.indent }annotate ${ this.renderArtifactName(ext.annotate, env) }`;
|
|
823
|
+
|
|
824
|
+
if (topLevelAnnotations)
|
|
825
|
+
result += ` with\n${ topLevelAnnotations }`;
|
|
826
|
+
|
|
827
|
+
|
|
828
|
+
if (ext.params)
|
|
829
|
+
result += this.renderAnnotateParamsInParentheses(ext, env);
|
|
830
|
+
|
|
831
|
+
// Element extensions and annotations (possibly nested)
|
|
832
|
+
if (ext.elements || ext.enum)
|
|
833
|
+
result += ` ${ this.renderAnnotateStatementElements(ext, env) }`;
|
|
834
|
+
|
|
835
|
+
else if (ext.returns)
|
|
836
|
+
result += this.renderAnnotateReturns(ext, env);
|
|
837
|
+
|
|
838
|
+
|
|
839
|
+
if (ext.actions) { // Bound action annotations
|
|
840
|
+
result += ' actions {\n';
|
|
841
|
+
env.increaseIndent();
|
|
842
|
+
env.path.push('actions', '');
|
|
843
|
+
for (const name in ext.actions) {
|
|
844
|
+
env.path[env.path.length - 1] = name;
|
|
845
|
+
const action = ext.actions[name];
|
|
846
|
+
result += this.renderAnnotationAssignmentsAndDocComment(action, env) + env.indent + this.quoteNonIdentifierOrKeyword(name, env);
|
|
847
|
+
// Action parameter annotations
|
|
848
|
+
if (action.params)
|
|
849
|
+
result += this.renderAnnotateParamsInParentheses(action, env);
|
|
850
|
+
if (action.returns)
|
|
851
|
+
result += this.renderAnnotateReturns(action, env);
|
|
852
|
+
|
|
853
|
+
result = removeTrailingNewline(result);
|
|
854
|
+
result += ';\n';
|
|
855
|
+
}
|
|
856
|
+
env.decreaseIndent();
|
|
857
|
+
result += `${ env.indent }}`;
|
|
858
|
+
}
|
|
859
|
+
|
|
860
|
+
result = removeTrailingNewline(result);
|
|
861
|
+
result += ';\n';
|
|
862
|
+
return result;
|
|
863
|
+
}
|
|
864
|
+
|
|
865
|
+
/**
|
|
866
|
+
* Render the elements-specific part of an 'annotate' statement for an element dictionary
|
|
867
|
+
* 'ext.elements' (assuming that the surrounding parent has just been rendered, without trailing newline).
|
|
868
|
+
* Returns the resulting source string, ending without a trailing newline.
|
|
869
|
+
*
|
|
870
|
+
* @param {object} ext
|
|
871
|
+
* @param {CdlRenderEnvironment} env
|
|
872
|
+
* @return {string}
|
|
873
|
+
*/
|
|
874
|
+
renderAnnotateStatementElements( ext, env ) {
|
|
875
|
+
const elements = ext.enum ? ext.enum : ext.elements;
|
|
876
|
+
let result = '{\n';
|
|
877
|
+
env.increaseIndent();
|
|
878
|
+
env.path.push(ext.enum ? 'enum' : 'elements', '');
|
|
879
|
+
for (const name in elements) {
|
|
880
|
+
env.path[env.path.length - 1] = name;
|
|
881
|
+
const elem = elements[name];
|
|
882
|
+
result += this.renderAnnotationAssignmentsAndDocComment(elem, env);
|
|
883
|
+
result += env.indent + this.quoteNonIdentifierOrKeyword(name, env);
|
|
884
|
+
if (elem.elements) {
|
|
885
|
+
env.path.push('elements');
|
|
886
|
+
result += ` ${ this.renderAnnotateStatementElements(elem, env) }`;
|
|
887
|
+
env.path.pop();
|
|
888
|
+
}
|
|
889
|
+
else if (elem.enum) {
|
|
890
|
+
env.path.push('enum');
|
|
891
|
+
result += ` ${ this.renderAnnotateStatementElements(elem, env) }`;
|
|
892
|
+
env.path.pop();
|
|
893
|
+
}
|
|
894
|
+
|
|
895
|
+
result += ';\n';
|
|
896
|
+
}
|
|
897
|
+
env.path.length -= 2;
|
|
898
|
+
env.decreaseIndent();
|
|
899
|
+
result += `${ env.indent }}`;
|
|
900
|
+
return result;
|
|
901
|
+
}
|
|
902
|
+
|
|
903
|
+
/**
|
|
904
|
+
* Renders the `returns` part of an `annotate` statement for (bound) actions.
|
|
905
|
+
* `ext` must be an object with a `returns` property.
|
|
906
|
+
*
|
|
907
|
+
* @param {CSN.Extension} ext
|
|
908
|
+
* @param {CdlRenderEnvironment} env
|
|
909
|
+
* @return {string}
|
|
910
|
+
*/
|
|
911
|
+
renderAnnotateReturns( ext, env ) {
|
|
912
|
+
env = env.withSubPath([ 'returns', 'elements' ]);
|
|
913
|
+
let result = ' returns';
|
|
914
|
+
|
|
915
|
+
const returnAnnos = this.renderAnnotationAssignmentsAndDocComment(ext.returns, env.withIncreasedIndent());
|
|
916
|
+
if (returnAnnos)
|
|
917
|
+
result += `\n${ returnAnnos }`;
|
|
918
|
+
|
|
919
|
+
if (ext.returns.elements) {
|
|
920
|
+
// Annotations are on separate lines: Have it aligned nicely
|
|
921
|
+
result += returnAnnos ? `${ env.indent }` : ' ';
|
|
922
|
+
result += this.renderAnnotateStatementElements(ext.returns, env);
|
|
923
|
+
}
|
|
924
|
+
return result;
|
|
925
|
+
}
|
|
926
|
+
|
|
927
|
+
/**
|
|
928
|
+
* Render a parameter list for `annotate` statements, in parentheses `()`.
|
|
929
|
+
*
|
|
930
|
+
* @param {CSN.Artifact} ext
|
|
931
|
+
* @param {CdlRenderEnvironment} env
|
|
932
|
+
* @return {string}
|
|
933
|
+
*/
|
|
934
|
+
renderAnnotateParamsInParentheses( ext, env ) {
|
|
935
|
+
const childEnv = env.withIncreasedIndent();
|
|
936
|
+
let result = '(\n';
|
|
937
|
+
const paramAnnotations = [];
|
|
938
|
+
forEach(ext.params, (paramName, param) => {
|
|
939
|
+
const annos = this.renderAnnotationAssignmentsAndDocComment(param, childEnv);
|
|
940
|
+
const name = this.quoteNonIdentifierOrKeyword(paramName, childEnv);
|
|
941
|
+
// Not supported, yet (#13052)
|
|
942
|
+
// const sub = (param.elements || param.enum) ? ` ${renderAnnotateStatementElements(param, childEnv)}` : '';
|
|
943
|
+
paramAnnotations.push( annos + childEnv.indent + name);
|
|
944
|
+
});
|
|
945
|
+
result += `${ paramAnnotations.join(',\n') }\n${ env.indent })`;
|
|
946
|
+
return result;
|
|
947
|
+
}
|
|
948
|
+
|
|
949
|
+
/**
|
|
950
|
+
* Render an artifact. Return the resulting source string.
|
|
951
|
+
*
|
|
952
|
+
* @param {string} artifactName
|
|
953
|
+
* @param {CSN.Artifact} art
|
|
954
|
+
* @param {CdlRenderEnvironment} env
|
|
955
|
+
*/
|
|
956
|
+
renderDefinition( artifactName, art, env ) {
|
|
957
|
+
env = env.cloneWith({ path: [ 'definitions', artifactName ] });
|
|
958
|
+
|
|
959
|
+
const kind = art.kind || 'type'; // the default kind is "type".
|
|
960
|
+
switch (kind) {
|
|
961
|
+
case 'entity':
|
|
962
|
+
if (art.query || art.projection)
|
|
963
|
+
return this.renderView(artifactName, art, env);
|
|
964
|
+
return this.renderArtifact(artifactName, art, env);
|
|
965
|
+
case 'aspect':
|
|
966
|
+
return this.renderAspect(artifactName, art, env);
|
|
967
|
+
|
|
968
|
+
case 'context':
|
|
969
|
+
case 'service':
|
|
970
|
+
return this.renderContextOrService(artifactName, art, env);
|
|
971
|
+
|
|
972
|
+
case 'annotation': // annotation in 'csn.definitions' for compiler v1 compatibility
|
|
973
|
+
return this.renderArtifact(artifactName, art, env, 'annotation');
|
|
974
|
+
|
|
975
|
+
case 'action':
|
|
976
|
+
case 'function':
|
|
977
|
+
return this.renderActionOrFunction(artifactName, art, env, false);
|
|
978
|
+
|
|
979
|
+
case 'type':
|
|
980
|
+
case 'event':
|
|
981
|
+
return this.renderArtifact(artifactName, art, env);
|
|
982
|
+
|
|
983
|
+
default:
|
|
984
|
+
throw new ModelError(`to.cdl: Unknown artifact kind: '${ art.kind }' at ${ JSON.stringify(env.path) }`);
|
|
985
|
+
}
|
|
986
|
+
}
|
|
987
|
+
|
|
988
|
+
/**
|
|
989
|
+
* @param {string} artifactName
|
|
990
|
+
* @param {CSN.Artifact} art
|
|
991
|
+
* @param {CdlRenderEnvironment} env
|
|
992
|
+
* @param {string} [overrideKind] If set, override the artifact kind.
|
|
993
|
+
*/
|
|
994
|
+
renderArtifact( artifactName, art, env, overrideKind ) {
|
|
995
|
+
let result = this.renderAnnotationAssignmentsAndDocComment(art, env);
|
|
996
|
+
let kind = overrideKind || art.$syntax === 'aspect' && 'aspect' || art.kind;
|
|
997
|
+
if (art.abstract)
|
|
998
|
+
kind = `abstract ${ kind }`;
|
|
999
|
+
// Vocabularies are in a separate name environment. We can't shorten them.
|
|
1000
|
+
const normalizedArtifactName = kind !== 'annotation'
|
|
1001
|
+
? this.renderArtifactName(artifactName, env)
|
|
1002
|
+
: this.quotePathIfRequired(artifactName, env);
|
|
1003
|
+
result += `${ env.indent }${ kind } ${ normalizedArtifactName }`;
|
|
1004
|
+
|
|
1005
|
+
if (art.params)
|
|
1006
|
+
result += this.renderParameters(art, env);
|
|
1007
|
+
|
|
1008
|
+
let isDirectStruct = false;
|
|
1009
|
+
const isQuery = art.query || art.projection;
|
|
1010
|
+
if (isQuery) {
|
|
1011
|
+
result += ' : ';
|
|
1012
|
+
// types/events (should) only support "projections"
|
|
1013
|
+
result += this.renderQuery(getNormalizedQuery(art).query, true, 'projection',
|
|
1014
|
+
env.withSubPath([ art.projection ? 'projection' : 'query' ]));
|
|
1015
|
+
}
|
|
1016
|
+
else {
|
|
1017
|
+
const type = this.renderTypeReferenceAndProps(art, env);
|
|
1018
|
+
if (type) {
|
|
1019
|
+
isDirectStruct = type.startsWith('{');
|
|
1020
|
+
|
|
1021
|
+
if (art.includes?.length && isDirectStruct) {
|
|
1022
|
+
// We can only render includes, if the type is directly structured. Otherwise, we would
|
|
1023
|
+
// render e.g. `type T : Include : T2;`, which is invalid. We use `extend` in such cases.
|
|
1024
|
+
result += this.renderIncludes(art.includes, env);
|
|
1025
|
+
}
|
|
1026
|
+
|
|
1027
|
+
// For nicer output, no colon if unnamed structure is used.
|
|
1028
|
+
result += (!art.type && art.elements) ? ` ${ type }` : ` : ${ type }`;
|
|
1029
|
+
}
|
|
1030
|
+
else {
|
|
1031
|
+
this.msg.warning('syntax-missing-type', env.path, { '#': art.kind, name: artifactName }, {
|
|
1032
|
+
std: 'Missing type for definition $(NAME); can\'t be represented in CDL',
|
|
1033
|
+
entity: 'Missing elements for entity $(NAME); can\'t be represented in CDL',
|
|
1034
|
+
});
|
|
1035
|
+
}
|
|
1036
|
+
}
|
|
1037
|
+
|
|
1038
|
+
if (art.actions) {
|
|
1039
|
+
if (!isQuery && !isDirectStruct) {
|
|
1040
|
+
// If there are no elements nor query, but actions, CDL syntax requires braces.
|
|
1041
|
+
result += ' { }';
|
|
1042
|
+
}
|
|
1043
|
+
result += this.renderBoundActionsAndFunctions(art, env);
|
|
1044
|
+
}
|
|
1045
|
+
|
|
1046
|
+
result += ';\n';
|
|
1047
|
+
|
|
1048
|
+
if (art.includes?.length && !isDirectStruct) {
|
|
1049
|
+
// If we're not a directly structured type, render the `includes` as `extend`
|
|
1050
|
+
// statements directly below the type definition.
|
|
1051
|
+
result += this.renderExtendStatement(artifactName, { includes: art.includes }, env);
|
|
1052
|
+
}
|
|
1053
|
+
|
|
1054
|
+
return result;
|
|
1055
|
+
}
|
|
1056
|
+
|
|
1057
|
+
/**
|
|
1058
|
+
* @param {string} artifactName
|
|
1059
|
+
* @param {CSN.Artifact} art
|
|
1060
|
+
* @param {CdlRenderEnvironment} env
|
|
1061
|
+
* @returns {string}
|
|
1062
|
+
*/
|
|
1063
|
+
renderContextOrService( artifactName, art, env ) {
|
|
1064
|
+
let result = this.renderAnnotationAssignmentsAndDocComment(art, env);
|
|
1065
|
+
result += `${ env.indent }${ art.kind } ${ this.renderArtifactName(artifactName, env) }`;
|
|
1066
|
+
return `${ result } {};\n`;
|
|
1067
|
+
}
|
|
1068
|
+
|
|
1069
|
+
/**
|
|
1070
|
+
* Render an aspect. Return the resulting source string.
|
|
1071
|
+
* Behaves very similar to renderEntity, _except_ that aspects are
|
|
1072
|
+
* allowed to _not_ have elements, e.g. `aspect A;`.
|
|
1073
|
+
*
|
|
1074
|
+
* @param {string} artifactName
|
|
1075
|
+
* @param {CSN.Artifact} art
|
|
1076
|
+
* @param {CdlRenderEnvironment} env
|
|
1077
|
+
* @return {string}
|
|
1078
|
+
*/
|
|
1079
|
+
renderAspect( artifactName, art, env ) {
|
|
1080
|
+
let result = this.renderAnnotationAssignmentsAndDocComment(art, env);
|
|
1081
|
+
result += `${ env.indent }aspect ${ this.renderArtifactName(artifactName, env) }`;
|
|
1082
|
+
if (art.includes)
|
|
1083
|
+
result += this.renderIncludes(art.includes, env);
|
|
1084
|
+
|
|
1085
|
+
if (art.elements)
|
|
1086
|
+
result += ` ${ this.renderElements(art, env) }`;
|
|
1087
|
+
else if (art.actions)
|
|
1088
|
+
// if there are no elements, but actions, CDL syntax requires braces.
|
|
1089
|
+
result += ' { }';
|
|
1090
|
+
|
|
1091
|
+
result += `${ this.renderBoundActionsAndFunctions(art, env) };\n`;
|
|
1092
|
+
return result;
|
|
1093
|
+
}
|
|
1094
|
+
|
|
1095
|
+
/**
|
|
1096
|
+
* Render a list of elements enclosed in braces. If the list is empty, returns `{ }`.
|
|
1097
|
+
*
|
|
1098
|
+
* @param {object} artifact Artifact with `elements` property.
|
|
1099
|
+
* @param {CdlRenderEnvironment} env
|
|
1100
|
+
* @return {string}
|
|
1101
|
+
*/
|
|
1102
|
+
renderElements( artifact, env ) {
|
|
1103
|
+
let elements = '';
|
|
1104
|
+
const childEnv = env.withIncreasedIndent();
|
|
1105
|
+
for (const name in artifact.elements)
|
|
1106
|
+
elements += this.renderElement(name, artifact.elements[name], childEnv.withSubPath([ 'elements', name ]));
|
|
1107
|
+
|
|
1108
|
+
return (elements === '') ? '{ }' : `{\n${ elements }${ env.indent }}`;
|
|
1109
|
+
}
|
|
1110
|
+
|
|
1111
|
+
/**
|
|
1112
|
+
* Render an element (of an entity, type or annotation, not a projection or view)
|
|
1113
|
+
* or an enum symbol.
|
|
1114
|
+
* Returns the resulting source string.
|
|
1115
|
+
*
|
|
1116
|
+
* @param {string} elementName
|
|
1117
|
+
* @param {CSN.Element} element
|
|
1118
|
+
* @param {CdlRenderEnvironment} env
|
|
1119
|
+
*/
|
|
1120
|
+
renderElement( elementName, element, env ) {
|
|
1121
|
+
const isCalcElement = (element.value !== undefined);
|
|
1122
|
+
let result = this.renderAnnotationAssignmentsAndDocComment(element, env);
|
|
1123
|
+
result += env.indent;
|
|
1124
|
+
result += element.virtual ? 'virtual ' : '';
|
|
1125
|
+
result += element.key ? 'key ' : '';
|
|
1126
|
+
result += this.quoteNonIdentifierOrKeyword(elementName, env);
|
|
1127
|
+
if (element['#'] !== undefined) { // enum symbol reference
|
|
1128
|
+
result += ` = #${ element['#'] }`;
|
|
1129
|
+
}
|
|
1130
|
+
else if (element.val !== undefined) { // enum value
|
|
1131
|
+
result += ` = ${ this.exprRenderer.renderExpr(element, env) }`;
|
|
1132
|
+
}
|
|
1133
|
+
else if (!isCalcElement || !isDirectAssocOrComp(element.type) && !element.$filtered && !element.$enclosed) {
|
|
1134
|
+
// If the element is a calculated element _and_ a direct association or
|
|
1135
|
+
// composition, we'd render `Association to F on (cond) = calcValue;` which
|
|
1136
|
+
// would alter the ON-condition.
|
|
1137
|
+
// If it is a calculated element _and_ an indirect association (via type chain),
|
|
1138
|
+
// we'd get a cast to an association.
|
|
1139
|
+
const props = this.renderTypeReferenceAndProps(element, env);
|
|
1140
|
+
if (props !== '')
|
|
1141
|
+
result += ` : ${ props }`;
|
|
1142
|
+
}
|
|
1143
|
+
|
|
1144
|
+
if (isCalcElement) { // calculated element // @ts-ignore
|
|
1145
|
+
result += ' = ';
|
|
1146
|
+
env.path.push('value');
|
|
1147
|
+
const isSubExpr = (element.value.xpr && xprContainsCondition(element.value.xpr));
|
|
1148
|
+
result += isSubExpr
|
|
1149
|
+
? this.exprRenderer.renderSubExpr(element.value, env)
|
|
1150
|
+
: this.exprRenderer.renderExpr(element.value, env);
|
|
1151
|
+
if (element.value.stored === true)
|
|
1152
|
+
result += ' stored';
|
|
1153
|
+
env.path.length -= 1;
|
|
1154
|
+
}
|
|
1155
|
+
|
|
1156
|
+
return `${ result };\n`;
|
|
1157
|
+
}
|
|
1158
|
+
|
|
1159
|
+
/**
|
|
1160
|
+
* Render annotations that were extended to a query element of a view or projection (they only
|
|
1161
|
+
* appear in the view's 'elements', not in their 'columns' for client CSN, because the element
|
|
1162
|
+
* itself may not even be in 'columns', e.g. if it was expanded from a '*'). Return the
|
|
1163
|
+
* resulting rendered 'annotate' statement or an empty string if none required.
|
|
1164
|
+
*
|
|
1165
|
+
* Note: In the past, we checked if the annotation also exists in the respective column,
|
|
1166
|
+
* however, in client CSN, annotations are not part of the column and in parseCdl CSN,
|
|
1167
|
+
* no `elements` exist.
|
|
1168
|
+
*
|
|
1169
|
+
* @param {CSN.Artifact} art
|
|
1170
|
+
* @param {CdlRenderEnvironment} env
|
|
1171
|
+
* @return {string}
|
|
1172
|
+
*/
|
|
1173
|
+
renderQueryElementAndEnumAnnotations( art, env ) {
|
|
1174
|
+
const annotate = this.collectAnnotationsOfElementsAndEnum(art, env);
|
|
1175
|
+
if (annotate)
|
|
1176
|
+
return this.renderExtensions([ annotate ], env);
|
|
1177
|
+
return '';
|
|
1178
|
+
}
|
|
1179
|
+
|
|
1180
|
+
/**
|
|
1181
|
+
* Create an "annotate" statement as a CSN extension for all annotations of (sub-)elements.
|
|
1182
|
+
* If no annotation was found, we return `null`.
|
|
1183
|
+
*
|
|
1184
|
+
* @param {CSN.Artifact} artifact
|
|
1185
|
+
* @param {CdlRenderEnvironment} env
|
|
1186
|
+
* @return {CSN.Extension|null}
|
|
1187
|
+
*/
|
|
1188
|
+
collectAnnotationsOfElementsAndEnum( artifact, env ) {
|
|
1189
|
+
// Array, which may be annotated as well.
|
|
1190
|
+
if (artifact.items) {
|
|
1191
|
+
env = env.withSubPath([ 'items' ]);
|
|
1192
|
+
artifact = artifact.items;
|
|
1193
|
+
}
|
|
1194
|
+
|
|
1195
|
+
if (!artifact.elements && !artifact.enum && !artifact.keys)
|
|
1196
|
+
return null;
|
|
1197
|
+
|
|
1198
|
+
const annotate = { annotate: env.path[1] };
|
|
1199
|
+
|
|
1200
|
+
// Based on the current path, create a correctly nested structure
|
|
1201
|
+
// of elements for which we collect annotations.
|
|
1202
|
+
let obj = annotate;
|
|
1203
|
+
for (let i = 2; i < env.path.length; ++i) {
|
|
1204
|
+
const key = env.path[i];
|
|
1205
|
+
if (key === 'elements' || key === 'actions' || key === 'params') {
|
|
1206
|
+
obj[key] = Object.create(null);
|
|
1207
|
+
const elem = env.path[i + 1];
|
|
1208
|
+
obj[key][elem] = {};
|
|
1209
|
+
obj = obj[key][elem];
|
|
1210
|
+
}
|
|
1211
|
+
else if (key === 'returns') {
|
|
1212
|
+
obj.returns = {};
|
|
1213
|
+
obj = obj.returns;
|
|
1214
|
+
}
|
|
1215
|
+
else {
|
|
1216
|
+
// ignore others, e.g. 'items'
|
|
1217
|
+
}
|
|
1218
|
+
}
|
|
1219
|
+
return collectAnnos(obj, artifact) ? annotate : null;
|
|
1220
|
+
|
|
1221
|
+
/**
|
|
1222
|
+
* Recursive function to collect annotations. `annotateObj` will get an `elements`
|
|
1223
|
+
* object with annotations only if there are annotations on `art`'s (sub-)elements or
|
|
1224
|
+
* enums. Returned object will use "elements" even for enums, since that is
|
|
1225
|
+
* expected in extensions.
|
|
1226
|
+
*
|
|
1227
|
+
* @return {boolean} True, if there were annotations, false otherwise.
|
|
1228
|
+
*/
|
|
1229
|
+
function collectAnnos( annotateObj, art ) {
|
|
1230
|
+
if (!Object.hasOwnProperty.call(art, 'elements') &&
|
|
1231
|
+
!Object.hasOwnProperty.call(art, 'enum') &&
|
|
1232
|
+
!Object.hasOwnProperty.call(art, 'keys'))
|
|
1233
|
+
return false;
|
|
1234
|
+
|
|
1235
|
+
const dict = art.enum || art.keys && getKeysDict(art) || art.elements;
|
|
1236
|
+
// Use "elements" for all. This is allowed in extensions.
|
|
1237
|
+
const collected = { elements: Object.create(null) };
|
|
1238
|
+
let hasAnnotation = false;
|
|
1239
|
+
|
|
1240
|
+
forEach(dict, (elemName, element) => {
|
|
1241
|
+
if (!collected.elements[elemName])
|
|
1242
|
+
collected.elements[elemName] = { };
|
|
1243
|
+
|
|
1244
|
+
let hasElementAnnotations = false;
|
|
1245
|
+
for (const name in element) {
|
|
1246
|
+
if (name.startsWith('@')) {
|
|
1247
|
+
collected.elements[elemName][name] = element[name];
|
|
1248
|
+
hasElementAnnotations = true;
|
|
1249
|
+
hasAnnotation = true;
|
|
1250
|
+
}
|
|
1251
|
+
}
|
|
1252
|
+
|
|
1253
|
+
const hasSubAnnotations = collectAnnos(collected.elements[elemName], element);
|
|
1254
|
+
if (!hasElementAnnotations && !hasSubAnnotations)
|
|
1255
|
+
delete collected.elements[elemName]; // delete if no annotations exist
|
|
1256
|
+
hasAnnotation = hasAnnotation || hasSubAnnotations;
|
|
1257
|
+
});
|
|
1258
|
+
|
|
1259
|
+
if (hasAnnotation)
|
|
1260
|
+
annotateObj.elements = collected.elements;
|
|
1261
|
+
|
|
1262
|
+
return hasAnnotation;
|
|
1263
|
+
}
|
|
1264
|
+
}
|
|
1265
|
+
|
|
1266
|
+
/**
|
|
1267
|
+
* Render the source of a query, which may be a path reference, possibly with an alias,
|
|
1268
|
+
* or a subselect, or a join operation, as seen from artifact 'art'.
|
|
1269
|
+
* Returns the source as a string.
|
|
1270
|
+
*
|
|
1271
|
+
* @param {object} source
|
|
1272
|
+
* @param {CdlRenderEnvironment} env
|
|
1273
|
+
* @return {string}
|
|
1274
|
+
*/
|
|
1275
|
+
renderViewSource( source, env ) {
|
|
1276
|
+
// Sub-SELECT
|
|
1277
|
+
if (source.SELECT || source.SET) {
|
|
1278
|
+
const subEnv = env.withIncreasedIndent();
|
|
1279
|
+
let result = `(\n${ subEnv.indent }${ this.renderQuery(source, false, 'view', subEnv) }\n${ env.indent })`;
|
|
1280
|
+
if (source.as)
|
|
1281
|
+
result += this.renderAlias(source.as, env);
|
|
1282
|
+
|
|
1283
|
+
return result;
|
|
1284
|
+
}
|
|
1285
|
+
// JOIN
|
|
1286
|
+
else if (source.join) {
|
|
1287
|
+
// One join operation, possibly with ON-condition
|
|
1288
|
+
env.path.push('args', 0);
|
|
1289
|
+
let result = `(${ this.renderViewSource(source.args[0], env) }`;
|
|
1290
|
+
for (let i = 1; i < source.args.length; i++) {
|
|
1291
|
+
env.path[env.path.length - 1] = i;
|
|
1292
|
+
result += ` ${ source.join } `;
|
|
1293
|
+
result += this.renderJoinCardinality(source.cardinality);
|
|
1294
|
+
result += `join ${ this.renderViewSource(source.args[i], env) }`;
|
|
1295
|
+
}
|
|
1296
|
+
env.path.length -= 2;
|
|
1297
|
+
if (source.on) {
|
|
1298
|
+
env.path.push('on');
|
|
1299
|
+
result += ` on ${ this.exprRenderer.renderExpr(source.on, env.withSubPath([ 'on' ])) }`;
|
|
1300
|
+
env.path.length -= 1;
|
|
1301
|
+
}
|
|
1302
|
+
result += ')';
|
|
1303
|
+
return result;
|
|
1304
|
+
}
|
|
1305
|
+
// Ordinary path, possibly with an alias
|
|
1306
|
+
|
|
1307
|
+
return this.renderAbsolutePathWithAlias(source, env);
|
|
1308
|
+
}
|
|
1309
|
+
|
|
1310
|
+
renderJoinCardinality( card ) {
|
|
1311
|
+
let result = '';
|
|
1312
|
+
if (card) {
|
|
1313
|
+
if (card.srcmin && card.srcmin === 1)
|
|
1314
|
+
result += 'exact ';
|
|
1315
|
+
result += card.src && card.src === 1 ? 'one ' : 'many ';
|
|
1316
|
+
result += 'to ';
|
|
1317
|
+
if (card.min && card.min === 1)
|
|
1318
|
+
result += 'exact ';
|
|
1319
|
+
if (card.max)
|
|
1320
|
+
result += (card.max === 1) ? 'one ' : 'many ';
|
|
1321
|
+
}
|
|
1322
|
+
return result;
|
|
1323
|
+
}
|
|
1324
|
+
|
|
1325
|
+
/**
|
|
1326
|
+
* Render a path that starts with an absolute name (as used e.g. for the source of a query),
|
|
1327
|
+
* with plain or quoted names, depending on options. Expects an object 'path' that has a 'ref'.
|
|
1328
|
+
* Returns the name as a string.
|
|
1329
|
+
*
|
|
1330
|
+
* @param {object} path
|
|
1331
|
+
* @param {CdlRenderEnvironment} env
|
|
1332
|
+
* @return {string}
|
|
1333
|
+
*/
|
|
1334
|
+
renderAbsolutePath( path, env ) {
|
|
1335
|
+
// Sanity checks
|
|
1336
|
+
if (!path.ref)
|
|
1337
|
+
throw new ModelError(`Expecting ref in path: ${ JSON.stringify(path) }`);
|
|
1338
|
+
|
|
1339
|
+
// Determine the absolute name of the first artifact on the path (before any associations or element traversals)
|
|
1340
|
+
const firstArtifactName = path.ref[0].id || path.ref[0];
|
|
1341
|
+
|
|
1342
|
+
// Render the first path step (absolute name, with different quoting/naming ..)
|
|
1343
|
+
let result = this.renderDefinitionReference(firstArtifactName, env);
|
|
1344
|
+
|
|
1345
|
+
// Even the first step might have parameters and/or a filter
|
|
1346
|
+
env.path.push('ref', 0);
|
|
1347
|
+
if (path.ref[0].args)
|
|
1348
|
+
result += `(${ this.renderArguments(path.ref[0], ':', env) })`;
|
|
1349
|
+
if (path.ref[0].where)
|
|
1350
|
+
result += this.renderFilterAndCardinality(path.ref[0], env);
|
|
1351
|
+
env.path.length -= 2;
|
|
1352
|
+
|
|
1353
|
+
// Add any path steps (possibly with parameters and filters) that may follow after that
|
|
1354
|
+
if (path.ref.length > 1)
|
|
1355
|
+
result += `:${ this.exprRenderer.renderExpr({ ref: path.ref.slice(1) }, env) }`;
|
|
1356
|
+
|
|
1357
|
+
return result;
|
|
1358
|
+
}
|
|
1359
|
+
|
|
1360
|
+
/**
|
|
1361
|
+
* Render a path that starts with an absolute name (as used for the source of a query),
|
|
1362
|
+
* possibly with an alias, with plain or quoted names, depending on options. Expects an object 'path' that has a
|
|
1363
|
+
* 'ref' and (in case of an alias) an 'as'. If necessary, an artificial alias
|
|
1364
|
+
* is created to the original implicit name.
|
|
1365
|
+
* Returns the name and alias as a string.
|
|
1366
|
+
*
|
|
1367
|
+
* @param {object} path
|
|
1368
|
+
* @param {CdlRenderEnvironment} env
|
|
1369
|
+
* @return {string}
|
|
1370
|
+
*/
|
|
1371
|
+
renderAbsolutePathWithAlias( path, env ) {
|
|
1372
|
+
// We may have changed the implicit alias due to renderAbsolutePath() and renderDefinitionReference()
|
|
1373
|
+
// introducing USING statements. We need to ensure that the implicit alias stays the same.
|
|
1374
|
+
const isElementRef = path.ref.length > 1;
|
|
1375
|
+
const alias = path.as || implicitAs(path.ref);
|
|
1376
|
+
|
|
1377
|
+
let result = this.renderAbsolutePath(path, env);
|
|
1378
|
+
if (path.as) {
|
|
1379
|
+
// Source had an alias - render it
|
|
1380
|
+
result += this.renderAlias(path.as, env);
|
|
1381
|
+
}
|
|
1382
|
+
else if (!isElementRef) {
|
|
1383
|
+
const defName = path.ref[0].id || path.ref[0];
|
|
1384
|
+
const sourcePath = env.nameEnvStack.definitionReference(defName);
|
|
1385
|
+
// Source did not have an alias, but we add one as we'd
|
|
1386
|
+
// otherwise have a different implicit alias.
|
|
1387
|
+
if (sourcePath.split('.').at(-1) !== alias)
|
|
1388
|
+
result += this.renderAlias(alias, env);
|
|
1389
|
+
}
|
|
1390
|
+
return result;
|
|
1391
|
+
}
|
|
1392
|
+
|
|
1393
|
+
/**
|
|
1394
|
+
* Render the given columns / select items.
|
|
1395
|
+
*
|
|
1396
|
+
* @param {CSN.Extension | CSN.QuerySelect} art
|
|
1397
|
+
* @param {object} elements
|
|
1398
|
+
* @param {CdlRenderEnvironment} env
|
|
1399
|
+
* @return {string}
|
|
1400
|
+
*/
|
|
1401
|
+
renderViewColumns( art, env, elements = Object.create(null) ) {
|
|
1402
|
+
env.path.push( 'columns', -1 );
|
|
1403
|
+
const result = art.columns.map((col, i) => {
|
|
1404
|
+
env.path[env.path.length - 1] = i;
|
|
1405
|
+
return this.renderViewColumn(col, env, findElement(elements, col));
|
|
1406
|
+
}).join(',\n');
|
|
1407
|
+
env.path.length -= 2;
|
|
1408
|
+
return `${ result }\n`;
|
|
1409
|
+
}
|
|
1410
|
+
|
|
1411
|
+
/**
|
|
1412
|
+
* Render a single view or projection column 'col', as it occurs in a select list or
|
|
1413
|
+
* projection list within 'art', possibly with annotations.
|
|
1414
|
+
* Return the resulting source string (no trailing LF).
|
|
1415
|
+
*
|
|
1416
|
+
* @param {object} col
|
|
1417
|
+
* @param {CdlRenderEnvironment} env
|
|
1418
|
+
* @param {CSN.Element} element Element corresponding to the column. Generated by the compiler.
|
|
1419
|
+
*/
|
|
1420
|
+
renderViewColumn( col, env, element ) {
|
|
1421
|
+
// Annotations and column
|
|
1422
|
+
let result = '';
|
|
1423
|
+
if (!col.doc) {
|
|
1424
|
+
// TODO: In contrast to annotations, we do not render the doc comment as part
|
|
1425
|
+
// of an `annotate` statement. That may change in the future.
|
|
1426
|
+
result += this.renderDocComment(element, env);
|
|
1427
|
+
}
|
|
1428
|
+
result += this.renderAnnotationAssignmentsAndDocComment(col, env);
|
|
1429
|
+
result += env.indent;
|
|
1430
|
+
|
|
1431
|
+
// only if column is virtual, keyword virtual was present in the source text
|
|
1432
|
+
result += col.virtual ? 'virtual ' : '';
|
|
1433
|
+
result += col.key ? 'key ' : '';
|
|
1434
|
+
|
|
1435
|
+
let exprResult;
|
|
1436
|
+
// Use special rendering for .expand/.inline - renderExpr cannot easily handle some cases
|
|
1437
|
+
if (col.expand || col.inline)
|
|
1438
|
+
exprResult = this.renderInlineExpand(col, env);
|
|
1439
|
+
else if (col.xpr && xprContainsCondition(col.xpr))
|
|
1440
|
+
exprResult = this.exprRenderer.renderSubExpr(withoutCast(col), env);
|
|
1441
|
+
else
|
|
1442
|
+
exprResult = this.exprRenderer.renderExpr(withoutCast(col), env);
|
|
1443
|
+
|
|
1444
|
+
result += exprResult;
|
|
1445
|
+
|
|
1446
|
+
// A new association (cast with `type` and `target`) uses `as` as its primary name, not alias.
|
|
1447
|
+
// The same for `virtual <name>`, which is a new element definition instead of a reference.
|
|
1448
|
+
const isNewElementDefinition = exprResult === '';
|
|
1449
|
+
if (isNewElementDefinition && col.as) {
|
|
1450
|
+
result += this.quoteNonIdentifierOrKeyword(col.as, env);
|
|
1451
|
+
}
|
|
1452
|
+
else if (col.as && !col.inline && !col.expand) {
|
|
1453
|
+
// Alias for inline/expand is already handled by renderInlineExpand
|
|
1454
|
+
result += this.renderAlias(col.as, env);
|
|
1455
|
+
}
|
|
1456
|
+
|
|
1457
|
+
|
|
1458
|
+
// Explicit type provided for the view element?
|
|
1459
|
+
if (col.cast) {
|
|
1460
|
+
env.path.push('cast');
|
|
1461
|
+
// Special case: Explicit association type is actually a redirect
|
|
1462
|
+
if (col.cast.target && !col.cast.type)
|
|
1463
|
+
result += ` : ${ this.renderRedirectedTo(col.cast, env) }`;
|
|
1464
|
+
else
|
|
1465
|
+
result += ` : ${ this.renderTypeReferenceAndProps(col.cast, env, { noAnnoCollect: true }) }`;
|
|
1466
|
+
env.path.length -= 1;
|
|
1467
|
+
}
|
|
1468
|
+
return result;
|
|
1469
|
+
}
|
|
1470
|
+
|
|
1471
|
+
/**
|
|
1472
|
+
* For the current column, render a (nested) inline/expand. If the current column
|
|
1473
|
+
* does not have an .expand/.inline, '' is returned
|
|
1474
|
+
*
|
|
1475
|
+
* @param {object} obj Thing with .expand or .inline
|
|
1476
|
+
* @param {CdlRenderEnvironment} env
|
|
1477
|
+
* @returns {string}
|
|
1478
|
+
*/
|
|
1479
|
+
renderInlineExpand( obj, env ) {
|
|
1480
|
+
// No expression to render for { * } as alias
|
|
1481
|
+
let result = (obj.as && obj.expand && !obj.ref) ? '' : this.exprRenderer.renderExpr(withoutCast(obj), env);
|
|
1482
|
+
|
|
1483
|
+
const isAnonymousExpand = (obj.expand && !obj.ref);
|
|
1484
|
+
|
|
1485
|
+
|
|
1486
|
+
// s as alias { * }
|
|
1487
|
+
if (obj.as && !isAnonymousExpand)
|
|
1488
|
+
result += this.renderAlias(obj.as, env);
|
|
1489
|
+
|
|
1490
|
+
// We found a leaf - no further drilling
|
|
1491
|
+
if (!obj.inline && !obj.expand) {
|
|
1492
|
+
env.path.push('cast');
|
|
1493
|
+
if (obj.cast && obj.cast.type)
|
|
1494
|
+
result += ` : ${ this.renderTypeReferenceAndProps(obj.cast, env, { noAnnoCollect: true }) }`;
|
|
1495
|
+
else if (obj.cast && obj.cast.target) // test tbd
|
|
1496
|
+
result += ` : ${ this.renderRedirectedTo(obj.cast, env) }`;
|
|
1497
|
+
env.path.length -= 1;
|
|
1498
|
+
return result;
|
|
1499
|
+
}
|
|
1500
|
+
|
|
1501
|
+
if (obj.inline)
|
|
1502
|
+
result += '.{\n';
|
|
1503
|
+
else
|
|
1504
|
+
result += result !== '' ? ' {\n' : '{\n';
|
|
1505
|
+
|
|
1506
|
+
// Drill down and render children of the expand/inline
|
|
1507
|
+
const childEnv = env.withIncreasedIndent();
|
|
1508
|
+
const expandInline = obj.expand || obj.inline;
|
|
1509
|
+
result += expandInline //
|
|
1510
|
+
.map(elm => this.renderViewColumn(elm, childEnv))
|
|
1511
|
+
.join(',\n');
|
|
1512
|
+
result += `\n${ env.indent }}`;
|
|
1513
|
+
|
|
1514
|
+
// Don't forget about the .excluding
|
|
1515
|
+
if (obj.excluding)
|
|
1516
|
+
result += ` excluding { ${ obj.excluding.join(',') } }`;
|
|
1517
|
+
|
|
1518
|
+
// { * } as expand
|
|
1519
|
+
if (obj.as && isAnonymousExpand)
|
|
1520
|
+
result += this.renderAlias(obj.as, env);
|
|
1521
|
+
|
|
1522
|
+
return result;
|
|
1523
|
+
}
|
|
1524
|
+
|
|
1525
|
+
/**
|
|
1526
|
+
* Render .doc properties as comments in CDL
|
|
1527
|
+
*
|
|
1528
|
+
* @param {object} obj Object to render for
|
|
1529
|
+
* @param {CdlRenderEnvironment} env
|
|
1530
|
+
* @returns {String}
|
|
1531
|
+
*/
|
|
1532
|
+
renderDocComment( obj, env ) {
|
|
1533
|
+
if (!obj || obj && obj.doc === undefined)
|
|
1534
|
+
return '';
|
|
1535
|
+
else if (obj && obj.doc === null) // empty doc comment needs to be rendered
|
|
1536
|
+
return `\n${ env.indent }/** */\n`;
|
|
1537
|
+
|
|
1538
|
+
let { doc } = obj;
|
|
1539
|
+
if (/[*]\//.test(doc)) // only escape sequence allowed in CDL for doc comments
|
|
1540
|
+
doc = doc.replace(/[*]\//g, '*\\/');
|
|
1541
|
+
|
|
1542
|
+
// Smaller comment for single-line comments. If the comment starts or ends with whitespace
|
|
1543
|
+
// we must use a block comment, or it will be lost when compiling the source again.
|
|
1544
|
+
if (!obj.doc.includes('\n') && !/(^\s)|(\s$)/.test(obj.doc))
|
|
1545
|
+
return `${ env.indent }/** ${ doc } */\n`;
|
|
1546
|
+
|
|
1547
|
+
const comment = doc.split('\n').map(l => `${ env.indent } * ${ l }`).join('\n');
|
|
1548
|
+
return `${ env.indent }/**\n${ comment }\n${ env.indent } */\n`;
|
|
1549
|
+
}
|
|
1550
|
+
|
|
1551
|
+
/**
|
|
1552
|
+
* @param {string} artifactName
|
|
1553
|
+
* @param {CSN.Artifact} art
|
|
1554
|
+
* @param {CdlRenderEnvironment} env
|
|
1555
|
+
*/
|
|
1556
|
+
renderView( artifactName, art, env ) {
|
|
1557
|
+
const syntax = (art.projection) ? 'projection' : 'entity';
|
|
1558
|
+
let result = this.renderAnnotationAssignmentsAndDocComment(art, env);
|
|
1559
|
+
result += `${ env.indent }entity ${ this.renderArtifactName(artifactName, env) }`;
|
|
1560
|
+
if (art.params)
|
|
1561
|
+
result += this.renderParameters(art, env);
|
|
1562
|
+
result += ' as ';
|
|
1563
|
+
result += this.renderQuery(getNormalizedQuery(art).query, true, syntax, env.withSubPath([ art.projection ? 'projection' : 'query' ]), art.elements);
|
|
1564
|
+
if (art.actions) // Views/Projections also allow actions. Just the VIEW keyword variant did not.
|
|
1565
|
+
result += this.renderBoundActionsAndFunctions(art, env);
|
|
1566
|
+
result += ';\n';
|
|
1567
|
+
result += this.renderQueryElementAndEnumAnnotations(art, env);
|
|
1568
|
+
if (art.includes)
|
|
1569
|
+
result += this.renderExtension({ extend: artifactName, includes: art.includes }, env);
|
|
1570
|
+
return result;
|
|
1571
|
+
}
|
|
1572
|
+
|
|
1573
|
+
/**
|
|
1574
|
+
* Render a query 'query', i.e. a select statement with where-condition etc.
|
|
1575
|
+
* If 'isLeadingQuery' is true, mixins, actions and functions of 'art' are
|
|
1576
|
+
* also rendered into the query. Use 'syntax' style ('projection', 'view',
|
|
1577
|
+
* or 'entity')
|
|
1578
|
+
*
|
|
1579
|
+
* @param {CSN.Query} query
|
|
1580
|
+
* @param {boolean} isLeadingQuery
|
|
1581
|
+
* @param {string} syntax The query syntax, either "projection", "entity" or "view"
|
|
1582
|
+
* @param {CdlRenderEnvironment} env
|
|
1583
|
+
* @param {object} [elements]
|
|
1584
|
+
*/
|
|
1585
|
+
renderQuery( query, isLeadingQuery, syntax, env, elements = query.elements || Object.create(null) ) {
|
|
1586
|
+
const that = this;
|
|
1587
|
+
if (query.SET) {
|
|
1588
|
+
// Set operator, such as UNION, INTERSECT, or EXCEPT...
|
|
1589
|
+
return renderQuerySet();
|
|
1590
|
+
}
|
|
1591
|
+
else if (!query.SELECT) {
|
|
1592
|
+
// ...otherwise must have a SELECT
|
|
1593
|
+
throw new ModelError(`Unexpected query operation ${ JSON.stringify(query) }`);
|
|
1594
|
+
}
|
|
1595
|
+
|
|
1596
|
+
let result = '';
|
|
1597
|
+
const select = query.SELECT;
|
|
1598
|
+
|
|
1599
|
+
// If not a projection, must be view/entity.
|
|
1600
|
+
result += (syntax === 'projection') ? 'projection on ' : 'select from ';
|
|
1601
|
+
|
|
1602
|
+
env.path.push('from');
|
|
1603
|
+
result += this.renderViewSource(select.from, env);
|
|
1604
|
+
env.path.length -= 1;
|
|
1605
|
+
|
|
1606
|
+
if (select.mixin) {
|
|
1607
|
+
let elems = '';
|
|
1608
|
+
env.path.push('mixin', '');
|
|
1609
|
+
env.increaseIndent();
|
|
1610
|
+
forEach(select.mixin, (name, mixin) => {
|
|
1611
|
+
env.path[env.path.length - 1] = name;
|
|
1612
|
+
elems += this.renderElement(name, mixin, env);
|
|
1613
|
+
});
|
|
1614
|
+
env.decreaseIndent();
|
|
1615
|
+
env.path.length -= 2;
|
|
1616
|
+
if (elems) {
|
|
1617
|
+
result += ' mixin {\n';
|
|
1618
|
+
result += elems;
|
|
1619
|
+
result += `${ env.indent }} into`;
|
|
1620
|
+
}
|
|
1621
|
+
}
|
|
1622
|
+
result += select.distinct ? ' distinct' : '';
|
|
1623
|
+
if (select.columns) {
|
|
1624
|
+
result += ' {\n';
|
|
1625
|
+
env.increaseIndent();
|
|
1626
|
+
result += this.renderViewColumns(select, env, elements);
|
|
1627
|
+
env.decreaseIndent();
|
|
1628
|
+
result += `${ env.indent }}`;
|
|
1629
|
+
}
|
|
1630
|
+
|
|
1631
|
+
const childEnv = env.withIncreasedIndent();
|
|
1632
|
+
if (select.excluding) {
|
|
1633
|
+
const excludes = select.excluding.map(id => `${ childEnv.indent }${ this.quoteNonIdentifierOrKeyword(id, env) }`).join(',\n');
|
|
1634
|
+
result += ` excluding {\n${ excludes }\n`;
|
|
1635
|
+
result += `${ env.indent }}`;
|
|
1636
|
+
}
|
|
1637
|
+
|
|
1638
|
+
if (isLeadingQuery && query.actions)
|
|
1639
|
+
result += this.renderBoundActionsAndFunctions(query, env);
|
|
1640
|
+
|
|
1641
|
+
if (select.where)
|
|
1642
|
+
result += `${ continueIndent(result, env) }where ${ this.exprRenderer.renderExpr(select.where, env.withSubPath([ 'where' ])) }`;
|
|
1643
|
+
|
|
1644
|
+
if (select.groupBy)
|
|
1645
|
+
result += `${ continueIndent(result, env) }group by ${ select.groupBy.map((expr, i) => this.exprRenderer.renderExpr(expr, env.withSubPath([ 'groupBy', i ]))).join(', ') }`;
|
|
1646
|
+
|
|
1647
|
+
if (select.having)
|
|
1648
|
+
result += `${ continueIndent(result, env) }having ${ this.exprRenderer.renderExpr(select.having, env.withSubPath([ 'having' ])) }`;
|
|
1649
|
+
|
|
1650
|
+
if (select.orderBy)
|
|
1651
|
+
result += `${ continueIndent(result, env) }order by ${ select.orderBy.map((entry, i) => this.renderOrderByEntry(entry, env.withSubPath([ 'orderBy', i ]))).join(', ') }`;
|
|
1652
|
+
|
|
1653
|
+
if (select.limit)
|
|
1654
|
+
result += `${ continueIndent(result, env) }${ this.renderLimit(select.limit, env.withSubPath([ 'limit' ])) }`;
|
|
1655
|
+
|
|
1656
|
+
return result;
|
|
1657
|
+
|
|
1658
|
+
/**
|
|
1659
|
+
* Utility function to make sure that we continue with the same indentation in WHERE, GROUP BY, ... after a closing curly brace and beyond
|
|
1660
|
+
*
|
|
1661
|
+
* @param {string} str
|
|
1662
|
+
* @param {CdlRenderEnvironment} indentEnv
|
|
1663
|
+
* @return {string}
|
|
1664
|
+
*/
|
|
1665
|
+
function continueIndent( str, indentEnv ) {
|
|
1666
|
+
if (str.endsWith('}') || str.endsWith('})')) {
|
|
1667
|
+
// The preceding clause ended with '}', just append after that
|
|
1668
|
+
return ' ';
|
|
1669
|
+
}
|
|
1670
|
+
// Otherwise, start new line and indent normally
|
|
1671
|
+
return `\n${ indentEnv.withIncreasedIndent().indent }`;
|
|
1672
|
+
}
|
|
1673
|
+
|
|
1674
|
+
/**
|
|
1675
|
+
* Render UNION, INTERSECT, and EXCEPT, i.e. sets.
|
|
1676
|
+
*
|
|
1677
|
+
* @return {string}
|
|
1678
|
+
*/
|
|
1679
|
+
function renderQuerySet() {
|
|
1680
|
+
const subQueries = query.SET.args.map((arg, i) => {
|
|
1681
|
+
// First arg may be leading query
|
|
1682
|
+
const subEnv = env.withSubPath([ 'SET', 'args', i ]);
|
|
1683
|
+
const subQuery = that.renderQuery(arg, isLeadingQuery && (i === 0), 'view', subEnv, elements);
|
|
1684
|
+
return `(${ subQuery })`;
|
|
1685
|
+
});
|
|
1686
|
+
|
|
1687
|
+
let setResult = subQueries.join(`\n${ env.indent }${ query.SET.op }${ query.SET.all ? ' all' : '' } `);
|
|
1688
|
+
// Set operation may also have an ORDER BY and LIMIT/OFFSET (in contrast to the ones belonging to
|
|
1689
|
+
// each SELECT)
|
|
1690
|
+
if (query.SET.orderBy)
|
|
1691
|
+
setResult += `${ continueIndent(setResult, env) }order by ${ query.SET.orderBy.map((entry, i) => that.renderOrderByEntry(entry, env.withSubPath([ 'SET', 'orderBy', i ]))).join(', ') }`;
|
|
1692
|
+
|
|
1693
|
+
if (query.SET.limit)
|
|
1694
|
+
setResult += `${ continueIndent(setResult, env) }${ that.renderLimit(query.SET.limit, env.withSubPath([ 'SET', 'limit' ])) }`;
|
|
1695
|
+
return setResult;
|
|
1696
|
+
}
|
|
1697
|
+
}
|
|
1698
|
+
|
|
1699
|
+
/**
|
|
1700
|
+
* Render one entry of a query's ORDER BY clause (which always has a 'value' expression, and may
|
|
1701
|
+
* have a 'sort' property for ASC/DESC and a 'nulls' for FIRST/LAST
|
|
1702
|
+
*
|
|
1703
|
+
* @param {object} entry
|
|
1704
|
+
* @param {CdlRenderEnvironment} env
|
|
1705
|
+
* @return {string}
|
|
1706
|
+
*/
|
|
1707
|
+
renderOrderByEntry( entry, env ) {
|
|
1708
|
+
let result = this.renderAnnotationAssignmentsAndDocComment(entry, env) + this.exprRenderer.renderExpr(entry, env);
|
|
1709
|
+
if (entry.sort)
|
|
1710
|
+
result += ` ${ entry.sort }`;
|
|
1711
|
+
|
|
1712
|
+
if (entry.nulls)
|
|
1713
|
+
result += ` nulls ${ entry.nulls }`;
|
|
1714
|
+
|
|
1715
|
+
return result;
|
|
1716
|
+
}
|
|
1717
|
+
|
|
1718
|
+
/**
|
|
1719
|
+
* Render a query's LIMIT clause, which may also have OFFSET.
|
|
1720
|
+
*
|
|
1721
|
+
* @param {CSN.QueryLimit} limit
|
|
1722
|
+
* @param {CdlRenderEnvironment} limitEnv
|
|
1723
|
+
* @return {string}
|
|
1724
|
+
*/
|
|
1725
|
+
renderLimit( limit, limitEnv ) {
|
|
1726
|
+
let limitStr = '';
|
|
1727
|
+
if (limit.rows !== undefined)
|
|
1728
|
+
limitStr += `limit ${ this.exprRenderer.renderExpr(limit.rows, limitEnv.withSubPath([ 'rows' ])) }`;
|
|
1729
|
+
|
|
1730
|
+
if (limit.offset !== undefined) {
|
|
1731
|
+
const offsetIndent = (limitStr === '') ? '' : `\n${ limitEnv.withIncreasedIndent().indent }`;
|
|
1732
|
+
limitStr += `${ offsetIndent }offset ${ this.exprRenderer.renderExpr(limit.offset, limitEnv.withSubPath([ 'offset' ])) }`;
|
|
1733
|
+
}
|
|
1734
|
+
return limitStr;
|
|
1735
|
+
}
|
|
1736
|
+
|
|
1737
|
+
/**
|
|
1738
|
+
* Render an entity's actions and functions (if any)
|
|
1739
|
+
* (expect an entity with trailing '}' or an 'extend' statement ending with 'with'
|
|
1740
|
+
* to have just been rendered).
|
|
1741
|
+
* Return the resulting source string.
|
|
1742
|
+
*
|
|
1743
|
+
* @param {CSN.Artifact} art
|
|
1744
|
+
* @param {CdlRenderEnvironment} env
|
|
1745
|
+
* @return {string}
|
|
1746
|
+
*/
|
|
1747
|
+
renderBoundActionsAndFunctions( art, env ) {
|
|
1748
|
+
let result = '';
|
|
1749
|
+
if (art.actions) {
|
|
1750
|
+
const childEnv = env.withIncreasedIndent();
|
|
1751
|
+
for (const name in art.actions)
|
|
1752
|
+
result += this.renderActionOrFunction(name, art.actions[name], childEnv.withSubPath([ 'actions', name ]), true);
|
|
1753
|
+
result = (result === '')
|
|
1754
|
+
? ' actions { }'
|
|
1755
|
+
: ` actions {\n${ result }${ env.indent }}`;
|
|
1756
|
+
}
|
|
1757
|
+
return result;
|
|
1758
|
+
}
|
|
1759
|
+
|
|
1760
|
+
/**
|
|
1761
|
+
* Render an action or function 'act' with name 'actName'. Return the resulting source string.
|
|
1762
|
+
*
|
|
1763
|
+
* @param {string} actionName
|
|
1764
|
+
* @param {CSN.Action} act
|
|
1765
|
+
* @param {CdlRenderEnvironment} env
|
|
1766
|
+
* @param {boolean} isBound
|
|
1767
|
+
* @return {string}
|
|
1768
|
+
*/
|
|
1769
|
+
renderActionOrFunction( actionName, act, env, isBound ) {
|
|
1770
|
+
let result = this.renderAnnotationAssignmentsAndDocComment(act, env) + env.indent + act.kind;
|
|
1771
|
+
if (isBound) {
|
|
1772
|
+
// for bound actions, paths are not global
|
|
1773
|
+
result += ` ${ this.quotePathIfRequired(actionName, env) }`;
|
|
1774
|
+
}
|
|
1775
|
+
else {
|
|
1776
|
+
result += ` ${ this.renderArtifactName(actionName, env) }`;
|
|
1777
|
+
}
|
|
1778
|
+
result += this.renderParameters(act, env);
|
|
1779
|
+
if (act.returns) {
|
|
1780
|
+
let actEnv = env.withSubPath([ 'returns' ]);
|
|
1781
|
+
const annos = this.renderAnnotationAssignmentsAndDocComment(act.returns, actEnv.withIncreasedIndent());
|
|
1782
|
+
if (annos) // if `returns` has annotations, increase indent for nicer aligned output
|
|
1783
|
+
actEnv = actEnv.withIncreasedIndent();
|
|
1784
|
+
const type = this.renderTypeReferenceAndProps(act.returns, actEnv);
|
|
1785
|
+
result += ` returns${ annos ? '\n' : ' ' }${ annos }${ annos ? actEnv.indent : '' }${ type }`;
|
|
1786
|
+
}
|
|
1787
|
+
|
|
1788
|
+
result += ';\n';
|
|
1789
|
+
return result;
|
|
1790
|
+
}
|
|
1791
|
+
|
|
1792
|
+
/**
|
|
1793
|
+
* Render art.params, i.e. list of parameter in parentheses. If there is only one
|
|
1794
|
+
* parameter, a single line is used, otherwise an indented list is used.
|
|
1795
|
+
* If there are no params, an empty list `()` is returned.
|
|
1796
|
+
*
|
|
1797
|
+
* @param {CSN.Artifact} art
|
|
1798
|
+
* @param {CdlRenderEnvironment} env
|
|
1799
|
+
* @returns {string}
|
|
1800
|
+
*/
|
|
1801
|
+
renderParameters( art, env ) {
|
|
1802
|
+
const childEnv = env.withIncreasedIndent();
|
|
1803
|
+
const parameters = Object.keys(art.params || {}).map(name => this.renderParameter(name, art.params[name], childEnv));
|
|
1804
|
+
if (parameters.length === 0)
|
|
1805
|
+
return '()';
|
|
1806
|
+
return `(\n${ parameters.join(',\n') }\n${ env.indent })`;
|
|
1807
|
+
}
|
|
1808
|
+
|
|
1809
|
+
/**
|
|
1810
|
+
* Render an action or function parameter 'par' with name 'parName'. Return the resulting source string (no trailing LF).
|
|
1811
|
+
*
|
|
1812
|
+
* @param {string} parName
|
|
1813
|
+
* @param {object} par
|
|
1814
|
+
* @param {CdlRenderEnvironment} env
|
|
1815
|
+
* @return {string}
|
|
1816
|
+
*/
|
|
1817
|
+
renderParameter( parName, par, env ) {
|
|
1818
|
+
env = env.withSubPath( [ 'params', parName ]);
|
|
1819
|
+
let result = `${ this.renderAnnotationAssignmentsAndDocComment(par, env) }${ env.indent }`;
|
|
1820
|
+
result += `${ this.quoteNonIdentifierOrKeyword(parName, env) } : ${ this.renderTypeReferenceAndProps(par, env) }`;
|
|
1821
|
+
return result;
|
|
1822
|
+
}
|
|
1823
|
+
|
|
1824
|
+
/**
|
|
1825
|
+
* Render a reference to a type used by 'artifact' (named or inline) and (element) properties
|
|
1826
|
+
* such as `not null` and `default <xpr>`.
|
|
1827
|
+
* Allow suppressing rendering of structs such as enums - used in columns for example.
|
|
1828
|
+
*
|
|
1829
|
+
* @param {CSN.Artifact} artifact
|
|
1830
|
+
* @param {CdlRenderEnvironment} env
|
|
1831
|
+
* @param {object} [config={}]
|
|
1832
|
+
* @param {boolean} [config.typeRefOnly] Whether to only render type defs, no arrayed/structured/enum.
|
|
1833
|
+
* @param {boolean} [config.noAnnoCollect] Do not collect annotations of sub-elements.
|
|
1834
|
+
* @return {string}
|
|
1835
|
+
*/
|
|
1836
|
+
renderTypeReferenceAndProps( artifact, env, config = {} ) {
|
|
1837
|
+
let result = '';
|
|
1838
|
+
const { typeRefOnly, noAnnoCollect } = config;
|
|
1839
|
+
|
|
1840
|
+
if (typeRefOnly && !artifact.type)
|
|
1841
|
+
throw new ModelError(`Expected artifact to have a type; in: ${ JSON.stringify(env.path) }`);
|
|
1842
|
+
|
|
1843
|
+
if (artifact.localized) // works even for type definitions
|
|
1844
|
+
result += 'localized ';
|
|
1845
|
+
|
|
1846
|
+
// Some properties are always "top-level", even for "many", e.g. "default" or
|
|
1847
|
+
// "not null". Keep a reference to the outer artifact.
|
|
1848
|
+
const origArtifact = artifact;
|
|
1849
|
+
if (!artifact.type && artifact.items) {
|
|
1850
|
+
this.checkArrayedArtifact(artifact, env);
|
|
1851
|
+
result += 'many '; // alternative: 'array of'; but not used
|
|
1852
|
+
artifact = artifact.items;
|
|
1853
|
+
env = env.withSubPath([ 'items' ]);
|
|
1854
|
+
}
|
|
1855
|
+
|
|
1856
|
+
const type = normalizeTypeRef(artifact.type);
|
|
1857
|
+
|
|
1858
|
+
if (!type && artifact.elements) {
|
|
1859
|
+
result += this.renderElements(artifact, env);
|
|
1860
|
+
result += this.renderNullability(artifact.notNull);
|
|
1861
|
+
// structured default not possible at the moment
|
|
1862
|
+
return result;
|
|
1863
|
+
}
|
|
1864
|
+
|
|
1865
|
+
const defaultValue = origArtifact.default ? origArtifact.default : artifact.default;
|
|
1866
|
+
const notNull = origArtifact.notNull ? origArtifact.notNull : artifact.notNull;
|
|
1867
|
+
|
|
1868
|
+
// Association type
|
|
1869
|
+
if (isDirectAssocOrComp(type)) {
|
|
1870
|
+
const isComp = type === 'cds.Composition';
|
|
1871
|
+
// Type, cardinality and target; CAPire uses CamelCase
|
|
1872
|
+
result += isComp ? 'Composition' : 'Association';
|
|
1873
|
+
result += this.renderCardinality(artifact);
|
|
1874
|
+
|
|
1875
|
+
// `targetAspect` may be set by the core compiler and refers to the original named or unnamed aspect.
|
|
1876
|
+
// In parseCdl, `target` may still be an object containing elements. This would be replaced
|
|
1877
|
+
// by targetAspect in client CSN, but we can't rely on that.
|
|
1878
|
+
// If a name exists (either in target or targetAspect), prefer it over rendering elements.
|
|
1879
|
+
const elements = artifact.target?.elements || artifact.targetAspect?.elements;
|
|
1880
|
+
if (typeof artifact.target === 'string' || typeof artifact.targetAspect === 'string') {
|
|
1881
|
+
result += this.renderAbsolutePath({ ref: [ artifact.target || artifact.targetAspect ] },
|
|
1882
|
+
{ ...env, additionalKeywords: [ 'MANY', 'ONE' ] });
|
|
1883
|
+
}
|
|
1884
|
+
else if (elements) {
|
|
1885
|
+
// anonymous aspect, either parseCdl or client CSN.
|
|
1886
|
+
result += this.renderElements({ elements }, env.withSubPath([ artifact.target?.elements ? 'target' : 'targetAspect' ]));
|
|
1887
|
+
}
|
|
1888
|
+
else {
|
|
1889
|
+
throw new ModelError('Association/Composition is missing its target! Throwing exception to trigger recompilation.');
|
|
1890
|
+
}
|
|
1891
|
+
|
|
1892
|
+
// ON-condition (if any)
|
|
1893
|
+
if (artifact.on)
|
|
1894
|
+
result += ` on ${ this.exprRenderer.renderExpr(artifact.on, env.withSubPath([ 'on' ])) }`;
|
|
1895
|
+
|
|
1896
|
+
// Foreign keys (if any, unless we also have an ON-condition (which means we have been transformed from managed to unmanaged)
|
|
1897
|
+
if (artifact.keys && !artifact.on) {
|
|
1898
|
+
const keys = this.renderForeignKeys(artifact, env, false);
|
|
1899
|
+
if (keys)
|
|
1900
|
+
result += ` ${ keys }`;
|
|
1901
|
+
}
|
|
1902
|
+
|
|
1903
|
+
if (!artifact.on) {
|
|
1904
|
+
// unmanaged associations can't be followed by "not null" or "default"
|
|
1905
|
+
result += this.renderNullability(notNull);
|
|
1906
|
+
result += this.renderDefaultExpr(defaultValue, env.withSubPath([ 'default' ]));
|
|
1907
|
+
}
|
|
1908
|
+
return result;
|
|
1909
|
+
}
|
|
1910
|
+
|
|
1911
|
+
// At this point, we will render a named type.
|
|
1912
|
+
|
|
1913
|
+
// If we have a type and elements, we may have sub-structure annotates that would
|
|
1914
|
+
// get lost if we only render the type name.
|
|
1915
|
+
// We only extract annotations of enums, if "typeRefOnly" is true. Otherwise, since
|
|
1916
|
+
// the full enum is rendered below, we would have unnecessary annotations.
|
|
1917
|
+
if (!noAnnoCollect && (!artifact.enum || typeRefOnly)) {
|
|
1918
|
+
const annotate = this.collectAnnotationsOfElementsAndEnum(artifact, env);
|
|
1919
|
+
if (annotate)
|
|
1920
|
+
this.subelementAnnotates.push(annotate);
|
|
1921
|
+
}
|
|
1922
|
+
|
|
1923
|
+
// Reference to another artifact
|
|
1924
|
+
if (typeof type === 'string') {
|
|
1925
|
+
// If we get here, it must be a named type
|
|
1926
|
+
result += this.renderNamedTypeWithParameters(artifact, env);
|
|
1927
|
+
}
|
|
1928
|
+
else if (type?.ref) {
|
|
1929
|
+
result += this.renderAbsolutePath(artifact.type, env);
|
|
1930
|
+
}
|
|
1931
|
+
|
|
1932
|
+
if (artifact.enum && !typeRefOnly)
|
|
1933
|
+
result += this.renderEnum(artifact.enum, env);
|
|
1934
|
+
|
|
1935
|
+
result += this.renderNullability(notNull);
|
|
1936
|
+
// If there is a default value, and it's a calculated element, do not
|
|
1937
|
+
// render the default (because it's not supported for calc elements).
|
|
1938
|
+
if (defaultValue !== undefined && !artifact.value)
|
|
1939
|
+
result += this.renderDefaultExpr(defaultValue, env.withSubPath([ 'default' ]));
|
|
1940
|
+
|
|
1941
|
+
return result;
|
|
1942
|
+
}
|
|
1943
|
+
|
|
1944
|
+
/**
|
|
1945
|
+
* Render REDIRECTED TO with its keys/on condition for the given artifact.
|
|
1946
|
+
*
|
|
1947
|
+
* @param {object} art
|
|
1948
|
+
* @param {CdlRenderEnvironment} env
|
|
1949
|
+
* @return {string}
|
|
1950
|
+
*/
|
|
1951
|
+
renderRedirectedTo( art, env ) {
|
|
1952
|
+
let result = `redirected to ${ this.renderDefinitionReference(art.target, env) }`;
|
|
1953
|
+
if (art.on) {
|
|
1954
|
+
result += ` on ${ this.exprRenderer.renderExpr(art.on, env.withSubPath([ 'on' ])) }`;
|
|
1955
|
+
}
|
|
1956
|
+
else if (art.keys) {
|
|
1957
|
+
const keys = this.renderForeignKeys(art, env, true);
|
|
1958
|
+
if (keys)
|
|
1959
|
+
result += ` ${ keys }`;
|
|
1960
|
+
}
|
|
1961
|
+
return result;
|
|
1962
|
+
}
|
|
1963
|
+
|
|
1964
|
+
/**
|
|
1965
|
+
* Render the named type with optional parameters, e.g. `MyString(length: 10)`.
|
|
1966
|
+
*
|
|
1967
|
+
* @param {CSN.Artifact} artWithType
|
|
1968
|
+
* @param {CdlRenderEnvironment} env
|
|
1969
|
+
* @return {string}
|
|
1970
|
+
*/
|
|
1971
|
+
renderNamedTypeWithParameters( artWithType, env ) {
|
|
1972
|
+
const type = normalizeTypeRef(artWithType.type);
|
|
1973
|
+
let result = this.renderDefinitionReference(type, env);
|
|
1974
|
+
result += this.renderTypeParameters(artWithType);
|
|
1975
|
+
return result;
|
|
1976
|
+
}
|
|
1977
|
+
|
|
1978
|
+
|
|
1979
|
+
/**
|
|
1980
|
+
* Render the 'enum { ... } part of a type declaration
|
|
1981
|
+
*
|
|
1982
|
+
* @param {CSN.EnumList} enumPart
|
|
1983
|
+
* @param {CdlRenderEnvironment} env
|
|
1984
|
+
* @return {string}
|
|
1985
|
+
*/
|
|
1986
|
+
renderEnum( enumPart, env ) {
|
|
1987
|
+
let result = ' enum {\n';
|
|
1988
|
+
const childEnv = env.withIncreasedIndent();
|
|
1989
|
+
for (const name in enumPart)
|
|
1990
|
+
result += this.renderElement(name, enumPart[name], childEnv.withSubPath([ 'enum', name ]));
|
|
1991
|
+
result += `${ env.indent }}`;
|
|
1992
|
+
return result;
|
|
1993
|
+
}
|
|
1994
|
+
|
|
1995
|
+
/**
|
|
1996
|
+
* Render an annotation value, which is either
|
|
1997
|
+
* - a normal expressions
|
|
1998
|
+
* - a somewhat simplified expression, with slightly different representation
|
|
1999
|
+
*
|
|
2000
|
+
* @param {any} annoValue
|
|
2001
|
+
* @param {CdlRenderEnvironment} env
|
|
2002
|
+
*/
|
|
2003
|
+
renderAnnotationValue( annoValue, env, isTopLevel = false ) {
|
|
2004
|
+
if (Array.isArray(annoValue))
|
|
2005
|
+
return this.renderAnnotationArrayValue( annoValue, env );
|
|
2006
|
+
|
|
2007
|
+
// Null
|
|
2008
|
+
if (annoValue === null)
|
|
2009
|
+
return 'null';
|
|
2010
|
+
|
|
2011
|
+
if (typeof annoValue !== 'object') {
|
|
2012
|
+
// Primitive: string, number, boolean
|
|
2013
|
+
// Quote strings, leave all others as they are
|
|
2014
|
+
return (typeof annoValue === 'string') ? renderString(annoValue, env) : String(annoValue);
|
|
2015
|
+
}
|
|
2016
|
+
// Enum symbol (is also annotation expression, but rendered without `(…)`
|
|
2017
|
+
if (annoValue['#'] !== undefined)
|
|
2018
|
+
return `#${ annoValue['#'] }`;
|
|
2019
|
+
|
|
2020
|
+
if (isAnnotationExpression(annoValue)) {
|
|
2021
|
+
// Once inside an expression, we stay there.
|
|
2022
|
+
const xpr = this.exprRenderer.renderExpr(annoValue, env);
|
|
2023
|
+
return `( ${ xpr } )`;
|
|
2024
|
+
}
|
|
2025
|
+
// Unchecked reference in `=` (with additional props: render as struct if not top-level)
|
|
2026
|
+
if (typeof annoValue['='] === 'string' &&
|
|
2027
|
+
(isTopLevel || Object.keys(annoValue).length === 1)) {
|
|
2028
|
+
// TODO: the to.cdl backend could issue a warning if there are non-`=`
|
|
2029
|
+
// properties in a structure outside an array (not representable in CDL)
|
|
2030
|
+
return (annoValue['='].startsWith('@'))
|
|
2031
|
+
? this.quoteAnnotationPathIfRequired(annoValue['='], env)
|
|
2032
|
+
: this.quotePathIfRequired(annoValue['='], env);
|
|
2033
|
+
}
|
|
2034
|
+
// Ellipsis: `... up to <val>`
|
|
2035
|
+
if (annoValue['...'] !== undefined) {
|
|
2036
|
+
return (annoValue['...'] === true)
|
|
2037
|
+
? '...'
|
|
2038
|
+
: `... up to ${ this.renderAnnotationValue(annoValue['...'], env) }`;
|
|
2039
|
+
}
|
|
2040
|
+
|
|
2041
|
+
// Struct value (TODO: issue warning if outside an array, possible via CSN input)
|
|
2042
|
+
// Render as one-liner if there is at most one key. Render as multi-line
|
|
2043
|
+
// struct if there are more and use nicer indentation.
|
|
2044
|
+
const keys = Object.keys(annoValue);
|
|
2045
|
+
const childEnv = env.withIncreasedIndent();
|
|
2046
|
+
const values = keys.map(key => `${ this.quoteAnnotationPathIfRequired(key, env) }: ${ this.renderAnnotationValue(annoValue[key], childEnv.withSubPath([ key ])) }`);
|
|
2047
|
+
const result = joinDocuments(values, [ ',', line() ]);
|
|
2048
|
+
return format(nestBy(env.indent.length, bracketBlock(INDENT_SIZE, '{', result, '}') ));
|
|
2049
|
+
}
|
|
2050
|
+
|
|
2051
|
+
/**
|
|
2052
|
+
* Renders an array annotation value. Uses a heuristic to put each element on its own line
|
|
2053
|
+
* if a single-line becomes longer than 100 characters or if any sub-expression already
|
|
2054
|
+
* contains a line break. The latter checks makes nested arrays with structures more
|
|
2055
|
+
* readable.
|
|
2056
|
+
*
|
|
2057
|
+
* @param {any[]} annoValue
|
|
2058
|
+
* @param {CdlRenderEnvironment} env
|
|
2059
|
+
* @return {string}
|
|
2060
|
+
*/
|
|
2061
|
+
renderAnnotationArrayValue( annoValue, env ) {
|
|
2062
|
+
const childEnv = env.withIncreasedIndent();
|
|
2063
|
+
// Render array parts as values.
|
|
2064
|
+
const items = annoValue.map((item, i) => this.renderAnnotationValue(item, childEnv.withSubPath([ i ])));
|
|
2065
|
+
const result = joinDocuments(items, [ ',', line() ]);
|
|
2066
|
+
return format(nestBy(env.indent.length, bracketBlock(INDENT_SIZE, '[', result, ']')));
|
|
2067
|
+
}
|
|
2068
|
+
|
|
2069
|
+
/**
|
|
2070
|
+
* Render a single path step 's' at path position 'idx', which can have filters or parameters or be a function
|
|
2071
|
+
*
|
|
2072
|
+
* @param {string|object} s
|
|
2073
|
+
* @param {number} idx
|
|
2074
|
+
* @param {object} env
|
|
2075
|
+
* @returns {string}
|
|
2076
|
+
*/
|
|
2077
|
+
renderPathStep( s, idx, env ) {
|
|
2078
|
+
// Simple id or absolute name
|
|
2079
|
+
if (typeof s === 'string') {
|
|
2080
|
+
// In first path position, do not quote $projection and magic $-variables like CURRENT_DATE, $now etc.
|
|
2081
|
+
// FIXME: We should rather explicitly recognize quoting somehow
|
|
2082
|
+
if (idx === 0 && s.startsWith('$'))
|
|
2083
|
+
return s;
|
|
2084
|
+
return this.quoteNonIdentifierOrKeyword(s, env);
|
|
2085
|
+
}
|
|
2086
|
+
// ID with filters or parameters
|
|
2087
|
+
else if (typeof s === 'object') {
|
|
2088
|
+
// Sanity check
|
|
2089
|
+
if (!s.func && !s.id)
|
|
2090
|
+
throw new ModelError(`Unknown path step object: ${ JSON.stringify(s) }`);
|
|
2091
|
+
|
|
2092
|
+
// Not really a path step but an object-like function call
|
|
2093
|
+
if (s.func)
|
|
2094
|
+
return `${ s.func }(${ this.renderArguments(s, '=>', env) })`;
|
|
2095
|
+
|
|
2096
|
+
// Path step, possibly with view parameters and/or filters
|
|
2097
|
+
let result = `${ this.quoteNonIdentifierOrKeyword(s.id, env) }`;
|
|
2098
|
+
if (s.args) {
|
|
2099
|
+
// View parameters
|
|
2100
|
+
result += `(${ this.renderArguments(s, ':', env) })`;
|
|
2101
|
+
}
|
|
2102
|
+
|
|
2103
|
+
result += this.renderFilterAndCardinality(s, env);
|
|
2104
|
+
|
|
2105
|
+
return result;
|
|
2106
|
+
}
|
|
2107
|
+
|
|
2108
|
+
throw new ModelError(`Unknown path step: ${ JSON.stringify(s) }`);
|
|
2109
|
+
}
|
|
2110
|
+
|
|
2111
|
+
/**
|
|
2112
|
+
* Render function arguments or view parameters (positional if array, named if object/dict),
|
|
2113
|
+
* using 'sep' as separator for named parameters
|
|
2114
|
+
*
|
|
2115
|
+
* @param {object} node with `args` to render
|
|
2116
|
+
* @param {string} sep
|
|
2117
|
+
* @param {CdlRenderEnvironment} env
|
|
2118
|
+
* @returns {string}
|
|
2119
|
+
*/
|
|
2120
|
+
renderArguments( node, sep, env ) {
|
|
2121
|
+
if (!node.args)
|
|
2122
|
+
return '';
|
|
2123
|
+
else if (Array.isArray(node.args))
|
|
2124
|
+
return this.renderPositionalArguments(node, env);
|
|
2125
|
+
else if (typeof node.args === 'object')
|
|
2126
|
+
return this.renderNamedArguments(node, sep, env);
|
|
2127
|
+
throw new ModelError(`Unknown args: ${ JSON.stringify(node.args) }; expected array/object`);
|
|
2128
|
+
}
|
|
2129
|
+
|
|
2130
|
+
/**
|
|
2131
|
+
* Render named function arguments or view parameters,
|
|
2132
|
+
* using 'sep' as separator.
|
|
2133
|
+
*
|
|
2134
|
+
* @param {object} node with `args` to render
|
|
2135
|
+
* @param {string} separator
|
|
2136
|
+
* @param {CdlRenderEnvironment} env
|
|
2137
|
+
* @returns {string}
|
|
2138
|
+
*/
|
|
2139
|
+
renderNamedArguments( node, separator, env ) {
|
|
2140
|
+
const that = this;
|
|
2141
|
+
return Object.keys(node.args).map(function renderNamedArgument(key) {
|
|
2142
|
+
return `${ that.quoteNonIdentifierOrKeyword(key, env) } ${ separator } ${ that.renderArgument(node.args[key], env.withSubPath([ 'args', key ])) }`;
|
|
2143
|
+
}).join(', ');
|
|
2144
|
+
}
|
|
2145
|
+
|
|
2146
|
+
/**
|
|
2147
|
+
* Render a comma separated list of positional function arguments.
|
|
2148
|
+
*
|
|
2149
|
+
* @param {object} node with `args` to render
|
|
2150
|
+
* @param {CdlRenderEnvironment} env
|
|
2151
|
+
* @returns {string}
|
|
2152
|
+
*/
|
|
2153
|
+
renderPositionalArguments( node, env ) {
|
|
2154
|
+
if (!node.args)
|
|
2155
|
+
return '';
|
|
2156
|
+
const func = node.func?.toUpperCase();
|
|
2157
|
+
const that = this;
|
|
2158
|
+
if (func) {
|
|
2159
|
+
return node.args.map(function renderFunctionArg(arg, i) {
|
|
2160
|
+
return that.renderArgument(arg, env.withSubPath([ 'args', i ]), getKeywordsForSpecialFunctionArgument(func, i));
|
|
2161
|
+
}).join(', ');
|
|
2162
|
+
}
|
|
2163
|
+
return node.args.map((arg, i) => this.renderArgument(arg, env.withSubPath([ 'args', i ]))).join(', ');
|
|
2164
|
+
}
|
|
2165
|
+
|
|
2166
|
+
/**
|
|
2167
|
+
* Render a function argument, e.g. for generic functions or CAST().
|
|
2168
|
+
* Ensures that parentheses are used if necessary, e.g. for `someFct( (1=1), (1=1) )`.
|
|
2169
|
+
*
|
|
2170
|
+
* @param {any} arg
|
|
2171
|
+
* @param {CdlRenderEnvironment} env
|
|
2172
|
+
* @param {string[]} additionalKeywords
|
|
2173
|
+
* @return {string}
|
|
2174
|
+
*/
|
|
2175
|
+
renderArgument( arg, env, additionalKeywords = [] ) {
|
|
2176
|
+
// If the argument is a xpr with e.g. `=`, it may require parentheses.
|
|
2177
|
+
// For nested xpr, `exprRenderer.renderExpr()` will already add parentheses.
|
|
2178
|
+
env = env.cloneWith({ additionalKeywords });
|
|
2179
|
+
if (isSimpleFunctionExpression(arg && arg.xpr, additionalKeywords))
|
|
2180
|
+
return this.exprRenderer.renderExpr(arg, env);
|
|
2181
|
+
return this.exprRenderer.renderSubExpr(arg, env);
|
|
2182
|
+
}
|
|
2183
|
+
|
|
2184
|
+
/**
|
|
2185
|
+
* Render an artifact's cardinality.
|
|
2186
|
+
*
|
|
2187
|
+
* @param artifact
|
|
2188
|
+
* @returns {string}
|
|
2189
|
+
*/
|
|
2190
|
+
renderCardinality( artifact ) {
|
|
2191
|
+
if (this.isSimpleCardinality(artifact.cardinality))
|
|
2192
|
+
return this.renderSimpleCardinality(artifact);
|
|
2193
|
+
return this.renderBracketCardinality(artifact);
|
|
2194
|
+
}
|
|
2195
|
+
|
|
2196
|
+
/**
|
|
2197
|
+
* Render a cardinality (only those parts that were actually provided)
|
|
2198
|
+
*
|
|
2199
|
+
* @param {CSN.Artifact} art
|
|
2200
|
+
* @return {string}
|
|
2201
|
+
*/
|
|
2202
|
+
renderBracketCardinality( art ) {
|
|
2203
|
+
const isComp = normalizeTypeRef(art.type) === 'cds.Composition';
|
|
2204
|
+
const suffix = (isComp ? ' of ' : ' to ');
|
|
2205
|
+
const card = art.cardinality;
|
|
2206
|
+
|
|
2207
|
+
if (!card)
|
|
2208
|
+
return suffix;
|
|
2209
|
+
|
|
2210
|
+
let result = '[';
|
|
2211
|
+
if (card.src !== undefined)
|
|
2212
|
+
result += `${ card.src }, `;
|
|
2213
|
+
if (card.min !== undefined)
|
|
2214
|
+
result += `${ card.min }..`;
|
|
2215
|
+
if (card.max !== undefined)
|
|
2216
|
+
result += card.max;
|
|
2217
|
+
// srcmin can't be represented in CDL
|
|
2218
|
+
return `${ result }]${ suffix }`;
|
|
2219
|
+
}
|
|
2220
|
+
|
|
2221
|
+
/**
|
|
2222
|
+
* A "simple" cardinality is one that only has a "max" cardinality property
|
|
2223
|
+
* which is either '*' or 1.
|
|
2224
|
+
*
|
|
2225
|
+
* @param {CSN.Cardinality} cardinality
|
|
2226
|
+
* @return {boolean}
|
|
2227
|
+
*/
|
|
2228
|
+
isSimpleCardinality( cardinality ) {
|
|
2229
|
+
return !cardinality || (
|
|
2230
|
+
cardinality.min === undefined &&
|
|
2231
|
+
cardinality.src === undefined &&
|
|
2232
|
+
cardinality.srcmin === undefined &&
|
|
2233
|
+
(cardinality.max === '*' || cardinality.max === 1)
|
|
2234
|
+
);
|
|
2235
|
+
}
|
|
2236
|
+
|
|
2237
|
+
/**
|
|
2238
|
+
* Renders the simple cardinality of an association/composition, i.e. "many"/"one",
|
|
2239
|
+
* including the "of"/"to" part.
|
|
2240
|
+
*
|
|
2241
|
+
* @param {CSN.Element} elem
|
|
2242
|
+
* @return {string}
|
|
2243
|
+
*/
|
|
2244
|
+
renderSimpleCardinality( elem ) {
|
|
2245
|
+
let result = (normalizeTypeRef(elem.type) === 'cds.Association' ? ' to ' : ' of ');
|
|
2246
|
+
if (!elem.cardinality)
|
|
2247
|
+
return result;
|
|
2248
|
+
if (elem.cardinality.max === '*')
|
|
2249
|
+
result += 'many ';
|
|
2250
|
+
else if (elem.cardinality.max === 1)
|
|
2251
|
+
result += 'one ';
|
|
2252
|
+
return result;
|
|
2253
|
+
}
|
|
2254
|
+
|
|
2255
|
+
renderFilterAndCardinality( s, env ) {
|
|
2256
|
+
let result = '';
|
|
2257
|
+
const cardinality = s.cardinality ? (`${ s.cardinality.max }: `) : '';
|
|
2258
|
+
let filter = '';
|
|
2259
|
+
|
|
2260
|
+
// TODO: Unify with other filter rendering for SELECT
|
|
2261
|
+
if (s.groupBy)
|
|
2262
|
+
filter += ` group by ${ s.groupBy.map((expr, i) => this.exprRenderer.renderExpr(expr, env.withSubPath([ 'groupBy', i ]))).join(', ') }`;
|
|
2263
|
+
if (s.having)
|
|
2264
|
+
filter += ` having ${ this.exprRenderer.renderExpr(s.having, env.withSubPath([ 'having' ])) }`;
|
|
2265
|
+
if (s.orderBy)
|
|
2266
|
+
filter += ` order by ${ s.orderBy.map((entry, i) => this.renderOrderByEntry(entry, env.withSubPath([ 'orderBy', i ]))).join(', ') }`;
|
|
2267
|
+
if (s.limit)
|
|
2268
|
+
filter += ` ${ this.renderLimit(s.limit, env.withSubPath([ 'limit' ])) }`;
|
|
2269
|
+
|
|
2270
|
+
if (s.where) {
|
|
2271
|
+
let where = this.exprRenderer.renderExpr(s.where, env.withSubPath([ 'where' ]));
|
|
2272
|
+
// Special rules in CDS parser: If filter starts with one of these SQL keywords, WHERE is mandatory.
|
|
2273
|
+
if (filter || /^(?:group|having|order|limit)\s/i.test(where))
|
|
2274
|
+
where = ` where ${ where }`;
|
|
2275
|
+
filter = `${ where } ${ filter }`;
|
|
2276
|
+
}
|
|
2277
|
+
|
|
2278
|
+
const hasFilter = filter.length > 0; // filter may be empty after trimming
|
|
2279
|
+
filter = filter.trim();
|
|
2280
|
+
|
|
2281
|
+
if (cardinality || hasFilter) {
|
|
2282
|
+
if (filter.endsWith(']')) // for cases such as [… ![id] ]
|
|
2283
|
+
result += `[ ${ cardinality }${ filter } ]`;
|
|
2284
|
+
else
|
|
2285
|
+
result += `[${ cardinality }${ filter }]`;
|
|
2286
|
+
}
|
|
2287
|
+
return result;
|
|
2288
|
+
}
|
|
2289
|
+
|
|
2290
|
+
renderDefaultExpr( defaultValue, env ) {
|
|
2291
|
+
if (!defaultValue)
|
|
2292
|
+
return '';
|
|
2293
|
+
let result = ' default ';
|
|
2294
|
+
if (defaultValue.xpr && xprContainsCondition( defaultValue.xpr))
|
|
2295
|
+
result += this.exprRenderer.renderSubExpr(withoutCast(defaultValue), env);
|
|
2296
|
+
else
|
|
2297
|
+
result += this.exprRenderer.renderExpr(withoutCast(defaultValue), env);
|
|
2298
|
+
return result;
|
|
2299
|
+
}
|
|
2300
|
+
|
|
2301
|
+
// Render the nullability of an element or parameter (can be unset, true, or false)
|
|
2302
|
+
renderNullability( notNull /* , env */) {
|
|
2303
|
+
if (notNull === undefined) {
|
|
2304
|
+
// Attribute not set at all
|
|
2305
|
+
return '';
|
|
2306
|
+
}
|
|
2307
|
+
return notNull ? ' not null' : ' null';
|
|
2308
|
+
}
|
|
2309
|
+
|
|
2310
|
+
/**
|
|
2311
|
+
* Render foreign keys. We only render foreign keys if necessary or if we can't say for sure
|
|
2312
|
+
* that the foreign keys would match the implicitly generated ones.
|
|
2313
|
+
*
|
|
2314
|
+
* @param {object} art
|
|
2315
|
+
* @param {CdlRenderEnvironment} env
|
|
2316
|
+
* @param {boolean} alwaysRenderForeignKeys
|
|
2317
|
+
* If false, only render foreign keys if necessary (i.e. can't be inferred by compiler again).
|
|
2318
|
+
* @return {string}
|
|
2319
|
+
*/
|
|
2320
|
+
renderForeignKeys( art, env, alwaysRenderForeignKeys = false ) {
|
|
2321
|
+
const renderedKeys = [];
|
|
2322
|
+
let hasAnnotations = false;
|
|
2323
|
+
env = env.withSubPath([ 'keys', -1 ]);
|
|
2324
|
+
env.increaseIndent();
|
|
2325
|
+
|
|
2326
|
+
for (let i = 0; i < art.keys.length; ++i) {
|
|
2327
|
+
env.path[env.path.length - 1] = i;
|
|
2328
|
+
const fKey = art.keys[i];
|
|
2329
|
+
|
|
2330
|
+
const annos = this.renderAnnotationAssignmentsAndDocComment(fKey, env).trim();
|
|
2331
|
+
if (annos) {
|
|
2332
|
+
hasAnnotations = true;
|
|
2333
|
+
renderedKeys.push(annos);
|
|
2334
|
+
}
|
|
2335
|
+
|
|
2336
|
+
const alias = fKey.as ? this.renderAlias(fKey.as, env) : '';
|
|
2337
|
+
const key = this.exprRenderer.renderExpr(fKey, env);
|
|
2338
|
+
renderedKeys.push(`${ key }${ alias },`);
|
|
2339
|
+
}
|
|
2340
|
+
|
|
2341
|
+
// Annotations on foreign keys always require rendering of explicit keys.
|
|
2342
|
+
// Otherwise, we'd have to use annotate statements here.
|
|
2343
|
+
if (hasAnnotations) {
|
|
2344
|
+
const sep = `\n${ env.indent }`;
|
|
2345
|
+
env.decreaseIndent();
|
|
2346
|
+
return `{${ sep }${ renderedKeys.join(sep) }\n${ env.indent }}`;
|
|
2347
|
+
}
|
|
2348
|
+
|
|
2349
|
+
if (!alwaysRenderForeignKeys && this.foreignKeysMatchImplicitOnes( art ))
|
|
2350
|
+
return '';
|
|
2351
|
+
|
|
2352
|
+
let result = renderedKeys.join(' ');
|
|
2353
|
+
if (result[result.length - 1] === ',') // remove trailing comma
|
|
2354
|
+
result = result.slice(0, -1);
|
|
2355
|
+
return `{ ${ result } }`;
|
|
2356
|
+
}
|
|
2357
|
+
|
|
2358
|
+
/**
|
|
2359
|
+
* Returns true, if `to.cdl()` could leave out explicit foreign keys in the rendered output
|
|
2360
|
+
* without changing recompilation. We do so, because explicit foreign keys are not promoted
|
|
2361
|
+
* on CAPire.
|
|
2362
|
+
*
|
|
2363
|
+
* @param {CSN.Artifact} art
|
|
2364
|
+
* @returns {boolean}
|
|
2365
|
+
*/
|
|
2366
|
+
foreignKeysMatchImplicitOnes( art ) {
|
|
2367
|
+
if (art.cardinality && art.cardinality.max !== 1)
|
|
2368
|
+
return false; // e.g. to-many assocs
|
|
2369
|
+
|
|
2370
|
+
const target = this.csn.definitions[art.target];
|
|
2371
|
+
if (!art.keys?.length || !art.target || !target?.elements)
|
|
2372
|
+
return false;
|
|
2373
|
+
|
|
2374
|
+
// We could improve to.cdl() to properly check if keys match, but then we'd have to look
|
|
2375
|
+
// at sub-elements, structures, etc.; for now, we only check “simple” foreign keys that
|
|
2376
|
+
// don't have any alias.
|
|
2377
|
+
const hasComplexKeys = art.keys.some(key => key.ref?.length !== 1 || key.as !== undefined);
|
|
2378
|
+
if (hasComplexKeys)
|
|
2379
|
+
return false;
|
|
2380
|
+
|
|
2381
|
+
const targetKeys = Object.keys(target.elements).filter(name => target.elements[name]?.key);
|
|
2382
|
+
if (targetKeys.length === 0)
|
|
2383
|
+
return false; // always require explicit keys if there are no target side keys
|
|
2384
|
+
|
|
2385
|
+
const foreignKeys = art.keys.map(key => key.ref[0]);
|
|
2386
|
+
if (foreignKeys.length !== targetKeys.length)
|
|
2387
|
+
return false;
|
|
2388
|
+
|
|
2389
|
+
// We require the _same_ order! Otherwise, recompilation would change the generated foreign key order!
|
|
2390
|
+
for (let i = 0; i < foreignKeys.length; ++i) {
|
|
2391
|
+
if (foreignKeys[i] !== targetKeys[i])
|
|
2392
|
+
return false;
|
|
2393
|
+
}
|
|
2394
|
+
return true;
|
|
2395
|
+
}
|
|
2396
|
+
|
|
2397
|
+
/**
|
|
2398
|
+
* Render an explicit alias, e.g. for columns.
|
|
2399
|
+
*
|
|
2400
|
+
* @param {string} alias
|
|
2401
|
+
* @param {CdlRenderEnvironment} env
|
|
2402
|
+
* @return {string}
|
|
2403
|
+
*/
|
|
2404
|
+
renderAlias( alias, env ) {
|
|
2405
|
+
return ` as ${ this.quoteNonIdentifierOrKeyword(alias, env) }`;
|
|
2406
|
+
}
|
|
2407
|
+
|
|
2408
|
+
/**
|
|
2409
|
+
* Render (primitive) type parameters of artifact 'artWithType', i.e.
|
|
2410
|
+
* length, precision and scale (even if incomplete), plus any other unknown ones.
|
|
2411
|
+
*
|
|
2412
|
+
* @param {CSN.Artifact} artWithType
|
|
2413
|
+
* @param {boolean} noShortVersion If true, parameters will not be shortened, e.g. `(10)`
|
|
2414
|
+
* for length instead of `(length: 10)`.
|
|
2415
|
+
* @returns {string}
|
|
2416
|
+
*/
|
|
2417
|
+
renderTypeParameters( artWithType, noShortVersion = false ) {
|
|
2418
|
+
const params = typeParameters.list.filter(param => artWithType[param] !== undefined);
|
|
2419
|
+
if (params.length === 0)
|
|
2420
|
+
return '';
|
|
2421
|
+
|
|
2422
|
+
if (!noShortVersion) {
|
|
2423
|
+
// Special cases for 1 or 2 arguments.
|
|
2424
|
+
if (params.length === 1 && artWithType.length !== undefined)
|
|
2425
|
+
return `(${ artWithType.length })`;
|
|
2426
|
+
if (params.length === 2 && artWithType.precision !== undefined && artWithType.scale !== undefined)
|
|
2427
|
+
return `(${ artWithType.precision }, ${ artWithType.scale })`;
|
|
2428
|
+
}
|
|
2429
|
+
|
|
2430
|
+
// Render named params
|
|
2431
|
+
const renderedParams = [];
|
|
2432
|
+
for (const param of params)
|
|
2433
|
+
renderedParams.push(`${ param }: ${ artWithType[param] }`);
|
|
2434
|
+
|
|
2435
|
+
return `(${ renderedParams.join(', ') })`;
|
|
2436
|
+
}
|
|
2437
|
+
|
|
2438
|
+
/**
|
|
2439
|
+
* Render all annotation assignments of annotatable object 'obj'.
|
|
2440
|
+
*
|
|
2441
|
+
* @param {object} obj Object that has annotations
|
|
2442
|
+
* @param {CdlRenderEnvironment} env
|
|
2443
|
+
* @param {{parentheses: boolean}} [config] Config for renderAnnotationAssignment()
|
|
2444
|
+
* @return {string}
|
|
2445
|
+
*/
|
|
2446
|
+
renderAnnotationAssignmentsAndDocComment( obj, env, config ) {
|
|
2447
|
+
let result = this.renderDocComment(obj, env);
|
|
2448
|
+
for (const name in obj) {
|
|
2449
|
+
if (name.startsWith('@'))
|
|
2450
|
+
result += this.renderAnnotationAssignment(obj[name], name, env.withSubPath([ name ]), config);
|
|
2451
|
+
}
|
|
2452
|
+
return result;
|
|
2453
|
+
}
|
|
2454
|
+
|
|
2455
|
+
/**
|
|
2456
|
+
* Render a single annotation assignment 'anno' with fully qualified name 'name' (no trailing LF).
|
|
2457
|
+
* We might see variants like 'A.B.C#foo' or even 'A.B#foo.C'. The latter needs to be quoted as
|
|
2458
|
+
* dots in the variant are not recognized by the compiler.
|
|
2459
|
+
*
|
|
2460
|
+
* @param {any} anno Annotation value
|
|
2461
|
+
* @param {string} name Annotation name, e.g. `@A.B.C#foo.C`
|
|
2462
|
+
* @param {CdlRenderEnvironment} env
|
|
2463
|
+
* @param {object} [config] parentheses: Whether the annotation assignment must be surrounded by parentheses.
|
|
2464
|
+
* @return {string} Rendered annotation, possibly quoted: `@![A.B.C#foo.C]: value`
|
|
2465
|
+
*/
|
|
2466
|
+
renderAnnotationAssignment( anno, name, env, config = { parentheses: false } ) {
|
|
2467
|
+
name = name.substring(1);
|
|
2468
|
+
// Take the annotation assignment apart into <nameBeforeVariant>#<variantAndRest>
|
|
2469
|
+
const parts = name.split('#');
|
|
2470
|
+
let nameBeforeVariant = parts[0];
|
|
2471
|
+
const variant = parts.length > 1 ? parts.slice(1).join('#') : undefined;
|
|
2472
|
+
const { parentheses } = config;
|
|
2473
|
+
|
|
2474
|
+
let result = `${ env.indent }@`;
|
|
2475
|
+
if (parentheses)
|
|
2476
|
+
result += '(';
|
|
2477
|
+
|
|
2478
|
+
// if the variant is empty, render '#' as part of the name, e.g `variant !== undefined`.
|
|
2479
|
+
if (variant === '')
|
|
2480
|
+
nameBeforeVariant += '#';
|
|
2481
|
+
|
|
2482
|
+
result += this.quoteAnnotationPathIfRequired(nameBeforeVariant, env);
|
|
2483
|
+
|
|
2484
|
+
if (variant !== undefined && variant !== '') {
|
|
2485
|
+
// Unfortunately, the compiler does not allow `.@` after the first variant identifier,
|
|
2486
|
+
// nor multiple `#`, so we're back at simple paths that are possibly quoted.
|
|
2487
|
+
result += `#${ this.quotePathIfRequired(variant, env) }`;
|
|
2488
|
+
}
|
|
2489
|
+
result += ` : ${ this.renderAnnotationValue(anno, env, true) }`;
|
|
2490
|
+
|
|
2491
|
+
if (parentheses)
|
|
2492
|
+
result += ')';
|
|
2493
|
+
return `${ result }\n`;
|
|
2494
|
+
}
|
|
2495
|
+
|
|
2496
|
+
/**
|
|
2497
|
+
* Render the name of an artifact, quote path steps if necessary.
|
|
2498
|
+
*
|
|
2499
|
+
* @param {string} artifactName Artifact name to render
|
|
2500
|
+
* @param {CdlRenderEnvironment} env
|
|
2501
|
+
* @return {string} Artifact name ready for rendering
|
|
2502
|
+
*/
|
|
2503
|
+
renderArtifactName( artifactName, env ) {
|
|
2504
|
+
return this.quotePathIfRequired(env.nameEnvStack.definitionName(artifactName), env);
|
|
2505
|
+
}
|
|
2506
|
+
|
|
2507
|
+
/**
|
|
2508
|
+
* Render the name of a definition. Ensures the first segment of the name
|
|
2509
|
+
* is available in the rendered CDL. Otherwise, a USING is added.
|
|
2510
|
+
*
|
|
2511
|
+
* @param {string} name
|
|
2512
|
+
* @param {CdlRenderEnvironment} env
|
|
2513
|
+
* @return {string}
|
|
2514
|
+
*/
|
|
2515
|
+
renderDefinitionReference( name, env ) {
|
|
2516
|
+
if (name === '$self' && !this.csn.definitions.$self)
|
|
2517
|
+
return '$self';
|
|
2518
|
+
name = env.nameEnvStack.definitionReference(name);
|
|
2519
|
+
return this.quotePathIfRequired(name, env);
|
|
2520
|
+
}
|
|
2521
|
+
|
|
2522
|
+
/**
|
|
2523
|
+
* @param {string[]} includes
|
|
2524
|
+
* @param {CdlRenderEnvironment} env
|
|
2525
|
+
* @return {string}
|
|
2526
|
+
*/
|
|
2527
|
+
renderIncludes( includes, env ) {
|
|
2528
|
+
return ` : ${ includes.map((name, i) => this.renderDefinitionReference(name, env.withSubPath([ 'includes', i ]))).join(', ') }`;
|
|
2529
|
+
}
|
|
2530
|
+
|
|
2531
|
+
createCdlExpressionRenderer() {
|
|
2532
|
+
const that = this;
|
|
2533
|
+
return createExpressionRenderer({
|
|
2534
|
+
finalize: x => x,
|
|
2535
|
+
typeCast(x) {
|
|
2536
|
+
const typeRef = that.renderTypeReferenceAndProps(x.cast, this.env.withSubPath([ 'cast' ]), { typeRefOnly: true, noAnnoCollect: true });
|
|
2537
|
+
const arg = { ...x, cast: null }; // "arg" without cast to avoid recursion.
|
|
2538
|
+
return `cast(${ that.renderArgument(arg, this.env) } as ${ typeRef })`;
|
|
2539
|
+
},
|
|
2540
|
+
val(x) {
|
|
2541
|
+
// Literal value, possibly with explicit 'literal' property
|
|
2542
|
+
switch (x.literal || typeof x.val) {
|
|
2543
|
+
case 'number':
|
|
2544
|
+
case 'boolean':
|
|
2545
|
+
case 'null':
|
|
2546
|
+
return x.val;
|
|
2547
|
+
case 'x':
|
|
2548
|
+
case 'date':
|
|
2549
|
+
case 'time':
|
|
2550
|
+
case 'timestamp':
|
|
2551
|
+
return `${ x.literal }'${ x.val }'`;
|
|
2552
|
+
case 'string':
|
|
2553
|
+
return renderString(x.val, this.env);
|
|
2554
|
+
case 'object':
|
|
2555
|
+
if (x.val === null)
|
|
2556
|
+
return 'null';
|
|
2557
|
+
// otherwise fall through to
|
|
2558
|
+
default:
|
|
2559
|
+
throw new ModelError(`Unknown literal or type: ${ JSON.stringify(x) }`);
|
|
2560
|
+
}
|
|
2561
|
+
},
|
|
2562
|
+
enum: x => `#${ x['#'] }`,
|
|
2563
|
+
ref(x) {
|
|
2564
|
+
return `${ x.param ? ':' : '' }${ x.ref.map((step, index) => that.renderPathStep(step, index, this.env.withSubPath([ 'ref', index ]))).join('.') }`;
|
|
2565
|
+
},
|
|
2566
|
+
windowFunction(x) {
|
|
2567
|
+
const funcDef = this.func(x);
|
|
2568
|
+
return `${ funcDef } ${ this.renderExpr(x.xpr, this.env.withSubPath([ 'xpr' ])) }`; // xpr[0] is 'over'
|
|
2569
|
+
},
|
|
2570
|
+
func(x) {
|
|
2571
|
+
if (keywords.cdl_functions.includes(x.func.toUpperCase()) && !x.args)
|
|
2572
|
+
return x.func;
|
|
2573
|
+
const name = that.quoteFunctionIfRequired(x.func, this.env);
|
|
2574
|
+
if (!x.args) // e.g. for methods without arguments, `args` is not set at all.
|
|
2575
|
+
return `${ name }`;
|
|
2576
|
+
return `${ name }(${ that.renderArguments( x, '=>', this.env ) })`;
|
|
2577
|
+
},
|
|
2578
|
+
xpr(x) {
|
|
2579
|
+
const xprEnv = this.env.withSubPath([ 'xpr' ]);
|
|
2580
|
+
if (this.isNestedXpr && !x.cast)
|
|
2581
|
+
return `(${ this.renderExpr(x.xpr, xprEnv) })`;
|
|
2582
|
+
return this.renderExpr(x.xpr, xprEnv);
|
|
2583
|
+
},
|
|
2584
|
+
// Sub-queries in expressions need to be in parentheses, otherwise
|
|
2585
|
+
// left-associativity of UNIONS may result in different results.
|
|
2586
|
+
// For example: `select from E where id in (select from E union select from E);`:
|
|
2587
|
+
// Without parentheses, it would be different query.
|
|
2588
|
+
SET(x) {
|
|
2589
|
+
return `(${ that.renderQuery(x, false, 'view', this.env.withIncreasedIndent()) })`;
|
|
2590
|
+
},
|
|
2591
|
+
SELECT(x) {
|
|
2592
|
+
return `(${ that.renderQuery(x, false, 'view', this.env.withIncreasedIndent()) })`;
|
|
2593
|
+
},
|
|
2594
|
+
});
|
|
2595
|
+
}
|
|
2596
|
+
|
|
2597
|
+
// checks -------------------------------------------------------------------
|
|
2598
|
+
// The CDL backend has very few checks, but we need to tell the user if
|
|
2599
|
+
// something can't be rendered.
|
|
2600
|
+
|
|
2601
|
+
/**
|
|
2602
|
+
* If an artifact is an array via `.items`, some properties on `art` can't be rendered,
|
|
2603
|
+
* for example "not null", because there is no CDL representation for it. Only "not null"
|
|
2604
|
+
* on `.items` can be rendered.
|
|
2605
|
+
*
|
|
2606
|
+
* Furthermore, to.cdl() can only render one nesting level of `items`. `items` inside
|
|
2607
|
+
* `items, etc. can't be represented in CDL, hence can't be rendered.
|
|
2608
|
+
*
|
|
2609
|
+
* @param {CSN.Artifact} art
|
|
2610
|
+
* @param {CdlRenderEnvironment} env
|
|
2611
|
+
*/
|
|
2612
|
+
checkArrayedArtifact( art, env ) {
|
|
2613
|
+
if (!art.items)
|
|
2614
|
+
return;
|
|
2615
|
+
if (art.notNull !== undefined) {
|
|
2616
|
+
this.msg.warning('def-unexpected-nullability', env.path, { prop: 'not null', otherprop: 'items' },
|
|
2617
|
+
'Property $(PROP) not rendered, because it can only be rendered inside $(OTHERPROP) for arrayed artifacts');
|
|
2618
|
+
}
|
|
2619
|
+
|
|
2620
|
+
if (art.items.items && !art.items.type)
|
|
2621
|
+
this.msg.message('type-invalid-items', [ ...env.path, 'items' ], { '#': 'nested', prop: 'items' } );
|
|
2622
|
+
|
|
2623
|
+
const type = art.items.type && normalizeTypeRef(art.items.type);
|
|
2624
|
+
if (type === 'cds.Association' || type === 'cds.Composition') {
|
|
2625
|
+
// check for `art.items.target` not sufficient; could be indirect type reference
|
|
2626
|
+
const isComp = type === 'cds.Composition';
|
|
2627
|
+
this.msg.message('type-invalid-items', [ ...env.path, 'items' ], { '#': isComp ? 'comp' : 'assoc', prop: 'items' });
|
|
2628
|
+
}
|
|
2629
|
+
}
|
|
2630
|
+
|
|
2631
|
+
/**
|
|
2632
|
+
* Quote simple path steps with `![]` if necessary. For simple ids such as
|
|
2633
|
+
* `elem` use `quoteNonIdentifierOrKeyword` instead.
|
|
2634
|
+
*
|
|
2635
|
+
* In contrast to quoteNonIdentifierOrKeyword, does not handle additional keywords,
|
|
2636
|
+
* because it was not required, yet.
|
|
2637
|
+
*
|
|
2638
|
+
* Due to token rewrite, all keywords after a dot (`.`) are rewritten to
|
|
2639
|
+
* identifiers, i.e. we only need to check for the identifier RegEx.
|
|
2640
|
+
*
|
|
2641
|
+
* @param {string} path
|
|
2642
|
+
* @param {CdlRenderEnvironment} env
|
|
2643
|
+
* @returns {string}
|
|
2644
|
+
*/
|
|
2645
|
+
quotePathIfRequired( path, env ) {
|
|
2646
|
+
return path.split('.').map((step, index) => {
|
|
2647
|
+
if (index === 0)
|
|
2648
|
+
return this.quoteNonIdentifierOrKeyword(step, env);
|
|
2649
|
+
else if (!undelimitedIdentifierRegex.test(step))
|
|
2650
|
+
return this.delimitedId(step, env);
|
|
2651
|
+
return step;
|
|
2652
|
+
}).join('.');
|
|
2653
|
+
}
|
|
2654
|
+
|
|
2655
|
+
/**
|
|
2656
|
+
* Quote the id with `![]` if necessary. For paths such as `E.key` use
|
|
2657
|
+
* `quotePathIfRequired` instead.
|
|
2658
|
+
* See quoteNonIdentifier() if you want to ignore keywords.
|
|
2659
|
+
*
|
|
2660
|
+
* Set env.additionalKeywords to an array of UPPERCASE keywords
|
|
2661
|
+
* that also need quoting, e.g. in special functions.
|
|
2662
|
+
*
|
|
2663
|
+
* @param {string} id
|
|
2664
|
+
* @param {CdlRenderEnvironment} env
|
|
2665
|
+
* @return {string}
|
|
2666
|
+
*/
|
|
2667
|
+
quoteNonIdentifierOrKeyword( id, env ) {
|
|
2668
|
+
// Quote if required for CDL
|
|
2669
|
+
if (requiresQuotingForCdl(id, env?.additionalKeywords || []))
|
|
2670
|
+
return this.delimitedId(id, env);
|
|
2671
|
+
return id;
|
|
2672
|
+
}
|
|
2673
|
+
|
|
2674
|
+
/**
|
|
2675
|
+
* Quote the id with `![]` if necessary. For paths such as `E.key` use
|
|
2676
|
+
* `quotePathIfRequired` instead.
|
|
2677
|
+
* See quoteNonIdentifierOrKeyword() if you want to quote identifiers
|
|
2678
|
+
* that are keywords as well.
|
|
2679
|
+
*
|
|
2680
|
+
* Does not quote the given id if it is a keyword.
|
|
2681
|
+
*
|
|
2682
|
+
* @param {string} id
|
|
2683
|
+
* @param {CdlRenderEnvironment} env
|
|
2684
|
+
* @return {string}
|
|
2685
|
+
*/
|
|
2686
|
+
quoteNonIdentifier( id, env ) {
|
|
2687
|
+
if (!undelimitedIdentifierRegex.test(id))
|
|
2688
|
+
return this.delimitedId(id, env);
|
|
2689
|
+
return id;
|
|
2690
|
+
}
|
|
2691
|
+
|
|
2692
|
+
/**
|
|
2693
|
+
* Quote the given function name if required.
|
|
2694
|
+
*
|
|
2695
|
+
* @param {string} funcName
|
|
2696
|
+
* @param {CdlRenderEnvironment} env
|
|
2697
|
+
* @return {string}
|
|
2698
|
+
*/
|
|
2699
|
+
quoteFunctionIfRequired( funcName, env ) {
|
|
2700
|
+
if (cdlNewLineRegEx.test(funcName)) {
|
|
2701
|
+
this.msg.error('name-invalid-identifier', env.path, {},
|
|
2702
|
+
'An identifier can\'t contain newline characters in CDL');
|
|
2703
|
+
}
|
|
2704
|
+
return apiSmartFunctionId(funcName);
|
|
2705
|
+
}
|
|
2706
|
+
|
|
2707
|
+
/**
|
|
2708
|
+
* Quote an annotation path, e.g. `@My.@Anno.Description` if necessary.
|
|
2709
|
+
* `anno` can start with `@` but is not required to be.
|
|
2710
|
+
* Example of an annotation path that needs to be quoted:
|
|
2711
|
+
* `@![ spaces in path ].@!["double quotes"]`.
|
|
2712
|
+
*
|
|
2713
|
+
* @param {string} anno
|
|
2714
|
+
* @param {CdlRenderEnvironment} env
|
|
2715
|
+
* @returns {string}
|
|
2716
|
+
*/
|
|
2717
|
+
quoteAnnotationPathIfRequired( anno, env ) {
|
|
2718
|
+
return anno.split('.').map((segment) => {
|
|
2719
|
+
if (segment.startsWith('@'))
|
|
2720
|
+
return `@${ this.quoteNonIdentifier(segment.slice(1), env) }`;
|
|
2721
|
+
return this.quoteNonIdentifier(segment, env);
|
|
2722
|
+
}).join('.');
|
|
2723
|
+
}
|
|
2724
|
+
|
|
2725
|
+
/**
|
|
2726
|
+
* The same as the exported function apiDelimitedId, but checks that we can actually represent the
|
|
2727
|
+
* string: newline characters are not allowed.
|
|
2728
|
+
*
|
|
2729
|
+
* @param {string} id
|
|
2730
|
+
* @param {CdlRenderEnvironment} env
|
|
2731
|
+
* @return {string}
|
|
2732
|
+
*/
|
|
2733
|
+
delimitedId( id, env ) {
|
|
2734
|
+
if (cdlNewLineRegEx.test(id)) {
|
|
2735
|
+
this.msg.error('name-invalid-identifier', env.path, {},
|
|
2736
|
+
'An identifier can\'t contain newline characters in CDL');
|
|
2737
|
+
}
|
|
2738
|
+
return apiDelimitedId(id);
|
|
2739
|
+
}
|
|
2740
|
+
}
|
|
2741
|
+
|
|
2742
|
+
class CdlRenderEnvironment {
|
|
2743
|
+
indent = '';
|
|
2744
|
+
path = null;
|
|
2745
|
+
elementName = null;
|
|
2746
|
+
additionalKeywords = [];
|
|
2747
|
+
nameEnvStack = new NameScopeStack();
|
|
2748
|
+
|
|
2749
|
+
constructor(values) {
|
|
2750
|
+
Object.assign(this, values);
|
|
2751
|
+
}
|
|
2752
|
+
|
|
2753
|
+
increaseIndent() {
|
|
2754
|
+
this.indent = ` ${ this.indent }`;
|
|
2755
|
+
}
|
|
2756
|
+
decreaseIndent() {
|
|
2757
|
+
this.indent = this.indent.substring(0, this.indent.length - INDENT_SIZE);
|
|
2758
|
+
}
|
|
2759
|
+
withIncreasedIndent() {
|
|
2760
|
+
const indent = ' '.repeat(this.indent.length + INDENT_SIZE);
|
|
2761
|
+
return new CdlRenderEnvironment({ ...this, indent });
|
|
2762
|
+
}
|
|
2763
|
+
withSubPath(path) {
|
|
2764
|
+
return new CdlRenderEnvironment({ ...this, path: [ ...this.path, ...path ] });
|
|
2765
|
+
}
|
|
2766
|
+
cloneWith(values) {
|
|
2767
|
+
return Object.assign(new CdlRenderEnvironment(this), values);
|
|
2768
|
+
}
|
|
2769
|
+
}
|
|
2770
|
+
|
|
2771
|
+
|
|
2772
|
+
/**
|
|
2773
|
+
* Returns a newly created default environment (which keeps track of indentation, required USING
|
|
2774
|
+
* declarations and name prefixes.
|
|
2775
|
+
*
|
|
2776
|
+
* @param {object} [values]
|
|
2777
|
+
* @return {CdlRenderEnvironment}
|
|
2778
|
+
*/
|
|
2779
|
+
function createEnv( values = {} ) {
|
|
2780
|
+
return new CdlRenderEnvironment( values );
|
|
2781
|
+
}
|
|
2782
|
+
|
|
2783
|
+
/**
|
|
2784
|
+
* Remove a trailing `\n`/newline/LF from `str` and return the modified string.
|
|
2785
|
+
* Useful if you want to append a `;` to the string, but not on a separate line.
|
|
2786
|
+
*
|
|
2787
|
+
* @param {string} str
|
|
2788
|
+
* @return {string}
|
|
2789
|
+
*/
|
|
2790
|
+
function removeTrailingNewline( str ) {
|
|
2791
|
+
if (str[str.length - 1] === '\n')
|
|
2792
|
+
str = str.substring(0, str.length - 1);
|
|
2793
|
+
return str;
|
|
2794
|
+
}
|
|
2795
|
+
|
|
2796
|
+
/**
|
|
2797
|
+
* Returns true if 'id' requires quotes for CDL, i.e. if 'id'
|
|
2798
|
+
* does not match the first part of the `ident` rule of `lib/parsers/Lexer.js`
|
|
2799
|
+
* or if 'id' is a reserved keyword.
|
|
2800
|
+
*
|
|
2801
|
+
* Set additionalKeywords to an array of UPPERCASE keywords
|
|
2802
|
+
* that also need quoting, e.g. in special functions.
|
|
2803
|
+
*
|
|
2804
|
+
* @param {string} id
|
|
2805
|
+
* @param {string[]} [additionalKeywords]
|
|
2806
|
+
* @return {boolean}
|
|
2807
|
+
*/
|
|
2808
|
+
function requiresQuotingForCdl( id, additionalKeywords ) {
|
|
2809
|
+
return !undelimitedIdentifierRegex.test(id) ||
|
|
2810
|
+
keywords.cdl.includes(id.toUpperCase()) ||
|
|
2811
|
+
keywords.cdl_functions.includes(id.toUpperCase()) ||
|
|
2812
|
+
additionalKeywords.includes(id.toUpperCase());
|
|
2813
|
+
}
|
|
2814
|
+
|
|
2815
|
+
/**
|
|
2816
|
+
* Returns true if the given type is an association or composition,
|
|
2817
|
+
* without type indirection.
|
|
2818
|
+
*
|
|
2819
|
+
* @param {string|string[]} type
|
|
2820
|
+
* @return {boolean}
|
|
2821
|
+
*/
|
|
2822
|
+
|
|
2823
|
+
function isDirectAssocOrComp( type ) {
|
|
2824
|
+
type = normalizeTypeRef(type);
|
|
2825
|
+
return (type === 'cds.Association' || type === 'cds.Composition');
|
|
2826
|
+
}
|
|
2827
|
+
|
|
2828
|
+
const conditionOperators = [
|
|
2829
|
+
// Antlr rule 'condition', 'conditionAnd'
|
|
2830
|
+
'AND', 'OR',
|
|
2831
|
+
|
|
2832
|
+
// redepage CdlGrammar.g4 rule 'expression'
|
|
2833
|
+
'=', '<>', '>', '>=', '<', '<=', '==', '!=',
|
|
2834
|
+
// These are not forbidden, since they must be preceded by one of the comparators above.
|
|
2835
|
+
// 'any', 'some', 'all',
|
|
2836
|
+
|
|
2837
|
+
'IS', 'IN', 'NOT', 'NULL', 'EXISTS',
|
|
2838
|
+
// Antlr rule 'predicate'
|
|
2839
|
+
'BETWEEN', 'LIKE', 'ESCAPE',
|
|
2840
|
+
];
|
|
2841
|
+
|
|
2842
|
+
/**
|
|
2843
|
+
* Returns true if the given xpr-array can be rendered without parentheses
|
|
2844
|
+
* in a `fct(<xpr>)` expression such as `cast(<xpr> as Type)`. We only need to
|
|
2845
|
+
* look at the first nesting level. Otherwise, `renderExpr()` will already add parentheses.
|
|
2846
|
+
*
|
|
2847
|
+
* The list of `conditionOperators` was created by looking at the `expression` Antlr rule.
|
|
2848
|
+
* Because of token-rewrites, there are functions that allow operators/tokens that would
|
|
2849
|
+
* require parentheses in other functions. For example *regex functions allow `IN` but
|
|
2850
|
+
* if `IN` is used in other functions, it requires parentheses. To allow for that case,
|
|
2851
|
+
* you can set `additionalAllowedKeywords` to list of tokens that are allowed.
|
|
2852
|
+
*
|
|
2853
|
+
* Note that this is more of a heuristic for "nicer" CDL output. For example the
|
|
2854
|
+
* following snippet is parsable without parentheses:
|
|
2855
|
+
* `cast( case when int > 1 then int else 0 end as Integer ),`
|
|
2856
|
+
* However, because it is a flat xpr-array, we see `>` and assume that it is not
|
|
2857
|
+
* a simple expression.
|
|
2858
|
+
*
|
|
2859
|
+
* @param {any[]} xpr
|
|
2860
|
+
* @param {string[]} additionalAllowedKeywords
|
|
2861
|
+
* @return {boolean}
|
|
2862
|
+
*/
|
|
2863
|
+
function isSimpleFunctionExpression( xpr, additionalAllowedKeywords = [] ) {
|
|
2864
|
+
return !xpr || xpr.every(val => typeof val !== 'string' ||
|
|
2865
|
+
(additionalAllowedKeywords.includes(val.toUpperCase()) ||
|
|
2866
|
+
!conditionOperators.includes(val.toUpperCase())));
|
|
2867
|
+
}
|
|
2868
|
+
|
|
2869
|
+
/**
|
|
2870
|
+
* If `xpr` contains tokens that are used in conditions, it may be required to put the
|
|
2871
|
+
* rendered expression in parentheses. This function checks if any direct entry in
|
|
2872
|
+
* `xpr` is a condition token such as `AND`.
|
|
2873
|
+
*
|
|
2874
|
+
* May report false positives for e.g. `CASE WHEN 1>1 THEN …`.
|
|
2875
|
+
*
|
|
2876
|
+
* @param {any[]} xpr
|
|
2877
|
+
* @return {boolean}
|
|
2878
|
+
*/
|
|
2879
|
+
function xprContainsCondition( xpr ) {
|
|
2880
|
+
return xpr && xpr.some(val => typeof val === 'string' &&
|
|
2881
|
+
conditionOperators.includes(val.toUpperCase()));
|
|
2882
|
+
}
|
|
2883
|
+
|
|
2884
|
+
/**
|
|
2885
|
+
* Special functions may have special parser rules, such as SAP HANA RegEx functions.
|
|
2886
|
+
* They allow certain keywords in their arguments.
|
|
2887
|
+
*
|
|
2888
|
+
* This function is used to determine if arguments need to be put in parentheses or not.
|
|
2889
|
+
* See {@link isSimpleFunctionExpression}.
|
|
2890
|
+
*
|
|
2891
|
+
* @param {string} funcName
|
|
2892
|
+
* @param {number} argumentIndex
|
|
2893
|
+
* @returns {string[]}
|
|
2894
|
+
*/
|
|
2895
|
+
function getKeywordsForSpecialFunctionArgument( funcName, argumentIndex ) {
|
|
2896
|
+
const f = specialFunctions[funcName] && specialFunctions[funcName][argumentIndex];
|
|
2897
|
+
if (!f)
|
|
2898
|
+
return [];
|
|
2899
|
+
const additionalKeywords = [];
|
|
2900
|
+
if (f.intro)
|
|
2901
|
+
additionalKeywords.push(...f.intro);
|
|
2902
|
+
if (f.expr)
|
|
2903
|
+
additionalKeywords.push(...f.expr);
|
|
2904
|
+
if (f.separator)
|
|
2905
|
+
additionalKeywords.push(...f.separator);
|
|
2906
|
+
return additionalKeywords;
|
|
2907
|
+
}
|
|
2908
|
+
|
|
2909
|
+
/**
|
|
2910
|
+
* Get a list of all special keywords for the given function.
|
|
2911
|
+
*
|
|
2912
|
+
* @param {string} funcName
|
|
2913
|
+
* @return {undefined|string[]}
|
|
2914
|
+
*/
|
|
2915
|
+
function getAllKeywordsForSpecialFunction( funcName ) {
|
|
2916
|
+
if (specialFunctionKeywords[funcName])
|
|
2917
|
+
return specialFunctionKeywords[funcName];
|
|
2918
|
+
else if (!specialFunctions[funcName])
|
|
2919
|
+
return undefined;
|
|
2920
|
+
|
|
2921
|
+
const additionalKeywords = [];
|
|
2922
|
+
for (const arg of specialFunctions[funcName]) {
|
|
2923
|
+
if (arg.intro)
|
|
2924
|
+
additionalKeywords.push(...arg.intro);
|
|
2925
|
+
if (arg.expr)
|
|
2926
|
+
additionalKeywords.push(...arg.expr);
|
|
2927
|
+
if (arg.separator)
|
|
2928
|
+
additionalKeywords.push(...arg.separator);
|
|
2929
|
+
}
|
|
2930
|
+
specialFunctionKeywords[funcName] = additionalKeywords;
|
|
2931
|
+
return additionalKeywords;
|
|
2932
|
+
}
|
|
2933
|
+
|
|
2934
|
+
/**
|
|
2935
|
+
* Render the given string. Uses back-tick strings.
|
|
2936
|
+
* env is used for indentation of three-back-tick strings.
|
|
2937
|
+
*
|
|
2938
|
+
* @param {string} str
|
|
2939
|
+
* @param {CdlRenderEnvironment} env
|
|
2940
|
+
* @returns {string}
|
|
2941
|
+
*/
|
|
2942
|
+
function renderString( str, env ) {
|
|
2943
|
+
if (isSimpleString(str))
|
|
2944
|
+
return `'${ str.replace(/'/g, '\'\'') }'`;
|
|
2945
|
+
|
|
2946
|
+
// We try to work similar to how JavaScript implements JSON.stringify.
|
|
2947
|
+
// JSON.stringify() also checks for unpaired unicode surrogates (see §25.5.2.2,
|
|
2948
|
+
// <https://tc39.es/ecma262/#sec-quotejsonstring>).
|
|
2949
|
+
str = escapeString(str, {
|
|
2950
|
+
$: '\\$',
|
|
2951
|
+
'`': '\\`',
|
|
2952
|
+
'\\': '\\\\',
|
|
2953
|
+
// Replace commonly known escape sequences for control characters
|
|
2954
|
+
// See lib/language/multiLineStringParser.js
|
|
2955
|
+
'\f': '\\f',
|
|
2956
|
+
'\v': '\\v',
|
|
2957
|
+
'\t': '\\t',
|
|
2958
|
+
'\b': '\\b',
|
|
2959
|
+
// If CR, LS, or PS appear, they have been encoded explicitly. If we don't escape
|
|
2960
|
+
// them, a recompilation may yield different results because of newline normalization.
|
|
2961
|
+
'\r': '\\r',
|
|
2962
|
+
'\u{2028}': '\\u{2028}',
|
|
2963
|
+
'\u{2029}': '\\u{2029}',
|
|
2964
|
+
// Don't encode LF
|
|
2965
|
+
'\n': '\n',
|
|
2966
|
+
// JSON.stringify() is not required to escape all control characters, but if used, files may
|
|
2967
|
+
// be interpreted as binary. Therefore, we replace them.
|
|
2968
|
+
// We exclude LF from this list (\n). Characters with "nice" escapes have been replaced above.
|
|
2969
|
+
control: hexEscape,
|
|
2970
|
+
unpairedSurrogate: hexEscape,
|
|
2971
|
+
});
|
|
2972
|
+
|
|
2973
|
+
// Note: String is normalized, only \n is the line separator.
|
|
2974
|
+
const lines = str.split('\n');
|
|
2975
|
+
// We don't know whether a text block was used or not. But if there
|
|
2976
|
+
// are more than three lines, text blocks with indentation "look nicer".
|
|
2977
|
+
// This value was chosen by personal taste.
|
|
2978
|
+
if (lines.length > 3) {
|
|
2979
|
+
str = lines.join(`\n${ env.indent }`);
|
|
2980
|
+
return `\`\`\`\n${ env.indent }${ str }\n${ env.indent }\`\`\``;
|
|
2981
|
+
}
|
|
2982
|
+
|
|
2983
|
+
return `\`${ str }\``;
|
|
2984
|
+
}
|
|
2985
|
+
|
|
2986
|
+
/** @param {number} codePoint */
|
|
2987
|
+
function hexEscape( codePoint ) {
|
|
2988
|
+
const hex = codePoint.toString(16);
|
|
2989
|
+
return `\\u{${ hex }}`;
|
|
2990
|
+
}
|
|
2991
|
+
|
|
2992
|
+
/**
|
|
2993
|
+
* Returns true if the given string can be represented by using single quotes.
|
|
2994
|
+
* @param {string} str
|
|
2995
|
+
*/
|
|
2996
|
+
function isSimpleString( str ) {
|
|
2997
|
+
// A single-line string allows everything except certain line separators/breaks.
|
|
2998
|
+
// See ANTLR grammar for specifics.
|
|
2999
|
+
// Furthermore, if control characters are used, we escape them,
|
|
3000
|
+
// as these are explicitly mentioned in the JSON spec (§9):
|
|
3001
|
+
// <https://www.ecma-international.org/wp-content/uploads/ECMA-404_2nd_edition_december_2017.pdf>
|
|
3002
|
+
// On top, because (invalid) surrogate pairs need to be handled, we check for them as well.
|
|
3003
|
+
// v3: Not a simple string if ' (\u0027) is in string.
|
|
3004
|
+
// eslint-disable-next-line no-control-regex
|
|
3005
|
+
return str === '' || (/^[^\u{0000}-\u{001F}\u2028\u2029]+$/u.test(str) &&
|
|
3006
|
+
!hasUnpairedUnicodeSurrogate(str));
|
|
3007
|
+
}
|
|
3008
|
+
|
|
3009
|
+
/**
|
|
3010
|
+
* Quotes the identifier using CDL-style ![]-quotes.
|
|
3011
|
+
*
|
|
3012
|
+
* NOTE: It is not guaranteed that the resulting string can _always_ be parsed!
|
|
3013
|
+
* If `id` contains newline characters, the resulting delimited identifier
|
|
3014
|
+
* will not be parsable by the compiler!
|
|
3015
|
+
*
|
|
3016
|
+
* @param id
|
|
3017
|
+
* @returns {string}
|
|
3018
|
+
*/
|
|
3019
|
+
function apiDelimitedId( id ) {
|
|
3020
|
+
return `![${ id.replace(/]/g, ']]') }]`;
|
|
3021
|
+
}
|
|
3022
|
+
|
|
3023
|
+
/**
|
|
3024
|
+
* Returns a delimited identifier if the given identifier needs quoting.
|
|
3025
|
+
* Because "special functions" such as SAP HANA RegEx functions have local keywords that
|
|
3026
|
+
* are not default CDL keywords, specify a function name to take care of that.
|
|
3027
|
+
*
|
|
3028
|
+
* NOTE: It is not guaranteed that the resulting string can _always_ be parsed!
|
|
3029
|
+
* If `id` contains newline characters, the resulting delimited identifier
|
|
3030
|
+
* will not be parsable by the compiler!
|
|
3031
|
+
*
|
|
3032
|
+
* @param {string} id
|
|
3033
|
+
* @param {null|string} insideFunction
|
|
3034
|
+
* @return {string}
|
|
3035
|
+
*/
|
|
3036
|
+
function apiSmartId( id, insideFunction = null ) {
|
|
3037
|
+
insideFunction = insideFunction?.toUpperCase();
|
|
3038
|
+
const extra = insideFunction && specialFunctions[insideFunction] ? getAllKeywordsForSpecialFunction(insideFunction) : [];
|
|
3039
|
+
if (requiresQuotingForCdl(id, extra))
|
|
3040
|
+
return apiDelimitedId(id);
|
|
3041
|
+
return id;
|
|
3042
|
+
}
|
|
3043
|
+
|
|
3044
|
+
/**
|
|
3045
|
+
* Quote the given function name if required.
|
|
3046
|
+
*
|
|
3047
|
+
* NOTE: It is not guaranteed that the resulting string can _always_ be parsed!
|
|
3048
|
+
* If `funcName` contains newline characters, the resulting delimited identifier
|
|
3049
|
+
* will not be parsable by the compiler!
|
|
3050
|
+
*
|
|
3051
|
+
* @param {string} funcName
|
|
3052
|
+
* @return {string}
|
|
3053
|
+
*/
|
|
3054
|
+
function apiSmartFunctionId( funcName ) {
|
|
3055
|
+
const funcId = funcName.toUpperCase();
|
|
3056
|
+
const requiresQuoting = !undelimitedIdentifierRegex.test(funcName) ||
|
|
3057
|
+
(keywords.cdl.includes(funcId) && !specialFunctions[funcId]);
|
|
3058
|
+
if (requiresQuoting)
|
|
3059
|
+
return apiDelimitedId(funcName);
|
|
3060
|
+
return funcName;
|
|
3061
|
+
}
|
|
3062
|
+
|
|
3063
|
+
/**
|
|
3064
|
+
* Render the CSN model 'model' to CDS source text.
|
|
3065
|
+
* Returned object has the following properties:
|
|
3066
|
+
* - `model`: CSN model rendered as CDL (string).
|
|
3067
|
+
* - `namespace`: Namespace statement + `using from './model.cds'.
|
|
3068
|
+
*
|
|
3069
|
+
* @param {CSN.Model} csn
|
|
3070
|
+
* @param {CdlOptions} options
|
|
3071
|
+
* @param {object} msg Message Functions
|
|
3072
|
+
*/
|
|
3073
|
+
function csnToCdl( csn, options, msg ) {
|
|
3074
|
+
const renderer = new CsnToCdl(csn, options, msg);
|
|
3075
|
+
return renderer.render();
|
|
3076
|
+
}
|
|
3077
|
+
|
|
3078
|
+
|
|
3079
|
+
module.exports = {
|
|
3080
|
+
csnToCdl,
|
|
3081
|
+
smartId: apiSmartId,
|
|
3082
|
+
smartFunctionId: apiSmartFunctionId,
|
|
3083
|
+
delimitedId: apiDelimitedId,
|
|
3084
|
+
};
|