@sap/cds-dk 9.9.3 → 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 +88 -0
- package/bin/add.js +1 -1
- package/bin/cds.js +4 -1
- package/bin/data-products/import.js +1 -1
- package/bin/data-products/{index.js → load.js} +0 -3
- package/bin/debug.js +19 -0
- package/bin/export.js +21 -15
- package/bin/login.js +4 -8
- package/bin/logout.js +4 -9
- package/bin/pull.js +4 -8
- package/bin/push.js +8 -23
- package/bin/up.js +50 -1
- package/bin/upgrade-tenant.js +78 -0
- package/bin/upgrade.js +55 -53
- package/bin/util/log.js +1 -2
- package/bin/version.js +44 -60
- package/lib/bind/shared.js +5 -1
- package/lib/build/index.js +3 -3
- package/lib/build/plugins/fiori/index.js +5 -5
- package/lib/build/plugins/hana/index.js +13 -12
- package/lib/build/plugins/hana/template/package.json +1 -1
- package/lib/build/plugins/internal.js +4 -3
- package/lib/build/plugins/mtx-sidecar/index.js +8 -25
- package/lib/build/plugins/nodejs/index.js +4 -2
- package/lib/build/plugins/plugin.js +4 -10
- package/lib/build/util.js +0 -41
- package/lib/import/openapi/importOpenAPI.js +15 -3
- package/lib/index.js +1 -1
- package/lib/init/bas.js +2 -3
- package/lib/init/constants.js +8 -7
- package/lib/init/index.js +1 -17
- package/lib/init/projectReader.js +14 -5
- package/lib/init/registries/mta.js +12 -0
- package/lib/init/template/ai/files/mta.yaml.hbs +14 -0
- package/lib/init/template/ai/files/package.json.hbs +25 -0
- package/lib/init/template/ai/files/values.yaml +7 -0
- package/lib/init/template/ai/index.js +48 -0
- package/lib/init/template/ams/files/Chart.yaml.hbs +2 -2
- package/lib/init/template/ams/files/containerize.yaml.hbs +5 -5
- package/lib/init/template/ams/files/mta.yaml.hbs +1 -1
- package/lib/init/template/ams/files/package.json.hbs +3 -0
- package/lib/init/template/ams/index.js +2 -2
- package/lib/init/template/app-frontend/files/app-package.json.hbs +2 -2
- package/lib/init/template/app-frontend/files/containerize.yaml.hbs +13 -0
- package/lib/init/template/app-frontend/files/index.html.hbs +1 -1
- package/lib/init/template/app-frontend/files/mta.yaml.hbs +1 -1
- package/lib/init/template/app-frontend/files/ui5.yaml.hbs +4 -4
- package/lib/init/template/app-frontend/files/values.yaml.hbs +21 -9
- package/lib/init/template/app-frontend/index.js +37 -29
- package/lib/init/template/application-logging/files/mta.yaml.hbs +1 -1
- package/lib/init/template/application-logging/index.js +3 -3
- package/lib/init/template/approuter/files/containerize.yaml.hbs +4 -4
- package/lib/init/template/approuter/files/mta.yaml.hbs +1 -1
- package/lib/init/template/approuter/index.js +5 -5
- package/lib/init/template/attachments/files/mta.yaml.hbs +1 -1
- package/lib/init/template/attachments/files/values.yaml +1 -1
- package/lib/init/template/attachments/index.js +4 -4
- package/lib/init/template/audit-logging/files/mta.yaml.hbs +1 -1
- package/lib/init/template/audit-logging/index.js +4 -4
- package/lib/init/template/cf-manifest/files/manifest.yml.hbs +3 -3
- package/lib/init/template/cjs/files/package.json.hbs +3 -0
- package/lib/init/template/{esm → cjs}/index.js +2 -2
- package/lib/init/template/cloud-logging/files/mta.yaml.hbs +1 -1
- package/lib/init/template/cloud-logging/index.js +3 -3
- package/lib/init/template/completion/completionSetup.js +1 -1
- package/lib/init/template/connectivity/files/mta.yaml.hbs +1 -1
- package/lib/init/template/connectivity/index.js +4 -4
- package/lib/init/template/data/as-json.js +0 -10
- package/lib/init/template/destination/files/mta.yaml.hbs +1 -1
- package/lib/init/template/destination/index.js +4 -4
- package/lib/init/template/dynatrace/files/mta.yaml.hbs +1 -1
- package/lib/init/template/dynatrace/index.js +3 -3
- package/lib/init/template/enterprise-messaging/files/mta.yaml.hbs +1 -1
- package/lib/init/template/enterprise-messaging/index.js +39 -23
- package/lib/init/template/enterprise-messaging-shared/files/mta.yaml.hbs +1 -1
- package/lib/init/template/enterprise-messaging-shared/index.js +22 -44
- package/lib/init/template/event-mesh/files/event-mesh.json.hbs +31 -0
- package/lib/init/template/event-mesh/files/mta.yaml.hbs +22 -0
- package/lib/init/template/event-mesh/files/package.json.hbs +20 -0
- package/lib/init/template/event-mesh/files/values.yaml +7 -0
- package/lib/init/template/event-mesh/files/xs-security.json.hbs +19 -0
- package/lib/init/template/event-mesh/index.js +16 -0
- package/lib/init/template/event-mesh-shared/files/event-mesh.json.hbs +31 -0
- package/lib/init/template/event-mesh-shared/files/mta.yaml.hbs +15 -0
- package/lib/init/template/event-mesh-shared/files/package.json.hbs +23 -0
- package/lib/init/template/event-mesh-shared/files/values.yaml +7 -0
- package/lib/init/template/event-mesh-shared/index.js +16 -0
- package/lib/init/template/extensibility/files/package.json.hbs +1 -1
- package/lib/init/template/github-actions/files/workflows/cf.yaml.hbs +2 -2
- package/lib/init/template/github-actions/files/workflows/test.yaml.hbs +2 -2
- package/lib/init/template/hana/files/containerize.yaml.hbs +5 -5
- package/lib/init/template/hana/files/mta.yaml.hbs +1 -1
- package/lib/init/template/hana/files/package.json.hbs +1 -1
- package/lib/init/template/hana/files/src/.hdiconfig +1 -1
- package/lib/init/template/hana/index.js +5 -8
- package/lib/init/template/handler/files/extension/handler.xs.hbs +1 -1
- package/lib/init/template/handler/index.js +1 -19
- package/lib/init/template/html5-repo/files/app-package.json.hbs +2 -2
- package/lib/init/template/html5-repo/files/containerize.yaml.hbs +5 -7
- package/lib/init/template/html5-repo/files/mta.yaml.hbs +4 -4
- package/lib/init/template/html5-repo/files/ui5.yaml.hbs +4 -4
- package/lib/init/template/html5-repo/files/values.yaml.hbs +9 -0
- package/lib/init/template/html5-repo/index.js +23 -22
- package/lib/init/template/ias/files/Chart.yaml.hbs +2 -2
- package/lib/init/template/ias/files/mta.yaml.hbs +1 -1
- package/lib/init/template/ias/index.js +5 -5
- package/lib/init/template/initial/index.js +2 -10
- package/lib/init/template/kafka/files/mta.yaml.hbs +1 -1
- package/lib/init/template/kafka/files/values.yaml +1 -1
- package/lib/init/template/kafka/index.js +4 -4
- package/lib/init/template/kyma/files/containerize.yaml.hbs +11 -11
- package/lib/init/template/kyma/files/values.schema.json +1 -1
- package/lib/init/template/kyma/index.js +10 -10
- package/lib/init/template/lint/files/package.json +1 -1
- package/lib/init/template/malware-scanner/files/mta.yaml.hbs +2 -2
- package/lib/init/template/malware-scanner/files/package.json.hbs +1 -1
- package/lib/init/template/malware-scanner/files/values.yaml +1 -1
- package/lib/init/template/malware-scanner/index.js +4 -4
- package/lib/init/template/mta/files/mta.yaml.hbs +1 -1
- package/lib/init/template/mta/files/package.json +1 -1
- package/lib/init/template/multitenancy/files/containerize.yaml.hbs +5 -5
- package/lib/init/template/multitenancy/files/mta.yaml.hbs +1 -1
- package/lib/init/template/multitenancy/files/package.json.hbs +1 -1
- package/lib/init/template/multitenancy/files/package.sidecar.json.hbs +5 -5
- package/lib/init/template/multitenancy/index.js +10 -11
- package/lib/init/template/nodejs/files/package.json.hbs +3 -2
- package/lib/init/template/portal/files/containerize.yaml.hbs +4 -4
- package/lib/init/template/portal/files/mta.yaml.hbs +1 -1
- package/lib/init/template/portal/files/values.yaml.hbs +3 -32
- package/lib/init/template/portal/index.js +5 -13
- package/lib/init/template/postgres/files/containerize.yaml.hbs +4 -4
- package/lib/init/template/postgres/files/mta.yml.hbs +1 -1
- package/lib/init/template/postgres/files/package.json.hbs +1 -1
- package/lib/init/template/postgres/index.js +4 -4
- package/lib/init/template/react/files/{index.html → index.html.hbs} +1 -1
- package/lib/init/template/react/files/{vite.config.js → vite.config.js.hbs} +2 -1
- package/lib/init/template/react/index.js +15 -7
- package/lib/init/template/redis/files/mta.yaml.hbs +1 -1
- package/lib/init/template/redis/index.js +4 -4
- package/lib/init/template/sample/files/app/admin-books/webapp/manifest.json +2 -1
- package/lib/init/template/side-by-side-extensibility/files/mta.yaml.hbs +1 -1
- package/lib/init/template/sqlite/files/package.json.hbs +2 -2
- package/lib/init/template/toggles/files/package.json.hbs +1 -1
- package/lib/init/template/typer/files/gitignore +1 -1
- package/lib/init/template/typescript/files/package.json +1 -1
- package/lib/init/template/vue/files/{index.html → index.html.hbs} +1 -1
- package/lib/init/template/vue/files/{vite.config.js → vite.config.js.hbs} +2 -1
- package/lib/init/template/vue/index.js +16 -8
- package/lib/init/template/workzone-standard/files/mta.yaml.hbs +1 -1
- package/lib/init/template/workzone-standard/index.js +3 -3
- package/lib/init/template/xsuaa/files/mta.yaml.hbs +1 -1
- package/lib/init/template/xsuaa/index.js +3 -3
- package/lib/lint/Linter.js +5 -4
- package/lib/lint/eslintHelp.json +1 -1
- package/lib/mtx/params.js +0 -4
- package/lib/mtx/pull.js +1 -1
- package/lib/mtx/push.js +4 -3
- package/lib/mtx/settings_manager.js +9 -14
- package/lib/mtx/tenant_action.js +6 -6
- package/lib/mtx/util/question.js +0 -18
- package/lib/upgrade/constants.js +102 -0
- package/lib/upgrade/context.js +24 -0
- package/lib/upgrade/index.js +65 -0
- package/lib/upgrade/migrations/cds10/migrations.json +705 -0
- package/lib/upgrade/preflight/cds-version.js +61 -0
- package/lib/upgrade/preflight/consistency.js +94 -0
- package/lib/upgrade/preflight/index.js +49 -0
- package/lib/upgrade/preflight/project-type.js +224 -0
- package/lib/upgrade/steps/analyze/classification.js +92 -0
- package/lib/upgrade/steps/analyze/detector.js +22 -0
- package/lib/upgrade/steps/analyze/evaluator.js +91 -0
- package/lib/upgrade/steps/analyze/index.js +124 -0
- package/lib/upgrade/steps/analyze/reporter.js +339 -0
- package/lib/upgrade/steps/analyze/setup.js +71 -0
- package/lib/upgrade/steps/analyze/utils/detection.js +63 -0
- package/lib/upgrade/steps/analyze/utils/files.js +114 -0
- package/lib/upgrade/steps/analyze/utils/grep.js +95 -0
- package/lib/upgrade/steps/analyze/utils/yaml.js +58 -0
- package/lib/upgrade/steps/install.js +115 -0
- package/lib/upgrade/steps/openrewrite.js +293 -0
- package/lib/upgrade/steps/removals.js +88 -0
- package/lib/upgrade/steps/rewrite.js +167 -0
- package/lib/upgrade/steps/verify.js +96 -0
- package/lib/upgrade/util/pom.js +46 -0
- package/lib/upgrade/util/prompt.js +28 -0
- package/lib/upgrade/util/workspaces.js +111 -0
- package/lib/util/cf.js +23 -12
- package/lib/util/term.js +1 -1
- package/lib/watch/vite-watch.js +33 -8
- package/node_modules/@cap-js/asyncapi/LICENSE +201 -0
- package/node_modules/@cap-js/asyncapi/README.md +46 -0
- package/node_modules/@cap-js/asyncapi/index.js +4 -0
- package/node_modules/@cap-js/asyncapi/lib/compile/channels.js +18 -0
- package/node_modules/@cap-js/asyncapi/lib/compile/components/messageTraits/index.js +89 -0
- package/node_modules/@cap-js/asyncapi/lib/compile/components/messages/index.js +179 -0
- package/node_modules/@cap-js/asyncapi/lib/compile/components/schemas/annotations.js +36 -0
- package/node_modules/@cap-js/asyncapi/lib/compile/components/schemas/array.js +8 -0
- package/node_modules/@cap-js/asyncapi/lib/compile/components/schemas/cache.js +16 -0
- package/node_modules/@cap-js/asyncapi/lib/compile/components/schemas/definition.js +191 -0
- package/node_modules/@cap-js/asyncapi/lib/compile/components/schemas/enum.js +15 -0
- package/node_modules/@cap-js/asyncapi/lib/compile/components/schemas/examples.js +10 -0
- package/node_modules/@cap-js/asyncapi/lib/compile/components/schemas/index.js +14 -0
- package/node_modules/@cap-js/asyncapi/lib/compile/components/schemas/localized.js +29 -0
- package/node_modules/@cap-js/asyncapi/lib/compile/components/schemas/primitiveElement.js +41 -0
- package/node_modules/@cap-js/asyncapi/lib/compile/components/schemas/ref.js +45 -0
- package/node_modules/@cap-js/asyncapi/lib/compile/components/schemas/utils.js +108 -0
- package/node_modules/@cap-js/asyncapi/lib/compile/index.js +277 -0
- package/node_modules/@cap-js/asyncapi/lib/compile/message.js +13 -0
- package/node_modules/@cap-js/asyncapi/lib/compile/utils.js +77 -0
- package/node_modules/@cap-js/asyncapi/package.json +34 -0
- package/node_modules/@cap-js/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 -1738
|
@@ -0,0 +1,2753 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Converts OData CSDL JSON to OpenAPI 3.0.2
|
|
3
|
+
*/
|
|
4
|
+
const cds = require('@sap/cds');
|
|
5
|
+
const { CSDLMeta, nameParts, isIdentifier } = require('./csdl');
|
|
6
|
+
const { camelCaseToWords: splitName } = require('./string-util');
|
|
7
|
+
const { Diagram } = require('./diagram')
|
|
8
|
+
const pluralize = require('pluralize')
|
|
9
|
+
const DEBUG = cds.debug('openapi'); // Initialize cds.debug with the 'openapi'
|
|
10
|
+
|
|
11
|
+
//TODO
|
|
12
|
+
// - Core.Example for complex types
|
|
13
|
+
// - reduce number of loops over schemas
|
|
14
|
+
// - inject $$name into each model element to make parameter passing easier?
|
|
15
|
+
// - allow passing additional files for referenced documents
|
|
16
|
+
// - delta: headers Prefer and Preference-Applied
|
|
17
|
+
// - inline definitions for Edm.* to make OpenAPI documents self-contained
|
|
18
|
+
// - both "clickable" and freestyle $expand, $select, $orderby - does not work yet, open issue for OpenAPI UI
|
|
19
|
+
// - system query options for actions/functions/imports depending on $Collection
|
|
20
|
+
// - 200 response for PATCH
|
|
21
|
+
// - ETag for GET / If-Match for PATCH and DELETE depending on @Core.OptimisticConcurrency
|
|
22
|
+
// - CountRestrictions for GET collection-valued (containment) navigation - https://issues.oasis-open.org/browse/ODATA-1300
|
|
23
|
+
// - InsertRestrictions/NonInsertableProperties
|
|
24
|
+
// - InsertRestrictions/NonInsertableNavigationProperties
|
|
25
|
+
// - see //TODO comments below
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* @typedef {import('./types').CSDL} CSDL
|
|
29
|
+
* @typedef {import('./types').Paths} Paths
|
|
30
|
+
* @typedef {import('./types').Parameter} Parameter
|
|
31
|
+
* @typedef {import('./types').Response} Response
|
|
32
|
+
* @typedef {import('./types').Schema} Schema
|
|
33
|
+
* @typedef {import('./types').TargetRestrictions} TargetRestrictions
|
|
34
|
+
*/
|
|
35
|
+
|
|
36
|
+
const SUFFIX = {
|
|
37
|
+
read: "",
|
|
38
|
+
create: "-create",
|
|
39
|
+
update: "-update",
|
|
40
|
+
};
|
|
41
|
+
|
|
42
|
+
const TITLE_SUFFIX = {
|
|
43
|
+
"": "",
|
|
44
|
+
"-create": " (for create)",
|
|
45
|
+
"-update": " (for update)",
|
|
46
|
+
};
|
|
47
|
+
|
|
48
|
+
const SYSTEM_QUERY_OPTIONS = [
|
|
49
|
+
"compute",
|
|
50
|
+
"expand",
|
|
51
|
+
"select",
|
|
52
|
+
"filter",
|
|
53
|
+
"search",
|
|
54
|
+
"count",
|
|
55
|
+
"orderby",
|
|
56
|
+
"skip",
|
|
57
|
+
"top",
|
|
58
|
+
"format",
|
|
59
|
+
"index",
|
|
60
|
+
"schemaversion",
|
|
61
|
+
"skiptoken",
|
|
62
|
+
"apply",
|
|
63
|
+
];
|
|
64
|
+
|
|
65
|
+
/**
|
|
66
|
+
* ODM annotations in CDS that should be converted into OpenAPI.
|
|
67
|
+
*/
|
|
68
|
+
const ODM_ANNOTATIONS = Object.freeze(
|
|
69
|
+
{
|
|
70
|
+
'@ODM.entityName': 'x-sap-odm-entity-name',
|
|
71
|
+
'@ODM.oid': 'x-sap-odm-oid'
|
|
72
|
+
});
|
|
73
|
+
|
|
74
|
+
const ER_ANNOTATION_PREFIX = '@EntityRelationship'
|
|
75
|
+
const ER_ANNOTATIONS = Object.freeze(
|
|
76
|
+
{
|
|
77
|
+
'@EntityRelationship.entityType': 'x-entity-relationship-entity-type',
|
|
78
|
+
'@EntityRelationship.entityIds': 'x-entity-relationship-entity-ids',
|
|
79
|
+
'@EntityRelationship.propertyType': 'x-entity-relationship-property-type',
|
|
80
|
+
'@EntityRelationship.reference': 'x-entity-relationship-reference',
|
|
81
|
+
'@EntityRelationship.compositeReferences': 'x-entity-relationship-composite-references',
|
|
82
|
+
'@EntityRelationship.temporalIds': 'x-entity-relationship-temporal-ids',
|
|
83
|
+
'@EntityRelationship.temporalReferences': 'x-entity-relationship-temporal-references',
|
|
84
|
+
'@EntityRelationship.referencesWithConstantIds': 'x-entity-relationship-references-with-constant-ids'
|
|
85
|
+
});
|
|
86
|
+
|
|
87
|
+
/**
|
|
88
|
+
* Construct an OpenAPI description from a CSDL document
|
|
89
|
+
* @param {CSDL} csdl CSDL document
|
|
90
|
+
* @param {{ url?: string, servers?: object, odataVersion?: string, scheme?: string, host?: string, basePath?: string, diagram?: boolean, maxLevels?: number, shortActionPaths?: boolean }} options Optional parameters
|
|
91
|
+
* @return {object} OpenAPI description
|
|
92
|
+
*/
|
|
93
|
+
module.exports.csdl2openapi = function (
|
|
94
|
+
csdl,
|
|
95
|
+
{
|
|
96
|
+
url: serviceRoot,
|
|
97
|
+
servers: serversObject,
|
|
98
|
+
odataVersion,
|
|
99
|
+
scheme = 'https',
|
|
100
|
+
host = 'localhost',
|
|
101
|
+
basePath = '/service-root',
|
|
102
|
+
diagram = false,
|
|
103
|
+
maxLevels = 5,
|
|
104
|
+
shortActionPaths = false
|
|
105
|
+
} = {}
|
|
106
|
+
) {
|
|
107
|
+
diagram = /** @type {unknown} */(diagram) !== "false" && !!diagram;
|
|
108
|
+
// as preProcess below mutates the csdl, copy it before, to avoid side-effects on the caller side
|
|
109
|
+
csdl = structuredClone(csdl)
|
|
110
|
+
csdl.$Version = odataVersion ? odataVersion : '4.01'
|
|
111
|
+
const meta = new CSDLMeta(csdl)
|
|
112
|
+
serviceRoot = serviceRoot ?? (`${scheme}://${host}${basePath}`);
|
|
113
|
+
const queryOptionPrefix = csdl.$Version <= '4.01' ? '$' : '';
|
|
114
|
+
const typesToInline = {}; // filled in schema() and used in inlineTypes()
|
|
115
|
+
|
|
116
|
+
/** @type {{ list: { namespace:string, name: string, suffix: string }[], used: Record<string, boolean> }} */
|
|
117
|
+
const requiredSchemas = { list: [], used: {} };
|
|
118
|
+
|
|
119
|
+
const entityContainer = csdl.$EntityContainer ? meta.modelElement(csdl.$EntityContainer) : {};
|
|
120
|
+
if (csdl.$EntityContainer) {
|
|
121
|
+
const serviceName = nameParts(csdl.$EntityContainer).qualifier;
|
|
122
|
+
Object.keys(entityContainer).forEach(element => {
|
|
123
|
+
if (entityContainer[element].$Type) {
|
|
124
|
+
const fullTypeName = entityContainer[element].$Type;
|
|
125
|
+
const type = fullTypeName.startsWith(`${serviceName}.`)
|
|
126
|
+
? fullTypeName.substring(serviceName.length + 1)
|
|
127
|
+
: nameParts(fullTypeName).name;
|
|
128
|
+
if ((csdl[serviceName]?.[type]?.['@cds.autoexpose'] || csdl[serviceName]?.[type]?.['@cds.autoexposed'])
|
|
129
|
+
&& (!entityContainer[type] || type.endsWith('_texts'))) {
|
|
130
|
+
entityContainer[element]['$cds.autoexpose'] = true;
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
});
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
const keyAsSegment = entityContainer ? entityContainer[meta.voc.Capabilities.KeyAsSegmentSupported] : {};
|
|
137
|
+
|
|
138
|
+
const openapi = {
|
|
139
|
+
openapi: '3.0.2',
|
|
140
|
+
info: getInfo(csdl, entityContainer),
|
|
141
|
+
'x-sap-api-type': 'ODATAV4',
|
|
142
|
+
'x-odata-version': csdl.$Version,
|
|
143
|
+
'x-sap-shortText': getShortText(csdl, entityContainer),
|
|
144
|
+
servers: getServers(serviceRoot, serversObject),
|
|
145
|
+
tags: entityContainer ? getTags(entityContainer) : {},
|
|
146
|
+
paths: entityContainer ? getPaths(entityContainer) : {},
|
|
147
|
+
components: getComponents(csdl, entityContainer)
|
|
148
|
+
};
|
|
149
|
+
|
|
150
|
+
const externalDocs = getExternalDoc(csdl);
|
|
151
|
+
if (externalDocs && Object.keys(externalDocs).length > 0) {
|
|
152
|
+
openapi.externalDocs = externalDocs;
|
|
153
|
+
}
|
|
154
|
+
const extensions = getExtensions(csdl, 'root');
|
|
155
|
+
if (extensions && Object.keys(extensions).length > 0) {
|
|
156
|
+
Object.assign(openapi, extensions);
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
// function to read @OpenAPI.Extensions and get them in the generated openAPI document
|
|
160
|
+
function getExtensions(csdl, level) {
|
|
161
|
+
const extensionObj = {};
|
|
162
|
+
let containerSchema = {};
|
|
163
|
+
if (level ==='root'){
|
|
164
|
+
const namespace = csdl.$EntityContainer ? nameParts(csdl.$EntityContainer).qualifier : null;
|
|
165
|
+
containerSchema = namespace ? csdl[namespace] : {};
|
|
166
|
+
}
|
|
167
|
+
else if(level === 'schema' || level === 'operation'){
|
|
168
|
+
containerSchema = csdl;
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
for (const [key, value] of Object.entries(containerSchema)) {
|
|
172
|
+
if (key.startsWith('@OpenAPI.Extensions')) {
|
|
173
|
+
const annotationProperties = key.split('@OpenAPI.Extensions.')[1] ?? ''
|
|
174
|
+
const keys = annotationProperties.split('.');
|
|
175
|
+
if (!keys[0].startsWith("x-sap-")) {
|
|
176
|
+
keys[0] = (keys[0].startsWith("sap-") ? "x-" : "x-sap-") + keys[0];
|
|
177
|
+
}
|
|
178
|
+
if (keys.length === 1) {
|
|
179
|
+
extensionObj[keys[0]] = value;
|
|
180
|
+
} else {
|
|
181
|
+
nestedAnnotation(extensionObj, keys[0], keys, value);
|
|
182
|
+
}
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
const extensionEnums = {
|
|
186
|
+
"x-sap-compliance-level": {allowedValues: ["sap:base:v1", "sap:core:v1", "sap:core:v2" ] } ,
|
|
187
|
+
"x-sap-api-type": {allowedValues: [ "ODATA", "ODATAV4", "REST" , "SOAP"] },
|
|
188
|
+
"x-sap-direction": {allowedValues: ["inbound", "outbound", "mixed"] , default : "inbound" },
|
|
189
|
+
"x-sap-dpp-entity-semantics": {allowedValues: ["sap:DataSubject", "sap:DataSubjectDetails", "sap:Other"] },
|
|
190
|
+
"x-sap-dpp-field-semantics": {allowedValues: ["sap:DataSubjectID", "sap:ConsentID", "sap:PurposeID", "sap:ContractRelatedID", "sap:LegalEntityID", "sap:DataControllerID", "sap:UserID", "sap:EndOfBusinessDate", "sap:BlockingDate", "sap:EndOfRetentionDate"] },
|
|
191
|
+
};
|
|
192
|
+
checkForExtensionEnums(extensionObj, extensionEnums);
|
|
193
|
+
|
|
194
|
+
const extensionSchema = {
|
|
195
|
+
"x-sap-stateInfo": ['state', 'deprecationDate', 'decomissionedDate', 'link'],
|
|
196
|
+
"x-sap-ext-overview": ['name', 'values'],
|
|
197
|
+
"x-sap-deprecated-operation" : ['deprecationDate', 'successorOperationRef', "successorOperationId"],
|
|
198
|
+
"x-sap-odm-semantic-key" : ['name', 'values'],
|
|
199
|
+
};
|
|
200
|
+
|
|
201
|
+
checkForExtentionSchema(extensionObj, extensionSchema);
|
|
202
|
+
return extensionObj;
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
function checkForExtensionEnums(extensionObj, extensionEnums){
|
|
206
|
+
for (const [key, value] of Object.entries(extensionObj)) {
|
|
207
|
+
if(extensionEnums[key] && extensionEnums[key].allowedValues && !extensionEnums[key].allowedValues.includes(value)){
|
|
208
|
+
if(extensionEnums[key].default){
|
|
209
|
+
extensionObj[key] = extensionEnums[key].default;
|
|
210
|
+
}
|
|
211
|
+
else{
|
|
212
|
+
delete extensionObj[key];
|
|
213
|
+
}
|
|
214
|
+
}
|
|
215
|
+
}
|
|
216
|
+
}
|
|
217
|
+
|
|
218
|
+
function checkForExtentionSchema(extensionObj, extensionSchema) {
|
|
219
|
+
for (const [key, value] of Object.entries(extensionObj)) {
|
|
220
|
+
if (extensionSchema[key]) {
|
|
221
|
+
if (Array.isArray(value)) {
|
|
222
|
+
extensionObj[key] = value.filter((v) => extensionSchema[key].includes(v));
|
|
223
|
+
} else if (typeof value === "object" && value !== null) {
|
|
224
|
+
for (const field in value) {
|
|
225
|
+
if (!extensionSchema[key].includes(field)) {
|
|
226
|
+
delete extensionObj[key][field];
|
|
227
|
+
}
|
|
228
|
+
}
|
|
229
|
+
}
|
|
230
|
+
}
|
|
231
|
+
}
|
|
232
|
+
}
|
|
233
|
+
|
|
234
|
+
|
|
235
|
+
function nestedAnnotation(resObj, openapiProperty, keys, value) {
|
|
236
|
+
if (resObj[openapiProperty] === undefined) {
|
|
237
|
+
resObj[openapiProperty] = {};
|
|
238
|
+
}
|
|
239
|
+
|
|
240
|
+
let node = resObj[openapiProperty];
|
|
241
|
+
|
|
242
|
+
// traverse the annotation property and define the objects if they're not defined
|
|
243
|
+
for (let nestedIndex = 1; nestedIndex < keys.length - 1; nestedIndex++) {
|
|
244
|
+
const nestedElement = keys[nestedIndex];
|
|
245
|
+
if (node[nestedElement] === undefined) {
|
|
246
|
+
node[nestedElement] = {};
|
|
247
|
+
}
|
|
248
|
+
node = node[nestedElement];
|
|
249
|
+
}
|
|
250
|
+
|
|
251
|
+
// set value annotation property
|
|
252
|
+
node[keys[keys.length - 1]] = value;
|
|
253
|
+
}
|
|
254
|
+
|
|
255
|
+
if (!csdl.$EntityContainer) {
|
|
256
|
+
// explicit cast required as .servers and .tags are not declared as optional
|
|
257
|
+
delete /**@type{any}*/(openapi).servers;
|
|
258
|
+
delete /**@type{any}*/(openapi).tags;
|
|
259
|
+
}
|
|
260
|
+
|
|
261
|
+
security(openapi, entityContainer);
|
|
262
|
+
|
|
263
|
+
return openapi;
|
|
264
|
+
|
|
265
|
+
|
|
266
|
+
function getContainerSchema(csdl) {
|
|
267
|
+
const namespace = csdl.$EntityContainer ? nameParts(csdl.$EntityContainer).qualifier : null;
|
|
268
|
+
return namespace ? csdl[namespace] : {};
|
|
269
|
+
}
|
|
270
|
+
|
|
271
|
+
/**
|
|
272
|
+
* Construct the Info Object
|
|
273
|
+
* @param {CSDL} csdl CSDL document
|
|
274
|
+
* @param {object} entityContainer Entity Container object
|
|
275
|
+
* @return {object} Info Object
|
|
276
|
+
*/
|
|
277
|
+
function getInfo(csdl, entityContainer) {
|
|
278
|
+
const containerSchema = getContainerSchema(csdl)
|
|
279
|
+
let description;
|
|
280
|
+
if (entityContainer && entityContainer[meta.voc.Core.LongDescription]) {
|
|
281
|
+
description = entityContainer[meta.voc.Core.LongDescription];
|
|
282
|
+
}
|
|
283
|
+
else if (containerSchema && containerSchema[meta.voc.Core.LongDescription]) {
|
|
284
|
+
description = containerSchema[meta.voc.Core.LongDescription];
|
|
285
|
+
}
|
|
286
|
+
else if (entityContainer && entityContainer[meta.voc.Core.Description]) {
|
|
287
|
+
description = entityContainer[meta.voc.Core.Description];
|
|
288
|
+
}
|
|
289
|
+
else if (containerSchema && containerSchema[meta.voc.Core.Description]) {
|
|
290
|
+
description = containerSchema[meta.voc.Core.Description];
|
|
291
|
+
}
|
|
292
|
+
else {
|
|
293
|
+
description = "Use the Core.LongDescription or Core.Description annotation on your CDS service to provide a meaningful description.";
|
|
294
|
+
}
|
|
295
|
+
description += (diagram ? new Diagram(meta).getResourceDiagram(entityContainer) : '');
|
|
296
|
+
let title;
|
|
297
|
+
if (entityContainer && entityContainer[meta.voc.Common.Label]) {
|
|
298
|
+
title = entityContainer[meta.voc.Common.Label];
|
|
299
|
+
}
|
|
300
|
+
else {
|
|
301
|
+
title = "Use the title annotation on your CDS service to provide a meaningful title.";
|
|
302
|
+
}
|
|
303
|
+
return {
|
|
304
|
+
title,
|
|
305
|
+
description: csdl.$EntityContainer ? description : '',
|
|
306
|
+
version: containerSchema[meta.voc.Core.SchemaVersion] || ''
|
|
307
|
+
};
|
|
308
|
+
}
|
|
309
|
+
|
|
310
|
+
/**
|
|
311
|
+
* Construct the externalDocs Object
|
|
312
|
+
* @param {CSDL} csdl CSDL document
|
|
313
|
+
* @return {object} externalDocs Object
|
|
314
|
+
*/
|
|
315
|
+
function getExternalDoc(csdl) {
|
|
316
|
+
const containerSchema = getContainerSchema(csdl)
|
|
317
|
+
const externalDocs = {};
|
|
318
|
+
if (containerSchema?.['@OpenAPI.externalDocs.description']) {
|
|
319
|
+
externalDocs.description = containerSchema['@OpenAPI.externalDocs.description'];
|
|
320
|
+
}
|
|
321
|
+
if (containerSchema?.['@OpenAPI.externalDocs.url']) {
|
|
322
|
+
externalDocs.url = containerSchema['@OpenAPI.externalDocs.url'];
|
|
323
|
+
}
|
|
324
|
+
return externalDocs;
|
|
325
|
+
}
|
|
326
|
+
|
|
327
|
+
/**
|
|
328
|
+
* Construct the short text
|
|
329
|
+
* @param {CSDL} csdl CSDL document
|
|
330
|
+
* @param {object} entityContainer Entity Container object
|
|
331
|
+
* @return {string} short text
|
|
332
|
+
*/
|
|
333
|
+
function getShortText(csdl, entityContainer) {
|
|
334
|
+
const containerSchema = getContainerSchema(csdl);
|
|
335
|
+
let shortText;
|
|
336
|
+
if (entityContainer && entityContainer[meta.voc.Core.Description]) {
|
|
337
|
+
shortText = entityContainer[meta.voc.Core.Description];
|
|
338
|
+
}
|
|
339
|
+
else if (containerSchema && containerSchema[meta.voc.Core.Description]) {
|
|
340
|
+
shortText = containerSchema[meta.voc.Core.Description];
|
|
341
|
+
}
|
|
342
|
+
else {
|
|
343
|
+
shortText = "Use the Core.Description annotation on your CDS service to provide a meaningful short text.";
|
|
344
|
+
}
|
|
345
|
+
return shortText;
|
|
346
|
+
}
|
|
347
|
+
|
|
348
|
+
/**
|
|
349
|
+
* Construct an array of Server Objects
|
|
350
|
+
* @param {object} serviceRoot The service root
|
|
351
|
+
* @param {object} serversObject Input servers object
|
|
352
|
+
* @return {{url: string}[]} The list of servers
|
|
353
|
+
*/
|
|
354
|
+
function getServers(serviceRoot, serversObject) {
|
|
355
|
+
let servers;
|
|
356
|
+
if (serversObject) {
|
|
357
|
+
try {
|
|
358
|
+
servers = JSON.parse(serversObject);
|
|
359
|
+
} catch {
|
|
360
|
+
throw new Error(`The input server object is invalid.`);
|
|
361
|
+
}
|
|
362
|
+
|
|
363
|
+
if (!servers.length) {
|
|
364
|
+
throw new Error(`The input server object should be an array.`);
|
|
365
|
+
}
|
|
366
|
+
} else {
|
|
367
|
+
servers = [{ url: serviceRoot }];
|
|
368
|
+
}
|
|
369
|
+
return servers;
|
|
370
|
+
}
|
|
371
|
+
|
|
372
|
+
/**
|
|
373
|
+
* Construct an array of Tag Objects from the entity container
|
|
374
|
+
* @param {object} container The entity container
|
|
375
|
+
* @return {Array} The list of tags
|
|
376
|
+
*/
|
|
377
|
+
function getTags(container) {
|
|
378
|
+
/** @type {Map<string, { name: string, description?: string }>} */
|
|
379
|
+
const tags = new Map();
|
|
380
|
+
// all entity sets and singletons
|
|
381
|
+
Object.keys(container)
|
|
382
|
+
.filter(name => isIdentifier(name) && container[name].$Type)
|
|
383
|
+
.forEach(child => {
|
|
384
|
+
if (child.endsWith('_texts') && container[child]['$cds.autoexpose']) {
|
|
385
|
+
return;
|
|
386
|
+
}
|
|
387
|
+
const type = meta.modelElement(container[child].$Type) || {};
|
|
388
|
+
const tag = {
|
|
389
|
+
name: type[meta.voc.Common.Label] || child
|
|
390
|
+
};
|
|
391
|
+
const description = container[child][meta.voc.Core.Description] || type[meta.voc.Core.Description];
|
|
392
|
+
if (description) tag.description = description;
|
|
393
|
+
tags.set(tag.name, tag);
|
|
394
|
+
});
|
|
395
|
+
return Array
|
|
396
|
+
.from(tags.values())
|
|
397
|
+
.map(normaliseTag)
|
|
398
|
+
.sort((pre, next) => pre.name.localeCompare(next.name));
|
|
399
|
+
}
|
|
400
|
+
|
|
401
|
+
/**
|
|
402
|
+
* @template {string | { name: string }} T
|
|
403
|
+
* @param {T} tag
|
|
404
|
+
* @returns {T}
|
|
405
|
+
*/
|
|
406
|
+
function normaliseTag(tag) {
|
|
407
|
+
const normalise = s => s
|
|
408
|
+
.replaceAll('_', ' ')
|
|
409
|
+
.replace(/([a-z])([A-Z])/g, '$1 $2'); // "camelCase" to "camel Case"
|
|
410
|
+
if (typeof tag === 'string') {
|
|
411
|
+
tag = normalise(tag);
|
|
412
|
+
} else {
|
|
413
|
+
tag.name = normalise(tag.name);
|
|
414
|
+
}
|
|
415
|
+
return tag;
|
|
416
|
+
}
|
|
417
|
+
|
|
418
|
+
/**
|
|
419
|
+
* Construct the Paths Object from the entity container
|
|
420
|
+
* @param {object} container Entity container
|
|
421
|
+
* @return {Paths} Paths Object
|
|
422
|
+
*/
|
|
423
|
+
function getPaths(container) {
|
|
424
|
+
/** @type {Paths} */
|
|
425
|
+
const paths = {};
|
|
426
|
+
const resources = Object.keys(container).filter(name => isIdentifier(name));
|
|
427
|
+
resources.forEach(name => {
|
|
428
|
+
const child = container[name];
|
|
429
|
+
if (name.endsWith('_texts') && child['$cds.autoexpose']) {
|
|
430
|
+
return;
|
|
431
|
+
}
|
|
432
|
+
if (child.$Type) {
|
|
433
|
+
const type = meta.modelElement(child.$Type);
|
|
434
|
+
const sourceName = (type && type[meta.voc.Common.Label]) || name;
|
|
435
|
+
// entity sets and singletons are almost containment navigation properties
|
|
436
|
+
child.$ContainsTarget = true;
|
|
437
|
+
pathItems({
|
|
438
|
+
paths,
|
|
439
|
+
prefix: `/${name}`,
|
|
440
|
+
prefixParameters: [],
|
|
441
|
+
element: child,
|
|
442
|
+
root: child,
|
|
443
|
+
sourceName,
|
|
444
|
+
targetName: sourceName,
|
|
445
|
+
target: child,
|
|
446
|
+
level: 0,
|
|
447
|
+
navigationPath: ''
|
|
448
|
+
});
|
|
449
|
+
} else if (child.$Action) {
|
|
450
|
+
pathItemActionImport(paths, name, child);
|
|
451
|
+
} else if (child.$Function) {
|
|
452
|
+
pathItemFunctionImport(paths, name, child);
|
|
453
|
+
} else {
|
|
454
|
+
DEBUG?.(`Unrecognized entity container child: ${name}`);
|
|
455
|
+
}
|
|
456
|
+
})
|
|
457
|
+
if (resources.length > 0) pathItemBatch(paths, container);
|
|
458
|
+
return Object.keys(paths).sort().reduce((p, c) => (p[c] = paths[c], p), {});
|
|
459
|
+
}
|
|
460
|
+
|
|
461
|
+
/**
|
|
462
|
+
* Add path and Path Item Object for a navigation segment
|
|
463
|
+
* @param {object} options
|
|
464
|
+
* @param {Paths} options.paths Paths Object to augment
|
|
465
|
+
* @param {string} options.prefix Prefix for path
|
|
466
|
+
* @param {Array} options.prefixParameters Parameter Objects for prefix
|
|
467
|
+
* @param {object} options.element Model element of navigation segment
|
|
468
|
+
* @param {object} options.root Root model element
|
|
469
|
+
* @param {string} options.sourceName Name of path source
|
|
470
|
+
* @param {string} options.targetName Name of path target
|
|
471
|
+
* @param {null | TargetRestrictions} options.target Target container child of path
|
|
472
|
+
* @param {number} options.level Number of navigation segments so far
|
|
473
|
+
* @param {string} options.navigationPath Path for finding navigation restrictions
|
|
474
|
+
*/
|
|
475
|
+
function pathItems({ paths, prefix, prefixParameters, element, root, sourceName, targetName, target, level, navigationPath }) {
|
|
476
|
+
const name = prefix.substring(prefix.lastIndexOf('/') + 1);
|
|
477
|
+
const type = meta.modelElement(element.$Type);
|
|
478
|
+
const pathItem = {};
|
|
479
|
+
const restrictions = navigationPropertyRestrictions(root, navigationPath);
|
|
480
|
+
const nonExpandable = nonExpandableProperties(root, navigationPath);
|
|
481
|
+
|
|
482
|
+
paths[prefix] = pathItem;
|
|
483
|
+
if (prefixParameters.length > 0) pathItem.parameters = prefixParameters;
|
|
484
|
+
|
|
485
|
+
operationRead({
|
|
486
|
+
pathItem,
|
|
487
|
+
element,
|
|
488
|
+
name,
|
|
489
|
+
sourceName,
|
|
490
|
+
targetName,
|
|
491
|
+
target,
|
|
492
|
+
level,
|
|
493
|
+
restrictions,
|
|
494
|
+
byKey: false,
|
|
495
|
+
nonExpandable
|
|
496
|
+
});
|
|
497
|
+
if (!root['$cds.autoexpose'] && element.$Collection && (element.$ContainsTarget || level < 2 && target)) {
|
|
498
|
+
operationCreate({ pathItem, element, name, sourceName, targetName, target, level, restrictions });
|
|
499
|
+
}
|
|
500
|
+
pathItemsForBoundOperations({ paths, prefix, prefixParameters, element, sourceName });
|
|
501
|
+
|
|
502
|
+
const targetIsTexts = target?.['$cds.autoexpose'] || (target?.$Type && nameParts(target.$Type).name.endsWith('_texts'));
|
|
503
|
+
if (element.$ContainsTarget || element.$Collection && targetIsTexts) {
|
|
504
|
+
if (element.$Collection) {
|
|
505
|
+
if (level < maxLevels)
|
|
506
|
+
pathItemsWithKey({
|
|
507
|
+
paths,
|
|
508
|
+
prefix,
|
|
509
|
+
prefixParameters,
|
|
510
|
+
element,
|
|
511
|
+
root,
|
|
512
|
+
sourceName,
|
|
513
|
+
targetName,
|
|
514
|
+
target,
|
|
515
|
+
level,
|
|
516
|
+
navigationPath,
|
|
517
|
+
restrictions,
|
|
518
|
+
nonExpandable
|
|
519
|
+
});
|
|
520
|
+
} else {
|
|
521
|
+
if (!root['$cds.autoexpose']) {
|
|
522
|
+
operationUpdate({ pathItem, element, name, sourceName, target, level, restrictions });
|
|
523
|
+
if (element.$Nullable) {
|
|
524
|
+
operationDelete({ pathItem, element, name, sourceName, target, level, restrictions });
|
|
525
|
+
}
|
|
526
|
+
}
|
|
527
|
+
pathItemsForBoundOperations({ paths, prefix, prefixParameters, element, sourceName });
|
|
528
|
+
pathItemsWithNavigation({
|
|
529
|
+
paths,
|
|
530
|
+
prefix,
|
|
531
|
+
prefixParameters,
|
|
532
|
+
type,
|
|
533
|
+
root,
|
|
534
|
+
sourceName,
|
|
535
|
+
level,
|
|
536
|
+
navigationPrefix: navigationPath
|
|
537
|
+
});
|
|
538
|
+
}
|
|
539
|
+
}
|
|
540
|
+
|
|
541
|
+
if (Object.keys(pathItem).filter((i) => i !== "parameters").length === 0)
|
|
542
|
+
delete paths[prefix];
|
|
543
|
+
}
|
|
544
|
+
|
|
545
|
+
/**
|
|
546
|
+
* Find navigation restrictions for a navigation path
|
|
547
|
+
* @param {object} root Root model element
|
|
548
|
+
* @param {string} navigationPath Path for finding navigation restrictions
|
|
549
|
+
* @return Navigation property restrictions of navigation segment
|
|
550
|
+
*/
|
|
551
|
+
function navigationPropertyRestrictions(root, navigationPath) {
|
|
552
|
+
const navigationRestrictions = root[meta.voc.Capabilities.NavigationRestrictions] ?? {};
|
|
553
|
+
return (navigationRestrictions.RestrictedProperties ?? []).find(item => navigationPropertyPath(item.NavigationProperty) == navigationPath)
|
|
554
|
+
?? {};
|
|
555
|
+
}
|
|
556
|
+
|
|
557
|
+
/**
|
|
558
|
+
* Find non-expandable properties for a navigation path
|
|
559
|
+
* @param {object} root Root model element
|
|
560
|
+
* @param {string} navigationPath Path for finding navigation restrictions
|
|
561
|
+
* @return Navigation property restrictions of navigation segment
|
|
562
|
+
*/
|
|
563
|
+
function nonExpandableProperties(root, navigationPath) {
|
|
564
|
+
const expandRestrictions = root[meta.voc.Capabilities.ExpandRestrictions] || {};
|
|
565
|
+
const prefix = navigationPath.length === 0 ? '' : `${navigationPath}/`
|
|
566
|
+
const from = prefix.length
|
|
567
|
+
const nonExpandable = []
|
|
568
|
+
for (const path of (expandRestrictions.NonExpandableProperties ?? [])) {
|
|
569
|
+
if (path.startsWith(prefix)) {
|
|
570
|
+
nonExpandable.push(path.substring(from))
|
|
571
|
+
}
|
|
572
|
+
}
|
|
573
|
+
return nonExpandable;
|
|
574
|
+
}
|
|
575
|
+
|
|
576
|
+
/**
|
|
577
|
+
* Add path and Path Item Object for a navigation segment with key
|
|
578
|
+
* @param {object} options
|
|
579
|
+
* @param {Paths} options.paths Paths Object to augment
|
|
580
|
+
* @param {string} options.prefix Prefix for path
|
|
581
|
+
* @param {Array} options.prefixParameters Parameter Objects for prefix
|
|
582
|
+
* @param {object} options.element Model element of navigation segment
|
|
583
|
+
* @param {object} options.root Root model element
|
|
584
|
+
* @param {string} options.sourceName Name of path source
|
|
585
|
+
* @param {string} options.targetName Name of path target
|
|
586
|
+
* @param {null | object} options.target Target container child of path
|
|
587
|
+
* @param {number} options.level Number of navigation segments so far
|
|
588
|
+
* @param {string} options.navigationPath Path for finding navigation restrictions
|
|
589
|
+
* @param {object} options.restrictions Navigation property restrictions of navigation segment
|
|
590
|
+
* @param {array} options.nonExpandable Non-expandable navigation properties
|
|
591
|
+
*/
|
|
592
|
+
function pathItemsWithKey({ paths, prefix, prefixParameters, element, root, sourceName, targetName, target, level, navigationPath, restrictions, nonExpandable }) {
|
|
593
|
+
const targetIndexable = target == null || target[meta.voc.Capabilities.IndexableByKey] != false;
|
|
594
|
+
if (restrictions.IndexableByKey == true || restrictions.IndexableByKey != false && targetIndexable) {
|
|
595
|
+
const name = prefix.substring(prefix.lastIndexOf('/') + 1);
|
|
596
|
+
const type = meta.modelElement(element.$Type);
|
|
597
|
+
const key = entityKey(type, level);
|
|
598
|
+
if (key.parameters.length > 0) {
|
|
599
|
+
const path = prefix + key.segment;
|
|
600
|
+
const parameters = prefixParameters.concat(key.parameters);
|
|
601
|
+
const pathItem = { parameters };
|
|
602
|
+
paths[path] = pathItem;
|
|
603
|
+
|
|
604
|
+
operationRead({
|
|
605
|
+
pathItem,
|
|
606
|
+
element,
|
|
607
|
+
name,
|
|
608
|
+
sourceName,
|
|
609
|
+
targetName,
|
|
610
|
+
target,
|
|
611
|
+
level,
|
|
612
|
+
restrictions,
|
|
613
|
+
byKey: true,
|
|
614
|
+
nonExpandable
|
|
615
|
+
});
|
|
616
|
+
if (!root['$cds.autoexpose']) {
|
|
617
|
+
operationUpdate({
|
|
618
|
+
pathItem,
|
|
619
|
+
element,
|
|
620
|
+
name,
|
|
621
|
+
sourceName,
|
|
622
|
+
target,
|
|
623
|
+
level,
|
|
624
|
+
restrictions,
|
|
625
|
+
byKey: true
|
|
626
|
+
});
|
|
627
|
+
operationDelete({
|
|
628
|
+
pathItem,
|
|
629
|
+
element,
|
|
630
|
+
name,
|
|
631
|
+
sourceName,
|
|
632
|
+
target,
|
|
633
|
+
level,
|
|
634
|
+
restrictions,
|
|
635
|
+
byKey: true
|
|
636
|
+
});
|
|
637
|
+
}
|
|
638
|
+
|
|
639
|
+
pathItemsForBoundOperations({
|
|
640
|
+
paths,
|
|
641
|
+
prefix: path,
|
|
642
|
+
prefixParameters: parameters,
|
|
643
|
+
element,
|
|
644
|
+
sourceName,
|
|
645
|
+
byKey: true
|
|
646
|
+
});
|
|
647
|
+
pathItemsWithNavigation({
|
|
648
|
+
paths,
|
|
649
|
+
prefix: path,
|
|
650
|
+
prefixParameters: parameters,
|
|
651
|
+
type,
|
|
652
|
+
root,
|
|
653
|
+
sourceName,
|
|
654
|
+
level,
|
|
655
|
+
navigationPrefix: navigationPath
|
|
656
|
+
});
|
|
657
|
+
pathItemsForMediaStream({ paths, prefix: path, prefixParameters: parameters, type, name, sourceName });
|
|
658
|
+
|
|
659
|
+
if (Object.keys(pathItem).filter((i) => i !== "parameters").length === 0)
|
|
660
|
+
delete paths[path];
|
|
661
|
+
}
|
|
662
|
+
}
|
|
663
|
+
}
|
|
664
|
+
|
|
665
|
+
/**
|
|
666
|
+
* Construct Operation Object for create
|
|
667
|
+
* @param {object} options
|
|
668
|
+
* @param {object} options.pathItem Path Item Object to augment
|
|
669
|
+
* @param {object} options.element Model element of navigation segment
|
|
670
|
+
* @param {string} options.name Name of navigation segment
|
|
671
|
+
* @param {string} options.sourceName Name of path source
|
|
672
|
+
* @param {string} options.targetName Name of path target
|
|
673
|
+
* @param {null | TargetRestrictions} options.target Target container child of path
|
|
674
|
+
* @param {number} options.level Number of navigation segments so far
|
|
675
|
+
* @param {object} options.restrictions Navigation property restrictions of navigation segment
|
|
676
|
+
*/
|
|
677
|
+
function operationCreate({ pathItem, element, name, sourceName, targetName, target, level, restrictions }) {
|
|
678
|
+
const insertRestrictions = restrictions.InsertRestrictions || target?.[meta.voc.Capabilities.InsertRestrictions] || {};
|
|
679
|
+
const countRestrictions = target?.[meta.voc.Capabilities.CountRestrictions]?.Countable === false // count property will be added if CountRestrictions is false
|
|
680
|
+
if (insertRestrictions.Insertable !== false) {
|
|
681
|
+
const lname = pluralize.singular(splitName(name));
|
|
682
|
+
const type = meta.modelElement(element.$Type);
|
|
683
|
+
pathItem.post = {
|
|
684
|
+
summary: insertRestrictions.Description || operationSummary({
|
|
685
|
+
operation: 'Creates',
|
|
686
|
+
name,
|
|
687
|
+
sourceName,
|
|
688
|
+
level,
|
|
689
|
+
collection: true,
|
|
690
|
+
byKey: true
|
|
691
|
+
}),
|
|
692
|
+
tags: [normaliseTag(sourceName)],
|
|
693
|
+
requestBody: {
|
|
694
|
+
description: type && type[meta.voc.Core.Description] || `New ${lname}`,
|
|
695
|
+
required: true,
|
|
696
|
+
content: {
|
|
697
|
+
'application/json': {
|
|
698
|
+
schema: ref(element.$Type, SUFFIX.create),
|
|
699
|
+
}
|
|
700
|
+
}
|
|
701
|
+
},
|
|
702
|
+
responses: response({
|
|
703
|
+
code: 201,
|
|
704
|
+
description: `Created ${lname}`,
|
|
705
|
+
type: { $Type: element.$Type },
|
|
706
|
+
errors: insertRestrictions.ErrorResponses,
|
|
707
|
+
isCount: !countRestrictions
|
|
708
|
+
}),
|
|
709
|
+
};
|
|
710
|
+
if (insertRestrictions.LongDescription) pathItem.post.description = insertRestrictions.LongDescription;
|
|
711
|
+
if (targetName && sourceName != targetName) pathItem.post.tags.push(normaliseTag(targetName));
|
|
712
|
+
customParameters(pathItem.post, insertRestrictions);
|
|
713
|
+
}
|
|
714
|
+
}
|
|
715
|
+
|
|
716
|
+
/**
|
|
717
|
+
* Construct operation summary
|
|
718
|
+
* @param {object} options
|
|
719
|
+
* @param {string} options.operation Operation (verb)
|
|
720
|
+
* @param {string} options.name Name of navigation segment
|
|
721
|
+
* @param {string} options.sourceName Name of path source
|
|
722
|
+
* @param {number} options.level Number of navigation segments so far
|
|
723
|
+
* @param {boolean} options.collection Access a collection
|
|
724
|
+
* @param {boolean} options.byKey Access by key
|
|
725
|
+
* @return Operation Text
|
|
726
|
+
*/
|
|
727
|
+
function operationSummary({ operation, name, sourceName, level, collection, byKey }) {
|
|
728
|
+
const lname = splitName(name);
|
|
729
|
+
const sname = splitName(sourceName);
|
|
730
|
+
|
|
731
|
+
return `${operation} ${
|
|
732
|
+
byKey ? 'a single ' : (collection ? 'a list of ' : '')
|
|
733
|
+
}${byKey ? pluralize.singular(lname) : lname
|
|
734
|
+
//TODO: suppress "a" for all singletons
|
|
735
|
+
}${level == 0 ? '' : (level == 1 && sname == 'me' ? ' of me' : ` of a ${pluralize.singular(sname)}`)
|
|
736
|
+
}.`
|
|
737
|
+
}
|
|
738
|
+
|
|
739
|
+
/**
|
|
740
|
+
* Construct Operation Object for read
|
|
741
|
+
* @param {object} options
|
|
742
|
+
* @param {object} options.pathItem Path Item Object to augment
|
|
743
|
+
* @param {object} options.element Model element of navigation segment
|
|
744
|
+
* @param {string} options.name Name of navigation segment
|
|
745
|
+
* @param {string} options.sourceName Name of path source
|
|
746
|
+
* @param {string} options.targetName Name of path target
|
|
747
|
+
* @param {null | TargetRestrictions} options.target Target container child of path
|
|
748
|
+
* @param {number} options.level Number of navigation segments so far
|
|
749
|
+
* @param {object} options.restrictions Navigation property restrictions of navigation segment
|
|
750
|
+
* @param {boolean} options.byKey Read by key
|
|
751
|
+
* @param {array} options.nonExpandable Non-expandable navigation properties
|
|
752
|
+
*/
|
|
753
|
+
function operationRead({ pathItem, element, name, sourceName, targetName, target, level, restrictions, byKey, nonExpandable }) {
|
|
754
|
+
const targetRestrictions = target?.[meta.voc.Capabilities.ReadRestrictions];
|
|
755
|
+
const readRestrictions = restrictions.ReadRestrictions || targetRestrictions || {};
|
|
756
|
+
const readByKeyRestrictions = readRestrictions.ReadByKeyRestrictions;
|
|
757
|
+
let readable = true;
|
|
758
|
+
const countRestrictions = target && (target[meta.voc.Capabilities.CountRestrictions]?.Countable === false);
|
|
759
|
+
if (byKey && readByKeyRestrictions && readByKeyRestrictions.Readable !== undefined)
|
|
760
|
+
readable = readByKeyRestrictions.Readable;
|
|
761
|
+
else if (readRestrictions.Readable !== undefined)
|
|
762
|
+
readable = readRestrictions.Readable;
|
|
763
|
+
|
|
764
|
+
if (readable) {
|
|
765
|
+
let descriptions = (level == 0 ? targetRestrictions : restrictions.ReadRestrictions) || {};
|
|
766
|
+
if (byKey) descriptions = descriptions.ReadByKeyRestrictions || {};
|
|
767
|
+
const lname = splitName(name);
|
|
768
|
+
const collection = !byKey && element.$Collection;
|
|
769
|
+
const operation = {
|
|
770
|
+
summary: descriptions.Description || operationSummary({
|
|
771
|
+
operation: 'Retrieves',
|
|
772
|
+
name,
|
|
773
|
+
sourceName,
|
|
774
|
+
level,
|
|
775
|
+
collection: element.$Collection,
|
|
776
|
+
byKey
|
|
777
|
+
}),
|
|
778
|
+
tags: [normaliseTag(sourceName)],
|
|
779
|
+
parameters: [],
|
|
780
|
+
responses: response({
|
|
781
|
+
code: 200,
|
|
782
|
+
description: `Retrieved ${byKey ? pluralize.singular(lname) : lname}`,
|
|
783
|
+
type: { $Type: element.$Type, $Collection: collection },
|
|
784
|
+
errors: byKey ? readByKeyRestrictions?.ErrorResponses : readRestrictions?.ErrorResponses,
|
|
785
|
+
isCount: !countRestrictions
|
|
786
|
+
})
|
|
787
|
+
};
|
|
788
|
+
const deltaSupported = element[meta.voc.Capabilities.ChangeTracking] && element[meta.voc.Capabilities.ChangeTracking].Supported;
|
|
789
|
+
if (!byKey && deltaSupported) {
|
|
790
|
+
// @ts-expect-error - set above
|
|
791
|
+
operation.responses[200].content['application/json'].schema.properties['@odata.deltaLink'] = {
|
|
792
|
+
type: 'string',
|
|
793
|
+
example: `${basePath}/${name}?$deltatoken=opaque server-generated token for fetching the delta`
|
|
794
|
+
}
|
|
795
|
+
}
|
|
796
|
+
if (descriptions.LongDescription) operation.description = descriptions.LongDescription;
|
|
797
|
+
if (target && sourceName != targetName) operation.tags.push(normaliseTag(targetName));
|
|
798
|
+
customParameters(operation, byKey ? readByKeyRestrictions || readRestrictions : readRestrictions);
|
|
799
|
+
|
|
800
|
+
if (collection) {
|
|
801
|
+
optionTop(operation.parameters, target, restrictions);
|
|
802
|
+
optionSkip(operation.parameters, target, restrictions);
|
|
803
|
+
if (csdl.$Version >= '4.0') optionSearch(operation.parameters, target, restrictions);
|
|
804
|
+
optionFilter(operation.parameters, target, restrictions);
|
|
805
|
+
optionCount(operation.parameters, target);
|
|
806
|
+
optionOrderBy(operation.parameters, element, target, restrictions);
|
|
807
|
+
}
|
|
808
|
+
|
|
809
|
+
optionSelect(operation.parameters, element, target, restrictions);
|
|
810
|
+
optionExpand(operation.parameters, element, target, nonExpandable);
|
|
811
|
+
|
|
812
|
+
pathItem.get = operation;
|
|
813
|
+
}
|
|
814
|
+
}
|
|
815
|
+
|
|
816
|
+
/**
|
|
817
|
+
* Add custom headers and query options
|
|
818
|
+
* @param {object} operation Operation object to augment
|
|
819
|
+
* @param {object} restrictions Restrictions for operation
|
|
820
|
+
*/
|
|
821
|
+
function customParameters(operation, restrictions) {
|
|
822
|
+
if (
|
|
823
|
+
!operation.parameters &&
|
|
824
|
+
(restrictions.CustomHeaders || restrictions.CustomQueryOptions)
|
|
825
|
+
)
|
|
826
|
+
operation.parameters = [];
|
|
827
|
+
for (const custom of restrictions.CustomHeaders || []) {
|
|
828
|
+
operation.parameters.push(customParameter(custom, "header"));
|
|
829
|
+
}
|
|
830
|
+
|
|
831
|
+
for (const custom of restrictions.CustomQueryOptions || []) {
|
|
832
|
+
operation.parameters.push(customParameter(custom, "query"));
|
|
833
|
+
}
|
|
834
|
+
}
|
|
835
|
+
|
|
836
|
+
/**
|
|
837
|
+
* Construct custom parameter
|
|
838
|
+
* @param {object} custom custom parameter in OData format
|
|
839
|
+
* @param {string} location "header" or "query"
|
|
840
|
+
*/
|
|
841
|
+
function customParameter(custom, location) {
|
|
842
|
+
return {
|
|
843
|
+
name: custom.Name,
|
|
844
|
+
in: location,
|
|
845
|
+
required: custom.Required || false,
|
|
846
|
+
...(custom.Description && { description: custom.Description }),
|
|
847
|
+
schema: {
|
|
848
|
+
type: "string",
|
|
849
|
+
...(custom.DocumentationURL && {
|
|
850
|
+
externalDocs: { url: custom.DocumentationURL },
|
|
851
|
+
}),
|
|
852
|
+
//TODO: Examples
|
|
853
|
+
},
|
|
854
|
+
};
|
|
855
|
+
}
|
|
856
|
+
|
|
857
|
+
/**
|
|
858
|
+
* Add parameter for query option $count
|
|
859
|
+
* @param {Array} parameters Array of parameters to augment
|
|
860
|
+
* @param {null | TargetRestrictions} target Target container child of path
|
|
861
|
+
*/
|
|
862
|
+
function optionCount(parameters, target) {
|
|
863
|
+
const targetRestrictions = target?.[meta.voc.Capabilities.CountRestrictions];
|
|
864
|
+
const targetCountable = target == null
|
|
865
|
+
|| targetRestrictions == null
|
|
866
|
+
|| targetRestrictions.Countable !== false;
|
|
867
|
+
|
|
868
|
+
if (targetCountable) {
|
|
869
|
+
parameters.push({
|
|
870
|
+
|
|
871
|
+
$ref: '#/components/parameters/count'
|
|
872
|
+
});
|
|
873
|
+
}
|
|
874
|
+
}
|
|
875
|
+
|
|
876
|
+
/**
|
|
877
|
+
* Add parameter for query option $expand
|
|
878
|
+
* @param {Array} parameters Array of parameters to augment
|
|
879
|
+
* @param {object} element Model element of navigation segment
|
|
880
|
+
* @param {null | TargetRestrictions} target Target container child of path
|
|
881
|
+
* @param {array} nonExpandable Non-expandable navigation properties
|
|
882
|
+
*/
|
|
883
|
+
function optionExpand(parameters, element, target, nonExpandable) {
|
|
884
|
+
const targetRestrictions = target?.[meta.voc.Capabilities.ExpandRestrictions];
|
|
885
|
+
const supported = targetRestrictions == null || targetRestrictions.Expandable != false;
|
|
886
|
+
if (supported) {
|
|
887
|
+
const expandItems = ['*'].concat(navigationPaths(element).filter(path => !nonExpandable.includes(path)));
|
|
888
|
+
if (expandItems.length > 1) {
|
|
889
|
+
parameters.push({
|
|
890
|
+
name: `${queryOptionPrefix}expand`,
|
|
891
|
+
description: (targetRestrictions && targetRestrictions[meta.voc.Core.Description])
|
|
892
|
+
|| 'The value of $expand query option is a comma-separated list of navigation property names, \
|
|
893
|
+
stream property names, or $value indicating the stream content of a media-entity. \
|
|
894
|
+
The corresponding related entities and stream values will be represented inline, \
|
|
895
|
+
see [Expand](http://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-protocol.html#sec_SystemQueryOptionexpand)',
|
|
896
|
+
in: 'query',
|
|
897
|
+
explode: false,
|
|
898
|
+
schema: {
|
|
899
|
+
type: 'array',
|
|
900
|
+
uniqueItems: true,
|
|
901
|
+
items: {
|
|
902
|
+
type: 'string',
|
|
903
|
+
enum: expandItems
|
|
904
|
+
}
|
|
905
|
+
}
|
|
906
|
+
});
|
|
907
|
+
}
|
|
908
|
+
}
|
|
909
|
+
}
|
|
910
|
+
|
|
911
|
+
/**
|
|
912
|
+
* Collect navigation paths of a navigation segment and its potentially structured components
|
|
913
|
+
* @param {object} element Model element of navigation segment
|
|
914
|
+
* @param {string} prefix Navigation prefix
|
|
915
|
+
* @param {number} level Number of navigation segments so far
|
|
916
|
+
* @return {Array} Array of navigation property paths
|
|
917
|
+
*/
|
|
918
|
+
function navigationPaths(element, prefix = '', level = 0) {
|
|
919
|
+
const paths = [];
|
|
920
|
+
const type = meta.modelElement(element.$Type);
|
|
921
|
+
const properties = propertiesOfStructuredType(type);
|
|
922
|
+
Object.keys(properties).forEach(key => {
|
|
923
|
+
if (properties[key].$Kind == 'NavigationProperty') {
|
|
924
|
+
paths.push(prefix + key)
|
|
925
|
+
} else if (properties[key].$Type && level < maxLevels) {
|
|
926
|
+
paths.push(...navigationPaths(properties[key], `${prefix + key}/`, level + 1));
|
|
927
|
+
}
|
|
928
|
+
})
|
|
929
|
+
return paths;
|
|
930
|
+
}
|
|
931
|
+
|
|
932
|
+
/**
|
|
933
|
+
* Add parameter for query option $filter
|
|
934
|
+
* @param {Array} parameters Array of parameters to augment
|
|
935
|
+
* @param {null | TargetRestrictions} target Target container child of path
|
|
936
|
+
* @param {object} restrictions Navigation property restrictions of navigation segment
|
|
937
|
+
*/
|
|
938
|
+
function optionFilter(parameters, target, restrictions) {
|
|
939
|
+
const filterRestrictions = restrictions.FilterRestrictions || target?.[meta.voc.Capabilities.FilterRestrictions] || {};
|
|
940
|
+
|
|
941
|
+
if (filterRestrictions.Filterable !== false) {
|
|
942
|
+
const filter = {
|
|
943
|
+
name: `${queryOptionPrefix}filter`,
|
|
944
|
+
description: filterRestrictions[meta.voc.Core.Description]
|
|
945
|
+
|| 'Filter items by property values, see [Filtering](http://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-protocol.html#sec_SystemQueryOptionfilter)',
|
|
946
|
+
in: 'query',
|
|
947
|
+
schema: {
|
|
948
|
+
type: 'string'
|
|
949
|
+
}
|
|
950
|
+
};
|
|
951
|
+
if (filterRestrictions.RequiresFilter)
|
|
952
|
+
filter.required = true;
|
|
953
|
+
if (filterRestrictions.RequiredProperties) {
|
|
954
|
+
filter.description += '\n\nRequired filter properties:';
|
|
955
|
+
filterRestrictions.RequiredProperties.forEach(
|
|
956
|
+
item => filter.description += `\n- ${propertyPath(item)}`
|
|
957
|
+
);
|
|
958
|
+
}
|
|
959
|
+
parameters.push(filter);
|
|
960
|
+
}
|
|
961
|
+
}
|
|
962
|
+
|
|
963
|
+
/**
|
|
964
|
+
* Add parameter for query option $orderby
|
|
965
|
+
* @param {Array} parameters Array of parameters to augment
|
|
966
|
+
* @param {object} element Model element of navigation segment
|
|
967
|
+
* @param {null | TargetRestrictions} target Target container child of path
|
|
968
|
+
* @param {object} restrictions Navigation property restrictions of navigation segment
|
|
969
|
+
*/
|
|
970
|
+
function optionOrderBy(parameters, element, target, restrictions) {
|
|
971
|
+
const sortRestrictions = restrictions.SortRestrictions || target?.[meta.voc.Capabilities.SortRestrictions] || {};
|
|
972
|
+
|
|
973
|
+
if (sortRestrictions.Sortable !== false) {
|
|
974
|
+
const nonSortable = {};
|
|
975
|
+
(sortRestrictions.NonSortableProperties || []).forEach(name => {
|
|
976
|
+
nonSortable[propertyPath(name)] = true;
|
|
977
|
+
});
|
|
978
|
+
const orderbyItems = [];
|
|
979
|
+
primitivePaths(element).filter(property => !nonSortable[property]).forEach(property => {
|
|
980
|
+
orderbyItems.push(property);
|
|
981
|
+
orderbyItems.push(`${property} desc`);
|
|
982
|
+
});
|
|
983
|
+
if (orderbyItems.length > 0) {
|
|
984
|
+
parameters.push({
|
|
985
|
+
name: `${queryOptionPrefix}orderby`,
|
|
986
|
+
description: sortRestrictions[meta.voc.Core.Description]
|
|
987
|
+
|| 'Order items by property values, see [Sorting](http://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-protocol.html#sec_SystemQueryOptionorderby)',
|
|
988
|
+
in: 'query',
|
|
989
|
+
explode: false,
|
|
990
|
+
schema: {
|
|
991
|
+
type: 'array',
|
|
992
|
+
uniqueItems: true,
|
|
993
|
+
items: {
|
|
994
|
+
type: 'string',
|
|
995
|
+
enum: orderbyItems
|
|
996
|
+
}
|
|
997
|
+
}
|
|
998
|
+
});
|
|
999
|
+
}
|
|
1000
|
+
}
|
|
1001
|
+
}
|
|
1002
|
+
|
|
1003
|
+
/**
|
|
1004
|
+
* Unpack EnumMember value if it uses CSDL JSON CS01 style, like CAP does
|
|
1005
|
+
* @param {string | object} member Qualified name of referenced type
|
|
1006
|
+
* @return {object} Reference Object
|
|
1007
|
+
*/
|
|
1008
|
+
function enumMember(member) {
|
|
1009
|
+
if (typeof member == 'string')
|
|
1010
|
+
return member;
|
|
1011
|
+
else if (typeof member == 'object')
|
|
1012
|
+
return member.$EnumMember;
|
|
1013
|
+
}
|
|
1014
|
+
|
|
1015
|
+
/**
|
|
1016
|
+
* Unpack NavigationPropertyPath value if it uses CSDL JSON CS01 style, like CAP does
|
|
1017
|
+
* @param {string | object} path Qualified name of referenced type
|
|
1018
|
+
* @return {object} Reference Object
|
|
1019
|
+
*/
|
|
1020
|
+
function navigationPropertyPath(path) {
|
|
1021
|
+
if (typeof path == 'string')
|
|
1022
|
+
return path;
|
|
1023
|
+
return path.$NavigationPropertyPath;
|
|
1024
|
+
}
|
|
1025
|
+
|
|
1026
|
+
/**
|
|
1027
|
+
* Unpack PropertyPath value if it uses CSDL JSON CS01 style, like CAP does
|
|
1028
|
+
* @param {string | object} path Qualified name of referenced type
|
|
1029
|
+
* @return {object} Reference Object
|
|
1030
|
+
*/
|
|
1031
|
+
function propertyPath(path) {
|
|
1032
|
+
if (typeof path == 'string')
|
|
1033
|
+
return path;
|
|
1034
|
+
return path.$PropertyPath;
|
|
1035
|
+
}
|
|
1036
|
+
|
|
1037
|
+
/**
|
|
1038
|
+
* Collect primitive paths of a navigation segment and its potentially structured components
|
|
1039
|
+
* @param {object} element Model element of navigation segment
|
|
1040
|
+
* @param {string} prefix Navigation prefix
|
|
1041
|
+
* @return {Array} Array of primitive property paths
|
|
1042
|
+
*/
|
|
1043
|
+
function primitivePaths(element, prefix = '') {
|
|
1044
|
+
const paths = [];
|
|
1045
|
+
const elementType = meta.modelElement(element.$Type);
|
|
1046
|
+
|
|
1047
|
+
if (!elementType) {
|
|
1048
|
+
DEBUG?.(`Unknown type for element: ${JSON.stringify(element)}`);
|
|
1049
|
+
return paths;
|
|
1050
|
+
}
|
|
1051
|
+
|
|
1052
|
+
const propsOfType = propertiesOfStructuredType(elementType);
|
|
1053
|
+
const ignore = Object.entries(propsOfType)
|
|
1054
|
+
.filter(entry => entry[1].$Kind !== 'NavigationProperty')
|
|
1055
|
+
.filter(entry => entry[1].$Type)
|
|
1056
|
+
.filter(entry => nameParts(entry[1].$Type).qualifier !== 'Edm')
|
|
1057
|
+
.filter(entry => !meta.modelElement(entry[1].$Type));
|
|
1058
|
+
|
|
1059
|
+
// Keep old logging
|
|
1060
|
+
ignore.forEach(entry => DEBUG?.(`Unknown type for element: ${JSON.stringify(entry)}`));
|
|
1061
|
+
|
|
1062
|
+
const properties = Object.entries(propsOfType)
|
|
1063
|
+
.filter(entry => entry[1].$Kind !== 'NavigationProperty')
|
|
1064
|
+
.filter(entry => !ignore.includes(entry))
|
|
1065
|
+
.map(entryToProperty({ path: prefix, typeRefChain: [] }));
|
|
1066
|
+
|
|
1067
|
+
for (let i = 0; i < properties.length; i++) {
|
|
1068
|
+
const property = properties[i];
|
|
1069
|
+
if (!property.isComplex) {
|
|
1070
|
+
paths.push(property.path);
|
|
1071
|
+
continue;
|
|
1072
|
+
}
|
|
1073
|
+
|
|
1074
|
+
const typeRefChainTail = property.typeRefChain[property.typeRefChain.length - 1];
|
|
1075
|
+
|
|
1076
|
+
// Allow full cycle to be shown (0) times
|
|
1077
|
+
if (property.typeRefChain.filter(_type => _type === typeRefChainTail).length > 1) {
|
|
1078
|
+
DEBUG?.(`Cycle detected ${property.typeRefChain.join('->')}`);
|
|
1079
|
+
continue;
|
|
1080
|
+
}
|
|
1081
|
+
|
|
1082
|
+
const expanded = Object.entries(property.properties)
|
|
1083
|
+
.filter(pProperty => pProperty[1].$Kind !== 'NavigationProperty')
|
|
1084
|
+
.map(entryToProperty(property))
|
|
1085
|
+
properties.splice(i + 1, 0, ...expanded);
|
|
1086
|
+
}
|
|
1087
|
+
|
|
1088
|
+
return paths;
|
|
1089
|
+
}
|
|
1090
|
+
|
|
1091
|
+
function entryToProperty(parent) {
|
|
1092
|
+
|
|
1093
|
+
return function (entry) {
|
|
1094
|
+
const key = entry[0];
|
|
1095
|
+
const property = entry[1];
|
|
1096
|
+
const propertyType = property.$Type && meta.modelElement(property.$Type);
|
|
1097
|
+
|
|
1098
|
+
if (propertyType && propertyType.$Kind && propertyType.$Kind === 'ComplexType') {
|
|
1099
|
+
return {
|
|
1100
|
+
properties: propertiesOfStructuredType(propertyType),
|
|
1101
|
+
path: `${parent.path}${key}/`,
|
|
1102
|
+
typeRefChain: parent.typeRefChain.concat(property.$Type),
|
|
1103
|
+
isComplex: true
|
|
1104
|
+
}
|
|
1105
|
+
}
|
|
1106
|
+
|
|
1107
|
+
return {
|
|
1108
|
+
properties: {},
|
|
1109
|
+
path: `${parent.path}${key}`,
|
|
1110
|
+
typeRefChain: [],
|
|
1111
|
+
isComplex: false,
|
|
1112
|
+
}
|
|
1113
|
+
};
|
|
1114
|
+
}
|
|
1115
|
+
|
|
1116
|
+
/**
|
|
1117
|
+
* Add parameter for query option $search
|
|
1118
|
+
* @param {Array} parameters Array of parameters to augment
|
|
1119
|
+
* @param {null | TargetRestrictions} target Target container child of path
|
|
1120
|
+
* @param {object} restrictions Navigation property restrictions of navigation segment
|
|
1121
|
+
*/
|
|
1122
|
+
function optionSearch(parameters, target, restrictions) {
|
|
1123
|
+
const searchRestrictions = restrictions.SearchRestrictions ?? target?.[meta.voc.Capabilities.SearchRestrictions] ?? {};
|
|
1124
|
+
|
|
1125
|
+
if (searchRestrictions.Searchable !== false) {
|
|
1126
|
+
if (searchRestrictions[meta.voc.Core.Description]) {
|
|
1127
|
+
parameters.push({
|
|
1128
|
+
name: `${queryOptionPrefix}search`,
|
|
1129
|
+
description: searchRestrictions[meta.voc.Core.Description],
|
|
1130
|
+
in: 'query',
|
|
1131
|
+
schema: { type: 'string' }
|
|
1132
|
+
});
|
|
1133
|
+
} else {
|
|
1134
|
+
parameters.push({ $ref: '#/components/parameters/search' });
|
|
1135
|
+
}
|
|
1136
|
+
}
|
|
1137
|
+
}
|
|
1138
|
+
|
|
1139
|
+
/**
|
|
1140
|
+
* Add parameter for query option $select
|
|
1141
|
+
* @param {Array} parameters Array of parameters to augment
|
|
1142
|
+
* @param {object} element Model element of navigation segment
|
|
1143
|
+
* @param {null | TargetRestrictions} target Target container child of path
|
|
1144
|
+
* @param {object} restrictions Navigation property restrictions of navigation segment
|
|
1145
|
+
*/
|
|
1146
|
+
function optionSelect(parameters, element, target, restrictions) {
|
|
1147
|
+
const selectSupport = restrictions.SelectSupport ?? target?.[meta.voc.Capabilities.SelectSupport] ?? {};
|
|
1148
|
+
|
|
1149
|
+
if (selectSupport.Supported !== false) {
|
|
1150
|
+
const type = meta.modelElement(element.$Type) || {};
|
|
1151
|
+
const properties = propertiesOfStructuredType(type);
|
|
1152
|
+
const selectItems = [];
|
|
1153
|
+
Object.keys(properties).filter(key => properties[key].$Kind != 'NavigationProperty').forEach(
|
|
1154
|
+
key => selectItems.push(key)
|
|
1155
|
+
)
|
|
1156
|
+
if (selectItems.length > 0) {
|
|
1157
|
+
parameters.push({
|
|
1158
|
+
name: `${queryOptionPrefix}select`,
|
|
1159
|
+
description: 'Select properties to be returned, see [Select](http://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-protocol.html#sec_SystemQueryOptionselect)',
|
|
1160
|
+
in: 'query',
|
|
1161
|
+
explode: false,
|
|
1162
|
+
schema: {
|
|
1163
|
+
type: 'array',
|
|
1164
|
+
uniqueItems: true,
|
|
1165
|
+
items: {
|
|
1166
|
+
type: 'string',
|
|
1167
|
+
enum: selectItems
|
|
1168
|
+
}
|
|
1169
|
+
}
|
|
1170
|
+
});
|
|
1171
|
+
}
|
|
1172
|
+
}
|
|
1173
|
+
}
|
|
1174
|
+
|
|
1175
|
+
/**
|
|
1176
|
+
* Add parameter for query option $skip
|
|
1177
|
+
* @param {Array} parameters Array of parameters to augment
|
|
1178
|
+
* @param {null | TargetRestrictions} target Target container child of path
|
|
1179
|
+
* @param {object} restrictions Navigation property restrictions of navigation segment
|
|
1180
|
+
*/
|
|
1181
|
+
function optionSkip(parameters, target, restrictions) {
|
|
1182
|
+
const supported = restrictions.SkipSupported !== undefined
|
|
1183
|
+
? restrictions.SkipSupported
|
|
1184
|
+
: target == null || target[meta.voc.Capabilities.SkipSupported] !== false;
|
|
1185
|
+
|
|
1186
|
+
if (supported) {
|
|
1187
|
+
parameters.push({
|
|
1188
|
+
$ref: '#/components/parameters/skip'
|
|
1189
|
+
});
|
|
1190
|
+
}
|
|
1191
|
+
}
|
|
1192
|
+
|
|
1193
|
+
/**
|
|
1194
|
+
* Add parameter for query option $top
|
|
1195
|
+
* @param {Array} parameters Array of parameters to augment
|
|
1196
|
+
* @param {null | TargetRestrictions} target Target container child of path
|
|
1197
|
+
* @param {object} restrictions Navigation property restrictions of navigation segment
|
|
1198
|
+
*/
|
|
1199
|
+
function optionTop(parameters, target, restrictions) {
|
|
1200
|
+
const supported = restrictions.TopSupported !== undefined
|
|
1201
|
+
? restrictions.TopSupported
|
|
1202
|
+
: target == null || target?.[meta.voc.Capabilities.TopSupported] !== false;
|
|
1203
|
+
|
|
1204
|
+
if (supported) {
|
|
1205
|
+
parameters.push({
|
|
1206
|
+
$ref: '#/components/parameters/top'
|
|
1207
|
+
});
|
|
1208
|
+
}
|
|
1209
|
+
}
|
|
1210
|
+
|
|
1211
|
+
/**
|
|
1212
|
+
* Construct Operation Object for update
|
|
1213
|
+
* @param {object} options
|
|
1214
|
+
* @param {object} options.pathItem Path Item Object to augment
|
|
1215
|
+
* @param {object} options.element Model element of navigation segment
|
|
1216
|
+
* @param {string} options.name Name of navigation segment
|
|
1217
|
+
* @param {string} options.sourceName Name of path source
|
|
1218
|
+
* @param {null | TargetRestrictions} options.target Target container child of path
|
|
1219
|
+
* @param {number} options.level Number of navigation segments so far
|
|
1220
|
+
* @param {object} options.restrictions Navigation property restrictions of navigation segment
|
|
1221
|
+
* @param {boolean} [options.byKey=false] Update by key
|
|
1222
|
+
*/
|
|
1223
|
+
function operationUpdate({ pathItem, element, name, sourceName, target, level, restrictions, byKey = false }) {
|
|
1224
|
+
const updateRestrictions = restrictions.UpdateRestrictions || target?.[meta.voc.Capabilities.UpdateRestrictions] || {};
|
|
1225
|
+
const countRestrictions = target?.[meta.voc.Capabilities.CountRestrictions]?.Countable === false;
|
|
1226
|
+
if (updateRestrictions.Updatable !== false && !element[meta.voc.Core.Immutable]) {
|
|
1227
|
+
|
|
1228
|
+
const type = meta.modelElement(element.$Type);
|
|
1229
|
+
const operation = {
|
|
1230
|
+
summary: updateRestrictions.Description || operationSummary({
|
|
1231
|
+
operation: 'Changes',
|
|
1232
|
+
name,
|
|
1233
|
+
sourceName,
|
|
1234
|
+
level,
|
|
1235
|
+
collection: element.$Collection,
|
|
1236
|
+
byKey
|
|
1237
|
+
}),
|
|
1238
|
+
tags: [normaliseTag(sourceName)],
|
|
1239
|
+
requestBody: {
|
|
1240
|
+
description: type && type[meta.voc.Core.Description] || 'New property values',
|
|
1241
|
+
required: true,
|
|
1242
|
+
content: {
|
|
1243
|
+
'application/json': {
|
|
1244
|
+
schema: ref(element.$Type, SUFFIX.update),
|
|
1245
|
+
}
|
|
1246
|
+
}
|
|
1247
|
+
},
|
|
1248
|
+
responses: response({
|
|
1249
|
+
code: 204,
|
|
1250
|
+
description: "Success",
|
|
1251
|
+
type: undefined,
|
|
1252
|
+
errors: updateRestrictions.ErrorResponses,
|
|
1253
|
+
isCount: !countRestrictions
|
|
1254
|
+
}),
|
|
1255
|
+
};
|
|
1256
|
+
if (updateRestrictions.LongDescription) operation.description = updateRestrictions.LongDescription;
|
|
1257
|
+
customParameters(operation, updateRestrictions);
|
|
1258
|
+
const updateMethod = updateRestrictions.UpdateMethod?.['$Capabilities.HttpMethod']?.toLowerCase() ?? 'patch';
|
|
1259
|
+
pathItem[updateMethod] = operation;
|
|
1260
|
+
}
|
|
1261
|
+
}
|
|
1262
|
+
|
|
1263
|
+
/**
|
|
1264
|
+
* Construct Operation Object for delete
|
|
1265
|
+
* @param {object} options
|
|
1266
|
+
* @param {object} options.pathItem Path Item Object to augment
|
|
1267
|
+
* @param {object} options.element Model element of navigation segment
|
|
1268
|
+
* @param {string} options.name Name of navigation segment
|
|
1269
|
+
* @param {string} options.sourceName Name of path source
|
|
1270
|
+
* @param {null | TargetRestrictions} options.target Target container child of path
|
|
1271
|
+
* @param {number} options.level Number of navigation segments so far
|
|
1272
|
+
* @param {object} options.restrictions Navigation property restrictions of navigation segment
|
|
1273
|
+
* @param {boolean} [options.byKey=false] Delete by key
|
|
1274
|
+
*/
|
|
1275
|
+
function operationDelete({ pathItem, element, name, sourceName, target, level, restrictions, byKey = false }) {
|
|
1276
|
+
const deleteRestrictions = restrictions.DeleteRestrictions || target?.[meta.voc.Capabilities.DeleteRestrictions] || {};
|
|
1277
|
+
const countRestrictions = target?.[meta.voc.Capabilities.CountRestrictions]?.Countable === false
|
|
1278
|
+
if (deleteRestrictions.Deletable !== false) {
|
|
1279
|
+
pathItem.delete = {
|
|
1280
|
+
summary: deleteRestrictions.Description || operationSummary({
|
|
1281
|
+
operation: 'Deletes',
|
|
1282
|
+
name,
|
|
1283
|
+
sourceName,
|
|
1284
|
+
level,
|
|
1285
|
+
collection: element.$Collection,
|
|
1286
|
+
byKey
|
|
1287
|
+
}),
|
|
1288
|
+
tags: [normaliseTag(sourceName)],
|
|
1289
|
+
responses: response({
|
|
1290
|
+
code: 204,
|
|
1291
|
+
description: "Success",
|
|
1292
|
+
type: undefined,
|
|
1293
|
+
errors: deleteRestrictions.ErrorResponses,
|
|
1294
|
+
isCount: !countRestrictions
|
|
1295
|
+
}),
|
|
1296
|
+
};
|
|
1297
|
+
if (deleteRestrictions.LongDescription) pathItem.delete.description = deleteRestrictions.LongDescription;
|
|
1298
|
+
customParameters(pathItem.delete, deleteRestrictions);
|
|
1299
|
+
}
|
|
1300
|
+
}
|
|
1301
|
+
|
|
1302
|
+
/**
|
|
1303
|
+
* Add path and Path Item Object for media stream access ($value) and stream properties of an entity type
|
|
1304
|
+
* @param {object} options
|
|
1305
|
+
* @param {object} options.paths The Paths Object to augment
|
|
1306
|
+
* @param {string} options.prefix Prefix for path (the key-qualified entity path)
|
|
1307
|
+
* @param {Array} options.prefixParameters Parameter Objects for prefix
|
|
1308
|
+
* @param {object} options.type Entity type object
|
|
1309
|
+
* @param {string} options.name Name of the entity set
|
|
1310
|
+
* @param {string} options.sourceName Name of path source
|
|
1311
|
+
*/
|
|
1312
|
+
function pathItemsForMediaStream({ paths, prefix, prefixParameters, type, name, sourceName }) {
|
|
1313
|
+
if (type.$HasStream) {
|
|
1314
|
+
const mediaTypes = type[meta.voc.Core.AcceptableMediaTypes]?.map(t => t['$EnumMember'] ?? t) ?? [];
|
|
1315
|
+
const contentTypes = mediaTypes.length > 0 ? mediaTypes : ['*/*'];
|
|
1316
|
+
const mediaContent = Object.fromEntries(contentTypes.map(ct => [ct, { schema: { type: 'string', format: 'binary' } }]));
|
|
1317
|
+
const lname = splitName(name);
|
|
1318
|
+
const valuePath = `${prefix}/$value`;
|
|
1319
|
+
const pathItem = prefixParameters.length > 0 ? { parameters: prefixParameters } : {};
|
|
1320
|
+
paths[valuePath] = pathItem;
|
|
1321
|
+
|
|
1322
|
+
pathItem.get = {
|
|
1323
|
+
summary: `Retrieves the media stream of a single ${pluralize.singular(lname)}.`,
|
|
1324
|
+
tags: [normaliseTag(sourceName)],
|
|
1325
|
+
responses: {
|
|
1326
|
+
200: {
|
|
1327
|
+
description: `Retrieved ${pluralize.singular(lname)}`,
|
|
1328
|
+
content: mediaContent
|
|
1329
|
+
},
|
|
1330
|
+
'4XX': { $ref: '#/components/responses/error' }
|
|
1331
|
+
}
|
|
1332
|
+
};
|
|
1333
|
+
pathItem.put = {
|
|
1334
|
+
summary: `Changes the media stream of a single ${pluralize.singular(lname)}.`,
|
|
1335
|
+
tags: [normaliseTag(sourceName)],
|
|
1336
|
+
requestBody: {
|
|
1337
|
+
description: `New media stream for ${pluralize.singular(lname)}`,
|
|
1338
|
+
required: true,
|
|
1339
|
+
content: mediaContent
|
|
1340
|
+
},
|
|
1341
|
+
responses: {
|
|
1342
|
+
204: { description: 'Success' },
|
|
1343
|
+
'4XX': { $ref: '#/components/responses/error' }
|
|
1344
|
+
}
|
|
1345
|
+
};
|
|
1346
|
+
}
|
|
1347
|
+
|
|
1348
|
+
const properties = propertiesOfStructuredType(type);
|
|
1349
|
+
Object.keys(properties).forEach(propName => {
|
|
1350
|
+
const prop = properties[propName];
|
|
1351
|
+
if (prop.$Kind === 'NavigationProperty' || prop.$Type !== 'Edm.Stream') return;
|
|
1352
|
+
const mediaTypeAnnotation = prop[meta.voc.Core.MediaType];
|
|
1353
|
+
const contentTypes = [typeof mediaTypeAnnotation === 'string' ? mediaTypeAnnotation : '*/*'];
|
|
1354
|
+
const mediaContent = Object.fromEntries(contentTypes.map(ct => [ct, { schema: { type: 'string', format: 'binary' } }]));
|
|
1355
|
+
const lname = splitName(name);
|
|
1356
|
+
const propPath = `${prefix}/${propName}`;
|
|
1357
|
+
const pathItem = prefixParameters.length > 0 ? { parameters: prefixParameters } : {};
|
|
1358
|
+
paths[propPath] = pathItem;
|
|
1359
|
+
|
|
1360
|
+
pathItem.get = {
|
|
1361
|
+
summary: `Retrieves ${splitName(propName)} of a single ${pluralize.singular(lname)}.`,
|
|
1362
|
+
tags: [normaliseTag(sourceName)],
|
|
1363
|
+
responses: {
|
|
1364
|
+
200: {
|
|
1365
|
+
description: `Retrieved ${splitName(propName)}`,
|
|
1366
|
+
content: mediaContent
|
|
1367
|
+
},
|
|
1368
|
+
'4XX': { $ref: '#/components/responses/error' }
|
|
1369
|
+
}
|
|
1370
|
+
};
|
|
1371
|
+
pathItem.put = {
|
|
1372
|
+
summary: `Changes ${splitName(propName)} of a single ${pluralize.singular(lname)}.`,
|
|
1373
|
+
tags: [normaliseTag(sourceName)],
|
|
1374
|
+
requestBody: {
|
|
1375
|
+
description: `New value for ${splitName(propName)}`,
|
|
1376
|
+
required: true,
|
|
1377
|
+
content: mediaContent
|
|
1378
|
+
},
|
|
1379
|
+
responses: {
|
|
1380
|
+
204: { description: 'Success' },
|
|
1381
|
+
'4XX': { $ref: '#/components/responses/error' }
|
|
1382
|
+
}
|
|
1383
|
+
};
|
|
1384
|
+
});
|
|
1385
|
+
}
|
|
1386
|
+
|
|
1387
|
+
/**
|
|
1388
|
+
* Add paths and Path Item Objects for navigation segments
|
|
1389
|
+
* @param {object} options
|
|
1390
|
+
* @param {object} options.paths The Paths Object to augment
|
|
1391
|
+
* @param {string} options.prefix Prefix for path
|
|
1392
|
+
* @param {Array} options.prefixParameters Parameter Objects for prefix
|
|
1393
|
+
* @param {object} options.type Entity type object of navigation segment
|
|
1394
|
+
* @param {object} options.root Root element
|
|
1395
|
+
* @param {string} options.sourceName Name of path source
|
|
1396
|
+
* @param {number} options.level Number of navigation segments so far
|
|
1397
|
+
* @param {string} options.navigationPrefix Path for finding navigation restrictions
|
|
1398
|
+
*/
|
|
1399
|
+
function pathItemsWithNavigation({ paths, prefix, prefixParameters, type, root, sourceName, level, navigationPrefix }) {
|
|
1400
|
+
const navigationRestrictions = root[meta.voc.Capabilities.NavigationRestrictions] ?? {};
|
|
1401
|
+
const rootNavigable = level == 0 && enumMember(navigationRestrictions.Navigability) != 'None'
|
|
1402
|
+
|| level == 1 && enumMember(navigationRestrictions.Navigability) != 'Single'
|
|
1403
|
+
|| level > 1;
|
|
1404
|
+
|
|
1405
|
+
if (type && level < maxLevels) {
|
|
1406
|
+
const properties = navigationPathMap(type);
|
|
1407
|
+
Object.keys(properties).forEach(name => {
|
|
1408
|
+
const parentRestrictions = navigationPropertyRestrictions(root, navigationPrefix);
|
|
1409
|
+
if (enumMember(parentRestrictions.Navigability) == 'Single') return;
|
|
1410
|
+
|
|
1411
|
+
const navigationPath = navigationPrefix + (navigationPrefix.length > 0 ? '/' : '') + name;
|
|
1412
|
+
const restrictions = navigationPropertyRestrictions(root, navigationPath);
|
|
1413
|
+
if (['Recursive', 'Single'].includes(enumMember(restrictions.Navigability))
|
|
1414
|
+
|| restrictions.Navigability == null && rootNavigable) {
|
|
1415
|
+
const targetSetName = root.$NavigationPropertyBinding && root.$NavigationPropertyBinding[navigationPath];
|
|
1416
|
+
const target = entityContainer[targetSetName];
|
|
1417
|
+
const targetType = target && meta.modelElement(target.$Type);
|
|
1418
|
+
const targetName = (targetType && targetType[meta.voc.Common.Label]) || targetSetName;
|
|
1419
|
+
pathItems({
|
|
1420
|
+
paths,
|
|
1421
|
+
prefix: `${prefix}/${name}`,
|
|
1422
|
+
prefixParameters,
|
|
1423
|
+
element: properties[name],
|
|
1424
|
+
root,
|
|
1425
|
+
sourceName,
|
|
1426
|
+
targetName,
|
|
1427
|
+
target,
|
|
1428
|
+
level: level + 1,
|
|
1429
|
+
navigationPath
|
|
1430
|
+
});
|
|
1431
|
+
}
|
|
1432
|
+
});
|
|
1433
|
+
}
|
|
1434
|
+
}
|
|
1435
|
+
|
|
1436
|
+
/**
|
|
1437
|
+
* Collect navigation paths of a navigation segment and its potentially structured components
|
|
1438
|
+
* @param {object} type Structured type
|
|
1439
|
+
* @param {object} map Map of navigation property paths and their types
|
|
1440
|
+
* @param {string} prefix Navigation prefix
|
|
1441
|
+
* @param {number} level Number of navigation segments so far
|
|
1442
|
+
* @return {object} Map of navigation property paths and their types
|
|
1443
|
+
*/
|
|
1444
|
+
function navigationPathMap(type, map = {}, prefix = '', level = 0) {
|
|
1445
|
+
const properties = propertiesOfStructuredType(type);
|
|
1446
|
+
Object.keys(properties).forEach(key => {
|
|
1447
|
+
if (properties[key].$Kind == 'NavigationProperty') {
|
|
1448
|
+
map[prefix + key] = properties[key];
|
|
1449
|
+
} else if (properties[key].$Type && !properties[key].$Collection && level < maxLevels) {
|
|
1450
|
+
navigationPathMap(meta.modelElement(properties[key].$Type), map, `${prefix + key}/`, level + 1);
|
|
1451
|
+
}
|
|
1452
|
+
})
|
|
1453
|
+
return map;
|
|
1454
|
+
}
|
|
1455
|
+
|
|
1456
|
+
/**
|
|
1457
|
+
* Construct map of key names for an entity type
|
|
1458
|
+
* @param {object} type Entity type object
|
|
1459
|
+
* @return {object} Map of key names
|
|
1460
|
+
*/
|
|
1461
|
+
function keyMap(type) {
|
|
1462
|
+
const map = {};
|
|
1463
|
+
if (type.$Kind == 'EntityType') {
|
|
1464
|
+
const keys = getKey(type) || [];
|
|
1465
|
+
keys.forEach(key => {
|
|
1466
|
+
if (typeof key == 'string')
|
|
1467
|
+
map[key] = true;
|
|
1468
|
+
});
|
|
1469
|
+
}
|
|
1470
|
+
return map;
|
|
1471
|
+
}
|
|
1472
|
+
|
|
1473
|
+
/**
|
|
1474
|
+
* Key for path item
|
|
1475
|
+
* @param {object} entityType Entity Type object
|
|
1476
|
+
* @return {array} Key of entity type or null
|
|
1477
|
+
*/
|
|
1478
|
+
function getKey(entityType) {
|
|
1479
|
+
let type = entityType;
|
|
1480
|
+
let keys = null;
|
|
1481
|
+
while (type) {
|
|
1482
|
+
keys = type.$Key;
|
|
1483
|
+
if (keys || !type.$BaseType) break;
|
|
1484
|
+
type = meta.modelElement(type.$BaseType);
|
|
1485
|
+
}
|
|
1486
|
+
return keys;
|
|
1487
|
+
}
|
|
1488
|
+
|
|
1489
|
+
/**
|
|
1490
|
+
* Get description with fallback
|
|
1491
|
+
* @param {object} element Model element
|
|
1492
|
+
* @param {string} [fallback] Optional fallback text
|
|
1493
|
+
* @return {string} Description text
|
|
1494
|
+
*/
|
|
1495
|
+
function getDescriptionWithFallback(element, fallback) {
|
|
1496
|
+
return element[meta.voc.Core.LongDescription]
|
|
1497
|
+
|| element[meta.voc.Core.Description]
|
|
1498
|
+
|| fallback;
|
|
1499
|
+
}
|
|
1500
|
+
|
|
1501
|
+
/**
|
|
1502
|
+
* Key for path item
|
|
1503
|
+
* @param {object} entityType Entity Type object
|
|
1504
|
+
* @param {number} level Number of navigation segments so far
|
|
1505
|
+
* @return {object} key: Key segment, parameters: key parameters
|
|
1506
|
+
*/
|
|
1507
|
+
function entityKey(entityType, level) {
|
|
1508
|
+
let segment = '';
|
|
1509
|
+
const params = [];
|
|
1510
|
+
const keys = getKey(entityType) || [];
|
|
1511
|
+
const properties = propertiesOfStructuredType(entityType);
|
|
1512
|
+
|
|
1513
|
+
keys.forEach((key, index) => {
|
|
1514
|
+
const suffix = level > 0 ? `_${level}` : '';
|
|
1515
|
+
if (keyAsSegment)
|
|
1516
|
+
segment += '/';
|
|
1517
|
+
else {
|
|
1518
|
+
if (index > 0) segment += ',';
|
|
1519
|
+
if (keys.length != 1) segment += `${key}=`;
|
|
1520
|
+
}
|
|
1521
|
+
let parameter;
|
|
1522
|
+
let property = {};
|
|
1523
|
+
if (typeof key == 'string') {
|
|
1524
|
+
parameter = key;
|
|
1525
|
+
property = properties[key];
|
|
1526
|
+
} else {
|
|
1527
|
+
parameter = Object.keys(key)[0];
|
|
1528
|
+
const segments = key[parameter].split('/');
|
|
1529
|
+
property = properties[segments[0]];
|
|
1530
|
+
for (let i = 1; i < segments.length; i++) {
|
|
1531
|
+
const complexType = meta.modelElement(property.$Type);
|
|
1532
|
+
const properties = propertiesOfStructuredType(complexType);
|
|
1533
|
+
property = properties[segments[i]];
|
|
1534
|
+
}
|
|
1535
|
+
}
|
|
1536
|
+
const propertyType = property.$Type;
|
|
1537
|
+
segment += `${pathValuePrefix(propertyType)}{${parameter}${suffix}}${pathValueSuffix(propertyType)}`;
|
|
1538
|
+
const param = {
|
|
1539
|
+
description: getDescriptionWithFallback(property, `key: ${parameter}`),
|
|
1540
|
+
in: 'path',
|
|
1541
|
+
name: parameter + suffix,
|
|
1542
|
+
required: true,
|
|
1543
|
+
schema: getSchema(property, '', true)
|
|
1544
|
+
};
|
|
1545
|
+
params.push(param);
|
|
1546
|
+
})
|
|
1547
|
+
return { segment: (keyAsSegment ? '' : '(') + segment + (keyAsSegment ? '' : ')'), parameters: params };
|
|
1548
|
+
}
|
|
1549
|
+
|
|
1550
|
+
/**
|
|
1551
|
+
* Prefix for key value in key segment
|
|
1552
|
+
* @param {string} typename Qualified name of key property type
|
|
1553
|
+
* @return {string} value prefix
|
|
1554
|
+
*/
|
|
1555
|
+
function pathValuePrefix(typename) {
|
|
1556
|
+
//TODO: handle other Edm types, enumeration types, and type definitions
|
|
1557
|
+
if (['Edm.Int64', 'Edm.Int32', 'Edm.Int16', 'Edm.SByte', 'Edm.Byte',
|
|
1558
|
+
'Edm.Double', 'Edm.Single', 'Edm.Date', 'Edm.DateTimeOffset', 'Edm.Guid'].includes(typename)) return '';
|
|
1559
|
+
if (keyAsSegment) return '';
|
|
1560
|
+
return `'`;
|
|
1561
|
+
}
|
|
1562
|
+
|
|
1563
|
+
/**
|
|
1564
|
+
* Suffix for key value in key segment
|
|
1565
|
+
* @param {string} typename Qualified name of key property type
|
|
1566
|
+
* @return {string} value prefix
|
|
1567
|
+
*/
|
|
1568
|
+
function pathValueSuffix(typename) {
|
|
1569
|
+
//TODO: handle other Edm types, enumeration types, and type definitions
|
|
1570
|
+
if (['Edm.Int64', 'Edm.Int32', 'Edm.Int16', 'Edm.SByte', 'Edm.Byte',
|
|
1571
|
+
'Edm.Double', 'Edm.Single', 'Edm.Date', 'Edm.DateTimeOffset', 'Edm.Guid'].includes(typename)) return '';
|
|
1572
|
+
if (keyAsSegment) return '';
|
|
1573
|
+
return `'`;
|
|
1574
|
+
}
|
|
1575
|
+
|
|
1576
|
+
/**
|
|
1577
|
+
* Add path and Path Item Object for actions and functions bound to the element
|
|
1578
|
+
* @param {object} options
|
|
1579
|
+
* @param {Paths} options.paths Paths Object to augment
|
|
1580
|
+
* @param {string} options.prefix Prefix for path
|
|
1581
|
+
* @param {Array} options.prefixParameters Parameter Objects for prefix
|
|
1582
|
+
* @param {object} options.element Model element the operations are bound to
|
|
1583
|
+
* @param {string} options.sourceName Name of path source
|
|
1584
|
+
* @param {boolean} [options.byKey=false] Read by key
|
|
1585
|
+
*/
|
|
1586
|
+
function pathItemsForBoundOperations({ paths, prefix, prefixParameters, element, sourceName, byKey = false }) {
|
|
1587
|
+
if (element.$Kind === "NavigationProperty" && !element.$ContainsTarget) {
|
|
1588
|
+
return;
|
|
1589
|
+
}
|
|
1590
|
+
const overloads = meta.boundOverloads[element.$Type + (!byKey && element.$Collection ? '-c' : '')] || [];
|
|
1591
|
+
overloads.forEach(item => {
|
|
1592
|
+
const pathName = shortActionPaths && item.name.includes('.') ? nameParts(item.name).name : item.name;
|
|
1593
|
+
if (item.overload.$Kind == 'Action')
|
|
1594
|
+
pathItemAction({
|
|
1595
|
+
paths,
|
|
1596
|
+
prefix: `${prefix}/${pathName}`,
|
|
1597
|
+
prefixParameters,
|
|
1598
|
+
actionName: item.name,
|
|
1599
|
+
overload: item.overload,
|
|
1600
|
+
sourceName
|
|
1601
|
+
});
|
|
1602
|
+
else
|
|
1603
|
+
pathItemFunction({
|
|
1604
|
+
paths,
|
|
1605
|
+
prefix: `${prefix}/${pathName}`,
|
|
1606
|
+
prefixParameters,
|
|
1607
|
+
functionName: item.name,
|
|
1608
|
+
overload: item.overload,
|
|
1609
|
+
sourceName
|
|
1610
|
+
});
|
|
1611
|
+
});
|
|
1612
|
+
}
|
|
1613
|
+
|
|
1614
|
+
/**
|
|
1615
|
+
* Add path and Path Item Object for an action import
|
|
1616
|
+
* @param {Paths} paths Paths Object to augment
|
|
1617
|
+
* @param {string} name Name of action import
|
|
1618
|
+
* @param {object} child Action import object
|
|
1619
|
+
*/
|
|
1620
|
+
function pathItemActionImport(paths, name, child) {
|
|
1621
|
+
const overload = meta.modelElement(child.$Action).find(pOverload => !pOverload.$IsBound);
|
|
1622
|
+
pathItemAction({
|
|
1623
|
+
paths,
|
|
1624
|
+
prefix: `/${name}`,
|
|
1625
|
+
prefixParameters: [],
|
|
1626
|
+
actionName: child.$Action,
|
|
1627
|
+
overload,
|
|
1628
|
+
sourceName: child.$EntitySet,
|
|
1629
|
+
actionImport: child
|
|
1630
|
+
});
|
|
1631
|
+
}
|
|
1632
|
+
|
|
1633
|
+
/**
|
|
1634
|
+
* Add path and Path Item Object for action overload
|
|
1635
|
+
* @param {object} options
|
|
1636
|
+
* @param {Paths} options.paths Paths Object to augment
|
|
1637
|
+
* @param {string} options.prefix Prefix for path
|
|
1638
|
+
* @param {Array} options.prefixParameters Parameter Objects for prefix
|
|
1639
|
+
* @param {string} options.actionName Qualified name of function
|
|
1640
|
+
* @param {object} options.overload Function overload
|
|
1641
|
+
* @param {string} options.sourceName Name of path source
|
|
1642
|
+
* @param {object} [options.actionImport={}] Action import
|
|
1643
|
+
*/
|
|
1644
|
+
function pathItemAction({ paths, prefix, prefixParameters, actionName, overload, sourceName, actionImport = {} }) {
|
|
1645
|
+
const name = actionName.indexOf('.') === -1 ? actionName : nameParts(actionName).name;
|
|
1646
|
+
const pathItem = {
|
|
1647
|
+
post: {
|
|
1648
|
+
summary: actionImport[meta.voc.Core.Description] || overload[meta.voc.Core.Description] || `Invokes action ${name}`,
|
|
1649
|
+
tags: [normaliseTag(overload[meta.voc.Common.Label] || sourceName || 'Service Operations')],
|
|
1650
|
+
responses: overload.$ReturnType ? response({
|
|
1651
|
+
code: 200,
|
|
1652
|
+
description: "Success",
|
|
1653
|
+
type: overload.$ReturnType,
|
|
1654
|
+
errors: overload[meta.voc.Capabilities.OperationRestrictions]?.ErrorResponses
|
|
1655
|
+
}) : response({
|
|
1656
|
+
code: 204,
|
|
1657
|
+
description: "Success",
|
|
1658
|
+
type: undefined,
|
|
1659
|
+
errors: overload[meta.voc.Capabilities.OperationRestrictions]?.ErrorResponses
|
|
1660
|
+
}),
|
|
1661
|
+
}
|
|
1662
|
+
};
|
|
1663
|
+
const actionExtension = getExtensions(overload, 'operation');
|
|
1664
|
+
if (Object.keys(actionExtension).length > 0) {
|
|
1665
|
+
Object.assign(pathItem.post, actionExtension);
|
|
1666
|
+
}
|
|
1667
|
+
const description = actionImport[meta.voc.Core.LongDescription] || overload[meta.voc.Core.LongDescription];
|
|
1668
|
+
if (description) pathItem.post.description = description;
|
|
1669
|
+
if (prefixParameters.length > 0) pathItem.post.parameters = [...prefixParameters];
|
|
1670
|
+
let parameters = overload.$Parameter || [];
|
|
1671
|
+
if (overload.$IsBound) parameters = parameters.slice(1);
|
|
1672
|
+
if (parameters.length > 0) {
|
|
1673
|
+
const requestProperties = {};
|
|
1674
|
+
parameters.forEach(p => { requestProperties[p.$Name] = getSchema(p) });
|
|
1675
|
+
pathItem.post.requestBody = {
|
|
1676
|
+
description: 'Action parameters',
|
|
1677
|
+
content: {
|
|
1678
|
+
'application/json': {
|
|
1679
|
+
schema: {
|
|
1680
|
+
type: 'object',
|
|
1681
|
+
properties: requestProperties
|
|
1682
|
+
}
|
|
1683
|
+
}
|
|
1684
|
+
}
|
|
1685
|
+
}
|
|
1686
|
+
} else {
|
|
1687
|
+
// Actions without parameters still need Content-Type: application/json
|
|
1688
|
+
pathItem.post.requestBody = {
|
|
1689
|
+
required: false,
|
|
1690
|
+
content: {
|
|
1691
|
+
'application/json': {
|
|
1692
|
+
schema: {
|
|
1693
|
+
type: 'object'
|
|
1694
|
+
}
|
|
1695
|
+
}
|
|
1696
|
+
}
|
|
1697
|
+
}
|
|
1698
|
+
}
|
|
1699
|
+
customParameters(pathItem.post, overload[meta.voc.Capabilities.OperationRestrictions] || {});
|
|
1700
|
+
paths[prefix] = pathItem;
|
|
1701
|
+
}
|
|
1702
|
+
|
|
1703
|
+
/**
|
|
1704
|
+
* Add path and Path Item Object for an action import
|
|
1705
|
+
* @param {Paths} paths Paths Object to augment
|
|
1706
|
+
* @param {string} name Name of function import
|
|
1707
|
+
* @param {object} child Function import object
|
|
1708
|
+
*/
|
|
1709
|
+
function pathItemFunctionImport(paths, name, child) {
|
|
1710
|
+
const overloads = meta.modelElement(child.$Function);
|
|
1711
|
+
console.assert(overloads, `Unknown function "${child.$Function}" in function import "${name}"`);
|
|
1712
|
+
overloads && overloads.filter(overload => !overload.$IsBound).forEach(overload => pathItemFunction({
|
|
1713
|
+
paths,
|
|
1714
|
+
prefix: `/${name}`,
|
|
1715
|
+
prefixParameters: [],
|
|
1716
|
+
functionName: child.$Function,
|
|
1717
|
+
overload,
|
|
1718
|
+
sourceName: child.$EntitySet,
|
|
1719
|
+
functionImport: child
|
|
1720
|
+
}));
|
|
1721
|
+
}
|
|
1722
|
+
|
|
1723
|
+
/**
|
|
1724
|
+
* Add path and Path Item Object for function overload
|
|
1725
|
+
* @param {object} options
|
|
1726
|
+
* @param {Paths} options.paths Paths Object to augment
|
|
1727
|
+
* @param {string} options.prefix Prefix for path
|
|
1728
|
+
* @param {Array} options.prefixParameters Parameter Objects for prefix
|
|
1729
|
+
* @param {string} options.functionName Qualified name of function
|
|
1730
|
+
* @param {object} options.overload Function overload
|
|
1731
|
+
* @param {string} options.sourceName Name of path source
|
|
1732
|
+
* @param {object} [options.functionImport={}] Function Import
|
|
1733
|
+
*/
|
|
1734
|
+
function pathItemFunction({ paths, prefix, prefixParameters, functionName, overload, sourceName, functionImport = {} }) {
|
|
1735
|
+
const name = functionName.indexOf('.') === -1 ? functionName : nameParts(functionName).name;
|
|
1736
|
+
let parameters = overload.$Parameter || [];
|
|
1737
|
+
if (overload.$IsBound) parameters = parameters.slice(1);
|
|
1738
|
+
const pathSegments = [];
|
|
1739
|
+
const params = [];
|
|
1740
|
+
|
|
1741
|
+
const implicitAliases = csdl.$Version > '4.0' || parameters.some(p => p[meta.voc.Core.OptionalParameter]);
|
|
1742
|
+
|
|
1743
|
+
parameters.forEach(p => {
|
|
1744
|
+
const description = getDescriptionWithFallback(p);
|
|
1745
|
+
/** @type {Parameter} */
|
|
1746
|
+
const param = {
|
|
1747
|
+
...(description && { description }),
|
|
1748
|
+
required: implicitAliases ? !p[meta.voc.Core.OptionalParameter] : true
|
|
1749
|
+
};
|
|
1750
|
+
const type = meta.modelElement(p.$Type || 'Edm.String');
|
|
1751
|
+
// TODO: check whether parameter or type definition of Edm.Stream is annotated with JSON.Schema
|
|
1752
|
+
if (p.$Collection || p.$Type == 'Edm.Stream'
|
|
1753
|
+
|| type && ['ComplexType', 'EntityType'].includes(type.$Kind)
|
|
1754
|
+
|| type && type.$UnderlyingType == 'Edm.Stream') {
|
|
1755
|
+
param.in = 'query';
|
|
1756
|
+
if (
|
|
1757
|
+
implicitAliases &&
|
|
1758
|
+
csdl.$Version !== '2.0' &&
|
|
1759
|
+
SYSTEM_QUERY_OPTIONS.includes(p.$Name.toLowerCase())
|
|
1760
|
+
) {
|
|
1761
|
+
param.name = `@${p.$Name}`;
|
|
1762
|
+
} else if (implicitAliases) {
|
|
1763
|
+
param.name = p.$Name;
|
|
1764
|
+
} else {
|
|
1765
|
+
pathSegments.push(`${p.$Name}=@${p.$Name}`);
|
|
1766
|
+
param.name = `@${p.$Name}`;
|
|
1767
|
+
}
|
|
1768
|
+
param.schema = { type: 'string' };
|
|
1769
|
+
if (param.description) param.description += ' \n'; else param.description = '';
|
|
1770
|
+
param.description += `This is ${
|
|
1771
|
+
p.$Collection ? 'a ' : ''
|
|
1772
|
+
}URL-encoded JSON ${
|
|
1773
|
+
p.$Collection ? 'array with items ' : ''
|
|
1774
|
+
}of type ${
|
|
1775
|
+
meta.namespaceQualifiedName(p.$Type ?? 'Edm.String')
|
|
1776
|
+
}, see [Complex and Collection Literals](https://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part2-url-conventions.html#sec_ComplexandCollectionLiterals)`;
|
|
1777
|
+
param.example = p.$Collection ? '[]' : '{}';
|
|
1778
|
+
} else {
|
|
1779
|
+
if (implicitAliases) {
|
|
1780
|
+
param.in = 'query';
|
|
1781
|
+
} else {
|
|
1782
|
+
pathSegments.push(`${p.$Name}={${p.$Name}}`);
|
|
1783
|
+
param.in = 'path';
|
|
1784
|
+
}
|
|
1785
|
+
if (
|
|
1786
|
+
implicitAliases &&
|
|
1787
|
+
csdl.$Version !== '2.0' &&
|
|
1788
|
+
SYSTEM_QUERY_OPTIONS.includes(p.$Name.toLowerCase())
|
|
1789
|
+
)
|
|
1790
|
+
param.name = `@${p.$Name}`;
|
|
1791
|
+
else
|
|
1792
|
+
param.name = p.$Name;
|
|
1793
|
+
if (!p.$Type || p.$Type === "Edm.String" || (type && (!type.$Type || type.$Type === "Edm.String"))) {
|
|
1794
|
+
if (param.description) param.description += ' \n';
|
|
1795
|
+
else param.description = '';
|
|
1796
|
+
param.description += "String value needs to be enclosed in single quotes";
|
|
1797
|
+
}
|
|
1798
|
+
param.schema = getSchema(p, '', true, true);
|
|
1799
|
+
}
|
|
1800
|
+
params.push(param);
|
|
1801
|
+
});
|
|
1802
|
+
|
|
1803
|
+
const pathParameters = implicitAliases ? '' : `(${pathSegments.join(',')})`;
|
|
1804
|
+
const pathItem = {
|
|
1805
|
+
get: {
|
|
1806
|
+
summary: functionImport[meta.voc.Core.Description] || overload[meta.voc.Core.Description] || `Invokes function ${name}`,
|
|
1807
|
+
tags: [normaliseTag(overload[meta.voc.Common.Label] || sourceName || 'Service Operations')],
|
|
1808
|
+
parameters: prefixParameters.concat(params),
|
|
1809
|
+
responses: response({
|
|
1810
|
+
code: 200,
|
|
1811
|
+
description: "Success",
|
|
1812
|
+
type: overload.$ReturnType,
|
|
1813
|
+
errors: overload[meta.voc.Capabilities.OperationRestrictions]?.ErrorResponses
|
|
1814
|
+
}),
|
|
1815
|
+
}
|
|
1816
|
+
};
|
|
1817
|
+
const functionExtension = getExtensions(overload, 'operation');
|
|
1818
|
+
if (Object.keys(functionExtension).length > 0) {
|
|
1819
|
+
Object.assign(pathItem.get, functionExtension);
|
|
1820
|
+
}
|
|
1821
|
+
const iDescription = functionImport[meta.voc.Core.LongDescription] || overload[meta.voc.Core.LongDescription];
|
|
1822
|
+
if (iDescription) pathItem.get.description = iDescription;
|
|
1823
|
+
customParameters(pathItem.get, overload[meta.voc.Capabilities.OperationRestrictions] || {});
|
|
1824
|
+
paths[prefix + pathParameters] = pathItem;
|
|
1825
|
+
}
|
|
1826
|
+
|
|
1827
|
+
/**
|
|
1828
|
+
* Add path and Path Item Object for batch requests
|
|
1829
|
+
* @param {Paths} paths Paths Object to augment
|
|
1830
|
+
* @param {object} container Entity container
|
|
1831
|
+
*/
|
|
1832
|
+
function pathItemBatch(paths, container) {
|
|
1833
|
+
const batchSupport = container[meta.voc.Capabilities.BatchSupport] || {};
|
|
1834
|
+
const supported = container[meta.voc.Capabilities.BatchSupported] !== false && batchSupport.Supported !== false;
|
|
1835
|
+
if (supported) {
|
|
1836
|
+
const firstEntitySet = Object.keys(container).filter(child => isIdentifier(child) && container[child].$Collection)[0];
|
|
1837
|
+
paths['/$batch'] = {
|
|
1838
|
+
post: {
|
|
1839
|
+
summary: batchSupport[meta.voc.Core.Description] ?? 'Sends a group of requests',
|
|
1840
|
+
description: `${batchSupport[meta.voc.Core.LongDescription] ?? 'Group multiple requests into a single request payload, see '
|
|
1841
|
+
+ '[Batch Requests](http://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-protocol.html#sec_BatchRequests).'
|
|
1842
|
+
}\n\n*Please note that "Try it out" is not supported for this request.*`,
|
|
1843
|
+
tags: [normaliseTag('Batch Requests')],
|
|
1844
|
+
requestBody: {
|
|
1845
|
+
required: true,
|
|
1846
|
+
description: 'Batch request',
|
|
1847
|
+
content: {
|
|
1848
|
+
'multipart/mixed;boundary=request-separator': {
|
|
1849
|
+
schema: {
|
|
1850
|
+
type: 'string'
|
|
1851
|
+
},
|
|
1852
|
+
example: `--request-separator\n`
|
|
1853
|
+
+ `Content-Type: application/http\n`
|
|
1854
|
+
+ `Content-Transfer-Encoding: binary\n\n`
|
|
1855
|
+
+ `GET ${firstEntitySet} HTTP/1.1\n`
|
|
1856
|
+
+ `Accept: application/json\n\n`
|
|
1857
|
+
+ `\n--request-separator--`
|
|
1858
|
+
}
|
|
1859
|
+
}
|
|
1860
|
+
},
|
|
1861
|
+
responses: {
|
|
1862
|
+
'4XX': {
|
|
1863
|
+
$ref: '#/components/responses/error'
|
|
1864
|
+
}
|
|
1865
|
+
}
|
|
1866
|
+
}
|
|
1867
|
+
};
|
|
1868
|
+
// @ts-expect-error - set above
|
|
1869
|
+
paths['/$batch'].post.responses[csdl.$Version < '4.0' ? 202 : 200] = {
|
|
1870
|
+
description: 'Batch response',
|
|
1871
|
+
content: {
|
|
1872
|
+
'multipart/mixed': {
|
|
1873
|
+
schema: {
|
|
1874
|
+
type: 'string'
|
|
1875
|
+
},
|
|
1876
|
+
example: '--response-separator\n'
|
|
1877
|
+
+ 'Content-Type: application/http\n\n'
|
|
1878
|
+
+ 'HTTP/1.1 200 OK\n'
|
|
1879
|
+
+ 'Content-Type: application/json\n\n'
|
|
1880
|
+
+ '{...}'
|
|
1881
|
+
+ '\n--response-separator--'
|
|
1882
|
+
}
|
|
1883
|
+
}
|
|
1884
|
+
};
|
|
1885
|
+
}
|
|
1886
|
+
}
|
|
1887
|
+
|
|
1888
|
+
/**
|
|
1889
|
+
* Construct Responses Object
|
|
1890
|
+
* @param {object} options
|
|
1891
|
+
* @param {string | number} options.code HTTP response code
|
|
1892
|
+
* @param {string} options.description Description
|
|
1893
|
+
* @param {object} options.type Response type object
|
|
1894
|
+
* @param {array} options.errors Array of operation-specific status codes with descriptions
|
|
1895
|
+
* @param {boolean} [options.isCount=true]
|
|
1896
|
+
* @returns {Record<string, Response>}
|
|
1897
|
+
*/
|
|
1898
|
+
function response({ code, description, type, errors, isCount = true }) {
|
|
1899
|
+
/** @type {Record<string, Response>} */
|
|
1900
|
+
const r = {
|
|
1901
|
+
[code]: {
|
|
1902
|
+
description
|
|
1903
|
+
}
|
|
1904
|
+
};
|
|
1905
|
+
const CountPropertyObj = { [csdl.$Version > '4.0' ? '@count' : '@odata.count']: ref('count') };
|
|
1906
|
+
if (code != 204) {
|
|
1907
|
+
const s = getSchema(type);
|
|
1908
|
+
r[code].content = {
|
|
1909
|
+
'application/json': {}
|
|
1910
|
+
};
|
|
1911
|
+
|
|
1912
|
+
if (type.$Collection) {
|
|
1913
|
+
// @ts-ignore - not undefined, we set it above
|
|
1914
|
+
r[code].content['application/json'].schema = {
|
|
1915
|
+
type: 'object',
|
|
1916
|
+
title: `Collection of ${nameParts(type.$Type ? type.$Type : 'Edm.String').name}`,
|
|
1917
|
+
properties: {
|
|
1918
|
+
...(isCount && CountPropertyObj),
|
|
1919
|
+
value: s
|
|
1920
|
+
}
|
|
1921
|
+
};
|
|
1922
|
+
}
|
|
1923
|
+
|
|
1924
|
+
else if (
|
|
1925
|
+
type.$Type === undefined ||
|
|
1926
|
+
(type.$Type.startsWith("Edm.") &&
|
|
1927
|
+
!["Edm.Stream", "Edm.EntityType", "Edm.ComplexType"].includes(
|
|
1928
|
+
type.$Type,
|
|
1929
|
+
))
|
|
1930
|
+
) {
|
|
1931
|
+
// @ts-expect-error - set above
|
|
1932
|
+
r[code].content['application/json'].schema = { type: "object", properties: { value: s } };
|
|
1933
|
+
}
|
|
1934
|
+
|
|
1935
|
+
else {
|
|
1936
|
+
// @ts-expect-error - set above
|
|
1937
|
+
r[code].content['application/json'].schema = s;
|
|
1938
|
+
}
|
|
1939
|
+
}
|
|
1940
|
+
if (errors) {
|
|
1941
|
+
for (const e of errors) {
|
|
1942
|
+
r[e.StatusCode] = {
|
|
1943
|
+
description: e.Description,
|
|
1944
|
+
content: {
|
|
1945
|
+
"application/json": {
|
|
1946
|
+
schema: { $ref: "#/components/schemas/error" },
|
|
1947
|
+
},
|
|
1948
|
+
},
|
|
1949
|
+
};
|
|
1950
|
+
}
|
|
1951
|
+
} else {
|
|
1952
|
+
r["4XX"] = {
|
|
1953
|
+
$ref: "#/components/responses/error",
|
|
1954
|
+
};
|
|
1955
|
+
}
|
|
1956
|
+
return r;
|
|
1957
|
+
}
|
|
1958
|
+
|
|
1959
|
+
/**
|
|
1960
|
+
* Construct the Components Object from the types of the CSDL document
|
|
1961
|
+
* @param {CSDL} csdl CSDL document
|
|
1962
|
+
* @param {object} entityContainer Entity Container object
|
|
1963
|
+
* @return {object} Components Object
|
|
1964
|
+
*/
|
|
1965
|
+
function getComponents(csdl, entityContainer) {
|
|
1966
|
+
const c = {
|
|
1967
|
+
schemas: getSchemas(csdl)
|
|
1968
|
+
};
|
|
1969
|
+
|
|
1970
|
+
if (csdl.$EntityContainer) {
|
|
1971
|
+
c.parameters = getParameters();
|
|
1972
|
+
c.responses = {
|
|
1973
|
+
error: {
|
|
1974
|
+
description: 'Error',
|
|
1975
|
+
content: {
|
|
1976
|
+
'application/json': {
|
|
1977
|
+
schema: ref('error')
|
|
1978
|
+
}
|
|
1979
|
+
}
|
|
1980
|
+
}
|
|
1981
|
+
};
|
|
1982
|
+
}
|
|
1983
|
+
|
|
1984
|
+
getSecuritySchemes(c, entityContainer)
|
|
1985
|
+
|
|
1986
|
+
return c;
|
|
1987
|
+
}
|
|
1988
|
+
|
|
1989
|
+
/**
|
|
1990
|
+
* Construct Schema Objects from the types of the CSDL document
|
|
1991
|
+
* @param {CSDL} csdl CSDL document
|
|
1992
|
+
* @return {object} Map of Schema Objects
|
|
1993
|
+
*/
|
|
1994
|
+
function getSchemas(csdl) {
|
|
1995
|
+
const unordered = {};
|
|
1996
|
+
|
|
1997
|
+
for (const r of requiredSchemas.list) {
|
|
1998
|
+
const type = meta.modelElement(`${r.namespace}.${r.name}`);
|
|
1999
|
+
if (!type) continue;
|
|
2000
|
+
switch (type.$Kind) {
|
|
2001
|
+
case "ComplexType":
|
|
2002
|
+
case "EntityType":
|
|
2003
|
+
schemasForStructuredType({ schemas: unordered, qualifier: r.namespace, name: r.name, type, suffix: r.suffix });
|
|
2004
|
+
break;
|
|
2005
|
+
case "EnumType":
|
|
2006
|
+
schemaForEnumerationType(unordered, r.namespace, r.name, type);
|
|
2007
|
+
break;
|
|
2008
|
+
case "TypeDefinition":
|
|
2009
|
+
schemaForTypeDefinition(unordered, r.namespace, r.name, type);
|
|
2010
|
+
break;
|
|
2011
|
+
}
|
|
2012
|
+
}
|
|
2013
|
+
|
|
2014
|
+
// Add @OpenAPI.Extensions at entity level to schema object
|
|
2015
|
+
Object.keys(csdl).filter(name => isIdentifier(name)).forEach(namespace => {
|
|
2016
|
+
const schema = csdl[namespace] ?? {};
|
|
2017
|
+
Object.keys(schema).filter(name => isIdentifier(name)).forEach(name => {
|
|
2018
|
+
const type = schema[name];
|
|
2019
|
+
if (type.$Kind === 'EntityType' || type.$Kind === 'ComplexType') {
|
|
2020
|
+
const schemaName = `${namespace}.${name}${SUFFIX.read}`;
|
|
2021
|
+
const extensions = getExtensions(type, 'schema');
|
|
2022
|
+
if (Object.keys(extensions).length > 0) {
|
|
2023
|
+
unordered[schemaName] = unordered[schemaName] || {};
|
|
2024
|
+
Object.assign(unordered[schemaName], extensions);
|
|
2025
|
+
}
|
|
2026
|
+
}
|
|
2027
|
+
});
|
|
2028
|
+
});
|
|
2029
|
+
|
|
2030
|
+
const ordered = {};
|
|
2031
|
+
for (const name of Object.keys(unordered).sort()) {
|
|
2032
|
+
ordered[name] = unordered[name];
|
|
2033
|
+
}
|
|
2034
|
+
|
|
2035
|
+
inlineTypes(ordered);
|
|
2036
|
+
|
|
2037
|
+
if (csdl.$EntityContainer) {
|
|
2038
|
+
ordered.count = count();
|
|
2039
|
+
ordered.error = error();
|
|
2040
|
+
}
|
|
2041
|
+
|
|
2042
|
+
return ordered;
|
|
2043
|
+
}
|
|
2044
|
+
|
|
2045
|
+
/**
|
|
2046
|
+
* Construct Schema Objects from the types of the CSDL document
|
|
2047
|
+
* @param {object} schemas Map of Schema Objects to augment
|
|
2048
|
+
*/
|
|
2049
|
+
function inlineTypes(schemas) {
|
|
2050
|
+
if (typesToInline.geoPoint) {
|
|
2051
|
+
schemas.geoPoint = {
|
|
2052
|
+
type: 'object',
|
|
2053
|
+
properties: {
|
|
2054
|
+
coordinates: ref('geoPosition'),
|
|
2055
|
+
type: {
|
|
2056
|
+
type: 'string',
|
|
2057
|
+
enum: ['Point'],
|
|
2058
|
+
default: 'Point'
|
|
2059
|
+
}
|
|
2060
|
+
},
|
|
2061
|
+
required: ['type', 'coordinates']
|
|
2062
|
+
};
|
|
2063
|
+
schemas.geoPosition = {
|
|
2064
|
+
type: 'array',
|
|
2065
|
+
minItems: 2,
|
|
2066
|
+
items: {
|
|
2067
|
+
type: 'number'
|
|
2068
|
+
}
|
|
2069
|
+
}
|
|
2070
|
+
}
|
|
2071
|
+
}
|
|
2072
|
+
|
|
2073
|
+
/**
|
|
2074
|
+
* Construct Schema Objects for an enumeration type
|
|
2075
|
+
* @param {object} schemas Map of Schema Objects to augment
|
|
2076
|
+
* @param {string} qualifier Qualifier for structured type
|
|
2077
|
+
* @param {string} name Simple name of structured type
|
|
2078
|
+
* @param {object} type Structured type
|
|
2079
|
+
* @return {object} Map of Schemas Objects
|
|
2080
|
+
*/
|
|
2081
|
+
function schemaForEnumerationType(schemas, qualifier, name, type) {
|
|
2082
|
+
const members = [];
|
|
2083
|
+
Object.keys(type).filter(iName => isIdentifier(iName)).forEach(iName2 => {
|
|
2084
|
+
members.push(iName2);
|
|
2085
|
+
});
|
|
2086
|
+
|
|
2087
|
+
const s = {
|
|
2088
|
+
type: 'string',
|
|
2089
|
+
title: name,
|
|
2090
|
+
enum: members
|
|
2091
|
+
};
|
|
2092
|
+
const description = type[meta.voc.Core.LongDescription];
|
|
2093
|
+
if (description) s.description = description;
|
|
2094
|
+
schemas[`${qualifier}.${name}`] = s;
|
|
2095
|
+
}
|
|
2096
|
+
|
|
2097
|
+
/**
|
|
2098
|
+
* Construct Schema Objects for a type definition
|
|
2099
|
+
* @param {object} schemas Map of Schema Objects to augment
|
|
2100
|
+
* @param {string} qualifier Qualifier for structured type
|
|
2101
|
+
* @param {string} name Simple name of structured type
|
|
2102
|
+
* @param {object} type Structured type
|
|
2103
|
+
* @return {object} Map of Schemas Objects
|
|
2104
|
+
*/
|
|
2105
|
+
function schemaForTypeDefinition(schemas, qualifier, name, type) {
|
|
2106
|
+
const s = getSchema({$Type: type.$UnderlyingType, ...type});
|
|
2107
|
+
s.title = name;
|
|
2108
|
+
const description = type[meta.voc.Core.LongDescription];
|
|
2109
|
+
if (description) s.description = description;
|
|
2110
|
+
schemas[`${qualifier}.${name}`] = s;
|
|
2111
|
+
}
|
|
2112
|
+
|
|
2113
|
+
/**
|
|
2114
|
+
* Construct Schema Objects for a structured type
|
|
2115
|
+
* @param {object} options
|
|
2116
|
+
* @param {object} options.schemas Map of Schema Objects to augment
|
|
2117
|
+
* @param {string} options.qualifier Qualifier for structured type
|
|
2118
|
+
* @param {string} options.name Simple name of structured type
|
|
2119
|
+
* @param {object} options.type Structured type
|
|
2120
|
+
* @param {string} options.suffix Suffix for read/create/update
|
|
2121
|
+
* @return {object} Map of Schemas Objects
|
|
2122
|
+
*/
|
|
2123
|
+
function schemasForStructuredType({ schemas, qualifier, name, type, suffix }) {
|
|
2124
|
+
const schemaName = `${qualifier}.${name}${suffix}`;
|
|
2125
|
+
const baseName = `${qualifier}.${name}`;
|
|
2126
|
+
const isKey = keyMap(type);
|
|
2127
|
+
const required = Object.keys(isKey);
|
|
2128
|
+
const schemaProperties = {};
|
|
2129
|
+
let isCount = true;
|
|
2130
|
+
if (csdl[qualifier]?.$Annotations) {
|
|
2131
|
+
const annotations = csdl[qualifier].$Annotations[`${qualifier}.EntityContainer/${name}`];
|
|
2132
|
+
if (annotations && annotations[meta.voc.Capabilities.CountRestrictions] && annotations[meta.voc.Capabilities.CountRestrictions]?.Countable === false) {
|
|
2133
|
+
isCount = false;
|
|
2134
|
+
}
|
|
2135
|
+
}
|
|
2136
|
+
const properties = propertiesOfStructuredType(type);
|
|
2137
|
+
const expandRestrictions = type[meta.voc.Capabilities.ExpandRestrictions] ?? {};
|
|
2138
|
+
const nonExpandableProperties = expandRestrictions.NonExpandableProperties ?? [];
|
|
2139
|
+
Object.keys(properties).forEach(iName => {
|
|
2140
|
+
if (nonExpandableProperties.includes(iName)) {
|
|
2141
|
+
return;
|
|
2142
|
+
}
|
|
2143
|
+
const property = properties[iName];
|
|
2144
|
+
if (suffix === SUFFIX.read) schemaProperties[iName] = getSchema(property);
|
|
2145
|
+
if ((Object.prototype.hasOwnProperty.call(property, '@Common.FieldControl')) && property['@Common.FieldControl'] === 'Mandatory') { required.push(iName) }
|
|
2146
|
+
if (property.$Kind == 'NavigationProperty') {
|
|
2147
|
+
if (property.$Collection && suffix === "" && isCount === true) {
|
|
2148
|
+
schemaProperties[`${iName}@${csdl.$Version === '4.0' ? 'odata.' : ''}count`] = ref('count');
|
|
2149
|
+
}
|
|
2150
|
+
if (property[meta.voc.Core.Permissions] != "Read" && !property[meta.voc.Core.Computed] && (property.$ContainsTarget || property.$OnDelete === 'Cascade')) {
|
|
2151
|
+
if (suffix === SUFFIX.create) {
|
|
2152
|
+
schemaProperties[iName] = getSchema(property, SUFFIX.create);
|
|
2153
|
+
}
|
|
2154
|
+
if (suffix === SUFFIX.update && !property[meta.voc.Core.Immutable]) {
|
|
2155
|
+
schemaProperties[iName] = getSchema(property, SUFFIX.create);
|
|
2156
|
+
}
|
|
2157
|
+
}
|
|
2158
|
+
} else {
|
|
2159
|
+
if (property[meta.voc.Core.Permissions] === "Read" || property[meta.voc.Core.Computed] || property[meta.voc.Core.ComputedDefaultValue]) {
|
|
2160
|
+
const index = required.indexOf(iName);
|
|
2161
|
+
if (index != -1) required.splice(index, 1);
|
|
2162
|
+
}
|
|
2163
|
+
if (!(property[meta.voc.Core.Permissions] === "Read" || property[meta.voc.Core.Computed])) {
|
|
2164
|
+
if (suffix === SUFFIX.create)
|
|
2165
|
+
schemaProperties[iName] = getSchema(property, SUFFIX.create);
|
|
2166
|
+
if (suffix === SUFFIX.update && !isKey[iName] && !property[meta.voc.Core.Immutable])
|
|
2167
|
+
schemaProperties[iName] = getSchema(property, SUFFIX.update);
|
|
2168
|
+
}
|
|
2169
|
+
}
|
|
2170
|
+
});
|
|
2171
|
+
|
|
2172
|
+
|
|
2173
|
+
schemas[schemaName] = {
|
|
2174
|
+
title: (type[meta.voc.Core.Description] || name) + TITLE_SUFFIX[suffix],
|
|
2175
|
+
type: 'object'
|
|
2176
|
+
};
|
|
2177
|
+
if (Object.keys(schemaProperties).length > 0)
|
|
2178
|
+
schemas[schemaName].properties = schemaProperties;
|
|
2179
|
+
|
|
2180
|
+
if (suffix === SUFFIX.read && type["@ODM.root"]) schemas[schemaName]["x-sap-root-entity"] = type["@ODM.root"]
|
|
2181
|
+
odmExtensions(type, schemas[schemaName]);
|
|
2182
|
+
erExtensions(type, schemas[schemaName]);
|
|
2183
|
+
|
|
2184
|
+
if (suffix === SUFFIX.create && required.length > 0)
|
|
2185
|
+
schemas[schemaName].required = [...new Set(required)];
|
|
2186
|
+
|
|
2187
|
+
const description = type[meta.voc.Core.LongDescription];
|
|
2188
|
+
if (description) {
|
|
2189
|
+
schemas[schemaName].description = description;
|
|
2190
|
+
}
|
|
2191
|
+
|
|
2192
|
+
if (meta.derivedTypes[baseName]) {
|
|
2193
|
+
schemas[schemaName].anyOf = [];
|
|
2194
|
+
meta.derivedTypes[baseName].forEach((derivedType) => {
|
|
2195
|
+
schemas[schemaName].anyOf.push(ref(derivedType, suffix));
|
|
2196
|
+
});
|
|
2197
|
+
if (!type.$Abstract) schemas[schemaName].anyOf.push({});
|
|
2198
|
+
}
|
|
2199
|
+
}
|
|
2200
|
+
|
|
2201
|
+
/**
|
|
2202
|
+
* Add ODM extensions to OpenAPI schema for a structured type
|
|
2203
|
+
* @param {object} type Structured type
|
|
2204
|
+
* @param {object} schema OpenAPI schema to augment
|
|
2205
|
+
*/
|
|
2206
|
+
function odmExtensions(type, schema) {
|
|
2207
|
+
for (const [annotation, openApiExtension] of Object.entries(ODM_ANNOTATIONS)) {
|
|
2208
|
+
if (type[annotation]) schema[openApiExtension] = type[annotation];
|
|
2209
|
+
}
|
|
2210
|
+
}
|
|
2211
|
+
|
|
2212
|
+
/**
|
|
2213
|
+
* Add entity relationship extensions to OpenAPI schema for a structured type
|
|
2214
|
+
* @param {object} type Structured type
|
|
2215
|
+
* @param {object} schema OpenAPI schema to augment
|
|
2216
|
+
*/
|
|
2217
|
+
function erExtensions(type, schema) {
|
|
2218
|
+
for (const [annotation, openApiExtension] of Object.entries(ER_ANNOTATIONS)) {
|
|
2219
|
+
if (type[annotation]) schema[openApiExtension] = type[annotation];
|
|
2220
|
+
}
|
|
2221
|
+
}
|
|
2222
|
+
|
|
2223
|
+
/**
|
|
2224
|
+
* Collect all properties of a structured type along the inheritance hierarchy
|
|
2225
|
+
* @param {object} type Structured type
|
|
2226
|
+
* @return {object} Map of properties
|
|
2227
|
+
*/
|
|
2228
|
+
function propertiesOfStructuredType(type) {
|
|
2229
|
+
const properties = (type && type.$BaseType) ? propertiesOfStructuredType(meta.modelElement(type.$BaseType)) : {};
|
|
2230
|
+
if (type) {
|
|
2231
|
+
Object.keys(type).filter(name => isIdentifier(name)).forEach(name => {
|
|
2232
|
+
properties[name] = type[name];
|
|
2233
|
+
});
|
|
2234
|
+
}
|
|
2235
|
+
return properties;
|
|
2236
|
+
}
|
|
2237
|
+
|
|
2238
|
+
/**
|
|
2239
|
+
* Construct Parameter Objects for type-independent OData system query options
|
|
2240
|
+
* @return {object} Map of Parameter Objects
|
|
2241
|
+
*/
|
|
2242
|
+
function getParameters() {
|
|
2243
|
+
const param = {
|
|
2244
|
+
top: {
|
|
2245
|
+
name: `${queryOptionPrefix}top`,
|
|
2246
|
+
in: 'query',
|
|
2247
|
+
description: 'Show only the first n items, see [Paging - Top](http://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-protocol.html#sec_SystemQueryOptiontop)',
|
|
2248
|
+
schema: {
|
|
2249
|
+
type: 'integer',
|
|
2250
|
+
minimum: 0
|
|
2251
|
+
},
|
|
2252
|
+
example: 50
|
|
2253
|
+
},
|
|
2254
|
+
skip: {
|
|
2255
|
+
name: `${queryOptionPrefix}skip`,
|
|
2256
|
+
in: 'query',
|
|
2257
|
+
description: 'Skip the first n items, see [Paging - Skip](http://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-protocol.html#sec_SystemQueryOptionskip)',
|
|
2258
|
+
schema: {
|
|
2259
|
+
type: 'integer',
|
|
2260
|
+
minimum: 0
|
|
2261
|
+
}
|
|
2262
|
+
},
|
|
2263
|
+
count: {
|
|
2264
|
+
name: `${queryOptionPrefix}count`,
|
|
2265
|
+
in: 'query',
|
|
2266
|
+
description: 'Include count of items, see [Count](http://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-protocol.html#sec_SystemQueryOptioncount)',
|
|
2267
|
+
schema: {
|
|
2268
|
+
type: 'boolean'
|
|
2269
|
+
}
|
|
2270
|
+
}
|
|
2271
|
+
};
|
|
2272
|
+
|
|
2273
|
+
if (csdl.$Version >= '4.0') param.search = {
|
|
2274
|
+
name: `${queryOptionPrefix}search`,
|
|
2275
|
+
in: 'query',
|
|
2276
|
+
description: 'Search items by search phrases, see [Searching](http://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-protocol.html#sec_SystemQueryOptionsearch)',
|
|
2277
|
+
schema: {
|
|
2278
|
+
type: 'string'
|
|
2279
|
+
}
|
|
2280
|
+
};
|
|
2281
|
+
|
|
2282
|
+
return param;
|
|
2283
|
+
}
|
|
2284
|
+
|
|
2285
|
+
/**
|
|
2286
|
+
* Construct OData error response
|
|
2287
|
+
*/
|
|
2288
|
+
function error() {
|
|
2289
|
+
const err = {
|
|
2290
|
+
type: 'object',
|
|
2291
|
+
required: ['error'],
|
|
2292
|
+
properties: {
|
|
2293
|
+
error: {
|
|
2294
|
+
type: 'object',
|
|
2295
|
+
required: ['code', 'message'],
|
|
2296
|
+
properties: {
|
|
2297
|
+
code: { type: 'string' },
|
|
2298
|
+
message: { type: 'string' },
|
|
2299
|
+
target: { type: 'string' },
|
|
2300
|
+
details: {
|
|
2301
|
+
type: 'array',
|
|
2302
|
+
items: {
|
|
2303
|
+
type: 'object',
|
|
2304
|
+
required: ['code', 'message'],
|
|
2305
|
+
properties: {
|
|
2306
|
+
code: { type: 'string' },
|
|
2307
|
+
message: { type: 'string' },
|
|
2308
|
+
target: { type: 'string' }
|
|
2309
|
+
}
|
|
2310
|
+
}
|
|
2311
|
+
},
|
|
2312
|
+
innererror: {
|
|
2313
|
+
type: 'object',
|
|
2314
|
+
description: 'The structure of this object is service-specific'
|
|
2315
|
+
}
|
|
2316
|
+
}
|
|
2317
|
+
}
|
|
2318
|
+
}
|
|
2319
|
+
};
|
|
2320
|
+
|
|
2321
|
+
if (csdl.$Version < '4.0') {
|
|
2322
|
+
err.properties.error.properties.message = {
|
|
2323
|
+
type: 'object',
|
|
2324
|
+
properties: {
|
|
2325
|
+
lang: { type: 'string' },
|
|
2326
|
+
value: { type: 'string' }
|
|
2327
|
+
},
|
|
2328
|
+
required: ['lang', 'value']
|
|
2329
|
+
};
|
|
2330
|
+
// explicit cast required, as .details and .target are no inferred as optional above
|
|
2331
|
+
delete /**@type{any}*/(err.properties.error.properties).details;
|
|
2332
|
+
delete /**@type{any}*/(err.properties.error.properties).target;
|
|
2333
|
+
}
|
|
2334
|
+
|
|
2335
|
+
return err;
|
|
2336
|
+
}
|
|
2337
|
+
|
|
2338
|
+
/**
|
|
2339
|
+
* Construct OData count response
|
|
2340
|
+
*/
|
|
2341
|
+
function count() {
|
|
2342
|
+
return {
|
|
2343
|
+
anyOf: [
|
|
2344
|
+
{ type: 'number' },
|
|
2345
|
+
{ type: 'string' }
|
|
2346
|
+
],
|
|
2347
|
+
description: 'The number of entities in the collection. Available when using the [$count](http://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-protocol.html#sec_SystemQueryOptioncount) query option.',
|
|
2348
|
+
};
|
|
2349
|
+
}
|
|
2350
|
+
|
|
2351
|
+
/**
|
|
2352
|
+
* Construct Schema Object for model object referencing a type
|
|
2353
|
+
* @param {object} element referencing a type
|
|
2354
|
+
* @return {object} Schema Object
|
|
2355
|
+
*/
|
|
2356
|
+
function getSchema(element, suffix = '', forParameter = false, forFunction = false) {
|
|
2357
|
+
|
|
2358
|
+
/** @type {Schema} */
|
|
2359
|
+
let s = {};
|
|
2360
|
+
switch (element.$Type) {
|
|
2361
|
+
case 'Edm.AnnotationPath':
|
|
2362
|
+
case 'Edm.meta.modelElementPath':
|
|
2363
|
+
case 'Edm.NavigationPropertyPath':
|
|
2364
|
+
case 'Edm.PropertyPath':
|
|
2365
|
+
s = { type: 'string' };
|
|
2366
|
+
break;
|
|
2367
|
+
case 'Edm.Binary':
|
|
2368
|
+
s = {
|
|
2369
|
+
type: 'string',
|
|
2370
|
+
format: 'base64url'
|
|
2371
|
+
};
|
|
2372
|
+
if (element.$MaxLength) s.maxLength = Math.ceil(4 * element.$MaxLength / 3);
|
|
2373
|
+
break;
|
|
2374
|
+
case 'Edm.Boolean':
|
|
2375
|
+
s = { type: 'boolean' };
|
|
2376
|
+
break;
|
|
2377
|
+
case 'Edm.Byte':
|
|
2378
|
+
s = {
|
|
2379
|
+
type: 'integer',
|
|
2380
|
+
format: 'uint8'
|
|
2381
|
+
};
|
|
2382
|
+
break;
|
|
2383
|
+
case 'Edm.Date':
|
|
2384
|
+
s = {
|
|
2385
|
+
type: 'string',
|
|
2386
|
+
format: 'date',
|
|
2387
|
+
example: '2017-04-13'
|
|
2388
|
+
};
|
|
2389
|
+
break;
|
|
2390
|
+
case 'Edm.DateTime':
|
|
2391
|
+
case 'Edm.DateTimeOffset':
|
|
2392
|
+
s = {
|
|
2393
|
+
type: 'string',
|
|
2394
|
+
format: 'date-time',
|
|
2395
|
+
example: `2017-04-13T15:51:04${isNaN(element.$Precision) || element.$Precision === 0 ? '' : `.${'0'.repeat(element.$Precision)}`}Z`
|
|
2396
|
+
};
|
|
2397
|
+
break;
|
|
2398
|
+
case 'Edm.Decimal': {
|
|
2399
|
+
const preDecimal = /** @type {const}*/({ type: 'number', format: 'decimal' })
|
|
2400
|
+
s = {
|
|
2401
|
+
anyOf: [preDecimal, { type: 'string' }],
|
|
2402
|
+
example: 0
|
|
2403
|
+
};
|
|
2404
|
+
if (!isNaN(element.$Precision)) s['x-sap-precision'] = element.$Precision;
|
|
2405
|
+
if (!isNaN(element.$Scale)) s['x-sap-scale'] = element.$Scale;
|
|
2406
|
+
const scale = !isNaN(element.$Scale) ? element.$Scale : null;
|
|
2407
|
+
if (scale !== null) {
|
|
2408
|
+
// Node.js 20 has problems with negative exponents, 10 ** -5 --> 0.000009999999999999999
|
|
2409
|
+
if (scale <= 0)
|
|
2410
|
+
preDecimal.multipleOf = 10 ** -scale;
|
|
2411
|
+
else
|
|
2412
|
+
preDecimal.multipleOf = 1 / 10 ** scale;
|
|
2413
|
+
}
|
|
2414
|
+
if (element.$Precision < 16) {
|
|
2415
|
+
const limit = 10 ** (element.$Precision - scale);
|
|
2416
|
+
const delta = 10 ** -scale;
|
|
2417
|
+
preDecimal.maximum = limit - delta;
|
|
2418
|
+
preDecimal.minimum = -preDecimal.maximum;
|
|
2419
|
+
}
|
|
2420
|
+
break;
|
|
2421
|
+
}
|
|
2422
|
+
case 'Edm.Double':
|
|
2423
|
+
s = {
|
|
2424
|
+
anyOf: [{ type: 'number', format: 'double' }, { type: 'string' }],
|
|
2425
|
+
example: 3.14
|
|
2426
|
+
};
|
|
2427
|
+
break;
|
|
2428
|
+
case 'Edm.Duration':
|
|
2429
|
+
s = {
|
|
2430
|
+
type: 'string',
|
|
2431
|
+
format: 'duration',
|
|
2432
|
+
example: 'P4DT15H51M04S'
|
|
2433
|
+
};
|
|
2434
|
+
break;
|
|
2435
|
+
case 'Edm.GeographyPoint':
|
|
2436
|
+
case 'Edm.GeometryPoint':
|
|
2437
|
+
s = ref('geoPoint');
|
|
2438
|
+
typesToInline.geoPoint = true;
|
|
2439
|
+
break;
|
|
2440
|
+
case 'Edm.Guid':
|
|
2441
|
+
s = {
|
|
2442
|
+
type: 'string',
|
|
2443
|
+
format: 'uuid',
|
|
2444
|
+
example: '01234567-89ab-cdef-0123-456789abcdef'
|
|
2445
|
+
};
|
|
2446
|
+
break;
|
|
2447
|
+
case 'Edm.Int16':
|
|
2448
|
+
s = {
|
|
2449
|
+
type: 'integer',
|
|
2450
|
+
format: 'int16'
|
|
2451
|
+
};
|
|
2452
|
+
break;
|
|
2453
|
+
case 'Edm.Int32':
|
|
2454
|
+
s = {
|
|
2455
|
+
type: 'integer',
|
|
2456
|
+
format: 'int32'
|
|
2457
|
+
};
|
|
2458
|
+
break;
|
|
2459
|
+
case 'Edm.Int64':
|
|
2460
|
+
s = {
|
|
2461
|
+
anyOf: [{ type: 'integer', format: 'int64' }, { type: 'string' }],
|
|
2462
|
+
example: "42"
|
|
2463
|
+
};
|
|
2464
|
+
break;
|
|
2465
|
+
case 'Edm.PrimitiveType':
|
|
2466
|
+
s = {
|
|
2467
|
+
anyOf: [{ type: 'boolean' }, { type: 'number' }, { type: 'string' }]
|
|
2468
|
+
};
|
|
2469
|
+
break;
|
|
2470
|
+
case 'Edm.SByte':
|
|
2471
|
+
s = {
|
|
2472
|
+
type: 'integer',
|
|
2473
|
+
format: 'int8'
|
|
2474
|
+
};
|
|
2475
|
+
break;
|
|
2476
|
+
case 'Edm.Single':
|
|
2477
|
+
s = {
|
|
2478
|
+
anyOf: [{ type: 'number', format: 'float' }, { type: 'string' }],
|
|
2479
|
+
example: 3.14
|
|
2480
|
+
};
|
|
2481
|
+
break;
|
|
2482
|
+
case 'Edm.Stream':
|
|
2483
|
+
// eslint-disable-next-line no-case-declarations
|
|
2484
|
+
const jsonSchema = element[meta.voc.JSON.Schema];
|
|
2485
|
+
if (jsonSchema) {
|
|
2486
|
+
if (typeof jsonSchema == 'string')
|
|
2487
|
+
s = JSON.parse(jsonSchema);
|
|
2488
|
+
else
|
|
2489
|
+
s = jsonSchema;
|
|
2490
|
+
} else {
|
|
2491
|
+
s = {
|
|
2492
|
+
type: 'string',
|
|
2493
|
+
format: 'base64url'
|
|
2494
|
+
};
|
|
2495
|
+
}
|
|
2496
|
+
break;
|
|
2497
|
+
case 'Edm.String':
|
|
2498
|
+
case undefined: {
|
|
2499
|
+
s = { type: 'string' };
|
|
2500
|
+
if (element.$MaxLength) s.maxLength = element.$MaxLength;
|
|
2501
|
+
const pattern = element[meta.voc.Validation.Pattern];
|
|
2502
|
+
if (pattern) s.pattern = pattern;
|
|
2503
|
+
break;
|
|
2504
|
+
}
|
|
2505
|
+
case 'Edm.TimeOfDay':
|
|
2506
|
+
s = {
|
|
2507
|
+
type: 'string',
|
|
2508
|
+
format: 'time',
|
|
2509
|
+
example: '15:51:04'
|
|
2510
|
+
};
|
|
2511
|
+
break;
|
|
2512
|
+
default:
|
|
2513
|
+
if (element.$Type.startsWith('Edm.')) {
|
|
2514
|
+
DEBUG?.(`Unknown type: ${element.$Type}`);
|
|
2515
|
+
} else {
|
|
2516
|
+
const type = meta.modelElement(element.$Type);
|
|
2517
|
+
const isStructured = type && ['ComplexType', 'EntityType'].includes(type.$Kind);
|
|
2518
|
+
s = ref(element.$Type, (isStructured ? suffix : ''));
|
|
2519
|
+
if (element.$MaxLength) {
|
|
2520
|
+
s = {
|
|
2521
|
+
allOf: [s],
|
|
2522
|
+
maxLength: element.$MaxLength
|
|
2523
|
+
};
|
|
2524
|
+
}
|
|
2525
|
+
}
|
|
2526
|
+
}
|
|
2527
|
+
|
|
2528
|
+
allowedValues(s, element);
|
|
2529
|
+
|
|
2530
|
+
if (element.$Nullable) {
|
|
2531
|
+
if (s.$ref) s = { allOf: [s] };
|
|
2532
|
+
s.nullable = true;
|
|
2533
|
+
}
|
|
2534
|
+
|
|
2535
|
+
if (element.$DefaultValue !== undefined) {
|
|
2536
|
+
if (s.$ref) s = { allOf: [s] };
|
|
2537
|
+
s.default = element.$DefaultValue;
|
|
2538
|
+
}
|
|
2539
|
+
|
|
2540
|
+
if (element[meta.voc.Core.Example]) {
|
|
2541
|
+
if (s.$ref) s = { allOf: [s] };
|
|
2542
|
+
s.example = element[meta.voc.Core.Example].Value;
|
|
2543
|
+
}
|
|
2544
|
+
|
|
2545
|
+
/** @returns {s is import('./types.d.ts').StringSchema} */
|
|
2546
|
+
const isStringSchema = s => s?.type === 'string'
|
|
2547
|
+
/** @returns {s is import('./types.d.ts').NumberSchema} */
|
|
2548
|
+
const isNumberSchema = s => s?.type === 'number' || s?.type === 'integer'
|
|
2549
|
+
/** @returns {s is import('./types.d.ts').AnyOf} */
|
|
2550
|
+
const isAnyOfSchema = s => Boolean(s?.anyOf)
|
|
2551
|
+
|
|
2552
|
+
if (forFunction) {
|
|
2553
|
+
if (s.example && typeof s.example === "string") {
|
|
2554
|
+
s.example = `${pathValuePrefix(element.$Type)}${s.example
|
|
2555
|
+
}${pathValueSuffix(element.$Type)} `;
|
|
2556
|
+
}
|
|
2557
|
+
if (isStringSchema(s)) {
|
|
2558
|
+
if (s.pattern) {
|
|
2559
|
+
const pre = pathValuePrefix(element.$Type);
|
|
2560
|
+
const suf = pathValueSuffix(element.$Type);
|
|
2561
|
+
s.pattern = s.pattern.replace(/^\^/, `^ ${pre} (`);
|
|
2562
|
+
s.pattern = s.pattern.replace(/\$$/, `)${suf} $`);
|
|
2563
|
+
} else if (!element.$Type || element.$Type === "Edm.String") {
|
|
2564
|
+
s.pattern = "^'([^']|'')*'$";
|
|
2565
|
+
}
|
|
2566
|
+
}
|
|
2567
|
+
if (element.$Nullable) {
|
|
2568
|
+
s.default = "null";
|
|
2569
|
+
if (isStringSchema(s) && s.pattern) {
|
|
2570
|
+
s.pattern = s.pattern
|
|
2571
|
+
.replace(/^\^/, "^(null|")
|
|
2572
|
+
.replace(/\$$/, ")$");
|
|
2573
|
+
}
|
|
2574
|
+
}
|
|
2575
|
+
}
|
|
2576
|
+
|
|
2577
|
+
if (element[meta.voc.Validation.Maximum] != undefined) {
|
|
2578
|
+
if (s.$ref) s = { allOf: [s] };
|
|
2579
|
+
if (isAnyOfSchema(s) && isNumberSchema(s.anyOf[0])) {
|
|
2580
|
+
s.anyOf[0].maximum = element[meta.voc.Validation.Maximum];
|
|
2581
|
+
}
|
|
2582
|
+
// TODO: this implies that we could be handling an AnyOfSchema here. So exclusiveMinimum is attach to that? Or to its first element, as above?
|
|
2583
|
+
// @ts-expect-error
|
|
2584
|
+
if (element[meta.voc.Validation.Maximum + meta.voc.Validation.Exclusive]) s.exclusiveMaximum = true;
|
|
2585
|
+
}
|
|
2586
|
+
|
|
2587
|
+
if (element[meta.voc.Validation.Minimum] != undefined) {
|
|
2588
|
+
if (s.$ref) s = { allOf: [s] };
|
|
2589
|
+
if (isAnyOfSchema(s) && isNumberSchema(s.anyOf[0])) {
|
|
2590
|
+
s.anyOf[0].minimum = element[meta.voc.Validation.Minimum];
|
|
2591
|
+
}
|
|
2592
|
+
// TODO: see above
|
|
2593
|
+
// @ts-expect-error
|
|
2594
|
+
if (element[meta.voc.Validation.Minimum + meta.voc.Validation.Exclusive]) s.exclusiveMinimum = true;
|
|
2595
|
+
}
|
|
2596
|
+
|
|
2597
|
+
if (element.$Collection) {
|
|
2598
|
+
s = {
|
|
2599
|
+
type: 'array',
|
|
2600
|
+
items: s
|
|
2601
|
+
};
|
|
2602
|
+
}
|
|
2603
|
+
|
|
2604
|
+
const description = forParameter ? undefined : (element[meta.voc.Core.LongDescription] || element[meta.voc.Core.Description]);
|
|
2605
|
+
if (description) {
|
|
2606
|
+
if (s.$ref) s = { allOf: [s] };
|
|
2607
|
+
s.description = description;
|
|
2608
|
+
}
|
|
2609
|
+
|
|
2610
|
+
if (element['@ODM.oidReference']?.entityName) {
|
|
2611
|
+
s['x-sap-odm-oid-reference-entity-name'] = element['@ODM.oidReference'].entityName
|
|
2612
|
+
}
|
|
2613
|
+
|
|
2614
|
+
for (const key in element) {
|
|
2615
|
+
if (key.startsWith(ER_ANNOTATION_PREFIX) && ER_ANNOTATIONS[key]) {
|
|
2616
|
+
s[ER_ANNOTATIONS[key]] = element[key];
|
|
2617
|
+
}
|
|
2618
|
+
}
|
|
2619
|
+
return s;
|
|
2620
|
+
}
|
|
2621
|
+
|
|
2622
|
+
/**
|
|
2623
|
+
* Add allowed values enum to Schema Object for string-like model element
|
|
2624
|
+
* @param {object} schema Schema Object to augment
|
|
2625
|
+
* @param {object} element Model element
|
|
2626
|
+
*/
|
|
2627
|
+
function allowedValues(schema, element) {
|
|
2628
|
+
const values = element[meta.voc.Validation.AllowedValues];
|
|
2629
|
+
if (values) schema.enum = values.map(record => record.Value);
|
|
2630
|
+
}
|
|
2631
|
+
|
|
2632
|
+
/**
|
|
2633
|
+
* Construct Reference Object for a type
|
|
2634
|
+
* @param {string} typename Qualified name of referenced type
|
|
2635
|
+
* @param {string} suffix Optional suffix for referenced schema
|
|
2636
|
+
* @return {object} Reference Object
|
|
2637
|
+
*/
|
|
2638
|
+
function ref(typename, suffix = '') {
|
|
2639
|
+
let name = typename;
|
|
2640
|
+
let nsp = '';
|
|
2641
|
+
let url = '';
|
|
2642
|
+
if (typename.indexOf('.') != -1) {
|
|
2643
|
+
const parts = nameParts(typename);
|
|
2644
|
+
nsp = meta.namespace[parts.qualifier];
|
|
2645
|
+
name = `${nsp}.${parts.name}`;
|
|
2646
|
+
url = meta.namespaceUrl[nsp] ?? '';
|
|
2647
|
+
if (url === "" && !requiredSchemas.used[name + suffix]) {
|
|
2648
|
+
requiredSchemas.used[name + suffix] = true;
|
|
2649
|
+
requiredSchemas.list.push({ namespace: nsp, name: parts.name, suffix });
|
|
2650
|
+
}
|
|
2651
|
+
//TODO: introduce better way than guessing
|
|
2652
|
+
if (url.endsWith('.xml')) url = `${url.substring(0, url.length - 3)}openapi3.json`;
|
|
2653
|
+
}
|
|
2654
|
+
return {
|
|
2655
|
+
$ref: `${url}#/components/schemas/${name}${suffix}`
|
|
2656
|
+
};
|
|
2657
|
+
}
|
|
2658
|
+
|
|
2659
|
+
/**
|
|
2660
|
+
* Augment Components Object with map of Security Scheme Objects
|
|
2661
|
+
* @param {object} components Components Object to augment
|
|
2662
|
+
* @param {object} entityContainer Entity Container object
|
|
2663
|
+
*/
|
|
2664
|
+
function getSecuritySchemes(components, entityContainer) {
|
|
2665
|
+
const authorizations = entityContainer && entityContainer[meta.voc.Authorization.Authorizations] ? entityContainer[meta.voc.Authorization.Authorizations] : [];
|
|
2666
|
+
const schemes = {};
|
|
2667
|
+
const location = { Header: 'header', QueryOption: 'query', Cookie: 'cookie' };
|
|
2668
|
+
authorizations.forEach(auth => {
|
|
2669
|
+
const scheme = {};
|
|
2670
|
+
const flow = {};
|
|
2671
|
+
if (auth.Description) scheme.description = auth.Description;
|
|
2672
|
+
const qualifiedType = auth['@type'] || auth['@odata.type']
|
|
2673
|
+
const type = qualifiedType.substring(qualifiedType.lastIndexOf(".") + 1);
|
|
2674
|
+
let unknown = false
|
|
2675
|
+
switch (type) {
|
|
2676
|
+
case 'ApiKey':
|
|
2677
|
+
scheme.type = 'apiKey';
|
|
2678
|
+
scheme.name = auth.KeyName;
|
|
2679
|
+
scheme.in = location[auth.Location];
|
|
2680
|
+
break;
|
|
2681
|
+
case 'Http':
|
|
2682
|
+
scheme.type = 'http';
|
|
2683
|
+
scheme.scheme = auth.Scheme;
|
|
2684
|
+
scheme.bearerFormat = auth.BearerFormat;
|
|
2685
|
+
break;
|
|
2686
|
+
case 'OAuth2AuthCode':
|
|
2687
|
+
scheme.type = 'oauth2';
|
|
2688
|
+
scheme.flows = { authorizationCode: flow };
|
|
2689
|
+
flow.authorizationUrl = auth.AuthorizationUrl;
|
|
2690
|
+
flow.tokenUrl = auth.TokenUrl;
|
|
2691
|
+
if (auth.RefreshUrl) flow.refreshUrl = auth.RefreshUrl;
|
|
2692
|
+
flow.scopes = getScopes(auth);
|
|
2693
|
+
break;
|
|
2694
|
+
case 'OAuth2ClientCredentials':
|
|
2695
|
+
scheme.type = 'oauth2';
|
|
2696
|
+
scheme.flows = { clientCredentials: flow };
|
|
2697
|
+
flow.tokenUrl = auth.TokenUrl;
|
|
2698
|
+
if (auth.RefreshUrl) flow.refreshUrl = auth.RefreshUrl;
|
|
2699
|
+
flow.scopes = getScopes(auth);
|
|
2700
|
+
break;
|
|
2701
|
+
case 'OAuth2Implicit':
|
|
2702
|
+
scheme.type = 'oauth2';
|
|
2703
|
+
scheme.flows = { implicit: flow };
|
|
2704
|
+
flow.authorizationUrl = auth.AuthorizationUrl;
|
|
2705
|
+
if (auth.RefreshUrl) flow.refreshUrl = auth.RefreshUrl;
|
|
2706
|
+
flow.scopes = getScopes(auth);
|
|
2707
|
+
break;
|
|
2708
|
+
case 'OAuth2Password':
|
|
2709
|
+
scheme.type = 'oauth2';
|
|
2710
|
+
scheme.flows = {};
|
|
2711
|
+
scheme.flows = { password: flow };
|
|
2712
|
+
flow.tokenUrl = auth.TokenUrl;
|
|
2713
|
+
if (auth.RefreshUrl) flow.refreshUrl = auth.RefreshUrl;
|
|
2714
|
+
flow.scopes = getScopes(auth);
|
|
2715
|
+
break;
|
|
2716
|
+
case 'OpenIDConnect':
|
|
2717
|
+
scheme.type = 'openIdConnect';
|
|
2718
|
+
scheme.openIdConnectUrl = auth.IssuerUrl;
|
|
2719
|
+
break;
|
|
2720
|
+
default:
|
|
2721
|
+
unknown = true
|
|
2722
|
+
DEBUG?.(`Unknown Authorization type ${qualifiedType}`);
|
|
2723
|
+
}
|
|
2724
|
+
if (!unknown) schemes[auth.Name] = scheme;
|
|
2725
|
+
});
|
|
2726
|
+
if (Object.keys(schemes).length > 0) components.securitySchemes = schemes
|
|
2727
|
+
}
|
|
2728
|
+
|
|
2729
|
+
function getScopes(authorization) {
|
|
2730
|
+
const scopes = {};
|
|
2731
|
+
authorization.Scopes.forEach(scope => { scopes[scope.Scope] = scope.Description });
|
|
2732
|
+
return scopes;
|
|
2733
|
+
}
|
|
2734
|
+
|
|
2735
|
+
/**
|
|
2736
|
+
* Augment OpenAPI document with Security Requirements Object
|
|
2737
|
+
* @param {object} openapi OpenAPI document to augment
|
|
2738
|
+
* @param {object} entityContainer Entity Container object
|
|
2739
|
+
*/
|
|
2740
|
+
function security(openapi, entityContainer) {
|
|
2741
|
+
const securitySchemes = entityContainer && entityContainer[meta.voc.Authorization.SecuritySchemes] ? entityContainer[meta.voc.Authorization.SecuritySchemes] : [];
|
|
2742
|
+
// check if securitySchemas exist if it does not exist then throw a warning
|
|
2743
|
+
if (securitySchemes.length === 0) {
|
|
2744
|
+
DEBUG?.('No security schemes defined in the entity container');
|
|
2745
|
+
}
|
|
2746
|
+
if (securitySchemes.length > 0) openapi.security = [];
|
|
2747
|
+
securitySchemes.forEach(scheme => {
|
|
2748
|
+
const s = {};
|
|
2749
|
+
s[scheme.Authorization] = scheme.RequiredScopes || [];
|
|
2750
|
+
openapi.security.push(s);
|
|
2751
|
+
});
|
|
2752
|
+
}
|
|
2753
|
+
};
|