@sap/cds-dk 9.9.2 → 10.0.3
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 +95 -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/import.js +6 -1
- 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/common.js +3 -2
- package/lib/import/importapi.js +1 -1
- package/lib/import/odata/annotationParser.js +316 -0
- package/lib/import/odata/v2parser.js +217 -0
- package/lib/import/odata/v4parser.js +8 -232
- 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/lib/watch/watcher.js +27 -1
- 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/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/@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 +178 -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 +307 -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 +423 -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 +116 -9
- 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 -1725
|
@@ -0,0 +1,2604 @@
|
|
|
1
|
+
const cds = require('../cds')
|
|
2
|
+
const LOG = cds.log('fiori|drafts')
|
|
3
|
+
|
|
4
|
+
const { Object_keys } = cds.utils
|
|
5
|
+
|
|
6
|
+
const { Readable, PassThrough } = require('stream')
|
|
7
|
+
|
|
8
|
+
const { getPageSize, commonGenericPaging } = require('../common/generic/paging')
|
|
9
|
+
const { getPreferReturnHeader } = require('../../odata/utils')
|
|
10
|
+
const { commonGenericSorting } = require('../common/generic/sorting')
|
|
11
|
+
const { addEtagColumns } = require('../common/utils/etag')
|
|
12
|
+
const { handleStreamProperties } = require('../common/utils/streamProp')
|
|
13
|
+
|
|
14
|
+
const { prototype: odata } = require('../../odata/ODataAdapter')
|
|
15
|
+
const { Responses, prepareError } = require('../../../lib/req/response')
|
|
16
|
+
const location4 = require('../../http/location')
|
|
17
|
+
|
|
18
|
+
const $original = Symbol('original')
|
|
19
|
+
const $draftParams = Symbol('draftParams')
|
|
20
|
+
|
|
21
|
+
const { WELL_KNOWN_EVENTS } = require('../../../lib/req/event')
|
|
22
|
+
|
|
23
|
+
const AGGREGATION_FUNCTIONS = ['sum', 'min', 'max', 'avg', 'average', 'count']
|
|
24
|
+
const MAX_RECURSION_DEPTH = cds.env.features.recursion_depth != null ? Number(cds.env.features.recursion_depth) : 4
|
|
25
|
+
const IS_PERSISTED_DRAFT_MESSAGES_ENABLED =
|
|
26
|
+
!!cds.model?.definitions?.['DRAFT.DraftAdministrativeData']?.elements?.DraftMessages
|
|
27
|
+
|
|
28
|
+
const _config_to_ms = (config, _default) => {
|
|
29
|
+
const timeout = cds.env.fiori?.[config]
|
|
30
|
+
let timeout_ms
|
|
31
|
+
if (timeout === true) {
|
|
32
|
+
timeout_ms = cds.utils.ms4(_default)
|
|
33
|
+
} else if (typeof timeout === 'string') {
|
|
34
|
+
timeout_ms = cds.utils.ms4(timeout)
|
|
35
|
+
if (!timeout_ms)
|
|
36
|
+
cds.error`
|
|
37
|
+
${timeout} is an invalid value for \`cds.fiori.${config}\`.
|
|
38
|
+
Please provide a value in format /^([0-9]+)(w|d|h|hrs|min)$/.
|
|
39
|
+
`
|
|
40
|
+
} else {
|
|
41
|
+
timeout_ms = timeout
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
return timeout_ms
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
const DEL_TIMEOUT = {
|
|
48
|
+
get value() {
|
|
49
|
+
const timeout_ms = _config_to_ms('draft_deletion_timeout', '30d')
|
|
50
|
+
Object.defineProperty(DEL_TIMEOUT, 'value', { value: timeout_ms })
|
|
51
|
+
return timeout_ms
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
const LOCK_TIMEOUT = {
|
|
56
|
+
get value() {
|
|
57
|
+
let timeout_ms = _config_to_ms('draft_lock_timeout', '15min')
|
|
58
|
+
|
|
59
|
+
Object.defineProperty(LOCK_TIMEOUT, 'value', { value: timeout_ms })
|
|
60
|
+
return timeout_ms
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
const reject_bypassed_draft = () => {
|
|
65
|
+
const message =
|
|
66
|
+
!cds.profiles?.includes('production') &&
|
|
67
|
+
'`cds.fiori.bypass_draft` must be enabled to support direct modifications of active instances.'
|
|
68
|
+
cds.error({ status: 501, message })
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
const DRAFT_ELEMENTS = new Set([
|
|
72
|
+
'IsActiveEntity',
|
|
73
|
+
'HasDraftEntity',
|
|
74
|
+
'HasActiveEntity',
|
|
75
|
+
'DraftAdministrativeData',
|
|
76
|
+
'DraftAdministrativeData_DraftUUID',
|
|
77
|
+
'SiblingEntity'
|
|
78
|
+
])
|
|
79
|
+
const DRAFT_ELEMENTS_WITHOUT_HASACTIVE = new Set(DRAFT_ELEMENTS)
|
|
80
|
+
DRAFT_ELEMENTS_WITHOUT_HASACTIVE.delete('HasActiveEntity')
|
|
81
|
+
const REDUCED_DRAFT_ELEMENTS = new Set(['IsActiveEntity', 'HasDraftEntity', 'SiblingEntity'])
|
|
82
|
+
|
|
83
|
+
const numericCollator = { numeric: true }
|
|
84
|
+
const emptyObject = {}
|
|
85
|
+
|
|
86
|
+
const _isKeyValue = (i, keys, where) => {
|
|
87
|
+
if (!where[i].ref || !keys.includes(where[i].ref[0])) {
|
|
88
|
+
return false
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
return where[i + 1] === '=' && 'val' in where[i + 2]
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
const _getKeyData = (keys, where) => {
|
|
95
|
+
if (!where) {
|
|
96
|
+
return {}
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
const data = {}
|
|
100
|
+
let i = 0
|
|
101
|
+
|
|
102
|
+
while (where[i]) {
|
|
103
|
+
if (_isKeyValue(i, keys, where)) {
|
|
104
|
+
data[where[i].ref[0]] = where[i + 2].val
|
|
105
|
+
i = i + 3
|
|
106
|
+
} else {
|
|
107
|
+
i++
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
return data
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
const _fillIsActiveEntity = (row, IsActiveEntity, target) => {
|
|
115
|
+
if (target.drafts) row.IsActiveEntity = IsActiveEntity
|
|
116
|
+
for (const key in target.associations) {
|
|
117
|
+
const prop = row[key]
|
|
118
|
+
if (!prop) continue
|
|
119
|
+
const el = target.elements[key]
|
|
120
|
+
const childIsActiveEntity = el._target.isDraft ? IsActiveEntity : true
|
|
121
|
+
const propArray = Array.isArray(prop) ? prop : [prop]
|
|
122
|
+
propArray.forEach(r => _fillIsActiveEntity(r, childIsActiveEntity, el._target))
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
const _filterResultSet = (resultSet, limit, offset) => {
|
|
127
|
+
const pageResultSet = []
|
|
128
|
+
|
|
129
|
+
for (let i = 0; i < resultSet.length; i++) {
|
|
130
|
+
if (i < offset) continue
|
|
131
|
+
pageResultSet.push(resultSet[i])
|
|
132
|
+
if (pageResultSet.length === limit) break
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
return pageResultSet
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
// It's important to wait for the completion of all promises, otherwise a rollback might happen too soon
|
|
139
|
+
const _promiseAll = async array => {
|
|
140
|
+
const results = await Promise.allSettled(array)
|
|
141
|
+
const firstRejected = results.find(response => response.status === 'rejected')
|
|
142
|
+
if (firstRejected) throw firstRejected.reason
|
|
143
|
+
return results.map(result => result.value)
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
const _isCount = query => query.SELECT.columns?.length === 1 && query.SELECT.columns[0].func === 'count'
|
|
147
|
+
const _entityKeys = entity =>
|
|
148
|
+
Object_keys(entity.keys).filter(key => key !== 'IsActiveEntity' && !entity.keys[key].isAssociation)
|
|
149
|
+
|
|
150
|
+
const _inProcessByUserXpr = lockShiftedNow => ({
|
|
151
|
+
xpr: [
|
|
152
|
+
'case',
|
|
153
|
+
'when',
|
|
154
|
+
{ ref: ['LastChangeDateTime'] },
|
|
155
|
+
'<',
|
|
156
|
+
{ val: lockShiftedNow },
|
|
157
|
+
'then',
|
|
158
|
+
{ val: '' },
|
|
159
|
+
'else',
|
|
160
|
+
{ ref: ['InProcessByUser'] },
|
|
161
|
+
'end'
|
|
162
|
+
],
|
|
163
|
+
as: 'InProcessByUser',
|
|
164
|
+
cast: { type: 'cds.String' }
|
|
165
|
+
})
|
|
166
|
+
|
|
167
|
+
const _lock = {
|
|
168
|
+
get shiftedNow() {
|
|
169
|
+
return new Date(Math.max(0, Date.now() - LOCK_TIMEOUT.value)).toISOString()
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
const _redirectRefToDrafts = (ref, model) => {
|
|
174
|
+
const [root, ...tail] = ref
|
|
175
|
+
const target = model.definitions[root.id || root]
|
|
176
|
+
const draft = target.drafts || target
|
|
177
|
+
return [root.id ? { ...root, id: draft.name } : draft.name, ...tail]
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
const _redirectRefToActives = (ref, model) => {
|
|
181
|
+
const [root, ...tail] = ref
|
|
182
|
+
const target = model.definitions[root.id || root]
|
|
183
|
+
const active = target.actives || target
|
|
184
|
+
return [root.id ? { ...root, id: active.name } : active.name, ...tail]
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
const lastCheckMap = new Map()
|
|
188
|
+
const _cleanUpOldDrafts = (service, tenant) => {
|
|
189
|
+
if (!DEL_TIMEOUT.value) return
|
|
190
|
+
|
|
191
|
+
const expiryDate = new Date(Date.now() - DEL_TIMEOUT.value).toISOString()
|
|
192
|
+
const interval = DEL_TIMEOUT.value / 2
|
|
193
|
+
const lastCheck = lastCheckMap.get(tenant)
|
|
194
|
+
|
|
195
|
+
if (lastCheck && Date.now() - lastCheck < Number(interval)) return
|
|
196
|
+
|
|
197
|
+
cds.spawn({ tenant, user: cds.User.privileged }, async () => {
|
|
198
|
+
const expiredDrafts = await SELECT.from('DRAFT.DraftAdministrativeData', ['DraftUUID']).where(
|
|
199
|
+
`LastChangeDateTime <`,
|
|
200
|
+
expiryDate
|
|
201
|
+
)
|
|
202
|
+
|
|
203
|
+
if (!expiredDrafts.length) return
|
|
204
|
+
|
|
205
|
+
const expiredDraftsIds = expiredDrafts.map(el => el.DraftUUID)
|
|
206
|
+
const promises = []
|
|
207
|
+
|
|
208
|
+
const draftRoots = []
|
|
209
|
+
|
|
210
|
+
for (const name in service.model.definitions) {
|
|
211
|
+
const target = service.model.definitions[name]
|
|
212
|
+
if (target.drafts && target['@Common.DraftRoot.ActivationAction']) {
|
|
213
|
+
draftRoots.push(target.drafts)
|
|
214
|
+
}
|
|
215
|
+
}
|
|
216
|
+
|
|
217
|
+
const draftRootIds = await Promise.all(
|
|
218
|
+
draftRoots.map(draftRoot =>
|
|
219
|
+
SELECT.from(draftRoot, _entityKeys(draftRoot)).where(`DraftAdministrativeData_DraftUUID IN`, expiredDraftsIds)
|
|
220
|
+
)
|
|
221
|
+
)
|
|
222
|
+
|
|
223
|
+
for (let i = 0; i < draftRoots.length; i++) {
|
|
224
|
+
const ids = draftRootIds[i]
|
|
225
|
+
if (!ids.length) continue
|
|
226
|
+
const srv = await cds.connect.to(draftRoots[i]._service.name).catch(() => {})
|
|
227
|
+
if (!srv) continue // srv might not be loaded
|
|
228
|
+
for (const idObj of ids) {
|
|
229
|
+
promises.push(srv.send({ event: 'CANCEL', query: DELETE.from(draftRoots[i], idObj), data: idObj }))
|
|
230
|
+
}
|
|
231
|
+
}
|
|
232
|
+
|
|
233
|
+
await Promise.allSettled(promises)
|
|
234
|
+
})
|
|
235
|
+
|
|
236
|
+
lastCheckMap.set(tenant, Date.now())
|
|
237
|
+
}
|
|
238
|
+
|
|
239
|
+
const _hasStreaming = (cols, target, deep) => {
|
|
240
|
+
return cols?.some(col => {
|
|
241
|
+
const name = col.as || col.ref?.at(-1)
|
|
242
|
+
if (!target.elements[name]) return
|
|
243
|
+
return (
|
|
244
|
+
target.elements[name]._type === 'cds.LargeBinary' ||
|
|
245
|
+
(deep && col.expand && _hasStreaming(col.expand, target.elements[name]._target, deep))
|
|
246
|
+
)
|
|
247
|
+
})
|
|
248
|
+
}
|
|
249
|
+
|
|
250
|
+
const _waitForReadable = readable => {
|
|
251
|
+
return new Promise((resolve, reject) => {
|
|
252
|
+
readable.once('readable', resolve)
|
|
253
|
+
readable.once('error', reject)
|
|
254
|
+
})
|
|
255
|
+
}
|
|
256
|
+
|
|
257
|
+
const _removeEmptyStreams = async result => {
|
|
258
|
+
if (!result) return
|
|
259
|
+
|
|
260
|
+
const res = Array.isArray(result) ? result : [result]
|
|
261
|
+
for (let r of res) {
|
|
262
|
+
for (let key in r) {
|
|
263
|
+
const el = r[key]
|
|
264
|
+
if (el instanceof Readable) {
|
|
265
|
+
// In case hana-client Readable may not be ready
|
|
266
|
+
if (cds.db?.constructor?.name === 'HANAService') await _waitForReadable(el)
|
|
267
|
+
const chunk0 = el.read()
|
|
268
|
+
if (chunk0 === null) delete r[key]
|
|
269
|
+
else el.unshift(chunk0)
|
|
270
|
+
} else if (typeof el === 'object') {
|
|
271
|
+
const res = Array.isArray(el) ? el : [el]
|
|
272
|
+
for (let r of res) {
|
|
273
|
+
await _removeEmptyStreams(r)
|
|
274
|
+
}
|
|
275
|
+
}
|
|
276
|
+
}
|
|
277
|
+
}
|
|
278
|
+
}
|
|
279
|
+
|
|
280
|
+
const getUpdateFromSelectQueries = (target, draftRef, activeRef, depth = 0) => {
|
|
281
|
+
const updateMediaDataQueries = []
|
|
282
|
+
|
|
283
|
+
// Collect relevant elements
|
|
284
|
+
const compositionElements = []
|
|
285
|
+
const mediaDataElements = []
|
|
286
|
+
const autogeneratedElements = []
|
|
287
|
+
const targetElements = Array.isArray(target.elements) ? target.elements : Object.values(target.elements)
|
|
288
|
+
for (const element of targetElements) {
|
|
289
|
+
if (element['@cds.on.update']) autogeneratedElements.push(element)
|
|
290
|
+
else if (element.isComposition) compositionElements.push(element)
|
|
291
|
+
else if (element._type === 'cds.LargeBinary') mediaDataElements.push(element)
|
|
292
|
+
}
|
|
293
|
+
|
|
294
|
+
// Recurse into compositions
|
|
295
|
+
const nextDepth = depth + 1
|
|
296
|
+
if (nextDepth <= MAX_RECURSION_DEPTH) {
|
|
297
|
+
for (const composition of compositionElements) {
|
|
298
|
+
const compositionTargetElement = cds.model.definitions[composition.target]
|
|
299
|
+
|
|
300
|
+
const nextDraftRef = [...draftRef, composition.name]
|
|
301
|
+
const nextActiveRef = [...activeRef, composition.name]
|
|
302
|
+
|
|
303
|
+
updateMediaDataQueries.push(
|
|
304
|
+
...getUpdateFromSelectQueries(compositionTargetElement, nextDraftRef, nextActiveRef, nextDepth)
|
|
305
|
+
)
|
|
306
|
+
}
|
|
307
|
+
}
|
|
308
|
+
|
|
309
|
+
// Construct update queries for media data elements
|
|
310
|
+
if (mediaDataElements.length) {
|
|
311
|
+
const updateWith = {}
|
|
312
|
+
for (const element of autogeneratedElements) {
|
|
313
|
+
updateWith[element.name] = { ref: ['active', element.name] }
|
|
314
|
+
}
|
|
315
|
+
|
|
316
|
+
// Construct WHERE to match draft and active entities
|
|
317
|
+
const selectWhere = Object.values(target.keys).reduce((acc, key) => {
|
|
318
|
+
if (key.virtual || key.isAssociation) return acc
|
|
319
|
+
if (acc.length) acc.push('and')
|
|
320
|
+
acc.push({ ref: ['draft', key.name] })
|
|
321
|
+
acc.push('=')
|
|
322
|
+
acc.push({ ref: ['active', key.name] })
|
|
323
|
+
return acc
|
|
324
|
+
}, [])
|
|
325
|
+
|
|
326
|
+
for (const element of mediaDataElements) {
|
|
327
|
+
const activeElementRef = { ref: ['active', element.name] }
|
|
328
|
+
const draftElementRef = { ref: ['draft', element.name] }
|
|
329
|
+
|
|
330
|
+
// cds.ql.xpr`CASE WHEN (${draftElementRef} IS NULL OR length(${draftElementRef}) > 0) THEN ${draftElementRef} ELSE ${activeElementRef} END`
|
|
331
|
+
const columnExpression = {
|
|
332
|
+
xpr: [
|
|
333
|
+
'case',
|
|
334
|
+
'when',
|
|
335
|
+
{
|
|
336
|
+
xpr: [
|
|
337
|
+
draftElementRef,
|
|
338
|
+
'=',
|
|
339
|
+
{ val: null },
|
|
340
|
+
'or',
|
|
341
|
+
{ func: 'length', args: [draftElementRef] },
|
|
342
|
+
'>',
|
|
343
|
+
{ val: 0 }
|
|
344
|
+
]
|
|
345
|
+
},
|
|
346
|
+
'then',
|
|
347
|
+
draftElementRef,
|
|
348
|
+
'else',
|
|
349
|
+
activeElementRef,
|
|
350
|
+
'end'
|
|
351
|
+
]
|
|
352
|
+
}
|
|
353
|
+
columnExpression.as = element.name
|
|
354
|
+
|
|
355
|
+
const qSelectNextMediaData = SELECT.columns([columnExpression])
|
|
356
|
+
.from({ ref: draftRef, as: 'draft' })
|
|
357
|
+
.where(selectWhere)
|
|
358
|
+
|
|
359
|
+
updateWith[element.name] = qSelectNextMediaData
|
|
360
|
+
}
|
|
361
|
+
|
|
362
|
+
// Construct & Collect the actual update query for this composition level
|
|
363
|
+
const updateMediaDataQuery = UPDATE.entity({ ref: activeRef, as: 'active' }).with(updateWith)
|
|
364
|
+
updateMediaDataQueries.push(updateMediaDataQuery)
|
|
365
|
+
}
|
|
366
|
+
|
|
367
|
+
return updateMediaDataQueries
|
|
368
|
+
}
|
|
369
|
+
|
|
370
|
+
// REVISIT: Can be replaced with SQL WHEN statement (see commented code in expandStarStar) in the new HANA db layer - doesn't work with old db layer
|
|
371
|
+
const _replaceStreams = result => {
|
|
372
|
+
if (!result) return
|
|
373
|
+
|
|
374
|
+
const res = Array.isArray(result) ? result : [result]
|
|
375
|
+
for (let r of res) {
|
|
376
|
+
for (let key in r) {
|
|
377
|
+
const el = r[key]
|
|
378
|
+
if (el instanceof Readable) {
|
|
379
|
+
const stream = new Readable()
|
|
380
|
+
stream.push(null)
|
|
381
|
+
r[key] = stream
|
|
382
|
+
} else if (typeof el === 'object') {
|
|
383
|
+
const res = Array.isArray(el) ? el : [el]
|
|
384
|
+
res.forEach(_replaceStreams)
|
|
385
|
+
}
|
|
386
|
+
}
|
|
387
|
+
}
|
|
388
|
+
}
|
|
389
|
+
|
|
390
|
+
const _extractPrefixRef = (draftsRef, targetEntity, requestData = null) => {
|
|
391
|
+
const prefixRef = []
|
|
392
|
+
for (let refIdx = 0; refIdx < draftsRef.length; refIdx++) {
|
|
393
|
+
const dRef = draftsRef[refIdx],
|
|
394
|
+
dRefId = dRef.id ?? dRef
|
|
395
|
+
|
|
396
|
+
// Determine entity, referenced by the processesd segment of 'draftsRef'
|
|
397
|
+
if (refIdx > 0) targetEntity = targetEntity.elements[dRefId]._target
|
|
398
|
+
|
|
399
|
+
// Construct 'prefixRef' segment
|
|
400
|
+
const pRef = { where: [] }
|
|
401
|
+
|
|
402
|
+
if (dRefId === targetEntity.name) {
|
|
403
|
+
pRef.id = targetEntity.isDraft ? targetEntity.actives.name : targetEntity.name
|
|
404
|
+
} else pRef.id = dRefId
|
|
405
|
+
|
|
406
|
+
if (targetEntity.isDraft) targetEntity = targetEntity.actives
|
|
407
|
+
|
|
408
|
+
if ((typeof dRef === 'string' || !dRef.where?.length) && requestData) {
|
|
409
|
+
// In case of CREATE: The WHERE for the created entity must be constructed for use in 'prefixRef'
|
|
410
|
+
|
|
411
|
+
for (const k in targetEntity.keys) {
|
|
412
|
+
const key = targetEntity.keys[k]
|
|
413
|
+
let v = requestData[key.name]
|
|
414
|
+
if (v === undefined)
|
|
415
|
+
if (key.name === 'IsActiveEntity') v = false
|
|
416
|
+
else return null
|
|
417
|
+
if (v instanceof Buffer) v = v.toString('base64') //> convert binary keys to base64
|
|
418
|
+
if (pRef.where.length > 0) pRef.where.push('and')
|
|
419
|
+
pRef.where.push({ ref: [key.name] }, '=', { val: v })
|
|
420
|
+
}
|
|
421
|
+
|
|
422
|
+
prefixRef.push(pRef)
|
|
423
|
+
continue
|
|
424
|
+
}
|
|
425
|
+
|
|
426
|
+
if (dRef.where?.length) {
|
|
427
|
+
// Use the existing where clause from draftRef
|
|
428
|
+
pRef.where.push(...dRef.where)
|
|
429
|
+
|
|
430
|
+
if (!pRef.where.some(w => w === 'IsActiveEntity' || w.ref?.[0] === 'IsActiveEntity'))
|
|
431
|
+
pRef.where.push('and', { ref: ['IsActiveEntity'] }, '=', { val: false })
|
|
432
|
+
|
|
433
|
+
prefixRef.push(pRef)
|
|
434
|
+
continue
|
|
435
|
+
}
|
|
436
|
+
|
|
437
|
+
prefixRef.push(pRef.id)
|
|
438
|
+
}
|
|
439
|
+
|
|
440
|
+
return prefixRef
|
|
441
|
+
}
|
|
442
|
+
|
|
443
|
+
const compileUpdatedDraftMessages = (newMessages, persistedMessages, requestData, draftsRef) => {
|
|
444
|
+
const txModel = cds.context.tx.model // REVISIT: prefer srv.model!
|
|
445
|
+
let targetEntity = txModel.definitions[draftsRef[0].id || draftsRef[0]]
|
|
446
|
+
|
|
447
|
+
// The 'target' of validation errors needs to specify the full path from the draft root
|
|
448
|
+
// > Since success of establishment of containment can't be guaranteed, we clean up messages
|
|
449
|
+
if (!targetEntity['@Common.DraftRoot.ActivationAction']) return []
|
|
450
|
+
|
|
451
|
+
// Determine the path prefix required for a fully qualified validation message 'target'
|
|
452
|
+
const prefixRef = _extractPrefixRef(draftsRef, targetEntity, requestData)
|
|
453
|
+
if (!prefixRef) return null
|
|
454
|
+
|
|
455
|
+
const draftMessageTargetPrefix = cds.odata.urlify(
|
|
456
|
+
{ SELECT: { from: { ref: prefixRef } } },
|
|
457
|
+
{ kind: 'odata-v4', model: txModel }
|
|
458
|
+
).path
|
|
459
|
+
|
|
460
|
+
const nextMessages = []
|
|
461
|
+
|
|
462
|
+
// Collect messages that were created during the most recent validation run
|
|
463
|
+
const newMessagesByMessageKeyAndTarget = newMessages.reduce((acc, message) => {
|
|
464
|
+
if (!message.target) return acc //> silently ignore messages without target
|
|
465
|
+
|
|
466
|
+
message.numericSeverity ??= 4
|
|
467
|
+
message.additionalTargets = message.additionalTargets?.map(t => t.replace(/^in\//, ''))
|
|
468
|
+
|
|
469
|
+
// Remove prefix 'in/' in favor of fully qualified path to the target
|
|
470
|
+
const messageTarget = message.target.replace(/^in\//, '')
|
|
471
|
+
|
|
472
|
+
// Process the message target produced by validation
|
|
473
|
+
// > The message target contains the relative path of the erroneous entity
|
|
474
|
+
// > For a message specific 'prefixRef', this info must be added to the entity 'prefixRef'
|
|
475
|
+
const messagePrefixRef = [...prefixRef]
|
|
476
|
+
const messageTargetRef = cds.odata.parse(messageTarget).SELECT.from.ref
|
|
477
|
+
message.target = messageTargetRef.pop()
|
|
478
|
+
|
|
479
|
+
for (const tRef of messageTargetRef) {
|
|
480
|
+
messagePrefixRef.push(tRef)
|
|
481
|
+
if ((tRef.where ??= []).some(w => w === 'IsActiveEntity' || w.ref?.[0] === 'IsActiveEntity')) continue
|
|
482
|
+
if (tRef.where.length > 0) tRef.where.push('and', 'IsActiveEntity', '=', false)
|
|
483
|
+
}
|
|
484
|
+
|
|
485
|
+
message.prefix = cds.odata.urlify(
|
|
486
|
+
{ SELECT: { from: { ref: messagePrefixRef } } },
|
|
487
|
+
{ kind: 'odata-v4', model: txModel }
|
|
488
|
+
).path
|
|
489
|
+
|
|
490
|
+
nextMessages.push(message)
|
|
491
|
+
|
|
492
|
+
return acc.set(`${message.message}:${message.prefix}:${message.target}`, message)
|
|
493
|
+
}, new Map())
|
|
494
|
+
|
|
495
|
+
// Merge new messages with persisted ones & eliminate outdated ones
|
|
496
|
+
const simplePathElements = prefixRef.map(pRef => pRef.id)
|
|
497
|
+
for (const message of persistedMessages) {
|
|
498
|
+
// Drop persisted draft messages that are replaced by new ones
|
|
499
|
+
if (newMessagesByMessageKeyAndTarget.has(`${message.message}:${message.prefix}:${message.target}`)) continue
|
|
500
|
+
const hasNewMessageForAdditionalTarget = message.additionalTargets?.some(target =>
|
|
501
|
+
newMessagesByMessageKeyAndTarget.has(`${message.message}:${message.prefix}:${target}`)
|
|
502
|
+
)
|
|
503
|
+
if (hasNewMessageForAdditionalTarget) continue
|
|
504
|
+
|
|
505
|
+
// Drop persisted draft messages where the value of the target field changed
|
|
506
|
+
if (message.prefix === draftMessageTargetPrefix) {
|
|
507
|
+
if (requestData[message.target] !== undefined) continue
|
|
508
|
+
if (message.additionalTargets?.some(target => requestData[target] !== undefined)) continue
|
|
509
|
+
}
|
|
510
|
+
|
|
511
|
+
// Drop persisted draft messages, whose target's use navigations, where the value of the target field changed
|
|
512
|
+
const messageSimplePathElements = message.prefix.replaceAll(/\([^(]*\)/g, '').split('/')
|
|
513
|
+
if (messageSimplePathElements.length > simplePathElements.length)
|
|
514
|
+
if (requestData[messageSimplePathElements[simplePathElements.length]] !== undefined) continue
|
|
515
|
+
|
|
516
|
+
nextMessages.push(message)
|
|
517
|
+
}
|
|
518
|
+
|
|
519
|
+
return nextMessages.map(msg => odata.normalized(msg))
|
|
520
|
+
}
|
|
521
|
+
|
|
522
|
+
const _createNewDraftData = (obj, target, draftUUID) => {
|
|
523
|
+
const newDraftData = Object.assign({}, obj, {
|
|
524
|
+
DraftAdministrativeData_DraftUUID: draftUUID,
|
|
525
|
+
HasActiveEntity: false
|
|
526
|
+
})
|
|
527
|
+
if (!target) return newDraftData
|
|
528
|
+
|
|
529
|
+
for (const key in newDraftData) {
|
|
530
|
+
if (!target.elements[key]?.isComposition) continue
|
|
531
|
+
|
|
532
|
+
// Recurse into payload entries for nested associated entities
|
|
533
|
+
if (Array.isArray(newDraftData[key]))
|
|
534
|
+
newDraftData[key] = newDraftData[key].map(v => _createNewDraftData(v, target.elements[key]._target, draftUUID))
|
|
535
|
+
else if (typeof newDraftData[key] === 'object')
|
|
536
|
+
newDraftData[key] = _createNewDraftData(newDraftData[key], target.elements[key]._target, draftUUID)
|
|
537
|
+
}
|
|
538
|
+
|
|
539
|
+
return newDraftData
|
|
540
|
+
}
|
|
541
|
+
|
|
542
|
+
const _newReq = (req, query, draftParams, { event, headers }) => {
|
|
543
|
+
// REVISIT: This is a bit hacky -> better way?
|
|
544
|
+
query._target = undefined
|
|
545
|
+
query[$draftParams] = draftParams
|
|
546
|
+
|
|
547
|
+
// REVISIT: This is extremely bad. We should be able to just create a copy without such hacks.
|
|
548
|
+
const _req = cds.Request.for(req._) // REVISIT: this causes req._.data of WRITE reqs copied to READ reqs
|
|
549
|
+
// To create a `READ` event based on a modifying request, we need to delete req.data
|
|
550
|
+
if (event === 'READ' && req.event !== 'READ') delete _req.data
|
|
551
|
+
|
|
552
|
+
if (headers) {
|
|
553
|
+
_req.headers = Object.create(req.headers)
|
|
554
|
+
Object.assign(_req.headers, headers)
|
|
555
|
+
}
|
|
556
|
+
|
|
557
|
+
// Set relevant attributes of the inner request based on the outer
|
|
558
|
+
_req.target = cds.infer.target(query)
|
|
559
|
+
_req.query = query
|
|
560
|
+
_req.params = req.params
|
|
561
|
+
_req._ = req._
|
|
562
|
+
|
|
563
|
+
const cqnData = _req.query.UPDATE?.data || _req.query.INSERT?.entries?.[0]
|
|
564
|
+
if (cqnData) _req.data = cqnData // must point to the same object
|
|
565
|
+
|
|
566
|
+
if (req.protocol) _req.protocol = req.protocol
|
|
567
|
+
if (!_req._.event) _req._.event = req.event
|
|
568
|
+
if (req.tx && !_req.tx) _req.tx = req.tx
|
|
569
|
+
|
|
570
|
+
// Determine the proper event for the inner request
|
|
571
|
+
if (event) _req.event = event
|
|
572
|
+
else if (query.SELECT) _req.event = 'READ'
|
|
573
|
+
else if (query.INSERT) _req.event = 'CREATE'
|
|
574
|
+
else if (query.UPDATE) _req.event = 'UPDATE'
|
|
575
|
+
else if (query.DELETE) _req.event = 'DELETE'
|
|
576
|
+
else _req.event = req.event
|
|
577
|
+
|
|
578
|
+
// Divert messages and validation errors to outer request
|
|
579
|
+
/* prettier-ignore */ Object.defineProperty(_req, '_messages', { get() { return req._messages } })
|
|
580
|
+
/* prettier-ignore */ Object.defineProperty(_req, '_validationErrors', { get() { return req._validationErrors } })
|
|
581
|
+
|
|
582
|
+
const shouldCollectValidationErrorsSeparately =
|
|
583
|
+
_req.target.isDraft && IS_PERSISTED_DRAFT_MESSAGES_ENABLED && req.protocol && ['UPDATE', 'NEW'].includes(_req.event)
|
|
584
|
+
if (shouldCollectValidationErrorsSeparately) {
|
|
585
|
+
// Add a separate collection for validation errors, to the outer request
|
|
586
|
+
req._validationErrors ??= new Responses()
|
|
587
|
+
|
|
588
|
+
// Override .error to collect validation errors separately, for the inner request
|
|
589
|
+
// > Validation errors being classified by having a 'target'
|
|
590
|
+
_req.error = (...args) => {
|
|
591
|
+
const err = prepareError(4, ...args)
|
|
592
|
+
if (err.target) _req._validationErrors.push(err)
|
|
593
|
+
else _req._errors.add(null, ...args)
|
|
594
|
+
return err
|
|
595
|
+
}
|
|
596
|
+
}
|
|
597
|
+
|
|
598
|
+
return _req
|
|
599
|
+
}
|
|
600
|
+
|
|
601
|
+
// REVISIT: Can we do a regular handler function instead of monky patching?
|
|
602
|
+
const protoHandle = cds.ApplicationService.prototype.handle
|
|
603
|
+
const draftHandle = async function (req) {
|
|
604
|
+
if (req.event === 'DISCARD') req.event = 'CANCEL'
|
|
605
|
+
else if (req.event === 'SAVE') {
|
|
606
|
+
req.event = 'draftActivate'
|
|
607
|
+
req.query ??= SELECT.from(req.target, req.data) //> support simple srv.send('SAVE',entity,...)
|
|
608
|
+
}
|
|
609
|
+
|
|
610
|
+
// Fast exit for non-draft requests
|
|
611
|
+
// REVISIT: should also start with else, but then this test fails: cds/tests/_runtime/odata/__tests__/integration/draft-custom-handlers.test.js
|
|
612
|
+
if (!req.query) return protoHandle.call(this, req)
|
|
613
|
+
if ($draftParams in req.query) return protoHandle.call(this, req)
|
|
614
|
+
/* prettier-ignore */ if (!(
|
|
615
|
+
// Note: we skip UPSERTs as these might have an additional INSERT
|
|
616
|
+
'SELECT' in req.query ||
|
|
617
|
+
'INSERT' in req.query ||
|
|
618
|
+
'UPDATE' in req.query ||
|
|
619
|
+
'DELETE' in req.query
|
|
620
|
+
)) return protoHandle.call(this, req)
|
|
621
|
+
// TODO: also skip quickly if no draft-enabled entities are involved ?!?
|
|
622
|
+
// TODO: also skip quickly if no isActiveEntity is part of the query ?!?
|
|
623
|
+
// TODO: also skip quickly for CREATE request not from Fiori clients ???
|
|
624
|
+
|
|
625
|
+
// rewrite event if necessary
|
|
626
|
+
if (req.protocol && req.target.drafts && req.event in { CREATE: 1, DELETE: 1 }) {
|
|
627
|
+
if (req.event === 'CREATE' && req.data.IsActiveEntity !== true) req.event = 'NEW'
|
|
628
|
+
if (req.event === 'DELETE' && req.data.IsActiveEntity === false) req.event = 'CANCEL'
|
|
629
|
+
}
|
|
630
|
+
|
|
631
|
+
const query = _cleansed(req.query, this.model)
|
|
632
|
+
_cleanseParams(req.params, req.target)
|
|
633
|
+
if (req.data) _cleanseParams(req.data, req.target)
|
|
634
|
+
const draftParams = query[$draftParams]
|
|
635
|
+
|
|
636
|
+
const run = (query, options = {}) => {
|
|
637
|
+
const _req = _newReq(req, query, draftParams, options)
|
|
638
|
+
return protoHandle.call(this, _req)
|
|
639
|
+
}
|
|
640
|
+
|
|
641
|
+
if (req.event === 'READ') {
|
|
642
|
+
if (
|
|
643
|
+
!Object.keys(draftParams).length &&
|
|
644
|
+
!req.query._target.name?.endsWith('DraftAdministrativeData') &&
|
|
645
|
+
!req.query._target.drafts
|
|
646
|
+
) {
|
|
647
|
+
req.query = query
|
|
648
|
+
return protoHandle.call(this, req)
|
|
649
|
+
}
|
|
650
|
+
|
|
651
|
+
// For direct CRUD: Simply forward the read query
|
|
652
|
+
if (
|
|
653
|
+
cds.env.fiori.bypass_draft &&
|
|
654
|
+
query.SELECT.one &&
|
|
655
|
+
!req.query._target.isDraft &&
|
|
656
|
+
draftParams.IsActiveEntity === undefined &&
|
|
657
|
+
!req.target.name.includes('DraftAdministrativeData') // draft admin data requires special handling
|
|
658
|
+
) {
|
|
659
|
+
req.query = query
|
|
660
|
+
return protoHandle.call(this, req)
|
|
661
|
+
}
|
|
662
|
+
|
|
663
|
+
// apply paging and sorting on original query for protocol adapters relying on it
|
|
664
|
+
commonGenericPaging(req)
|
|
665
|
+
commonGenericSorting(req)
|
|
666
|
+
|
|
667
|
+
const determineRead = () => {
|
|
668
|
+
// 'draftParams' as filled in '_cleanseQuery'
|
|
669
|
+
const isActiveEntity = draftParams.IsActiveEntity
|
|
670
|
+
const hasDraftEntity = draftParams.HasDraftEntity
|
|
671
|
+
const hasStreaming = _hasStreaming(query.SELECT.columns, query._target)
|
|
672
|
+
const isBinaryDraftCompat = cds.env.features.binary_draft_compat
|
|
673
|
+
const isTargetDraft = req.query._target.name.endsWith('.drafts')
|
|
674
|
+
const inProcessByUserEqNullString = ['not ', 'not null'].includes(
|
|
675
|
+
draftParams.DraftAdministrativeData_InProcessByUser
|
|
676
|
+
)
|
|
677
|
+
const inProcessByUserEqEmptyString = draftParams.DraftAdministrativeData_InProcessByUser === ''
|
|
678
|
+
const isSiblingIsActiveEntityNull = draftParams.SiblingEntity_IsActiveEntity === null
|
|
679
|
+
|
|
680
|
+
if (isActiveEntity === false && hasStreaming && !isBinaryDraftCompat) return Read.draftStream
|
|
681
|
+
if (isTargetDraft) return Read.ownDrafts
|
|
682
|
+
if (isActiveEntity === false && isSiblingIsActiveEntityNull) return Read.all
|
|
683
|
+
if (isActiveEntity === true && isSiblingIsActiveEntityNull && inProcessByUserEqNullString)
|
|
684
|
+
return Read.lockedByAnotherUser
|
|
685
|
+
if (isActiveEntity === true && isSiblingIsActiveEntityNull && inProcessByUserEqEmptyString)
|
|
686
|
+
return Read.unsavedChangesByAnotherUser
|
|
687
|
+
if (isActiveEntity === true && hasDraftEntity === false) return Read.unchanged
|
|
688
|
+
if (isActiveEntity === false) return Read.ownDrafts
|
|
689
|
+
return Read.onlyActives
|
|
690
|
+
}
|
|
691
|
+
|
|
692
|
+
const read = determineRead()
|
|
693
|
+
const result = await read.bind(this)(run, query)
|
|
694
|
+
return result
|
|
695
|
+
}
|
|
696
|
+
|
|
697
|
+
if (req.event === 'draftEdit') req.event = 'EDIT'
|
|
698
|
+
if (req.event === 'draftPrepare' && draftParams.IsActiveEntity)
|
|
699
|
+
cds.error({ status: 400, message: 'Action "draftPrepare" can only be called on the draft entity' })
|
|
700
|
+
|
|
701
|
+
// REVISIT: Can't use req.subject here:
|
|
702
|
+
// REVISIT: > Caching in req.subject will yield erroneous result
|
|
703
|
+
// REVISIT: > after replacing req.query by draft adapted query
|
|
704
|
+
let rootEntityName = (
|
|
705
|
+
query.SELECT?.from ||
|
|
706
|
+
query.INSERT?.into ||
|
|
707
|
+
query.UPSERT?.into ||
|
|
708
|
+
query.UPDATE?.entity ||
|
|
709
|
+
query.DELETE?.from
|
|
710
|
+
)?.ref?.[0]
|
|
711
|
+
if (typeof rootEntityName === 'object') rootEntityName = rootEntityName.id
|
|
712
|
+
const rootEntity = this.model.definitions[rootEntityName]
|
|
713
|
+
|
|
714
|
+
const newDraftAction =
|
|
715
|
+
cds.env.fiori.draft_new_action && rootEntity['@Common.DraftRoot.NewAction']?.split?.('.').at(-1)
|
|
716
|
+
const shouldHandleNewDraftAction = newDraftAction && req.target.name === rootEntity.name
|
|
717
|
+
|
|
718
|
+
const shouldBeConsideredForCreateBypass =
|
|
719
|
+
req.target.drafts &&
|
|
720
|
+
!req.target.isDraft &&
|
|
721
|
+
draftParams.IsActiveEntity !== false &&
|
|
722
|
+
req.data?.IsActiveEntity !== false
|
|
723
|
+
|
|
724
|
+
// Create active instance of draft-enabled entity
|
|
725
|
+
// REVISIT: New OData adapter only sets `NEW` for drafts... how to distinguish programmatic modifications?
|
|
726
|
+
if (
|
|
727
|
+
(req.event === 'NEW' && shouldHandleNewDraftAction && req.data.IsActiveEntity !== false) ||
|
|
728
|
+
(req.event === 'NEW' && shouldBeConsideredForCreateBypass && req.target.name !== rootEntity.name) ||
|
|
729
|
+
(req.event === 'CREATE' && shouldBeConsideredForCreateBypass)
|
|
730
|
+
) {
|
|
731
|
+
if (
|
|
732
|
+
!cds.env.fiori.bypass_draft &&
|
|
733
|
+
req.protocol === 'odata' && // FIXME: lean-draft should never be involved for non-odata requests!
|
|
734
|
+
!('IsActiveEntity' in req.data)
|
|
735
|
+
) {
|
|
736
|
+
return reject_bypassed_draft(req)
|
|
737
|
+
}
|
|
738
|
+
|
|
739
|
+
const queryUsesContainment = !!rootEntity['@Common.DraftRoot.ActivationAction']
|
|
740
|
+
if (!queryUsesContainment) cds.error({ status: 422, message: 'DRAFT_MODIFICATION_ONLY_VIA_ROOT' })
|
|
741
|
+
|
|
742
|
+
const isDirectAccess = req.query.INSERT.into.ref?.length === 1
|
|
743
|
+
const data = Array.isArray(req.data) ? [...req.data] : Object.assign({}, req.data) // IsActiveEntity is not enumerable
|
|
744
|
+
const draftsRootRef = _redirectRefToDrafts([query.INSERT.into.ref[0]], this.model)
|
|
745
|
+
|
|
746
|
+
let draftRootEntityExists
|
|
747
|
+
|
|
748
|
+
// Children: check root entity has no draft
|
|
749
|
+
if (!isDirectAccess) draftRootEntityExists = await SELECT.one([1]).from({ ref: draftsRootRef })
|
|
750
|
+
|
|
751
|
+
// Direct access and req.data contains keys: check if root has no draft with that keys
|
|
752
|
+
if (isDirectAccess && _entityKeys(query._target).every(k => k in data)) {
|
|
753
|
+
const keyData = _entityKeys(query._target).reduce((res, k) => {
|
|
754
|
+
res[k] = req.data[k]
|
|
755
|
+
return res
|
|
756
|
+
}, {})
|
|
757
|
+
draftRootEntityExists = await SELECT.one([1]).from({ ref: draftsRootRef }).where(keyData)
|
|
758
|
+
}
|
|
759
|
+
|
|
760
|
+
if (draftRootEntityExists) cds.error({ status: 409, message: 'DRAFT_ALREADY_EXISTS' })
|
|
761
|
+
|
|
762
|
+
const cqn = INSERT.into(query.INSERT.into).entries(data)
|
|
763
|
+
const result = await run(cqn, { event: 'CREATE' })
|
|
764
|
+
|
|
765
|
+
let _data = data
|
|
766
|
+
if (!newDraftAction) {
|
|
767
|
+
if (Array.isArray(data)) _data = data.map(d => ({ ...d, IsActiveEntity: true }))
|
|
768
|
+
else _data = { ...data, IsActiveEntity: true }
|
|
769
|
+
if (Array.isArray(result)) result.forEach(d => (d.IsActiveEntity = true))
|
|
770
|
+
else result.IsActiveEntity = true
|
|
771
|
+
req.data = _data //> make keys available via req.data (as with normal crud)
|
|
772
|
+
} else {
|
|
773
|
+
req.data = Object.assign(req.data, _data) //> make keys available via req.data (as with normal crud)
|
|
774
|
+
}
|
|
775
|
+
|
|
776
|
+
return result
|
|
777
|
+
}
|
|
778
|
+
|
|
779
|
+
// Prevent creating active entities via drafts
|
|
780
|
+
if (req.event === 'CREATE' && draftParams.IsActiveEntity === false && !req.target.isDraft) {
|
|
781
|
+
cds.error({ status: 403, message: 'ACTIVE_MODIFICATION_VIA_DRAFT' })
|
|
782
|
+
}
|
|
783
|
+
|
|
784
|
+
// Handle 'newDraftAction' event if enabled
|
|
785
|
+
if (shouldHandleNewDraftAction && req.event === newDraftAction) {
|
|
786
|
+
if (!req.target.isDraft) req.target = req.target.drafts
|
|
787
|
+
|
|
788
|
+
// Rewrite 'newDraftAction' into regular 'NEW' event
|
|
789
|
+
query.SELECT.from.ref = _redirectRefToDrafts(query.SELECT.from.ref, this.model)
|
|
790
|
+
const createNewQuery = INSERT.into(query.SELECT.from).entries(req.data)
|
|
791
|
+
|
|
792
|
+
req.event = req._.event = 'NEW'
|
|
793
|
+
req.query = req._.query = createNewQuery
|
|
794
|
+
|
|
795
|
+
const innerReq = _newReq(req, createNewQuery, draftParams, { event: 'NEW' })
|
|
796
|
+
_deepRemoveIsActiveEntity(innerReq.data, innerReq.target)
|
|
797
|
+
await protoHandle.call(this, innerReq)
|
|
798
|
+
const createNewResult = innerReq.data
|
|
799
|
+
|
|
800
|
+
req.data = createNewResult
|
|
801
|
+
req.res.status(201)
|
|
802
|
+
|
|
803
|
+
const result = await _readAfterDraftAction.call(this, { req, payload: createNewResult, action: 'draftNew' })
|
|
804
|
+
if (result === null) req.res.status(204)
|
|
805
|
+
req.res.set(
|
|
806
|
+
'location',
|
|
807
|
+
'../' + location4(req.target.actives, this, result || { ...createNewResult, IsActiveEntity: false })
|
|
808
|
+
)
|
|
809
|
+
return result
|
|
810
|
+
}
|
|
811
|
+
|
|
812
|
+
// Handle draft-only events, that can only ever target entities in draft state
|
|
813
|
+
if (
|
|
814
|
+
(req.event === 'NEW' && (!shouldHandleNewDraftAction || req.data.IsActiveEntity === false)) ||
|
|
815
|
+
req.event === 'CANCEL' ||
|
|
816
|
+
req.event === 'draftPrepare'
|
|
817
|
+
) {
|
|
818
|
+
if (!req.target.isDraft) req.target = req.target.drafts // COMPAT: also support these events for actives
|
|
819
|
+
|
|
820
|
+
if (query.INSERT) query.INSERT.into.ref = _redirectRefToDrafts(query.INSERT.into.ref, this.model)
|
|
821
|
+
else if (query.DELETE) query.DELETE.from.ref = _redirectRefToDrafts(query.DELETE.from.ref, this.model)
|
|
822
|
+
else if (query.SELECT) query.SELECT.from.ref = _redirectRefToDrafts(query.SELECT.from.ref, this.model)
|
|
823
|
+
|
|
824
|
+
const _req = _newReq(req, query, draftParams, { event: req.event, headers: req.headers })
|
|
825
|
+
|
|
826
|
+
// Do not allow to create active instances via drafts
|
|
827
|
+
if (req.event === 'NEW' && draftParams.IsActiveEntity === false && !_req.target.isDraft) {
|
|
828
|
+
cds.error({ status: 403, message: 'ACTIVE_MODIFICATION_VIA_DRAFT' })
|
|
829
|
+
}
|
|
830
|
+
|
|
831
|
+
if (req.event === 'NEW') _deepRemoveIsActiveEntity(_req.data, _req.target)
|
|
832
|
+
|
|
833
|
+
const result = await protoHandle.call(this, _req)
|
|
834
|
+
|
|
835
|
+
req.data = _req.data //> make keys available via req.data (as with normal crud)
|
|
836
|
+
return result
|
|
837
|
+
}
|
|
838
|
+
|
|
839
|
+
// Handle 'DELETE' event on entities in active state
|
|
840
|
+
if (req.target.drafts && !req.target.isDraft && req.event === 'DELETE' && draftParams.IsActiveEntity !== false) {
|
|
841
|
+
const draftsRef = _redirectRefToDrafts(query.DELETE.from.ref, this.model)
|
|
842
|
+
const inProcessByUserCol = {
|
|
843
|
+
ref: ['DraftAdministrativeData'],
|
|
844
|
+
expand: [_inProcessByUserXpr(_lock.shiftedNow)]
|
|
845
|
+
}
|
|
846
|
+
const draftQuery = SELECT.one
|
|
847
|
+
.from({ ref: draftsRef })
|
|
848
|
+
.columns([{ ref: ['DraftAdministrativeData_DraftUUID'] }, inProcessByUserCol])
|
|
849
|
+
if (query.DELETE.where) draftQuery.where(query.DELETE.where)
|
|
850
|
+
|
|
851
|
+
// Deletion of active instance outside draft tree, no need to check for draft
|
|
852
|
+
const target = cds.infer.target(draftQuery) // FIXME: this should not be neccessary, does it?
|
|
853
|
+
if (!target?.isDraft) {
|
|
854
|
+
await run(query)
|
|
855
|
+
return Object.assign([], { affected: 1 })
|
|
856
|
+
}
|
|
857
|
+
|
|
858
|
+
// Deletion of active instance inside draft tree, need to check that no draft exists
|
|
859
|
+
const drafts = []
|
|
860
|
+
const draftsRes = await draftQuery
|
|
861
|
+
if (draftsRes) drafts.push(draftsRes)
|
|
862
|
+
|
|
863
|
+
// For hierarchies, check that no sub node exists.
|
|
864
|
+
if (target?.elements?.LimitedDescendantCount) {
|
|
865
|
+
let key
|
|
866
|
+
for (const _key in req.target.keys) {
|
|
867
|
+
if (_key === 'IsActiveEntity') continue
|
|
868
|
+
key = _key // only single key supported
|
|
869
|
+
}
|
|
870
|
+
// We must only do this for recursive _composition_ children.
|
|
871
|
+
// For recursive _association_ children, app developers must deal with dangling pointers themselves.
|
|
872
|
+
const _recursiveComposition = target => {
|
|
873
|
+
for (const _comp in target.compositions) {
|
|
874
|
+
if (target.compositions[_comp]['@odata.draft.ignore']) {
|
|
875
|
+
return target.compositions[_comp]
|
|
876
|
+
}
|
|
877
|
+
}
|
|
878
|
+
}
|
|
879
|
+
const recursiveComposition = _recursiveComposition(req.target)
|
|
880
|
+
if (recursiveComposition) {
|
|
881
|
+
let uplinkName
|
|
882
|
+
for (const key in req.target) {
|
|
883
|
+
if (key.match(/@Aggregation\.RecursiveHierarchy\s*#.*\.ParentNavigationProperty/)) {
|
|
884
|
+
uplinkName = req.target[key]['=']
|
|
885
|
+
break
|
|
886
|
+
}
|
|
887
|
+
}
|
|
888
|
+
const keyVal = req.query.DELETE.from.ref[0].where?.[2]?.val
|
|
889
|
+
if (keyVal === undefined) cds.error({ status: 400, message: 'Deletion not supported' })
|
|
890
|
+
// We must select actives and check for corresponding drafts (drafts themselve don't necessarily form a hierarchy)
|
|
891
|
+
const recursiveQ = SELECT.from(req.target).columns(key)
|
|
892
|
+
recursiveQ.SELECT.recurse = {
|
|
893
|
+
ref: [uplinkName],
|
|
894
|
+
where: [{ func: 'DistanceTo', args: [{ val: keyVal }, { val: null }] }]
|
|
895
|
+
}
|
|
896
|
+
const recursives = await recursiveQ
|
|
897
|
+
if (recursives.length) {
|
|
898
|
+
const recursiveDrafts = await SELECT.from(req.target.drafts)
|
|
899
|
+
.columns(inProcessByUserCol)
|
|
900
|
+
.where(Read.whereIn(req.target, recursives))
|
|
901
|
+
drafts.push(...recursiveDrafts)
|
|
902
|
+
}
|
|
903
|
+
}
|
|
904
|
+
}
|
|
905
|
+
|
|
906
|
+
for (const draft of drafts) {
|
|
907
|
+
const inProcessByUser = draft?.DraftAdministrativeData?.InProcessByUser
|
|
908
|
+
if (!cds.context.user._is_privileged && inProcessByUser && inProcessByUser !== cds.context.user.id)
|
|
909
|
+
cds.error({ status: 403, message: 'DRAFT_LOCKED_BY_ANOTHER_USER', args: [inProcessByUser] })
|
|
910
|
+
else cds.error({ status: 403, message: 'DRAFT_ACTIVE_DELETE_FORBIDDEN_DRAFT_EXISTS' })
|
|
911
|
+
}
|
|
912
|
+
await run(query)
|
|
913
|
+
return Object.assign([], { affected: 1 })
|
|
914
|
+
}
|
|
915
|
+
|
|
916
|
+
// Handle 'draftActivate' event
|
|
917
|
+
if (req.event === 'draftActivate') {
|
|
918
|
+
LOG.debug('activate draft')
|
|
919
|
+
|
|
920
|
+
if (req.query.SELECT.from.ref.length > 1 || draftParams.IsActiveEntity === true) {
|
|
921
|
+
cds.error({
|
|
922
|
+
status: 400,
|
|
923
|
+
message: 'Action "draftActivate" can only be called on the root draft entity'
|
|
924
|
+
})
|
|
925
|
+
}
|
|
926
|
+
|
|
927
|
+
if (req.target._etag && !req.headers['if-match'] && !req.headers['if-none-match']) {
|
|
928
|
+
cds.error(428)
|
|
929
|
+
}
|
|
930
|
+
|
|
931
|
+
const columns = expandStarStar(req.target.drafts, true)
|
|
932
|
+
|
|
933
|
+
const draftRef = _redirectRefToDrafts(query.SELECT.from.ref, this.model)
|
|
934
|
+
const draftQuery = SELECT.one
|
|
935
|
+
.from({ ref: draftRef })
|
|
936
|
+
.columns(columns)
|
|
937
|
+
.columns([
|
|
938
|
+
// Will automatically select 'IsActiveEntity' as key column
|
|
939
|
+
{ ref: ['HasActiveEntity'] },
|
|
940
|
+
{ ref: ['DraftAdministrativeData_DraftUUID'] },
|
|
941
|
+
{
|
|
942
|
+
ref: ['DraftAdministrativeData'],
|
|
943
|
+
expand: [
|
|
944
|
+
{ ref: ['InProcessByUser'] },
|
|
945
|
+
...(IS_PERSISTED_DRAFT_MESSAGES_ENABLED ? [{ ref: ['DraftMessages'] }] : [])
|
|
946
|
+
]
|
|
947
|
+
}
|
|
948
|
+
])
|
|
949
|
+
.where(query.SELECT.where)
|
|
950
|
+
const res = await run(draftQuery)
|
|
951
|
+
|
|
952
|
+
if (!res) {
|
|
953
|
+
const _etagValidationType = req.headers['if-match']
|
|
954
|
+
? 'if-match'
|
|
955
|
+
: req.headers['if-none-match']
|
|
956
|
+
? 'if-none-match'
|
|
957
|
+
: undefined
|
|
958
|
+
cds.error(_etagValidationType ? { status: 412 } : { status: 404, message: 'DRAFT_NOT_EXISTING' })
|
|
959
|
+
}
|
|
960
|
+
if (!cds.context.user._is_privileged && res.DraftAdministrativeData?.InProcessByUser !== cds.context.user.id) {
|
|
961
|
+
cds.error({
|
|
962
|
+
status: 403,
|
|
963
|
+
message: 'DRAFT_LOCKED_BY_ANOTHER_USER',
|
|
964
|
+
args: [res.DraftAdministrativeData?.InProcessByUser]
|
|
965
|
+
})
|
|
966
|
+
}
|
|
967
|
+
|
|
968
|
+
// Remove draft artefacts from persistedDraft entry
|
|
969
|
+
const DraftAdministrativeData_DraftUUID = res.DraftAdministrativeData_DraftUUID
|
|
970
|
+
const persistedDraftMessages = res.DraftAdministrativeData?.DraftMessages || []
|
|
971
|
+
delete res.DraftAdministrativeData_DraftUUID
|
|
972
|
+
delete res.DraftAdministrativeData
|
|
973
|
+
const HasActiveEntity = res.HasActiveEntity
|
|
974
|
+
delete res.HasActiveEntity
|
|
975
|
+
|
|
976
|
+
if (
|
|
977
|
+
_hasStreaming(draftQuery.SELECT.columns, draftQuery._target, true) &&
|
|
978
|
+
!cds.env.features.binary_draft_compat &&
|
|
979
|
+
!cds.env.fiori.move_media_data_in_db
|
|
980
|
+
) {
|
|
981
|
+
await _removeEmptyStreams(res)
|
|
982
|
+
}
|
|
983
|
+
|
|
984
|
+
// First run the handlers as they might need access to DraftAdministrativeData or the draft entities
|
|
985
|
+
const activesRef = _redirectRefToActives(query.SELECT.from.ref, this.model)
|
|
986
|
+
|
|
987
|
+
// Upsert draft into active, not considering media data columns
|
|
988
|
+
const upsertQuery = HasActiveEntity
|
|
989
|
+
? UPDATE({ ref: activesRef }).data(res).where(query.SELECT.where)
|
|
990
|
+
: INSERT.into({ ref: activesRef }).entries(res)
|
|
991
|
+
const upsertOptions = { headers: Object.assign({}, req.headers, { 'if-match': '*' }) }
|
|
992
|
+
|
|
993
|
+
const _req = _newReq(req, upsertQuery, draftParams, upsertOptions)
|
|
994
|
+
|
|
995
|
+
if (IS_PERSISTED_DRAFT_MESSAGES_ENABLED) {
|
|
996
|
+
_req.on('failed', async error => {
|
|
997
|
+
if (!error && !_req.errors?.length) {
|
|
998
|
+
LOG.debug('Draft activation failed without error information: Skip update of DraftMessages.')
|
|
999
|
+
return
|
|
1000
|
+
}
|
|
1001
|
+
const errors = []
|
|
1002
|
+
if (_req.errors?.length) {
|
|
1003
|
+
// Need to clone errors to avoid side effects on original error objects
|
|
1004
|
+
errors.push(..._req.errors.map(e => ({ ...e })))
|
|
1005
|
+
} else {
|
|
1006
|
+
// NOTE: this branch is for on-commit errors, which don't end up in req.errors
|
|
1007
|
+
// IMPORTANT: copy error objects to avoid side effects on original error
|
|
1008
|
+
if (typeof error === 'object') errors.push({ ...error })
|
|
1009
|
+
if (error.details) errors.push(...error.details.map(e => ({ ...e })))
|
|
1010
|
+
}
|
|
1011
|
+
const nextDraftMessages = compileUpdatedDraftMessages(errors, persistedDraftMessages, _req.data || {}, draftRef)
|
|
1012
|
+
await cds.tx(async () => {
|
|
1013
|
+
await UPDATE('DRAFT.DraftAdministrativeData')
|
|
1014
|
+
.set({ DraftMessages: nextDraftMessages })
|
|
1015
|
+
.where({ DraftUUID: DraftAdministrativeData_DraftUUID })
|
|
1016
|
+
})
|
|
1017
|
+
})
|
|
1018
|
+
}
|
|
1019
|
+
|
|
1020
|
+
const result = await protoHandle.call(this, _req).catch(err => {
|
|
1021
|
+
// block pop-up in fiori draft activation flow
|
|
1022
|
+
if (err.code === 'MULTIPLE_ERRORS' || err.message === 'MULTIPLE_ERRORS') err.target ??= 'in'
|
|
1023
|
+
throw err
|
|
1024
|
+
})
|
|
1025
|
+
|
|
1026
|
+
// REVISIT: Remove feature flag dependency
|
|
1027
|
+
if (cds.env.fiori.move_media_data_in_db) {
|
|
1028
|
+
// Move cds.LargeBinary data from draft to active
|
|
1029
|
+
const updateMediaDataQueries = getUpdateFromSelectQueries(req.target, draftRef, activesRef)
|
|
1030
|
+
await _promiseAll(updateMediaDataQueries)
|
|
1031
|
+
}
|
|
1032
|
+
|
|
1033
|
+
// Delete draft artefacts
|
|
1034
|
+
await _promiseAll([
|
|
1035
|
+
DELETE.from({ ref: draftRef }).where(query.SELECT.where),
|
|
1036
|
+
DELETE.from('DRAFT.DraftAdministrativeData').where({ DraftUUID: DraftAdministrativeData_DraftUUID })
|
|
1037
|
+
])
|
|
1038
|
+
|
|
1039
|
+
if (req.res) {
|
|
1040
|
+
// status code must be set in handler to allow overriding for FE V2
|
|
1041
|
+
// REVISIT: needs reworking for new adapter, especially re $batch
|
|
1042
|
+
if (!HasActiveEntity) req.res.status(201)
|
|
1043
|
+
|
|
1044
|
+
const read_result = await _readAfterDraftAction.bind(this)({
|
|
1045
|
+
req,
|
|
1046
|
+
payload: res,
|
|
1047
|
+
action: 'draftActivate'
|
|
1048
|
+
})
|
|
1049
|
+
req.res.set('location', '../' + location4(req.target, this, read_result || { ...res, IsActiveEntity: true }))
|
|
1050
|
+
|
|
1051
|
+
if (read_result == null) req.res.status(204)
|
|
1052
|
+
|
|
1053
|
+
return read_result
|
|
1054
|
+
}
|
|
1055
|
+
|
|
1056
|
+
return Object.assign(result, { IsActiveEntity: true })
|
|
1057
|
+
}
|
|
1058
|
+
|
|
1059
|
+
// Handle regular custom actions on entities in draft state
|
|
1060
|
+
if (req.target.actions?.[req.event] && !(req.event in WELL_KNOWN_EVENTS) && draftParams.IsActiveEntity === false) {
|
|
1061
|
+
if (query.SELECT?.from?.ref) query.SELECT.from.ref = _redirectRefToDrafts(query.SELECT.from.ref, this.model)
|
|
1062
|
+
|
|
1063
|
+
// Check if the draft is locked by another user
|
|
1064
|
+
const rootQuery = query.clone()
|
|
1065
|
+
rootQuery.SELECT.columns = [{ ref: ['DraftAdministrativeData'], expand: [{ ref: ['InProcessByUser'] }] }]
|
|
1066
|
+
rootQuery.SELECT.one = true
|
|
1067
|
+
rootQuery.SELECT.from = { ref: [query.SELECT.from.ref[0]] }
|
|
1068
|
+
const root = await cds.run(rootQuery)
|
|
1069
|
+
|
|
1070
|
+
if (!root) cds.error(404)
|
|
1071
|
+
if (root.DraftAdministrativeData?.InProcessByUser !== cds.context.user.id) {
|
|
1072
|
+
cds.error({
|
|
1073
|
+
status: 403,
|
|
1074
|
+
message: 'DRAFT_LOCKED_BY_ANOTHER_USER',
|
|
1075
|
+
args: [root.DraftAdministrativeData.InProcessByUser]
|
|
1076
|
+
})
|
|
1077
|
+
}
|
|
1078
|
+
|
|
1079
|
+
const _req = _newReq(req, query, draftParams, { event: req.event })
|
|
1080
|
+
const result = await protoHandle.call(this, _req)
|
|
1081
|
+
|
|
1082
|
+
return result
|
|
1083
|
+
}
|
|
1084
|
+
|
|
1085
|
+
// Handle 'UPDATE' events on entities in draft or active state
|
|
1086
|
+
if (req.event === 'PATCH' || (req.event === 'UPDATE' && req.target.drafts)) {
|
|
1087
|
+
// also delete `IsActiveEntity` for references
|
|
1088
|
+
const _rmIsActiveEntity = (data, target) => {
|
|
1089
|
+
delete data.IsActiveEntity
|
|
1090
|
+
for (const assoc in target.associations) {
|
|
1091
|
+
const val = data[assoc]
|
|
1092
|
+
if (val && typeof val === 'object') {
|
|
1093
|
+
const _target = req.target.associations[assoc]._target
|
|
1094
|
+
if (Array.isArray(val)) {
|
|
1095
|
+
val.forEach(v => _rmIsActiveEntity(v, _target))
|
|
1096
|
+
} else {
|
|
1097
|
+
_rmIsActiveEntity(val, _target)
|
|
1098
|
+
}
|
|
1099
|
+
}
|
|
1100
|
+
}
|
|
1101
|
+
}
|
|
1102
|
+
_rmIsActiveEntity(req.data, req.target)
|
|
1103
|
+
|
|
1104
|
+
// REVISIT: This should allow `IsActiveEntity: false` to be passed in the body
|
|
1105
|
+
// REVISIT: > Enabling this would re-establish symmetry with CREATE
|
|
1106
|
+
if (draftParams.IsActiveEntity === false) {
|
|
1107
|
+
LOG.debug('patch draft')
|
|
1108
|
+
|
|
1109
|
+
if (req.target?.name.endsWith('DraftAdministrativeData')) cds.error(405)
|
|
1110
|
+
|
|
1111
|
+
const draftsRef = _redirectRefToDrafts(query.UPDATE.entity.ref, this.model)
|
|
1112
|
+
const res = await SELECT.one.from({ ref: draftsRef }).columns('DraftAdministrativeData_DraftUUID', {
|
|
1113
|
+
ref: ['DraftAdministrativeData'],
|
|
1114
|
+
expand: [
|
|
1115
|
+
{ ref: ['InProcessByUser'] },
|
|
1116
|
+
...(IS_PERSISTED_DRAFT_MESSAGES_ENABLED ? [{ ref: ['DraftMessages'] }] : [])
|
|
1117
|
+
]
|
|
1118
|
+
})
|
|
1119
|
+
|
|
1120
|
+
if (!res) cds.error(404)
|
|
1121
|
+
if (!cds.context.user._is_privileged && res.DraftAdministrativeData?.InProcessByUser !== cds.context.user.id) {
|
|
1122
|
+
cds.error({
|
|
1123
|
+
status: 403,
|
|
1124
|
+
message: 'DRAFT_LOCKED_BY_ANOTHER_USER',
|
|
1125
|
+
args: [res.DraftAdministrativeData?.InProcessByUser]
|
|
1126
|
+
})
|
|
1127
|
+
}
|
|
1128
|
+
|
|
1129
|
+
// Propagate parent's DraftUUID into nested composition children
|
|
1130
|
+
const draftUUID = res.DraftAdministrativeData_DraftUUID
|
|
1131
|
+
for (const key in req.data) {
|
|
1132
|
+
const elem = req.target.elements[key]
|
|
1133
|
+
if (!elem?.isComposition) continue
|
|
1134
|
+
const val = req.data[key]
|
|
1135
|
+
if (Array.isArray(val)) req.data[key] = val.map(v => _createNewDraftData(v, elem._target, draftUUID))
|
|
1136
|
+
else if (val && typeof val === 'object') req.data[key] = _createNewDraftData(val, elem._target, draftUUID)
|
|
1137
|
+
}
|
|
1138
|
+
|
|
1139
|
+
const innerQuery = UPDATE({ ref: draftsRef }).data(req.data)
|
|
1140
|
+
const innerReq = _newReq(req, innerQuery, draftParams, {})
|
|
1141
|
+
await protoHandle.call(this, innerReq).catch(error => {
|
|
1142
|
+
// > This prevents thrown req.errors from being added to 'sap-messages'
|
|
1143
|
+
// > Downgraded req.error will add to req.messages, regardless of whether the error is thrown
|
|
1144
|
+
// > Unless we prevent it here, the response will contain the error in both body and header
|
|
1145
|
+
// > Downgrading is only required for PATCH, to prevent a rollback in case validation fails
|
|
1146
|
+
if (req.messages?.length) req.messages = req.messages.filter(m => m !== error)
|
|
1147
|
+
throw req.error(error)
|
|
1148
|
+
})
|
|
1149
|
+
|
|
1150
|
+
const nextDraftAdminData = {
|
|
1151
|
+
InProcessByUser: req.user.id,
|
|
1152
|
+
LastChangedByUser: req.user.id,
|
|
1153
|
+
LastChangeDateTime: new Date()
|
|
1154
|
+
}
|
|
1155
|
+
|
|
1156
|
+
if (IS_PERSISTED_DRAFT_MESSAGES_ENABLED) {
|
|
1157
|
+
nextDraftAdminData.DraftMessages = compileUpdatedDraftMessages(
|
|
1158
|
+
req._validationErrors ?? [],
|
|
1159
|
+
res.DraftAdministrativeData?.DraftMessages ?? [],
|
|
1160
|
+
req.data ?? {},
|
|
1161
|
+
draftsRef
|
|
1162
|
+
)
|
|
1163
|
+
}
|
|
1164
|
+
|
|
1165
|
+
await UPDATE('DRAFT.DraftAdministrativeData')
|
|
1166
|
+
.data(nextDraftAdminData)
|
|
1167
|
+
.where({ DraftUUID: res.DraftAdministrativeData_DraftUUID })
|
|
1168
|
+
|
|
1169
|
+
req.data.IsActiveEntity = false
|
|
1170
|
+
return Object.assign([], { affected: 1 })
|
|
1171
|
+
}
|
|
1172
|
+
|
|
1173
|
+
LOG.debug('patch active')
|
|
1174
|
+
|
|
1175
|
+
if (
|
|
1176
|
+
req.protocol === 'odata' && // FIXME: lean-draft should never be involved for non-odata requests!
|
|
1177
|
+
!cds.env.fiori.bypass_draft &&
|
|
1178
|
+
!req.target['@odata.draft.bypass']
|
|
1179
|
+
)
|
|
1180
|
+
return reject_bypassed_draft(req)
|
|
1181
|
+
|
|
1182
|
+
const entityRef = query.UPDATE.entity.ref
|
|
1183
|
+
|
|
1184
|
+
if (!this.model.definitions[entityRef[0].id || entityRef[0]]['@Common.DraftRoot.ActivationAction']) {
|
|
1185
|
+
cds.error({ status: 422, message: 'DRAFT_MODIFICATION_ONLY_VIA_ROOT' })
|
|
1186
|
+
}
|
|
1187
|
+
|
|
1188
|
+
const draftsRef = _redirectRefToDrafts(entityRef, this.model)
|
|
1189
|
+
const draftsQuery = SELECT.one([1]).from({ ref: [draftsRef[0]] })
|
|
1190
|
+
if (query.UPDATE.where) draftsQuery.where(query.UPDATE.where)
|
|
1191
|
+
const hasDraft = !!(await draftsQuery)
|
|
1192
|
+
if (hasDraft) cds.error({ status: 409, message: 'DRAFT_ALREADY_EXISTS' })
|
|
1193
|
+
|
|
1194
|
+
await run(query)
|
|
1195
|
+
return Object.assign([], { affected: 1 })
|
|
1196
|
+
}
|
|
1197
|
+
|
|
1198
|
+
req.query = query
|
|
1199
|
+
|
|
1200
|
+
return protoHandle.call(this, req)
|
|
1201
|
+
}
|
|
1202
|
+
|
|
1203
|
+
// REVISIT: It's not optimal to first calculate the whole result array and only later
|
|
1204
|
+
// delete unrequested properties. However, as a first step, we do it that way,
|
|
1205
|
+
// especially since the current db driver always adds those fields.
|
|
1206
|
+
// Once we switch to the new driver, we'll adapt it.
|
|
1207
|
+
const _requested = (result, query) => {
|
|
1208
|
+
const originalQuery = query[$original]
|
|
1209
|
+
if (!result || !originalQuery) return result
|
|
1210
|
+
const all = ['HasActiveEntity', 'HasDraftEntity']
|
|
1211
|
+
|
|
1212
|
+
const ignoredCols = new Set(all.concat('DraftAdministrativeData'))
|
|
1213
|
+
const _isODataV2 = cds.context?.http?.req?.headers?.['x-cds-odata-version'] === 'v2'
|
|
1214
|
+
if (!_isODataV2) ignoredCols.add('DraftAdministrativeData_DraftUUID')
|
|
1215
|
+
for (const col of originalQuery.SELECT.columns || ['*']) {
|
|
1216
|
+
const name = col.as || col.ref?.[0] || col
|
|
1217
|
+
if (all.includes(name) || name === 'DraftAdministrativeData' || name === 'DraftAdministrativeData_DraftUUID')
|
|
1218
|
+
ignoredCols.delete(name)
|
|
1219
|
+
if (name === '*') all.forEach(c => ignoredCols.delete(c))
|
|
1220
|
+
}
|
|
1221
|
+
if (!ignoredCols.size) return result
|
|
1222
|
+
const resArray = Array.isArray(result) ? result : [result]
|
|
1223
|
+
for (const row of resArray) {
|
|
1224
|
+
for (const ignoredCol of ignoredCols) delete row[ignoredCol]
|
|
1225
|
+
}
|
|
1226
|
+
return result
|
|
1227
|
+
}
|
|
1228
|
+
|
|
1229
|
+
const _readDraftStream = (draftStream, activeCQN, property) =>
|
|
1230
|
+
Readable.from(
|
|
1231
|
+
(async function* () {
|
|
1232
|
+
let isActive = true
|
|
1233
|
+
this._stream = draftStream
|
|
1234
|
+
for await (const chunk of draftStream) {
|
|
1235
|
+
isActive = false
|
|
1236
|
+
yield chunk
|
|
1237
|
+
}
|
|
1238
|
+
|
|
1239
|
+
if (isActive) {
|
|
1240
|
+
const active = (await activeCQN)?.[property]
|
|
1241
|
+
if (active) {
|
|
1242
|
+
for await (const chunk of active) {
|
|
1243
|
+
yield chunk
|
|
1244
|
+
}
|
|
1245
|
+
}
|
|
1246
|
+
}
|
|
1247
|
+
})()
|
|
1248
|
+
)
|
|
1249
|
+
|
|
1250
|
+
// REVISIT: HanaLobStream of @sap/hana-client cannot read chunks with "for await" - hangs
|
|
1251
|
+
const _readDraftStreamHanaClient = async (draftStream, activeCQN, property) =>
|
|
1252
|
+
Readable.from(
|
|
1253
|
+
(async function* () {
|
|
1254
|
+
let isActive = true
|
|
1255
|
+
const pth = new PassThrough()
|
|
1256
|
+
draftStream.pipe(pth)
|
|
1257
|
+
for await (const chunk of pth) {
|
|
1258
|
+
isActive = false
|
|
1259
|
+
yield chunk
|
|
1260
|
+
}
|
|
1261
|
+
|
|
1262
|
+
if (isActive) {
|
|
1263
|
+
const active = (await activeCQN)?.[property]
|
|
1264
|
+
if (active) {
|
|
1265
|
+
const pth = new PassThrough()
|
|
1266
|
+
active.pipe(pth)
|
|
1267
|
+
for await (const chunk of pth) {
|
|
1268
|
+
yield chunk
|
|
1269
|
+
}
|
|
1270
|
+
}
|
|
1271
|
+
}
|
|
1272
|
+
})()
|
|
1273
|
+
)
|
|
1274
|
+
|
|
1275
|
+
const { count_as_string } = cds.env.features
|
|
1276
|
+
|
|
1277
|
+
const Read = {
|
|
1278
|
+
onlyActives: async function (run, query, { ignoreDrafts } = {}) {
|
|
1279
|
+
LOG.debug('List Editing Status: Only Active')
|
|
1280
|
+
|
|
1281
|
+
if (_isCount(query)) return run(query)
|
|
1282
|
+
|
|
1283
|
+
if (query._target.name.endsWith('.DraftAdministrativeData')) {
|
|
1284
|
+
// DraftAdministrativeData is only accessible via drafts
|
|
1285
|
+
if (query.SELECT.from.ref?.length === 1) {
|
|
1286
|
+
cds.error({ status: 400, message: 'INVALID_DRAFT_REQUEST' })
|
|
1287
|
+
}
|
|
1288
|
+
|
|
1289
|
+
return run(query._drafts)
|
|
1290
|
+
}
|
|
1291
|
+
|
|
1292
|
+
if (!query._target._isDraftEnabled) return run(query)
|
|
1293
|
+
|
|
1294
|
+
if (
|
|
1295
|
+
!query.SELECT.groupBy &&
|
|
1296
|
+
query.SELECT.columns &&
|
|
1297
|
+
!query.SELECT.columns.some(c => c === '*') &&
|
|
1298
|
+
!query.SELECT.columns.some(c => c.func && AGGREGATION_FUNCTIONS.includes(c.func))
|
|
1299
|
+
) {
|
|
1300
|
+
const keys = _entityKeys(query._target)
|
|
1301
|
+
for (const key of keys) {
|
|
1302
|
+
if (!query.SELECT.columns.some(c => c.ref?.[0] === key)) query.SELECT.columns.push({ ref: [key] })
|
|
1303
|
+
}
|
|
1304
|
+
}
|
|
1305
|
+
|
|
1306
|
+
// Query active entity instances
|
|
1307
|
+
const actives = await run(query)
|
|
1308
|
+
|
|
1309
|
+
if (!actives || (Array.isArray(actives) && !actives.length)) return actives
|
|
1310
|
+
if (!query._target.drafts) return actives
|
|
1311
|
+
|
|
1312
|
+
// Query corresponding drafts, if not explicitly ignored
|
|
1313
|
+
const drafts = !ignoreDrafts ? await this.run(Read.complementaryDrafts(query, actives)) : []
|
|
1314
|
+
|
|
1315
|
+
Read.merge(query._target, actives, drafts, (row, other) => {
|
|
1316
|
+
if (other) {
|
|
1317
|
+
if ('DraftAdministrativeData' in other) row.DraftAdministrativeData = other.DraftAdministrativeData
|
|
1318
|
+
if ('DraftAdministrativeData_DraftUUID' in other)
|
|
1319
|
+
row.DraftAdministrativeData_DraftUUID = other.DraftAdministrativeData_DraftUUID
|
|
1320
|
+
Object.assign(row, { HasActiveEntity: false, HasDraftEntity: true })
|
|
1321
|
+
} else
|
|
1322
|
+
Object.assign(row, {
|
|
1323
|
+
HasActiveEntity: false,
|
|
1324
|
+
HasDraftEntity: false,
|
|
1325
|
+
DraftAdministrativeData: null,
|
|
1326
|
+
DraftAdministrativeData_DraftUUID: null
|
|
1327
|
+
})
|
|
1328
|
+
_fillIsActiveEntity(row, true, query._target)
|
|
1329
|
+
})
|
|
1330
|
+
|
|
1331
|
+
return _requested(actives, query)
|
|
1332
|
+
},
|
|
1333
|
+
|
|
1334
|
+
unchanged: async function (run, query) {
|
|
1335
|
+
LOG.debug('List Editing Status: Unchanged')
|
|
1336
|
+
|
|
1337
|
+
const draftsQuery = query._drafts
|
|
1338
|
+
if (!draftsQuery) cds.error({ status: 400, message: 'INVALID_DRAFT_REQUEST' }) // only via drafts
|
|
1339
|
+
draftsQuery.SELECT.count = undefined
|
|
1340
|
+
draftsQuery.SELECT.orderBy = undefined
|
|
1341
|
+
draftsQuery.SELECT.limit = null
|
|
1342
|
+
draftsQuery.SELECT.columns = _entityKeys(query._target).map(k => ({ ref: [k] }))
|
|
1343
|
+
|
|
1344
|
+
const drafts = await draftsQuery.where({ HasActiveEntity: true })
|
|
1345
|
+
const res = await Read.onlyActives(run, query.where(Read.whereNotIn(query._target, drafts)), {
|
|
1346
|
+
ignoreDrafts: true
|
|
1347
|
+
})
|
|
1348
|
+
return _requested(res, query)
|
|
1349
|
+
},
|
|
1350
|
+
|
|
1351
|
+
ownDrafts: async function (run, query) {
|
|
1352
|
+
LOG.debug('List Editing Status: Own Draft')
|
|
1353
|
+
|
|
1354
|
+
if (!query._drafts) cds.error({ status: 400, message: 'INVALID_DRAFT_REQUEST' }) // only via drafts
|
|
1355
|
+
|
|
1356
|
+
// read active from draft
|
|
1357
|
+
if (!query._drafts._target?.name.endsWith('.drafts')) {
|
|
1358
|
+
const result = await run(query._drafts)
|
|
1359
|
+
|
|
1360
|
+
// active entity is draft enabled, draft columns have to be removed
|
|
1361
|
+
if (query._drafts._target?.drafts) {
|
|
1362
|
+
Read.merge(query._drafts._target, result, [], row => {
|
|
1363
|
+
delete row.IsActiveEntity
|
|
1364
|
+
delete row.HasDraftEntity
|
|
1365
|
+
delete row.HasActiveEntity
|
|
1366
|
+
delete row.DraftAdministrativeData_DraftUUID
|
|
1367
|
+
})
|
|
1368
|
+
}
|
|
1369
|
+
return result
|
|
1370
|
+
}
|
|
1371
|
+
|
|
1372
|
+
const selectedColumnNames = query._drafts.SELECT.columns?.map(c => c.ref?.[0] || c) || ['*']
|
|
1373
|
+
const isAllKeysSelected =
|
|
1374
|
+
selectedColumnNames.includes('*') ||
|
|
1375
|
+
Object.keys(query._drafts._target.keys).every(k => selectedColumnNames.includes(k))
|
|
1376
|
+
|
|
1377
|
+
let txModel
|
|
1378
|
+
if (IS_PERSISTED_DRAFT_MESSAGES_ENABLED && isAllKeysSelected) {
|
|
1379
|
+
// Replace selection of 'DraftMessages' with the proper path expression
|
|
1380
|
+
|
|
1381
|
+
query._drafts.SELECT.columns = [
|
|
1382
|
+
...(query._drafts.SELECT.columns ?? ['*']).filter(c => c.ref?.[0] !== 'DraftMessages'),
|
|
1383
|
+
{ ref: ['DraftAdministrativeData', 'DraftMessages'], as: 'DraftMessages' }
|
|
1384
|
+
]
|
|
1385
|
+
|
|
1386
|
+
txModel = cds.context.tx.model
|
|
1387
|
+
}
|
|
1388
|
+
|
|
1389
|
+
const draftsQuery = query._drafts.where(
|
|
1390
|
+
{ ref: ['DraftAdministrativeData', 'InProcessByUser'] },
|
|
1391
|
+
'=',
|
|
1392
|
+
cds.context.user.id
|
|
1393
|
+
)
|
|
1394
|
+
|
|
1395
|
+
const drafts = await run(draftsQuery)
|
|
1396
|
+
Read.merge(query._target, drafts, [], row => {
|
|
1397
|
+
Object.assign(row, {
|
|
1398
|
+
HasDraftEntity: false
|
|
1399
|
+
})
|
|
1400
|
+
_fillIsActiveEntity(row, false, query._drafts._target)
|
|
1401
|
+
|
|
1402
|
+
if (IS_PERSISTED_DRAFT_MESSAGES_ENABLED && row.DraftMessages?.length) {
|
|
1403
|
+
// Based on the query for own drafts, compile the ref of a query matching
|
|
1404
|
+
// the format produced by cds.odata.parse to compare against message prefixes
|
|
1405
|
+
|
|
1406
|
+
const queryRootEntity = txModel.definitions[draftsQuery.SELECT.from.ref[0].id || draftsQuery.SELECT.from.ref[0]]
|
|
1407
|
+
const queryPrefixRef = _extractPrefixRef(draftsQuery.SELECT.from.ref, queryRootEntity)
|
|
1408
|
+
|
|
1409
|
+
if (queryPrefixRef.length > 1) {
|
|
1410
|
+
let targetRef = queryPrefixRef[queryPrefixRef.length - 1]
|
|
1411
|
+
if (typeof targetRef === 'string') {
|
|
1412
|
+
// Construct key from model info and result data
|
|
1413
|
+
|
|
1414
|
+
queryPrefixRef[queryPrefixRef.length - 1] = targetRef = { id: targetRef, where: [] }
|
|
1415
|
+
|
|
1416
|
+
// This repliactes the strucutally equivalent logic from _compileUpdatedDraftMessages
|
|
1417
|
+
// > This is necessary to enable filtering for messages realted to a newly created entity
|
|
1418
|
+
// > Since readAfterRide will put key info into a filter rather than into the path
|
|
1419
|
+
for (const k in draftsQuery._target.actives.keys) {
|
|
1420
|
+
const key = draftsQuery._target.actives.keys[k]
|
|
1421
|
+
let v = row[key.name]
|
|
1422
|
+
if (v === undefined)
|
|
1423
|
+
if (key.name === 'IsActiveEntity') v = false
|
|
1424
|
+
else continue
|
|
1425
|
+
if (v instanceof Buffer) v = v.toString('base64') //> convert binary keys to base64
|
|
1426
|
+
if (targetRef.where.length > 0) targetRef.where.push('and')
|
|
1427
|
+
targetRef.where.push({ ref: [key.name] }, '=', { val: v })
|
|
1428
|
+
}
|
|
1429
|
+
}
|
|
1430
|
+
}
|
|
1431
|
+
|
|
1432
|
+
// Reduce persisted draft messages to the set of those that are relevant for this result row:
|
|
1433
|
+
// Specification: https://sapui5.hana.ondemand.com/#/topic/fbe1cb5613cf4a40a841750bf813238e:~:text=Lifecycle%20Management%20for%20State%20Messages,-The%20lifecycle%20management
|
|
1434
|
+
const filteredDraftMessages = row.DraftMessages.reduce((acc, msg) => {
|
|
1435
|
+
const msgPrefixRef = cds.odata.parse(msg.prefix).SELECT.from.ref
|
|
1436
|
+
if (queryPrefixRef.length > msgPrefixRef.length) return acc
|
|
1437
|
+
|
|
1438
|
+
// TODO: This seems excessive ... how to compare more efficiently?
|
|
1439
|
+
const queryPrefixUrl = cds.odata.urlify(
|
|
1440
|
+
{ SELECT: { from: { ref: queryPrefixRef } } },
|
|
1441
|
+
{ kind: 'odata-v4', model: txModel }
|
|
1442
|
+
).path
|
|
1443
|
+
const msgPrefixUrl = cds.odata.urlify(
|
|
1444
|
+
{ SELECT: { from: { ref: msgPrefixRef } } },
|
|
1445
|
+
{ kind: 'odata-v4', model: txModel }
|
|
1446
|
+
).path
|
|
1447
|
+
|
|
1448
|
+
if (!msgPrefixUrl.startsWith(queryPrefixUrl)) return acc
|
|
1449
|
+
|
|
1450
|
+
msg.target = `/${msg.prefix}/${msg.target}`
|
|
1451
|
+
if (msg.additionalTargets?.length)
|
|
1452
|
+
msg.additionalTargets = msg.additionalTargets.map(additionalTarget => `/${msg.prefix}/${additionalTarget}`)
|
|
1453
|
+
|
|
1454
|
+
delete msg.prefix
|
|
1455
|
+
|
|
1456
|
+
acc.push(msg)
|
|
1457
|
+
return acc
|
|
1458
|
+
}, [])
|
|
1459
|
+
|
|
1460
|
+
const { locale } = cds.context
|
|
1461
|
+
row.DraftMessages = filteredDraftMessages.map(e => {
|
|
1462
|
+
// eslint-disable-next-line no-unused-vars
|
|
1463
|
+
const { status, args, _i18n, ...cleansed } = odata.localized(e, locale)
|
|
1464
|
+
return cleansed
|
|
1465
|
+
})
|
|
1466
|
+
}
|
|
1467
|
+
})
|
|
1468
|
+
|
|
1469
|
+
return _requested(drafts, query)
|
|
1470
|
+
},
|
|
1471
|
+
|
|
1472
|
+
all: async function (run, query) {
|
|
1473
|
+
LOG.debug('List Editing Status: All')
|
|
1474
|
+
|
|
1475
|
+
if (!query._drafts) return []
|
|
1476
|
+
|
|
1477
|
+
query._drafts.SELECT.count = false
|
|
1478
|
+
query._drafts.SELECT.limit = null // we need all entries for the keys to properly select actives (count)
|
|
1479
|
+
const isCount = _isCount(query._drafts)
|
|
1480
|
+
if (isCount) {
|
|
1481
|
+
query._drafts.SELECT.columns = _entityKeys(query._target).map(k => ({ ref: [k] }))
|
|
1482
|
+
}
|
|
1483
|
+
if (!query._drafts.SELECT.columns) query._drafts.SELECT.columns = ['*']
|
|
1484
|
+
if (!query._drafts.SELECT.columns.some(c => c.ref?.[0] === 'HasActiveEntity')) {
|
|
1485
|
+
query._drafts.SELECT.columns.push({ ref: ['HasActiveEntity'] })
|
|
1486
|
+
}
|
|
1487
|
+
|
|
1488
|
+
const orderByExpr = query.SELECT.orderBy
|
|
1489
|
+
const getOrderByColumns = columns => {
|
|
1490
|
+
const selectAll = columns === undefined || columns.includes('*')
|
|
1491
|
+
const queryColumns = !selectAll && columns && columns.map(column => column.as || column?.ref?.[0]).filter(c => c)
|
|
1492
|
+
const newColumns = []
|
|
1493
|
+
|
|
1494
|
+
for (const column of orderByExpr) {
|
|
1495
|
+
if (selectAll || !queryColumns.includes(column.ref.join('_'))) {
|
|
1496
|
+
if (column.ref.length === 1 && selectAll) continue
|
|
1497
|
+
const columnClone = { ...column }
|
|
1498
|
+
delete columnClone.sort
|
|
1499
|
+
columnClone.as = columnClone.ref.join('_')
|
|
1500
|
+
newColumns.push(columnClone)
|
|
1501
|
+
}
|
|
1502
|
+
}
|
|
1503
|
+
|
|
1504
|
+
return newColumns
|
|
1505
|
+
}
|
|
1506
|
+
|
|
1507
|
+
let orderByDraftColumns
|
|
1508
|
+
if (orderByExpr) {
|
|
1509
|
+
orderByDraftColumns = getOrderByColumns(query._drafts.SELECT.columns)
|
|
1510
|
+
if (orderByDraftColumns.length) query._drafts.SELECT.columns.push(...orderByDraftColumns)
|
|
1511
|
+
}
|
|
1512
|
+
|
|
1513
|
+
const ownDrafts = await run(
|
|
1514
|
+
query._drafts.where({ ref: ['DraftAdministrativeData', 'InProcessByUser'] }, '=', cds.context.user.id)
|
|
1515
|
+
)
|
|
1516
|
+
const draftLength = ownDrafts.length
|
|
1517
|
+
const limit = query.SELECT.limit?.rows?.val ?? getPageSize(query._target).max
|
|
1518
|
+
const offset = query.SELECT.limit?.offset?.val ?? 0
|
|
1519
|
+
query.SELECT.limit = {
|
|
1520
|
+
rows: { val: limit + draftLength }, // virtual limit
|
|
1521
|
+
offset: { val: Math.max(0, offset - draftLength) } // virtual offset
|
|
1522
|
+
}
|
|
1523
|
+
|
|
1524
|
+
let orderByColumns
|
|
1525
|
+
if (orderByExpr) {
|
|
1526
|
+
orderByColumns = getOrderByColumns(query.SELECT.columns)
|
|
1527
|
+
if (orderByColumns.length) {
|
|
1528
|
+
query.SELECT.columns = query.SELECT.columns ?? ['*']
|
|
1529
|
+
query.SELECT.columns.push(...orderByColumns)
|
|
1530
|
+
}
|
|
1531
|
+
}
|
|
1532
|
+
|
|
1533
|
+
const queryElements = query.elements
|
|
1534
|
+
const actives = await run(query.where(Read.whereNotIn(query._target, ownDrafts)))
|
|
1535
|
+
const removeColumns = (columns, toRemoveCols) => {
|
|
1536
|
+
if (!toRemoveCols) return
|
|
1537
|
+
for (const c of toRemoveCols) columns.forEach((column, index) => c.as === column.as && columns.splice(index, 1))
|
|
1538
|
+
}
|
|
1539
|
+
removeColumns(query._drafts.SELECT.columns, orderByDraftColumns)
|
|
1540
|
+
removeColumns(query.SELECT.columns, orderByColumns)
|
|
1541
|
+
|
|
1542
|
+
const ownNewDrafts = []
|
|
1543
|
+
const ownEditDrafts = []
|
|
1544
|
+
for (const draft of ownDrafts) {
|
|
1545
|
+
if (draft.HasActiveEntity) ownEditDrafts.push(draft)
|
|
1546
|
+
else ownNewDrafts.push(draft)
|
|
1547
|
+
}
|
|
1548
|
+
|
|
1549
|
+
let $count = isCount ? actives[0]?.$count : actives?.$count
|
|
1550
|
+
$count = $count != null ? Number($count) : 0
|
|
1551
|
+
$count += ownDrafts.length
|
|
1552
|
+
|
|
1553
|
+
if (isCount) return { $count: count_as_string ? `${$count}` : $count }
|
|
1554
|
+
|
|
1555
|
+
Read.merge(query._target, ownDrafts, [], row => {
|
|
1556
|
+
Object.assign(row, { HasDraftEntity: false })
|
|
1557
|
+
_fillIsActiveEntity(row, false, query._drafts._target)
|
|
1558
|
+
})
|
|
1559
|
+
const otherEditDrafts = actives?.length ? await this.run(Read.complementaryDrafts(query, actives)) : []
|
|
1560
|
+
Read.merge(query._target, actives, otherEditDrafts, (row, other) => {
|
|
1561
|
+
if (other) {
|
|
1562
|
+
Object.assign(row, {
|
|
1563
|
+
HasDraftEntity: true,
|
|
1564
|
+
HasActiveEntity: false,
|
|
1565
|
+
DraftAdministrativeData_DraftUUID: other.DraftAdministrativeData_DraftUUID,
|
|
1566
|
+
DraftAdministrativeData: other.DraftAdministrativeData
|
|
1567
|
+
})
|
|
1568
|
+
} else {
|
|
1569
|
+
Object.assign(row, {
|
|
1570
|
+
HasDraftEntity: false,
|
|
1571
|
+
HasActiveEntity: false,
|
|
1572
|
+
DraftAdministrativeData_DraftUUID: null,
|
|
1573
|
+
DraftAdministrativeData: null
|
|
1574
|
+
})
|
|
1575
|
+
}
|
|
1576
|
+
_fillIsActiveEntity(row, true, query._target)
|
|
1577
|
+
})
|
|
1578
|
+
const resultSet =
|
|
1579
|
+
actives.length > 0 && ownDrafts.length === 0
|
|
1580
|
+
? actives
|
|
1581
|
+
: ownDrafts.length > 0 && actives.length === 0
|
|
1582
|
+
? ownDrafts
|
|
1583
|
+
: [...ownDrafts, ...actives]
|
|
1584
|
+
|
|
1585
|
+
// runtime sort required
|
|
1586
|
+
if (orderByExpr && ownDrafts.length > 0 && actives.length > 0) {
|
|
1587
|
+
const locale = cds.context.locale?.replaceAll('_', '-')
|
|
1588
|
+
const collatorMap = new Map()
|
|
1589
|
+
const elementNamesToSort = orderByExpr.map(orderByExp => orderByExp.ref.join('_'))
|
|
1590
|
+
|
|
1591
|
+
for (const elementName of elementNamesToSort) {
|
|
1592
|
+
const element = queryElements[elementName] ?? query._target.elements[elementName] // The latter is needed for CDS orderBy statements
|
|
1593
|
+
if (!element) continue
|
|
1594
|
+
|
|
1595
|
+
let collatorOptions
|
|
1596
|
+
|
|
1597
|
+
switch (element.type) {
|
|
1598
|
+
case 'cds.Integer':
|
|
1599
|
+
case 'cds.UInt8':
|
|
1600
|
+
case 'cds.Int16':
|
|
1601
|
+
case 'cds.Int32':
|
|
1602
|
+
case 'cds.Integer64':
|
|
1603
|
+
case 'cds.Int64':
|
|
1604
|
+
case 'cds.Decimal':
|
|
1605
|
+
case 'cds.DecimalFloat':
|
|
1606
|
+
case 'cds.Double':
|
|
1607
|
+
collatorOptions = numericCollator
|
|
1608
|
+
break
|
|
1609
|
+
|
|
1610
|
+
default:
|
|
1611
|
+
collatorOptions = emptyObject
|
|
1612
|
+
}
|
|
1613
|
+
|
|
1614
|
+
const collator = Intl.Collator(locale, collatorOptions)
|
|
1615
|
+
collatorMap.set(elementName, collator)
|
|
1616
|
+
}
|
|
1617
|
+
|
|
1618
|
+
const getSortFn =
|
|
1619
|
+
(index = 0) =>
|
|
1620
|
+
(entityA, entityB) => {
|
|
1621
|
+
const orderBy = orderByExpr[index]
|
|
1622
|
+
const elementName = elementNamesToSort[index]
|
|
1623
|
+
const collator = collatorMap.get(elementName)
|
|
1624
|
+
const valueA = entityA[elementName]
|
|
1625
|
+
const valueB = entityB[elementName]
|
|
1626
|
+
|
|
1627
|
+
if (valueA == null && valueB == null) {
|
|
1628
|
+
// continue to next sort criterion
|
|
1629
|
+
if (index + 1 < orderByExpr.length) return getSortFn(index + 1)(entityA, entityB)
|
|
1630
|
+
return 0
|
|
1631
|
+
}
|
|
1632
|
+
|
|
1633
|
+
const nullsFirst = orderBy.nulls ? orderBy.nulls.toLowerCase() === 'first' : orderBy.sort === 'asc'
|
|
1634
|
+
if (valueA == null) return nullsFirst ? -1 : 1
|
|
1635
|
+
if (valueB == null) return nullsFirst ? 1 : -1
|
|
1636
|
+
|
|
1637
|
+
const diff = collator.compare(valueA, valueB)
|
|
1638
|
+
|
|
1639
|
+
if (diff === 0 && index + 1 < orderByExpr.length) return getSortFn(index + 1)(entityA, entityB)
|
|
1640
|
+
if (orderBy.sort === 'desc') return diff * -1
|
|
1641
|
+
return diff
|
|
1642
|
+
}
|
|
1643
|
+
|
|
1644
|
+
resultSet.sort(getSortFn())
|
|
1645
|
+
}
|
|
1646
|
+
|
|
1647
|
+
let virtualOffset = offset - draftLength
|
|
1648
|
+
virtualOffset = virtualOffset > 0 ? draftLength : draftLength + virtualOffset
|
|
1649
|
+
const pageResultSet = _filterResultSet(resultSet, limit, virtualOffset)
|
|
1650
|
+
if (query.SELECT.count) {
|
|
1651
|
+
$count += ownDrafts.$count != null ? Number(ownDrafts.$count) : 0
|
|
1652
|
+
pageResultSet.$count = count_as_string ? `${$count}` : $count
|
|
1653
|
+
}
|
|
1654
|
+
return _requested(pageResultSet, query)
|
|
1655
|
+
},
|
|
1656
|
+
|
|
1657
|
+
activesFromDrafts: async function (run, query, { isLocked = true }) {
|
|
1658
|
+
const draftsQuery = query._drafts
|
|
1659
|
+
if (!draftsQuery) cds.error({ status: 400, message: 'INVALID_DRAFT_REQUEST' }) // only via drafts
|
|
1660
|
+
|
|
1661
|
+
const additionalCols = draftsQuery.SELECT.columns
|
|
1662
|
+
? draftsQuery.SELECT.columns.filter(
|
|
1663
|
+
c => c.ref && ['DraftAdministrativeData', 'DraftAdministrativeData_DraftUUID'].includes(c.ref[0])
|
|
1664
|
+
)
|
|
1665
|
+
: [{ ref: ['DraftAdministrativeData_DraftUUID'] }]
|
|
1666
|
+
draftsQuery.SELECT.columns = _entityKeys(query._target)
|
|
1667
|
+
.map(k => ({ ref: [k] }))
|
|
1668
|
+
.concat(additionalCols)
|
|
1669
|
+
draftsQuery.where({
|
|
1670
|
+
HasActiveEntity: true,
|
|
1671
|
+
'DraftAdministrativeData.InProcessByUser': { '!=': cds.context.user.id },
|
|
1672
|
+
'DraftAdministrativeData.LastChangeDateTime': {
|
|
1673
|
+
[isLocked ? '>' : '<']: _lock.shiftedNow
|
|
1674
|
+
}
|
|
1675
|
+
})
|
|
1676
|
+
const drafts = await draftsQuery
|
|
1677
|
+
const actives = drafts.length
|
|
1678
|
+
? await run(query.where(Read.whereIn(query._target, drafts)))
|
|
1679
|
+
: Object.assign([], { $count: count_as_string ? '0' : 0 })
|
|
1680
|
+
Read.merge(query._target, actives, drafts, (row, other) => {
|
|
1681
|
+
if (other) Object.assign(row, other, { HasDraftEntity: true, HasActiveEntity: false })
|
|
1682
|
+
else Object.assign({ HasDraftEntity: false, HasActiveEntity: false })
|
|
1683
|
+
_fillIsActiveEntity(row, true, query._target)
|
|
1684
|
+
})
|
|
1685
|
+
return _requested(actives, query)
|
|
1686
|
+
},
|
|
1687
|
+
|
|
1688
|
+
unsavedChangesByAnotherUser: async function (run, query) {
|
|
1689
|
+
LOG.debug('List Editing Status: Unsaved Changes by Another User')
|
|
1690
|
+
|
|
1691
|
+
return Read.activesFromDrafts(run, query, { isLocked: false })
|
|
1692
|
+
},
|
|
1693
|
+
|
|
1694
|
+
lockedByAnotherUser: async function (run, query) {
|
|
1695
|
+
LOG.debug('List Editing Status: Locked by Another User')
|
|
1696
|
+
|
|
1697
|
+
return Read.activesFromDrafts(run, query, { isLocked: true })
|
|
1698
|
+
},
|
|
1699
|
+
|
|
1700
|
+
whereNotIn: (target, data) => Read.whereIn(target, data, true),
|
|
1701
|
+
|
|
1702
|
+
whereIn: (target, data, not = false) => {
|
|
1703
|
+
const keys = _entityKeys(target)
|
|
1704
|
+
const dataArray = data ? (Array.isArray(data) ? data : [data]) : []
|
|
1705
|
+
if (not && !dataArray.length) return []
|
|
1706
|
+
if (keys.length === 1) {
|
|
1707
|
+
// For single keys, make it nicer (without unnecessary lists)
|
|
1708
|
+
const key = keys[0]
|
|
1709
|
+
const left = { ref: [key] }
|
|
1710
|
+
const op = not ? ['not', 'in'] : ['in']
|
|
1711
|
+
const right = { list: dataArray.map(r => ({ val: r[key] })) }
|
|
1712
|
+
return [left, ...op, right]
|
|
1713
|
+
} else {
|
|
1714
|
+
const left = { list: keys.map(k => ({ ref: [k] })) }
|
|
1715
|
+
const op = not ? ['not', 'in'] : ['in']
|
|
1716
|
+
const right = { list: dataArray.map(r => ({ list: keys.map(k => ({ val: r[k] })) })) }
|
|
1717
|
+
return [left, ...op, right]
|
|
1718
|
+
}
|
|
1719
|
+
},
|
|
1720
|
+
|
|
1721
|
+
complementaryDrafts: (query, _actives) => {
|
|
1722
|
+
const actives = Array.isArray(_actives) ? _actives : [_actives]
|
|
1723
|
+
if (!actives.length) return []
|
|
1724
|
+
const drafts = SELECT.from(query._target.drafts)
|
|
1725
|
+
drafts[$draftParams] = query[$draftParams]
|
|
1726
|
+
drafts.SELECT.where = Read.whereIn(query._target, actives)
|
|
1727
|
+
const newColumns = _entityKeys(query._target).map(k => ({ ref: [k] }))
|
|
1728
|
+
const queryDrafts = query._drafts
|
|
1729
|
+
if (queryDrafts) {
|
|
1730
|
+
if (
|
|
1731
|
+
!queryDrafts.SELECT.columns ||
|
|
1732
|
+
queryDrafts.SELECT.columns.some(c => c === '*' || c.ref?.[0] === 'DraftAdministrativeData_DraftUUID')
|
|
1733
|
+
)
|
|
1734
|
+
newColumns.push({ ref: ['DraftAdministrativeData_DraftUUID'] })
|
|
1735
|
+
const draftAdmin = queryDrafts.SELECT.columns?.find(c => c.ref?.[0] === 'DraftAdministrativeData')
|
|
1736
|
+
if (draftAdmin) newColumns.push(draftAdmin)
|
|
1737
|
+
}
|
|
1738
|
+
drafts.SELECT.columns = newColumns
|
|
1739
|
+
return drafts
|
|
1740
|
+
},
|
|
1741
|
+
|
|
1742
|
+
draftStream: async (run, query) => {
|
|
1743
|
+
// read from draft
|
|
1744
|
+
const result = await Read.ownDrafts(run, query)
|
|
1745
|
+
if (!Array.isArray(result)) {
|
|
1746
|
+
for (let key in result) {
|
|
1747
|
+
if (result[key] instanceof Readable) {
|
|
1748
|
+
result[key] =
|
|
1749
|
+
result[key].constructor.name === 'HanaLobStream'
|
|
1750
|
+
? await _readDraftStreamHanaClient(result[key], query, key)
|
|
1751
|
+
: _readDraftStream(result[key], query, key)
|
|
1752
|
+
}
|
|
1753
|
+
}
|
|
1754
|
+
}
|
|
1755
|
+
|
|
1756
|
+
return result
|
|
1757
|
+
},
|
|
1758
|
+
|
|
1759
|
+
_makeArray: data => (Array.isArray(data) ? data : data ? [data] : []),
|
|
1760
|
+
|
|
1761
|
+
_index: (target, data) => {
|
|
1762
|
+
// Indexes the data for fast key access
|
|
1763
|
+
const dataArray = Read._makeArray(data)
|
|
1764
|
+
if (!dataArray.length) return
|
|
1765
|
+
const hash = row =>
|
|
1766
|
+
_entityKeys(target)
|
|
1767
|
+
.map(k => row[k])
|
|
1768
|
+
.reduce((res, curr) => res + '|$|' + curr, '')
|
|
1769
|
+
const hashMap = new Map()
|
|
1770
|
+
for (const row of dataArray) hashMap.set(hash(row), row)
|
|
1771
|
+
return { hashMap, hash }
|
|
1772
|
+
},
|
|
1773
|
+
|
|
1774
|
+
// Calls `cb` for each entry of data with a potential counterpart in otherData
|
|
1775
|
+
merge: (target, data, otherData, cb) => {
|
|
1776
|
+
const dataArray = Read._makeArray(data)
|
|
1777
|
+
if (!dataArray.length) return
|
|
1778
|
+
|
|
1779
|
+
const index = Read._index(target, otherData)
|
|
1780
|
+
for (const row of dataArray) {
|
|
1781
|
+
const other = index?.hashMap.get(index.hash(row))
|
|
1782
|
+
cb(row, other)
|
|
1783
|
+
}
|
|
1784
|
+
},
|
|
1785
|
+
|
|
1786
|
+
// Deletes entries of data with a counterpart in otherData
|
|
1787
|
+
delete: (target, data, otherData) => {
|
|
1788
|
+
if (!Array.isArray(data) || !data.length) return
|
|
1789
|
+
|
|
1790
|
+
const index = Read._index(target, otherData)
|
|
1791
|
+
let i = data.length
|
|
1792
|
+
while (i--) {
|
|
1793
|
+
if (index?.hashMap.get(index.hash(data[i]))) data.splice(i, 1)
|
|
1794
|
+
}
|
|
1795
|
+
}
|
|
1796
|
+
}
|
|
1797
|
+
|
|
1798
|
+
function _cleanseParams(params, target) {
|
|
1799
|
+
if (!target?.drafts) return
|
|
1800
|
+
if (Array.isArray(params)) {
|
|
1801
|
+
for (const param of params) _cleanseParams(param, target)
|
|
1802
|
+
return
|
|
1803
|
+
}
|
|
1804
|
+
if (typeof params === 'object') {
|
|
1805
|
+
for (const key in params) {
|
|
1806
|
+
if (key === 'IsActiveEntity') {
|
|
1807
|
+
const value = params[key]
|
|
1808
|
+
delete params[key]
|
|
1809
|
+
Object.defineProperty(params, key, { value, enumerable: false, writeable: true, configurable: true })
|
|
1810
|
+
}
|
|
1811
|
+
}
|
|
1812
|
+
}
|
|
1813
|
+
}
|
|
1814
|
+
|
|
1815
|
+
function _cleanseCols(columns, elements, target) {
|
|
1816
|
+
// TODO: sometimes target is undefined
|
|
1817
|
+
if (!target || typeof columns?.filter !== 'function') return columns
|
|
1818
|
+
const filtered = target?.drafts ? columns.filter(c => !elements.has(c.ref?.[0])) : columns
|
|
1819
|
+
return filtered.map(c => {
|
|
1820
|
+
if (c.expand && c.ref) {
|
|
1821
|
+
return { ...c, expand: _cleanseCols(c.expand, elements, target.elements[c.ref[0]]?._target) }
|
|
1822
|
+
}
|
|
1823
|
+
return c
|
|
1824
|
+
})
|
|
1825
|
+
}
|
|
1826
|
+
|
|
1827
|
+
let DRAFT_ADMIN_ELEMENTS
|
|
1828
|
+
/**
|
|
1829
|
+
* Creates a clone of the query, cleanses and collects all draft parameters into DRAFT_PARAMS.
|
|
1830
|
+
*/
|
|
1831
|
+
function _cleansed(query, model) {
|
|
1832
|
+
const draftParams = {} //> used to collect draft filter criteria
|
|
1833
|
+
const q = _cleanseQuery(query, draftParams, model)
|
|
1834
|
+
if (query.SELECT) {
|
|
1835
|
+
const getDrafts = () => {
|
|
1836
|
+
// could just clone `query` but the latter is ruined by database layer
|
|
1837
|
+
const draftsQuery = _cleanseQuery(query, {}, model)
|
|
1838
|
+
|
|
1839
|
+
// set the target to null to ensure cds.infer(...) correctly infer the
|
|
1840
|
+
// target after query modifications
|
|
1841
|
+
Object.defineProperty(draftsQuery, '_target', { value: null, configurable: true, writable: true })
|
|
1842
|
+
let draftSelect = draftsQuery.SELECT
|
|
1843
|
+
let querySelect = query.SELECT
|
|
1844
|
+
|
|
1845
|
+
// in the $apply scenario, only the most inner nested SELECT data structure must be cleansed
|
|
1846
|
+
while (draftSelect.from.SELECT) {
|
|
1847
|
+
// set the target to null to ensure cds.infer(...) correctly infer the
|
|
1848
|
+
// target after query modifications
|
|
1849
|
+
if (draftSelect.from._target)
|
|
1850
|
+
Object.defineProperty(draftSelect.from, '_target', { value: null, configurable: true, writable: true })
|
|
1851
|
+
draftSelect = draftSelect.from.SELECT
|
|
1852
|
+
querySelect = querySelect.from.SELECT
|
|
1853
|
+
}
|
|
1854
|
+
|
|
1855
|
+
if (!draftSelect.from.ref) return // invalid draft request
|
|
1856
|
+
|
|
1857
|
+
const [root, ...tail] = draftSelect.from.ref
|
|
1858
|
+
const draft = model.definitions[root.id || root].drafts
|
|
1859
|
+
if (!draft) return
|
|
1860
|
+
draftSelect.from = {
|
|
1861
|
+
ref: [root.id ? { ...root, id: draft.name } : draft.name, ...tail]
|
|
1862
|
+
}
|
|
1863
|
+
cds.infer.target(draftsQuery)
|
|
1864
|
+
|
|
1865
|
+
// draftsQuery._target = draftsQuery._target?.drafts || draftsQuery._target
|
|
1866
|
+
if (querySelect.columns && query._target.drafts) {
|
|
1867
|
+
if (draftsQuery._target.isDraft)
|
|
1868
|
+
draftSelect.columns = _cleanseCols(querySelect.columns, REDUCED_DRAFT_ELEMENTS, draft)
|
|
1869
|
+
else draftSelect.columns = _cleanseCols(querySelect.columns, DRAFT_ELEMENTS, draft)
|
|
1870
|
+
}
|
|
1871
|
+
|
|
1872
|
+
if (querySelect.where && query._target.drafts) {
|
|
1873
|
+
if (draftsQuery._target.isDraft)
|
|
1874
|
+
draftSelect.where = _cleanseWhere(querySelect.where, {}, DRAFT_ELEMENTS_WITHOUT_HASACTIVE)
|
|
1875
|
+
else draftSelect.where = _cleanseWhere(querySelect.where, {}, DRAFT_ELEMENTS)
|
|
1876
|
+
}
|
|
1877
|
+
|
|
1878
|
+
if (querySelect.orderBy && query._target.drafts) {
|
|
1879
|
+
if (draftsQuery._target.isDraft)
|
|
1880
|
+
draftSelect.orderBy = _cleanseWhere(querySelect.orderBy, {}, REDUCED_DRAFT_ELEMENTS)
|
|
1881
|
+
else draftSelect.orderBy = _cleanseWhere(querySelect.orderBy, {}, DRAFT_ELEMENTS)
|
|
1882
|
+
}
|
|
1883
|
+
|
|
1884
|
+
if (draftsQuery._target.name.endsWith('.DraftAdministrativeData')) {
|
|
1885
|
+
draftSelect.columns = _tweakAdminCols(draftSelect.columns)
|
|
1886
|
+
} else if (draftsQuery._target?.name.endsWith('.drafts')) {
|
|
1887
|
+
draftSelect.columns = _tweakAdminExpand(draftSelect.columns)
|
|
1888
|
+
}
|
|
1889
|
+
|
|
1890
|
+
draftsQuery[$draftParams] = draftParams
|
|
1891
|
+
Object.defineProperty(q, '_drafts', { value: draftsQuery })
|
|
1892
|
+
return draftsQuery
|
|
1893
|
+
}
|
|
1894
|
+
|
|
1895
|
+
Object.defineProperty(q, '_drafts', {
|
|
1896
|
+
configurable: true,
|
|
1897
|
+
get() {
|
|
1898
|
+
return getDrafts()
|
|
1899
|
+
}
|
|
1900
|
+
})
|
|
1901
|
+
}
|
|
1902
|
+
|
|
1903
|
+
q[$draftParams] = draftParams
|
|
1904
|
+
q[$original] = query
|
|
1905
|
+
return q
|
|
1906
|
+
|
|
1907
|
+
function _cleanseQuery(query, draftParams, model) {
|
|
1908
|
+
const target = query._target
|
|
1909
|
+
const q = cds.ql.clone(query)
|
|
1910
|
+
|
|
1911
|
+
if (q.SELECT?.from.SELECT) q.SELECT.from = _cleanseQuery(q.SELECT?.from, draftParams, model)
|
|
1912
|
+
const ref =
|
|
1913
|
+
q.SELECT?.from.SELECT?.from.ref ||
|
|
1914
|
+
q.SELECT?.from.ref ||
|
|
1915
|
+
q.UPDATE?.entity.ref ||
|
|
1916
|
+
q.INSERT?.into.ref ||
|
|
1917
|
+
q.DELETE?.from.ref
|
|
1918
|
+
const cqn = q.SELECT || q.UPDATE || q.INSERT || q.DELETE
|
|
1919
|
+
|
|
1920
|
+
if (ref) {
|
|
1921
|
+
let entity
|
|
1922
|
+
const cleansedRef = ref.map(r => {
|
|
1923
|
+
entity = (entity && entity.elements[r.id || r]._target) || model.definitions[r.id || r]
|
|
1924
|
+
if (!entity?.drafts) return r
|
|
1925
|
+
return r.where ? { ...r, where: _cleanseWhere(r.where, draftParams, DRAFT_ELEMENTS) } : r
|
|
1926
|
+
})
|
|
1927
|
+
if (q.SELECT) q.SELECT.from = q.SELECT.from.SELECT ? q.SELECT.from : { ...q.SELECT.from, ref: cleansedRef }
|
|
1928
|
+
else if (q.DELETE) q.DELETE.from = { ...q.DELETE.from, ref: cleansedRef }
|
|
1929
|
+
else if (q.UPDATE) q.UPDATE.entity = { ...q.UPDATE.entity, ref: cleansedRef }
|
|
1930
|
+
else if (q.INSERT) q.INSERT.into = { ...q.INSERT.into, ref: cleansedRef }
|
|
1931
|
+
|
|
1932
|
+
// This only works for simple cases of `SiblingEntity`, e.g. `root(ID=1,IsActiveEntity=false)/SiblingEntity`
|
|
1933
|
+
// , check if there are more complicated use cases
|
|
1934
|
+
const siblingIdx = cleansedRef.findIndex(r => r === 'SiblingEntity')
|
|
1935
|
+
if (siblingIdx !== -1) {
|
|
1936
|
+
cleansedRef.splice(siblingIdx, 1)
|
|
1937
|
+
draftParams.IsActiveEntity = !draftParams.IsActiveEntity
|
|
1938
|
+
}
|
|
1939
|
+
}
|
|
1940
|
+
|
|
1941
|
+
if (target.drafts && cqn.where) cqn.where = _cleanseWhere(cqn.where, draftParams, DRAFT_ELEMENTS)
|
|
1942
|
+
if (target.drafts && cqn.orderBy) cqn.orderBy = _cleanseCols(cqn.orderBy, DRAFT_ELEMENTS, target) // allowed to reuse
|
|
1943
|
+
if (cqn.columns) cqn.columns = _cleanseCols(cqn.columns, DRAFT_ELEMENTS, target)
|
|
1944
|
+
return q
|
|
1945
|
+
}
|
|
1946
|
+
|
|
1947
|
+
function _tweakAdminExpand(columns) {
|
|
1948
|
+
if (!columns) return columns
|
|
1949
|
+
return columns.map(col => {
|
|
1950
|
+
if (col.ref?.[0] === 'DraftAdministrativeData') {
|
|
1951
|
+
return { ...col, expand: _tweakAdminCols(col.expand) }
|
|
1952
|
+
}
|
|
1953
|
+
return col
|
|
1954
|
+
})
|
|
1955
|
+
}
|
|
1956
|
+
|
|
1957
|
+
function _tweakAdminCols(columns) {
|
|
1958
|
+
if (!DRAFT_ADMIN_ELEMENTS) {
|
|
1959
|
+
DRAFT_ADMIN_ELEMENTS = []
|
|
1960
|
+
for (const key in cds.model.definitions['DRAFT.DraftAdministrativeData'].elements) DRAFT_ADMIN_ELEMENTS.push(key)
|
|
1961
|
+
}
|
|
1962
|
+
|
|
1963
|
+
if (!columns || columns.some(c => c === '*')) columns = DRAFT_ADMIN_ELEMENTS.map(k => ({ ref: [k] }))
|
|
1964
|
+
return columns.map(col => {
|
|
1965
|
+
const name = col.ref?.[0]
|
|
1966
|
+
if (!name) return col
|
|
1967
|
+
switch (name) {
|
|
1968
|
+
case 'DraftAdministrativeData':
|
|
1969
|
+
return { ...col, expand: _tweakAdminCols(col.expand) }
|
|
1970
|
+
case 'DraftIsCreatedByMe':
|
|
1971
|
+
return {
|
|
1972
|
+
xpr: [
|
|
1973
|
+
'case',
|
|
1974
|
+
'when',
|
|
1975
|
+
{ ref: ['CreatedByUser'] },
|
|
1976
|
+
'=',
|
|
1977
|
+
{ val: cds.context.user.id },
|
|
1978
|
+
'then',
|
|
1979
|
+
'true',
|
|
1980
|
+
'else',
|
|
1981
|
+
'false',
|
|
1982
|
+
'end'
|
|
1983
|
+
],
|
|
1984
|
+
as: 'DraftIsCreatedByMe',
|
|
1985
|
+
cast: { type: 'cds.Boolean' }
|
|
1986
|
+
}
|
|
1987
|
+
case 'InProcessByUser':
|
|
1988
|
+
return _inProcessByUserXpr(_lock.shiftedNow)
|
|
1989
|
+
case 'DraftIsProcessedByMe':
|
|
1990
|
+
return {
|
|
1991
|
+
xpr: [
|
|
1992
|
+
'case',
|
|
1993
|
+
'when',
|
|
1994
|
+
{ ref: ['InProcessByUser'] },
|
|
1995
|
+
'=',
|
|
1996
|
+
{ val: cds.context.user.id },
|
|
1997
|
+
'and',
|
|
1998
|
+
{ ref: ['LastChangeDateTime'] },
|
|
1999
|
+
'>',
|
|
2000
|
+
{ val: _lock.shiftedNow },
|
|
2001
|
+
'then',
|
|
2002
|
+
'true',
|
|
2003
|
+
'else',
|
|
2004
|
+
'false',
|
|
2005
|
+
'end'
|
|
2006
|
+
],
|
|
2007
|
+
as: 'DraftIsProcessedByMe',
|
|
2008
|
+
cast: { type: 'cds.Boolean' }
|
|
2009
|
+
}
|
|
2010
|
+
default:
|
|
2011
|
+
return col
|
|
2012
|
+
}
|
|
2013
|
+
})
|
|
2014
|
+
}
|
|
2015
|
+
|
|
2016
|
+
function _cleanseWhere(xpr, draftParams, ignoredElements) {
|
|
2017
|
+
const cleansed = []
|
|
2018
|
+
for (let i = 0; i < xpr.length; ++i) {
|
|
2019
|
+
let x = xpr[i]
|
|
2020
|
+
const e = x.ref?.[0]
|
|
2021
|
+
if (ignoredElements.has(e) && !xpr[i + 2]) {
|
|
2022
|
+
continue
|
|
2023
|
+
}
|
|
2024
|
+
if (ignoredElements.has(e) && xpr[i + 2]) {
|
|
2025
|
+
let { val } = xpr[i + 2]
|
|
2026
|
+
const param = x.ref.join('_')
|
|
2027
|
+
// outer-most parameters win
|
|
2028
|
+
if (draftParams[param] === undefined)
|
|
2029
|
+
draftParams[param] = xpr[i + 1] === '!=' ? (typeof val === 'boolean' ? !val : 'not ' + val) : val
|
|
2030
|
+
i += 2
|
|
2031
|
+
const last = cleansed[cleansed.length - 1]
|
|
2032
|
+
if (last === 'and' || last === 'or') cleansed.pop()
|
|
2033
|
+
continue
|
|
2034
|
+
}
|
|
2035
|
+
if (x.xpr) {
|
|
2036
|
+
x = { xpr: _cleanseWhere(x.xpr, draftParams, ignoredElements) }
|
|
2037
|
+
if (!x.xpr) {
|
|
2038
|
+
i += 1
|
|
2039
|
+
continue
|
|
2040
|
+
}
|
|
2041
|
+
}
|
|
2042
|
+
cleansed.push(x)
|
|
2043
|
+
}
|
|
2044
|
+
const first = cleansed[0]
|
|
2045
|
+
if (first === 'and' || first === 'or') cleansed.shift()
|
|
2046
|
+
const last = cleansed[cleansed.length - 1]
|
|
2047
|
+
if (last === 'and' || last === 'or') cleansed.pop()
|
|
2048
|
+
if (cleansed.length) return cleansed
|
|
2049
|
+
}
|
|
2050
|
+
}
|
|
2051
|
+
|
|
2052
|
+
// REVISIT: This function is better defined on DB layer
|
|
2053
|
+
function expandStarStar(target, draftActivate, recursion = new Map()) {
|
|
2054
|
+
const columns = []
|
|
2055
|
+
|
|
2056
|
+
for (const el in target.elements) {
|
|
2057
|
+
const element = target.elements[el]
|
|
2058
|
+
|
|
2059
|
+
// Skip calculated elements
|
|
2060
|
+
if (draftActivate && element.value) continue
|
|
2061
|
+
|
|
2062
|
+
// Make sure column is releveant & add it to output
|
|
2063
|
+
const isDraftInfo = DRAFT_ELEMENTS.has(el)
|
|
2064
|
+
const isGenerated = draftActivate && !!(element['@cds.on.insert'] || element['@cds.on.update'])
|
|
2065
|
+
const isLargeBinary = cds.env.fiori.move_media_data_in_db && draftActivate && element._type === 'cds.LargeBinary'
|
|
2066
|
+
const isSkippedType = element.isAssociation || isLargeBinary
|
|
2067
|
+
if (!isDraftInfo && !isGenerated && !isSkippedType && !element['@odata.draft.skip']) columns.push({ ref: [el] })
|
|
2068
|
+
|
|
2069
|
+
// Skip children where draft is explicitly disabled
|
|
2070
|
+
if (!element.isComposition || element._target['@odata.draft.enabled'] === false || element['@odata.draft.ignore'])
|
|
2071
|
+
continue // happens for texts if not @fiori.draft.enabled
|
|
2072
|
+
|
|
2073
|
+
// Make sure recursion depth is not exceeded
|
|
2074
|
+
const cacheKey = target.name + ':' + el
|
|
2075
|
+
let cache = recursion.get(cacheKey) ?? 0
|
|
2076
|
+
recursion.set(cacheKey, ++cache)
|
|
2077
|
+
if (cache >= MAX_RECURSION_DEPTH) continue
|
|
2078
|
+
|
|
2079
|
+
// Recurse
|
|
2080
|
+
const expandedColumns = expandStarStar(element._target, draftActivate, recursion)
|
|
2081
|
+
|
|
2082
|
+
// Unpack recursion result
|
|
2083
|
+
if (expandedColumns.length) columns.push({ ref: [el], expand: expandedColumns })
|
|
2084
|
+
}
|
|
2085
|
+
|
|
2086
|
+
return columns
|
|
2087
|
+
}
|
|
2088
|
+
|
|
2089
|
+
function _deepRemoveIsActiveEntity(data, target) {
|
|
2090
|
+
if (!data) return
|
|
2091
|
+
|
|
2092
|
+
delete data.IsActiveEntity
|
|
2093
|
+
|
|
2094
|
+
if (!target) return
|
|
2095
|
+
|
|
2096
|
+
// Also support deep insertions
|
|
2097
|
+
for (const key in data) {
|
|
2098
|
+
if (!target.elements[key]) return
|
|
2099
|
+
if (data[key] && target.elements[key].isAssociation) delete data[key].IsActiveEntity
|
|
2100
|
+
if (!target.elements[key].isComposition) continue
|
|
2101
|
+
if (Array.isArray(data[key])) data[key].map(v => _deepRemoveIsActiveEntity(v, target.elements[key]._target))
|
|
2102
|
+
else if (typeof data[key] === 'object') _deepRemoveIsActiveEntity(data[key], target.elements[key]._target)
|
|
2103
|
+
}
|
|
2104
|
+
}
|
|
2105
|
+
|
|
2106
|
+
async function onNew(req, next) {
|
|
2107
|
+
if (!req.target.isDraft) return next?.()
|
|
2108
|
+
|
|
2109
|
+
LOG.debug('new draft')
|
|
2110
|
+
|
|
2111
|
+
if (req.target.actives['@Capabilities.InsertRestrictions.Insertable'] === false || req.target.actives['@readonly'])
|
|
2112
|
+
cds.error(405)
|
|
2113
|
+
|
|
2114
|
+
//> support simple srv.send('NEW',entity,...)
|
|
2115
|
+
req.query ??= INSERT.into(req.subject).entries(req.data || {})
|
|
2116
|
+
|
|
2117
|
+
// Only allowed for pseudo draft roots (entities with this action)
|
|
2118
|
+
const isDirectAccess = req.query.INSERT.into.ref?.length === 1
|
|
2119
|
+
if (isDirectAccess && !req.target.actives['@Common.DraftRoot.ActivationAction'])
|
|
2120
|
+
cds.error({ status: 422, message: 'DRAFT_MODIFICATION_ONLY_VIA_ROOT' })
|
|
2121
|
+
|
|
2122
|
+
_cleanUpOldDrafts(this, req.tenant)
|
|
2123
|
+
|
|
2124
|
+
let DraftUUID
|
|
2125
|
+
let DraftMessages = []
|
|
2126
|
+
let nextDraftMessages = []
|
|
2127
|
+
if (isDirectAccess) DraftUUID = cds.utils.uuid()
|
|
2128
|
+
else {
|
|
2129
|
+
const rootData = await SELECT.one(req.query.INSERT.into.ref[0].id)
|
|
2130
|
+
.columns([
|
|
2131
|
+
{ ref: ['DraftAdministrativeData_DraftUUID'] },
|
|
2132
|
+
{
|
|
2133
|
+
ref: ['DraftAdministrativeData'],
|
|
2134
|
+
expand: [
|
|
2135
|
+
{ ref: ['InProcessByUser'] },
|
|
2136
|
+
...(IS_PERSISTED_DRAFT_MESSAGES_ENABLED ? [{ ref: ['DraftMessages'] }] : [])
|
|
2137
|
+
]
|
|
2138
|
+
}
|
|
2139
|
+
])
|
|
2140
|
+
.where(req.query.INSERT.into.ref[0].where)
|
|
2141
|
+
|
|
2142
|
+
if (!rootData) cds.error(404)
|
|
2143
|
+
if (!cds.context.user._is_privileged && rootData.DraftAdministrativeData?.InProcessByUser !== req.user.id)
|
|
2144
|
+
cds.error({
|
|
2145
|
+
status: 403,
|
|
2146
|
+
message: 'DRAFT_LOCKED_BY_ANOTHER_USER',
|
|
2147
|
+
args: [rootData.DraftAdministrativeData.InProcessByUser]
|
|
2148
|
+
})
|
|
2149
|
+
|
|
2150
|
+
DraftUUID = rootData.DraftAdministrativeData_DraftUUID
|
|
2151
|
+
DraftMessages = rootData.DraftAdministrativeData?.DraftMessages || []
|
|
2152
|
+
}
|
|
2153
|
+
|
|
2154
|
+
const timestamp = cds.context.timestamp.toISOString() // REVISIT: toISOString should be done on db layer
|
|
2155
|
+
const draftData = _createNewDraftData(req.query.INSERT.entries[0], req.target, DraftUUID)
|
|
2156
|
+
const draftCQN = INSERT.into(req.subject).entries(draftData)
|
|
2157
|
+
|
|
2158
|
+
const insertReq = _newReq(req, draftCQN, req.query[$draftParams], {})
|
|
2159
|
+
await this.dispatch(insertReq)
|
|
2160
|
+
|
|
2161
|
+
if (IS_PERSISTED_DRAFT_MESSAGES_ENABLED) {
|
|
2162
|
+
nextDraftMessages = compileUpdatedDraftMessages(
|
|
2163
|
+
req._validationErrors ?? [],
|
|
2164
|
+
DraftMessages,
|
|
2165
|
+
draftData,
|
|
2166
|
+
req.query.INSERT.into.ref
|
|
2167
|
+
)
|
|
2168
|
+
}
|
|
2169
|
+
|
|
2170
|
+
const adminDataCQN = isDirectAccess
|
|
2171
|
+
? INSERT.into('DRAFT.DraftAdministrativeData').entries({
|
|
2172
|
+
DraftUUID,
|
|
2173
|
+
CreationDateTime: timestamp,
|
|
2174
|
+
CreatedByUser: req.user.id,
|
|
2175
|
+
LastChangeDateTime: timestamp,
|
|
2176
|
+
LastChangedByUser: req.user.id,
|
|
2177
|
+
DraftIsCreatedByMe: true, // Dummy values
|
|
2178
|
+
DraftIsProcessedByMe: true, // Dummy values
|
|
2179
|
+
InProcessByUser: req.user.id,
|
|
2180
|
+
...(IS_PERSISTED_DRAFT_MESSAGES_ENABLED ? { DraftMessages: nextDraftMessages } : {})
|
|
2181
|
+
})
|
|
2182
|
+
: UPDATE('DRAFT.DraftAdministrativeData')
|
|
2183
|
+
.data({
|
|
2184
|
+
InProcessByUser: req.user.id,
|
|
2185
|
+
LastChangedByUser: req.user.id,
|
|
2186
|
+
LastChangeDateTime: timestamp,
|
|
2187
|
+
...(IS_PERSISTED_DRAFT_MESSAGES_ENABLED ? { DraftMessages: nextDraftMessages } : {})
|
|
2188
|
+
})
|
|
2189
|
+
.where({ DraftUUID })
|
|
2190
|
+
|
|
2191
|
+
await adminDataCQN
|
|
2192
|
+
|
|
2193
|
+
req.data = { ...draftData, IsActiveEntity: false }
|
|
2194
|
+
// prettier-ignore
|
|
2195
|
+
const pk = Object.keys(req.target.keys).reduce((acc, cur) => ((acc[cur] = req.data[cur]), acc), { IsActiveEntity: false })
|
|
2196
|
+
return Object.assign([pk], { affected: 1 })
|
|
2197
|
+
}
|
|
2198
|
+
|
|
2199
|
+
async function onEdit(req, next) {
|
|
2200
|
+
if (req.target.isDraft) return next?.()
|
|
2201
|
+
|
|
2202
|
+
LOG.debug('edit active')
|
|
2203
|
+
|
|
2204
|
+
req.query ??= SELECT.from(req.target, req.data).where({ IsActiveEntity: true }) //> support simple srv.send('EDIT',entity,...)
|
|
2205
|
+
|
|
2206
|
+
// REVISIT: can draftParams in the edit case ever be undefined or other than IsActiveEntity=true ?
|
|
2207
|
+
const draftParams = req.query[$draftParams] || { IsActiveEntity: true }
|
|
2208
|
+
if (req.query.SELECT.from.ref.length > 1 || draftParams.IsActiveEntity === false) {
|
|
2209
|
+
cds.error({
|
|
2210
|
+
status: 400,
|
|
2211
|
+
message: 'Action "draftEdit" can only be called on the root active entity'
|
|
2212
|
+
})
|
|
2213
|
+
}
|
|
2214
|
+
|
|
2215
|
+
if (
|
|
2216
|
+
req.target['@Capabilities.UpdateRestrictions.Updatable'] === false ||
|
|
2217
|
+
req.target['@insertonly'] ||
|
|
2218
|
+
req.target['@readonly']
|
|
2219
|
+
) {
|
|
2220
|
+
cds.error({ status: 405 })
|
|
2221
|
+
}
|
|
2222
|
+
|
|
2223
|
+
_cleanUpOldDrafts(this, req.tenant)
|
|
2224
|
+
|
|
2225
|
+
const DraftUUID = cds.utils.uuid()
|
|
2226
|
+
|
|
2227
|
+
// REVISIT: Later optimization if datasource === db: INSERT FROM SELECT
|
|
2228
|
+
const cols = expandStarStar(req.target, false)
|
|
2229
|
+
const _addDraftColumns = (target, columns) => {
|
|
2230
|
+
if (target.drafts) {
|
|
2231
|
+
columns.push({ val: true, as: 'HasActiveEntity' })
|
|
2232
|
+
columns.push({ val: DraftUUID, as: 'DraftAdministrativeData_DraftUUID' })
|
|
2233
|
+
}
|
|
2234
|
+
for (const col of columns) {
|
|
2235
|
+
if (col.expand) {
|
|
2236
|
+
const el = target.elements[col.ref[0]]
|
|
2237
|
+
_addDraftColumns(el._target, col.expand)
|
|
2238
|
+
}
|
|
2239
|
+
}
|
|
2240
|
+
}
|
|
2241
|
+
|
|
2242
|
+
_addDraftColumns(req.target, cols)
|
|
2243
|
+
|
|
2244
|
+
const draftsRef = _redirectRefToDrafts(req.query.SELECT.from.ref, this.model)
|
|
2245
|
+
const existingDraft = SELECT.one({ ref: draftsRef }).columns({
|
|
2246
|
+
ref: ['DraftAdministrativeData'],
|
|
2247
|
+
expand: [_inProcessByUserXpr(_lock.shiftedNow)]
|
|
2248
|
+
})
|
|
2249
|
+
|
|
2250
|
+
// prevent service to check for own user
|
|
2251
|
+
existingDraft[$draftParams] = draftParams
|
|
2252
|
+
|
|
2253
|
+
const selectActiveCQN = SELECT.one.from({ ref: req.query.SELECT.from.ref }).columns(cols)
|
|
2254
|
+
selectActiveCQN.SELECT.localized = false
|
|
2255
|
+
|
|
2256
|
+
let res, draft
|
|
2257
|
+
|
|
2258
|
+
// Ensure exclusive access to the record of the active entity by applying a lock,
|
|
2259
|
+
// which effectively prevents the creation or overwriting of duplicate draft entities.
|
|
2260
|
+
// This lock mechanism enforces a strict processing order for active entities,
|
|
2261
|
+
// allowing only one entity to be worked on at any given time.
|
|
2262
|
+
// By using .forUpdate() with a wait value of 0, we immediately lock the record,
|
|
2263
|
+
// ensuring there is no waiting time for other users attempting to edit the same record
|
|
2264
|
+
// concurrently.
|
|
2265
|
+
if (this._datasource === cds.db) {
|
|
2266
|
+
const keys = _entityKeys(req.target)
|
|
2267
|
+
const keyData = _getKeyData(keys, req.query.SELECT.from.ref[0].where)
|
|
2268
|
+
const rootWhere = keys.reduce((res, key) => {
|
|
2269
|
+
res[key] = keyData[key]
|
|
2270
|
+
return res
|
|
2271
|
+
}, {})
|
|
2272
|
+
const transition = cds.db.resolve.transitions(req.query)
|
|
2273
|
+
|
|
2274
|
+
// gets the underlying target entity, as record locking can't be
|
|
2275
|
+
// applied to localized views
|
|
2276
|
+
const lockTarget = transition.target
|
|
2277
|
+
const lockWhere =
|
|
2278
|
+
transition.mapping.size === 0
|
|
2279
|
+
? rootWhere
|
|
2280
|
+
: (() => {
|
|
2281
|
+
const whereKeys = Object.keys(rootWhere)
|
|
2282
|
+
const w = {}
|
|
2283
|
+
whereKeys.forEach(key => {
|
|
2284
|
+
const mappedKey = transition.mapping.get(key)
|
|
2285
|
+
const lockKey = mappedKey ? mappedKey.ref[0] : key
|
|
2286
|
+
w[lockKey] = rootWhere[key]
|
|
2287
|
+
})
|
|
2288
|
+
return w
|
|
2289
|
+
})()
|
|
2290
|
+
|
|
2291
|
+
const activeLockCQN = SELECT.from(lockTarget, [1]).where(lockWhere).forUpdate({ wait: 0 })
|
|
2292
|
+
activeLockCQN.SELECT.localized = false
|
|
2293
|
+
activeLockCQN[$draftParams] = draftParams
|
|
2294
|
+
|
|
2295
|
+
try {
|
|
2296
|
+
await activeLockCQN
|
|
2297
|
+
} catch (error) {
|
|
2298
|
+
LOG._debug && LOG.debug('Failed to acquire database lock:', error)
|
|
2299
|
+
const draft = await existingDraft
|
|
2300
|
+
cds.error({ status: 409, message: draft ? 'DRAFT_ALREADY_EXISTS' : 'ENTITY_LOCKED' })
|
|
2301
|
+
}
|
|
2302
|
+
|
|
2303
|
+
const cqns = [
|
|
2304
|
+
cds.env.fiori.read_actives_from_db ? cds.db.run(selectActiveCQN) : this.run(selectActiveCQN),
|
|
2305
|
+
existingDraft
|
|
2306
|
+
]
|
|
2307
|
+
|
|
2308
|
+
;[res, draft] = await _promiseAll(cqns)
|
|
2309
|
+
} else {
|
|
2310
|
+
const activeLockCQN = SELECT.from({ ref: req.query.SELECT.from.ref }, [1]).forUpdate({ wait: 0 })
|
|
2311
|
+
activeLockCQN.SELECT.localized = false
|
|
2312
|
+
activeLockCQN[$draftParams] = draftParams
|
|
2313
|
+
|
|
2314
|
+
// Locking the underlying database table is effective only when the database is not
|
|
2315
|
+
// hosted on an external service. This is because the active data might be stored in
|
|
2316
|
+
// a separate system.
|
|
2317
|
+
try {
|
|
2318
|
+
await activeLockCQN
|
|
2319
|
+
} catch (error) {
|
|
2320
|
+
LOG._debug && LOG.debug('Failed to acquire database lock:', error)
|
|
2321
|
+
}
|
|
2322
|
+
|
|
2323
|
+
;[res, draft] = await _promiseAll([
|
|
2324
|
+
// REVISIT: inofficial compat flag just in case it breaks something -> do not document
|
|
2325
|
+
cds.env.fiori.read_actives_from_db ? cds.db.run(selectActiveCQN) : this.run(selectActiveCQN),
|
|
2326
|
+
// no user check must be done here...
|
|
2327
|
+
existingDraft
|
|
2328
|
+
])
|
|
2329
|
+
}
|
|
2330
|
+
|
|
2331
|
+
if (!res) cds.error(404)
|
|
2332
|
+
|
|
2333
|
+
const preserveChanges = req.data?.PreserveChanges
|
|
2334
|
+
const inProcessByUser = draft?.DraftAdministrativeData?.InProcessByUser
|
|
2335
|
+
|
|
2336
|
+
if (draft) {
|
|
2337
|
+
if (inProcessByUser || preserveChanges) cds.error({ status: 409, message: 'DRAFT_ALREADY_EXISTS' })
|
|
2338
|
+
const keys = {}
|
|
2339
|
+
for (const key in req.target.drafts.keys) keys[key] = res[key]
|
|
2340
|
+
await _promiseAll([
|
|
2341
|
+
DELETE.from('DRAFT.DraftAdministrativeData').where({ DraftUUID }),
|
|
2342
|
+
DELETE.from(req.target.drafts).where(keys)
|
|
2343
|
+
])
|
|
2344
|
+
}
|
|
2345
|
+
|
|
2346
|
+
if (!cds.env.features.binary_draft_compat) _replaceStreams(res)
|
|
2347
|
+
|
|
2348
|
+
const timestamp = cds.context.timestamp.toISOString() // REVISIT: toISOString should be done on db layer
|
|
2349
|
+
await INSERT.into('DRAFT.DraftAdministrativeData').entries({
|
|
2350
|
+
DraftUUID,
|
|
2351
|
+
CreationDateTime: timestamp,
|
|
2352
|
+
CreatedByUser: req.user.id,
|
|
2353
|
+
LastChangeDateTime: timestamp,
|
|
2354
|
+
LastChangedByUser: req.user.id,
|
|
2355
|
+
DraftIsCreatedByMe: true, // Dummy values
|
|
2356
|
+
DraftIsProcessedByMe: true, // Dummy values
|
|
2357
|
+
InProcessByUser: req.user.id
|
|
2358
|
+
})
|
|
2359
|
+
|
|
2360
|
+
// is set to `null` on srv layer
|
|
2361
|
+
res.DraftAdministrativeData_DraftUUID = DraftUUID
|
|
2362
|
+
res.HasActiveEntity = true
|
|
2363
|
+
delete res.DraftAdministrativeData
|
|
2364
|
+
// change to db run
|
|
2365
|
+
await INSERT.into(req.target.drafts).entries(res)
|
|
2366
|
+
|
|
2367
|
+
if (req.res) {
|
|
2368
|
+
// status code must be set in handler to allow overriding for FE V2
|
|
2369
|
+
// REVISIT: needs reworking for new adapter, especially re $batch
|
|
2370
|
+
req.res.status(201)
|
|
2371
|
+
|
|
2372
|
+
const read_result = await _readAfterDraftAction.bind(this)({
|
|
2373
|
+
req,
|
|
2374
|
+
payload: res,
|
|
2375
|
+
action: 'draftEdit'
|
|
2376
|
+
})
|
|
2377
|
+
req.res.set('location', '../' + location4(req.target, this, read_result || { ...res, IsActiveEntity: false }))
|
|
2378
|
+
|
|
2379
|
+
if (read_result == null) req.res.status(204)
|
|
2380
|
+
|
|
2381
|
+
return read_result
|
|
2382
|
+
} else {
|
|
2383
|
+
return { ...res, IsActiveEntity: false } // REVISIT: Flatten?
|
|
2384
|
+
}
|
|
2385
|
+
}
|
|
2386
|
+
|
|
2387
|
+
async function onCancel(req, next) {
|
|
2388
|
+
if (!req.target.isDraft) return next?.()
|
|
2389
|
+
LOG.debug('delete draft')
|
|
2390
|
+
|
|
2391
|
+
req.query ??= DELETE(req.target, req.data) //> support simple srv.send('CANCEL',entity,...)
|
|
2392
|
+
const draftParams = req.query[$draftParams] || { IsActiveEntity: false }
|
|
2393
|
+
|
|
2394
|
+
const expandedDraftAdminElements = [_inProcessByUserXpr(_lock.shiftedNow)]
|
|
2395
|
+
if (IS_PERSISTED_DRAFT_MESSAGES_ENABLED) expandedDraftAdminElements.push({ ref: ['DraftMessages'] })
|
|
2396
|
+
|
|
2397
|
+
const draftQuery = SELECT.one.from({ ref: req.query.DELETE.from.ref }).columns([
|
|
2398
|
+
'DraftAdministrativeData_DraftUUID',
|
|
2399
|
+
{
|
|
2400
|
+
ref: ['DraftAdministrativeData'],
|
|
2401
|
+
expand: expandedDraftAdminElements
|
|
2402
|
+
}
|
|
2403
|
+
])
|
|
2404
|
+
if (req._etagValidationClause && draftParams.IsActiveEntity === false) draftQuery.where(req._etagValidationClause)
|
|
2405
|
+
|
|
2406
|
+
const draft = await draftQuery
|
|
2407
|
+
|
|
2408
|
+
if (!draft) cds.error({ status: req._etagValidationType ? 412 : 404 })
|
|
2409
|
+
|
|
2410
|
+
const processByUser = draft.DraftAdministrativeData?.InProcessByUser
|
|
2411
|
+
if (!cds.context.user._is_privileged && processByUser && processByUser !== cds.context.user.id)
|
|
2412
|
+
cds.error({ status: 403, message: 'DRAFT_LOCKED_BY_ANOTHER_USER', args: [processByUser] })
|
|
2413
|
+
|
|
2414
|
+
const deleteQuery = DELETE.from({ ref: req.query.DELETE.from.ref })
|
|
2415
|
+
const deleteReq = _newReq(req, deleteQuery, draftParams, {})
|
|
2416
|
+
const queries = [this.dispatch(deleteReq)]
|
|
2417
|
+
|
|
2418
|
+
if (req.target['@Common.DraftRoot.ActivationAction']) {
|
|
2419
|
+
// The root entity is being deleted and draft admin data can be deleted
|
|
2420
|
+
|
|
2421
|
+
queries.push(
|
|
2422
|
+
DELETE.from('DRAFT.DraftAdministrativeData').where({
|
|
2423
|
+
DraftUUID: draft.DraftAdministrativeData_DraftUUID
|
|
2424
|
+
})
|
|
2425
|
+
)
|
|
2426
|
+
} else {
|
|
2427
|
+
// A child entity is being deleted and draft admin data must be updated
|
|
2428
|
+
|
|
2429
|
+
const nextDraftAdminData = {
|
|
2430
|
+
InProcessByUser: cds.context.user.id,
|
|
2431
|
+
LastChangedByUser: cds.context.user.id,
|
|
2432
|
+
LastChangeDateTime: cds.context.timestamp.toISOString()
|
|
2433
|
+
}
|
|
2434
|
+
|
|
2435
|
+
if (IS_PERSISTED_DRAFT_MESSAGES_ENABLED) {
|
|
2436
|
+
// Determine persisted draft messages that relate to the deleted child entity
|
|
2437
|
+
|
|
2438
|
+
const queryRootEntity = this.model.definitions[req.query.DELETE.from.ref[0].id || req.query.DELETE.from.ref[0]]
|
|
2439
|
+
|
|
2440
|
+
if (queryRootEntity['@Common.DraftRoot.ActivationAction']) {
|
|
2441
|
+
// The DELETE query uses containment & we can compile a target prefix
|
|
2442
|
+
// > This allows us to only remove those messages that target the delted child
|
|
2443
|
+
|
|
2444
|
+
const prefixRef = _extractPrefixRef(req.query.DELETE.from.ref, queryRootEntity)
|
|
2445
|
+
const messageTargetPrefix = cds.odata.urlify(
|
|
2446
|
+
{ SELECT: { from: { ref: prefixRef } } },
|
|
2447
|
+
{ kind: 'odata-v4', model: req.context.tx.model }
|
|
2448
|
+
).path
|
|
2449
|
+
|
|
2450
|
+
// Remove those draft messages whose prefix matches the deleted child entity
|
|
2451
|
+
nextDraftAdminData.DraftMessages = (draft?.DraftAdministrativeData?.DraftMessages || []).filter(
|
|
2452
|
+
msg => !msg.prefix.startsWith(messageTargetPrefix)
|
|
2453
|
+
)
|
|
2454
|
+
} else {
|
|
2455
|
+
// The query does not use containment & we can not compile a target prefix
|
|
2456
|
+
// > Best ew can do is to clear all persisted messages
|
|
2457
|
+
|
|
2458
|
+
nextDraftAdminData.DraftMessages = []
|
|
2459
|
+
}
|
|
2460
|
+
}
|
|
2461
|
+
|
|
2462
|
+
const updateDraftAdminDataQuery = UPDATE('DRAFT.DraftAdministrativeData')
|
|
2463
|
+
.data(nextDraftAdminData)
|
|
2464
|
+
.where({ DraftUUID: draft.DraftAdministrativeData_DraftUUID })
|
|
2465
|
+
|
|
2466
|
+
queries.push(updateDraftAdminDataQuery)
|
|
2467
|
+
}
|
|
2468
|
+
|
|
2469
|
+
await _promiseAll(queries)
|
|
2470
|
+
|
|
2471
|
+
return Object.assign([], { affected: 1 })
|
|
2472
|
+
}
|
|
2473
|
+
|
|
2474
|
+
async function onPrepare(req, next) {
|
|
2475
|
+
if (!req.target.isDraft) return next?.()
|
|
2476
|
+
LOG.debug('prepare draft')
|
|
2477
|
+
|
|
2478
|
+
const draftParams = req.query[$draftParams]
|
|
2479
|
+
if (req.query.SELECT.from.ref.length > 1 || draftParams.IsActiveEntity !== false) {
|
|
2480
|
+
cds.error({
|
|
2481
|
+
status: 400,
|
|
2482
|
+
message: 'Action "draftPrepare" can only be called on the root draft entity'
|
|
2483
|
+
})
|
|
2484
|
+
}
|
|
2485
|
+
|
|
2486
|
+
const selectedCols = ['*']
|
|
2487
|
+
if (req.target.actions.draftPrepare.returns.type === req.target.actives.name) {
|
|
2488
|
+
selectedCols.push(...(req.query.SELECT.columns ?? []))
|
|
2489
|
+
if (selectedCols.length > 1) selectedCols.shift()
|
|
2490
|
+
const draftMsgColIdx = selectedCols.findIndex(c => c.ref?.[0] === 'DraftMessages')
|
|
2491
|
+
if (draftMsgColIdx >= 0) {
|
|
2492
|
+
selectedCols.splice(draftMsgColIdx)
|
|
2493
|
+
selectedCols.push(...cds.ql.columns`DraftAdministrativeData.DraftMessages as DraftMessages`)
|
|
2494
|
+
}
|
|
2495
|
+
}
|
|
2496
|
+
|
|
2497
|
+
const draftQuery = SELECT.one
|
|
2498
|
+
.from(req.target)
|
|
2499
|
+
.columns([...selectedCols, cds.ql.expand(cds.ql.ref`DraftAdministrativeData`, cds.ql.columns`InProcessByUser`)])
|
|
2500
|
+
.where(req.subject.ref[0].where)
|
|
2501
|
+
|
|
2502
|
+
draftQuery[$draftParams] = draftParams
|
|
2503
|
+
|
|
2504
|
+
const data = await draftQuery
|
|
2505
|
+
|
|
2506
|
+
if (!data) cds.error(404)
|
|
2507
|
+
if (!cds.context.user._is_privileged && data.DraftAdministrativeData?.InProcessByUser !== req.user.id)
|
|
2508
|
+
cds.error({
|
|
2509
|
+
status: 403,
|
|
2510
|
+
message: 'DRAFT_LOCKED_BY_ANOTHER_USER',
|
|
2511
|
+
args: [data.DraftAdministrativeData?.InProcessByUser]
|
|
2512
|
+
})
|
|
2513
|
+
|
|
2514
|
+
if (getPreferReturnHeader(req) === 'minimal') return null
|
|
2515
|
+
|
|
2516
|
+
delete data.DraftAdministrativeData
|
|
2517
|
+
if (data && req.headers?.['x-cds-odata-version'] !== 'v2') {
|
|
2518
|
+
// The result must not include DraftAdministrativeData_DraftUUID
|
|
2519
|
+
// > in for OData V4, however, a value is required in OData V2
|
|
2520
|
+
delete data.DraftAdministrativeData_DraftUUID
|
|
2521
|
+
}
|
|
2522
|
+
|
|
2523
|
+
return {
|
|
2524
|
+
...data,
|
|
2525
|
+
IsActiveEntity: false,
|
|
2526
|
+
HasDraftEntity: false,
|
|
2527
|
+
HasActiveEntity: data.HasActiveEntity || false
|
|
2528
|
+
}
|
|
2529
|
+
}
|
|
2530
|
+
|
|
2531
|
+
const _readAfterDraftAction = async function ({ req, payload, action }) {
|
|
2532
|
+
if (getPreferReturnHeader(req) === 'minimal') return null
|
|
2533
|
+
|
|
2534
|
+
const entity = action === 'draftActivate' ? req.target : req.target.drafts
|
|
2535
|
+
|
|
2536
|
+
// read after write with query options
|
|
2537
|
+
const keys = {}
|
|
2538
|
+
for (let key of entity.keys) {
|
|
2539
|
+
if (key.name === 'IsActiveEntity' || key.isAssociation || key.virtual) continue
|
|
2540
|
+
keys[key.name] = payload[key.name]
|
|
2541
|
+
}
|
|
2542
|
+
if (action === 'draftActivate') keys.IsActiveEntity = true
|
|
2543
|
+
|
|
2544
|
+
let read = SELECT.one.from(entity, keys)
|
|
2545
|
+
if (req.req?.query.$select || req.req?.query.$expand) {
|
|
2546
|
+
const queryOptions = []
|
|
2547
|
+
if (req.req.query.$select) queryOptions.push(`$select=${req.req.query.$select}`)
|
|
2548
|
+
if (req.req.query.$expand) queryOptions.push(`$expand=${req.req.query.$expand}`)
|
|
2549
|
+
read.columns(cds.odata.parse(`/X?${queryOptions.join('&')}`).SELECT.columns)
|
|
2550
|
+
// ensure keys are always selected
|
|
2551
|
+
Object.keys(keys).forEach(key => {
|
|
2552
|
+
if (!read.SELECT.columns.some(c => c.ref?.[0] === key)) read.SELECT.columns.push({ ref: [key] })
|
|
2553
|
+
})
|
|
2554
|
+
// also ensure selection of etag columns
|
|
2555
|
+
addEtagColumns(read.SELECT.columns, entity)
|
|
2556
|
+
handleStreamProperties(entity, read.SELECT.columns, this.model)
|
|
2557
|
+
}
|
|
2558
|
+
|
|
2559
|
+
try {
|
|
2560
|
+
const read_result = await this.run(read)
|
|
2561
|
+
// result must not include DraftAdministrativeData_DraftUUID for plain v4 usage, however required for odata-v2
|
|
2562
|
+
if (read_result && req.headers?.['x-cds-odata-version'] !== 'v2') {
|
|
2563
|
+
delete read_result.DraftAdministrativeData_DraftUUID
|
|
2564
|
+
}
|
|
2565
|
+
return read_result
|
|
2566
|
+
} catch (err) {
|
|
2567
|
+
if (!(Number(err.code) in { 401: 1, 403: 1, 404: 1, 405: 1 })) throw err
|
|
2568
|
+
// it's important to return null if one of the above accepted errors occurs
|
|
2569
|
+
return null
|
|
2570
|
+
}
|
|
2571
|
+
}
|
|
2572
|
+
|
|
2573
|
+
module.exports = cds.service.impl(function () {
|
|
2574
|
+
if (!this.entities?.DraftAdministrativeData) return
|
|
2575
|
+
|
|
2576
|
+
// REVISIT: don't pollute services... -> do we really need this?
|
|
2577
|
+
Object.defineProperty(this, '_datasource', { value: cds.db })
|
|
2578
|
+
|
|
2579
|
+
// Extend the AppService's API by draft specific functions
|
|
2580
|
+
this.new = (draft, key) => ({
|
|
2581
|
+
then: (r, e) => this.send('NEW', draft, key).then(r, e),
|
|
2582
|
+
for: key => this.send('EDIT', typeof draft === 'string' ? draft.replace(/\.drafts$/, '') : draft.actives, key)
|
|
2583
|
+
})
|
|
2584
|
+
this.edit = (active, key) => this.send('EDIT', active, key)
|
|
2585
|
+
this.save = (draft, key) => this.send('SAVE', draft, key)
|
|
2586
|
+
this.cancel = (draft, key) => this.send('CANCEL', draft, key)
|
|
2587
|
+
this.discard = (draft, key) => this.send('DISCARD', draft, key)
|
|
2588
|
+
|
|
2589
|
+
// Override the AppService's handle function
|
|
2590
|
+
this.handle = !cds.env.features.legacy_srv_results
|
|
2591
|
+
? draftHandle
|
|
2592
|
+
: async function (req) {
|
|
2593
|
+
if (req.protocol?.match(/odata/) && req.event in { NEW: 1 }) req._.readAfterWrite = true
|
|
2594
|
+
|
|
2595
|
+
const res = await draftHandle.call(this, req)
|
|
2596
|
+
return Array.isArray(res) && 'affected' in res ? req.data : res
|
|
2597
|
+
}
|
|
2598
|
+
|
|
2599
|
+
this.on('NEW', '*', onNew.bind(this))
|
|
2600
|
+
this.on('EDIT', '*', onEdit.bind(this))
|
|
2601
|
+
this.on('CANCEL', '*', onCancel.bind(this))
|
|
2602
|
+
this.on('draftPrepare', '*', onPrepare.bind(this))
|
|
2603
|
+
})
|
|
2604
|
+
module.exports.compileUpdatedDraftMessages = compileUpdatedDraftMessages
|