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

orma

Package Overview
Dependencies
Maintainers
2
Versions
236
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

orma - npm Package Compare versions

Comparing version 1.0.48 to 1.0.50

19

build/types/query_types.d.ts

@@ -8,3 +8,3 @@ import { Pluck } from './helper_types';

};
export declare type Subquery<Schema extends OrmaSchema, Entities extends GetAllEntities<Schema>, RequireFrom extends boolean> = Entities extends any ? FieldObj<Schema, Entities> & SubqueryObj<Schema, Entities> & VirtualFieldObj<Schema, Entities> & FromObj<Schema, Entities, RequireFrom> & PaginationObj & GroupByObj<Schema, Entities> : never;
export declare type Subquery<Schema extends OrmaSchema, Entities extends GetAllEntities<Schema>, RequireFrom extends boolean> = Entities extends any ? FieldObj<Schema, Entities> & SubqueryObj<Schema, Entities> & VirtualFieldObj<Schema, Entities> & FromObj<Schema, Entities, RequireFrom> & PaginationObj & GroupByObj<Schema, Entities> & OrderByObj<Schema, Entities> : never;
export declare type FieldObj<Schema extends OrmaSchema, Entity extends GetAllEntities<Schema>> = {

@@ -19,3 +19,3 @@ [Field in GetFields<Schema, Entity>]?: QueryField<Schema, Entity>;

};
export declare type VirtualField<Schema extends OrmaSchema, Entity extends GetAllEntities<Schema>> = Subquery<Schema, Pluck<GetAllEdges<Schema, Entity>, 'to_entity'>, false> | QueryField<Schema, Entity> | Entity | number | GroupBy<Schema, Entity>;
export declare type VirtualField<Schema extends OrmaSchema, Entity extends GetAllEntities<Schema>> = Subquery<Schema, Pluck<GetAllEdges<Schema, Entity>, 'to_entity'>, false> | QueryField<Schema, Entity> | Entity | number | GroupBy<Schema, Entity> | OrderBy<Schema, Entity>;
export declare type FromObj<Schema extends OrmaSchema, Entity extends GetAllEntities<Schema>, RequireFrom extends boolean> = RequireFrom extends true ? {

@@ -34,4 +34,15 @@ $from: Entity;

};
export declare type GroupByObj<Schema extends OrmaSchema, Entity extends GetAllEntities<Schema>> = {};
declare type GroupBy<Schema extends OrmaSchema, Entity extends GetAllEntities<Schema>> = (GetFields<Schema, Entity> | Expression<Schema, Entity>)[];
export declare type GroupByObj<Schema extends OrmaSchema, Entity extends GetAllEntities<Schema>> = {
$group_by?: GroupBy<Schema, Entity>;
};
declare type FieldOrString<Schema extends OrmaSchema, Entity extends GetAllEntities<Schema>> = GetFields<Schema, Entity> | (string & {});
declare type GroupBy<Schema extends OrmaSchema, Entity extends GetAllEntities<Schema>> = (FieldOrString<Schema, Entity> | Expression<Schema, Entity>)[];
export declare type OrderByObj<Schema extends OrmaSchema, Entity extends GetAllEntities<Schema>> = {
$order_by?: OrderBy<Schema, Entity>;
};
declare type OrderBy<Schema extends OrmaSchema, Entity extends GetAllEntities<Schema>> = (FieldOrString<Schema, Entity> | {
$asc: FieldOrString<Schema, Entity>;
} | {
$desc: FieldOrString<Schema, Entity>;
} | Expression<Schema, Entity>)[];
export {};

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

$from: 'images',
url: true
url: true,
},

@@ -94,5 +94,5 @@ };

products: {
id: true
}
}
id: true,
},
},
},

@@ -102,5 +102,5 @@ },

products: {
id: true
}
}
id: true,
},
},
};

@@ -124,3 +124,3 @@ // orma actually doesnt allow this, since in this case a $from clause must

products: {
$sum: 'id'
$sum: 'id',
},

@@ -148,4 +148,4 @@ };

$limit: 1,
$offset: 2
}
$offset: 2,
},
};

@@ -156,5 +156,37 @@ }

products: {
$group_by: ['id', 'location_id']
$group_by: ['id', 'asdasdasd', {
$sum: 'id'
}],
},
};
}
{
const good = {
products: {
$order_by: [
'id',
{
$asc: 'location_id',
},
{
$desc: 'asdasdasdsad',
},
'asdjaskdhasjd'
],
},
};
const bad1 = {
products: {
// @ts-expect-error
$order_by: 'id'
}
};
const bad2 = {
products: {
$order_by: [{
// @ts-expect-error
$not_a_real_keyword: 'id'
}]
}
};
}

@@ -161,0 +193,0 @@ // {

{
"name": "orma",
"version": "1.0.48",
"version": "1.0.50",
"description": "A declarative relational syncronous orm",

@@ -5,0 +5,0 @@ "main": "build/index.js",

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