@sap/cds-dk 10.1.1 → 10.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +53 -0
- package/bin/add.js +7 -2
- package/bin/bind.js +0 -2
- package/bin/bindings.js +35 -0
- package/bin/build.js +11 -6
- package/bin/compile/index.js +1 -0
- package/bin/completion/index.js +10 -448
- package/bin/completion/scripts/cds.fish +24 -16
- package/bin/completion/scripts/cds.ps1 +26 -25
- package/bin/completion/scripts/cds.sh +22 -19
- package/bin/completion/scripts/cds.zsh +22 -19
- package/bin/deploy/index.js +1 -1
- package/bin/deploy/to-hana/hana.js +5 -4
- package/bin/env.js +0 -1
- package/bin/eval.js +9 -5
- package/bin/export.js +6 -4
- package/bin/help/export.md +28 -4
- package/bin/import.js +6 -5
- package/bin/inspect.js +0 -1
- package/bin/login.js +28 -3
- package/bin/repl.js +82 -26
- package/bin/run.js +6 -7
- package/bin/serve.js +6 -7
- package/bin/up.js +7 -2
- package/bin/upgrade/steps/install.js +6 -6
- package/bin/watch/index.js +1 -0
- package/lib/build/index.js +11 -7
- package/lib/build/plugins/featureToggles.js +2 -2
- package/lib/build/plugins/hana/index.js +1 -1
- package/lib/build/plugins/helm/files/subcharts/web-application/Chart.yaml +1 -1
- package/lib/build/plugins/helm/files/subcharts/web-application/templates/_helpers.tpl +7 -0
- package/lib/build/plugins/helm/files/subcharts/web-application/templates/api-rule.yaml +1 -0
- package/lib/build/plugins/helm/files/subcharts/web-application/templates/service-binding.yaml +4 -4
- package/lib/build/plugins/helm/files/subcharts/web-application/values.schema.json +13 -0
- package/lib/build/plugins/helm/files/subcharts/web-application/values.yaml +7 -1
- package/lib/build/plugins/internal.js +0 -26
- package/lib/build/plugins/java/index.js +5 -1
- package/lib/build/plugins/nodejs/index.js +13 -4
- package/lib/build/util.js +4 -5
- package/lib/cds.js +8 -2
- package/lib/env/schemas/cds-rc.js +5 -0
- package/lib/import/importapi.js +2 -3
- package/lib/init/constants.js +1 -1
- package/lib/init/index.js +8 -3
- package/lib/init/merge.js +21 -17
- package/lib/init/plugin.js +1 -1
- package/lib/init/projectReader.js +13 -10
- package/lib/init/registries/mta.js +0 -6
- package/lib/init/template/ai/index.js +4 -4
- package/lib/init/template/ams/files/extensionDeveloper.dcl +6 -0
- package/lib/init/template/ams/files/mta.yaml.hbs +6 -0
- package/lib/init/template/ams/files/sidecar.package.json.hbs +5 -0
- package/lib/init/template/ams/index.js +42 -40
- package/lib/init/template/app-frontend/files/mta.yaml.hbs +2 -0
- package/lib/init/template/app-frontend/files/ui5.yaml.hbs +0 -4
- package/lib/init/template/app-frontend/index.js +29 -24
- package/lib/init/template/application-logging/index.js +6 -6
- package/lib/init/template/approuter/files/xs-app.json.hbs +22 -0
- package/lib/init/template/approuter/index.js +20 -13
- package/lib/init/template/attachments/index.js +3 -3
- package/lib/init/template/audit-logging/index.js +4 -4
- package/lib/init/template/cloud-logging/index.js +12 -6
- package/lib/init/template/completion/completionSetup.js +19 -6
- package/lib/init/template/connectivity/index.js +3 -3
- package/lib/init/template/data/as-csv.js +7 -4
- package/lib/init/template/data/as-json.js +77 -20
- package/lib/init/template/destination/index.js +12 -9
- package/lib/init/template/dynatrace/index.js +5 -5
- package/lib/init/template/enterprise-messaging/index.js +10 -7
- package/lib/init/template/enterprise-messaging-shared/index.js +4 -4
- package/lib/init/template/event-mesh/index.js +3 -0
- package/lib/init/template/extensibility/index.js +2 -2
- package/lib/init/template/extension/index.js +26 -0
- package/lib/init/template/github-actions/index.js +3 -3
- package/lib/init/template/hana/files/package.json.hbs +3 -2
- package/lib/init/template/hana/index.js +5 -5
- package/lib/init/template/hana-serverless/index.js +3 -3
- package/lib/init/template/html5-repo/files/mta.yaml.hbs +2 -0
- package/lib/init/template/html5-repo/files/ui5.yaml.hbs +0 -4
- package/lib/init/template/html5-repo/index.js +68 -40
- package/lib/init/template/http/index.js +1 -1
- package/lib/init/template/ias/index.js +7 -7
- package/lib/init/template/initial/files/.gitignore.hbs +1 -0
- package/lib/init/template/kafka/index.js +3 -3
- package/lib/init/template/kyma/index.js +7 -9
- package/lib/init/template/malware-scanner/index.js +3 -3
- package/lib/init/template/mta/index.js +6 -3
- package/lib/init/template/multitenancy/index.js +6 -7
- package/lib/init/template/notifications/index.js +2 -2
- package/lib/init/template/portal/index.js +16 -10
- package/lib/init/template/postgres/index.js +5 -5
- package/lib/init/template/react/files/index.html.hbs +1 -1
- package/lib/init/template/react/files/package.json.hbs +3 -2
- package/lib/init/template/react/files/src/{App.jsx.hbs → App.{{jsxExtension}}.hbs} +8 -2
- package/lib/init/template/react/files/src/{main.jsx → main.{{jsxExtension}}.hbs} +2 -2
- package/lib/init/template/react/index.js +23 -4
- package/lib/init/template/react/typescript/src/vite-env.d.ts +1 -0
- package/lib/init/template/react/typescript/tsconfig.json.hbs +16 -0
- package/lib/init/template/redis/index.js +2 -2
- package/lib/init/template/side-by-side-extensibility/index.js +6 -3
- package/lib/init/template/typescript/files/tsconfig.json +3 -1
- package/lib/init/template/vue/files/index.html.hbs +1 -1
- package/lib/init/template/vue/files/package.json.hbs +2 -1
- package/lib/init/template/vue/files/src/App.vue.hbs +8 -2
- package/lib/init/template/vue/index.js +20 -4
- package/lib/init/template/vue/typescript/tsconfig.json +11 -0
- package/lib/init/template/workzone-standard/files/mta.yaml.hbs +2 -2
- package/lib/init/template/workzone-standard/index.js +30 -28
- package/lib/init/template/xsuaa/files/mta.yaml.hbs +1 -1
- package/lib/init/template/xsuaa/files/values.yaml.hbs +1 -1
- package/lib/init/template/xsuaa/index.js +34 -22
- package/lib/mtx/auth_manager.js +8 -2
- package/lib/mtx/browser_login.js +181 -0
- package/lib/mtx/params.js +6 -0
- package/lib/mtx/settings_manager.js +29 -4
- package/lib/util/cf.js +44 -8
- package/lib/util/fs.js +2 -2
- package/node_modules/@cap-js/db-service/CHANGELOG.md +23 -0
- package/node_modules/@cap-js/db-service/lib/cqn2pql.js +4 -0
- package/node_modules/@cap-js/db-service/lib/cqn2sql.js +3 -0
- package/node_modules/@cap-js/db-service/lib/cqn4sql.js +17 -28
- package/node_modules/@cap-js/db-service/lib/infer/index.js +20 -27
- package/node_modules/@cap-js/db-service/package.json +1 -1
- package/node_modules/@cap-js/openapi/cds-plugin.js +12 -0
- package/node_modules/@cap-js/openapi/index.js +3 -1
- package/node_modules/@cap-js/openapi/lib/compile/csdl2openapi.js +652 -413
- package/node_modules/@cap-js/openapi/lib/compile/diagram.js +16 -13
- package/node_modules/@cap-js/openapi/lib/compile/index.js +10 -7
- package/node_modules/@cap-js/openapi/lib/compile/property-util.js +51 -0
- package/{lib/import/openapi → node_modules/@cap-js/openapi/lib/import}/importOpenAPI.js +12 -9
- package/{lib/import/openapi → node_modules/@cap-js/openapi/lib/import}/index.js +4 -3
- package/node_modules/@cap-js/openapi/package.json +71 -3
- package/node_modules/@cap-js/sqlite/CHANGELOG.md +18 -0
- package/node_modules/@cap-js/sqlite/package.json +3 -3
- package/node_modules/@isaacs/fs-minipass/LICENSE +15 -0
- package/node_modules/@isaacs/fs-minipass/README.md +71 -0
- package/node_modules/@isaacs/fs-minipass/dist/commonjs/index.d.ts +118 -0
- package/node_modules/@isaacs/fs-minipass/dist/commonjs/index.d.ts.map +1 -0
- package/node_modules/@isaacs/fs-minipass/dist/commonjs/index.js +430 -0
- package/node_modules/@isaacs/fs-minipass/dist/commonjs/index.js.map +1 -0
- package/node_modules/@isaacs/fs-minipass/dist/commonjs/package.json +3 -0
- package/node_modules/@isaacs/fs-minipass/dist/esm/index.d.ts +118 -0
- package/node_modules/@isaacs/fs-minipass/dist/esm/index.d.ts.map +1 -0
- package/node_modules/@isaacs/fs-minipass/dist/esm/index.js +420 -0
- package/node_modules/@isaacs/fs-minipass/dist/esm/index.js.map +1 -0
- package/node_modules/@isaacs/fs-minipass/dist/esm/package.json +3 -0
- package/node_modules/@isaacs/fs-minipass/package.json +72 -0
- package/node_modules/@sap/cds/CHANGELOG.md +71 -1
- package/node_modules/@sap/cds/_i18n/messages_ar.properties +1 -0
- package/node_modules/@sap/cds/_i18n/messages_bg.properties +1 -0
- package/node_modules/@sap/cds/_i18n/messages_cs.properties +1 -0
- package/node_modules/@sap/cds/_i18n/messages_da.properties +1 -0
- package/node_modules/@sap/cds/_i18n/messages_de.properties +1 -0
- package/node_modules/@sap/cds/_i18n/messages_el.properties +1 -0
- package/node_modules/@sap/cds/_i18n/messages_en.properties +1 -0
- package/node_modules/@sap/cds/_i18n/messages_es.properties +1 -0
- package/node_modules/@sap/cds/_i18n/messages_es_MX.properties +1 -0
- package/node_modules/@sap/cds/_i18n/messages_fi.properties +1 -0
- package/node_modules/@sap/cds/_i18n/messages_fr.properties +1 -0
- package/node_modules/@sap/cds/_i18n/messages_he.properties +1 -0
- package/node_modules/@sap/cds/_i18n/messages_hr.properties +1 -0
- package/node_modules/@sap/cds/_i18n/messages_hu.properties +1 -0
- package/node_modules/@sap/cds/_i18n/messages_it.properties +1 -0
- package/node_modules/@sap/cds/_i18n/messages_ja.properties +1 -0
- package/node_modules/@sap/cds/_i18n/messages_kk.properties +1 -0
- package/node_modules/@sap/cds/_i18n/messages_ko.properties +1 -0
- package/node_modules/@sap/cds/_i18n/messages_ms.properties +1 -0
- package/node_modules/@sap/cds/_i18n/messages_nl.properties +1 -0
- package/node_modules/@sap/cds/_i18n/messages_no.properties +1 -0
- package/node_modules/@sap/cds/_i18n/messages_pl.properties +1 -0
- package/node_modules/@sap/cds/_i18n/messages_pt.properties +1 -0
- package/node_modules/@sap/cds/_i18n/messages_ro.properties +1 -0
- package/node_modules/@sap/cds/_i18n/messages_ru.properties +1 -0
- package/node_modules/@sap/cds/_i18n/messages_sh.properties +1 -0
- package/node_modules/@sap/cds/_i18n/messages_sk.properties +1 -0
- package/node_modules/@sap/cds/_i18n/messages_sl.properties +1 -0
- package/node_modules/@sap/cds/_i18n/messages_sv.properties +1 -0
- package/node_modules/@sap/cds/_i18n/messages_th.properties +1 -0
- package/node_modules/@sap/cds/_i18n/messages_tr.properties +1 -0
- package/node_modules/@sap/cds/_i18n/messages_uk.properties +1 -0
- package/node_modules/@sap/cds/_i18n/messages_vi.properties +1 -0
- package/node_modules/@sap/cds/_i18n/messages_zh_CN.properties +1 -0
- package/node_modules/@sap/cds/_i18n/messages_zh_TW.properties +1 -0
- package/node_modules/@sap/cds/app/index-client.js +164 -0
- package/node_modules/@sap/cds/app/index.css +598 -87
- package/node_modules/@sap/cds/app/index.html +54 -30
- package/node_modules/@sap/cds/app/index.js +311 -67
- package/node_modules/@sap/cds/app/table.html +226 -0
- package/node_modules/@sap/cds/app/table.js +302 -0
- package/node_modules/@sap/cds/bin/serve.js +3 -2
- package/node_modules/@sap/cds/common.cds +3 -3
- package/node_modules/@sap/cds/eslint.config.mjs +2 -0
- package/node_modules/@sap/cds/lib/compile/cdsc.js +7 -0
- package/node_modules/@sap/cds/lib/compile/for/embeddings.js +27 -0
- package/node_modules/@sap/cds/lib/compile/load.js +2 -2
- package/node_modules/@sap/cds/lib/compile/minify.js +17 -2
- package/node_modules/@sap/cds/lib/compile/parse.js +3 -0
- package/node_modules/@sap/cds/lib/compile/resolve.js +16 -14
- package/node_modules/@sap/cds/lib/core/classes.js +1 -0
- package/node_modules/@sap/cds/lib/dbs/cds-deploy.js +4 -5
- package/node_modules/@sap/cds/lib/env/cds-env.js +132 -70
- package/node_modules/@sap/cds/lib/env/cds-requires/auth-strategies.js +62 -0
- package/node_modules/@sap/cds/lib/env/cds-requires/databases.js +49 -0
- package/node_modules/@sap/cds/lib/env/cds-requires/embeddings.js +8 -0
- package/node_modules/@sap/cds/lib/env/cds-requires/index.js +27 -0
- package/node_modules/@sap/cds/lib/env/cds-requires/messaging.js +82 -0
- package/node_modules/@sap/cds/lib/env/cds-requires/platform.js +23 -0
- package/node_modules/@sap/cds/lib/env/cds-requires/queues.js +34 -0
- package/node_modules/@sap/cds/lib/env/cds-requires/services.js +32 -0
- package/node_modules/@sap/cds/lib/env/defaults.js +9 -1
- package/node_modules/@sap/cds/lib/i18n/files.js +4 -4
- package/node_modules/@sap/cds/lib/i18n/locale.js +1 -1
- package/node_modules/@sap/cds/lib/index.js +9 -9
- package/node_modules/@sap/cds/lib/log/cds-log.js +3 -3
- package/node_modules/@sap/cds/lib/ql/SELECT.js +2 -0
- package/node_modules/@sap/cds/lib/ql/UPDATE.js +1 -1
- package/node_modules/@sap/cds/lib/ql/cds.ql-Query.js +4 -1
- package/node_modules/@sap/cds/lib/ql/core/@types/cqn.d.ts +146 -0
- package/node_modules/@sap/cds/lib/ql/core/@types/exprs.d.ts +51 -0
- package/node_modules/@sap/cds/lib/ql/core/@types/index.d.ts +29 -0
- package/node_modules/@sap/cds/lib/ql/core/@types/package.json +7 -0
- package/node_modules/@sap/cds/lib/ql/core/@types/ql/delete.d.ts +8 -0
- package/node_modules/@sap/cds/lib/ql/core/@types/ql/insert.d.ts +19 -0
- package/node_modules/@sap/cds/lib/ql/core/@types/ql/select.d.ts +24 -0
- package/node_modules/@sap/cds/lib/ql/core/@types/ql/update.d.ts +10 -0
- package/node_modules/@sap/cds/lib/ql/core/@types/query.d.ts +18 -0
- package/node_modules/@sap/cds/lib/ql/core/cql/parser.min.js +1 -0
- package/node_modules/@sap/cds/lib/ql/core/lib/index.js +69 -0
- package/node_modules/@sap/cds/lib/ql/core/lib/ql/cache.js +34 -0
- package/node_modules/@sap/cds/lib/ql/core/lib/ql/call-action.js +6 -0
- package/node_modules/@sap/cds/lib/ql/core/lib/ql/delete.js +8 -0
- package/node_modules/@sap/cds/lib/ql/core/lib/ql/insert.js +26 -0
- package/node_modules/@sap/cds/lib/ql/core/lib/ql/select.js +22 -0
- package/node_modules/@sap/cds/lib/ql/core/lib/ql/update.js +26 -0
- package/node_modules/@sap/cds/lib/ql/core/lib/query.js +85 -0
- package/node_modules/@sap/cds/lib/ql/core/lib/xl/fluent.js +47 -0
- package/node_modules/@sap/cds/lib/ql/core/lib/xl/ttl.js +24 -0
- package/node_modules/@sap/cds/lib/ql/core/license +201 -0
- package/node_modules/@sap/cds/lib/ql/core/package.json +24 -0
- package/node_modules/@sap/cds/lib/ql/core/readme.md +99 -0
- package/node_modules/@sap/cds/lib/ql/core/upstream.json +5 -0
- package/node_modules/@sap/cds/lib/req/spawn.js +1 -1
- package/node_modules/@sap/cds/lib/srv/bindings.js +111 -115
- package/node_modules/@sap/cds/lib/srv/cds-connect.js +11 -10
- package/node_modules/@sap/cds/lib/srv/cds-serve.js +16 -7
- package/node_modules/@sap/cds/lib/srv/cds.Service.js +13 -7
- package/node_modules/@sap/cds/lib/srv/factory.js +8 -10
- package/node_modules/@sap/cds/lib/srv/middlewares/auth/ias-auth.js +35 -32
- package/node_modules/@sap/cds/lib/srv/middlewares/auth/jwt-auth.js +5 -1
- package/node_modules/@sap/cds/lib/srv/middlewares/auth/mocked-users.js +1 -1
- package/node_modules/@sap/cds/lib/srv/protocols/hcql.js +230 -79
- package/node_modules/@sap/cds/lib/srv/protocols/http.js +7 -3
- package/node_modules/@sap/cds/lib/srv/protocols/index.js +7 -2
- package/node_modules/@sap/cds/lib/srv/srv-dispatch.js +2 -2
- package/node_modules/@sap/cds/lib/utils/cds-utils.js +37 -0
- package/node_modules/@sap/cds/lib/utils/csv-reader.js +2 -2
- package/node_modules/@sap/cds/libx/_runtime/common/generic/assert.js +18 -27
- package/node_modules/@sap/cds/libx/_runtime/common/generic/crud.js +8 -2
- package/node_modules/@sap/cds/libx/_runtime/common/utils/cqn.js +1 -1
- package/node_modules/@sap/cds/libx/_runtime/common/utils/rewriteAsterisks.js +1 -1
- package/node_modules/@sap/cds/libx/_runtime/fiori/lean-draft.js +122 -85
- package/node_modules/@sap/cds/libx/_runtime/messaging/common-utils/authorizedRequest.js +24 -1
- package/node_modules/@sap/cds/libx/_runtime/messaging/common-utils/normalizeIncomingMessage.js +1 -1
- package/node_modules/@sap/cds/libx/_runtime/messaging/kafka.js +1 -1
- package/node_modules/@sap/cds/libx/_runtime/remote/Service.js +2 -2
- package/node_modules/@sap/cds/libx/_runtime/remote/utils/client.js +3 -2
- package/node_modules/@sap/cds/libx/_runtime/remote/utils/query.js +11 -6
- package/node_modules/@sap/cds/libx/http/location.js +10 -11
- package/node_modules/@sap/cds/libx/odata/middleware/create.js +4 -0
- package/node_modules/@sap/cds/libx/odata/middleware/metadata.js +1 -1
- package/node_modules/@sap/cds/libx/odata/middleware/operation.js +3 -0
- package/node_modules/@sap/cds/libx/odata/middleware/parse.js +9 -0
- package/node_modules/@sap/cds/libx/odata/middleware/read.js +7 -1
- package/node_modules/@sap/cds/libx/odata/middleware/update.js +5 -1
- package/node_modules/@sap/cds/libx/odata/parse/afterburner.js +3 -3
- package/node_modules/@sap/cds/libx/odata/parse/multipartToJson.js +1 -1
- package/node_modules/@sap/cds/libx/odata/utils/ieee754.js +20 -0
- package/node_modules/@sap/cds/libx/queue/SchedulingService.js +4 -0
- package/node_modules/@sap/cds/libx/queue/api.js +1 -1
- package/node_modules/@sap/cds/libx/queue/index.js +46 -10
- package/node_modules/@sap/cds/libx/queue/processing.js +52 -16
- package/node_modules/@sap/cds/libx/queue/utils.js +3 -0
- package/node_modules/@sap/cds/libx/rest/RestAdapter.js +1 -0
- package/node_modules/@sap/cds/package.json +2 -2
- package/node_modules/@sap/cds/server.js +1 -0
- package/node_modules/@sap/cds/srv/ucl-service.cds +1 -0
- package/node_modules/@sap/cds/tasks/enterprise-messaging-deploy.js +13 -5
- package/node_modules/@sap/cds-compiler/CHANGELOG.md +83 -0
- package/node_modules/@sap/cds-compiler/bin/cdsse.js +1 -1
- package/node_modules/@sap/cds-compiler/doc/EffectiveCSN.md +3314 -0
- package/node_modules/@sap/cds-compiler/lib/api/main.js +9 -6
- package/node_modules/@sap/cds-compiler/lib/api/options.js +3 -3
- package/node_modules/@sap/cds-compiler/lib/{model → base}/csnUtils.js +5 -5
- package/node_modules/@sap/cds-compiler/lib/base/message-registry.js +54 -6
- package/node_modules/@sap/cds-compiler/lib/base/optionProcessor.js +4 -4
- package/node_modules/@sap/cds-compiler/lib/{model → base}/sortViews.js +1 -1
- package/node_modules/@sap/cds-compiler/lib/checks/assocOutsideService.js +1 -1
- package/node_modules/@sap/cds-compiler/lib/checks/checkForTypes.js +1 -1
- package/node_modules/@sap/cds-compiler/lib/checks/checkPathsInStoredCalcElement.js +1 -1
- package/node_modules/@sap/cds-compiler/lib/checks/elements.js +37 -3
- package/node_modules/@sap/cds-compiler/lib/checks/enricher.js +1 -1
- package/node_modules/@sap/cds-compiler/lib/checks/existsInForbiddenPlaces.js +1 -1
- package/node_modules/@sap/cds-compiler/lib/checks/hasPersistedElements.js +1 -1
- package/node_modules/@sap/cds-compiler/lib/checks/manyExpand.js +1 -1
- package/node_modules/@sap/cds-compiler/lib/checks/manyNavigations.js +1 -1
- package/node_modules/@sap/cds-compiler/lib/checks/onConditions.js +1 -1
- package/node_modules/@sap/cds-compiler/lib/checks/parameters.js +1 -1
- package/node_modules/@sap/cds-compiler/lib/checks/queryNoDbArtifacts.js +1 -1
- package/node_modules/@sap/cds-compiler/lib/checks/selectItems.js +1 -1
- package/node_modules/@sap/cds-compiler/lib/checks/structuredAnnoExpressions.js +1 -1
- package/node_modules/@sap/cds-compiler/lib/checks/typeParameters.js +1 -1
- package/node_modules/@sap/cds-compiler/lib/checks/types.js +1 -1
- package/node_modules/@sap/cds-compiler/lib/checks/validator.js +1 -1
- package/node_modules/@sap/cds-compiler/lib/compiler/assert-consistency.js +20 -12
- package/node_modules/@sap/cds-compiler/lib/compiler/builtins.js +9 -4
- package/node_modules/@sap/cds-compiler/lib/compiler/checks.js +50 -0
- package/node_modules/@sap/cds-compiler/lib/compiler/define.js +303 -323
- package/node_modules/@sap/cds-compiler/lib/compiler/dictionaries.js +5 -0
- package/node_modules/@sap/cds-compiler/lib/compiler/extend.js +1015 -1177
- package/node_modules/@sap/cds-compiler/lib/compiler/generate.js +55 -42
- package/node_modules/@sap/cds-compiler/lib/compiler/populate.js +74 -45
- package/node_modules/@sap/cds-compiler/lib/compiler/propagator.js +1 -0
- package/node_modules/@sap/cds-compiler/lib/compiler/resolve.js +6 -4
- package/node_modules/@sap/cds-compiler/lib/compiler/shared.js +30 -49
- package/node_modules/@sap/cds-compiler/lib/compiler/utils.js +32 -18
- package/node_modules/@sap/cds-compiler/lib/edm/annotations/edmJson.js +3 -3
- package/node_modules/@sap/cds-compiler/lib/edm/annotations/genericTranslation.js +2 -2
- package/node_modules/@sap/cds-compiler/lib/edm/annotations/preprocessAnnotations.js +2 -3
- package/node_modules/@sap/cds-compiler/lib/edm/csn2edm.js +1 -1
- package/node_modules/@sap/cds-compiler/lib/edm/edm.js +6 -7
- package/node_modules/@sap/cds-compiler/lib/edm/edmAnnoPreprocessor.js +1 -1
- package/node_modules/@sap/cds-compiler/lib/edm/edmInboundChecks.js +1 -1
- package/node_modules/@sap/cds-compiler/lib/edm/edmPreprocessor.js +1 -1
- package/node_modules/@sap/cds-compiler/lib/edm/edmUtils.js +12 -7
- package/node_modules/@sap/cds-compiler/lib/gen/CdlGrammar.checksum +1 -1
- package/node_modules/@sap/cds-compiler/lib/gen/CdlParser.js +15 -15
- package/node_modules/@sap/cds-compiler/lib/gen/Dictionary.json +7 -0
- package/node_modules/@sap/cds-compiler/lib/json/from-csn.js +30 -30
- package/node_modules/@sap/cds-compiler/lib/json/to-csn.js +2 -1
- package/node_modules/@sap/cds-compiler/lib/main.js +4 -1
- package/node_modules/@sap/cds-compiler/lib/parsers/AstBuildingParser.js +42 -15
- package/node_modules/@sap/cds-compiler/lib/render/DuplicateChecker.js +37 -11
- package/node_modules/@sap/cds-compiler/lib/render/manageConstraints.js +1 -1
- package/node_modules/@sap/cds-compiler/lib/render/toCdl.js +11 -6
- package/node_modules/@sap/cds-compiler/lib/render/toRename.js +1 -1
- package/node_modules/@sap/cds-compiler/lib/render/toSql.js +74 -24
- package/node_modules/@sap/cds-compiler/lib/render/utils/common.js +1 -1
- package/node_modules/@sap/cds-compiler/lib/render/utils/operators.js +81 -0
- package/node_modules/@sap/cds-compiler/lib/render/utils/sql.js +17 -10
- package/node_modules/@sap/cds-compiler/lib/transform/db/assertUnique.js +1 -1
- package/node_modules/@sap/cds-compiler/lib/transform/db/associations.js +3 -4
- package/node_modules/@sap/cds-compiler/lib/transform/db/assocsToQueries/transformExists.js +1 -1
- package/node_modules/@sap/cds-compiler/lib/transform/db/backlinks.js +2 -2
- package/node_modules/@sap/cds-compiler/lib/transform/db/cdsPersistence.js +1 -1
- package/node_modules/@sap/cds-compiler/lib/transform/db/constraints.js +6 -5
- package/node_modules/@sap/cds-compiler/lib/transform/db/expansion.js +7 -1
- package/node_modules/@sap/cds-compiler/lib/transform/db/flattening.js +2 -2
- package/node_modules/@sap/cds-compiler/lib/{modelCompare/compare.js → transform/db/migration/diffModels.js} +5 -5
- package/node_modules/@sap/cds-compiler/lib/{modelCompare/utils/filter.js → transform/db/migration/filterDiff.js} +2 -2
- package/node_modules/@sap/cds-compiler/lib/transform/db/processSqlServices.js +1 -1
- package/node_modules/@sap/cds-compiler/lib/transform/db/rewriteCalculatedElements.js +1 -1
- package/node_modules/@sap/cds-compiler/lib/transform/db/temporal.js +1 -1
- package/node_modules/@sap/cds-compiler/lib/transform/db/views.js +2 -6
- package/node_modules/@sap/cds-compiler/lib/transform/draft/db.js +1 -1
- package/node_modules/@sap/cds-compiler/lib/transform/draft/odata.js +1 -1
- package/node_modules/@sap/cds-compiler/lib/transform/effective/annotations.js +1 -1
- package/node_modules/@sap/cds-compiler/lib/transform/effective/associations.js +1 -1
- package/node_modules/@sap/cds-compiler/lib/transform/effective/flattening.js +1 -1
- package/node_modules/@sap/cds-compiler/lib/transform/effective/main.js +3 -2
- package/node_modules/@sap/cds-compiler/lib/transform/effective/misc.js +2 -1
- package/node_modules/@sap/cds-compiler/lib/transform/effective/queries.js +1 -1
- package/node_modules/@sap/cds-compiler/lib/transform/effective/types.js +1 -1
- package/node_modules/@sap/cds-compiler/lib/transform/forOdata.js +1 -1
- package/node_modules/@sap/cds-compiler/lib/transform/forRelationalDB.js +9 -4
- package/node_modules/@sap/cds-compiler/lib/transform/localized.js +1 -1
- package/node_modules/@sap/cds-compiler/lib/transform/odata/adaptAnnotationRefs.js +5 -11
- package/node_modules/@sap/cds-compiler/lib/transform/odata/createForeignKeys.js +1 -1
- package/node_modules/@sap/cds-compiler/lib/transform/odata/flattening.js +4 -4
- package/node_modules/@sap/cds-compiler/lib/transform/odata/foreignKeyRefsInXprAnnos.js +5 -3
- package/node_modules/@sap/cds-compiler/lib/transform/odata/toFinalBaseType.js +29 -5
- package/node_modules/@sap/cds-compiler/lib/transform/odata/typesExposure.js +13 -3
- package/node_modules/@sap/cds-compiler/lib/transform/odata/utils.js +9 -0
- package/node_modules/@sap/cds-compiler/lib/transform/transformUtils.js +2 -2
- package/node_modules/@sap/cds-compiler/lib/transform/translateAssocsToJoins.js +1 -1
- package/node_modules/@sap/cds-compiler/lib/transform/tupleExpansion.js +1 -1
- package/node_modules/@sap/cds-compiler/lib/transform/universalCsn/coreComputed.js +1 -1
- package/node_modules/@sap/cds-compiler/lib/transform/universalCsn/universalCsnEnricher.js +1 -1
- package/node_modules/@sap/cds-compiler/lib/transform/universalCsn/utils.js +1 -1
- package/node_modules/@sap/cds-compiler/package.json +1 -1
- package/node_modules/@sap/cds-mtxs/CHANGELOG.md +47 -0
- package/node_modules/@sap/cds-mtxs/bin/cds-mtx-migrate.js +4 -6
- package/node_modules/@sap/cds-mtxs/bin/cds-mtx.js +5 -4
- package/node_modules/@sap/cds-mtxs/cds-plugin.js +38 -2
- package/node_modules/@sap/cds-mtxs/db/t0.cds +7 -0
- package/node_modules/@sap/cds-mtxs/lib/utils.js +129 -20
- package/node_modules/@sap/cds-mtxs/package.json +15 -14
- package/node_modules/@sap/cds-mtxs/srv/cf/abstract-provisioning-service.js +13 -12
- package/node_modules/@sap/cds-mtxs/srv/cf/saas-provisioning-service.cds +1 -0
- package/node_modules/@sap/cds-mtxs/srv/cf/sms-provisioning-service.cds +1 -0
- package/node_modules/@sap/cds-mtxs/srv/extensibility/compat/update.js +5 -2
- package/node_modules/@sap/cds-mtxs/srv/extensibility/linter/config.js +1 -2
- package/node_modules/@sap/cds-mtxs/srv/extensibility/linter/csv-allowlist.js +64 -0
- package/node_modules/@sap/cds-mtxs/srv/extensibility/linter/index.js +4 -2
- package/node_modules/@sap/cds-mtxs/srv/extensibility/linter/protected-namespace.js +67 -5
- package/node_modules/@sap/cds-mtxs/srv/extensibility-service.js +179 -15
- package/node_modules/@sap/cds-mtxs/srv/jobs-service.js +12 -3
- package/node_modules/@sap/cds-mtxs/srv/plugins/common.js +33 -12
- package/node_modules/@sap/cds-mtxs/srv/plugins/hana/ctnr-mgr-base.js +24 -6
- package/node_modules/@sap/cds-mtxs/srv/plugins/hana/hdi-ctnr-mgr.js +3 -1
- package/node_modules/@sap/cds-mtxs/srv/plugins/hana/hdi-native.js +752 -0
- package/node_modules/@sap/cds-mtxs/srv/plugins/hana/serverless.js +17 -20
- package/node_modules/@sap/cds-mtxs/srv/plugins/hana/srv-mgr-v2.js +511 -0
- package/node_modules/@sap/cds-mtxs/srv/plugins/hana/srv-mgr.js +11 -4
- package/node_modules/@sap/cds-mtxs/srv/plugins/hana/tms.js +8 -0
- package/node_modules/@sap/cds-mtxs/srv/plugins/hana.js +27 -18
- package/node_modules/@sap/cds-mtxs/srv/worker/job-worker-pool.js +1 -1
- package/node_modules/@sap/cds-mtxs/srv/worker/job-worker.js +1 -1
- package/node_modules/chownr/LICENSE.md +63 -0
- package/node_modules/chownr/README.md +3 -0
- package/node_modules/chownr/dist/commonjs/index.d.ts +3 -0
- package/node_modules/chownr/dist/commonjs/index.d.ts.map +1 -0
- package/node_modules/chownr/dist/commonjs/index.js +93 -0
- package/node_modules/chownr/dist/commonjs/index.js.map +1 -0
- package/node_modules/chownr/dist/commonjs/package.json +3 -0
- package/node_modules/chownr/dist/esm/index.d.ts +3 -0
- package/node_modules/chownr/dist/esm/index.d.ts.map +1 -0
- package/node_modules/chownr/dist/esm/index.js +85 -0
- package/node_modules/chownr/dist/esm/index.js.map +1 -0
- package/node_modules/chownr/dist/esm/package.json +3 -0
- package/node_modules/chownr/package.json +69 -0
- package/node_modules/content-disposition/README.md +105 -35
- package/node_modules/content-disposition/dist/index.d.ts +72 -0
- package/node_modules/content-disposition/dist/index.js +388 -0
- package/node_modules/content-disposition/dist/index.js.map +1 -0
- package/node_modules/content-disposition/package.json +31 -19
- package/node_modules/content-type/README.md +34 -57
- package/node_modules/content-type/package.json +35 -25
- package/node_modules/express/Readme.md +15 -9
- package/node_modules/express/lib/application.js +2 -2
- package/node_modules/express/lib/request.js +32 -19
- package/node_modules/express/lib/response.js +27 -30
- package/node_modules/express/package.json +10 -10
- package/node_modules/handlebars/bin/handlebars +1 -1
- package/node_modules/handlebars/dist/amd/handlebars/base.js +2 -2
- package/node_modules/handlebars/dist/amd/handlebars/compiler/base.js +2 -59
- package/node_modules/handlebars/dist/amd/handlebars/compiler/code-gen.js +68 -5
- package/node_modules/handlebars/dist/amd/handlebars/compiler/compiler.js +160 -19
- package/node_modules/handlebars/dist/amd/handlebars/compiler/javascript-compiler.js +23 -7
- package/node_modules/handlebars/dist/amd/handlebars/compiler/node-types.js +12 -0
- package/node_modules/handlebars/dist/amd/handlebars/compiler/visitor.js +26 -7
- package/node_modules/handlebars/dist/amd/handlebars/compiler/whitespace-control.js +9 -4
- package/node_modules/handlebars/dist/amd/handlebars/exception.js +8 -4
- package/node_modules/handlebars/dist/amd/handlebars/helpers/each.js +40 -14
- package/node_modules/handlebars/dist/amd/handlebars/internal/proto-access.js +21 -1
- package/node_modules/handlebars/dist/amd/handlebars/runtime.js +24 -4
- package/node_modules/handlebars/dist/amd/handlebars/utils.js +4 -3
- package/node_modules/handlebars/dist/amd/precompiler.js +13 -7
- package/node_modules/handlebars/dist/cjs/handlebars/base.js +2 -2
- package/node_modules/handlebars/dist/cjs/handlebars/compiler/base.js +1 -60
- package/node_modules/handlebars/dist/cjs/handlebars/compiler/code-gen.js +64 -4
- package/node_modules/handlebars/dist/cjs/handlebars/compiler/compiler.js +161 -18
- package/node_modules/handlebars/dist/cjs/handlebars/compiler/javascript-compiler.js +23 -7
- package/node_modules/handlebars/dist/cjs/handlebars/compiler/node-types.js +10 -0
- package/node_modules/handlebars/dist/cjs/handlebars/compiler/visitor.js +29 -6
- package/node_modules/handlebars/dist/cjs/handlebars/compiler/whitespace-control.js +9 -4
- package/node_modules/handlebars/dist/cjs/handlebars/exception.js +8 -4
- package/node_modules/handlebars/dist/cjs/handlebars/helpers/each.js +40 -14
- package/node_modules/handlebars/dist/cjs/handlebars/internal/proto-access.js +21 -1
- package/node_modules/handlebars/dist/cjs/handlebars/runtime.js +24 -4
- package/node_modules/handlebars/dist/cjs/handlebars/utils.js +4 -3
- package/node_modules/handlebars/dist/cjs/precompiler.js +14 -6
- package/node_modules/handlebars/dist/handlebars.amd.js +401 -130
- package/node_modules/handlebars/dist/handlebars.amd.min.js +4 -4
- package/node_modules/handlebars/dist/handlebars.js +396 -125
- package/node_modules/handlebars/dist/handlebars.min.js +4 -4
- package/node_modules/handlebars/dist/handlebars.runtime.amd.js +100 -29
- package/node_modules/handlebars/dist/handlebars.runtime.amd.min.js +2 -2
- package/node_modules/handlebars/dist/handlebars.runtime.js +94 -23
- package/node_modules/handlebars/dist/handlebars.runtime.min.js +2 -2
- package/node_modules/handlebars/lib/handlebars/base.js +1 -1
- package/node_modules/handlebars/lib/handlebars/compiler/base.js +0 -67
- package/node_modules/handlebars/lib/handlebars/compiler/code-gen.js +65 -11
- package/node_modules/handlebars/lib/handlebars/compiler/compiler.js +164 -23
- package/node_modules/handlebars/lib/handlebars/compiler/javascript-compiler.js +23 -7
- package/node_modules/handlebars/lib/handlebars/compiler/node-types.js +24 -0
- package/node_modules/handlebars/lib/handlebars/compiler/visitor.js +29 -5
- package/node_modules/handlebars/lib/handlebars/compiler/whitespace-control.js +16 -5
- package/node_modules/handlebars/lib/handlebars/exception.js +7 -3
- package/node_modules/handlebars/lib/handlebars/helpers/each.js +39 -16
- package/node_modules/handlebars/lib/handlebars/internal/proto-access.js +22 -0
- package/node_modules/handlebars/lib/handlebars/runtime.js +36 -4
- package/node_modules/handlebars/lib/handlebars/utils.js +3 -2
- package/node_modules/handlebars/lib/precompiler.js +14 -5
- package/node_modules/handlebars/package.json +2 -2
- package/node_modules/handlebars/release-notes.md +20 -1
- package/node_modules/handlebars/types/index.d.ts +8 -0
- package/node_modules/hdb/cfg/VERSION +1 -1
- package/node_modules/hdb/lib/Client.js +6 -2
- package/node_modules/hdb/lib/protocol/ClientInfo.js +28 -15
- package/node_modules/hdb/lib/protocol/Connection.js +30 -3
- package/node_modules/hdb/lib/protocol/Writer.js +2 -2
- package/node_modules/hdb/lib/protocol/common/ConnectOption.js +2 -0
- package/node_modules/hdb/lib/protocol/common/ConnectOptionFlagSet1.js +18 -0
- package/node_modules/hdb/lib/protocol/common/ConnectOptionType.js +2 -0
- package/node_modules/hdb/lib/protocol/common/Constants.js +1 -0
- package/node_modules/hdb/lib/protocol/common/MessageType.js +3 -2
- package/node_modules/hdb/lib/protocol/common/PartKind.js +2 -1
- package/node_modules/hdb/lib/protocol/common/index.js +1 -0
- package/node_modules/hdb/lib/protocol/data/TextList.js +25 -17
- package/node_modules/hdb/lib/protocol/data/index.js +1 -0
- package/node_modules/hdb/lib/protocol/part/ConnectOptions.js +7 -0
- package/node_modules/hdb/lib/protocol/request/index.js +7 -0
- package/node_modules/hdb/package.json +1 -2
- package/node_modules/livereload-js/.github/workflows/main.yml +4 -4
- package/node_modules/livereload-js/README.md +3 -3
- package/node_modules/livereload-js/dist/livereload.js +839 -2742
- package/node_modules/livereload-js/dist/livereload.min.js +1 -1
- package/node_modules/livereload-js/package.json +11 -11
- package/node_modules/minipass/LICENSE.md +55 -0
- package/node_modules/minipass/README.md +825 -0
- package/node_modules/minipass/dist/commonjs/index.d.ts +545 -0
- package/node_modules/minipass/dist/commonjs/index.d.ts.map +1 -0
- package/node_modules/minipass/dist/commonjs/index.js +1038 -0
- package/node_modules/minipass/dist/commonjs/index.js.map +1 -0
- package/node_modules/minipass/dist/commonjs/package.json +3 -0
- package/node_modules/minipass/dist/esm/index.d.ts +545 -0
- package/node_modules/minipass/dist/esm/index.d.ts.map +1 -0
- package/node_modules/minipass/dist/esm/index.js +1020 -0
- package/node_modules/minipass/dist/esm/index.js.map +1 -0
- package/node_modules/minipass/dist/esm/package.json +3 -0
- package/node_modules/minipass/package.json +77 -0
- package/node_modules/minizlib/LICENSE +26 -0
- package/node_modules/minizlib/README.md +64 -0
- package/node_modules/minizlib/dist/commonjs/constants.d.ts +2 -0
- package/node_modules/minizlib/dist/commonjs/constants.d.ts.map +1 -0
- package/node_modules/minizlib/dist/commonjs/constants.js +123 -0
- package/node_modules/minizlib/dist/commonjs/constants.js.map +1 -0
- package/node_modules/minizlib/dist/commonjs/index.d.ts +99 -0
- package/node_modules/minizlib/dist/commonjs/index.d.ts.map +1 -0
- package/node_modules/minizlib/dist/commonjs/index.js +416 -0
- package/node_modules/minizlib/dist/commonjs/index.js.map +1 -0
- package/node_modules/minizlib/dist/commonjs/package.json +3 -0
- package/node_modules/minizlib/dist/esm/constants.d.ts +2 -0
- package/node_modules/minizlib/dist/esm/constants.d.ts.map +1 -0
- package/node_modules/minizlib/dist/esm/constants.js +117 -0
- package/node_modules/minizlib/dist/esm/constants.js.map +1 -0
- package/node_modules/minizlib/dist/esm/index.d.ts +99 -0
- package/node_modules/minizlib/dist/esm/index.d.ts.map +1 -0
- package/node_modules/minizlib/dist/esm/index.js +363 -0
- package/node_modules/minizlib/dist/esm/index.js.map +1 -0
- package/node_modules/minizlib/dist/esm/package.json +3 -0
- package/node_modules/minizlib/package.json +80 -0
- package/node_modules/proxy-addr/HISTORY.md +60 -54
- package/node_modules/proxy-addr/README.md +1 -1
- package/node_modules/proxy-addr/index.js +32 -0
- package/node_modules/proxy-addr/package.json +8 -4
- package/node_modules/qs/.github/THREAT_MODEL.md +4 -2
- package/node_modules/qs/CHANGELOG.md +38 -14
- package/node_modules/qs/README.md +31 -3
- package/node_modules/qs/dist/qs.js +20 -20
- package/node_modules/qs/lib/parse.js +94 -4
- package/node_modules/qs/lib/stringify.js +4 -4
- package/node_modules/qs/lib/utils.js +130 -6
- package/node_modules/qs/package.json +4 -4
- package/node_modules/qs/test/parse.js +174 -0
- package/node_modules/qs/test/stringify.js +263 -33
- package/node_modules/qs/test/utils.js +184 -0
- package/node_modules/tar/LICENSE.md +55 -0
- package/node_modules/tar/README.md +1233 -0
- package/node_modules/tar/dist/commonjs/create.d.ts +3 -0
- package/node_modules/tar/dist/commonjs/create.d.ts.map +1 -0
- package/node_modules/tar/dist/commonjs/create.js +82 -0
- package/node_modules/tar/dist/commonjs/create.js.map +1 -0
- package/node_modules/tar/dist/commonjs/cwd-error.d.ts +8 -0
- package/node_modules/tar/dist/commonjs/cwd-error.d.ts.map +1 -0
- package/node_modules/tar/dist/commonjs/cwd-error.js +18 -0
- package/node_modules/tar/dist/commonjs/cwd-error.js.map +1 -0
- package/node_modules/tar/dist/commonjs/extract.d.ts +3 -0
- package/node_modules/tar/dist/commonjs/extract.d.ts.map +1 -0
- package/node_modules/tar/dist/commonjs/extract.js +88 -0
- package/node_modules/tar/dist/commonjs/extract.js.map +1 -0
- package/node_modules/tar/dist/commonjs/get-write-flag.d.ts +2 -0
- package/node_modules/tar/dist/commonjs/get-write-flag.d.ts.map +1 -0
- package/node_modules/tar/dist/commonjs/get-write-flag.js +32 -0
- package/node_modules/tar/dist/commonjs/get-write-flag.js.map +1 -0
- package/node_modules/tar/dist/commonjs/header.d.ts +53 -0
- package/node_modules/tar/dist/commonjs/header.d.ts.map +1 -0
- package/node_modules/tar/dist/commonjs/header.js +348 -0
- package/node_modules/tar/dist/commonjs/header.js.map +1 -0
- package/node_modules/tar/dist/commonjs/index.d.ts +20 -0
- package/node_modules/tar/dist/commonjs/index.d.ts.map +1 -0
- package/node_modules/tar/dist/commonjs/index.js +64 -0
- package/node_modules/tar/dist/commonjs/index.js.map +1 -0
- package/node_modules/tar/dist/commonjs/index.min.js +4 -0
- package/node_modules/tar/dist/commonjs/index.min.js.map +7 -0
- package/node_modules/tar/dist/commonjs/large-numbers.d.ts +3 -0
- package/node_modules/tar/dist/commonjs/large-numbers.d.ts.map +1 -0
- package/node_modules/tar/dist/commonjs/large-numbers.js +99 -0
- package/node_modules/tar/dist/commonjs/large-numbers.js.map +1 -0
- package/node_modules/tar/dist/commonjs/list.d.ts +7 -0
- package/node_modules/tar/dist/commonjs/list.d.ts.map +1 -0
- package/node_modules/tar/dist/commonjs/list.js +153 -0
- package/node_modules/tar/dist/commonjs/list.js.map +1 -0
- package/node_modules/tar/dist/commonjs/make-command.d.ts +49 -0
- package/node_modules/tar/dist/commonjs/make-command.d.ts.map +1 -0
- package/node_modules/tar/dist/commonjs/make-command.js +52 -0
- package/node_modules/tar/dist/commonjs/make-command.js.map +1 -0
- package/node_modules/tar/dist/commonjs/mkdir.d.ts +25 -0
- package/node_modules/tar/dist/commonjs/mkdir.d.ts.map +1 -0
- package/node_modules/tar/dist/commonjs/mkdir.js +187 -0
- package/node_modules/tar/dist/commonjs/mkdir.js.map +1 -0
- package/node_modules/tar/dist/commonjs/mode-fix.d.ts +2 -0
- package/node_modules/tar/dist/commonjs/mode-fix.d.ts.map +1 -0
- package/node_modules/tar/dist/commonjs/mode-fix.js +29 -0
- package/node_modules/tar/dist/commonjs/mode-fix.js.map +1 -0
- package/node_modules/tar/dist/commonjs/normalize-unicode.d.ts +2 -0
- package/node_modules/tar/dist/commonjs/normalize-unicode.d.ts.map +1 -0
- package/node_modules/tar/dist/commonjs/normalize-unicode.js +38 -0
- package/node_modules/tar/dist/commonjs/normalize-unicode.js.map +1 -0
- package/node_modules/tar/dist/commonjs/normalize-windows-path.d.ts +2 -0
- package/node_modules/tar/dist/commonjs/normalize-windows-path.d.ts.map +1 -0
- package/node_modules/tar/dist/commonjs/normalize-windows-path.js +12 -0
- package/node_modules/tar/dist/commonjs/normalize-windows-path.js.map +1 -0
- package/node_modules/tar/dist/commonjs/options.d.ts +604 -0
- package/node_modules/tar/dist/commonjs/options.d.ts.map +1 -0
- package/node_modules/tar/dist/commonjs/options.js +66 -0
- package/node_modules/tar/dist/commonjs/options.js.map +1 -0
- package/node_modules/tar/dist/commonjs/pack.d.ts +105 -0
- package/node_modules/tar/dist/commonjs/pack.d.ts.map +1 -0
- package/node_modules/tar/dist/commonjs/pack.js +544 -0
- package/node_modules/tar/dist/commonjs/pack.js.map +1 -0
- package/node_modules/tar/dist/commonjs/package.json +3 -0
- package/node_modules/tar/dist/commonjs/parse.d.ts +92 -0
- package/node_modules/tar/dist/commonjs/parse.d.ts.map +1 -0
- package/node_modules/tar/dist/commonjs/parse.js +655 -0
- package/node_modules/tar/dist/commonjs/parse.js.map +1 -0
- package/node_modules/tar/dist/commonjs/path-reservations.d.ts +11 -0
- package/node_modules/tar/dist/commonjs/path-reservations.d.ts.map +1 -0
- package/node_modules/tar/dist/commonjs/path-reservations.js +170 -0
- package/node_modules/tar/dist/commonjs/path-reservations.js.map +1 -0
- package/node_modules/tar/dist/commonjs/pax.d.ts +26 -0
- package/node_modules/tar/dist/commonjs/pax.d.ts.map +1 -0
- package/node_modules/tar/dist/commonjs/pax.js +182 -0
- package/node_modules/tar/dist/commonjs/pax.js.map +1 -0
- package/node_modules/tar/dist/commonjs/process-umask.d.ts +2 -0
- package/node_modules/tar/dist/commonjs/process-umask.d.ts.map +1 -0
- package/node_modules/tar/dist/commonjs/process-umask.js +7 -0
- package/node_modules/tar/dist/commonjs/process-umask.js.map +1 -0
- package/node_modules/tar/dist/commonjs/read-entry.d.ts +36 -0
- package/node_modules/tar/dist/commonjs/read-entry.d.ts.map +1 -0
- package/node_modules/tar/dist/commonjs/read-entry.js +136 -0
- package/node_modules/tar/dist/commonjs/read-entry.js.map +1 -0
- package/node_modules/tar/dist/commonjs/replace.d.ts +2 -0
- package/node_modules/tar/dist/commonjs/replace.d.ts.map +1 -0
- package/node_modules/tar/dist/commonjs/replace.js +227 -0
- package/node_modules/tar/dist/commonjs/replace.js.map +1 -0
- package/node_modules/tar/dist/commonjs/strip-absolute-path.d.ts +2 -0
- package/node_modules/tar/dist/commonjs/strip-absolute-path.d.ts.map +1 -0
- package/node_modules/tar/dist/commonjs/strip-absolute-path.js +29 -0
- package/node_modules/tar/dist/commonjs/strip-absolute-path.js.map +1 -0
- package/node_modules/tar/dist/commonjs/strip-trailing-slashes.d.ts +2 -0
- package/node_modules/tar/dist/commonjs/strip-trailing-slashes.d.ts.map +1 -0
- package/node_modules/tar/dist/commonjs/strip-trailing-slashes.js +18 -0
- package/node_modules/tar/dist/commonjs/strip-trailing-slashes.js.map +1 -0
- package/node_modules/tar/dist/commonjs/symlink-error.d.ts +9 -0
- package/node_modules/tar/dist/commonjs/symlink-error.d.ts.map +1 -0
- package/node_modules/tar/dist/commonjs/symlink-error.js +19 -0
- package/node_modules/tar/dist/commonjs/symlink-error.js.map +1 -0
- package/node_modules/tar/dist/commonjs/types.d.ts +16 -0
- package/node_modules/tar/dist/commonjs/types.d.ts.map +1 -0
- package/node_modules/tar/dist/commonjs/types.js +70 -0
- package/node_modules/tar/dist/commonjs/types.js.map +1 -0
- package/node_modules/tar/dist/commonjs/unpack.d.ts +101 -0
- package/node_modules/tar/dist/commonjs/unpack.d.ts.map +1 -0
- package/node_modules/tar/dist/commonjs/unpack.js +932 -0
- package/node_modules/tar/dist/commonjs/unpack.js.map +1 -0
- package/node_modules/tar/dist/commonjs/update.d.ts +2 -0
- package/node_modules/tar/dist/commonjs/update.d.ts.map +1 -0
- package/node_modules/tar/dist/commonjs/update.js +33 -0
- package/node_modules/tar/dist/commonjs/update.js.map +1 -0
- package/node_modules/tar/dist/commonjs/warn-method.d.ts +24 -0
- package/node_modules/tar/dist/commonjs/warn-method.d.ts.map +1 -0
- package/node_modules/tar/dist/commonjs/warn-method.js +31 -0
- package/node_modules/tar/dist/commonjs/warn-method.js.map +1 -0
- package/node_modules/tar/dist/commonjs/winchars.d.ts +3 -0
- package/node_modules/tar/dist/commonjs/winchars.d.ts.map +1 -0
- package/node_modules/tar/dist/commonjs/winchars.js +14 -0
- package/node_modules/tar/dist/commonjs/winchars.js.map +1 -0
- package/node_modules/tar/dist/commonjs/write-entry.d.ts +129 -0
- package/node_modules/tar/dist/commonjs/write-entry.d.ts.map +1 -0
- package/node_modules/tar/dist/commonjs/write-entry.js +698 -0
- package/node_modules/tar/dist/commonjs/write-entry.js.map +1 -0
- package/node_modules/tar/dist/esm/create.d.ts +3 -0
- package/node_modules/tar/dist/esm/create.d.ts.map +1 -0
- package/node_modules/tar/dist/esm/create.js +76 -0
- package/node_modules/tar/dist/esm/create.js.map +1 -0
- package/node_modules/tar/dist/esm/cwd-error.d.ts +8 -0
- package/node_modules/tar/dist/esm/cwd-error.d.ts.map +1 -0
- package/node_modules/tar/dist/esm/cwd-error.js +14 -0
- package/node_modules/tar/dist/esm/cwd-error.js.map +1 -0
- package/node_modules/tar/dist/esm/extract.d.ts +3 -0
- package/node_modules/tar/dist/esm/extract.d.ts.map +1 -0
- package/node_modules/tar/dist/esm/extract.js +49 -0
- package/node_modules/tar/dist/esm/extract.js.map +1 -0
- package/node_modules/tar/dist/esm/get-write-flag.d.ts +2 -0
- package/node_modules/tar/dist/esm/get-write-flag.d.ts.map +1 -0
- package/node_modules/tar/dist/esm/get-write-flag.js +26 -0
- package/node_modules/tar/dist/esm/get-write-flag.js.map +1 -0
- package/node_modules/tar/dist/esm/header.d.ts +53 -0
- package/node_modules/tar/dist/esm/header.d.ts.map +1 -0
- package/node_modules/tar/dist/esm/header.js +311 -0
- package/node_modules/tar/dist/esm/header.js.map +1 -0
- package/node_modules/tar/dist/esm/index.d.ts +20 -0
- package/node_modules/tar/dist/esm/index.d.ts.map +1 -0
- package/node_modules/tar/dist/esm/index.js +20 -0
- package/node_modules/tar/dist/esm/index.js.map +1 -0
- package/node_modules/tar/dist/esm/index.min.js +4 -0
- package/node_modules/tar/dist/esm/index.min.js.map +7 -0
- package/node_modules/tar/dist/esm/large-numbers.d.ts +3 -0
- package/node_modules/tar/dist/esm/large-numbers.d.ts.map +1 -0
- package/node_modules/tar/dist/esm/large-numbers.js +94 -0
- package/node_modules/tar/dist/esm/large-numbers.js.map +1 -0
- package/node_modules/tar/dist/esm/list.d.ts +7 -0
- package/node_modules/tar/dist/esm/list.d.ts.map +1 -0
- package/node_modules/tar/dist/esm/list.js +113 -0
- package/node_modules/tar/dist/esm/list.js.map +1 -0
- package/node_modules/tar/dist/esm/make-command.d.ts +49 -0
- package/node_modules/tar/dist/esm/make-command.d.ts.map +1 -0
- package/node_modules/tar/dist/esm/make-command.js +48 -0
- package/node_modules/tar/dist/esm/make-command.js.map +1 -0
- package/node_modules/tar/dist/esm/mkdir.d.ts +25 -0
- package/node_modules/tar/dist/esm/mkdir.d.ts.map +1 -0
- package/node_modules/tar/dist/esm/mkdir.js +179 -0
- package/node_modules/tar/dist/esm/mkdir.js.map +1 -0
- package/node_modules/tar/dist/esm/mode-fix.d.ts +2 -0
- package/node_modules/tar/dist/esm/mode-fix.d.ts.map +1 -0
- package/node_modules/tar/dist/esm/mode-fix.js +25 -0
- package/node_modules/tar/dist/esm/mode-fix.js.map +1 -0
- package/node_modules/tar/dist/esm/normalize-unicode.d.ts +2 -0
- package/node_modules/tar/dist/esm/normalize-unicode.d.ts.map +1 -0
- package/node_modules/tar/dist/esm/normalize-unicode.js +34 -0
- package/node_modules/tar/dist/esm/normalize-unicode.js.map +1 -0
- package/node_modules/tar/dist/esm/normalize-windows-path.d.ts +2 -0
- package/node_modules/tar/dist/esm/normalize-windows-path.d.ts.map +1 -0
- package/node_modules/tar/dist/esm/normalize-windows-path.js +9 -0
- package/node_modules/tar/dist/esm/normalize-windows-path.js.map +1 -0
- package/node_modules/tar/dist/esm/options.d.ts +604 -0
- package/node_modules/tar/dist/esm/options.d.ts.map +1 -0
- package/node_modules/tar/dist/esm/options.js +54 -0
- package/node_modules/tar/dist/esm/options.js.map +1 -0
- package/node_modules/tar/dist/esm/pack.d.ts +105 -0
- package/node_modules/tar/dist/esm/pack.d.ts.map +1 -0
- package/node_modules/tar/dist/esm/pack.js +502 -0
- package/node_modules/tar/dist/esm/pack.js.map +1 -0
- package/node_modules/tar/dist/esm/package.json +3 -0
- package/node_modules/tar/dist/esm/parse.d.ts +92 -0
- package/node_modules/tar/dist/esm/parse.d.ts.map +1 -0
- package/node_modules/tar/dist/esm/parse.js +651 -0
- package/node_modules/tar/dist/esm/parse.js.map +1 -0
- package/node_modules/tar/dist/esm/path-reservations.d.ts +11 -0
- package/node_modules/tar/dist/esm/path-reservations.d.ts.map +1 -0
- package/node_modules/tar/dist/esm/path-reservations.js +166 -0
- package/node_modules/tar/dist/esm/path-reservations.js.map +1 -0
- package/node_modules/tar/dist/esm/pax.d.ts +26 -0
- package/node_modules/tar/dist/esm/pax.d.ts.map +1 -0
- package/node_modules/tar/dist/esm/pax.js +178 -0
- package/node_modules/tar/dist/esm/pax.js.map +1 -0
- package/node_modules/tar/dist/esm/process-umask.d.ts +2 -0
- package/node_modules/tar/dist/esm/process-umask.d.ts.map +1 -0
- package/node_modules/tar/dist/esm/process-umask.js +3 -0
- package/node_modules/tar/dist/esm/process-umask.js.map +1 -0
- package/node_modules/tar/dist/esm/read-entry.d.ts +36 -0
- package/node_modules/tar/dist/esm/read-entry.d.ts.map +1 -0
- package/node_modules/tar/dist/esm/read-entry.js +132 -0
- package/node_modules/tar/dist/esm/read-entry.js.map +1 -0
- package/node_modules/tar/dist/esm/replace.d.ts +2 -0
- package/node_modules/tar/dist/esm/replace.d.ts.map +1 -0
- package/node_modules/tar/dist/esm/replace.js +221 -0
- package/node_modules/tar/dist/esm/replace.js.map +1 -0
- package/node_modules/tar/dist/esm/strip-absolute-path.d.ts +2 -0
- package/node_modules/tar/dist/esm/strip-absolute-path.d.ts.map +1 -0
- package/node_modules/tar/dist/esm/strip-absolute-path.js +25 -0
- package/node_modules/tar/dist/esm/strip-absolute-path.js.map +1 -0
- package/node_modules/tar/dist/esm/strip-trailing-slashes.d.ts +2 -0
- package/node_modules/tar/dist/esm/strip-trailing-slashes.d.ts.map +1 -0
- package/node_modules/tar/dist/esm/strip-trailing-slashes.js +14 -0
- package/node_modules/tar/dist/esm/strip-trailing-slashes.js.map +1 -0
- package/node_modules/tar/dist/esm/symlink-error.d.ts +9 -0
- package/node_modules/tar/dist/esm/symlink-error.d.ts.map +1 -0
- package/node_modules/tar/dist/esm/symlink-error.js +15 -0
- package/node_modules/tar/dist/esm/symlink-error.js.map +1 -0
- package/node_modules/tar/dist/esm/types.d.ts +16 -0
- package/node_modules/tar/dist/esm/types.d.ts.map +1 -0
- package/node_modules/tar/dist/esm/types.js +65 -0
- package/node_modules/tar/dist/esm/types.js.map +1 -0
- package/node_modules/tar/dist/esm/unpack.d.ts +101 -0
- package/node_modules/tar/dist/esm/unpack.d.ts.map +1 -0
- package/node_modules/tar/dist/esm/unpack.js +891 -0
- package/node_modules/tar/dist/esm/unpack.js.map +1 -0
- package/node_modules/tar/dist/esm/update.d.ts +2 -0
- package/node_modules/tar/dist/esm/update.d.ts.map +1 -0
- package/node_modules/tar/dist/esm/update.js +30 -0
- package/node_modules/tar/dist/esm/update.js.map +1 -0
- package/node_modules/tar/dist/esm/warn-method.d.ts +24 -0
- package/node_modules/tar/dist/esm/warn-method.d.ts.map +1 -0
- package/node_modules/tar/dist/esm/warn-method.js +27 -0
- package/node_modules/tar/dist/esm/warn-method.js.map +1 -0
- package/node_modules/tar/dist/esm/winchars.d.ts +3 -0
- package/node_modules/tar/dist/esm/winchars.d.ts.map +1 -0
- package/node_modules/tar/dist/esm/winchars.js +9 -0
- package/node_modules/tar/dist/esm/winchars.js.map +1 -0
- package/node_modules/tar/dist/esm/write-entry.d.ts +129 -0
- package/node_modules/tar/dist/esm/write-entry.d.ts.map +1 -0
- package/node_modules/tar/dist/esm/write-entry.js +656 -0
- package/node_modules/tar/dist/esm/write-entry.js.map +1 -0
- package/node_modules/tar/package.json +298 -0
- package/node_modules/ws/lib/websocket.js +17 -3
- package/node_modules/ws/package.json +1 -1
- package/node_modules/yallist/LICENSE.md +63 -0
- package/node_modules/yallist/README.md +205 -0
- package/node_modules/yallist/dist/commonjs/index.d.ts +39 -0
- package/node_modules/yallist/dist/commonjs/index.d.ts.map +1 -0
- package/node_modules/yallist/dist/commonjs/index.js +384 -0
- package/node_modules/yallist/dist/commonjs/index.js.map +1 -0
- package/node_modules/yallist/dist/commonjs/package.json +3 -0
- package/node_modules/yallist/dist/esm/index.d.ts +39 -0
- package/node_modules/yallist/dist/esm/index.d.ts.map +1 -0
- package/node_modules/yallist/dist/esm/index.js +379 -0
- package/node_modules/yallist/dist/esm/index.js.map +1 -0
- package/node_modules/yallist/dist/esm/package.json +3 -0
- package/node_modules/yallist/package.json +68 -0
- package/node_modules/yaml/browser/dist/compose/resolve-flow-scalar.js +19 -18
- package/node_modules/yaml/browser/dist/nodes/Alias.js +25 -23
- package/node_modules/yaml/dist/compose/resolve-flow-scalar.js +19 -18
- package/node_modules/yaml/dist/nodes/Alias.js +25 -23
- package/node_modules/yaml/package.json +1 -1
- package/package.json +7 -1
- package/bin/completion/templates/cds-tmpl.fish +0 -65
- package/bin/completion/templates/cds-tmpl.ps1 +0 -217
- package/bin/completion/templates/cds-tmpl.sh +0 -93
- package/bin/completion/templates/cds-tmpl.zsh +0 -74
- package/node_modules/@cap-js/db-service/lib/recursion-guard.js +0 -40
- package/node_modules/@sap/cds/lib/env/cds-requires.js +0 -326
- package/node_modules/@sap/cds-mtxs/srv/bootstrap.cds +0 -2
- package/node_modules/@sap/cds-mtxs/srv/bootstrap.js +0 -33
- package/node_modules/body-parser/node_modules/content-type/LICENSE +0 -22
- package/node_modules/body-parser/node_modules/content-type/README.md +0 -71
- package/node_modules/body-parser/node_modules/content-type/package.json +0 -52
- package/node_modules/content-disposition/index.js +0 -536
- package/node_modules/content-type/HISTORY.md +0 -29
- package/node_modules/content-type/index.js +0 -225
- package/node_modules/negotiator/node_modules/content-type/LICENSE +0 -22
- package/node_modules/negotiator/node_modules/content-type/README.md +0 -71
- package/node_modules/negotiator/node_modules/content-type/dist/index.d.ts +0 -46
- package/node_modules/negotiator/node_modules/content-type/dist/index.js +0 -176
- package/node_modules/negotiator/node_modules/content-type/dist/index.js.map +0 -1
- package/node_modules/negotiator/node_modules/content-type/package.json +0 -52
- package/node_modules/type-is/node_modules/content-type/LICENSE +0 -22
- package/node_modules/type-is/node_modules/content-type/README.md +0 -71
- package/node_modules/type-is/node_modules/content-type/dist/index.d.ts +0 -46
- package/node_modules/type-is/node_modules/content-type/dist/index.js +0 -176
- package/node_modules/type-is/node_modules/content-type/dist/index.js.map +0 -1
- package/node_modules/type-is/node_modules/content-type/package.json +0 -52
- /package/lib/init/template/react/files/{vite.config.js.hbs → vite.config.{{extension}}.hbs} +0 -0
- /package/lib/init/template/vue/files/src/{main.js → main.{{extension}}.hbs} +0 -0
- /package/lib/init/template/vue/files/{vite.config.js.hbs → vite.config.{{extension}}.hbs} +0 -0
- /package/{lib/import/openapi → node_modules/@cap-js/openapi/lib/import}/utilities.js +0 -0
- /package/node_modules/{body-parser/node_modules/content-type → content-type}/dist/index.d.ts +0 -0
- /package/node_modules/{body-parser/node_modules/content-type → content-type}/dist/index.js +0 -0
- /package/node_modules/{body-parser/node_modules/content-type → content-type}/dist/index.js.map +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import*as fluent from"../lib/xl/fluent.js";import{SELECT}from"../lib/ql/select.js";import{INSERT}from"../lib/ql/insert.js";import{UPSERT}from"../lib/ql/insert.js";import{UPDATE}from"../lib/ql/update.js";import{DELETE}from"../lib/ql/delete.js";import{CALL}from"../lib/ql/call-action.js";class peg$SyntaxError extends SyntaxError{constructor(t,e,r,n){super(t),this.expected=e,this.found=r,this.location=n,this.name="SyntaxError"}format(t){let e="Error: "+this.message;if(this.location){let r=null;const n=t.find(t=>t.source===this.location.source);n&&(r=n.text.split(/\r\n|\n|\r/g));const o=this.location.start,s=this.location.source&&"function"==typeof this.location.source.offset?this.location.source.offset(o):o,u=this.location.source+":"+s.line+":"+s.column;if(r){const t=this.location.end,n="".padEnd(s.line.toString().length," "),l=r[o.line-1],i=(o.line===t.line?t.column:l.length+1)-o.column||1;e+="\n --\x3e "+u+"\n"+n+" |\n"+s.line+" | "+l+"\n"+n+" | "+"".padEnd(o.column-1," ")+"".padEnd(i,"^")}else e+="\n at "+u}return e}static buildMessage(t,e){function r(t){return t.codePointAt(0).toString(16).toUpperCase()}const n=Object.prototype.hasOwnProperty.call(RegExp.prototype,"unicode")?new RegExp("[\\p{C}\\p{Mn}\\p{Mc}]","gu"):null;function o(t){return n?t.replace(n,t=>"\\u{"+r(t)+"}"):t}function s(t){return o(t.replace(/\\/g,"\\\\").replace(/"/g,'\\"').replace(/\0/g,"\\0").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/[\x00-\x0F]/g,t=>"\\x0"+r(t)).replace(/[\x10-\x1F\x7F-\x9F]/g,t=>"\\x"+r(t)))}function u(t){return o(t.replace(/\\/g,"\\\\").replace(/\]/g,"\\]").replace(/\^/g,"\\^").replace(/-/g,"\\-").replace(/\0/g,"\\0").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/[\x00-\x0F]/g,t=>"\\x0"+r(t)).replace(/[\x10-\x1F\x7F-\x9F]/g,t=>"\\x"+r(t)))}const l={literal:t=>'"'+s(t.text)+'"',class(t){const e=t.parts.map(t=>Array.isArray(t)?u(t[0])+"-"+u(t[1]):u(t));return"["+(t.inverted?"^":"")+e.join("")+"]"+(t.unicode?"u":"")},any:()=>"any character",end:()=>"end of input",other:t=>t.description};function i(t){return l[t.type](t)}return"Expected "+function(t){const e=t.map(i);if(e.sort(),e.length>0){let t=1;for(let r=1;r<e.length;r++)e[r-1]!==e[r]&&(e[t]=e[r],t++);e.length=t}switch(e.length){case 1:return e[0];case 2:return e[0]+" or "+e[1];default:return e.slice(0,-1).join(", ")+", or "+e[e.length-1]}}(t)+" but "+function(t){return t?'"'+s(t)+'"':"end of input"}(e)+" found."}}function peg$parse(t,e){const r={},n=(e=void 0!==e?e:{}).grammarSource,o={CQL:kr,subject:cn,columns:Jr,values:Ln,ref:pn,val:dn,expr:fn,set:nn,with:rn,where:Xr,groupBy:tn,orderBy:en};let s=kr;const u="select",l="stream",i="localized",a="distinct",c="one",f="from",h="where",p="group by",d="having",C="order by",b="limit",g="offset",w="as",L="*",A="[",m="]",E="asc",x="desc",v="insert",y="upsert",_="into",S="entries",T="columns",$="rows",R="values",F="update",I="entity",j="with",O="set",N="=",P="{",U=":",D="}",z="delete",B="call",M="action",q="function",Z="![",H="#",W="?",Y="and",k="or",G="in",Q="between",V="like",J="exists",K="contains",X="case",tt="when",et="then",rt="else",nt="end",ot="is",st="not",ut="null",lt="empty",it="-",at=".",ct="e",ft="'",ht="''",pt="\\'",dt="true",Ct="false",bt="$user",gt="(",wt=")",Lt=",",At="//",mt="--",Et=/^[A-Za-z_$]/,xt=/^[A-Za-z0-9_$]/,vt=/^[^\]]/,yt=/^[!=><+\-*\/%&|\^~]/,_t=/^[0-9]/,St=/^[^']/,Tt=/^[A-Za-z_$0-9]/,$t=/^[ \t\n\r]/,Rt=/^[^\n\r]/,Ft=Br("SELECT",!0),It=Br("STREAM",!0),jt=Br("LOCALIZED",!0),Ot=Br("DISTINCT",!0),Nt=Br("ONE",!0),Pt=Br("FROM",!0),Ut=Br("WHERE",!0),Dt={type:"any"},zt=Br("GROUP BY",!0),Bt=Br("HAVING",!0),Mt=Br("ORDER BY",!0),qt=Br("LIMIT",!0),Zt=Br("OFFSET",!0),Ht=Br("as",!0),Wt=Br("*",!1),Yt=Br("[",!1),kt=Br("]",!1),Gt=Br("asc",!0),Qt=Br("desc",!0),Vt=Br("INSERT",!0),Jt=Br("UPSERT",!0),Kt=Br("INTO",!0),Xt=Br("ENTRIES",!0),te=Br("COLUMNS",!0),ee=Br("ROWS",!0),re=Br("VALUES",!0),ne=Br("UPDATE",!0),oe=Br("ENTITY",!0),se=Br("WITH",!0),ue=Br("SET",!0),le=Br("=",!1),ie=Br("{",!1),ae=Br(":",!1),ce=Br("}",!1),fe=Br("DELETE",!0),he=Br("CALL",!0),pe=Br("ACTION",!0),de=Br("FUNCTION",!0),Ce=Br("from",!0),be=Br("where",!0),ge=Br("group by",!0),we=Br("order by",!0),Le=Br("limit",!0),Ae=Br("offset",!0),me=qr("a name"),Ee=Br("AS",!0),xe=Mr([["A","Z"],["a","z"],"_","$"],!1,!1,!1),ve=Mr([["A","Z"],["a","z"],["0","9"],"_","$"],!1,!1,!1),ye=qr("a quoted identifier"),_e=Br("![",!1),Se=Mr(["]"],!0,!1,!1),Te=qr("an element ref"),$e=qr("an entity ref"),Re=qr("a reference"),Fe=qr("a value"),Ie=qr("a list"),je=qr("a function"),Oe=qr("a symbol"),Ne=Br("#",!1),Pe=qr("a parameter"),Ue=Br("?",!1),De=qr("an operator"),ze=Mr(["!","=",">","<","+","-","*","/","%","&","|","^","~"],!1,!1,!1),Be=Br("and",!0),Me=Br("or",!0),qe=Br("in",!0),Ze=Br("between",!0),He=Br("like",!0),We=Br("exists",!0),Ye=Br("contains",!0),ke=Br("case",!0),Ge=Br("when",!0),Qe=Br("then",!0),Ve=Br("else",!0),Je=Br("end",!0),Ke=Br("is",!0),Xe=Br("not",!0),tr=Br("null",!0),er=Br("empty",!0),rr=qr("a literal"),nr=Br("-",!1),or=Mr([["0","9"]],!1,!1,!1),sr=Br(".",!1),ur=Br("e",!1),lr=Br("'",!1),ir=Br("''",!1),ar=Br("\\'",!1),cr=Mr(["'"],!0,!1,!1),fr=Br("null",!1),hr=Br("true",!1),pr=Br("false",!1),dr=Br("$user",!1),Cr=Br("(",!1),br=Br(")",!1),gr=Mr([["A","Z"],["a","z"],"_","$",["0","9"]],!1,!1,!1),wr=qr("a comma"),Lr=Br(",",!1),Ar=qr(""),mr=Mr([" ","\t","\n","\r"],!1,!1,!1),Er=Br("//",!1),xr=Br("--",!1),vr=Mr(["\n","\r"],!0,!1,!1);function yr(t,e){t.as=e}function _r(t,e,r){e?t.inline=r:t.expand=r}function Sr(t,e){t.as=e}function Tr(t,e){t.sort=e.toLowerCase()}function $r(t,e,r){t[e]=r}function Rr(t,e,r){t[e]="val"in r?r.val:r}function Fr(t,e){return e?{id:t,...e}:t}let Ir=0|e.peg$currPos,jr=Ir;const Or=[{line:1,column:1}];let Nr,Pr=Ir,Ur=e.peg$maxFailExpected||[],Dr=0|e.peg$silentFails;if(e.startRule){if(!(e.startRule in o))throw new Error("Can't start parsing from rule \""+e.startRule+'".');s=o[e.startRule]}function zr(){return t.substring(jr,Ir)}function Br(t,e){return{type:"literal",text:t,ignoreCase:e}}function Mr(t,e,r,n){return{type:"class",parts:t,inverted:e,ignoreCase:r,unicode:n}}function qr(t){return{type:"other",description:t}}function Zr(e){let r,n=Or[e];if(n)return n;if(e>=Or.length)r=Or.length-1;else for(r=e;!Or[--r];);for(n=Or[r],n={line:n.line,column:n.column};r<e;)10===t.charCodeAt(r)?(n.line++,n.column=1):n.column++,r++;return Or[e]=n,n}function Hr(t,e,r){const o=Zr(t),s=Zr(e),u={source:n,start:{offset:t,line:o.line,column:o.column},end:{offset:e,line:s.line,column:s.column}};return r&&n&&"function"==typeof n.offset&&(u.start=n.offset(u.start),u.end=n.offset(u.end)),u}function Wr(t){Ir<Pr||(Ir>Pr&&(Pr=Ir,Ur=[]),Ur.push(t))}function Yr(t,e,r){return new peg$SyntaxError(peg$SyntaxError.buildMessage(t,e),t,e,r)}function kr(){let e,n,o,s;var u;return e=Ir,n=Rn(),o=Gr(),o===r&&(o=function(){let e,n,o,s,u,l,i,a,c,h,p,d,C,b;e=Ir,n=Ir,o=t.substr(Ir,6),o.toLowerCase()===v?Ir+=6:(o=r,0===Dr&&Wr(Vt));o!==r?(s=Fn(),s!==r?(jr=n,n=new INSERT):(Ir=n,n=r)):(Ir=n,n=r);n===r&&(n=Ir,o=t.substr(Ir,6),o.toLowerCase()===y?Ir+=6:(o=r,0===Dr&&Wr(Jt)),o!==r?(s=Fn(),s!==r?(jr=n,n=new UPSERT):(Ir=n,n=r)):(Ir=n,n=r));if(n!==r)if(o=Ir,s=En(),s!==r&&(jr=o,g=s,s=void(n._.entries=Array.isArray(g)?g:[g])),o=s,o===r&&(o=null),s=Ir,u=Ir,l=t.substr(Ir,4),l.toLowerCase()===_?Ir+=4:(l=r,0===Dr&&Wr(Kt)),l!==r?(i=Fn(),i!==r?(l=[l,i],u=l):(Ir=u,u=r)):(Ir=u,u=r),u!==r?(l=cn(),l!==r?(jr=s,s=function(t,e){t._.into=e}(n,l)):(Ir=s,s=r)):(Ir=s,s=r),s!==r){if(u=Ir,l=t.substr(Ir,4),l.toLowerCase()===f?Ir+=4:(l=r,0===Dr&&Wr(Pt)),l!==r?(i=Fn(),i!==r?(a=En(),a!==r?(jr=u,u=function(t,e){t._.from=e}(n,a)):(Ir=u,u=r)):(Ir=u,u=r)):(Ir=u,u=r),u===r&&(u=Ir,l=Gr(),l!==r&&(jr=u,l=function(t,e){t._.from=e}(n,l)),u=l),u===r){if(u=Ir,l=Ir,i=Ir,a=t.substr(Ir,7),a.toLowerCase()===S?Ir+=7:(a=r,0===Dr&&Wr(Xt)),a!==r?(c=Fn(),c!==r?(a=[a,c],i=a):(Ir=i,i=r)):(Ir=i,i=r),i===r&&(i=null),a=Ir,c=En(),c===r){for(c=Ir,h=[],p=on();p!==r;)h.push(p),p=Ir,d=Tn(),d!==r?(d=on(),d===r?(Ir=p,p=r):p=d):p=d;h.length<1?(Ir=c,c=r):c=h}if(c!==r&&(jr=a,c=function(t,e){t._tail(e)}(n,c)),a=c,a!==r?(i=[i,a],l=i):(Ir=l,l=r),l===r&&(l=null),i=Ir,a=Ir,c=t.substr(Ir,7),c.toLowerCase()===T?Ir+=7:(c=r,0===Dr&&Wr(te)),c!==r?(h=Fn(),h!==r?(c=[c,h],a=c):(Ir=a,a=r)):(Ir=a,a=r),a===r&&(a=null),c=En(),c===r)if(c=Ir,h=yn(),h!==r){for(p=Ir,d=[],C=an();C!==r;)d.push(C),C=Ir,b=Tn(),b!==r?(b=an(),b===r?(Ir=C,C=r):C=b):C=b;d.length<1?(Ir=p,p=r):p=d,p!==r?(d=_n(),d!==r?c=p:(Ir=c,c=r)):(Ir=c,c=r)}else Ir=c,c=r;c!==r?(jr=i,i=function(t,e){t._.columns=e}(n,c)):(Ir=i,i=r),i===r&&(i=null),a=Ir,c=Ir,h=t.substr(Ir,4),h.toLowerCase()===$?Ir+=4:(h=r,0===Dr&&Wr(ee)),h!==r?(p=Fn(),p!==r?(h=[h,p],c=h):(Ir=c,c=r)):(Ir=c,c=r),c===r&&(c=null),h=En(),h!==r?(jr=a,a=function(t,e){t._.rows=e}(n,h)):(Ir=a,a=r),a===r&&(a=null),c=Ir,h=Ir,p=t.substr(Ir,6),p.toLowerCase()===R?Ir+=6:(p=r,0===Dr&&Wr(re)),p!==r?(d=Fn(),d!==r?(p=[p,d],h=p):(Ir=h,h=r)):(Ir=h,h=r),h!==r?(p=Cn(),p!==r?(jr=c,c=function(t,e){t._.values=e.list}(n,p)):(Ir=c,c=r)):(Ir=c,c=r),c===r&&(c=null),l=[l,i,a,c],u=l}u!==r?e=n:(Ir=e,e=r)}else Ir=e,e=r;else Ir=e,e=r;var g;return e}(),o===r&&(o=function(){let e,n,o,s,u,l,i,a,f,p;e=Ir,n=Ir,o=t.substr(Ir,6),o.toLowerCase()===F?Ir+=6:(o=r,0===Dr&&Wr(ne));o!==r?(s=Fn(),s!==r?(jr=n,n=new UPDATE):(Ir=n,n=r)):(Ir=n,n=r);n!==r?(o=Ir,s=t.substr(Ir,3),s.toLowerCase()===c?Ir+=3:(s=r,0===Dr&&Wr(Nt)),s!==r?(u=Fn(),u!==r?(jr=o,o=void(n._.one=!0)):(Ir=o,o=r)):(Ir=o,o=r),o===r&&(o=null),s=Ir,u=Ir,l=t.substr(Ir,6),l.toLowerCase()===I?Ir+=6:(l=r,0===Dr&&Wr(oe)),l!==r?(i=Fn(),i!==r?(l=[l,i],u=l):(Ir=u,u=r)):(Ir=u,u=r),u===r&&(u=null),l=cn(),l!==r?(jr=s,s=function(t,e){t._.entity=e}(n,l)):(Ir=s,s=r),s!==r?(u=Ir,l=Ir,i=t.substr(Ir,4),i.toLowerCase()===j?Ir+=4:(i=r,0===Dr&&Wr(se)),i!==r?(a=Fn(),a!==r?(i=[i,a],l=i):(Ir=l,l=r)):(Ir=l,l=r),l!==r?(i=rn(),i!==r?(jr=u,u=function(t,e){t._.data=e}(n,i)):(Ir=u,u=r)):(Ir=u,u=r),u===r&&(u=null),l=Ir,i=Ir,a=t.substr(Ir,3),a.toLowerCase()===O?Ir+=3:(a=r,0===Dr&&Wr(ue)),a!==r?(f=Fn(),f!==r?(a=[a,f],i=a):(Ir=i,i=r)):(Ir=i,i=r),i!==r?(a=nn(),a!==r?(jr=l,l=function(t,e){t._.with=e}(n,a)):(Ir=l,l=r)):(Ir=l,l=r),l===r&&(l=null),i=Ir,a=Ir,f=t.substr(Ir,5),f.toLowerCase()===h?Ir+=5:(f=r,0===Dr&&Wr(Ut)),f!==r?(p=Fn(),p!==r?(f=[f,p],a=f):(Ir=a,a=r)):(Ir=a,a=r),a!==r?(f=Xr(),f!==r?(p=Rn(),jr=i,i=function(t,e){t._.where=e}(n,f)):(Ir=i,i=r)):(Ir=i,i=r),i===r&&(i=null),e=n):(Ir=e,e=r)):(Ir=e,e=r);return e}(),o===r&&(o=function(){let e,n,o,s,u,l,i,a;e=Ir,n=Ir,o=t.substr(Ir,6),o.toLowerCase()===z?Ir+=6:(o=r,0===Dr&&Wr(fe));o!==r?(s=Fn(),s!==r?(jr=n,n=new DELETE):(Ir=n,n=r)):(Ir=n,n=r);n!==r?(o=Ir,s=t.substr(Ir,3),s.toLowerCase()===c?Ir+=3:(s=r,0===Dr&&Wr(Nt)),s!==r?(u=Fn(),u!==r?(jr=o,o=void(n._.one=!0)):(Ir=o,o=r)):(Ir=o,o=r),o===r&&(o=null),s=Ir,u=Ir,l=t.substr(Ir,4),l.toLowerCase()===f?Ir+=4:(l=r,0===Dr&&Wr(Pt)),l!==r?(i=Fn(),i!==r?(l=[l,i],u=l):(Ir=u,u=r)):(Ir=u,u=r),u===r&&(u=null),l=cn(),l!==r?(i=Rn(),jr=s,s=function(t,e){t._.from=e}(n,l)):(Ir=s,s=r),s!==r?(u=Ir,l=Ir,i=t.substr(Ir,5),i.toLowerCase()===h?Ir+=5:(i=r,0===Dr&&Wr(Ut)),i!==r?(a=Fn(),a!==r?(i=[i,a],l=i):(Ir=l,l=r)):(Ir=l,l=r),l!==r?(i=Xr(),i!==r?(a=Rn(),jr=u,u=function(t,e){t._.where=e}(n,i)):(Ir=u,u=r)):(Ir=u,u=r),u===r&&(u=null),e=n):(Ir=e,e=r)):(Ir=e,e=r);return e}(),o===r&&(o=function(){let e,n,o,s,u,l,i;e=Ir,n=Ir,o=t.substr(Ir,4),o.toLowerCase()===B?Ir+=4:(o=r,0===Dr&&Wr(he));o!==r?(s=Fn(),s!==r?(jr=n,n=new CALL):(Ir=n,n=r)):(Ir=n,n=r);n!==r?(o=Ir,s=Ir,u=t.substr(Ir,6),u.toLowerCase()===M?Ir+=6:(u=r,0===Dr&&Wr(pe)),u===r&&(u=t.substr(Ir,8),u.toLowerCase()===q?Ir+=8:(u=r,0===Dr&&Wr(de))),u!==r?(l=Fn(),l!==r?(u=[u,l],s=u):(Ir=s,s=r)):(Ir=s,s=r),s===r&&(s=null),u=un(),u!==r?(l=Rn(),jr=o,a=u,o=void(n._.action=a)):(Ir=o,o=r),o!==r?(s=Ir,u=Ir,l=t.substr(Ir,4),l.toLowerCase()===j?Ir+=4:(l=r,0===Dr&&Wr(se)),l!==r?(i=Fn(),i!==r?(l=[l,i],u=l):(Ir=u,u=r)):(Ir=u,u=r),u===r&&(u=null),l=on(),l!==r?(i=Rn(),jr=s,s=function(t,e){Object.assign(t._,{with:e})}(n,l)):(Ir=s,s=r),s!==r?e=n:(Ir=e,e=r)):(Ir=e,e=r)):(Ir=e,e=r);var a;return e}())))),o!==r?(s=Rn(),jr=e,u=o,jn?.length&&(u.params=jn),On?.length&&(u.args=On),u.source=zr(),e=u):(Ir=e,e=r),e}function Gr(){let e,n,o,s,p,d,C,b,g,w,L,A,m,E;return e=Ir,n=Ir,o=t.substr(Ir,6),o.toLowerCase()===u?Ir+=6:(o=r,0===Dr&&Wr(Ft)),o!==r?(s=Fn(),s!==r?(jr=n,n=new SELECT):(Ir=n,n=r)):(Ir=n,n=r),n===r&&(n=Ir,o=t.substr(Ir,6),o.toLowerCase()===l?Ir+=6:(o=r,0===Dr&&Wr(It)),o!==r?(s=Fn(),s!==r?(jr=n,n=function(){let t=new SELECT;return t._.stream=!0,t}()):(Ir=n,n=r)):(Ir=n,n=r)),n!==r?(o=Ir,s=t.substr(Ir,9),s.toLowerCase()===i?Ir+=9:(s=r,0===Dr&&Wr(jt)),s!==r?(p=Fn(),p!==r?(jr=o,o=void(n._.localized=!0)):(Ir=o,o=r)):(Ir=o,o=r),o===r&&(o=null),s=Ir,p=t.substr(Ir,8),p.toLowerCase()===a?Ir+=8:(p=r,0===Dr&&Wr(Ot)),p!==r?(d=Fn(),d!==r?(jr=s,s=function(t){t._.distinct=!0}(n)):(Ir=s,s=r)):(Ir=s,s=r),s===r&&(s=null),p=Ir,d=t.substr(Ir,6),d.toLowerCase()===l?Ir+=6:(d=r,0===Dr&&Wr(It)),d!==r?(C=Fn(),C!==r?(jr=p,p=function(t){t._.stream=!0}(n)):(Ir=p,p=r)):(Ir=p,p=r),p===r&&(p=null),d=Ir,C=t.substr(Ir,3),C.toLowerCase()===c?Ir+=3:(C=r,0===Dr&&Wr(Nt)),C!==r?(b=Fn(),b!==r?(jr=d,d=function(t){t._.one=!0}(n)):(Ir=d,d=r)):(Ir=d,d=r),d===r&&(d=null),C=Ir,b=Jr(),b!==r?(g=Rn(),jr=C,C=function(t,e){t._.columns=e}(n,b)):(Ir=C,C=r),C===r&&(C=null),b=Ir,g=t.substr(Ir,4),g.toLowerCase()===f?Ir+=4:(g=r,0===Dr&&Wr(Pt)),g!==r?(w=Fn(),w!==r?(L=cn(),L===r&&(L=mn()),L!==r?(jr=b,b=function(t,e){t._.from=e}(n,L)):(Ir=b,b=r)):(Ir=b,b=r)):(Ir=b,b=r),b===r&&(b=null),g=Ir,w=xn(),w!==r?(L=Jr(),L!==r?(A=vn(),A!==r?(jr=g,g=function(t,e){t._.columns=e}(n,L)):(Ir=g,g=r)):(Ir=g,g=r)):(Ir=g,g=r),g===r&&(g=null),w=Ir,L=t.substr(Ir,5),L.toLowerCase()===h?Ir+=5:(L=r,0===Dr&&Wr(Ut)),L!==r?(A=Fn(),A!==r?(m=Xr(),m!==r?(E=Rn(),jr=w,w=function(t,e){t._.where=e}(n,m)):(Ir=w,w=r)):(Ir=w,w=r)):(Ir=w,w=r),w===r&&(w=null),L=Ir,A=Qr(),A!==r&&(jr=L,A=function(t,e){Object.assign(t._,e)}(n,A)),L=A,L===r&&(L=null),e=n):(Ir=e,e=r),e}function Qr(){let e,n,o,s,u,l,i,a,c,f;var h;return e=Ir,n=Ir,o=Ir,Dr++,t.length>Ir?(s=t.charAt(Ir),Ir++):(s=r,0===Dr&&Wr(Dt)),Dr--,s!==r?(Ir=o,o=void 0):o=r,o!==r&&(jr=n,o={}),n=o,n!==r?(o=Ir,s=Ir,u=t.substr(Ir,8),u.toLowerCase()===p?Ir+=8:(u=r,0===Dr&&Wr(zt)),u!==r?(l=Fn(),l!==r?(i=tn(),i!==r?(a=Rn(),jr=s,h=i,s=void(n.groupBy=h)):(Ir=s,s=r)):(Ir=s,s=r)):(Ir=s,s=r),s!==r?(u=Ir,l=t.substr(Ir,6),l.toLowerCase()===d?Ir+=6:(l=r,0===Dr&&Wr(Bt)),l!==r?(i=Fn(),i!==r?(a=Xr(),a!==r?(c=Rn(),jr=u,u=function(t,e){t.having=e}(n,a)):(Ir=u,u=r)):(Ir=u,u=r)):(Ir=u,u=r),u===r&&(u=null),s=[s,u],o=s):(Ir=o,o=r),o===r&&(o=null),s=Ir,u=Ir,l=t.substr(Ir,8),l.toLowerCase()===C?Ir+=8:(l=r,0===Dr&&Wr(Mt)),l!==r?(i=Fn(),i!==r?(l=[l,i],u=l):(Ir=u,u=r)):(Ir=u,u=r),u!==r?(l=en(),l!==r?(i=Rn(),jr=s,s=function(t,e){t.orderBy=e}(n,l)):(Ir=s,s=r)):(Ir=s,s=r),s===r&&(s=null),u=Ir,l=Ir,i=t.substr(Ir,5),i.toLowerCase()===b?Ir+=5:(i=r,0===Dr&&Wr(qt)),i!==r?(a=Fn(),a!==r?(c=pn(),c===r&&(c=dn()),c!==r?(f=Rn(),jr=l,l=function(t,e){t.limit={rows:e}}(n,c)):(Ir=l,l=r)):(Ir=l,l=r)):(Ir=l,l=r),l!==r?(i=Ir,a=Ir,c=t.substr(Ir,6),c.toLowerCase()===g?Ir+=6:(c=r,0===Dr&&Wr(Zt)),c!==r?(f=Fn(),f!==r?(c=[c,f],a=c):(Ir=a,a=r)):(Ir=a,a=r),a===r&&(a=Tn()),a!==r?(c=pn(),c===r&&(c=dn()),c!==r?(f=Rn(),jr=i,i=function(t,e){t.limit.offset=e}(n,c)):(Ir=i,i=r)):(Ir=i,i=r),i===r&&(i=null),l=[l,i],u=l):(Ir=u,u=r),u===r&&(u=null),e=n):(Ir=e,e=r),e}function Vr(){let e,n,o,s,u;return e=Ir,n=Ir,o=Rn(),n=t.substring(n,Ir),o=t.substr(Ir,2),o.toLowerCase()===w?Ir+=2:(o=r,0===Dr&&Wr(Ht)),o!==r?(s=Fn(),s!==r?(u=un(),u!==r?e=u:(Ir=e,e=r)):(Ir=e,e=r)):(Ir=e,e=r),e}function Jr(){let e,n,o,s,u,l,i,a,c,f,h,p;for(e=Ir,n=Ir,o=[],42===t.charCodeAt(Ir)?(s=L,Ir++):(s=r,0===Dr&&Wr(Wt)),s===r&&(s=Ir,u=pn(),u!==r?(l=Ir,i=Vr(),i!==r&&(jr=l,i=yr(u,i)),l=i,l===r&&(l=null),i=$n(),i===r&&(i=null),a=Ir,c=xn(),c!==r?(f=Jr(),f!==r?(h=vn(),h!==r?(jr=a,a=_r(u,i,f)):(Ir=a,a=r)):(Ir=a,a=r)):(Ir=a,a=r),a!==r?s=u:(Ir=s,s=r)):(Ir=s,s=r),s===r&&(s=Ir,u=fn(),u!==r?(l=Ir,i=Vr(),i!==r&&(jr=l,i=Sr(u,i)),l=i,l===r&&(l=null),s=u):(Ir=s,s=r)));s!==r;)o.push(s),s=Ir,u=Tn(),u!==r?(42===t.charCodeAt(Ir)?(u=L,Ir++):(u=r,0===Dr&&Wr(Wt)),u===r&&(u=Ir,l=pn(),l!==r?(i=Ir,a=Vr(),a!==r&&(jr=i,a=yr(l,a)),i=a,i===r&&(i=null),a=$n(),a===r&&(a=null),c=Ir,f=xn(),f!==r?(h=Jr(),h!==r?(p=vn(),p!==r?(jr=c,c=_r(l,a,h)):(Ir=c,c=r)):(Ir=c,c=r)):(Ir=c,c=r),c!==r?u=l:(Ir=u,u=r)):(Ir=u,u=r),u===r&&(u=Ir,l=fn(),l!==r?(i=Ir,a=Vr(),a!==r&&(jr=i,a=Sr(l,a)),i=a,i===r&&(i=null),u=l):(Ir=u,u=r))),u===r?(Ir=s,s=r):s=u):s=u;return o.length<1?(Ir=n,n=r):n=o,n!==r?(o=Tn(),o===r&&(o=null),e=n):(Ir=e,e=r),e}function Kr(){let e,n,o,s,u,l,i,a;return e=Ir,n=Rn(),91===t.charCodeAt(Ir)?(o=A,Ir++):(o=r,0===Dr&&Wr(Yt)),o!==r?(s=Rn(),u=function(){let e,n,o,s,u;e=Ir,n=En(),n!==r&&(jr=e,l=n,n={where:fluent.where(l)});var l;if(e=n,e===r){for(e=Ir,n=Ir,o=[],s=dn();s!==r;)o.push(s),s=Ir,u=Tn(),u!==r?(u=dn(),u===r?(Ir=s,s=r):s=u):s=u;o.length<1?(Ir=n,n=r):n=o,n!==r&&(jr=e,n={where:n}),e=n,e===r&&(e=Ir,n=Ir,o=Ir,s=t.substr(Ir,5),s.toLowerCase()===h?Ir+=5:(s=r,0===Dr&&Wr(Ut)),s!==r?(u=Fn(),u!==r?(s=[s,u],o=s):(Ir=o,o=r)):(Ir=o,o=r),o===r&&(o=null),s=Xr(),s!==r?(u=Rn(),n=s):(Ir=n,n=r),n===r&&(n=null),o=Qr(),o===r&&(o=null),jr=e,a=o,e=(i=n)?{where:i,...a}:a)}var i,a;return e}(),u!==r?(l=Rn(),93===t.charCodeAt(Ir)?(i=m,Ir++):(i=r,0===Dr&&Wr(kt)),i!==r?(a=Rn(),e=u):(Ir=e,e=r)):(Ir=e,e=r)):(Ir=e,e=r),e}function Xr(){let t,e;var n;return t=Ir,e=En(),e!==r&&(jr=t,n=e,e=fluent.where(n)),t=e,t===r&&(t=Ir,e=hn(),e!==r&&(jr=t,e=e.xpr),t=e),t}function tn(){let t,e,n,o,s;for(t=Ir,e=[],n=Ir,o=bn(),o===r&&(o=pn()),o!==r?n=o:(Ir=n,n=r);n!==r;)e.push(n),n=Ir,o=Tn(),o!==r?(o=Ir,s=bn(),s===r&&(s=pn()),s!==r?o=s:(Ir=o,o=r),o===r?(Ir=n,n=r):n=o):n=o;return e.length<1?(Ir=t,t=r):t=e,t}function en(){let e,n,o,s,u,l,i,a;for(e=Ir,n=[],o=Ir,s=bn(),s===r&&(s=pn()),s!==r?(u=Ir,l=Rn(),i=t.substr(Ir,3),i.toLowerCase()===E?Ir+=3:(i=r,0===Dr&&Wr(Gt)),i===r&&(i=t.substr(Ir,4),i.toLowerCase()===x?Ir+=4:(i=r,0===Dr&&Wr(Qt))),i!==r?(jr=u,u=Tr(s,i)):(Ir=u,u=r),u===r&&(u=null),o=s):(Ir=o,o=r);o!==r;)n.push(o),o=Ir,s=Tn(),s!==r?(s=Ir,u=bn(),u===r&&(u=pn()),u!==r?(l=Ir,i=Rn(),a=t.substr(Ir,3),a.toLowerCase()===E?Ir+=3:(a=r,0===Dr&&Wr(Gt)),a===r&&(a=t.substr(Ir,4),a.toLowerCase()===x?Ir+=4:(a=r,0===Dr&&Wr(Qt))),a!==r?(jr=l,l=Tr(u,a)):(Ir=l,l=r),l===r&&(l=null),s=u):(Ir=s,s=r),s===r?(Ir=o,o=r):o=s):o=s;return n.length<1?(Ir=e,e=r):e=n,e}function rn(){let t;return t=En(),t===r&&(t=on()),t}function nn(){let e,n,o,s,u,l,i,a,c,f,h;for(e=Ir,n=Ir,o="",jr=n,o={},n=o,o=Ir,s=[],u=Ir,l=an(),l!==r?(i=Rn(),61===t.charCodeAt(Ir)?(a=N,Ir++):(a=r,0===Dr&&Wr(le)),a!==r?(c=Rn(),f=wn(),f===r&&(f=fn()),f!==r?(jr=u,u=$r(n,l,f)):(Ir=u,u=r)):(Ir=u,u=r)):(Ir=u,u=r);u!==r;)s.push(u),u=Ir,l=Tn(),l!==r?(l=Ir,i=an(),i!==r?(a=Rn(),61===t.charCodeAt(Ir)?(c=N,Ir++):(c=r,0===Dr&&Wr(le)),c!==r?(f=Rn(),h=wn(),h===r&&(h=fn()),h!==r?(jr=l,l=$r(n,i,h)):(Ir=l,l=r)):(Ir=l,l=r)):(Ir=l,l=r),l===r?(Ir=u,u=r):u=l):u=l;return s.length<1?(Ir=o,o=r):o=s,o!==r?(s=Rn(),e=n):(Ir=e,e=r),e}function on(){let e,n,o,s,u,l,i,a,c,f,h,p;if(e=Ir,n=Ir,o=Ir,s=Rn(),123===t.charCodeAt(Ir)?(u=P,Ir++):(u=r,0===Dr&&Wr(ie)),u!==r?(l=Rn(),jr=o,o={}):(Ir=o,o=r),o!==r){for(s=Ir,u=[],l=Ir,i=an(),i!==r?(a=Rn(),58===t.charCodeAt(Ir)?(c=U,Ir++):(c=r,0===Dr&&Wr(ae)),c!==r?(f=Rn(),h=dn(),h===r&&(h=on(),h===r&&(h=sn())),h!==r?(jr=l,l=Rr(o,i,h)):(Ir=l,l=r)):(Ir=l,l=r)):(Ir=l,l=r);l!==r;)u.push(l),l=Ir,i=Tn(),i!==r?(i=Ir,a=an(),a!==r?(c=Rn(),58===t.charCodeAt(Ir)?(f=U,Ir++):(f=r,0===Dr&&Wr(ae)),f!==r?(h=Rn(),p=dn(),p===r&&(p=on(),p===r&&(p=sn())),p!==r?(jr=i,i=Rr(o,a,p)):(Ir=i,i=r)):(Ir=i,i=r)):(Ir=i,i=r),i===r?(Ir=l,l=r):l=i):l=i;u.length<1?(Ir=s,s=r):s=u,s!==r?(u=Tn(),u===r&&(u=null),l=Rn(),125===t.charCodeAt(Ir)?(i=D,Ir++):(i=r,0===Dr&&Wr(ce)),i!==r?(a=Rn(),n=o):(Ir=n,n=r)):(Ir=n,n=r)}else Ir=n,n=r;return n!==r?e=n:(Ir=e,e=r),e}function sn(){let e,n,o,s,u,l,i,a,c;if(e=Ir,n=Rn(),91===t.charCodeAt(Ir)?(o=A,Ir++):(o=r,0===Dr&&Wr(Yt)),o!==r){for(s=Rn(),u=Ir,l=[],i=on();i!==r;)l.push(i),i=Ir,a=Tn(),a!==r?(a=on(),a===r?(Ir=i,i=r):i=a):i=a;l.length<1?(Ir=u,u=r):u=l,u!==r?(l=Tn(),l===r&&(l=null),i=Rn(),93===t.charCodeAt(Ir)?(a=m,Ir++):(a=r,0===Dr&&Wr(kt)),a!==r?(c=Rn(),e=u):(Ir=e,e=r)):(Ir=e,e=r)}else Ir=e,e=r;return e}function un(){let e,n,o,s,u,l,i,a;if(Dr++,e=Ir,n=Ir,Dr++,o=t.substr(Ir,2),o.toLowerCase()===w?Ir+=2:(o=r,0===Dr&&Wr(Ee)),Dr--,o===r?n=void 0:(Ir=n,n=r),n!==r)if(o=Ir,Dr++,s=function(){let e;return e=t.substr(Ir,4),e.toLowerCase()===f?Ir+=4:(e=r,0===Dr&&Wr(Ce)),e===r&&(e=t.substr(Ir,5),e.toLowerCase()===h?Ir+=5:(e=r,0===Dr&&Wr(be)),e===r&&(e=t.substr(Ir,8),e.toLowerCase()===p?Ir+=8:(e=r,0===Dr&&Wr(ge)),e===r&&(e=t.substr(Ir,8),e.toLowerCase()===C?Ir+=8:(e=r,0===Dr&&Wr(we)),e===r&&(e=t.substr(Ir,5),e.toLowerCase()===b?Ir+=5:(e=r,0===Dr&&Wr(Le)),e===r&&(e=t.substr(Ir,6),e.toLowerCase()===g?Ir+=6:(e=r,0===Dr&&Wr(Ae))))))),e}(),Dr--,s===r?o=void 0:(Ir=o,o=r),o!==r){if(s=Ir,u=Ir,l=t.charAt(Ir),Et.test(l)?Ir++:(l=r,0===Dr&&Wr(xe)),l!==r){for(i=[],a=t.charAt(Ir),xt.test(a)?Ir++:(a=r,0===Dr&&Wr(ve));a!==r;)i.push(a),a=t.charAt(Ir),xt.test(a)?Ir++:(a=r,0===Dr&&Wr(ve));l=[l,i],u=l}else Ir=u,u=r;s=u!==r?t.substring(s,Ir):u,s!==r?e=s:(Ir=e,e=r)}else Ir=e,e=r;else Ir=e,e=r;return e===r&&(e=ln()),Dr--,e===r&&(n=r,0===Dr&&Wr(me)),e}function ln(){let e,n,o,s,u;if(Dr++,e=Ir,t.substr(Ir,2)===Z?(n=Z,Ir+=2):(n=r,0===Dr&&Wr(_e)),n!==r){if(o=Ir,s=[],u=t.charAt(Ir),vt.test(u)?Ir++:(u=r,0===Dr&&Wr(Se)),u!==r)for(;u!==r;)s.push(u),u=t.charAt(Ir),vt.test(u)?Ir++:(u=r,0===Dr&&Wr(Se));else s=r;o=s!==r?t.substring(o,Ir):s,o!==r?(93===t.charCodeAt(Ir)?(s=m,Ir++):(s=r,0===Dr&&Wr(kt)),s!==r?e=o:(Ir=e,e=r)):(Ir=e,e=r)}else Ir=e,e=r;return Dr--,e===r&&(n=r,0===Dr&&Wr(ye)),e}function an(){let e,n,o,s,u,l;for(Dr++,e=Ir,n=Ir,o=Ir,s=[],u=un();u!==r;)s.push(u),u=Ir,l=$n(),l!==r?(l=un(),l===r?(Ir=u,u=r):u=l):u=l;return s.length<1?(Ir=o,o=r):o=s,n=o!==r?t.substring(n,Ir):o,n!==r?e=n:(Ir=e,e=r),Dr--,e===r&&(n=r,0===Dr&&Wr(Te)),e}function cn(){let e,n,o,s,u,l,i;var a;if(Dr++,e=Ir,n=En(),n!==r&&(jr=e,a=n,n=fluent.subject(a)),e=n,e===r){for(e=Ir,n=Ir,o=[],s=Ir,u=un(),u!==r?(l=$n(),l!==r?(u=[u,l],s=u):(Ir=s,s=r)):(Ir=s,s=r);s!==r;)o.push(s),s=Ir,u=un(),u!==r?(l=$n(),l!==r?(u=[u,l],s=u):(Ir=s,s=r)):(Ir=s,s=r);n=t.substring(n,Ir),o=Ir,s=un(),s!==r?(u=Rn(),58===t.charCodeAt(Ir)?(l=U,Ir++):(l=r,0===Dr&&Wr(ae)),l!==r?(i=Rn(),o=s):(Ir=o,o=r)):(Ir=o,o=r),o===r&&(o=null),s=pn(),s!==r?(u=Rn(),jr=e,e=function(t,e,r){if(e)return{ref:[t+e,...r.ref]};if(t){let[e]=r.ref;e.id?e.id=t+e.id:r.ref[0]=t+e}return r}(n,o,s)):(Ir=e,e=r)}return Dr--,e===r&&(n=r,0===Dr&&Wr($e)),e}function fn(){let t,e;var n;return t=Ir,e=hn(),e!==r&&(jr=t,e=(n=e).xpr.length>1?n:n.xpr[0]),t=e,t}function hn(){let t,e,n,o,s,u;if(t=Ir,e=[],n=mn(),n===r&&(n=Cn(),n===r&&(n=gn(),n===r&&(n=dn(),n===r&&(n=An(),n===r&&(n=bn(),n===r&&(n=pn(),n===r&&(n=Ir,o=yn(),o!==r?(s=fn(),s!==r?(u=_n(),u!==r?n=s:(Ir=n,n=r)):(Ir=n,n=r)):(Ir=n,n=r)))))))),n!==r)for(;n!==r;)e.push(n),n=mn(),n===r&&(n=Cn(),n===r&&(n=gn(),n===r&&(n=dn(),n===r&&(n=An(),n===r&&(n=bn(),n===r&&(n=pn(),n===r&&(n=Ir,o=yn(),o!==r?(s=fn(),s!==r?(u=_n(),u!==r?n=s:(Ir=n,n=r)):(Ir=n,n=r)):(Ir=n,n=r))))))));else e=r;return e!==r&&(jr=t,e={xpr:e.flat()}),t=e,t}function pn(){let e,n,o,s,u,l,i;if(Dr++,e=function(){let e,n,o,s,u;e=Ir,t.substr(Ir,5)===bt?(n=bt,Ir+=5):(n=r,0===Dr&&Wr(dr));n!==r?(o=Ir,Dr++,s=Sn(),Dr--,s===r?o=void 0:(Ir=o,o=r),o!==r?(s=Ir,Dr++,u=$n(),Dr--,u===r?s=void 0:(Ir=s,s=r),s!==r?(jr=e,e={ref:["$user","id"]}):(Ir=e,e=r)):(Ir=e,e=r)):(Ir=e,e=r);return e}(),e===r){for(e=Ir,n=Ir,o=[],s=Ir,u=un(),u!==r?(l=Kr(),l===r&&(l=null),jr=s,s=Fr(u,l)):(Ir=s,s=r);s!==r;)o.push(s),s=Ir,u=$n(),u!==r?(u=Ir,l=un(),l!==r?(i=Kr(),i===r&&(i=null),jr=u,u=Fr(l,i)):(Ir=u,u=r),u===r?(Ir=s,s=r):s=u):s=u;o.length<1?(Ir=n,n=r):n=o,n!==r&&(jr=e,n={ref:n}),e=n}return Dr--,e===r&&(n=r,0===Dr&&Wr(Re)),e}function dn(){let e,n;return Dr++,e=wn(),e===r&&(e=Ir,n=function(){let e,n;Dr++,e=function(){let e,n,o,s,u,l;e=Ir,39===t.charCodeAt(Ir)?(n=ft,Ir++):(n=r,0===Dr&&Wr(lr));if(n!==r){for(o=Ir,s=Ir,u=[],t.substr(Ir,2)===ht?(l=ht,Ir+=2):(l=r,0===Dr&&Wr(ir)),l===r&&(t.substr(Ir,2)===pt?(l=pt,Ir+=2):(l=r,0===Dr&&Wr(ar)),l===r&&(l=t.charAt(Ir),St.test(l)?Ir++:(l=r,0===Dr&&Wr(cr))));l!==r;)u.push(l),t.substr(Ir,2)===ht?(l=ht,Ir+=2):(l=r,0===Dr&&Wr(ir)),l===r&&(t.substr(Ir,2)===pt?(l=pt,Ir+=2):(l=r,0===Dr&&Wr(ar)),l===r&&(l=t.charAt(Ir),St.test(l)?Ir++:(l=r,0===Dr&&Wr(cr))));s=t.substring(s,Ir),jr=o,s=zr().replace(/''|\\'/g,"'"),o=s,39===t.charCodeAt(Ir)?(s=ft,Ir++):(s=r,0===Dr&&Wr(lr)),s!==r?e=o:(Ir=e,e=r)}else Ir=e,e=r;return e}(),e===r&&(e=function(){let e,n,o,s,u,l,i,a,c,f;e=Ir,n=Ir,o=Ir,45===t.charCodeAt(Ir)?(s=it,Ir++):(s=r,0===Dr&&Wr(nr));s===r&&(s=null);u=[],l=t.charAt(Ir),_t.test(l)?Ir++:(l=r,0===Dr&&Wr(or));if(l!==r)for(;l!==r;)u.push(l),l=t.charAt(Ir),_t.test(l)?Ir++:(l=r,0===Dr&&Wr(or));else u=r;if(u!==r){if(l=Ir,46===t.charCodeAt(Ir)?(i=at,Ir++):(i=r,0===Dr&&Wr(sr)),i!==r){if(a=[],c=t.charAt(Ir),_t.test(c)?Ir++:(c=r,0===Dr&&Wr(or)),c!==r)for(;c!==r;)a.push(c),c=t.charAt(Ir),_t.test(c)?Ir++:(c=r,0===Dr&&Wr(or));else a=r;a!==r?(i=[i,a],l=i):(Ir=l,l=r)}else Ir=l,l=r;if(l===r&&(l=null),i=Ir,101===t.charCodeAt(Ir)?(a=ct,Ir++):(a=r,0===Dr&&Wr(ur)),a!==r){if(c=[],f=t.charAt(Ir),_t.test(f)?Ir++:(f=r,0===Dr&&Wr(or)),f!==r)for(;f!==r;)c.push(f),f=t.charAt(Ir),_t.test(f)?Ir++:(f=r,0===Dr&&Wr(or));else c=r;c!==r?(a=[a,c],i=a):(Ir=i,i=r)}else Ir=i,i=r;i===r&&(i=null),s=[s,u,l,i],o=s}else Ir=o,o=r;n=o!==r?t.substring(n,Ir):o;n!==r&&(jr=e,n=Number(n));return e=n,e}(),e===r&&(e=function(){let e,n,o,s;e=Ir,t.substr(Ir,4)===dt?(n=dt,Ir+=4):(n=r,0===Dr&&Wr(hr));n!==r?(o=Ir,Dr++,s=Sn(),Dr--,s===r?o=void 0:(Ir=o,o=r),o!==r?(jr=e,e=!0):(Ir=e,e=r)):(Ir=e,e=r);return e}(),e===r&&(e=function(){let e,n,o,s;e=Ir,t.substr(Ir,5)===Ct?(n=Ct,Ir+=5):(n=r,0===Dr&&Wr(pr));n!==r?(o=Ir,Dr++,s=Sn(),Dr--,s===r?o=void 0:(Ir=o,o=r),o!==r?(jr=e,e=!1):(Ir=e,e=r)):(Ir=e,e=r);return e}(),e===r&&(e=function(){let e,n,o,s;e=Ir,t.substr(Ir,4)===ut?(n=ut,Ir+=4):(n=r,0===Dr&&Wr(fr));n!==r?(o=Ir,Dr++,s=Sn(),Dr--,s===r?o=void 0:(Ir=o,o=r),o!==r?(jr=e,e=null):(Ir=e,e=r)):(Ir=e,e=r);return e}()))));Dr--,e===r&&(n=r,0===Dr&&Wr(rr));return e}(),n!==r&&(jr=e,n={val:n}),e=n),Dr--,e===r&&(n=r,0===Dr&&Wr(Fe)),e}function Cn(){let t,e,n,o;return Dr++,t=wn(),t===r&&(t=Ir,e=yn(),e!==r?(n=Ir,o=Ln(),o!==r&&(jr=n,o={list:o}),n=o,n!==r?(o=_n(),o!==r?t=n:(Ir=t,t=r)):(Ir=t,t=r)):(Ir=t,t=r)),Dr--,t===r&&(e=r,0===Dr&&Wr(Ie)),t}function bn(){let e,n,o,s,u,l,i;if(Dr++,e=Ir,n=un(),n!==r)if(o=yn(),o!==r){for(s=Ir,u=[],42===t.charCodeAt(Ir)?(l=L,Ir++):(l=r,0===Dr&&Wr(Wt)),l===r&&(l=fn());l!==r;)u.push(l),l=Ir,i=Tn(),i!==r?(42===t.charCodeAt(Ir)?(i=L,Ir++):(i=r,0===Dr&&Wr(Wt)),i===r&&(i=fn()),i===r?(Ir=l,l=r):l=i):l=i;u.length<1?(Ir=s,s=r):s=u,s!==r?(u=_n(),u!==r?(jr=e,e={func:n,args:s}):(Ir=e,e=r)):(Ir=e,e=r)}else Ir=e,e=r;else Ir=e,e=r;return Dr--,e===r&&(n=r,0===Dr&&Wr(je)),e}function gn(){let e,n,o;return Dr++,e=Ir,35===t.charCodeAt(Ir)?(n=H,Ir++):(n=r,0===Dr&&Wr(Ne)),n!==r?(o=un(),o!==r?(jr=e,e={"#":o}):(Ir=e,e=r)):(Ir=e,e=r),Dr--,e===r&&(n=r,0===Dr&&Wr(Oe)),e}function wn(){let e,n,o,s;return Dr++,e=Ir,n=Rn(),63===t.charCodeAt(Ir)?(o=W,Ir++):(o=r,0===Dr&&Wr(Ue)),o!==r?(s=Rn(),jr=e,e=Pn()):(Ir=e,e=r),Dr--,e===r&&(n=r,0===Dr&&Wr(Pe)),e}function Ln(){let t,e,n,o;for(Dr++,t=Ir,e=[],n=gn(),n===r&&(n=dn(),n===r&&(n=pn(),n===r&&(n=bn())));n!==r;)e.push(n),n=Ir,o=Tn(),o!==r?(o=gn(),o===r&&(o=dn(),o===r&&(o=pn(),o===r&&(o=bn()))),o===r?(Ir=n,n=r):n=o):n=o;return e.length<2?(Ir=t,t=r):t=e,Dr--,t===r&&(e=r,0===Dr&&Wr(Fe)),t}function An(){let e,n,o,s,u,l,i;if(Dr++,e=Ir,n=Rn(),o=function(){let e,n,o,s,u,l,i;e=Ir,n=t.substr(Ir,3),n.toLowerCase()===Y?Ir+=3:(n=r,0===Dr&&Wr(Be));n===r&&(n=t.substr(Ir,2),n.toLowerCase()===k?Ir+=2:(n=r,0===Dr&&Wr(Me)),n===r&&(n=t.substr(Ir,2),n.toLowerCase()===G?Ir+=2:(n=r,0===Dr&&Wr(qe)),n===r&&(n=t.substr(Ir,7),n.toLowerCase()===Q?Ir+=7:(n=r,0===Dr&&Wr(Ze)),n===r&&(n=t.substr(Ir,4),n.toLowerCase()===V?Ir+=4:(n=r,0===Dr&&Wr(He)),n===r&&(n=t.substr(Ir,6),n.toLowerCase()===J?Ir+=6:(n=r,0===Dr&&Wr(We)),n===r&&(n=Ir,o=t.substr(Ir,8),o.toLowerCase()===K?Ir+=8:(o=r,0===Dr&&Wr(Ye)),o!==r?(s=Ir,Dr++,u=yn(),Dr--,u===r?s=void 0:(Ir=s,s=r),s!==r?n=o:(Ir=n,n=r)):(Ir=n,n=r)))))));n!==r?(o=Ir,Dr++,s=Sn(),Dr--,s===r?o=void 0:(Ir=o,o=r),o!==r?e=n:(Ir=e,e=r)):(Ir=e,e=r);if(e===r&&(e=Ir,n=t.substr(Ir,4),n.toLowerCase()===X?Ir+=4:(n=r,0===Dr&&Wr(ke)),n===r&&(n=t.substr(Ir,4),n.toLowerCase()===tt?Ir+=4:(n=r,0===Dr&&Wr(Ge)),n===r&&(n=t.substr(Ir,4),n.toLowerCase()===et?Ir+=4:(n=r,0===Dr&&Wr(Qe)),n===r&&(n=t.substr(Ir,4),n.toLowerCase()===rt?Ir+=4:(n=r,0===Dr&&Wr(Ve)),n===r&&(n=t.substr(Ir,3),n.toLowerCase()===nt?Ir+=3:(n=r,0===Dr&&Wr(Je)))))),n!==r?(o=Ir,Dr++,s=Sn(),Dr--,s===r?o=void 0:(Ir=o,o=r),o!==r?e=n:(Ir=e,e=r)):(Ir=e,e=r),e===r)){for(e=Ir,n=[],o=Ir,s=t.substr(Ir,2),s.toLowerCase()===ot?Ir+=2:(s=r,0===Dr&&Wr(Ke)),s===r&&(s=t.substr(Ir,3),s.toLowerCase()===st?Ir+=3:(s=r,0===Dr&&Wr(Xe)),s===r&&(s=t.substr(Ir,4),s.toLowerCase()===ut?Ir+=4:(s=r,0===Dr&&Wr(tr)),s===r&&(s=t.substr(Ir,5),s.toLowerCase()===lt?Ir+=5:(s=r,0===Dr&&Wr(er))))),s!==r?(u=Ir,Dr++,l=Sn(),Dr--,l===r?u=void 0:(Ir=u,u=r),u!==r?o=s:(Ir=o,o=r)):(Ir=o,o=r);o!==r;)n.push(o),o=Ir,s=Rn(),s=Ir,u=t.substr(Ir,2),u.toLowerCase()===ot?Ir+=2:(u=r,0===Dr&&Wr(Ke)),u===r&&(u=t.substr(Ir,3),u.toLowerCase()===st?Ir+=3:(u=r,0===Dr&&Wr(Xe)),u===r&&(u=t.substr(Ir,4),u.toLowerCase()===ut?Ir+=4:(u=r,0===Dr&&Wr(tr)),u===r&&(u=t.substr(Ir,5),u.toLowerCase()===lt?Ir+=5:(u=r,0===Dr&&Wr(er))))),u!==r?(l=Ir,Dr++,i=Sn(),Dr--,i===r?l=void 0:(Ir=l,l=r),l!==r?s=u:(Ir=s,s=r)):(Ir=s,s=r),s===r?(Ir=o,o=r):o=s;n.length<1?(Ir=e,e=r):e=n}return e}(),o===r)if(o=Ir,s=Ir,Dr++,u=ln(),Dr--,u===r?s=void 0:(Ir=s,s=r),s!==r){if(u=Ir,l=[],i=t.charAt(Ir),yt.test(i)?Ir++:(i=r,0===Dr&&Wr(ze)),i!==r)for(;i!==r;)l.push(i),i=t.charAt(Ir),yt.test(i)?Ir++:(i=r,0===Dr&&Wr(ze));else l=r;u=l!==r?t.substring(u,Ir):l,u!==r?o=u:(Ir=o,o=r)}else Ir=o,o=r;return o!==r?(s=Rn(),e=o):(Ir=e,e=r),Dr--,e===r&&(n=r,0===Dr&&Wr(De)),e}function mn(){let t,e,n,o;return t=Ir,e=yn(),e!==r?(n=Gr(),n!==r?(o=_n(),o!==r?t=n:(Ir=t,t=r)):(Ir=t,t=r)):(Ir=t,t=r),t}function En(){let e,n,o,s;return e=Ir,n=Rn(),63===t.charCodeAt(Ir)?(o=W,Ir++):(o=r,0===Dr&&Wr(Ue)),o!==r?(s=Rn(),jr=e,e=On.shift()):(Ir=e,e=r),e}function xn(){let e,n,o,s;return e=Ir,n=Rn(),123===t.charCodeAt(Ir)?(o=P,Ir++):(o=r,0===Dr&&Wr(ie)),o!==r?(s=Rn(),n=[n,o,s],e=n):(Ir=e,e=r),e}function vn(){let e,n,o,s;return e=Ir,n=Rn(),125===t.charCodeAt(Ir)?(o=D,Ir++):(o=r,0===Dr&&Wr(ce)),o!==r?(s=Rn(),n=[n,o,s],e=n):(Ir=e,e=r),e}function yn(){let e,n,o,s;return e=Ir,n=Rn(),40===t.charCodeAt(Ir)?(o=gt,Ir++):(o=r,0===Dr&&Wr(Cr)),o!==r?(s=Rn(),n=[n,o,s],e=n):(Ir=e,e=r),e}function _n(){let e,n,o,s;return e=Ir,n=Rn(),41===t.charCodeAt(Ir)?(o=wt,Ir++):(o=r,0===Dr&&Wr(br)),o!==r?(s=Rn(),n=[n,o,s],e=n):(Ir=e,e=r),e}function Sn(){let e;return e=t.charAt(Ir),Tt.test(e)?Ir++:(e=r,0===Dr&&Wr(gr)),e}function Tn(){let e,n,o,s;return Dr++,e=Ir,n=Rn(),44===t.charCodeAt(Ir)?(o=Lt,Ir++):(o=r,0===Dr&&Wr(Lr)),o!==r?(s=Rn(),e=o):(Ir=e,e=r),Dr--,e===r&&(n=r,0===Dr&&Wr(wr)),e}function $n(){let e,n,o,s;return Dr++,e=Ir,n=Rn(),46===t.charCodeAt(Ir)?(o=at,Ir++):(o=r,0===Dr&&Wr(sr)),o!==r?(s=Rn(),jr=e,e="."):(Ir=e,e=r),Dr--,e===r&&(n=r,0===Dr&&Wr(Ar)),e}function Rn(){let e,n,o,s,u;for(Dr++,e=Ir,n=Ir,o=[],s=t.charAt(Ir),$t.test(s)?Ir++:(s=r,0===Dr&&Wr(mr));s!==r;)o.push(s),s=t.charAt(Ir),$t.test(s)?Ir++:(s=r,0===Dr&&Wr(mr));return n=t.substring(n,Ir),o=Ir,s=In(),s!==r?(u=Rn(),s=[s,u],o=s):(Ir=o,o=r),o===r&&(o=null),n=[n,o],e=n,Dr--,e}function Fn(){let e,n,o,s,u;if(Dr++,e=Ir,n=Ir,o=[],s=t.charAt(Ir),$t.test(s)?Ir++:(s=r,0===Dr&&Wr(mr)),s!==r)for(;s!==r;)o.push(s),s=t.charAt(Ir),$t.test(s)?Ir++:(s=r,0===Dr&&Wr(mr));else o=r;return n=o!==r?t.substring(n,Ir):o,n!==r?(o=Ir,s=In(),s!==r?(u=Rn(),s=[s,u],o=s):(Ir=o,o=r),o===r&&(o=null),n=[n,o],e=n):(Ir=e,e=r),Dr--,e===r&&(n=r,0===Dr&&Wr(Ar)),e}function In(){let e,n,o,s,u;if(Dr++,e=Ir,t.substr(Ir,2)===At?(n=At,Ir+=2):(n=r,0===Dr&&Wr(Er)),n===r&&(t.substr(Ir,2)===mt?(n=mt,Ir+=2):(n=r,0===Dr&&Wr(xr))),n!==r){for(o=Ir,s=[],u=t.charAt(Ir),Rt.test(u)?Ir++:(u=r,0===Dr&&Wr(vr));u!==r;)s.push(u),u=t.charAt(Ir),Rt.test(u)?Ir++:(u=r,0===Dr&&Wr(vr));o=t.substring(o,Ir),n=[n,o],e=n}else Ir=e,e=r;return Dr--,e===r&&(n=r,0===Dr&&Wr(Ar)),e}const jn=[],On=e.args;let Nn=0;const Pn=!On?.length||!e.startRule&&peg$parse.late_binding?()=>jn[Nn++]=Un:()=>jn[Nn]=fluent.expr(On[Nn++]),Un={ref:["?"],param:!0};Nr=s();const Dn=Nr!==r&&Ir===t.length;function zn(){throw Nr!==r&&Ir<t.length&&Wr({type:"end"}),Yr(Ur,Pr<t.length?function(e=Ir){const r=t.codePointAt(e);return void 0===r?"":String.fromCodePoint(r)}(Pr):null,Pr<t.length?Hr(Pr,Pr+1):Hr(Pr,Pr))}return e.peg$library?{peg$result:Nr,peg$currPos:Ir,peg$FAILED:r,peg$maxFailExpected:Ur,peg$maxFailPos:Pr,peg$success:Dn,peg$throw:Dn?void 0:zn}:Dn?Nr:void zn()}const peg$allowedStartRules=["CQL","subject","columns","values","ref","val","expr","set","with","where","groupBy","orderBy"];export{peg$allowedStartRules as StartRules,peg$SyntaxError as SyntaxError,peg$parse as parse};
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
|
|
2
|
+
/**
|
|
3
|
+
* This is the central entry point for creating queries from various types of input:
|
|
4
|
+
* - If the input is a `Query` instance already, it's returned as-is.
|
|
5
|
+
* - If the input is a `string` or a template literal, it's parsed into a CQN object.
|
|
6
|
+
* - If the input is an `object` with a recognized query kind, it's cast into an instance of
|
|
7
|
+
* the corresponding query class.
|
|
8
|
+
* @param { Query | string | object } qso - The input, as described above, to be converted into an instance of a Query subclass.
|
|
9
|
+
* @param { ...any } args - Optional arguments for template literals or parameterized queries.
|
|
10
|
+
* @returns { SELECT_ & INSERT_ & UPSERT_ & UPDATE_ & DELETE_ }
|
|
11
|
+
*/
|
|
12
|
+
export const cql = Query.for = (qso, ...args) => {
|
|
13
|
+
if (!qso || qso instanceof Query) return qso
|
|
14
|
+
if (qso.raw) return cql.cache.query4 (qso, ...args)
|
|
15
|
+
if (typeof qso === 'string') return peg.parse (qso, {args})
|
|
16
|
+
else for (let k in qso) if (k in Query.for) //> usually query.kind is first key
|
|
17
|
+
return Object.setPrototypeOf (qso, Query.for[k].prototype)
|
|
18
|
+
return null //> for any other object
|
|
19
|
+
}
|
|
20
|
+
export default cql
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
// Re-export all the helper functions and classes from the xl module
|
|
24
|
+
export * from './xl/ttl.js'
|
|
25
|
+
import * as peg from '../cql/parser.min.js'
|
|
26
|
+
import { Query } from './query.js'
|
|
27
|
+
export { Query }
|
|
28
|
+
|
|
29
|
+
// Export fluent variants of the query classes
|
|
30
|
+
import { SELECT as SELECT_ } from './ql/select.js'
|
|
31
|
+
import { INSERT as INSERT_ } from './ql/insert.js'
|
|
32
|
+
import { UPSERT as UPSERT_ } from './ql/insert.js'
|
|
33
|
+
import { UPDATE as UPDATE_ } from './ql/update.js'
|
|
34
|
+
import { DELETE as DELETE_ } from './ql/delete.js'
|
|
35
|
+
import { CALL as CALL_ } from './ql/call-action.js'
|
|
36
|
+
|
|
37
|
+
export const SELECT = chimera (SELECT_, SELECT_.columns)
|
|
38
|
+
export const INSERT = chimera (INSERT_, INSERT_.entries)
|
|
39
|
+
export const UPSERT = chimera (UPSERT_, UPSERT_.entries)
|
|
40
|
+
export const UPDATE = chimera (UPDATE_, UPDATE_.entity)
|
|
41
|
+
export const DELETE = chimera (DELETE_, DELETE_.from)
|
|
42
|
+
export const CALL = chimera (CALL_, CALL_.action)
|
|
43
|
+
|
|
44
|
+
/**
|
|
45
|
+
* Turns subclasses of Query into fluent APIs that allow constructing instances with `new`
|
|
46
|
+
* as well as plain function calls. For example, this enables usages like these: @example
|
|
47
|
+
* SELECT`ID,title`.from`Books`
|
|
48
|
+
* UPDATE`Books`.with`${data}`
|
|
49
|
+
* @param factory - The function to be called when the fluent API is invoked without `new`.
|
|
50
|
+
* @type <clazz> (clazz:clazz, factory:()=> clazz) => factory & clazz
|
|
51
|
+
*/
|
|
52
|
+
function chimera (clazz, factory) { const kind = clazz.name
|
|
53
|
+
function fx (...args) { return new.target ? new clazz : factory.call (clazz,...args) }
|
|
54
|
+
Object.defineProperty (clazz.prototype, '_', { get(){ return this[kind] }})
|
|
55
|
+
Object.defineProperty (clazz.prototype, 'kind', { value: kind })
|
|
56
|
+
Object.defineProperty (clazz, 'name', { value: 'Query' })
|
|
57
|
+
Object.defineProperty (fx, 'name', { value: kind })
|
|
58
|
+
Object.defineProperty (fx, 'class', { value: clazz })
|
|
59
|
+
Object.defineProperty (fx, 'prototype', { value: clazz.prototype })
|
|
60
|
+
Object.setPrototypeOf (fx,clazz) //> adds static members
|
|
61
|
+
return Query.for[kind] = fx
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
|
|
65
|
+
// Prepare a cache for parsed queries, and export it as part of the cql facade
|
|
66
|
+
// for easy access and control over caching behavior.
|
|
67
|
+
import { QueryCache } from './ql/cache.js'
|
|
68
|
+
cql.cache = new QueryCache
|
|
69
|
+
cql.cache.enabled = false //> disable caching by default
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import * as peg from '../../cql/parser.min.js'
|
|
2
|
+
import { Query } from '../query.js'
|
|
3
|
+
|
|
4
|
+
export class QueryCache extends Map {
|
|
5
|
+
|
|
6
|
+
cached (strings, ...args) {
|
|
7
|
+
if (!strings?.raw) return this.parse (strings, ...args)
|
|
8
|
+
const cached = this.get (strings)
|
|
9
|
+
if (cached) {
|
|
10
|
+
const q = new Query.for[cached.kind]
|
|
11
|
+
q[q.kind] = cached[cached.kind]
|
|
12
|
+
q.params = cached.params
|
|
13
|
+
if (args?.length) q.args = args
|
|
14
|
+
return q
|
|
15
|
+
} else {
|
|
16
|
+
const q = this.parse (strings, ...args)
|
|
17
|
+
this.set (strings, q)
|
|
18
|
+
return q
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
parse (strings, ...args) {
|
|
23
|
+
const src = String.raw (strings, ...'?'.repeat(args.length))
|
|
24
|
+
return peg.parse (src, {args})
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
get enabled () { return peg.parse.late_binding }
|
|
28
|
+
set enabled (v) {
|
|
29
|
+
this.query4 = v ? this.cached : this.parse
|
|
30
|
+
peg.parse.late_binding = v
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
query4 = this.parse
|
|
34
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { subject, where } from '../xl/ttl.js'
|
|
2
|
+
import { Query } from '../query.js'
|
|
3
|
+
|
|
4
|
+
export class DELETE extends Query { DELETE = {}
|
|
5
|
+
static one (...args) { return (new this)._set('one',true)._set('from', subject (...args)) }
|
|
6
|
+
static from (...args) { return (new this)._set('from', subject (...args)) }
|
|
7
|
+
where (...args) { return this._add('where', where (...args)) }
|
|
8
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { subject, columns, values } from '../xl/ttl.js'
|
|
2
|
+
import { Query } from '../query.js'
|
|
3
|
+
|
|
4
|
+
const unwrapped = args => Array.isArray(args[0]) ? args[0] : args
|
|
5
|
+
|
|
6
|
+
export class XSERT extends Query {
|
|
7
|
+
static entries (...args) { return (new this).entries(...args) }
|
|
8
|
+
static into (x,...tail) {
|
|
9
|
+
if (x.raw) return (new this)._set ('into', subject(x,...tail)) //> INSERT.into`Foo`
|
|
10
|
+
const insert = (new this)._set ('into', subject(x)) //> INSERT.into(Foo)
|
|
11
|
+
return !tail.length ? insert : insert._tail(...tail) //> INSERT.into(Foo, ...?)
|
|
12
|
+
}; _tail (...tail) {
|
|
13
|
+
if (unwrapped(tail)[0]?.split) return this.columns(...tail) //> INSERT.into(Foo, columns)
|
|
14
|
+
return this._set ('entries', unwrapped(tail)) //> INSERT.into(Foo, entries)
|
|
15
|
+
}
|
|
16
|
+
into (...args) { return this._set('into', subject(...args)) }
|
|
17
|
+
entries (...args) { return this._set('entries', unwrapped(args)) }
|
|
18
|
+
columns (...args) { return this._add('columns', columns(...args).map(c => c.ref[0])) }
|
|
19
|
+
values (...args) { return this._set('values', values(...args)) }
|
|
20
|
+
rows (...args) { return this._set('rows', unwrapped(args)) }
|
|
21
|
+
from (...args) { return this._set('from', Query.for(...args)) }
|
|
22
|
+
get subject() { return this._.into }
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
export class INSERT extends XSERT { INSERT = {} }
|
|
26
|
+
export class UPSERT extends XSERT { UPSERT = {} }
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { subject, columns, where, orderBy, val } from '../xl/ttl.js'
|
|
2
|
+
import { Query } from '../query.js'
|
|
3
|
+
|
|
4
|
+
export class SELECT extends Query { SELECT = {}
|
|
5
|
+
static from (...args) { return (new this).from (...args) }
|
|
6
|
+
static columns (...args) { return (new this).columns (...args) }
|
|
7
|
+
static get localized() { return (new this)._set('localized', true) }
|
|
8
|
+
static get distinct() { return (new this)._set('distinct', true) }
|
|
9
|
+
static get one() { return (new this)._set('one', true) }
|
|
10
|
+
get localized() { return this._set('localized', true) }
|
|
11
|
+
get distinct() { return this._set('distinct', true) }
|
|
12
|
+
columns (...args) { return this._add('columns', columns (...args)) }
|
|
13
|
+
from (...args) { return this._set('from', subject (...args)) }
|
|
14
|
+
where (...args) { return this._add('where', where (...args)) }
|
|
15
|
+
having (...args) { return this._add('having', where (...args)) }
|
|
16
|
+
groupBy (...args) { return this._add('groupBy', columns (...args)) }
|
|
17
|
+
orderBy (...args) { return this._add('orderBy', orderBy (...args)) }
|
|
18
|
+
limit (...args) { return args[0]?.raw ? this.top(...args) : this.top(args[0]).skip(args[1]) }
|
|
19
|
+
top (...args) { if (args[0]) (this._.limit ??= {}).rows = val(...args); return this }
|
|
20
|
+
skip (...args) { if (args[0]) (this._.limit ??= {}).offset = val(...args); return this }
|
|
21
|
+
offset (...args) { return this.skip(...args) }
|
|
22
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { subject, where, ttl } from '../xl/ttl.js'
|
|
2
|
+
import { Query } from '../query.js'
|
|
3
|
+
|
|
4
|
+
export class UPDATE extends Query { UPDATE = {}
|
|
5
|
+
static one (...args) { return (new this)._set('one',true)._set('entity', subject (...args)) }
|
|
6
|
+
static entity (...args) { return (new this)._set('entity', subject (...args)) }
|
|
7
|
+
where (...args) { return this._add ('where', where (...args)) }
|
|
8
|
+
with (...args) {
|
|
9
|
+
if (args[0]?.raw) this._set('data', ttl('with',...args))
|
|
10
|
+
else this._set('data', args[0])
|
|
11
|
+
return this
|
|
12
|
+
}
|
|
13
|
+
set (...args) {
|
|
14
|
+
// PARKED: legacy with/data split behavior from @sap/cds
|
|
15
|
+
// if (args[0]?.raw) { //> split into 'with' and 'data'
|
|
16
|
+
// const w={}, d={}, wd = ttl('set',...args)
|
|
17
|
+
// for (let k in wd) 'val' in wd[k] ? d[k] = wd[k].val : w[k] = wd[k]
|
|
18
|
+
// if (Object.keys(w).length) this._set('with', w)
|
|
19
|
+
// if (Object.keys(d).length) this._set('data', d)
|
|
20
|
+
// }
|
|
21
|
+
if (args[0]?.raw) this._set('with', ttl('set',...args))
|
|
22
|
+
else this._set('data', args[0])
|
|
23
|
+
return this
|
|
24
|
+
}
|
|
25
|
+
get subject() { return this._.entity }
|
|
26
|
+
}
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
import { expr } from './xl/fluent.js'
|
|
2
|
+
|
|
3
|
+
export class Query {
|
|
4
|
+
|
|
5
|
+
// These are required for Peggy Live Preview in VSCode
|
|
6
|
+
/** @private */ get kind() { return this.constructor.name }
|
|
7
|
+
/** @private */ get _() { return this[this.kind] }
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* Returns the main subject `{ref}` of the query, which refers to the entity being queried or modified.
|
|
11
|
+
* @returns {ref:string[]} The main subject of the query.
|
|
12
|
+
*/
|
|
13
|
+
get subject() { return this._.from }
|
|
14
|
+
|
|
15
|
+
// Non-enumerable properties that are only valid within the same process
|
|
16
|
+
/** @private */ set source (cql) { Object.defineProperty (this, 'source', { value: cql, writable: true }) }
|
|
17
|
+
/** @private */ set params (arr) { Object.defineProperty (this, 'params', { value: arr, writable: true }) }
|
|
18
|
+
/** @private */ set args (arr) { Object.defineProperty (this, 'args', { value: arr, writable: true }) }
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* - Fills in any binding `{param}`s with corresponding `{val}`s from given `args`.
|
|
22
|
+
* - If no `args` are provided, the ones collected during parsing are used.
|
|
23
|
+
*/
|
|
24
|
+
bind (...args) {
|
|
25
|
+
let vals = args?.length ? args : this.args || [], i=0
|
|
26
|
+
if (this.params) for (let p of this.params) {
|
|
27
|
+
if ('list' in p) p.list = vals[i++].map(expr)
|
|
28
|
+
else p.val = vals[i++]
|
|
29
|
+
delete p.param
|
|
30
|
+
delete p.ref
|
|
31
|
+
}
|
|
32
|
+
else !function traverse (cqn) { // for manually created CQNs
|
|
33
|
+
Object.entries (cqn) .forEach (([k,x]) => {
|
|
34
|
+
if (!x || typeof x !== 'object') return
|
|
35
|
+
if (!x.param) return traverse(x)
|
|
36
|
+
let val = vals[i++]; if (val === undefined) return
|
|
37
|
+
let y = cqn[k] = {val}
|
|
38
|
+
if (x.as) y.as = x.as
|
|
39
|
+
})
|
|
40
|
+
} (this)
|
|
41
|
+
return this
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
/**
|
|
45
|
+
* - Creates a shallow clone of the given `query`.
|
|
46
|
+
* - Subsequent changes to the clone will not affect the original.
|
|
47
|
+
* - However, changes to nested objects will affect both the original and the clone.
|
|
48
|
+
* @param clauses - Optional list of objects with clauses to override in the clone.
|
|
49
|
+
* @type <T> (this:T, clauses:{columns,from,where,having,groupy,orderBy,limit}[]) => T
|
|
50
|
+
*/
|
|
51
|
+
clone (...clauses) {
|
|
52
|
+
const _ = this.kind || Object.keys(this)[0]
|
|
53
|
+
return Object.assign ({ __proto__: this,
|
|
54
|
+
[_]: { __proto__: this[_] }
|
|
55
|
+
}, ...clauses)
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
/**
|
|
59
|
+
* Adds the given values to the specified clause in the CQN. If the clause already
|
|
60
|
+
* exists, the new values are appended to the existing ones. Otherwise, a clause
|
|
61
|
+
* is added with the provided values.
|
|
62
|
+
*/
|
|
63
|
+
_add (clause, values, former = this._[clause]) {
|
|
64
|
+
if (values === undefined) return this
|
|
65
|
+
this._[clause] = !former ? values : [ ...former, ...values ]
|
|
66
|
+
return this
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
/**
|
|
70
|
+
* Sets the specified clause in the CQN to the given value, replacing existing
|
|
71
|
+
* one if present, or overriding it in case of cloned queries.
|
|
72
|
+
*/
|
|
73
|
+
_set (clause, value) {
|
|
74
|
+
if (value === undefined) return this
|
|
75
|
+
this._[clause] = value
|
|
76
|
+
return this
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
// Custom inspect method to improve the output, e.g. in repl, console.log,
|
|
80
|
+
[Symbol.for('nodejs.util.inspect.custom')] (depth, options, inspect) {
|
|
81
|
+
return `${this.kind} ${inspect(this[this.kind], options)}`
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
/** @private */ Query.for = {} //> filled in from ./index.js
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
const unwrapped = args => Array.isArray(args[0]) ? args[0] : args
|
|
2
|
+
|
|
3
|
+
export const val = (v) => ({ val: v })
|
|
4
|
+
export const ref = (r) => ({ ref: String(r).split('.') })
|
|
5
|
+
export const expr = (x) => {
|
|
6
|
+
if (Array.isArray(x)) return { list: x.map(expr) }
|
|
7
|
+
if (x && typeof x === 'object') return x //> already a cxn object
|
|
8
|
+
else return val(x)
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export const subject = (x,pk) => {
|
|
12
|
+
if (x.ref) return x
|
|
13
|
+
if (x.name) return Object.defineProperty ({ref:[x.name]},'target',{value:x})
|
|
14
|
+
let ref = [ !pk ? x : { id:x, where: where(pk) } ]
|
|
15
|
+
return {ref}
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export const columns = (...args) => {
|
|
19
|
+
return unwrapped(args) .map (a => typeof a === 'string' ? ref(a) : val(a))
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
export const values = (...args) => {
|
|
23
|
+
return unwrapped(args) .map (expr)
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
export const where = (x) => {
|
|
27
|
+
if (!x || typeof x !== 'object') return [ val(x) ]
|
|
28
|
+
return Object.entries(x) .map (([k,v]) => ['and', ref(k), '=', val(v)])
|
|
29
|
+
.flat().slice(1)
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
export const having = where
|
|
33
|
+
export const groupBy = columns
|
|
34
|
+
export const orderBy = (...args) => {
|
|
35
|
+
// orderBy({ a:1, b:-1 })
|
|
36
|
+
if (typeof (args = unwrapped(args))[0] === 'object')
|
|
37
|
+
return Object.entries(args[0]) .map (
|
|
38
|
+
([k,v]) => ({ ref:[k], sort: { [1]:'asc',[-1]:'desc' }[v] || v })
|
|
39
|
+
)
|
|
40
|
+
// orderBy('a desc','b')
|
|
41
|
+
else return args.map (ordering_term => {
|
|
42
|
+
const [,c,ad] = /^([^\s]+)(?:\s+(asc|desc))?$/i .exec (ordering_term)
|
|
43
|
+
const ref = { ref: c.split('.') }
|
|
44
|
+
if (ad) ref.sort = ad.toLowerCase()
|
|
45
|
+
return ref
|
|
46
|
+
})
|
|
47
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import * as peg from '../../cql/parser.min.js'
|
|
2
|
+
import * as fluent from './fluent.js'
|
|
3
|
+
export { fluent }
|
|
4
|
+
|
|
5
|
+
export const ttl = (rule, x,...args) => {
|
|
6
|
+
const src = String.raw (x,...'?'.repeat(args.length))
|
|
7
|
+
return peg.parse (src, { startRule: rule, args })
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export const ttl_ = (rule, ffn) => (x,...args) => {
|
|
11
|
+
if (x?.raw) return ttl (rule, x,...args)
|
|
12
|
+
else return ffn (x,...args)
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export const val = ttl_('val', fluent.val)
|
|
16
|
+
export const ref = ttl_('ref', fluent.ref)
|
|
17
|
+
export const expr = ttl_('expr', fluent.expr)
|
|
18
|
+
export const subject = ttl_('subject', fluent.subject)
|
|
19
|
+
export const columns = ttl_('columns', fluent.columns)
|
|
20
|
+
export const values = ttl_('values', fluent.values)
|
|
21
|
+
export const where = ttl_('where', fluent.where)
|
|
22
|
+
export const having = ttl_('having', fluent.having)
|
|
23
|
+
export const groupBy = ttl_('groupBy', fluent.groupBy)
|
|
24
|
+
export const orderBy = ttl_('orderBy', fluent.orderBy)
|
|
@@ -0,0 +1,201 @@
|
|
|
1
|
+
Apache License
|
|
2
|
+
Version 2.0, January 2004
|
|
3
|
+
http://www.apache.org/licenses/
|
|
4
|
+
|
|
5
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
6
|
+
|
|
7
|
+
1. Definitions.
|
|
8
|
+
|
|
9
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
10
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
11
|
+
|
|
12
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
13
|
+
the copyright owner that is granting the License.
|
|
14
|
+
|
|
15
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
16
|
+
other entities that control, are controlled by, or are under common
|
|
17
|
+
control with that entity. For the purposes of this definition,
|
|
18
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
19
|
+
direction or management of such entity, whether by contract or
|
|
20
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
21
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
22
|
+
|
|
23
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
24
|
+
exercising permissions granted by this License.
|
|
25
|
+
|
|
26
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
27
|
+
including but not limited to software source code, documentation
|
|
28
|
+
source, and configuration files.
|
|
29
|
+
|
|
30
|
+
"Object" form shall mean any form resulting from mechanical
|
|
31
|
+
transformation or translation of a Source form, including but
|
|
32
|
+
not limited to compiled object code, generated documentation,
|
|
33
|
+
and conversions to other media types.
|
|
34
|
+
|
|
35
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
36
|
+
Object form, made available under the License, as indicated by a
|
|
37
|
+
copyright notice that is included in or attached to the work
|
|
38
|
+
(an example is provided in the Appendix below).
|
|
39
|
+
|
|
40
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
41
|
+
form, that is based on (or derived from) the Work and for which the
|
|
42
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
43
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
44
|
+
of this License, Derivative Works shall not include works that remain
|
|
45
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
46
|
+
the Work and Derivative Works thereof.
|
|
47
|
+
|
|
48
|
+
"Contribution" shall mean any work of authorship, including
|
|
49
|
+
the original version of the Work and any modifications or additions
|
|
50
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
51
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
52
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
53
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
54
|
+
means any form of electronic, verbal, or written communication sent
|
|
55
|
+
to the Licensor or its representatives, including but not limited to
|
|
56
|
+
communication on electronic mailing lists, source code control systems,
|
|
57
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
58
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
59
|
+
excluding communication that is conspicuously marked or otherwise
|
|
60
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
61
|
+
|
|
62
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
63
|
+
on behalf of whom a Contribution has been received by Licensor and
|
|
64
|
+
subsequently incorporated within the Work.
|
|
65
|
+
|
|
66
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
67
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
68
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
69
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
70
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
71
|
+
Work and such Derivative Works in Source or Object form.
|
|
72
|
+
|
|
73
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
74
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
75
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
76
|
+
(except as stated in this section) patent license to make, have made,
|
|
77
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
78
|
+
where such license applies only to those patent claims licensable
|
|
79
|
+
by such Contributor that are necessarily infringed by their
|
|
80
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
81
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
82
|
+
institute patent litigation against any entity (including a
|
|
83
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
84
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
85
|
+
or contributory patent infringement, then any patent licenses
|
|
86
|
+
granted to You under this License for that Work shall terminate
|
|
87
|
+
as of the date such litigation is filed.
|
|
88
|
+
|
|
89
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
90
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
91
|
+
modifications, and in Source or Object form, provided that You
|
|
92
|
+
meet the following conditions:
|
|
93
|
+
|
|
94
|
+
(a) You must give any other recipients of the Work or
|
|
95
|
+
Derivative Works a copy of this License; and
|
|
96
|
+
|
|
97
|
+
(b) You must cause any modified files to carry prominent notices
|
|
98
|
+
stating that You changed the files; and
|
|
99
|
+
|
|
100
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
101
|
+
that You distribute, all copyright, patent, trademark, and
|
|
102
|
+
attribution notices from the Source form of the Work,
|
|
103
|
+
excluding those notices that do not pertain to any part of
|
|
104
|
+
the Derivative Works; and
|
|
105
|
+
|
|
106
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
107
|
+
distribution, then any Derivative Works that You distribute must
|
|
108
|
+
include a readable copy of the attribution notices contained
|
|
109
|
+
within such NOTICE file, excluding those notices that do not
|
|
110
|
+
pertain to any part of the Derivative Works, in at least one
|
|
111
|
+
of the following places: within a NOTICE text file distributed
|
|
112
|
+
as part of the Derivative Works; within the Source form or
|
|
113
|
+
documentation, if provided along with the Derivative Works; or,
|
|
114
|
+
within a display generated by the Derivative Works, if and
|
|
115
|
+
wherever such third-party notices normally appear. The contents
|
|
116
|
+
of the NOTICE file are for informational purposes only and
|
|
117
|
+
do not modify the License. You may add Your own attribution
|
|
118
|
+
notices within Derivative Works that You distribute, alongside
|
|
119
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
120
|
+
that such additional attribution notices cannot be construed
|
|
121
|
+
as modifying the License.
|
|
122
|
+
|
|
123
|
+
You may add Your own copyright statement to Your modifications and
|
|
124
|
+
may provide additional or different license terms and conditions
|
|
125
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
126
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
127
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
128
|
+
the conditions stated in this License.
|
|
129
|
+
|
|
130
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
131
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
132
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
133
|
+
this License, without any additional terms or conditions.
|
|
134
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
135
|
+
the terms of any separate license agreement you may have executed
|
|
136
|
+
with Licensor regarding such Contributions.
|
|
137
|
+
|
|
138
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
139
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
140
|
+
except as required for reasonable and customary use in describing the
|
|
141
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
|
142
|
+
|
|
143
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
144
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
145
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
146
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
147
|
+
implied, including, without limitation, any warranties or conditions
|
|
148
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
149
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
150
|
+
appropriateness of using or redistributing the Work and assume any
|
|
151
|
+
risks associated with Your exercise of permissions under this License.
|
|
152
|
+
|
|
153
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
154
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
155
|
+
unless required by applicable law (such as deliberate and grossly
|
|
156
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
157
|
+
liable to You for damages, including any direct, indirect, special,
|
|
158
|
+
incidental, or consequential damages of any character arising as a
|
|
159
|
+
result of this License or out of the use or inability to use the
|
|
160
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
161
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
162
|
+
other commercial damages or losses), even if such Contributor
|
|
163
|
+
has been advised of the possibility of such damages.
|
|
164
|
+
|
|
165
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
166
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
167
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
168
|
+
or other liability obligations and/or rights consistent with this
|
|
169
|
+
License. However, in accepting such obligations, You may act only
|
|
170
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
171
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
172
|
+
defend, and hold each Contributor harmless for any liability
|
|
173
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
174
|
+
of your accepting any such warranty or additional liability.
|
|
175
|
+
|
|
176
|
+
END OF TERMS AND CONDITIONS
|
|
177
|
+
|
|
178
|
+
APPENDIX: How to apply the Apache License to your work.
|
|
179
|
+
|
|
180
|
+
To apply the Apache License to your work, attach the following
|
|
181
|
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
|
182
|
+
replaced with your own identifying information. (Don't include
|
|
183
|
+
the brackets!) The text should be enclosed in the appropriate
|
|
184
|
+
comment syntax for the file format. We also recommend that a
|
|
185
|
+
file or class name and description of purpose be included on the
|
|
186
|
+
same "printed page" as the copyright notice for easier
|
|
187
|
+
identification within third-party archives.
|
|
188
|
+
|
|
189
|
+
Copyright [yyyy] [name of copyright owner]
|
|
190
|
+
|
|
191
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
192
|
+
you may not use this file except in compliance with the License.
|
|
193
|
+
You may obtain a copy of the License at
|
|
194
|
+
|
|
195
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
196
|
+
|
|
197
|
+
Unless required by applicable law or agreed to in writing, software
|
|
198
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
199
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
200
|
+
See the License for the specific language governing permissions and
|
|
201
|
+
limitations under the License.
|