diff --git a/apis/env.d.ts b/apis/env.d.ts index 1bbe7ebe..5c51af0d 100644 --- a/apis/env.d.ts +++ b/apis/env.d.ts @@ -14,6 +14,71 @@ export const env: { odata: any, query: any, sql: any, + features: { + + /** + * @see [capire](https://cap.cloud.sap/docs/guides/databases#db-constraints) + */ + assert_integrity: 'off' | 'app' | 'db', + + /** + * @see [capire](https://cap.cloud.sap/docs/node.js/cds-log#logging-in-production) + */ + kibana_formatter: boolean, + + /** + * @experimental + * @see [capire](https://cap.cloud.sap/docs/advanced/odata#transformations) + */ + odata_new_parser: boolean, + + /** + * @see [capire](https://cap.cloud.sap/docs/releases/archive/2021/oct21#consuming-odata-v2-services-in-node-js) + */ + cds_tx_inheritance: boolean, + + /** + * @see [capire](https://cap.cloud.sap/docs/releases/archive/2022/jun22#optimized-search-on-sap-hana-as-default) + */ + optimized_search: boolean, + + /** + * @see [capire](https://cap.cloud.sap/docs/releases/archive/2022/jun22#new-rest-adapter-as-default) + */ + rest_new_adapter: boolean, + + /** + * @see [capire](https://cap.cloud.sap/docs/releases/jun23#new-protocol-specific-service-endpoints) + */ + serve_on_root: boolean, + + /** + * @see [capire](https://cap.cloud.sap/docs/releases/jan24#media-data-and-large-binaries) + */ + stream_compat: boolean, + + with_mocks: boolean, + + /** + * @private + */ + hybrid_instance_manager: boolean, + + /** + * @private + */ + keys_in_data_compat: boolean, + + /** + * @private + */ + skip_unused: false | 'all', + + /** + * @private + */ + with_parameters: boolean, + }, } & { [key: string]: any } // to allow additional values we have not yet captured export const requires: any diff --git a/test/typescript/apis/project/cds-env.ts.ts b/test/typescript/apis/project/cds-env.ts.ts new file mode 100644 index 00000000..4fcc8184 --- /dev/null +++ b/test/typescript/apis/project/cds-env.ts.ts @@ -0,0 +1,17 @@ +import cds from '../../../..' + +cds.env.features +cds.env.features.assert_integrity = 'db' +cds.env.features.cds_tx_inheritance = true +cds.env.features.hybrid_instance_manager = true +cds.env.features.keys_in_data_compat = true +cds.env.features.kibana_formatter = true +cds.env.features.odata_new_parser = true +cds.env.features.optimized_search = true +cds.env.features.rest_new_adapter = true +cds.env.features.serve_on_root = true +cds.env.features.stream_compat = true +cds.env.features.skip_unused = 'all' +cds.env.features.skip_unused = false +cds.env.features.with_mocks = true +cds.env.features.with_parameters = true \ No newline at end of file