Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@balena/odata-to-abstract-sql

Package Overview
Dependencies
Maintainers
3
Versions
226
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@balena/odata-to-abstract-sql - npm Package Compare versions

Comparing version 6.2.8-build-renovate-major-9--balenasbvr-types-cb6ecf0bc2bfe70e632ac40538e3b5029813b72d-1 to 6.2.8-build-update-deps-5bb046976db9be203106ebd20db6248064fc9728-1

2

out/odata-to-abstract-sql.d.ts

@@ -74,3 +74,3 @@ import * as memoize from 'memoizee';

PathSegment(method: InternalSupportedMethod, bodyKeys: string[], path: ODataQuery): Query;
PathKey(method: InternalSupportedMethod, path: ODataQuery, resource: AliasedResource, bodyKeys: string[]): BooleanTypeNodes | void;
PathKey(method: InternalSupportedMethod, path: ODataQuery, resource: AliasedResource, bodyKeys: string[]): BooleanTypeNodes | undefined;
Bind(bind: BindReference, optional: true): BindNode | undefined;

@@ -77,0 +77,0 @@ Bind(bind: BindReference): BindNode;

@@ -45,3 +45,3 @@ "use strict";

for (const key in opts) {
if (key[0] === '$') {
if (key.startsWith('$')) {
return true;

@@ -636,3 +636,3 @@ }

const relationshipMapping = _.get(resourceRelations, relationshipPath);
if (!relationshipMapping || !relationshipMapping.$) {
if (!relationshipMapping?.$) {
throw new SyntaxError(`Could not resolve relationship mapping from '${resourceName}' to '${relationshipPath}'`);

@@ -649,5 +649,3 @@ }

let odataFieldNames;
if (path.options &&
path.options.$select &&
path.options.$select.properties) {
if (path.options?.$select?.properties) {
this.AddExtraFroms(query, resource, path.options.$select.properties);

@@ -1073,3 +1071,3 @@ odataFieldNames = path.options.$select.properties.map((prop) => {

}
if (expand.options && expand.options.$expand) {
if (expand.options?.$expand) {
this.Expands(expandResource, nestedExpandQuery, expand.options.$expand.properties);

@@ -1143,3 +1141,5 @@ }

if (Array.isArray(match)) {
match.forEach((v) => this.AddExtraFroms(query, parentResource, v));
match.forEach((v) => {
this.AddExtraFroms(query, parentResource, v);
});
}

@@ -1151,4 +1151,3 @@ else {

prop.name &&
prop.property &&
prop.property.name) {
prop.property?.name) {
nextProp = prop.property;

@@ -1163,3 +1162,3 @@ const resourceAlias = this.resourceAliases[prop.name];

}
if (nextProp && nextProp.args) {
if (nextProp?.args) {
this.AddExtraFroms(query, parentResource, prop.args);

@@ -1166,0 +1165,0 @@ }

{
"name": "@balena/odata-to-abstract-sql",
"version": "6.2.8-build-renovate-major-9--balenasbvr-types-cb6ecf0bc2bfe70e632ac40538e3b5029813b72d-1",
"version": "6.2.8-build-update-deps-5bb046976db9be203106ebd20db6248064fc9728-1",
"description": "A consumer of the OData parser, written in OMeta",
"type": "commonjs",
"main": "out/odata-to-abstract-sql.js",
"scripts": {
"lint": "balena-lint -e js -e ts src test && tsc --noEmit && tsc --noEmit --project tsconfig.js.json",
"prettify": "balena-lint -e js -e ts --fix src test",
"lint-fix": "balena-lint -e js -e ts --fix src test",
"pretest": "npm run prepare",

@@ -18,27 +19,27 @@ "test": "mocha && npm run lint",

"dependencies": {
"@balena/abstract-sql-compiler": "^9.1.4",
"@balena/odata-parser": "^3.0.3",
"@types/lodash": "^4.14.202",
"@balena/abstract-sql-compiler": "^9.2.0",
"@balena/odata-parser": "^3.0.8",
"@types/lodash": "^4.17.7",
"@types/memoizee": "^0.4.11",
"@types/string-hash": "^1.1.3",
"lodash": "^4.17.21",
"memoizee": "^0.4.15",
"memoizee": "^0.4.17",
"string-hash": "^1.1.3"
},
"devDependencies": {
"@balena/lf-to-abstract-sql": "^5.0.1",
"@balena/lint": "^8.0.0",
"@balena/sbvr-parser": "^1.4.3",
"@balena/sbvr-types": "^9.0.0",
"@types/chai": "^4.3.11",
"@balena/lf-to-abstract-sql": "^5.0.2",
"@balena/lint": "^8.2.7",
"@balena/sbvr-parser": "^1.4.6",
"@balena/sbvr-types": "^7.1.3",
"@types/chai": "^4.3.18",
"@types/chai-things": "0.0.38",
"@types/mocha": "^10.0.6",
"chai": "^4.4.1",
"@types/mocha": "^10.0.7",
"chai": "^4.5.0",
"chai-things": "~0.2.0",
"husky": "^9.0.0",
"lint-staged": "^15.2.0",
"mocha": "^10.2.0",
"husky": "^9.1.5",
"lint-staged": "^15.2.9",
"mocha": "^10.7.3",
"require-npm4-to-publish": "^1.0.0",
"ts-node": "^10.9.2",
"typescript": "^5.3.3"
"typescript": "^5.5.4"
},

@@ -57,4 +58,4 @@ "mocha": {

"versionist": {
"publishedAt": "2024-08-08T08:47:31.410Z"
"publishedAt": "2024-08-26T11:50:29.678Z"
}
}

@@ -172,3 +172,3 @@ import * as _ from 'lodash';

for (const key in opts) {
if (key[0] === '$') {
if (key.startsWith('$')) {
return true;

@@ -278,3 +278,3 @@ }

existingBinds: ODataBinds,
inc: number = 0,
inc = 0,
): void => {

@@ -343,3 +343,3 @@ const { binds } = definition;

public defaultResource: Resource | undefined;
public bindVarsLength: number = 0;
public bindVarsLength = 0;
private checkAlias: (alias: string) => string;

@@ -744,3 +744,3 @@ private alreadyComputedFields: AlreadyComputedFieldsLookup = {};

bodyKeys: string[],
): BooleanTypeNodes | void {
): BooleanTypeNodes | undefined {
const { key } = path;

@@ -945,3 +945,3 @@ if (key != null) {

}
return resource[resourceMappingsProp]!;
return resource[resourceMappingsProp];
}

@@ -970,3 +970,3 @@ ResolveRelationship(resource: string | Resource, relationship: string) {

const relationshipMapping = _.get(resourceRelations, relationshipPath);
if (!relationshipMapping || !relationshipMapping.$) {
if (!relationshipMapping?.$) {
throw new SyntaxError(

@@ -987,7 +987,3 @@ `Could not resolve relationship mapping from '${resourceName}' to '${relationshipPath}'`,

>;
if (
path.options &&
path.options.$select &&
path.options.$select.properties
) {
if (path.options?.$select?.properties) {
this.AddExtraFroms(query, resource, path.options.$select.properties);

@@ -1026,3 +1022,3 @@ odataFieldNames = path.options.$select.properties.map((prop: any) => {

// and will compile the computed Field statement into the abstract SQL statement regardless
forceCompilingComputedField: boolean = false,
forceCompilingComputedField = false,
):

@@ -1538,3 +1534,3 @@ | ReferencedFieldNode

}
if (expand.options && expand.options.$expand) {
if (expand.options?.$expand) {
this.Expands(

@@ -1623,3 +1619,5 @@ expandResource,

if (Array.isArray(match)) {
match.forEach((v) => this.AddExtraFroms(query, parentResource, v));
match.forEach((v) => {
this.AddExtraFroms(query, parentResource, v);
});
} else {

@@ -1632,4 +1630,3 @@ let nextProp = match;

prop.name &&
prop.property &&
prop.property.name
prop.property?.name
) {

@@ -1648,3 +1645,3 @@ nextProp = prop.property;

}
if (nextProp && nextProp.args) {
if (nextProp?.args) {
this.AddExtraFroms(query, parentResource, prop.args);

@@ -1708,3 +1705,3 @@ }

bindVarsLength: number,
bypassDefinition: boolean = false,
bypassDefinition = false,
tableAlias?: string,

@@ -1711,0 +1708,0 @@ isModifyOperation?: boolean,

@@ -85,3 +85,3 @@ import * as _ from 'lodash';

utils.addMethod(assertionPrototype, 'limit', bodyClause('Limit'));
return utils.addMethod(assertionPrototype, 'offset', bodyClause('Offset'));
utils.addMethod(assertionPrototype, 'offset', bodyClause('Offset'));
});

@@ -164,3 +164,3 @@

}
if (operand.charAt(0) === '(') {
if (operand.startsWith('(')) {
return operand

@@ -179,3 +179,3 @@ .slice(1, -1)

if (operand.charAt(0) === "'") {
if (operand.startsWith("'")) {
binds.push([

@@ -182,0 +182,0 @@ 'Text',

@@ -532,3 +532,5 @@ import { expect } from 'chai';

test(`/pilot?$filter=${odata}`, 'POST', { name: 'Peter' }, (result) =>
it(`should insert pilot where '${odata}'`, () => insertTest(result)),
it(`should insert pilot where '${odata}'`, () => {
insertTest(result);
}),
);

@@ -541,3 +543,5 @@

});
it('that inserts', () => insertTest(result[1]));
it('that inserts', () => {
insertTest(result[1]);
});
return it('and updates', () =>

@@ -730,5 +734,5 @@ expect(result[2])

test('/pilot(1)?$filter=' + odata, 'POST', { name }, (result) =>
it('should insert into pilot where "' + odata + '"', () =>
insertTest(result),
),
it('should insert into pilot where "' + odata + '"', () => {
insertTest(result);
}),
);

@@ -750,3 +754,5 @@

expect(result).to.be.a.query.that.upserts);
it('that inserts', () => insertTest(result[1]));
it('that inserts', () => {
insertTest(result[1]);
});
return it('and updates', () => {

@@ -753,0 +759,0 @@ expect(result[2])

Sorry, the diff of this file is not supported yet

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