Socket
Socket
Sign inDemoInstall

@sap/cds

Package Overview
Dependencies
Maintainers
3
Versions
183
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@sap/cds - npm Package Compare versions

Comparing version 1.15.0 to 1.15.1

SIGNATURE.SMF

2

package.json

@@ -1,1 +0,1 @@

{"dependencies":{"@sap/hdbext":"^4.3.0","@sap/xsenv":"^1.2.6","async":"1.5.0","winston":"1.1.2"},"description":"SAP HANA Core Data Services Client for node.js","devDependencies":{"expect":"^1.4.0","mocha":"4.0.1"},"engines":{"node":"^0.12.7 || ^4.4.0 || ^6.0.0","npm":"^2.11.x"},"keywords":["sap","hana","cds"],"main":"./cds.js","maintainers":[{"name":"https-support.sap.com","email":"do-not-reply@sap.com"}],"name":"@sap/cds","optionalDependencies":{},"readme":"node-cds: Core Data Services for node.js\n========================================\n\nImportant note: \n---------------\n The node-cds library is now considered feature complete. \n It will remain fully supported but will not receive further \n enhancements in future releases.\n\nAbstract\n--------\n\nThe *Core Data Services for node.js* (node-cds) are a JavaScript\nclient library for Core Data Services that allow node.js applications\nto consume CDS artifacts natively in node.js applications.\n\nnode-cds supports major CDS features, in particular entities, types,\nassociations, and views. The library offers a *managed mode* and an\n*unmanaged mode* that differ in the way that data is retrieved from\nthe database.\n\nThe node-cds project is the successor of the XS Data Services (XSDS)\nlibrary available for the HANA XS Engine.\n\n\nAPI Overview\n------------\n\n### Library Import\n\nTo use *node-cds*, require its main file:\n\n var cds = require('cds');\n\nOn Cloud Foundry, add a depencency on the latest node-cds release to\nyour `package.json`:\n\n \"dependencies\": {\n \"cds\": \"*\",\n ...\n }\n\t\t\n\n### CDS Import\n\nCDS entities are imported by name. The import function takes a callback that\nis invoked when all imports have completed. Additional fields and overrides\nmay be supplied for each entity.\n\n cds.importEntities([\n { $entity: \"xsds.test.cds::ds_test.e1\" },\n { $entity: \"xsds.test.cds::ds_test.e2\",\n $fields: {\n a: { $association: \"xsds.test.cds::ds_test.e2\",\n $viaBacklink: \"b\" }\n }\n }\n ], callback);\n\n function callback(error, entities) {\n var E1 = entities[\"xsds.test.cds::ds_test.e1\"];\n var E2 = entities[\"xsds.test.cds::ds_test.e2\"];\n // ...\n }\n\nNote that the import is a regular asynchronous node.js function. You may\nimport entities at any point in time, and in as many calls as you want.\n\nEntities may not be imported more than once. To retrieve an imported entity\nuse `$getEntity` or `$getEntities`:\n\n cds.$getEntities([\n \"xsds.test.cds::ds_test.e1\",\n \"xsds.test.cds::ds_test.e2\"\n ], function(err, entities) {\n var E1 = entities[\"xsds.test.cds::ds_test.e1\"];\n // ...\n });\n\nBoth functions will wait until the requested entity has been imported successfully.\nThere is also a synchronous version:\n\n var E1 = $getEntitySync(\"xsds.test.cds::ds_test.e1\");\n\nNote that `$getEntitySync` will return `null` if the import has not completed yet.\n\n\n### Database Connections and Transactions\n\nOpen new connection and transaction:\n\n cds.$getTransaction(function(error, tx) {\n tx.$get(...);\n // ...\n tx.$close();\n });\n\nReuse existing database connection `dbconn`, e.g., from `express` framework:\n\n cds.$getTransaction(dbconn, function(error, tx) {\n tx.$get(...);\n // ...\n tx.$close();\n });\n\nNote: We recommend `node-hdbext` for setting up the\nconnection to your HANA instance.\n\nTransaction management\n\n tx.$setAutoCommit(<boolean>);\n tx.$commit(callback);\n tx.$rollback(callback);\n\nBy default, transactions are in auto commit mode. Note that auto commit refers\nto node-cds operations, not database operations.\n\n\n### Managed Instances\n\nRetrieve entity instances by key:\n\n tx.$get(E1, { id1: 1, id2: 2, ... }, function(error, instance) {\n console.log(JSON.stringify(instance));\n });\n\nBatch retrieval for multiple instances:\n\n var requests = [\n { $entity: E1, id11: 1, id2: 2 },\n { $entity: E2, id: \"key\" }, ...\n ];\n tx.$getAll(requests, function(error, instances) {\n console.log(\"e1 = \" + JSON.stringify(instances[0]);\n console.log(\"e2 = \" + JSON.stringify(instances[1]);\n });\n\nSyntactic sugar for above:\n\n var requests = [\n E1.$prepare({ id1: 1, id2: 2 }),\n E2.$prepare({ id: \"key\" }), ...\n ];\n tx.$getAll(requests, ...);\n\nRetrieve entity instances by condition:\n\n tx.$find(E1, { value: { $gt: 69 } }, function(error, instances) {\n console.log(\"found \" + instance.length + \" instances\");\n });\n\nBatch retrieval by condition:\n\n tx.$findAll([\n { $entity: E1, { prop: { $eq: 1 } },\n { $entity: E2, { prop: { $ne: 2 } }\n ], callback);\n\nNote that the result of `$findAll` is an array of arrays; to flatten the result\nset you may use\n\n var flattenedInstanceArray = [].concat.apply([], findAllResult));\n\nFor complex data types you need to supply a comparison function using `$using` that\ncompares their values in JavaScript:\n\n tx.$find(E1, { prop: { $lt: \"1.0e-10\", $using: function(arg1, arg2) {\n return Math.sign(parseFloat(arg1) - parseFloat(arg2));\n } }, callback);\n\nA comparison function takes two arguments and returns values `< 0`, `== 0`, or `> 0`\ndepending on their relation to each other.\n\nCreate new instance:\n\n tx.$save({ $entity: E, key: 1, value: \"hello world\" }, function(error, instance) {\n if (!error)\n console.log(\"instance created\");\n });\n\nBatch creation:\n\n var newinsts = [\n { $entity: E1, id1: 1, value: 2 },\n E2.$prepare({ id: \"new\", value: 4 }), ...\n ];\n tx.$saveAll(newinsts, function(error, instances) {\n console.log(\"\" + instances.length + \" instances created\");\n });\n\nUpdate existing instance:\n\n instance.value++;\n tx.$save(instance, function (error, savedInstance) {\n if (!error)\n console.log(\"instance updated\");\n });\n\nBatch update:\n\n tx.$saveAll([ instance1, instance2, ... ], function (error, instances) {\n console.log(\"instances updated\");\n });\n\nDiscard entity instances:\n\n tx.$discard(instance, function(error) {\n if (error)\n console.error(\"Error discarding instance: \" + error);\n });\n\nBatch discard:\n\n tx.$discardAll([ instance1, instance2, ...], function(error) {\n if (error)\n console.error(\"Error discarding instances: \" + error);\n });\n\nUnmanaged delete:\n\n tx.$delete(entity, condition, callback);\n\n*CAUTION!* Unmanaged `delete`s bypass the cache and will not cascade to\ntarget instances! The `$delete` method is merely syntactic sugar for\n`$query().$matching().$delete()`!\n\n\n### Associations\n\nAdding via backlink 1:n associations:\n\n cds.importEntities([{\n $entity: \"cds.test::parent\",\n $fields: {\n BacklinkAssoc: {\n $association: {\n $entity: \"cds.test::target\",\n $viaBacklink: \"backassoc\"\n }\n }\n }\n }], callback);\n\nAdding via entity m:n associations:\n\n cds.importEntities([{\n $entity: \"cds.test::parent\",\n $fields: {\n BacklinkAssoc: {\n\t\t\t\t$association: {\n\t\t\t\t\t$entity: \"cds.test::target\",\n\t\t\t\t\t$viaEntity: \"cds.test::link\",\n\t\t\t\t\t$source: \"sourceassoc\",\n\t\t\t\t\t$target: \"targetassoc\"\n\t\t\t\t}\n }\n }\n }], callback);\n\nDeclaring lazy associations:\n\n cds.importEntities([{\n $entity: \"cds.test::parent\",\n $fields: {\n LazyAssoc: {\n $association: {\n\t\t\t\t\t$lazy: true\n\t\t\t\t}\n }\n }\n ], callback);\n\nLazy retrieval of lazy associations:\n\n instance.lazyAssoc.$load(function (error, targets) {\n // targets == instance.lazyAssoc\n console.log(\"\" + targets.length + \" targets retrieved\");\n });\n\nRe-syncing backlinking and unmanaged associations\n\n instance.unmanagedAssoc.$reload(function (error, targets) {\n // targets == instance.unmanagedAssoc\n console.log(\"association has \" + targets.length + \" targets\");\n });\n\n\n### Unmanaged Queries\n\nBasic query:\n\n E1.$query().$matching({ key: 1 })\n .$execute({}, function(error, result) {\n console.log(\"result = \" + JSON.stringify(result);\n });\n\nMore complex query conditions:\n\n E1.$query().$matching({ value1: { $lt: 42 }, value2: { $null: true } })\n .$execute({}, function(error, result) {\n console.log(\"result = \" + JSON.stringify(result);\n });\n\nProjection and navigation:\n\n E2.$query().$matching({ key: 1 })\n .$project({ value1: true, assoc: { value2: true, value3: true })\n .$execute({}, function(error, result) { ... });\n\nStream interface:\n\n E1.$query().$execute({ $stream: true }, function(error, stream) {\n stream.on('data', function(chunk) {\n console.log(chunk);\n }).on('end', function() {\n console.log(\"done\");\n });\n });\n","readmeFilename":"README.md","scripts":{"cleanBundle":"find $PWD -name package.json -exec node .filter/filter-package.js {} \\; ; rm -rf .filter init_sign.py","prepareRelease":"rm -rf doc/ test/ .gitignore .xmake.cfg && npm prune --production","test-disabled":"node node_modules/mocha/bin/mocha --recursive"},"version":"1.15.0","warnings":[{"code":"ENOTSUP","required":{"node":"^0.12.7 || ^4.4.0 || ^6.0.0","npm":"^2.11.x"},"pkgid":"@sap/cds@1.15.0"},{"code":"ENOTSUP","required":{"node":"^0.12.7 || ^4.4.0 || ^6.0.0","npm":"^2.11.x"},"pkgid":"@sap/cds@1.15.0"}],"license":"SEE LICENSE IN developer-license-3.1.txt"}
{"dependencies":{"@sap/hdbext":"^4.3.0","@sap/xsenv":"^1.2.6","async":"1.5.0","winston":"1.1.2"},"description":"SAP HANA Core Data Services Client for node.js","devDependencies":{"expect":"^1.4.0","mocha":"4.0.1"},"engines":{"node":"^0.12.7 || ^4.4.0 || ^6.0.0","npm":"^2.11.x"},"keywords":["sap","hana","cds"],"main":"./cds.js","maintainers":[{"name":"https-support.sap.com","email":"do-not-reply@sap.com"}],"name":"@sap/cds","optionalDependencies":{},"readme":"node-cds: Core Data Services for node.js\n========================================\n\nImportant note: \n---------------\n The node-cds library is now considered feature complete. \n It will remain fully supported but will not receive further \n enhancements in future releases.\n\nAbstract\n--------\n\nThe *Core Data Services for node.js* (node-cds) are a JavaScript\nclient library for Core Data Services that allow node.js applications\nto consume CDS artifacts natively in node.js applications.\n\nnode-cds supports major CDS features, in particular entities, types,\nassociations, and views. The library offers a *managed mode* and an\n*unmanaged mode* that differ in the way that data is retrieved from\nthe database.\n\nThe node-cds project is the successor of the XS Data Services (XSDS)\nlibrary available for the HANA XS Engine.\n\n\nAPI Overview\n------------\n\n### Library Import\n\nTo use *node-cds*, require its main file:\n\n var cds = require('cds');\n\nOn Cloud Foundry, add a depencency on the latest node-cds release to\nyour `package.json`:\n\n \"dependencies\": {\n \"cds\": \"*\",\n ...\n }\n\t\t\n\n### CDS Import\n\nCDS entities are imported by name. The import function takes a callback that\nis invoked when all imports have completed. Additional fields and overrides\nmay be supplied for each entity.\n\n cds.importEntities([\n { $entity: \"xsds.test.cds::ds_test.e1\" },\n { $entity: \"xsds.test.cds::ds_test.e2\",\n $fields: {\n a: { $association: \"xsds.test.cds::ds_test.e2\",\n $viaBacklink: \"b\" }\n }\n }\n ], callback);\n\n function callback(error, entities) {\n var E1 = entities[\"xsds.test.cds::ds_test.e1\"];\n var E2 = entities[\"xsds.test.cds::ds_test.e2\"];\n // ...\n }\n\nNote that the import is a regular asynchronous node.js function. You may\nimport entities at any point in time, and in as many calls as you want.\n\nEntities may not be imported more than once. To retrieve an imported entity\nuse `$getEntity` or `$getEntities`:\n\n cds.$getEntities([\n \"xsds.test.cds::ds_test.e1\",\n \"xsds.test.cds::ds_test.e2\"\n ], function(err, entities) {\n var E1 = entities[\"xsds.test.cds::ds_test.e1\"];\n // ...\n });\n\nBoth functions will wait until the requested entity has been imported successfully.\nThere is also a synchronous version:\n\n var E1 = $getEntitySync(\"xsds.test.cds::ds_test.e1\");\n\nNote that `$getEntitySync` will return `null` if the import has not completed yet.\n\n\n### Database Connections and Transactions\n\nOpen new connection and transaction:\n\n cds.$getTransaction(function(error, tx) {\n tx.$get(...);\n // ...\n tx.$close();\n });\n\nReuse existing database connection `dbconn`, e.g., from `express` framework:\n\n cds.$getTransaction(dbconn, function(error, tx) {\n tx.$get(...);\n // ...\n tx.$close();\n });\n\nNote: We recommend `node-hdbext` for setting up the\nconnection to your HANA instance.\n\nTransaction management\n\n tx.$setAutoCommit(<boolean>);\n tx.$commit(callback);\n tx.$rollback(callback);\n\nBy default, transactions are in auto commit mode. Note that auto commit refers\nto node-cds operations, not database operations.\n\n\n### Managed Instances\n\nRetrieve entity instances by key:\n\n tx.$get(E1, { id1: 1, id2: 2, ... }, function(error, instance) {\n console.log(JSON.stringify(instance));\n });\n\nBatch retrieval for multiple instances:\n\n var requests = [\n { $entity: E1, id11: 1, id2: 2 },\n { $entity: E2, id: \"key\" }, ...\n ];\n tx.$getAll(requests, function(error, instances) {\n console.log(\"e1 = \" + JSON.stringify(instances[0]);\n console.log(\"e2 = \" + JSON.stringify(instances[1]);\n });\n\nSyntactic sugar for above:\n\n var requests = [\n E1.$prepare({ id1: 1, id2: 2 }),\n E2.$prepare({ id: \"key\" }), ...\n ];\n tx.$getAll(requests, ...);\n\nRetrieve entity instances by condition:\n\n tx.$find(E1, { value: { $gt: 69 } }, function(error, instances) {\n console.log(\"found \" + instance.length + \" instances\");\n });\n\nBatch retrieval by condition:\n\n tx.$findAll([\n { $entity: E1, { prop: { $eq: 1 } },\n { $entity: E2, { prop: { $ne: 2 } }\n ], callback);\n\nNote that the result of `$findAll` is an array of arrays; to flatten the result\nset you may use\n\n var flattenedInstanceArray = [].concat.apply([], findAllResult));\n\nFor complex data types you need to supply a comparison function using `$using` that\ncompares their values in JavaScript:\n\n tx.$find(E1, { prop: { $lt: \"1.0e-10\", $using: function(arg1, arg2) {\n return Math.sign(parseFloat(arg1) - parseFloat(arg2));\n } }, callback);\n\nA comparison function takes two arguments and returns values `< 0`, `== 0`, or `> 0`\ndepending on their relation to each other.\n\nCreate new instance:\n\n tx.$save({ $entity: E, key: 1, value: \"hello world\" }, function(error, instance) {\n if (!error)\n console.log(\"instance created\");\n });\n\nBatch creation:\n\n var newinsts = [\n { $entity: E1, id1: 1, value: 2 },\n E2.$prepare({ id: \"new\", value: 4 }), ...\n ];\n tx.$saveAll(newinsts, function(error, instances) {\n console.log(\"\" + instances.length + \" instances created\");\n });\n\nUpdate existing instance:\n\n instance.value++;\n tx.$save(instance, function (error, savedInstance) {\n if (!error)\n console.log(\"instance updated\");\n });\n\nBatch update:\n\n tx.$saveAll([ instance1, instance2, ... ], function (error, instances) {\n console.log(\"instances updated\");\n });\n\nDiscard entity instances:\n\n tx.$discard(instance, function(error) {\n if (error)\n console.error(\"Error discarding instance: \" + error);\n });\n\nBatch discard:\n\n tx.$discardAll([ instance1, instance2, ...], function(error) {\n if (error)\n console.error(\"Error discarding instances: \" + error);\n });\n\nUnmanaged delete:\n\n tx.$delete(entity, condition, callback);\n\n*CAUTION!* Unmanaged `delete`s bypass the cache and will not cascade to\ntarget instances! The `$delete` method is merely syntactic sugar for\n`$query().$matching().$delete()`!\n\n\n### Associations\n\nAdding via backlink 1:n associations:\n\n cds.importEntities([{\n $entity: \"cds.test::parent\",\n $fields: {\n BacklinkAssoc: {\n $association: {\n $entity: \"cds.test::target\",\n $viaBacklink: \"backassoc\"\n }\n }\n }\n }], callback);\n\nAdding via entity m:n associations:\n\n cds.importEntities([{\n $entity: \"cds.test::parent\",\n $fields: {\n BacklinkAssoc: {\n\t\t\t\t$association: {\n\t\t\t\t\t$entity: \"cds.test::target\",\n\t\t\t\t\t$viaEntity: \"cds.test::link\",\n\t\t\t\t\t$source: \"sourceassoc\",\n\t\t\t\t\t$target: \"targetassoc\"\n\t\t\t\t}\n }\n }\n }], callback);\n\nDeclaring lazy associations:\n\n cds.importEntities([{\n $entity: \"cds.test::parent\",\n $fields: {\n LazyAssoc: {\n $association: {\n\t\t\t\t\t$lazy: true\n\t\t\t\t}\n }\n }\n ], callback);\n\nLazy retrieval of lazy associations:\n\n instance.lazyAssoc.$load(function (error, targets) {\n // targets == instance.lazyAssoc\n console.log(\"\" + targets.length + \" targets retrieved\");\n });\n\nRe-syncing backlinking and unmanaged associations\n\n instance.unmanagedAssoc.$reload(function (error, targets) {\n // targets == instance.unmanagedAssoc\n console.log(\"association has \" + targets.length + \" targets\");\n });\n\n\n### Unmanaged Queries\n\nBasic query:\n\n E1.$query().$matching({ key: 1 })\n .$execute({}, function(error, result) {\n console.log(\"result = \" + JSON.stringify(result);\n });\n\nMore complex query conditions:\n\n E1.$query().$matching({ value1: { $lt: 42 }, value2: { $null: true } })\n .$execute({}, function(error, result) {\n console.log(\"result = \" + JSON.stringify(result);\n });\n\nProjection and navigation:\n\n E2.$query().$matching({ key: 1 })\n .$project({ value1: true, assoc: { value2: true, value3: true })\n .$execute({}, function(error, result) { ... });\n\nStream interface:\n\n E1.$query().$execute({ $stream: true }, function(error, stream) {\n stream.on('data', function(chunk) {\n console.log(chunk);\n }).on('end', function() {\n console.log(\"done\");\n });\n });\n","readmeFilename":"README.md","scripts":{"cleanBundle":"find $PWD -name package.json -exec node .filter/filter-package.js {} \\; ; rm -rf .filter init_sign.py","prepareRelease":"rm -rf doc/ test/ .gitignore .xmake.cfg && npm prune --production","test-disabled":"node node_modules/mocha/bin/mocha --recursive"},"version":"1.15.1","warnings":[{"code":"ENOTSUP","required":{"node":"^0.12.7 || ^4.4.0 || ^6.0.0","npm":"^2.11.x"},"pkgid":"@sap/cds@1.15.1"},{"code":"ENOTSUP","required":{"node":"^0.12.7 || ^4.4.0 || ^6.0.0","npm":"^2.11.x"},"pkgid":"@sap/cds@1.15.1"}],"license":"SEE LICENSE IN developer-license-3.1.txt"}

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc