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

@compas/store

Package Overview
Dependencies
Maintainers
1
Versions
196
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@compas/store - npm Package Compare versions

Comparing version 0.0.148 to 0.0.149

6

package.json
{
"name": "@compas/store",
"version": "0.0.148",
"version": "0.0.149",
"description": "Postgres & S3-compatible wrappers for common things",

@@ -17,3 +17,3 @@ "main": "./index.js",

"dependencies": {
"@compas/stdlib": "0.0.148",
"@compas/stdlib": "0.0.149",
"@types/minio": "7.0.7",

@@ -44,3 +44,3 @@ "minio": "7.0.18",

},
"gitHead": "dbb386897f9e1199a32d9bccd4908cce6f13a234"
"gitHead": "dd7fa620c6d3cb6219764bcfc5cc91f711383dfc"
}

@@ -5,5 +5,5 @@ // Generated by @compas/code-gen

export const storeStructureString =
'{"jobInterval":{"type":"object","group":"store","name":"jobInterval","docString":"","isOptional":false,"validator":{"strict":true},"keys":{"years":{"type":"number","docString":"","isOptional":true,"validator":{"convert":false,"floatingPoint":false,"min":-2147483647,"max":2147483647}},"months":{"type":"number","docString":"","isOptional":true,"validator":{"convert":false,"floatingPoint":false,"min":-2147483647,"max":2147483647}},"days":{"type":"number","docString":"","isOptional":true,"validator":{"convert":false,"floatingPoint":false,"min":-2147483647,"max":2147483647}},"hours":{"type":"number","docString":"","isOptional":true,"validator":{"convert":false,"floatingPoint":false,"min":-2147483647,"max":2147483647}},"minutes":{"type":"number","docString":"","isOptional":true,"validator":{"convert":false,"floatingPoint":false,"min":-2147483647,"max":2147483647}},"seconds":{"type":"number","docString":"","isOptional":true,"validator":{"convert":false,"floatingPoint":false,"min":-2147483647,"max":2147483647}}},"relations":[],"uniqueName":"StoreJobInterval"},"file":{"type":"object","group":"store","name":"file","docString":"","isOptional":false,"validator":{"strict":true},"enableQueries":true,"queryOptions":{"withSoftDeletes":true,"withPrimaryKey":true},"keys":{"bucketName":{"type":"string","docString":"","isOptional":false,"validator":{"convert":false,"trim":false,"lowerCase":false,"upperCase":false,"min":1},"sql":{"searchable":true}},"contentLength":{"type":"number","docString":"","isOptional":false,"validator":{"convert":false,"floatingPoint":false,"min":-2147483647,"max":2147483647}},"contentType":{"type":"string","docString":"","isOptional":false,"validator":{"convert":false,"trim":false,"lowerCase":false,"upperCase":false,"min":1}},"name":{"type":"string","docString":"","isOptional":false,"validator":{"convert":false,"trim":false,"lowerCase":false,"upperCase":false,"min":1}},"meta":{"type":"reference","docString":"","isOptional":false,"validator":{},"reference":{"group":"store","name":"fileMeta","uniqueName":"StoreFileMeta"}}},"relations":[],"uniqueName":"StoreFile"},"fileGroup":{"type":"object","group":"store","name":"fileGroup","docString":"","isOptional":false,"validator":{"strict":true},"enableQueries":true,"queryOptions":{"withSoftDeletes":true,"withPrimaryKey":true},"keys":{"name":{"type":"string","docString":"","isOptional":true,"validator":{"convert":false,"trim":false,"lowerCase":false,"upperCase":false,"min":1}},"order":{"type":"number","docString":"Hack to get an increasing integer by default","isOptional":true,"defaultValue":"Math.floor(Date.now() / 1000000)","validator":{"convert":false,"floatingPoint":false,"min":-2147483647,"max":2147483647},"sql":{"searchable":true}},"meta":{"type":"reference","docString":"","isOptional":false,"validator":{},"reference":{"group":"store","name":"fileGroupMeta","uniqueName":"StoreFileGroupMeta"}}},"relations":[{"type":"relation","subType":"oneToOne","ownKey":"file","referencedKey":"group","isOptional":true,"reference":{"type":"reference","docString":"","isOptional":false,"validator":{},"reference":{"group":"store","name":"file","uniqueName":"StoreFile"}}},{"type":"relation","subType":"manyToOne","ownKey":"parent","referencedKey":"children","isOptional":true,"reference":{"type":"reference","docString":"","isOptional":false,"validator":{},"reference":{"group":"store","name":"fileGroup","uniqueName":"StoreFileGroup"}}},{"type":"relation","subType":"oneToMany","ownKey":"children","reference":{"type":"reference","docString":"","isOptional":false,"validator":{},"reference":{"group":"store","name":"fileGroup","uniqueName":"StoreFileGroup"}}}],"uniqueName":"StoreFileGroup"},"fileGroupView":{"type":"object","group":"store","name":"fileGroupView","docString":"","isOptional":false,"validator":{"strict":true},"enableQueries":true,"queryOptions":{"withSoftDeletes":true,"isView":true,"withPrimaryKey":true},"keys":{"name":{"type":"string","docString":"","isOptional":true,"validator":{"convert":false,"trim":false,"lowerCase":false,"upperCase":false,"min":1}},"order":{"type":"number","docString":"","isOptional":false,"validator":{"convert":false,"floatingPoint":false,"min":-2147483647,"max":2147483647}},"meta":{"type":"reference","docString":"","isOptional":false,"validator":{},"reference":{"group":"store","name":"fileGroupMeta","uniqueName":"StoreFileGroupMeta"}},"isDirectory":{"type":"boolean","docString":"","isOptional":false,"validator":{"convert":false},"sql":{"searchable":true}}},"relations":[{"type":"relation","subType":"oneToOne","ownKey":"file","referencedKey":"groupView","isOptional":true,"reference":{"type":"reference","docString":"","isOptional":false,"validator":{},"reference":{"group":"store","name":"file","uniqueName":"StoreFile"}}},{"type":"relation","subType":"manyToOne","ownKey":"parent","referencedKey":"children","isOptional":true,"reference":{"type":"reference","docString":"","isOptional":false,"validator":{},"reference":{"group":"store","name":"fileGroupView","uniqueName":"StoreFileGroupView"}}},{"type":"relation","subType":"oneToMany","ownKey":"children","reference":{"type":"reference","docString":"","isOptional":false,"validator":{},"reference":{"group":"store","name":"fileGroupView","uniqueName":"StoreFileGroupView"}}}],"uniqueName":"StoreFileGroupView"},"session":{"type":"object","group":"store","name":"session","docString":"","isOptional":false,"validator":{"strict":true},"enableQueries":true,"queryOptions":{"withDates":true,"withPrimaryKey":true},"keys":{"expires":{"type":"date","docString":"","isOptional":false,"validator":{},"sql":{"searchable":true}},"data":{"type":"any","docString":"","isOptional":true,"defaultValue":"{}","validator":{},"rawValueImport":{},"rawValidatorImport":{}}},"relations":[],"uniqueName":"StoreSession"},"job":{"type":"object","group":"store","name":"job","docString":"","isOptional":false,"validator":{"strict":true},"enableQueries":true,"queryOptions":{"withDates":true,"withPrimaryKey":true},"keys":{"id":{"type":"number","docString":"","isOptional":false,"validator":{"convert":false,"floatingPoint":false,"min":-2147483647,"max":2147483647},"sql":{"searchable":true,"primary":true}},"isComplete":{"type":"boolean","docString":"","isOptional":true,"defaultValue":"false","validator":{"convert":false},"sql":{"searchable":true}},"priority":{"type":"number","docString":"","isOptional":true,"defaultValue":"0","validator":{"convert":false,"floatingPoint":false,"min":0}},"scheduledAt":{"type":"date","docString":"","isOptional":true,"defaultValue":"(new Date())","validator":{},"sql":{"searchable":true}},"name":{"type":"string","docString":"","isOptional":false,"validator":{"convert":false,"trim":false,"lowerCase":false,"upperCase":false,"min":1},"sql":{"searchable":true}},"data":{"type":"any","docString":"","isOptional":true,"defaultValue":"{}","validator":{},"rawValueImport":{},"rawValidatorImport":{}},"retryCount":{"type":"number","docString":"","isOptional":true,"defaultValue":"0","validator":{"convert":false,"floatingPoint":false,"min":-2147483647,"max":2147483647}},"handlerTimeout":{"type":"number","docString":"","isOptional":true,"validator":{"convert":false,"floatingPoint":false,"min":1000}}},"relations":[],"uniqueName":"StoreJob"},"fileMeta":{"type":"object","group":"store","name":"fileMeta","docString":"User definable, optional object to store whatever you want","isOptional":true,"defaultValue":"{}","validator":{"strict":true},"keys":{},"relations":[],"uniqueName":"StoreFileMeta"},"fileGroupMeta":{"type":"object","group":"store","name":"fileGroupMeta","docString":"User definable, optional object to store whatever you want","isOptional":true,"defaultValue":"{}","validator":{"strict":true},"keys":{},"relations":[],"uniqueName":"StoreFileGroupMeta"}}';
'{"jobInterval":{"type":"object","group":"store","name":"jobInterval","docString":"","isOptional":false,"validator":{"strict":true},"keys":{"years":{"type":"number","docString":"","isOptional":true,"validator":{"convert":false,"floatingPoint":false,"min":-2147483647,"max":2147483647}},"months":{"type":"number","docString":"","isOptional":true,"validator":{"convert":false,"floatingPoint":false,"min":-2147483647,"max":2147483647}},"days":{"type":"number","docString":"","isOptional":true,"validator":{"convert":false,"floatingPoint":false,"min":-2147483647,"max":2147483647}},"hours":{"type":"number","docString":"","isOptional":true,"validator":{"convert":false,"floatingPoint":false,"min":-2147483647,"max":2147483647}},"minutes":{"type":"number","docString":"","isOptional":true,"validator":{"convert":false,"floatingPoint":false,"min":-2147483647,"max":2147483647}},"seconds":{"type":"number","docString":"","isOptional":true,"validator":{"convert":false,"floatingPoint":false,"min":-2147483647,"max":2147483647}}},"relations":[],"uniqueName":"StoreJobInterval"},"file":{"type":"object","group":"store","name":"file","docString":"","isOptional":false,"validator":{"strict":true},"enableQueries":true,"queryOptions":{"withSoftDeletes":true,"withPrimaryKey":true},"keys":{"bucketName":{"type":"string","docString":"","isOptional":false,"validator":{"convert":false,"trim":false,"lowerCase":false,"upperCase":false,"min":1},"sql":{"searchable":true}},"contentLength":{"type":"number","docString":"","isOptional":false,"validator":{"convert":false,"floatingPoint":false,"min":-2147483647,"max":2147483647}},"contentType":{"type":"string","docString":"","isOptional":false,"validator":{"convert":false,"trim":false,"lowerCase":false,"upperCase":false,"min":1}},"name":{"type":"string","docString":"","isOptional":false,"validator":{"convert":false,"trim":false,"lowerCase":false,"upperCase":false,"min":1}},"meta":{"type":"reference","docString":"","isOptional":false,"validator":{},"reference":{"group":"store","name":"fileMeta","uniqueName":"StoreFileMeta"}}},"relations":[],"uniqueName":"StoreFile"},"fileGroup":{"type":"object","group":"store","name":"fileGroup","docString":"","isOptional":false,"validator":{"strict":true},"enableQueries":true,"queryOptions":{"withSoftDeletes":true,"withPrimaryKey":true},"keys":{"name":{"type":"string","docString":"","isOptional":true,"validator":{"convert":false,"trim":false,"lowerCase":false,"upperCase":false,"min":1}},"order":{"type":"number","docString":"Hack to get an increasing integer by default","isOptional":true,"defaultValue":"Math.floor(Date.now() / 1000000)","validator":{"convert":false,"floatingPoint":false,"min":-2147483647,"max":2147483647},"sql":{"searchable":true}},"meta":{"type":"reference","docString":"","isOptional":false,"validator":{},"reference":{"group":"store","name":"fileGroupMeta","uniqueName":"StoreFileGroupMeta"}}},"relations":[{"type":"relation","subType":"oneToOne","ownKey":"file","referencedKey":"group","isOptional":true,"reference":{"type":"reference","docString":"","isOptional":false,"validator":{},"reference":{"group":"store","name":"file","uniqueName":"StoreFile"}}},{"type":"relation","subType":"manyToOne","ownKey":"parent","referencedKey":"children","isOptional":true,"reference":{"type":"reference","docString":"","isOptional":false,"validator":{},"reference":{"group":"store","name":"fileGroup","uniqueName":"StoreFileGroup"}}},{"type":"relation","subType":"oneToMany","ownKey":"children","reference":{"type":"reference","docString":"","isOptional":false,"validator":{},"reference":{"group":"store","name":"fileGroup","uniqueName":"StoreFileGroup"}}}],"uniqueName":"StoreFileGroup"},"session":{"type":"object","group":"store","name":"session","docString":"","isOptional":false,"validator":{"strict":true},"enableQueries":true,"queryOptions":{"withDates":true,"withPrimaryKey":true},"keys":{"expires":{"type":"date","docString":"","isOptional":false,"validator":{},"sql":{"searchable":true}},"data":{"type":"any","docString":"","isOptional":true,"defaultValue":"{}","validator":{},"rawValueImport":{},"rawValidatorImport":{}}},"relations":[],"uniqueName":"StoreSession"},"job":{"type":"object","group":"store","name":"job","docString":"","isOptional":false,"validator":{"strict":true},"enableQueries":true,"queryOptions":{"withDates":true,"withPrimaryKey":true},"keys":{"id":{"type":"number","docString":"","isOptional":false,"validator":{"convert":false,"floatingPoint":false,"min":-2147483647,"max":2147483647},"sql":{"searchable":true,"primary":true}},"isComplete":{"type":"boolean","docString":"","isOptional":true,"defaultValue":"false","validator":{"convert":false},"sql":{"searchable":true}},"priority":{"type":"number","docString":"","isOptional":true,"defaultValue":"0","validator":{"convert":false,"floatingPoint":false,"min":0}},"scheduledAt":{"type":"date","docString":"","isOptional":true,"defaultValue":"(new Date())","validator":{},"sql":{"searchable":true}},"name":{"type":"string","docString":"","isOptional":false,"validator":{"convert":false,"trim":false,"lowerCase":false,"upperCase":false,"min":1},"sql":{"searchable":true}},"data":{"type":"any","docString":"","isOptional":true,"defaultValue":"{}","validator":{},"rawValueImport":{},"rawValidatorImport":{}},"retryCount":{"type":"number","docString":"","isOptional":true,"defaultValue":"0","validator":{"convert":false,"floatingPoint":false,"min":-2147483647,"max":2147483647}},"handlerTimeout":{"type":"number","docString":"","isOptional":true,"validator":{"convert":false,"floatingPoint":false,"min":1000}}},"relations":[],"uniqueName":"StoreJob"},"fileMeta":{"type":"object","group":"store","name":"fileMeta","docString":"User definable, optional object to store whatever you want","isOptional":true,"defaultValue":"{}","validator":{"strict":true},"keys":{},"relations":[],"uniqueName":"StoreFileMeta"},"fileGroupMeta":{"type":"object","group":"store","name":"fileGroupMeta","docString":"User definable, optional object to store whatever you want","isOptional":true,"defaultValue":"{}","validator":{"strict":true},"keys":{},"relations":[],"uniqueName":"StoreFileGroupMeta"}}';
export const storeStructure = JSON.parse(storeStructureString);
export const structure = Object.assign({}, { store: storeStructure });
export const structureString = JSON.stringify(structure);

@@ -41,5 +41,2 @@ // Generated by @compas/code-gen

/**
* @typedef {{"name"?: undefined|string, "order": number, "meta": StoreFileGroupMeta, "isDirectory": boolean, "id": string, "file"?: undefined|string, "parent"?: undefined|string, "createdAt": Date, "updatedAt": Date, "deletedAt"?: undefined|Date, }} StoreFileGroupView
*/
/**
* @typedef {{"id": number, "isComplete": boolean, "priority": number, "scheduledAt": Date, "name": string, "data": *, "retryCount": number, "handlerTimeout"?: undefined|number, "createdAt": Date, "updatedAt": Date, }} StoreJob

@@ -54,3 +51,3 @@ */

/**
* @typedef {{"$raw"?: undefined|QueryPart, "$or"?: undefined|(StoreFileWhere)[], "id"?: undefined|string, "idNotEqual"?: undefined|string, "idIn"?: undefined|(string)[]|QueryPart, "idNotIn"?: undefined|(string)[]|QueryPart, "idLike"?: undefined|string, "idNotLike"?: undefined|string, "bucketName"?: undefined|string, "bucketNameNotEqual"?: undefined|string, "bucketNameIn"?: undefined|(string)[]|QueryPart, "bucketNameNotIn"?: undefined|(string)[]|QueryPart, "bucketNameLike"?: undefined|string, "bucketNameILike"?: undefined|string, "bucketNameNotLike"?: undefined|string, "createdAt"?: undefined|Date, "createdAtNotEqual"?: undefined|Date, "createdAtIn"?: undefined|(Date)[]|QueryPart, "createdAtNotIn"?: undefined|(Date)[]|QueryPart, "createdAtGreaterThan"?: undefined|Date, "createdAtLowerThan"?: undefined|Date, "createdAtIsNull"?: undefined|boolean, "createdAtIsNotNull"?: undefined|boolean, "updatedAt"?: undefined|Date, "updatedAtNotEqual"?: undefined|Date, "updatedAtIn"?: undefined|(Date)[]|QueryPart, "updatedAtNotIn"?: undefined|(Date)[]|QueryPart, "updatedAtGreaterThan"?: undefined|Date, "updatedAtLowerThan"?: undefined|Date, "updatedAtIsNull"?: undefined|boolean, "updatedAtIsNotNull"?: undefined|boolean, "deletedAt"?: undefined|Date, "deletedAtNotEqual"?: undefined|Date, "deletedAtIn"?: undefined|(Date)[]|QueryPart, "deletedAtNotIn"?: undefined|(Date)[]|QueryPart, "deletedAtGreaterThan"?: undefined|Date, "deletedAtLowerThan"?: undefined|Date, "deletedAtIncludeNotNull"?: undefined|boolean, "groupExists"?: undefined|StoreFileGroupWhere, "groupNotExists"?: undefined|StoreFileGroupWhere, "groupViewExists"?: undefined|StoreFileGroupViewWhere, "groupViewNotExists"?: undefined|StoreFileGroupViewWhere, }} StoreFileWhere
* @typedef {{"$raw"?: undefined|QueryPart, "$or"?: undefined|(StoreFileWhere)[], "id"?: undefined|string, "idNotEqual"?: undefined|string, "idIn"?: undefined|(string)[]|QueryPart, "idNotIn"?: undefined|(string)[]|QueryPart, "idLike"?: undefined|string, "idNotLike"?: undefined|string, "bucketName"?: undefined|string, "bucketNameNotEqual"?: undefined|string, "bucketNameIn"?: undefined|(string)[]|QueryPart, "bucketNameNotIn"?: undefined|(string)[]|QueryPart, "bucketNameLike"?: undefined|string, "bucketNameILike"?: undefined|string, "bucketNameNotLike"?: undefined|string, "createdAt"?: undefined|Date, "createdAtNotEqual"?: undefined|Date, "createdAtIn"?: undefined|(Date)[]|QueryPart, "createdAtNotIn"?: undefined|(Date)[]|QueryPart, "createdAtGreaterThan"?: undefined|Date, "createdAtLowerThan"?: undefined|Date, "createdAtIsNull"?: undefined|boolean, "createdAtIsNotNull"?: undefined|boolean, "updatedAt"?: undefined|Date, "updatedAtNotEqual"?: undefined|Date, "updatedAtIn"?: undefined|(Date)[]|QueryPart, "updatedAtNotIn"?: undefined|(Date)[]|QueryPart, "updatedAtGreaterThan"?: undefined|Date, "updatedAtLowerThan"?: undefined|Date, "updatedAtIsNull"?: undefined|boolean, "updatedAtIsNotNull"?: undefined|boolean, "deletedAt"?: undefined|Date, "deletedAtNotEqual"?: undefined|Date, "deletedAtIn"?: undefined|(Date)[]|QueryPart, "deletedAtNotIn"?: undefined|(Date)[]|QueryPart, "deletedAtGreaterThan"?: undefined|Date, "deletedAtLowerThan"?: undefined|Date, "deletedAtIncludeNotNull"?: undefined|boolean, "groupExists"?: undefined|StoreFileGroupWhere, "groupNotExists"?: undefined|StoreFileGroupWhere, }} StoreFileWhere
*/

@@ -61,5 +58,2 @@ /**

/**
* @typedef {{"$raw"?: undefined|QueryPart, "$or"?: undefined|(StoreFileGroupViewWhere)[], "id"?: undefined|string, "idNotEqual"?: undefined|string, "idIn"?: undefined|(string)[]|QueryPart, "idNotIn"?: undefined|(string)[]|QueryPart, "idLike"?: undefined|string, "idNotLike"?: undefined|string, "isDirectory"?: undefined|boolean, "file"?: undefined|string, "fileNotEqual"?: undefined|string, "fileIn"?: undefined|(string)[]|QueryPart, "fileNotIn"?: undefined|(string)[]|QueryPart, "fileLike"?: undefined|string, "fileNotLike"?: undefined|string, "fileIsNull"?: undefined|boolean, "fileIsNotNull"?: undefined|boolean, "parent"?: undefined|string, "parentNotEqual"?: undefined|string, "parentIn"?: undefined|(string)[]|QueryPart, "parentNotIn"?: undefined|(string)[]|QueryPart, "parentLike"?: undefined|string, "parentNotLike"?: undefined|string, "parentIsNull"?: undefined|boolean, "parentIsNotNull"?: undefined|boolean, "createdAt"?: undefined|Date, "createdAtNotEqual"?: undefined|Date, "createdAtIn"?: undefined|(Date)[]|QueryPart, "createdAtNotIn"?: undefined|(Date)[]|QueryPart, "createdAtGreaterThan"?: undefined|Date, "createdAtLowerThan"?: undefined|Date, "createdAtIsNull"?: undefined|boolean, "createdAtIsNotNull"?: undefined|boolean, "updatedAt"?: undefined|Date, "updatedAtNotEqual"?: undefined|Date, "updatedAtIn"?: undefined|(Date)[]|QueryPart, "updatedAtNotIn"?: undefined|(Date)[]|QueryPart, "updatedAtGreaterThan"?: undefined|Date, "updatedAtLowerThan"?: undefined|Date, "updatedAtIsNull"?: undefined|boolean, "updatedAtIsNotNull"?: undefined|boolean, "deletedAt"?: undefined|Date, "deletedAtNotEqual"?: undefined|Date, "deletedAtIn"?: undefined|(Date)[]|QueryPart, "deletedAtNotIn"?: undefined|(Date)[]|QueryPart, "deletedAtGreaterThan"?: undefined|Date, "deletedAtLowerThan"?: undefined|Date, "deletedAtIncludeNotNull"?: undefined|boolean, "childrenExists"?: undefined|StoreFileGroupViewWhere, "childrenNotExists"?: undefined|StoreFileGroupViewWhere, }} StoreFileGroupViewWhere
*/
/**
* @typedef {{"$raw"?: undefined|QueryPart, "$or"?: undefined|(StoreJobWhere)[], "id"?: undefined|number, "idNotEqual"?: undefined|number, "idIn"?: undefined|(number)[]|QueryPart, "idNotIn"?: undefined|(number)[]|QueryPart, "idGreaterThan"?: undefined|number, "idLowerThan"?: undefined|number, "isComplete"?: undefined|boolean, "isCompleteIsNull"?: undefined|boolean, "isCompleteIsNotNull"?: undefined|boolean, "name"?: undefined|string, "nameNotEqual"?: undefined|string, "nameIn"?: undefined|(string)[]|QueryPart, "nameNotIn"?: undefined|(string)[]|QueryPart, "nameLike"?: undefined|string, "nameILike"?: undefined|string, "nameNotLike"?: undefined|string, "scheduledAt"?: undefined|Date, "scheduledAtNotEqual"?: undefined|Date, "scheduledAtIn"?: undefined|(Date)[]|QueryPart, "scheduledAtNotIn"?: undefined|(Date)[]|QueryPart, "scheduledAtGreaterThan"?: undefined|Date, "scheduledAtLowerThan"?: undefined|Date, "scheduledAtIsNull"?: undefined|boolean, "scheduledAtIsNotNull"?: undefined|boolean, "createdAt"?: undefined|Date, "createdAtNotEqual"?: undefined|Date, "createdAtIn"?: undefined|(Date)[]|QueryPart, "createdAtNotIn"?: undefined|(Date)[]|QueryPart, "createdAtGreaterThan"?: undefined|Date, "createdAtLowerThan"?: undefined|Date, "createdAtIsNull"?: undefined|boolean, "createdAtIsNotNull"?: undefined|boolean, "updatedAt"?: undefined|Date, "updatedAtNotEqual"?: undefined|Date, "updatedAtIn"?: undefined|(Date)[]|QueryPart, "updatedAtNotIn"?: undefined|(Date)[]|QueryPart, "updatedAtGreaterThan"?: undefined|Date, "updatedAtLowerThan"?: undefined|Date, "updatedAtIsNull"?: undefined|boolean, "updatedAtIsNotNull"?: undefined|boolean, }} StoreJobWhere

@@ -89,8 +83,2 @@ */

/**
* @typedef {QueryPart|("id"|"isDirectory"|"file"|"parent"|"createdAt"|"updatedAt"|"deletedAt")[]} StoreFileGroupViewOrderBy
*/
/**
* @typedef {{"id"?: undefined|CompasSqlOrderBy, "isDirectory"?: undefined|CompasSqlOrderBy, "file"?: undefined|CompasSqlOrderByOptionalField, "parent"?: undefined|CompasSqlOrderByOptionalField, "createdAt"?: undefined|CompasSqlOrderBy, "updatedAt"?: undefined|CompasSqlOrderBy, "deletedAt"?: undefined|CompasSqlOrderByOptionalField, }} StoreFileGroupViewOrderBySpec
*/
/**
* @typedef {QueryPart|("id"|"isComplete"|"name"|"scheduledAt"|"createdAt"|"updatedAt")[]} StoreJobOrderBy

@@ -132,3 +120,3 @@ */

/**
* @typedef {{"where"?: undefined|StoreFileWhere, "orderBy"?: undefined|StoreFileOrderBy, "orderBySpec"?: undefined|StoreFileOrderBySpec, "as"?: undefined|string, "limit"?: undefined|number, "offset"?: undefined|number, "group"?: undefined|StoreFileGroupQueryBuilder, "viaGroup"?: undefined|StoreFileGroupQueryTraverser, "groupView"?: undefined|StoreFileGroupViewQueryBuilder, "viaGroupView"?: undefined|StoreFileGroupViewQueryTraverser, }} StoreFileQueryBuilder
* @typedef {{"where"?: undefined|StoreFileWhere, "orderBy"?: undefined|StoreFileOrderBy, "orderBySpec"?: undefined|StoreFileOrderBySpec, "as"?: undefined|string, "limit"?: undefined|number, "offset"?: undefined|number, "group"?: undefined|StoreFileGroupQueryBuilder, "viaGroup"?: undefined|StoreFileGroupQueryTraverser, }} StoreFileQueryBuilder
*/

@@ -139,3 +127,3 @@ /**

/**
* @typedef {{"where"?: undefined|StoreFileWhere, "limit"?: undefined|number, "offset"?: undefined|number, "viaGroup"?: undefined|StoreFileGroupQueryTraverser, "viaGroupView"?: undefined|StoreFileGroupViewQueryTraverser, }} StoreFileQueryTraverser
* @typedef {{"where"?: undefined|StoreFileWhere, "limit"?: undefined|number, "offset"?: undefined|number, "viaGroup"?: undefined|StoreFileGroupQueryTraverser, }} StoreFileQueryTraverser
*/

@@ -146,8 +134,2 @@ /**

/**
* @typedef {{"where"?: undefined|StoreFileGroupViewWhere, "limit"?: undefined|number, "offset"?: undefined|number, "viaFile"?: undefined|StoreFileQueryTraverser, "viaParent"?: undefined|StoreFileGroupViewQueryTraverser, "viaChildren"?: undefined|StoreFileGroupViewQueryTraverser, }} StoreFileGroupViewQueryTraverser
*/
/**
* @typedef {{"where"?: undefined|StoreFileGroupViewWhere, "orderBy"?: undefined|StoreFileGroupViewOrderBy, "orderBySpec"?: undefined|StoreFileGroupViewOrderBySpec, "as"?: undefined|string, "limit"?: undefined|number, "offset"?: undefined|number, "file"?: undefined|StoreFileQueryBuilder, "viaFile"?: undefined|StoreFileQueryTraverser, "parent"?: undefined|StoreFileGroupViewQueryBuilder, "viaParent"?: undefined|StoreFileGroupViewQueryTraverser, "children"?: undefined|StoreFileGroupViewQueryBuilder, "viaChildren"?: undefined|StoreFileGroupViewQueryTraverser, }} StoreFileGroupViewQueryBuilder
*/
/**
* @typedef {{"where"?: undefined|StoreJobWhere, "orderBy"?: undefined|StoreJobOrderBy, "orderBySpec"?: undefined|StoreJobOrderBySpec, "as"?: undefined|string, "limit"?: undefined|number, "offset"?: undefined|number, }} StoreJobQueryBuilder

@@ -154,0 +136,0 @@ */

@@ -19,8 +19,2 @@ // Generated by @compas/code-gen

} from "./fileGroup.js";
import {
fileGroupViewOrderBy,
fileGroupViewWhere,
internalQueryFileGroupView,
transformFileGroupView,
} from "./fileGroupView.js";

@@ -407,26 +401,2 @@ const fileFieldSet = new Set([

}
if (where.groupViewExists) {
strings.push(
` AND EXISTS (SELECT FROM "fileGroupView" fgv WHERE `,
` AND fgv."file" = ${tableName}"id")`,
);
values.push(
fileGroupViewWhere(where.groupViewExists, "fgv.", {
skipValidator: true,
}),
undefined,
);
}
if (where.groupViewNotExists) {
strings.push(
` AND NOT EXISTS (SELECT FROM "fileGroupView" fgv WHERE `,
` AND fgv."file" = ${tableName}"id")`,
);
values.push(
fileGroupViewWhere(where.groupViewNotExists, "fgv.", {
skipValidator: true,
}),
undefined,
);
}
strings.push("");

@@ -703,38 +673,2 @@ return query(strings, ...values);

}
if (builder.viaGroupView) {
builder.where = builder.where ?? {};
// Prepare idIn
if (isQueryPart(builder.where.idIn)) {
builder.where.idIn.append(query` INTERSECT `);
} else if (
Array.isArray(builder.where.idIn) &&
builder.where.idIn.length > 0
) {
builder.where.idIn = query(
[
"(SELECT value::uuid FROM(values (",
...Array.from({ length: builder.where.idIn.length - 1 }).map(
() => "), (",
),
")) as ids(value)) INTERSECT ",
],
...builder.where.idIn,
);
} else {
builder.where.idIn = query``;
}
const offsetLimitQb = !isNil(builder.viaGroupView.offset)
? query`OFFSET ${builder.viaGroupView.offset}`
: query``;
if (!isNil(builder.viaGroupView.limit)) {
offsetLimitQb.append(
query`FETCH NEXT ${builder.viaGroupView.limit} ROWS ONLY`,
);
}
builder.where.idIn.append(query`
SELECT DISTINCT fgv."file"
${internalQueryFileGroupView(builder.viaGroupView)}
${offsetLimitQb}
`);
}
if (builder.group) {

@@ -779,43 +713,2 @@ const joinedKeys = [];

}
if (builder.groupView) {
const joinedKeys = [];
const offsetLimitQb = !isNil(builder.groupView.offset)
? query`OFFSET ${builder.groupView.offset}`
: query``;
if (!isNil(builder.groupView.limit)) {
offsetLimitQb.append(
query`FETCH NEXT ${builder.groupView.limit} ROWS ONLY`,
);
}
if (builder.groupView.file) {
joinedKeys.push(
`'${builder.groupView.file?.as ?? "file"}'`,
`"fgv_f_0"."result"`,
);
}
if (builder.groupView.parent) {
joinedKeys.push(
`'${builder.groupView.parent?.as ?? "parent"}'`,
`"fgv_fgv_0"."result"`,
);
}
if (builder.groupView.children) {
joinedKeys.push(
`'${builder.groupView.children?.as ?? "children"}'`,
`coalesce("fgv_fgv_1"."result", '{}')`,
);
}
joinQb.append(query`LEFT JOIN LATERAL (
SELECT to_jsonb(fgv.*) || jsonb_build_object(${query([
joinedKeys.join(","),
])}) as "result"
${internalQueryFileGroupView(builder.groupView, query`AND fgv."file" = f."id"`)}
ORDER BY ${fileGroupViewOrderBy(
builder.groupView.orderBy,
builder.groupView.orderBySpec,
"fgv.",
)}
${offsetLimitQb}
) as "f_fgv_0" ON TRUE`);
}
return query`

@@ -830,3 +723,2 @@ FROM "file" f

* @property {QueryResultStoreFileGroup|string|number} [group]
* @property {QueryResultStoreFileGroupView|string|number} [groupView]
*/

@@ -850,8 +742,2 @@ /**

}
if (builder.groupView) {
joinedKeys.push(
`'${builder.groupView?.as ?? "groupView"}'`,
`"f_fgv_0"."result"`,
);
}
const qb = query`

@@ -921,10 +807,3 @@ SELECT to_jsonb(f.*) || jsonb_build_object(${query([

}
value[builder.groupView?.as ?? "groupView"] =
value[builder.groupView?.as ?? "groupView"] ?? undefined;
if (isPlainObject(value[builder.groupView?.as ?? "groupView"])) {
const arr = [value[builder.groupView?.as ?? "groupView"]];
transformFileGroupView(arr, builder.groupView);
value[builder.groupView?.as ?? "groupView"] = arr[0];
}
}
}

@@ -884,8 +884,2 @@ // Generated by @compas/code-gen

}
if (builder.file.groupView) {
joinedKeys.push(
`'${builder.file.groupView?.as ?? "groupView"}'`,
`"f_fgv_0"."result"`,
);
}
joinQb.append(query`LEFT JOIN LATERAL (

@@ -1117,8 +1111,2 @@ SELECT to_jsonb(f.*) || jsonb_build_object(${query([

}
if (builder.file.groupView) {
joinedKeys.push(
`'${builder.file.groupView?.as ?? "groupView"}'`,
`"f_fgv_0"."result"`,
);
}
joinQb.append(query`LEFT JOIN LATERAL (

@@ -1125,0 +1113,0 @@ SELECT to_jsonb(f.*) || jsonb_build_object(${query([

@@ -6,3 +6,2 @@ // Generated by @compas/code-gen

import { fileGroupQueries } from "./fileGroup.js";
import { fileGroupViewQueries } from "./fileGroupView.js";
import { jobQueries } from "./job.js";

@@ -14,5 +13,4 @@ import { sessionQueries } from "./session.js";

...fileGroupQueries,
...fileGroupViewQueries,
...jobQueries,
...sessionQueries,
};

@@ -10,3 +10,2 @@ // Generated by @compas/code-gen

anonymousValidator144635851,
anonymousValidator1468307041,
anonymousValidator153017499,

@@ -17,8 +16,5 @@ anonymousValidator163358845,

anonymousValidator1805657267,
anonymousValidator1823959232,
anonymousValidator1862233461,
anonymousValidator1952914356,
anonymousValidator2038758416,
anonymousValidator2041901602,
anonymousValidator2056027066,
anonymousValidator2060025506,

@@ -31,3 +27,2 @@ anonymousValidator2074494218,

anonymousValidator343387919,
anonymousValidator420606873,
anonymousValidator420878393,

@@ -39,3 +34,2 @@ anonymousValidator430889951,

anonymousValidator685221527,
anonymousValidator744250041,
anonymousValidator753972035,

@@ -70,10 +64,2 @@ } from "../common/anonymous-validators.js";

/**
* @param {undefined|*} value
* @param {string|undefined} [propertyPath]
* @returns {StoreFileGroupView}
*/
export function validateStoreFileGroupView(value, propertyPath = "$") {
return anonymousValidator420606873(value, propertyPath, []);
}
/**
* User definable, optional object to store whatever you want

@@ -131,10 +117,2 @@ *

* @param {string|undefined} [propertyPath]
* @returns {StoreFileGroupViewWhere}
*/
export function validateStoreFileGroupViewWhere(value, propertyPath = "$") {
return anonymousValidator1823959232(value, propertyPath, []);
}
/**
* @param {undefined|*} value
* @param {string|undefined} [propertyPath]
* @returns {StoreJobWhere}

@@ -188,21 +166,2 @@ */

* @param {string|undefined} [propertyPath]
* @returns {StoreFileGroupViewOrderBy}
*/
export function validateStoreFileGroupViewOrderBy(value, propertyPath = "$") {
return anonymousValidator2041901602(value, propertyPath, []);
}
/**
* @param {undefined|*} value
* @param {string|undefined} [propertyPath]
* @returns {StoreFileGroupViewOrderBySpec}
*/
export function validateStoreFileGroupViewOrderBySpec(
value,
propertyPath = "$",
) {
return anonymousValidator744250041(value, propertyPath, []);
}
/**
* @param {undefined|*} value
* @param {string|undefined} [propertyPath]
* @returns {StoreJobOrderBy}

@@ -275,24 +234,2 @@ */

* @param {string|undefined} [propertyPath]
* @returns {StoreFileGroupViewQueryBuilder}
*/
export function validateStoreFileGroupViewQueryBuilder(
value,
propertyPath = "$",
) {
return anonymousValidator2056027066(value, propertyPath, []);
}
/**
* @param {undefined|*} value
* @param {string|undefined} [propertyPath]
* @returns {StoreFileGroupViewQueryTraverser}
*/
export function validateStoreFileGroupViewQueryTraverser(
value,
propertyPath = "$",
) {
return anonymousValidator1468307041(value, propertyPath, []);
}
/**
* @param {undefined|*} value
* @param {string|undefined} [propertyPath]
* @returns {StoreJobQueryBuilder}

@@ -299,0 +236,0 @@ */

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