diff --git a/.npmrc b/.npmrc index e61268d8..550a85e7 100644 --- a/.npmrc +++ b/.npmrc @@ -2,3 +2,5 @@ strict-peer-dependencies=true auto-install-peers=true legacy-peer-deps=false registry=https://registry.npmmirror.com/ +sharp_binary_host="https://npmmirror.com/mirrors/sharp" +sharp_libvips_binary_host="https://npmmirror.com/mirrors/sharp-libvips" diff --git a/components/wener-tiptap/package.json b/components/wener-tiptap/package.json index ab76b4a0..a845d954 100644 --- a/components/wener-tiptap/package.json +++ b/components/wener-tiptap/package.json @@ -100,7 +100,7 @@ "@tiptap/react": "^2.0.0-beta.202", "@tiptap/starter-kit": "^2.0.0-beta.202", "@tiptap/suggestion": "^2.0.0-beta.202", - "@wener/utils": "workspace:1.1.8", + "@wener/utils": "workspace:*", "classnames": "^2.3.2", "linkify-it": "^4.0.1", "markdown-it": "^13.0.1", diff --git a/packages/ohm-grammar-miniquery/Makefile b/packages/ohm-grammar-miniquery/Makefile new file mode 100644 index 00000000..bd6c1c16 --- /dev/null +++ b/packages/ohm-grammar-miniquery/Makefile @@ -0,0 +1,8 @@ +REPO_ROOT ?= $(shell git rev-parse --show-toplevel) +include $(REPO_ROOT)/node.mk + +publish: fmt build + pnpm publish --access public --registry https://registry.npmjs.org --tag latest + +cover: + pnpm exec c8 ava diff --git a/packages/ohm-grammar-miniquery/README.md b/packages/ohm-grammar-miniquery/README.md new file mode 100644 index 00000000..d3e40310 --- /dev/null +++ b/packages/ohm-grammar-miniquery/README.md @@ -0,0 +1,13 @@ +# ohm-grammar-miniquery + +SQL Where like filter expression for sequelize + +## Sequelize + +```ts +import {toSequelizeWhere} from 'ohm-grammar-miniquery/sequelize'; + +await User.findAll({ + where: toSequelizeWhere(`name like 'wen%' and age > 18`), +}); +``` diff --git a/packages/ohm-grammar-miniquery/index.js b/packages/ohm-grammar-miniquery/index.js new file mode 100644 index 00000000..99b40968 --- /dev/null +++ b/packages/ohm-grammar-miniquery/index.js @@ -0,0 +1 @@ +export * from './lib' diff --git a/packages/ohm-grammar-miniquery/index.ts b/packages/ohm-grammar-miniquery/index.ts new file mode 100644 index 00000000..6f39cd49 --- /dev/null +++ b/packages/ohm-grammar-miniquery/index.ts @@ -0,0 +1 @@ +export * from './src' diff --git a/packages/ohm-grammar-miniquery/package.json b/packages/ohm-grammar-miniquery/package.json new file mode 100644 index 00000000..46dc4e59 --- /dev/null +++ b/packages/ohm-grammar-miniquery/package.json @@ -0,0 +1,83 @@ +{ + "name": "ohm-grammar-miniquery", + "version": "1.0.5", + "type": "module", + "description": "MiniQuery grammars for various editions of ORM/SQL.", + "repository": { + "type": "git", + "url": "git+https://github.com/wenerme/js-miniquery.git" + }, + "homepage": "https://github.com/wenerme/js-miniquery/tree/main/packages/ohm-grammar-miniquery#readme", + "bugs": { + "url": "https://github.com/wenerme/js-miniquery/issues" + }, + "license": "MIT", + "exports": { + ".": { + "import": "./lib/index.js", + "require": "./lib/cjs/index.js", + "types": "./src/index.ts" + }, + "./sequelize": { + "import": "./lib/sequelize/index.js", + "require": "./lib/cjs/sequelize/index.js", + "types": "./src/sequelize/index.ts" + }, + "./package.json": "./package.json" + }, + "files": [ + "index.js", + "index.ts", + "lib", + "sequelize.js", + "sequelize.ts", + "src", + "tsconfig.json" + ], + "keywords": [ + "ohm", + "ohm-grammar", + "miniquery", + "sql", + "sequelize", + "peg" + ], + "scripts": { + "build": "make build", + "dev": "make dev", + "gen": "ohm generateBundles --withTypes --esm ./src/grammar/miniquery.ohm", + "lint": "make lint", + "test": "make test" + }, + "peerDependencies": { + "@sequelize/core": "*", + "ohm-js": "^16" + }, + "peerDependenciesMeta": { + "@sequelize/core": { + "optional": true + } + }, + "devDependencies": { + "@ohm-js/cli": "^1.1.0", + "c8": "^7.12.0", + "sqlite3": "^5.0.11" + }, + "publishConfig": { + "access": "public", + "registry": "https://registry.npmjs.org" + }, + "sideEffects": [ + "./lib/ast.js" + ], + "ava": { + "extensions": { + "ts": "module" + }, + "nodeArguments": [ + "--conditions=typescript", + "--require=@wener/wode/suppress-experimental.cjs", + "--loader=tsx" + ] + } +} diff --git a/packages/ohm-grammar-miniquery/sequelize.js b/packages/ohm-grammar-miniquery/sequelize.js new file mode 100644 index 00000000..bdf0acca --- /dev/null +++ b/packages/ohm-grammar-miniquery/sequelize.js @@ -0,0 +1 @@ +export * from './lib/sequelize' diff --git a/packages/ohm-grammar-miniquery/sequelize.ts b/packages/ohm-grammar-miniquery/sequelize.ts new file mode 100644 index 00000000..b5d6102b --- /dev/null +++ b/packages/ohm-grammar-miniquery/sequelize.ts @@ -0,0 +1 @@ +export * from './src/sequelize'; diff --git a/packages/ohm-grammar-miniquery/src/ast.test.ts b/packages/ohm-grammar-miniquery/src/ast.test.ts new file mode 100644 index 00000000..c6f67f59 --- /dev/null +++ b/packages/ohm-grammar-miniquery/src/ast.test.ts @@ -0,0 +1,9 @@ +import test from 'ava'; +import { toMiniQueryAST } from './ast'; + +test('miniquery ast', (t) => { + for (const v of [`a > -1`]) { + const ast = toMiniQueryAST(v); + t.truthy(ast); + } +}); diff --git a/packages/ohm-grammar-miniquery/src/ast.ts b/packages/ohm-grammar-miniquery/src/ast.ts new file mode 100644 index 00000000..09be8326 --- /dev/null +++ b/packages/ohm-grammar-miniquery/src/ast.ts @@ -0,0 +1,202 @@ +import type { ActionDict, IterationNode, MatchResult } from 'ohm-js'; +import { MiniQueryGrammar, MiniQuerySemantics } from './grammar'; + +export type MiniQueryASTNode = + | { + type: 'identifier'; + name: string; + } + | { + type: 'logic'; + op: 'and' | 'or'; + a: MiniQueryASTNode; + b: MiniQueryASTNode; + } + | { + type: 'rel'; + op: 'gt' | 'lt' | 'gte' | 'lte' | 'eq' | 'ne' | 'like' | 'has' | 'in' | 'not in' | 'not like' | 'is' | 'is not'; + a: MiniQueryASTNode; + b: MiniQueryASTNode; + } + | { + type: 'between'; + op: 'between' | 'not between'; + a: MiniQueryASTNode; + b: MiniQueryASTNode; + c: MiniQueryASTNode; + } + | { + type: 'call'; + name: string; + value: MiniQueryASTNode[]; + } + | { + type: 'unary'; + op: 'pos' | 'neg' | 'not'; + value: MiniQueryASTNode; + } + | { + type: 'paren'; + value: MiniQueryASTNode; + } + | { + type: 'array'; + value: MiniQueryASTNode[]; + } + | { + type: 'int'; + value: number; + } + | { + type: 'float'; + value: number; + } + | { + type: 'string'; + value: string; + } + | { + type: 'null'; + } + | { + type: 'bool'; + value: boolean; + } + | { + type: 'ref'; + name: string[]; + }; + +const Ops: Record = { + '&&': 'and', + '||': 'or', + '=': 'eq', + '==': 'eq', + '!=': 'ne', + '<>': 'ne', + '>': 'gt', + '>=': 'gte', + '<': 'lt', + '<=': 'lte', + ':': 'has', +}; + +export function getMiniQueryASTOp(v: string) { + const s = v.toLowerCase().trim().replaceAll(/\s+/g, ' '); + return Ops[s] || s; +} + +const actions: ActionDict = { + nonEmpty(first, _, rest: IterationNode, _pad) { + return [first].concat(rest.children).map((v) => v.toAST()); + }, + rel(a, op, b) { + let v = op.sourceString; + if (op.isIteration()) { + v = op.children.map((vv) => vv.sourceString).join(' '); + } + return { + type: 'rel', + op: getMiniQueryASTOp(v) as any, + a: a.toAST(), + b: b.toAST(), + v: 'bool', + }; + }, + empty() { + return []; + }, +}; + +export function toMiniQueryAST(s: string | MatchResult) { + let match: MatchResult; + if (typeof s === 'string') { + match = MiniQueryGrammar.match(s); + } else { + match = s; + } + if (match.failed()) { + throw new SyntaxError(`Invalid MiniQuery: ${match.message}`); + } + return MiniQuerySemantics(match).toAST(); +} + +MiniQuerySemantics.addOperation('toAST()', { + Main(expr, _) { + return expr.toAST(); + }, + LogicExpr_match(a, op, b) { + return { + type: 'logic', + op: getMiniQueryASTOp(op.sourceString) as any, + a: a.toAST(), + b: b.toAST(), + v: 'bool', + }; + }, + RelExpr_match: actions.rel, + RelExpr_match_eq: actions.rel, + RelExpr_has: actions.rel, + InExpr_match: actions.rel, + PredicateExpr_like: actions.rel, + PredicateExpr_is: actions.rel, + BetweenExpr_match(a, op, b, _, c) { + return { + type: 'between', + op: op.sourceString as any, + a: a.toAST(), + b: b.toAST(), + c: c.toAST(), + v: 'bool', + }; + }, + CallExpr_match(n, _, v, _end) { + return { type: 'call', name: n.sourceString, value: v.toAST() }; + }, + PriExpr_paren(_, v, _end) { + return { type: 'paren', value: v.toAST() }; + }, + PriExpr_not(op, v) { + return { type: 'unary', op: getMiniQueryASTOp(op.sourceString) as any, value: v.toAST(), v: 'bool' }; + }, + PriExpr_pos(op, v) { + return { type: 'unary', op: getMiniQueryASTOp(op.sourceString) as any, value: v.toAST() }; + }, + PriExpr_neg(op, v) { + return { type: 'unary', op: getMiniQueryASTOp(op.sourceString) as any, value: v.toAST() }; + }, + Array(_, list, _end) { + return { type: 'array', value: list.toAST(), v: Array }; + }, + int: (s, _, v) => { + return { type: 'int', value: parseInt(`${s.sourceString || ''}${v.sourceString}`), v: 'int' }; + }, + float: (i, _, f) => { + return { type: 'float', value: parseFloat(`${i?.sourceString || 0}.${f.sourceString}`), v: Number }; + }, + string: (_, v, _end) => { + return { type: 'string', value: v.sourceString, v: 'string' }; + }, + ident: (a, b) => { + return { type: 'identifier', name: [a, b].map((v) => v.sourceString).join('') }; + }, + null: (_) => { + return { type: 'null', v: 'null' }; + }, + bool: (v) => { + return { type: 'bool', value: v.sourceString.toLowerCase() === 'true', v: 'bool' }; + }, + ref(a, b, c: IterationNode) { + return { + type: 'ref', + name: [a.sourceString].concat( + c.children.map((v) => { + const ast = v.toAST(); + return ast.name || ast.value; + }), + ), + }; + }, + TrailNonEmptyListOf: actions.nonEmpty, + EmptyListOf: actions.empty, +}); diff --git a/packages/ohm-grammar-miniquery/src/grammar/index.ts b/packages/ohm-grammar-miniquery/src/grammar/index.ts new file mode 100644 index 00000000..7df546f1 --- /dev/null +++ b/packages/ohm-grammar-miniquery/src/grammar/index.ts @@ -0,0 +1,6 @@ +import grammar from './miniquery.ohm-bundle'; + +export { default as MiniQueryGrammar } from './miniquery.ohm-bundle'; +export default grammar; +export const semantics = grammar.createSemantics(); +export const MiniQuerySemantics = semantics; diff --git a/packages/ohm-grammar-miniquery/src/grammar/miniquery.ohm b/packages/ohm-grammar-miniquery/src/grammar/miniquery.ohm new file mode 100644 index 00000000..e16af044 --- /dev/null +++ b/packages/ohm-grammar-miniquery/src/grammar/miniquery.ohm @@ -0,0 +1,67 @@ +MiniQuery { + Main = Expr end + Expr = LogicExpr + + LogicExpr + = LogicExpr logic RelExpr -- match + | RelExpr + + RelExpr + = RelExpr (">=" | "<=" | ">" | "<") InExpr -- match + | RelExpr ("==" | "!=" | "<>" | "=") InExpr -- match_eq + | RelExpr ":" literal -- has + | InExpr + InExpr + = InExpr in Array -- match + | PredicateExpr + PredicateExpr + = PredicateExpr is (null| bool) -- is + | PredicateExpr like string -- like + | BetweenExpr + BetweenExpr + = BetweenExpr between CallExpr "and" CallExpr -- match + | CallExpr + CallExpr + = ident "(" ListOf ")" -- match + | PriExpr + + PriExpr + = "(" Expr ")" -- paren + | caseInsensitive<"not"> Expr -- not + | Array + | Value + | "+" Expr -- pos + | "-" Expr -- neg + + + Array = "(" ListOf ")" | "[" ListOf "]" + Value = literal | ref | ident + + ListOf + := TrailNonEmptyListOf + | EmptyListOf + + TrailNonEmptyListOf + = elem (sep elem)* sep? + + in = (caseInsensitive<"not"> space+)? caseInsensitive<"in"> + is = caseInsensitive<"is"> (space+ caseInsensitive<"not">?) + logic = caseInsensitive<"and"> | caseInsensitive<"or"> | "&&" | "||" + like = (caseInsensitive<"not"> space+)? (caseInsensitive<"like"> | caseInsensitive<"ilike">) + between = (caseInsensitive<"not"> space+)? caseInsensitive<"between"> + + ref = ident ( "." (ident | string) )+ + ident = letter (alnum | "_")* + literal = string | float | int | bool | null + null = "null" | "NULL" + bool = "true" | "false" | "TRUE" | "FALSE" + string + = "'" (~"'" any)* "'" + | "\"" (~"\"" any)* "\"" + int = (("-"|"+") spaces)? uint + uint + = "0" + | int_non_zero + int_non_zero = "1".."9" digit* + float = int? "." digit+ +} diff --git a/packages/ohm-grammar-miniquery/src/grammar/miniquery.ohm-bundle.d.ts b/packages/ohm-grammar-miniquery/src/grammar/miniquery.ohm-bundle.d.ts new file mode 100644 index 00000000..3bb207b8 --- /dev/null +++ b/packages/ohm-grammar-miniquery/src/grammar/miniquery.ohm-bundle.d.ts @@ -0,0 +1,86 @@ +// AUTOGENERATED FILE +// This file was generated from miniquery.ohm by `ohm generateBundles`. +import type { ActionDict, Grammar, IterationNode, Node, NonterminalNode, Semantics, TerminalNode } from 'ohm-js'; + +export interface MiniQueryActionDict extends ActionDict { + Main?: (this: NonterminalNode, arg0: NonterminalNode, arg1: NonterminalNode) => T; + Expr?: (this: NonterminalNode, arg0: NonterminalNode) => T; + LogicExpr_match?: (this: NonterminalNode, arg0: NonterminalNode, arg1: NonterminalNode, arg2: NonterminalNode) => T; + LogicExpr?: (this: NonterminalNode, arg0: NonterminalNode) => T; + RelExpr_match?: (this: NonterminalNode, arg0: NonterminalNode, arg1: TerminalNode, arg2: NonterminalNode) => T; + RelExpr_match_eq?: (this: NonterminalNode, arg0: NonterminalNode, arg1: TerminalNode, arg2: NonterminalNode) => T; + RelExpr_has?: (this: NonterminalNode, arg0: NonterminalNode, arg1: TerminalNode, arg2: NonterminalNode) => T; + RelExpr?: (this: NonterminalNode, arg0: NonterminalNode) => T; + InExpr_match?: (this: NonterminalNode, arg0: NonterminalNode, arg1: NonterminalNode, arg2: NonterminalNode) => T; + InExpr?: (this: NonterminalNode, arg0: NonterminalNode) => T; + PredicateExpr_is?: (this: NonterminalNode, arg0: NonterminalNode, arg1: NonterminalNode, arg2: NonterminalNode) => T; + PredicateExpr_like?: ( + this: NonterminalNode, + arg0: NonterminalNode, + arg1: NonterminalNode, + arg2: NonterminalNode, + ) => T; + PredicateExpr?: (this: NonterminalNode, arg0: NonterminalNode) => T; + BetweenExpr_match?: ( + this: NonterminalNode, + arg0: NonterminalNode, + arg1: NonterminalNode, + arg2: NonterminalNode, + arg3: TerminalNode, + arg4: NonterminalNode, + ) => T; + BetweenExpr?: (this: NonterminalNode, arg0: NonterminalNode) => T; + CallExpr_match?: ( + this: NonterminalNode, + arg0: NonterminalNode, + arg1: TerminalNode, + arg2: NonterminalNode, + arg3: TerminalNode, + ) => T; + CallExpr?: (this: NonterminalNode, arg0: NonterminalNode) => T; + PriExpr_paren?: (this: NonterminalNode, arg0: TerminalNode, arg1: NonterminalNode, arg2: TerminalNode) => T; + PriExpr_not?: (this: NonterminalNode, arg0: NonterminalNode, arg1: NonterminalNode) => T; + PriExpr_pos?: (this: NonterminalNode, arg0: TerminalNode, arg1: NonterminalNode) => T; + PriExpr_neg?: (this: NonterminalNode, arg0: TerminalNode, arg1: NonterminalNode) => T; + PriExpr?: (this: NonterminalNode, arg0: NonterminalNode) => T; + Array?: (this: NonterminalNode, arg0: TerminalNode, arg1: NonterminalNode, arg2: TerminalNode) => T; + Value?: (this: NonterminalNode, arg0: NonterminalNode) => T; + ListOf?: (this: NonterminalNode, arg0: NonterminalNode) => T; + TrailNonEmptyListOf?: ( + this: NonterminalNode, + arg0: Node, + arg1: IterationNode, + arg2: IterationNode, + arg3: IterationNode, + ) => T; + in?: (this: NonterminalNode, arg0: IterationNode, arg1: IterationNode, arg2: NonterminalNode) => T; + is?: (this: NonterminalNode, arg0: NonterminalNode, arg1: IterationNode, arg2: IterationNode) => T; + logic?: (this: NonterminalNode, arg0: NonterminalNode | TerminalNode) => T; + like?: (this: NonterminalNode, arg0: IterationNode, arg1: IterationNode, arg2: NonterminalNode) => T; + between?: (this: NonterminalNode, arg0: IterationNode, arg1: IterationNode, arg2: NonterminalNode) => T; + ref?: (this: NonterminalNode, arg0: NonterminalNode, arg1: IterationNode, arg2: IterationNode) => T; + ident?: (this: NonterminalNode, arg0: NonterminalNode, arg1: IterationNode) => T; + literal?: (this: NonterminalNode, arg0: NonterminalNode) => T; + null?: (this: NonterminalNode, arg0: TerminalNode) => T; + bool?: (this: NonterminalNode, arg0: TerminalNode) => T; + string?: (this: NonterminalNode, arg0: TerminalNode, arg1: IterationNode, arg2: TerminalNode) => T; + int?: (this: NonterminalNode, arg0: IterationNode, arg1: IterationNode, arg2: NonterminalNode) => T; + uint?: (this: NonterminalNode, arg0: NonterminalNode | TerminalNode) => T; + int_non_zero?: (this: NonterminalNode, arg0: TerminalNode, arg1: IterationNode) => T; + float?: (this: NonterminalNode, arg0: IterationNode, arg1: TerminalNode, arg2: IterationNode) => T; +} + +export interface MiniQuerySemantics extends Semantics { + addOperation(name: string, actionDict: MiniQueryActionDict): this; + extendOperation(name: string, actionDict: MiniQueryActionDict): this; + addAttribute(name: string, actionDict: MiniQueryActionDict): this; + extendAttribute(name: string, actionDict: MiniQueryActionDict): this; +} + +export interface MiniQueryGrammar extends Grammar { + createSemantics(): MiniQuerySemantics; + extendSemantics(superSemantics: MiniQuerySemantics): MiniQuerySemantics; +} + +declare const grammar: MiniQueryGrammar; +export default grammar; diff --git a/packages/ohm-grammar-miniquery/src/grammar/miniquery.ohm-bundle.js b/packages/ohm-grammar-miniquery/src/grammar/miniquery.ohm-bundle.js new file mode 100644 index 00000000..6a5e893b --- /dev/null +++ b/packages/ohm-grammar-miniquery/src/grammar/miniquery.ohm-bundle.js @@ -0,0 +1,770 @@ +import ohm from 'ohm-js'; + +const result = ohm.makeRecipe([ + 'grammar', + { + source: + 'MiniQuery {\n Main = Expr end\n Expr = LogicExpr\n\n LogicExpr\n = LogicExpr logic RelExpr -- match\n | RelExpr\n\n RelExpr\n = RelExpr (">=" | "<=" | ">" | "<") InExpr -- match\n | RelExpr ("==" | "!=" | "<>" | "=") InExpr -- match_eq\n | RelExpr ":" literal -- has\n | InExpr\n InExpr\n = InExpr in Array -- match\n | PredicateExpr\n PredicateExpr\n = PredicateExpr is (null| bool) -- is\n | PredicateExpr like string -- like\n | BetweenExpr\n BetweenExpr\n = BetweenExpr between CallExpr "and" CallExpr -- match\n | CallExpr\n CallExpr\n = ident "(" ListOf ")" -- match\n | PriExpr\n\n PriExpr\n = "(" Expr ")" -- paren\n | caseInsensitive<"not"> Expr -- not\n | Array\n | Value\n | "+" Expr -- pos\n | "-" Expr -- neg\n\n\n Array = "(" ListOf ")" | "[" ListOf "]"\n Value = literal | ref | ident\n\n ListOf\n := TrailNonEmptyListOf\n | EmptyListOf\n\n TrailNonEmptyListOf\n = elem (sep elem)* sep?\n\n in = (caseInsensitive<"not"> space+)? caseInsensitive<"in">\n is = caseInsensitive<"is"> (space+ caseInsensitive<"not">?)\n logic = caseInsensitive<"and"> | caseInsensitive<"or"> | "&&" | "||"\n like = (caseInsensitive<"not"> space+)? (caseInsensitive<"like"> | caseInsensitive<"ilike">)\n between = (caseInsensitive<"not"> space+)? caseInsensitive<"between">\n\n ref = ident ( "." (ident | string) )+\n ident = letter (alnum | "_")*\n literal = string | float | int | bool | null\n null = "null" | "NULL"\n bool = "true" | "false" | "TRUE" | "FALSE"\n string\n = "\'" (~"\'" any)* "\'"\n | "\\"" (~"\\"" any)* "\\""\n int = (("-"|"+") spaces)? uint\n uint\n = "0"\n | int_non_zero\n int_non_zero = "1".."9" digit*\n float = int? "." digit+\n}', + }, + 'MiniQuery', + null, + 'Main', + { + Main: [ + 'define', + { sourceInterval: [14, 29] }, + null, + [], + [ + 'seq', + { sourceInterval: [21, 29] }, + ['app', { sourceInterval: [21, 25] }, 'Expr', []], + ['app', { sourceInterval: [26, 29] }, 'end', []], + ], + ], + Expr: ['define', { sourceInterval: [32, 48] }, null, [], ['app', { sourceInterval: [39, 48] }, 'LogicExpr', []]], + LogicExpr_match: [ + 'define', + { sourceInterval: [68, 100] }, + null, + [], + [ + 'seq', + { sourceInterval: [68, 91] }, + ['app', { sourceInterval: [68, 77] }, 'LogicExpr', []], + ['app', { sourceInterval: [78, 83] }, 'logic', []], + ['app', { sourceInterval: [84, 91] }, 'RelExpr', []], + ], + ], + LogicExpr: [ + 'define', + { sourceInterval: [52, 114] }, + null, + [], + [ + 'alt', + { sourceInterval: [68, 114] }, + ['app', { sourceInterval: [68, 91] }, 'LogicExpr_match', []], + ['app', { sourceInterval: [107, 114] }, 'RelExpr', []], + ], + ], + RelExpr_match: [ + 'define', + { sourceInterval: [132, 182] }, + null, + [], + [ + 'seq', + { sourceInterval: [132, 173] }, + ['app', { sourceInterval: [132, 139] }, 'RelExpr', []], + [ + 'alt', + { sourceInterval: [141, 165] }, + ['terminal', { sourceInterval: [141, 145] }, '>='], + ['terminal', { sourceInterval: [148, 152] }, '<='], + ['terminal', { sourceInterval: [156, 159] }, '>'], + ['terminal', { sourceInterval: [162, 165] }, '<'], + ], + ['app', { sourceInterval: [167, 173] }, 'InExpr', []], + ], + ], + RelExpr_match_eq: [ + 'define', + { sourceInterval: [189, 242] }, + null, + [], + [ + 'seq', + { sourceInterval: [189, 230] }, + ['app', { sourceInterval: [189, 196] }, 'RelExpr', []], + [ + 'alt', + { sourceInterval: [198, 222] }, + ['terminal', { sourceInterval: [198, 202] }, '=='], + ['terminal', { sourceInterval: [205, 209] }, '!='], + ['terminal', { sourceInterval: [212, 216] }, '<>'], + ['terminal', { sourceInterval: [219, 222] }, '='], + ], + ['app', { sourceInterval: [224, 230] }, 'InExpr', []], + ], + ], + RelExpr_has: [ + 'define', + { sourceInterval: [249, 275] }, + null, + [], + [ + 'seq', + { sourceInterval: [249, 268] }, + ['app', { sourceInterval: [249, 256] }, 'RelExpr', []], + ['terminal', { sourceInterval: [257, 260] }, ':'], + ['app', { sourceInterval: [261, 268] }, 'literal', []], + ], + ], + RelExpr: [ + 'define', + { sourceInterval: [118, 288] }, + null, + [], + [ + 'alt', + { sourceInterval: [132, 288] }, + ['app', { sourceInterval: [132, 173] }, 'RelExpr_match', []], + ['app', { sourceInterval: [189, 230] }, 'RelExpr_match_eq', []], + ['app', { sourceInterval: [249, 268] }, 'RelExpr_has', []], + ['app', { sourceInterval: [282, 288] }, 'InExpr', []], + ], + ], + InExpr_match: [ + 'define', + { sourceInterval: [304, 328] }, + null, + [], + [ + 'seq', + { sourceInterval: [304, 319] }, + ['app', { sourceInterval: [304, 310] }, 'InExpr', []], + ['app', { sourceInterval: [311, 313] }, 'in', []], + ['app', { sourceInterval: [314, 319] }, 'Array', []], + ], + ], + InExpr: [ + 'define', + { sourceInterval: [291, 348] }, + null, + [], + [ + 'alt', + { sourceInterval: [304, 348] }, + ['app', { sourceInterval: [304, 319] }, 'InExpr_match', []], + ['app', { sourceInterval: [335, 348] }, 'PredicateExpr', []], + ], + ], + PredicateExpr_is: [ + 'define', + { sourceInterval: [371, 406] }, + null, + [], + [ + 'seq', + { sourceInterval: [371, 400] }, + ['app', { sourceInterval: [371, 384] }, 'PredicateExpr', []], + ['app', { sourceInterval: [385, 387] }, 'is', []], + [ + 'alt', + { sourceInterval: [389, 399] }, + ['app', { sourceInterval: [389, 393] }, 'null', []], + ['app', { sourceInterval: [395, 399] }, 'bool', []], + ], + ], + ], + PredicateExpr_like: [ + 'define', + { sourceInterval: [413, 446] }, + null, + [], + [ + 'seq', + { sourceInterval: [413, 438] }, + ['app', { sourceInterval: [413, 426] }, 'PredicateExpr', []], + ['app', { sourceInterval: [427, 431] }, 'like', []], + ['app', { sourceInterval: [432, 438] }, 'string', []], + ], + ], + PredicateExpr: [ + 'define', + { sourceInterval: [351, 464] }, + null, + [], + [ + 'alt', + { sourceInterval: [371, 464] }, + ['app', { sourceInterval: [371, 400] }, 'PredicateExpr_is', []], + ['app', { sourceInterval: [413, 438] }, 'PredicateExpr_like', []], + ['app', { sourceInterval: [453, 464] }, 'BetweenExpr', []], + ], + ], + BetweenExpr_match: [ + 'define', + { sourceInterval: [485, 537] }, + null, + [], + [ + 'seq', + { sourceInterval: [485, 528] }, + ['app', { sourceInterval: [485, 496] }, 'BetweenExpr', []], + ['app', { sourceInterval: [497, 504] }, 'between', []], + ['app', { sourceInterval: [505, 513] }, 'CallExpr', []], + ['terminal', { sourceInterval: [514, 519] }, 'and'], + ['app', { sourceInterval: [520, 528] }, 'CallExpr', []], + ], + ], + BetweenExpr: [ + 'define', + { sourceInterval: [467, 552] }, + null, + [], + [ + 'alt', + { sourceInterval: [485, 552] }, + ['app', { sourceInterval: [485, 528] }, 'BetweenExpr_match', []], + ['app', { sourceInterval: [544, 552] }, 'CallExpr', []], + ], + ], + CallExpr_match: [ + 'define', + { sourceInterval: [570, 609] }, + null, + [], + [ + 'seq', + { sourceInterval: [570, 600] }, + ['app', { sourceInterval: [570, 575] }, 'ident', []], + ['terminal', { sourceInterval: [576, 579] }, '('], + [ + 'app', + { sourceInterval: [580, 596] }, + 'ListOf', + [ + ['app', { sourceInterval: [587, 591] }, 'Expr', []], + ['terminal', { sourceInterval: [592, 595] }, ','], + ], + ], + ['terminal', { sourceInterval: [597, 600] }, ')'], + ], + ], + CallExpr: [ + 'define', + { sourceInterval: [555, 623] }, + null, + [], + [ + 'alt', + { sourceInterval: [570, 623] }, + ['app', { sourceInterval: [570, 600] }, 'CallExpr_match', []], + ['app', { sourceInterval: [616, 623] }, 'PriExpr', []], + ], + ], + PriExpr_paren: [ + 'define', + { sourceInterval: [641, 662] }, + null, + [], + [ + 'seq', + { sourceInterval: [641, 653] }, + ['terminal', { sourceInterval: [641, 644] }, '('], + ['app', { sourceInterval: [645, 649] }, 'Expr', []], + ['terminal', { sourceInterval: [650, 653] }, ')'], + ], + ], + PriExpr_not: [ + 'define', + { sourceInterval: [669, 703] }, + null, + [], + [ + 'seq', + { sourceInterval: [669, 696] }, + [ + 'app', + { sourceInterval: [669, 691] }, + 'caseInsensitive', + [['terminal', { sourceInterval: [685, 690] }, 'not']], + ], + ['app', { sourceInterval: [692, 696] }, 'Expr', []], + ], + ], + PriExpr_pos: [ + 'define', + { sourceInterval: [734, 749] }, + null, + [], + [ + 'seq', + { sourceInterval: [734, 742] }, + ['terminal', { sourceInterval: [734, 737] }, '+'], + ['app', { sourceInterval: [738, 742] }, 'Expr', []], + ], + ], + PriExpr_neg: [ + 'define', + { sourceInterval: [756, 771] }, + null, + [], + [ + 'seq', + { sourceInterval: [756, 764] }, + ['terminal', { sourceInterval: [756, 759] }, '-'], + ['app', { sourceInterval: [760, 764] }, 'Expr', []], + ], + ], + PriExpr: [ + 'define', + { sourceInterval: [627, 771] }, + null, + [], + [ + 'alt', + { sourceInterval: [641, 771] }, + ['app', { sourceInterval: [641, 653] }, 'PriExpr_paren', []], + ['app', { sourceInterval: [669, 696] }, 'PriExpr_not', []], + ['app', { sourceInterval: [710, 715] }, 'Array', []], + ['app', { sourceInterval: [722, 727] }, 'Value', []], + ['app', { sourceInterval: [734, 742] }, 'PriExpr_pos', []], + ['app', { sourceInterval: [756, 764] }, 'PriExpr_neg', []], + ], + ], + Array: [ + 'define', + { sourceInterval: [776, 837] }, + null, + [], + [ + 'alt', + { sourceInterval: [786, 837] }, + [ + 'seq', + { sourceInterval: [786, 810] }, + ['terminal', { sourceInterval: [786, 789] }, '('], + [ + 'app', + { sourceInterval: [790, 806] }, + 'ListOf', + [ + ['app', { sourceInterval: [797, 801] }, 'Expr', []], + ['terminal', { sourceInterval: [802, 805] }, ','], + ], + ], + ['terminal', { sourceInterval: [807, 810] }, ')'], + ], + [ + 'seq', + { sourceInterval: [813, 837] }, + ['terminal', { sourceInterval: [813, 816] }, '['], + [ + 'app', + { sourceInterval: [817, 833] }, + 'ListOf', + [ + ['app', { sourceInterval: [824, 828] }, 'Expr', []], + ['terminal', { sourceInterval: [829, 832] }, ','], + ], + ], + ['terminal', { sourceInterval: [834, 837] }, ']'], + ], + ], + ], + Value: [ + 'define', + { sourceInterval: [840, 871] }, + null, + [], + [ + 'alt', + { sourceInterval: [850, 871] }, + ['app', { sourceInterval: [850, 857] }, 'literal', []], + ['app', { sourceInterval: [860, 863] }, 'ref', []], + ['app', { sourceInterval: [866, 871] }, 'ident', []], + ], + ], + ListOf: [ + 'override', + { sourceInterval: [875, 959] }, + null, + ['elem', 'sep'], + [ + 'alt', + { sourceInterval: [900, 959] }, + [ + 'app', + { sourceInterval: [900, 930] }, + 'TrailNonEmptyListOf', + [ + ['param', { sourceInterval: [920, 924] }, 0], + ['param', { sourceInterval: [926, 929] }, 1], + ], + ], + [ + 'app', + { sourceInterval: [937, 959] }, + 'EmptyListOf', + [ + ['param', { sourceInterval: [949, 953] }, 0], + ['param', { sourceInterval: [955, 958] }, 1], + ], + ], + ], + ], + TrailNonEmptyListOf: [ + 'define', + { sourceInterval: [963, 1021] }, + null, + ['elem', 'sep'], + [ + 'seq', + { sourceInterval: [1000, 1021] }, + ['param', { sourceInterval: [1000, 1004] }, 0], + [ + 'star', + { sourceInterval: [1005, 1016] }, + [ + 'seq', + { sourceInterval: [1006, 1014] }, + ['param', { sourceInterval: [1006, 1009] }, 1], + ['param', { sourceInterval: [1010, 1014] }, 0], + ], + ], + ['opt', { sourceInterval: [1017, 1021] }, ['param', { sourceInterval: [1017, 1020] }, 1]], + ], + ], + in: [ + 'define', + { sourceInterval: [1025, 1084] }, + null, + [], + [ + 'seq', + { sourceInterval: [1030, 1084] }, + [ + 'opt', + { sourceInterval: [1030, 1062] }, + [ + 'seq', + { sourceInterval: [1031, 1060] }, + [ + 'app', + { sourceInterval: [1031, 1053] }, + 'caseInsensitive', + [['terminal', { sourceInterval: [1047, 1052] }, 'not']], + ], + ['plus', { sourceInterval: [1054, 1060] }, ['app', { sourceInterval: [1054, 1059] }, 'space', []]], + ], + ], + [ + 'app', + { sourceInterval: [1063, 1084] }, + 'caseInsensitive', + [['terminal', { sourceInterval: [1079, 1083] }, 'in']], + ], + ], + ], + is: [ + 'define', + { sourceInterval: [1087, 1146] }, + null, + [], + [ + 'seq', + { sourceInterval: [1092, 1146] }, + [ + 'app', + { sourceInterval: [1092, 1113] }, + 'caseInsensitive', + [['terminal', { sourceInterval: [1108, 1112] }, 'is']], + ], + ['plus', { sourceInterval: [1115, 1121] }, ['app', { sourceInterval: [1115, 1120] }, 'space', []]], + [ + 'opt', + { sourceInterval: [1122, 1145] }, + [ + 'app', + { sourceInterval: [1122, 1144] }, + 'caseInsensitive', + [['terminal', { sourceInterval: [1138, 1143] }, 'not']], + ], + ], + ], + ], + logic: [ + 'define', + { sourceInterval: [1149, 1217] }, + null, + [], + [ + 'alt', + { sourceInterval: [1157, 1217] }, + [ + 'app', + { sourceInterval: [1157, 1179] }, + 'caseInsensitive', + [['terminal', { sourceInterval: [1173, 1178] }, 'and']], + ], + [ + 'app', + { sourceInterval: [1182, 1203] }, + 'caseInsensitive', + [['terminal', { sourceInterval: [1198, 1202] }, 'or']], + ], + ['terminal', { sourceInterval: [1206, 1210] }, '&&'], + ['terminal', { sourceInterval: [1213, 1217] }, '||'], + ], + ], + like: [ + 'define', + { sourceInterval: [1220, 1312] }, + null, + [], + [ + 'seq', + { sourceInterval: [1227, 1312] }, + [ + 'opt', + { sourceInterval: [1227, 1259] }, + [ + 'seq', + { sourceInterval: [1228, 1257] }, + [ + 'app', + { sourceInterval: [1228, 1250] }, + 'caseInsensitive', + [['terminal', { sourceInterval: [1244, 1249] }, 'not']], + ], + ['plus', { sourceInterval: [1251, 1257] }, ['app', { sourceInterval: [1251, 1256] }, 'space', []]], + ], + ], + [ + 'alt', + { sourceInterval: [1261, 1311] }, + [ + 'app', + { sourceInterval: [1261, 1284] }, + 'caseInsensitive', + [['terminal', { sourceInterval: [1277, 1283] }, 'like']], + ], + [ + 'app', + { sourceInterval: [1287, 1311] }, + 'caseInsensitive', + [['terminal', { sourceInterval: [1303, 1310] }, 'ilike']], + ], + ], + ], + ], + between: [ + 'define', + { sourceInterval: [1315, 1384] }, + null, + [], + [ + 'seq', + { sourceInterval: [1325, 1384] }, + [ + 'opt', + { sourceInterval: [1325, 1357] }, + [ + 'seq', + { sourceInterval: [1326, 1355] }, + [ + 'app', + { sourceInterval: [1326, 1348] }, + 'caseInsensitive', + [['terminal', { sourceInterval: [1342, 1347] }, 'not']], + ], + ['plus', { sourceInterval: [1349, 1355] }, ['app', { sourceInterval: [1349, 1354] }, 'space', []]], + ], + ], + [ + 'app', + { sourceInterval: [1358, 1384] }, + 'caseInsensitive', + [['terminal', { sourceInterval: [1374, 1383] }, 'between']], + ], + ], + ], + ref: [ + 'define', + { sourceInterval: [1388, 1425] }, + null, + [], + [ + 'seq', + { sourceInterval: [1394, 1425] }, + ['app', { sourceInterval: [1394, 1399] }, 'ident', []], + [ + 'plus', + { sourceInterval: [1400, 1425] }, + [ + 'seq', + { sourceInterval: [1402, 1422] }, + ['terminal', { sourceInterval: [1402, 1405] }, '.'], + [ + 'alt', + { sourceInterval: [1407, 1421] }, + ['app', { sourceInterval: [1407, 1412] }, 'ident', []], + ['app', { sourceInterval: [1415, 1421] }, 'string', []], + ], + ], + ], + ], + ], + ident: [ + 'define', + { sourceInterval: [1428, 1457] }, + null, + [], + [ + 'seq', + { sourceInterval: [1436, 1457] }, + ['app', { sourceInterval: [1436, 1442] }, 'letter', []], + [ + 'star', + { sourceInterval: [1443, 1457] }, + [ + 'alt', + { sourceInterval: [1444, 1455] }, + ['app', { sourceInterval: [1444, 1449] }, 'alnum', []], + ['terminal', { sourceInterval: [1452, 1455] }, '_'], + ], + ], + ], + ], + literal: [ + 'define', + { sourceInterval: [1460, 1504] }, + null, + [], + [ + 'alt', + { sourceInterval: [1470, 1504] }, + ['app', { sourceInterval: [1470, 1476] }, 'string', []], + ['app', { sourceInterval: [1479, 1484] }, 'float', []], + ['app', { sourceInterval: [1487, 1490] }, 'int', []], + ['app', { sourceInterval: [1493, 1497] }, 'bool', []], + ['app', { sourceInterval: [1500, 1504] }, 'null', []], + ], + ], + null: [ + 'define', + { sourceInterval: [1507, 1532] }, + null, + [], + [ + 'alt', + { sourceInterval: [1517, 1532] }, + ['terminal', { sourceInterval: [1517, 1523] }, 'null'], + ['terminal', { sourceInterval: [1526, 1532] }, 'NULL'], + ], + ], + bool: [ + 'define', + { sourceInterval: [1535, 1580] }, + null, + [], + [ + 'alt', + { sourceInterval: [1545, 1580] }, + ['terminal', { sourceInterval: [1545, 1551] }, 'true'], + ['terminal', { sourceInterval: [1554, 1561] }, 'false'], + ['terminal', { sourceInterval: [1564, 1570] }, 'TRUE'], + ['terminal', { sourceInterval: [1573, 1580] }, 'FALSE'], + ], + ], + string: [ + 'define', + { sourceInterval: [1583, 1644] }, + null, + [], + [ + 'alt', + { sourceInterval: [1596, 1644] }, + [ + 'seq', + { sourceInterval: [1596, 1615] }, + ['terminal', { sourceInterval: [1596, 1599] }, "'"], + [ + 'star', + { sourceInterval: [1600, 1611] }, + [ + 'seq', + { sourceInterval: [1601, 1609] }, + ['not', { sourceInterval: [1601, 1605] }, ['terminal', { sourceInterval: [1602, 1605] }, "'"]], + ['app', { sourceInterval: [1606, 1609] }, 'any', []], + ], + ], + ['terminal', { sourceInterval: [1612, 1615] }, "'"], + ], + [ + 'seq', + { sourceInterval: [1622, 1644] }, + ['terminal', { sourceInterval: [1622, 1626] }, '"'], + [ + 'star', + { sourceInterval: [1627, 1639] }, + [ + 'seq', + { sourceInterval: [1628, 1637] }, + ['not', { sourceInterval: [1628, 1633] }, ['terminal', { sourceInterval: [1629, 1633] }, '"']], + ['app', { sourceInterval: [1634, 1637] }, 'any', []], + ], + ], + ['terminal', { sourceInterval: [1640, 1644] }, '"'], + ], + ], + ], + int: [ + 'define', + { sourceInterval: [1647, 1677] }, + null, + [], + [ + 'seq', + { sourceInterval: [1653, 1677] }, + [ + 'opt', + { sourceInterval: [1653, 1672] }, + [ + 'seq', + { sourceInterval: [1654, 1670] }, + [ + 'alt', + { sourceInterval: [1655, 1662] }, + ['terminal', { sourceInterval: [1655, 1658] }, '-'], + ['terminal', { sourceInterval: [1659, 1662] }, '+'], + ], + ['app', { sourceInterval: [1664, 1670] }, 'spaces', []], + ], + ], + ['app', { sourceInterval: [1673, 1677] }, 'uint', []], + ], + ], + uint: [ + 'define', + { sourceInterval: [1680, 1713] }, + null, + [], + [ + 'alt', + { sourceInterval: [1691, 1713] }, + ['terminal', { sourceInterval: [1691, 1694] }, '0'], + ['app', { sourceInterval: [1701, 1713] }, 'int_non_zero', []], + ], + ], + int_non_zero: [ + 'define', + { sourceInterval: [1716, 1746] }, + null, + [], + [ + 'seq', + { sourceInterval: [1731, 1746] }, + ['range', { sourceInterval: [1731, 1739] }, '1', '9'], + ['star', { sourceInterval: [1740, 1746] }, ['app', { sourceInterval: [1740, 1745] }, 'digit', []]], + ], + ], + float: [ + 'define', + { sourceInterval: [1749, 1774] }, + null, + [], + [ + 'seq', + { sourceInterval: [1759, 1774] }, + ['opt', { sourceInterval: [1759, 1763] }, ['app', { sourceInterval: [1759, 1762] }, 'int', []]], + ['terminal', { sourceInterval: [1764, 1767] }, '.'], + ['plus', { sourceInterval: [1768, 1774] }, ['app', { sourceInterval: [1768, 1773] }, 'digit', []]], + ], + ], + }, +]); +export default result; diff --git a/packages/ohm-grammar-miniquery/src/index.ts b/packages/ohm-grammar-miniquery/src/index.ts new file mode 100644 index 00000000..fc19f5ee --- /dev/null +++ b/packages/ohm-grammar-miniquery/src/index.ts @@ -0,0 +1,2 @@ +export * from './grammar'; +export { toMiniQueryAST, getMiniQueryASTOp, type MiniQueryASTNode } from './ast'; diff --git a/packages/ohm-grammar-miniquery/src/miniquery.test.ts b/packages/ohm-grammar-miniquery/src/miniquery.test.ts new file mode 100644 index 00000000..da156102 --- /dev/null +++ b/packages/ohm-grammar-miniquery/src/miniquery.test.ts @@ -0,0 +1,65 @@ +import test from 'ava'; +import { MiniQueryGrammar, toMiniQueryAST } from './'; + +test('miniquery syntax', (t) => { + for (const v of [ + // base + '- 1.1', + '+ 1.1', + `-a > -1 and +b < +2`, + `now()`, + // logic + `a IS NOT TRUE and b is NOT false`, + `(1=1) or( 1=2 )or( 1=3)or(1=3 ) `, + `not true`, + `not true or not 1 > 2`, + // relational + '1=1 and a >= 1', + '1=1 AND a >= 1', + `1=1 or 1=2 or 1=3 `, + `a=b or a=0`, + `a is not null`, + `a is null and a = true`, + `1 in [0,1,2,3,4] and b >= 2 or c not in [] and d in ()`, + `1 in [ 0 , 1 , 2 , 3 , 4 ]`, + `a in ("a", "b" ,"c")`, + `a in (1)`, + `a between 12 and 15 or b not between 67 and 78`, + `a is true and b is not false and c is not null and d is null`, + `owned = true`, + `a between 1 and 2`, + // string + ` ( a like '%hello%' ) and b not ILIKE '%world%'`, + // `a between [1,2]`, // 特殊的 between 语法,方便构造语法 + // function + `a()`, + `func(123)`, + `func(1,2,3,4,5,)`, + `func(0,true,false,null,'a',"bc")`, + `func(['a',1,3])`, + `date(a) = func(123)`, + `func(a)`, + `func(a,b)`, + `func( a , b )`, + `func(a ,name==1 )`, + `func( a, name == 1 )`, + `func( a, name in (1,2,3) )`, + `func( a, name in ('a','b') )`, + `date('2021-05-12T00:00:00+08:00')`, + `profile.age > 10`, + // rare cases + `null == NULL`, + `date(created_at) between date('2021-05-12T00:00:00+08:00') and date('2021-05-14T00:00:00+08:00')`, + `a.b: 10`, + ]) { + const result = MiniQueryGrammar.match(v); + t.true(result.succeeded()); + t.notThrows(() => toMiniQueryAST(result)); + } +}); + +test('miniquery incorrect syntax', (t) => { + for (const v of [`a notlike '%hello%'`, `a notbetween a and b`]) { + t.false(MiniQueryGrammar.match(v).succeeded()); + } +}); diff --git a/packages/ohm-grammar-miniquery/src/sequelize/ignored.test.ts b/packages/ohm-grammar-miniquery/src/sequelize/ignored.test.ts new file mode 100644 index 00000000..d26a8e07 --- /dev/null +++ b/packages/ohm-grammar-miniquery/src/sequelize/ignored.test.ts @@ -0,0 +1,66 @@ +import test from 'ava'; +import { DataTypes, Sequelize } from '@sequelize/core'; + +let sequelize: Sequelize; +test.before(async (t) => { + sequelize = new Sequelize('sqlite::memory:'); + const User = await sequelize.define( + 'User', + { + username: { + type: DataTypes.STRING, + }, + name: { + type: DataTypes.STRING, + }, + age: { + type: DataTypes.INTEGER, + }, + attributes: { + type: DataTypes.JSON, + }, + profileId: { + type: DataTypes.INTEGER, + references: { + model: 'Profile', + key: 'id', + }, + }, + avatarUrl: { + type: DataTypes.STRING, + }, + }, + { + underscored: true, + }, + ); + const Profile = await sequelize.define( + 'Profile', + { + name: { + type: DataTypes.STRING, + }, + attributes: { + type: DataTypes.JSON, + }, + }, + { + underscored: true, + }, + ); + + User.hasOne(Profile, { + as: 'profile', + }); + Profile.belongsTo(User, { + as: 'user', + }); +}); + +test('sequelize type', async (t) => { + const { Model, ...attrs } = sequelize.models.User.getAttributes().attributes as any; + t.log(attrs); + t.log(attrs.type in DataTypes.JSON); + t.log(attrs.type.key === DataTypes.JSON.key); + t.pass(); +}); diff --git a/packages/ohm-grammar-miniquery/src/sequelize/index.ts b/packages/ohm-grammar-miniquery/src/sequelize/index.ts new file mode 100644 index 00000000..234f46f5 --- /dev/null +++ b/packages/ohm-grammar-miniquery/src/sequelize/index.ts @@ -0,0 +1 @@ +export { toSequelizeWhere, type SequelizeWhereOptions } from './where'; diff --git a/packages/ohm-grammar-miniquery/src/sequelize/where.test.ts b/packages/ohm-grammar-miniquery/src/sequelize/where.test.ts new file mode 100644 index 00000000..989c0fd6 --- /dev/null +++ b/packages/ohm-grammar-miniquery/src/sequelize/where.test.ts @@ -0,0 +1,221 @@ +import type { ExecutionContext } from 'ava'; +import test from 'ava'; +import type { FindOptions, Includeable, ModelStatic, WhereOptions } from '@sequelize/core'; +import { DataTypes, Sequelize } from '@sequelize/core'; +import { toMiniQueryAST } from '../ast'; +import { toSequelizeWhere } from './where'; + +let sequelize: Sequelize; +test.before(async (t) => { + sequelize = new Sequelize('sqlite::memory:'); + const User = await sequelize.define( + 'User', + { + username: { + type: DataTypes.STRING, + }, + name: { + type: DataTypes.STRING, + }, + age: { + type: DataTypes.INTEGER, + }, + attributes: { + type: DataTypes.JSON, + }, + profileId: { + type: DataTypes.INTEGER, + references: { + model: 'Profile', + key: 'id', + }, + }, + avatarUrl: { + type: DataTypes.STRING, + }, + }, + { + underscored: true, + }, + ); + const Department = await sequelize.define( + 'Department', + { + fullName: { + type: DataTypes.STRING, + }, + attributes: { + type: DataTypes.JSON, + }, + }, + { + underscored: true, + }, + ); + const Profile = await sequelize.define( + 'Profile', + { + name: { + type: DataTypes.STRING, + }, + attributes: { + type: DataTypes.JSON, + }, + }, + { + underscored: true, + }, + ); + const Pet = await sequelize.define( + 'Pet', + { + fullName: { + type: DataTypes.STRING, + }, + attributes: { + type: DataTypes.JSON, + }, + }, + { + underscored: true, + }, + ); + + const Image = await sequelize.define( + 'Image', + { + imageUrl: { + type: DataTypes.STRING, + }, + attributes: { + type: DataTypes.JSON, + }, + }, + { + underscored: true, + }, + ); + Department.hasMany(User, { + as: 'users', + }); + User.belongsTo(Department, { + as: 'department', + }); + + User.hasMany(Pet, { + as: 'pets', + }); + Pet.belongsTo(User, { + as: 'user', + }); + + User.hasOne(Profile, { + as: 'profile', + }); + Profile.belongsTo(User, { + as: 'user', + }); + + Profile.hasOne(Image, { + as: 'avatar', + }); + Image.belongsTo(Profile); + + await sequelize.sync(); +}); + +test('sequelize where', async (t) => { + const { User } = sequelize.models; + for (const s of [ + '', + `age > -1.1`, + `User.age > -1.1`, + `length(profile.name) > 1`, + `length(name) > length(username)`, + `name = 'wener' and age > 18 and age < 80`, + `name = 'wener' and (age > 18 or age < 80)`, + `age not between 18 and 80`, + `date(createdAt) between '2020-01-01' and '2020-01-31' and length(name) > 1 and username is not null and name like 'wen%'`, + `attributes.user.name = 'wener'`, // json + `attributes.'user name' = 'wener'`, // json + `attributes.'user.name' = 'wener'`, // 无法正确 escape + `age > 0 and age > 0 and age > 0`, // should flatten + `avatarUrl is not null`, // handle case + ]) { + await assertQuery(t, User, s); + } +}); + +test('sequelize association', async (t) => { + const { User } = sequelize.models; + for (const s of [`profile.name is not null`, `profile.avatar.imageUrl is not null`]) { + await assertQuery(t, User, s); + } +}); + +async function assertQuery(t: ExecutionContext, Model: ModelStatic, query: string) { + let where: WhereOptions; + let include: Includeable[]; + try { + ({ where, include } = toSequelizeWhere(query, { + sequelize, + Model, + })); + } catch (e) { + t.log(`MiniQuery: ${query}`); + t.log(`AST`, toMiniQueryAST(query)); + throw e; + } + + let sql = ''; + try { + await Model.findAll({ + logging: (s) => { + const indexOf = s.indexOf('WHERE '); + if (indexOf < 0) { + return (sql = ''); + } + // eslint-disable-next-line @typescript-eslint/restrict-plus-operands + return (sql = s.substring(indexOf + 'WHERE '.length, s.length - 1)); + }, + where, + include, + }); + } catch (e: any) { + console.error('ERROR', e?.message); + t.log(`SQL: ${sql}`); + t.log(`MiniQuery: ${query}`); + t.log(`Where`, where); + throw e; + } + t.snapshot(sql, `Query: ${query}`); + t.pass(); +} + +test('sequelize incorrect', async (t) => { + const { User } = sequelize.models; + for (const s of [ + '1 > 0', + `name.not_ok = ''`, + `not_exists = ''`, + `avatar_url is not null`, // attr not found + `pets.fullName is not null`, // use has instead + `pets.fullName: 'wener'`, // not supported yet + ]) { + let opt: FindOptions = {}; + t.throws( + () => { + opt = toSequelizeWhere(s, { + sequelize, + Model: User, + }); + t.log(`Where`, opt.where); + }, + undefined, + `Query: ${s}`, + ); + await User.findAll({ + ...opt, + }); + } +}); diff --git a/packages/ohm-grammar-miniquery/src/sequelize/where.test.ts.md b/packages/ohm-grammar-miniquery/src/sequelize/where.test.ts.md new file mode 100644 index 00000000..98793755 --- /dev/null +++ b/packages/ohm-grammar-miniquery/src/sequelize/where.test.ts.md @@ -0,0 +1,73 @@ +# Snapshot report for `src/sequelize/where.test.ts` + +The actual snapshot is saved in `where.test.ts.snap`. + +Generated by [AVA](https://avajs.dev). + +## sequelize where + +> Query: + + '' + +> Query: age > -1.1 + + '`User`.`age` > -1.1' + +> Query: User.age > -1.1 + + '`User`.`age` > -1.1' + +> Query: length(profile.name) > 1 + + 'length(`profile`.`name`) > 1' + +> Query: length(name) > length(username) + + 'length(`name`) > length(`username`)' + +> Query: name = 'wener' and age > 18 and age < 80 + + '(`User`.`name` = \'wener\' AND `User`.`age` > 18 AND `User`.`age` < 80)' + +> Query: name = 'wener' and (age > 18 or age < 80) + + '(`User`.`name` = \'wener\' AND ((`User`.`age` > 18 OR `User`.`age` < 80)))' + +> Query: age not between 18 and 80 + + '`User`.`age` NOT BETWEEN 18 AND 80' + +> Query: date(createdAt) between '2020-01-01' and '2020-01-31' and length(name) > 1 and username is not null and name like 'wen%' + + '(date(`created_at`) BETWEEN \'2020-01-01\' AND \'2020-01-31\' AND length(`name`) > 1 AND `User`.`username` IS NOT NULL AND `User`.`name` LIKE \'wen%\')' + +> Query: attributes.user.name = 'wener' + + 'json_extract(`User`.`attributes`,\'$.user.name\') = \'wener\'' + +> Query: attributes.'user name' = 'wener' + + 'json_extract(`User`.`attributes`,\'$.user name\') = \'wener\'' + +> Query: attributes.'user.name' = 'wener' + + 'json_extract(`User`.`attributes`,\'$.user.name\') = \'wener\'' + +> Query: age > 0 and age > 0 and age > 0 + + '(`User`.`age` > 0 AND `User`.`age` > 0 AND `User`.`age` > 0)' + +> Query: avatarUrl is not null + + '`User`.`avatar_url` IS NOT NULL' + +## sequelize association + +> Query: profile.name is not null + + '`profile`.`name` IS NOT NULL' + +> Query: profile.avatar.imageUrl is not null + + '`profile->avatar`.`image_url` IS NOT NULL' diff --git a/packages/ohm-grammar-miniquery/src/sequelize/where.test.ts.snap b/packages/ohm-grammar-miniquery/src/sequelize/where.test.ts.snap new file mode 100644 index 00000000..73aa4f80 Binary files /dev/null and b/packages/ohm-grammar-miniquery/src/sequelize/where.test.ts.snap differ diff --git a/packages/ohm-grammar-miniquery/src/sequelize/where.ts b/packages/ohm-grammar-miniquery/src/sequelize/where.ts new file mode 100644 index 00000000..4eef598d --- /dev/null +++ b/packages/ohm-grammar-miniquery/src/sequelize/where.ts @@ -0,0 +1,282 @@ +/* eslint-disable @typescript-eslint/no-non-null-assertion */ +import type { MatchResult } from 'ohm-js'; +import type { + Association, + DataType, + Includeable, + IncludeOptions, + Model, + ModelStatic, + Sequelize, + WhereOptions, +} from '@sequelize/core'; +import { col, DataTypes, fn, Op, where } from '@sequelize/core'; +import type { AbstractDataTypeConstructor } from '@sequelize/core/types/data-types'; +import type { MiniQueryASTNode } from '../ast'; +import { toMiniQueryAST } from '../ast'; + +export interface SequelizeWhereOptions { + sequelize: Sequelize; + Model: ModelStatic; + where?: WhereOptions[]; + include?: IncludeOptions[]; + // whitelist function calls + functions?: Record< + string, + { + arity?: number; + } + >; +} +type WhereContext = Omit & { + current?: any; + functions: Record< + string, + { + arity?: number; + } + >; + include: Includeable[]; + associations: Association[]; +}; + +export function toSequelizeWhere( + s: string | MatchResult, + o: SequelizeWhereOptions, +): { where: WhereOptions; include: IncludeOptions[] } { + const ctx = { functions: DefaultFunctions, include: [], associations: [], ...o }; + + if (!s) { + return { + where: {}, + include: [], + }; + } + const where = toWhere(toMiniQueryAST(s), ctx); + ctx.include.push(...ctx.associations); + return { where, include: ctx.include }; +} + +const DefaultFunctions: WhereContext['functions'] = { + date: { arity: 1 }, + length: { arity: 1 }, +}; + +function checkFunctions(name: string, args: any[] = [], o: WhereContext) { + if (!o.functions[name]) { + throw new Error(`Invalid function: ${name}`); + } +} + +function isSameType(a: DataType, b: AbstractDataTypeConstructor) { + if (typeof a === 'string') { + return a.toUpperCase() === b.key; + } + return a.key === b.key; +} + +function resolve(parts: string[], c: WhereContext) { + const { Model } = c; + let M = Model; + const rest = [...parts]; + + const all: string[] = []; + let isAssoc = false; + let include: IncludeOptions | undefined; + + while (rest.length) { + const first = rest.shift() as string; + const attr = M.getAttributes()[first]; + if (attr) { + if (isSameType(attr.type, DataTypes.JSON) || isSameType(attr.type, DataTypes.JSONB)) { + all.push(attr.field!); + all.push(...rest); + break; + } else if (rest.length === 0) { + all.push(attr.field!); + break; + } else { + throw new SyntaxError(`Invalid ref of attr: ${parts.join('.')} type of ${attr.field} is ${attr.type}`); + } + } else if (rest.length === parts.length - 1) { + // first + // User.createdAt + if (first === M.name) { + // todo should add a prefix to prevent ambiguous + // all.push(first) + continue; + } + } + + const assoc = M.associations[first]; + if (assoc) { + if (assoc.isMultiAssociation) { + throw new Error(`Use has for multi association: ${parts.join('.')}`); + } + if (!include) { + include = { + association: assoc, + required: true, + }; + c.include.push(include); + } else { + // nested + include.include = [ + { + association: assoc, + required: true, + }, + ]; + } + + all.push(first); + M = assoc.target; + if (!rest.length) { + throw new SyntaxError(`Invalid ref of an association: ${parts.join('.')}`); + } + isAssoc = true; + continue; + } + + throw new SyntaxError(`Invalid ref: ${parts.join('.')} of model ${M.name}`); + } + if (isAssoc) { + return `$${all.join('.')}$`; + } + return all.join('.'); +} + +function toWhere(ast: MiniQueryASTNode, o: WhereContext): any { + let current = o.current ?? {}; + const { Model } = o; + + function attrOfIdentifier(name: string) { + // can support auto case convert + + const attr = Model.getAttributes()[name]; + if (!attr?.field) { + throw new Error(`Invalid attribute: ${name}`); + } + return attr; + } + + const setOp = (left: MiniQueryASTNode, op: any, val: any) => { + if (typeof op === 'string') { + op = opOf(op); + } + let v: any; + switch (left.type) { + case 'identifier': + v = current[attrOfIdentifier(left.name).field!] ??= {}; + break; + case 'call': { + const first = left.value[0]; + if (left.value.length !== 1) { + throw new SyntaxError(`Expected 1 call args, got ${left.value.length}`); + } + let cn: string; + switch (first.type) { + case 'identifier': + cn = attrOfIdentifier(first.name).field!; + break; + case 'ref': + // fixme hack replace + cn = resolve(first.name, o).replaceAll(`$`, '`'); + break; + default: + throw new SyntaxError(`Expected identifier or ref for call, got ${first.type}`); + } + + const name = left.name.toLowerCase(); + checkFunctions(name, [first], o); + current = where(fn(name, col(cn)), { + [op]: val, + }); + return; + } + case 'ref': + // 依然无法 escape `.` + // https://sequelize.org/docs/v7/core-concepts/model-querying-basics/#querying-json + // v = _.get(current, left.name); + // if (!v) { + // v = {}; + // _.set(current, left.name, v); + // } + v = current[resolve(left.name, o)] ??= {}; + break; + default: + throw new SyntaxError(`Expected identifier, ref or call for left side, got ${left.type}`); + } + v[op] = val; + }; + + switch (ast.type) { + case 'rel': + { + setOp(ast.a, ast.op, toWhere(ast.b, { ...o })); + } + break; + case 'between': + { + setOp(ast.a, ast.op, [toWhere(ast.b, { ...o }), toWhere(ast.c, { ...o })]); + } + break; + case 'logic': + { + const op = opOf(ast.op); + const c = (current[op] ??= []); + // collect - flat - optimize + const a = toWhere(ast.a, { ...o }); + if (a[op]) { + c.push(...a[op]); + } else { + c.push(a); + } + const b = toWhere(ast.b, { ...o }); + if (b[op]) { + c.push(...b[op]); + } else { + c.push(b); + } + } + break; + + case 'paren': + return [toWhere(ast.value, { ...o })]; + case 'int': + case 'string': + case 'float': + return ast.value; + case 'null': + return null; + case 'call': { + const name = ast.name.toLowerCase(); + checkFunctions(name, ast.value, o); + return fn(name, ...ast.value.map((v) => toWhere(v, { ...o }))); + } + case 'identifier': { + const attr = attrOfIdentifier(ast.name); + return col(attr.field!); + } + default: + throw new SyntaxError(`Invalid type: ${ast.type}`); + } + return current; +} + +const OpMap: Record = { + 'not between': 'notBetween', + 'not like': 'notLike', + ilike: 'iLike', + 'not ilike': 'notILike', + 'not in': 'notIn', + 'is not': 'not', +}; + +function opOf(v: string) { + const op = Op[(OpMap[v] || v) as 'any']; + if (!op) { + throw new SyntaxError(`Unsupported operator: ${v}`); + } + return op; +} diff --git a/packages/ohm-grammar-miniquery/tsconfig.json b/packages/ohm-grammar-miniquery/tsconfig.json new file mode 100644 index 00000000..470d1d0b --- /dev/null +++ b/packages/ohm-grammar-miniquery/tsconfig.json @@ -0,0 +1,31 @@ +{ + "compilerOptions": { + "target": "esnext", + "module": "esnext", + "moduleResolution": "node", + "declaration": true, + "pretty": true, + "noEmitOnError": true, + "strict": true, + "resolveJsonModule": true, + "removeComments": true, + "newLine": "lf", + "allowSyntheticDefaultImports": true, + "noUnusedLocals": true, + "noFallthroughCasesInSwitch": true, + "useDefineForClassFields": true, + "forceConsistentCasingInFileNames": true, + "skipLibCheck": true, + "outDir": "dist", + "sourceMap": true, + "esModuleInterop": true, + "baseUrl": ".", + "lib": [ + "dom", + "esnext" + ] + }, + "include": [ + "src/**/*.ts", + ] +} diff --git a/packages/utils/src/index.ts b/packages/utils/src/index.ts index 6dd9df12..e5b9a8ca 100644 --- a/packages/utils/src/index.ts +++ b/packages/utils/src/index.ts @@ -27,15 +27,15 @@ export { shallowEqual } from './langs/shallowEqual'; export { deepEqual } from './langs/deepEqual'; export { classOf } from './langs/classOf'; export { shallowClone } from './langs/shallowClone'; +export { isClass } from './langs/isClass'; +export { isDefined } from './langs/isDefined'; +export { isEmptyObject } from './langs/isEmptyObject'; +export { isPlainObject } from './langs/isPlainObject'; +export { parseBoolean } from './langs/parseBoolean'; +export { maybeFunction, type MaybeFunction } from './langs/MaybeFunction'; -// assertions -export { isClass } from './validations/isClass'; -export { isDefined } from './validations/isDefined'; -export { isEmptyObject } from './validations/isEmptyObject'; export { isUUID } from './validations/isUUID'; -export { isPlainObject } from './validations/isPlainObject'; export { parseTimestamp } from './validations/parseTimestamp'; -export { parseBoolean } from './validations/parseBoolean'; // modules export { parseModuleId, type ParsedModuleId } from './modules/parseModuleId'; diff --git a/packages/utils/src/langs/MaybeFunction.ts b/packages/utils/src/langs/MaybeFunction.ts new file mode 100644 index 00000000..4e210d19 --- /dev/null +++ b/packages/utils/src/langs/MaybeFunction.ts @@ -0,0 +1,9 @@ +export type MaybeFunction = T | ((...args: P) => T); + +export function maybeFunction(v: MaybeFunction, ...args: P): T { + // https://github.com/microsoft/TypeScript/issues/37663#issuecomment-759728342 + if (v instanceof Function) { + return v(...args); + } + return v; +} diff --git a/packages/utils/src/validations/isClass.ts b/packages/utils/src/langs/isClass.ts similarity index 100% rename from packages/utils/src/validations/isClass.ts rename to packages/utils/src/langs/isClass.ts diff --git a/packages/utils/src/validations/isDefined.ts b/packages/utils/src/langs/isDefined.ts similarity index 100% rename from packages/utils/src/validations/isDefined.ts rename to packages/utils/src/langs/isDefined.ts diff --git a/packages/utils/src/validations/isEmptyObject.ts b/packages/utils/src/langs/isEmptyObject.ts similarity index 100% rename from packages/utils/src/validations/isEmptyObject.ts rename to packages/utils/src/langs/isEmptyObject.ts diff --git a/packages/utils/src/validations/isFunction.ts b/packages/utils/src/langs/isFunction.ts similarity index 100% rename from packages/utils/src/validations/isFunction.ts rename to packages/utils/src/langs/isFunction.ts diff --git a/packages/utils/src/validations/isPlainObject.ts b/packages/utils/src/langs/isPlainObject.ts similarity index 88% rename from packages/utils/src/validations/isPlainObject.ts rename to packages/utils/src/langs/isPlainObject.ts index 5e338e00..a4d7f05d 100644 --- a/packages/utils/src/validations/isPlainObject.ts +++ b/packages/utils/src/langs/isPlainObject.ts @@ -1,4 +1,4 @@ -import { classOf } from '../langs/classOf'; +import { classOf } from './classOf'; // see: https://github.com/mesqueeb/is-what/blob/88d6e4ca92fb2baab6003c54e02eedf4e729e5ab/src/index.ts diff --git a/packages/utils/src/validations/parseBoolean.ts b/packages/utils/src/langs/parseBoolean.ts similarity index 100% rename from packages/utils/src/validations/parseBoolean.ts rename to packages/utils/src/langs/parseBoolean.ts diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index e264a03f..e91643bd 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -376,7 +376,7 @@ importers: '@types/markdown-it': ^12.2.3 '@types/react': ^18.0.25 '@types/react-dom': ^18.0.9 - '@wener/utils': workspace:1.1.8 + '@wener/utils': workspace:* classnames: ^2.3.2 linkify-it: ^4.0.1 markdown-it: ^13.0.1 @@ -462,6 +462,21 @@ importers: react-dom: 18.2.0_react@18.2.0 typescript: 4.9.3 + packages/ohm-grammar-miniquery: + specifiers: + '@ohm-js/cli': ^1.1.0 + '@sequelize/core': '*' + c8: ^7.12.0 + ohm-js: ^16 + sqlite3: ^5.0.11 + dependencies: + '@sequelize/core': 7.0.0-alpha.10_sqlite3@5.1.4 + ohm-js: 16.4.0 + devDependencies: + '@ohm-js/cli': 1.1.0 + c8: 7.12.0 + sqlite3: 5.1.4 + packages/reaction: specifiers: '@types/hoist-non-react-statics': ^3.3.1 @@ -878,6 +893,10 @@ packages: to-fast-properties: 2.0.0 dev: true + /@bcoe/v8-coverage/0.2.3: + resolution: {integrity: sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw==} + dev: true + /@emotion/is-prop-valid/1.2.0: resolution: {integrity: sha512-3aDpDprjM0AwaxGE09bOPkNxHpBd+kA6jty3RnaEXdweX1DF1U3VQpPYb0g1IStAuK7SVQ1cy+bNBBKp4W3Fjg==} dependencies: @@ -988,6 +1007,10 @@ packages: react-dom: 18.2.0_react@18.2.0 dev: false + /@gar/promisify/1.1.3: + resolution: {integrity: sha512-k2Ty1JcVojjJFwrg/ThKi2ujJ7XNLYaFGNB/bWT9wGR+oSMJHMa5w+CUq6p/pVrKeNNgA7pCqEcjSnHVoqJQFw==} + optional: true + /@headlessui/react/1.7.4_biqbaboplfbrettd7655fr4n2y: resolution: {integrity: sha512-D8n5yGCF3WIkPsjEYeM8knn9jQ70bigGGb5aUvN6y4BGxcT3OcOQOKcM3zRGllRCZCFxCZyQvYJF6ZE7bQUOyQ==} engines: {node: '>=10'} @@ -1020,6 +1043,11 @@ packages: resolution: {integrity: sha512-ZnQMnLV4e7hDlUvw8H+U8ASL02SS2Gn6+9Ac3wGGLIe7+je2AeAOxPY+izIPJDfFDb7eDjev0Us8MO1iFRN8hA==} dev: true + /@istanbuljs/schema/0.1.3: + resolution: {integrity: sha512-ZXRY4jNvVgSVQ8DL3LTcakaAtXwTVUxE81hslsyD2AtoXW/wVob10HkOJ1X/pAlcI7D+2YoZKg5do8G/w6RYgA==} + engines: {node: '>=8'} + dev: true + /@jridgewell/gen-mapping/0.1.1: resolution: {integrity: sha512-sQXCasFk+U8lWYEe66WxRDOE9PjVz4vSM51fTu3Hw+ClTpUSQb718772vH3pyS5pShp6lvQM7SxgIDXXXmOX7w==} engines: {node: '>=6.0.0'} @@ -1275,6 +1303,23 @@ packages: yjs: 13.5.42 dev: false + /@mapbox/node-pre-gyp/1.0.10: + resolution: {integrity: sha512-4ySo4CjzStuprMwk35H5pPbkymjv1SF3jGLj6rAHp/xT/RF7TL7bd9CTm1xDY49K2qF7jmR/g7k+SkLETP6opA==} + hasBin: true + dependencies: + detect-libc: 2.0.1 + https-proxy-agent: 5.0.1 + make-dir: 3.1.0 + node-fetch: 2.6.7 + nopt: 5.0.0 + npmlog: 5.0.1 + rimraf: 3.0.2 + semver: 7.3.8 + tar: 6.1.12 + transitivePeerDependencies: + - encoding + - supports-color + /@next/env/13.0.5: resolution: {integrity: sha512-F3KLtiDrUslAZhTYTh8Zk5ZaavbYwLUn3NYPBnOjAXU8hWm0QVGVzKIOuURQ098ofRU4e9oglf3Sj9pFx5nI5w==} dev: false @@ -1424,6 +1469,31 @@ packages: '@nodelib/fs.scandir': 2.1.5 fastq: 1.14.0 + /@npmcli/fs/1.1.1: + resolution: {integrity: sha512-8KG5RD0GVP4ydEzRn/I4BNDuxDtqVbOdm8675T49OIG/NGhaK0pjPX7ZcDlvKYbA+ulvVK3ztfcF4uBdOxuJbQ==} + dependencies: + '@gar/promisify': 1.1.3 + semver: 7.3.8 + optional: true + + /@npmcli/move-file/1.1.2: + resolution: {integrity: sha512-1SUf/Cg2GzGDyaf15aR9St9TWlb+XvbZXWpDx8YKs7MLzMH/BCeopv+y9vzrzgkfykCGuWOlSu3mZhj2+FQcrg==} + engines: {node: '>=10'} + deprecated: This functionality has been moved to @npmcli/fs + dependencies: + mkdirp: 1.0.4 + rimraf: 3.0.2 + optional: true + + /@ohm-js/cli/1.1.0: + resolution: {integrity: sha512-CQSwyT6JsO6qc6lFGy9/EF639ZwPVqx2u8ZW/lTCxBGcnBs4aPueJtEYg3XT8yi7oGslCpddvoVDbsnnIEy+mw==} + hasBin: true + dependencies: + commander: 8.3.0 + fast-glob: 3.2.12 + ohm-js: 16.4.0 + dev: true + /@pkgr/utils/2.3.1: resolution: {integrity: sha512-wfzX8kc1PMyUILA+1Z/EqoE4UCXGy0iRGMhPwdfae1+f0OXlLqCk+By+aMzgJBzR9AzS4CDizioG6Ss1gvAFJw==} engines: {node: ^12.20.0 || ^14.18.0 || >=16.0.0} @@ -1508,6 +1578,59 @@ packages: resolution: {integrity: sha512-sXo/qW2/pAcmT43VoRKOJbDOfV3cYpq3szSVfIThQXNt+E4DfKj361vaAt3c88U5tPUxzEswam7GW48PJqtKAg==} dev: true + /@sequelize/core/7.0.0-alpha.10_sqlite3@5.1.4: + resolution: {integrity: sha512-uikpWaCiIaijsgoa9cH+3jCQl8r+FaQPhoE8AOJYvPwxOx52E1JZnRPMXNnlpbFy3Xu0qekrc5LBJq7IR8UB0Q==} + engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} + peerDependencies: + ibm_db: '*' + mariadb: '*' + mysql2: '*' + odbc: '*' + pg: '*' + pg-hstore: '*' + snowflake-sdk: '*' + sqlite3: '*' + tedious: '*' + peerDependenciesMeta: + ibm_db: + optional: true + mariadb: + optional: true + mysql2: + optional: true + odbc: + optional: true + pg: + optional: true + pg-hstore: + optional: true + snowflake-sdk: + optional: true + sqlite3: + optional: true + tedious: + optional: true + dependencies: + '@types/debug': 4.1.7 + debug: 4.3.4 + dottie: 2.0.2 + inflection: 1.13.4 + lodash: 4.17.21 + moment: 2.29.4 + moment-timezone: 0.5.40 + pg-connection-string: 2.5.0 + retry-as-promised: 5.0.0 + semver: 7.3.8 + sequelize-pool: 7.1.0 + sqlite3: 5.1.4 + toposort-class: 1.0.1 + uuid: 8.3.2 + validator: 13.7.0 + wkx: 0.5.0 + transitivePeerDependencies: + - supports-color + dev: false + /@sequelize/core/7.0.0-alpha.19: resolution: {integrity: sha512-9SskZlxm9HvyeOSHH86fceai1GqcDxKMkvlaZH9K0LkZ0GFrplZy+Svob/XzZiEjGsrINaIJQBPQYMmVePwhtA==} engines: {node: ^14.17.0 || >=16.0.0} @@ -2129,6 +2252,11 @@ packages: prosemirror-view: 1.29.1 dev: false + /@tootallnate/once/1.1.2: + resolution: {integrity: sha512-RbzJvlNzmRq5c3O09UipeuXno4tA1FE6ikOjxZK0tuxVv3412l64l5t1W5pj4+rJq9vpkm/kwiR07aZXnsKPxw==} + engines: {node: '>= 6'} + optional: true + /@tootallnate/once/2.0.0: resolution: {integrity: sha512-XCuKFP5PS55gnMVu3dty8KPatLqUoy/ZYzDzAGCQ8JNFCkLXzmI7vNHCR+XpbZaMWQK/vQubr7PkYq8g470J/A==} engines: {node: '>= 10'} @@ -2255,6 +2383,10 @@ packages: resolution: {integrity: sha512-kZSETqAVS74XC/K3mPX/tbMEi/Zy1KP0Wc59dB1i5P72AHz4eSW+UIpzWxmQnDxipoKSX5eRgUXy+wUr+bY73g==} dev: false + /@types/istanbul-lib-coverage/2.0.4: + resolution: {integrity: sha512-z/QT1XN4K4KYuslS23k62yDIDLwLFkzxOuMplDtObz0+y7VqJCaO2o+SPwHCvLFZh7xazvvoor2tA/hPz9ee7g==} + dev: true + /@types/jsdom/20.0.1: resolution: {integrity: sha512-d0r18sZPmMQr1eG35u12FZfhIXNrnsPU/g5wvRKCUf/tOGilKKwYMYGqh33BNR6ba+2gkHw1EUiHoN3mn7E5IQ==} dependencies: @@ -2650,6 +2782,9 @@ packages: resolution: {integrity: sha512-j2afSsaIENvHZN2B8GOpF566vZ5WVk5opAiMTvWgaQT8DkbOqsTfvNAvHoRGU2zzP8cPoqys+xHTRDWW8L+/BA==} dev: true + /abbrev/1.1.1: + resolution: {integrity: sha512-nne9/IiQ/hzIhY6pdDnbBtz7DjPTKrY00P/zvPSm5pOFkl6xuGrGnXn/VtTNNfNtAfZ9/1RtehkszU9qcTii0Q==} + /abort-controller/3.0.0: resolution: {integrity: sha512-h8lQ8tacZYnR3vNQTgibj+tODHI5/+l06Au2Pcriv/Gmet0eaj4TwWH41sO9wnHDiQsEj19q0drzdWdeAHtweg==} engines: {node: '>=6.5'} @@ -2706,6 +2841,25 @@ packages: transitivePeerDependencies: - supports-color + /agentkeepalive/4.2.1: + resolution: {integrity: sha512-Zn4cw2NEqd+9fiSVWMscnjyQ1a8Yfoc5oBajLeo5w+YBHgDUcEBY2hS4YpTz6iN5f/2zQiktcuM6tS8x1p9dpA==} + engines: {node: '>= 8.0.0'} + dependencies: + debug: 4.3.4 + depd: 1.1.2 + humanize-ms: 1.2.1 + transitivePeerDependencies: + - supports-color + optional: true + + /aggregate-error/3.1.0: + resolution: {integrity: sha512-4I7Td01quW/RpocfNayFdFVk1qSuoh0E7JrbRJ16nH01HhKFQ88INq9Sd+nd72zqRySlr9BmDA8xlEJ6vJMrYA==} + engines: {node: '>=8'} + dependencies: + clean-stack: 2.2.0 + indent-string: 4.0.0 + optional: true + /aggregate-error/4.0.1: resolution: {integrity: sha512-0poP0T7el6Vq3rstR8Mn4V/IQrpBLO6POkUSrN7RhyY+GF/InCFShQzsQ39T25gkHhLgSLByyAz+Kjb+c2L98w==} engines: {node: '>=12'} @@ -2778,7 +2932,6 @@ packages: /ansi-regex/5.0.1: resolution: {integrity: sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==} engines: {node: '>=8'} - dev: true /ansi-regex/6.0.1: resolution: {integrity: sha512-n5M855fKb2SsfMIiFFoVrABHJC8QtHwVx+mHWP3QcEqBHYienj5dHSgjbxtC0WEZXYt4wcD6zrQElDPhFuZgfA==} @@ -2814,6 +2967,24 @@ packages: normalize-path: 3.0.0 picomatch: 2.3.1 + /aproba/2.0.0: + resolution: {integrity: sha512-lYe4Gx7QT+MKGbDsA+Z+he/Wtef0BiwDOlK/XkBrdfsh9J/jPPXbX0tE9x9cl27Tmu5gg3QUbUrQYa/y+KOHPQ==} + + /are-we-there-yet/2.0.0: + resolution: {integrity: sha512-Ci/qENmwHnsYo9xKIcUJN5LeDKdJ6R1Z1j9V/J5wyq8nh/mYPEpIKJbBZXtZjG04HiK7zV/p6Vs9952MrMeUIw==} + engines: {node: '>=10'} + dependencies: + delegates: 1.0.0 + readable-stream: 3.6.0 + + /are-we-there-yet/3.0.1: + resolution: {integrity: sha512-QZW4EDmGwlYur0Yyf/b2uGucHQMa8aFUP7eu9ddR73vvhFyt4V0Vl3QHPcTNJ8l6qYOBdxgXdnBXQrHilfRQBg==} + engines: {node: ^12.13.0 || ^14.15.0 || >=16.0.0} + dependencies: + delegates: 1.0.0 + readable-stream: 3.6.0 + optional: true + /arg/5.0.2: resolution: {integrity: sha512-PYjyFOLKQ9y57JvQ6QLo8dAgNqswh8M1RMJYdQduT6xbWSgK36P/Z/v+p888pM69jMMfS8Xd8F6I1kQ/I9HUGg==} @@ -3144,6 +3315,51 @@ packages: semver: 7.3.8 dev: true + /c8/7.12.0: + resolution: {integrity: sha512-CtgQrHOkyxr5koX1wEUmN/5cfDa2ckbHRA4Gy5LAL0zaCFtVWJS5++n+w4/sr2GWGerBxgTjpKeDclk/Qk6W/A==} + engines: {node: '>=10.12.0'} + hasBin: true + dependencies: + '@bcoe/v8-coverage': 0.2.3 + '@istanbuljs/schema': 0.1.3 + find-up: 5.0.0 + foreground-child: 2.0.0 + istanbul-lib-coverage: 3.2.0 + istanbul-lib-report: 3.0.0 + istanbul-reports: 3.1.5 + rimraf: 3.0.2 + test-exclude: 6.0.0 + v8-to-istanbul: 9.0.1 + yargs: 16.2.0 + yargs-parser: 20.2.9 + dev: true + + /cacache/15.3.0: + resolution: {integrity: sha512-VVdYzXEn+cnbXpFgWs5hTT7OScegHVmLhJIR8Ufqk3iFD6A6j5iSX1KuBTfNEv4tdJWE2PzA6IVFtcLC7fN9wQ==} + engines: {node: '>= 10'} + dependencies: + '@npmcli/fs': 1.1.1 + '@npmcli/move-file': 1.1.2 + chownr: 2.0.0 + fs-minipass: 2.1.0 + glob: 7.2.3 + infer-owner: 1.0.4 + lru-cache: 6.0.0 + minipass: 3.3.6 + minipass-collect: 1.0.2 + minipass-flush: 1.0.5 + minipass-pipeline: 1.2.4 + mkdirp: 1.0.4 + p-map: 4.0.0 + promise-inflight: 1.0.1 + rimraf: 3.0.2 + ssri: 8.0.1 + tar: 6.1.12 + unique-filename: 1.1.1 + transitivePeerDependencies: + - bluebird + optional: true + /call-bind/1.0.2: resolution: {integrity: sha512-7O+FbCihrB5WGbFYesctwmTKae6rOiIzmz1icreWJ+0aA7LJfuqhEso2T9ncpcFtzMQtzXf2QGGueWJGTYsqrA==} dependencies: @@ -3244,7 +3460,6 @@ packages: /chownr/2.0.0: resolution: {integrity: sha512-bIomtDF5KGpdogkLd9VspvFzk9KfpyyGlS8YFVZl7TGPBHL5snIOnxeshwVgPteQ9b4Eydl+pVbIyE1DcvCWgQ==} engines: {node: '>=10'} - dev: false /chunkd/2.0.1: resolution: {integrity: sha512-7d58XsFmOq0j6el67Ug9mHf9ELUXsQXYJBkyxhH/k+6Ke0qXRnv0kbemx+Twc6fRJ07C49lcbdgm9FL1Ei/6SQ==} @@ -3263,6 +3478,11 @@ packages: resolution: {integrity: sha512-CSbhY4cFEJRe6/GQzIk5qXZ4Jeg5pcsP7b5peFSDpffpe1cqjASH/n9UTjBwOp6XpMSTwQ8Za2K5V02ueA7Tmw==} dev: false + /clean-stack/2.2.0: + resolution: {integrity: sha512-4diC9HaTE+KRAMWhDhrGOECgWZxoevMc5TlkObMqNSsVU62PYzXZ/SMTjzyGAFF1YusgxGcSWTEXBhp0CPwQ1A==} + engines: {node: '>=6'} + optional: true + /clean-stack/4.2.0: resolution: {integrity: sha512-LYv6XPxoyODi36Dp976riBtSY27VmFo+MKqEU9QCCWyTrdEPDog+RWA7xQWHi6Vbp61j5c4cdzzX1NidnwtUWg==} engines: {node: '>=12'} @@ -3287,6 +3507,14 @@ packages: resolution: {integrity: sha512-IV3Ou0jSMzZrd3pZ48nLkT9DA7Ag1pnPzaiQhpW7c3RbcqqzvzzVu+L8gfqMp/8IM2MQtSiqaCxrrcfu8I8rMA==} dev: false + /cliui/7.0.4: + resolution: {integrity: sha512-OcRE68cOsVMXp1Yvonl/fzkQOyjLSu/8bhPDfQt0e0/Eb283TKP20Fs2MqoPsr9SwA595rRCA+QMzYc9nBP+JQ==} + dependencies: + string-width: 4.2.3 + strip-ansi: 6.0.1 + wrap-ansi: 7.0.0 + dev: true + /cliui/8.0.1: resolution: {integrity: sha512-BSeNnyus75C4//NQ9gQt1/csTXyo/8Sb+afLAkzAptFuMsod9HFokGNudZpi/oQV73hnVK+sR+5PVRMd+Dr7YQ==} engines: {node: '>=12'} @@ -3326,6 +3554,10 @@ packages: color-name: 1.1.4 simple-swizzle: 0.2.2 + /color-support/1.1.3: + resolution: {integrity: sha512-qiBjkpbMLO/HL68y+lh4q0/O1MZFj2RX6X/KmMa3+gJD3z+WwI1ZzDHysvqHGS3mP6mznPckpXmw1nI9cJjyRg==} + hasBin: true + /color/4.2.3: resolution: {integrity: sha512-1rXeuUUiGGrykh+CeBdu5Ie7OJwinCgQY0bc7GCRxy5xVHy+moaqkpL/jqQq0MtQOeYcrqEz4abc5f0KtU7W4A==} engines: {node: '>=12.5.0'} @@ -3358,6 +3590,11 @@ packages: engines: {node: '>= 10'} dev: true + /commander/8.3.0: + resolution: {integrity: sha512-OkTL9umf+He2DZkUq8f8J9of7yL6RJKI24dVITBmNfZBmri9zYZQrKkuXiKhyfPSu8tUhnVBB1iKXevvnlR4Ww==} + engines: {node: '>= 12'} + dev: true + /commenting/1.1.0: resolution: {integrity: sha512-YeNK4tavZwtH7jEgK1ZINXzLKm6DZdEMfsaaieOsCAN0S8vsY7UeuO3Q7d/M018EFgE+IeUAuBOKkFccBZsUZA==} dev: true @@ -3387,6 +3624,9 @@ packages: well-known-symbols: 2.0.0 dev: true + /console-control-strings/1.1.0: + resolution: {integrity: sha512-ty/fTekppD2fIwRvnZAVdeOiGd1c7YXEixbgJTNzqcxJWKQnjJ/V1bNEEE6hygpM3WjwHFUVK6HTjWSzV4a8sQ==} + /convert-source-map/1.9.0: resolution: {integrity: sha512-ASFBup0Mz1uyiIjANan1jzLQami9z1PoYSZCiiYW2FczPbenXc45FZdBZLzOT+r6+iciuEModtmCti+hjaAk0A==} dev: true @@ -3742,10 +3982,17 @@ packages: engines: {node: '>=0.4.0'} dev: true + /delegates/1.0.0: + resolution: {integrity: sha512-bd2L678uiWATM6m5Z1VzNCErI3jiGzt6HGY8OVICs40JQq/HALfbyNJmp0UDakEY4pMMaN0Ly5om/B1VI/+xfQ==} + + /depd/1.1.2: + resolution: {integrity: sha512-7emPTl6Dpo6JRXOXjLRxck+FlLRX5847cLKEn00PLAgc3g2hTZZgr+e4c2v6QpSmLeFP3n5yUo7ft6avBK/5jQ==} + engines: {node: '>= 0.6'} + optional: true + /detect-libc/2.0.1: resolution: {integrity: sha512-463v3ZeIrcWtdgIg6vI6XUncguvr2TnGl4SzDXinkt9mSLpBJKXT3mW6xT3VQdDN11+WVs29pgvivTc4Lp8v+w==} engines: {node: '>=8'} - dev: false /detect-node/2.1.0: resolution: {integrity: sha512-T0NIuQpnTvFDATNuHN5roPwSBG83rFsuO+MXXH9/3N1eFbn4wcPjttvjMLEPWJ0RGUYgQE7cGgS3tNxbqCGM7g==} @@ -3871,12 +4118,18 @@ packages: /emoji-regex/8.0.0: resolution: {integrity: sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==} - dev: true /emoji-regex/9.2.2: resolution: {integrity: sha512-L18DaJsXSUk2+42pv8mLs5jJT2hqFkFE4j21wOmgbUqsZ2hL72NsUU785g9RXgo3s0ZNgVl42TiHp3ZtOv/Vyg==} dev: true + /encoding/0.1.13: + resolution: {integrity: sha512-ETBauow1T35Y/WZMkio9jiM0Z5xjHHmJ4XmjZOq1l/dXz3lr2sRn87nJy20RupqSh1F2m3HHPSp8ShIPQJrJ3A==} + requiresBuild: true + dependencies: + iconv-lite: 0.6.3 + optional: true + /end-of-stream/1.4.4: resolution: {integrity: sha512-+uw1inIHVPQoaVuHzRyXd21icM+cnt4CzD5rW+NC1wjOUSTOs+Te7FOv7AhN7vS9x/oIyhLP5PR1H+phQAHu5Q==} dependencies: @@ -3903,6 +4156,15 @@ packages: resolution: {integrity: sha512-oYp7156SP8LkeGD0GF85ad1X9Ai79WtRsZ2gxJqtBuzH+98YUV6jkHEKlZkMbcrjJjIVJNIDP/3WL9wQkoPbWA==} engines: {node: '>=0.12'} + /env-paths/2.2.1: + resolution: {integrity: sha512-+h1lkLKhZMTYjog1VEpJNG7NZJWcuc2DDk/qsqSTRRCOXiLjeQ1d1/udrUGhqMxUgAlwKNZ0cf2uqan5GLuS2A==} + engines: {node: '>=6'} + optional: true + + /err-code/2.0.3: + resolution: {integrity: sha512-2bmlRpNKBxT/CRmPOlyISQpNj+qSeYvcym/uT0Jx2bMOlKLtSy1ZmLuVxSEKKyor/N5yhvp/ZiG1oE3DEYMSFA==} + optional: true + /error-ex/1.3.2: resolution: {integrity: sha512-7dFHNmqeFSEt2ZBsCriorKnn3Z2pj+fd9kmI6QoWw4//DL+icEBfc0U7qJCisqrTsKTjw4fNFy2pW9OqStD84g==} dependencies: @@ -4884,6 +5146,14 @@ packages: resolution: {integrity: sha512-5nqDSxl8nn5BSNxyR3n4I6eDmbolI6WT+QqR547RwxQapgjQBmtktdP+HTBb/a/zLsbzERTONyUB5pefh5TtjQ==} dev: true + /foreground-child/2.0.0: + resolution: {integrity: sha512-dCIq9FpEcyQyXKCkyzmlPTFNgrCzPudOe+mhvJU5zAtlBnGVy2yKxtfsxK2tQBThwq225jcvBjpw1Gr40uzZCA==} + engines: {node: '>=8.0.0'} + dependencies: + cross-spawn: 7.0.3 + signal-exit: 3.0.7 + dev: true + /form-data/4.0.0: resolution: {integrity: sha512-ETEklSGi5t0QMZuiXoA/Q6vcnxcLQP5vdugSpuAyi6SVGi2clPPp+xgEhuMaHC+zGgn31Kd235W35f7Hykkaww==} engines: {node: '>= 6'} @@ -4911,7 +5181,6 @@ packages: engines: {node: '>= 8'} dependencies: minipass: 3.3.6 - dev: false /fs.realpath/1.0.0: resolution: {integrity: sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==} @@ -4940,6 +5209,34 @@ packages: resolution: {integrity: sha512-xckBUXyTIqT97tq2x2AMb+g163b5JFysYk0x4qxNFwbfQkmNZoiRHb6sPzI9/QV33WeuvVYBUIiD4NzNIyqaRQ==} dev: true + /gauge/3.0.2: + resolution: {integrity: sha512-+5J6MS/5XksCuXq++uFRsnUd7Ovu1XenbeuIuNRJxYWjgQbPuFhT14lAvsWfqfAmnwluf1OwMjz39HjfLPci0Q==} + engines: {node: '>=10'} + dependencies: + aproba: 2.0.0 + color-support: 1.1.3 + console-control-strings: 1.1.0 + has-unicode: 2.0.1 + object-assign: 4.1.1 + signal-exit: 3.0.7 + string-width: 4.2.3 + strip-ansi: 6.0.1 + wide-align: 1.1.5 + + /gauge/4.0.4: + resolution: {integrity: sha512-f9m+BEN5jkg6a0fZjleidjN51VE1X+mPFQ2DJ0uv1V39oCLCbsGe6yjbBnp7eK7z/+GAon99a3nHuqbuuthyPg==} + engines: {node: ^12.13.0 || ^14.15.0 || >=16.0.0} + dependencies: + aproba: 2.0.0 + color-support: 1.1.3 + console-control-strings: 1.1.0 + has-unicode: 2.0.1 + signal-exit: 3.0.7 + string-width: 4.2.3 + strip-ansi: 6.0.1 + wide-align: 1.1.5 + optional: true + /gensync/1.0.0-beta.2: resolution: {integrity: sha512-3hN7NaskYvMDLQY55gnW3NQ+mesEAepTqlg+VEbj7zzqEMBVNhzcGYYeqFo/TlYz6eQiFcp1HcsCZO+nGgS8zg==} engines: {node: '>=6.9.0'} @@ -5051,7 +5348,7 @@ packages: array-union: 2.1.0 dir-glob: 3.0.1 fast-glob: 3.2.12 - ignore: 5.2.0 + ignore: 5.2.1 merge2: 1.4.1 slash: 3.0.0 dev: true @@ -5073,7 +5370,6 @@ packages: /graceful-fs/4.2.10: resolution: {integrity: sha512-9ByhssR2fPVsNZj478qUUbKfmL0+t5BDVyjShtyZZLiK7ZDAArFFfopyOTj0M05wE2tJPisA4iTnnXl2YoPvOA==} - dev: true /grapheme-splitter/1.0.4: resolution: {integrity: sha512-bzh50DW9kTPM00T8y4o8vQg89Di9oLJVLW/KaOGIXJWP/iqCN6WKYkbNOF04vFLJhwcpYUh9ydh/+5vpOqV4YQ==} @@ -5115,6 +5411,9 @@ packages: has-symbols: 1.0.3 dev: true + /has-unicode/2.0.1: + resolution: {integrity: sha512-8Rf9Y83NBReMnx0gFzA8JImQACstCYWUplepDa9xprwwtmgEZUF0h/i5xSA625zB/I37EtrswSST6OXxwaaIJQ==} + /has/1.0.3: resolution: {integrity: sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw==} engines: {node: '>= 0.4.0'} @@ -5158,6 +5457,10 @@ packages: whatwg-encoding: 2.0.0 dev: true + /html-escaper/2.0.2: + resolution: {integrity: sha512-H2iMtd0I4Mt5eYiapRdIDjp+XzelXQ0tFE4JS7YFwFevXXMmOp9myNrUvCg0D6ws8iqkRPBfKHgbwig1SmlLfg==} + dev: true + /html-react-parser/3.0.4_react@18.2.0: resolution: {integrity: sha512-va68PSmC7uA6PbOEc9yuw5Mu3OHPXmFKUpkLGvUPdTuNrZ0CJZk1s/8X/FaHjswK/6uZghu2U02tJjussT8+uw==} peerDependencies: @@ -5179,6 +5482,21 @@ packages: entities: 4.4.0 dev: false + /http-cache-semantics/4.1.0: + resolution: {integrity: sha512-carPklcUh7ROWRK7Cv27RPtdhYhUsela/ue5/jKzjegVvXDqM2ILE9Q2BGn9JZJh1g87cp56su/FgQSzcWS8cQ==} + optional: true + + /http-proxy-agent/4.0.1: + resolution: {integrity: sha512-k0zdNgqWTGA6aeIRVpvfVob4fL52dTfaehylg0Y4UvSySvOq/Y+BOyPrgpUrA7HylqvU8vIZGsRuXmspskV0Tg==} + engines: {node: '>= 6'} + dependencies: + '@tootallnate/once': 1.1.2 + agent-base: 6.0.2 + debug: 4.3.4 + transitivePeerDependencies: + - supports-color + optional: true + /http-proxy-agent/5.0.0: resolution: {integrity: sha512-n2hY8YdoRE1i7r6M0w9DIw5GgZN0G25P8zLCRQ8rjXtTU3vsNFBI/vWK/UIeE6g5MUUz6avwAPXmL6Fy9D/90w==} engines: {node: '>= 6'} @@ -5199,12 +5517,17 @@ packages: transitivePeerDependencies: - supports-color + /humanize-ms/1.2.1: + resolution: {integrity: sha512-Fl70vYtsAFb/C06PTS9dZBo7ihau+Tu/DNCk/OyHhea07S+aeMWpFFkUaXRa8fI+ScZbEI8dfSxwY7gxZ9SAVQ==} + dependencies: + ms: 2.1.3 + optional: true + /iconv-lite/0.6.3: resolution: {integrity: sha512-4fCk79wshMdzMp2rH06qWrJE4iolqLhCUH+OiuIgU++RB0+94NlDL81atO7GX55uUKueo0txHNtvEyI6D7WdMw==} engines: {node: '>=0.10.0'} dependencies: safer-buffer: 2.1.2 - dev: true /ieee754/1.2.1: resolution: {integrity: sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA==} @@ -5243,18 +5566,20 @@ packages: /imurmurhash/0.1.4: resolution: {integrity: sha512-JmXMZ6wuvDmLiHEml9ykzqO6lwFbof0GG4IkcGaENdCRDDmMVnny7s5HsIgHCbaq0w2MyPhDqkhTUgS2LU2PHA==} engines: {node: '>=0.8.19'} - dev: true /indent-string/4.0.0: resolution: {integrity: sha512-EdDDZu4A2OyIK7Lr/2zG+w5jmbuk1DVBnEwREQvBzspBJkCEbRa8GxU1lghYcaGJCnRWibjDXlq779X1/y5xwg==} engines: {node: '>=8'} - dev: true /indent-string/5.0.0: resolution: {integrity: sha512-m6FAo/spmsW2Ab2fU35JTYwtOKa2yAwXSwgjSv1TJzh4Mh7mC3lzAOVLBprb72XsTrgkEIsl7YrFNAiDiRhIGg==} engines: {node: '>=12'} dev: true + /infer-owner/1.0.4: + resolution: {integrity: sha512-IClj+Xz94+d7irH5qRyfJonOdfTzuDaifE6ZPWfx0N0+/ATZCbuTPq2prFl526urkQd90WyUKIh1DfBQ2hMz9A==} + optional: true + /inflection/1.13.4: resolution: {integrity: sha512-6I/HUDeYFfuNCVS3td055BaXBwKYuzw7K3ExVMStBowKo9oOAMJIXIHvdyR3iboTCp1b+1i5DSkIZTcwIktuDw==} engines: {'0': node >= 0.4.0} @@ -5286,6 +5611,10 @@ packages: side-channel: 1.0.4 dev: true + /ip/2.0.0: + resolution: {integrity: sha512-WKa+XuLG1A1R0UWhl2+1XQSi+fZWMsYKffMZTTYsiZaUD8k2yDAj5atimTUD2TZkyCkNEeYE5NhFZmupOGtjYQ==} + optional: true + /irregular-plurals/3.3.0: resolution: {integrity: sha512-MVBLKUTangM3EfRPFROhmWQQKRDsrgI83J8GS3jXy+OwYqiR2/aoWndYQ5416jLE3uaGgLH7ncme3X9y09gZ3g==} engines: {node: '>=8'} @@ -5359,7 +5688,6 @@ packages: /is-fullwidth-code-point/3.0.0: resolution: {integrity: sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==} engines: {node: '>=8'} - dev: true /is-fullwidth-code-point/4.0.0: resolution: {integrity: sha512-O4L094N2/dZ7xqVdrXhh9r1KODPJpFms8B5sGdJLPy664AgvXsreZUyCQQNItZRDlYug4xStLjNp/sz3HvBowQ==} @@ -5372,6 +5700,10 @@ packages: dependencies: is-extglob: 2.1.1 + /is-lambda/1.0.1: + resolution: {integrity: sha512-z7CMFGNrENq5iFB9Bqo64Xk6Y9sg+epq1myIcdHaGnbMTYOxvzsEtdYqQUylB7LxfkvgrrjP32T6Ywciio9UIQ==} + optional: true + /is-module/1.0.0: resolution: {integrity: sha512-51ypPSPCoTEIN9dy5Oy+h4pShgJmPCygKfyRCISBI+JoWT/2oJvK8QPxmwv7b/p239jXrm9M1mlQbyKJ5A152g==} dev: true @@ -5493,12 +5825,33 @@ packages: /isexe/2.0.0: resolution: {integrity: sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==} - dev: true /isomorphic.js/0.2.5: resolution: {integrity: sha512-PIeMbHqMt4DnUP3MA/Flc0HElYjMXArsw1qwJZcm9sqR8mq3l8NYizFMty0pWwE/tzIGH3EKK5+jes5mAr85yw==} dev: false + /istanbul-lib-coverage/3.2.0: + resolution: {integrity: sha512-eOeJ5BHCmHYvQK7xt9GkdHuzuCGS1Y6g9Gvnx3Ym33fz/HpLRYxiS0wHNr+m/MBC8B647Xt608vCDEvhl9c6Mw==} + engines: {node: '>=8'} + dev: true + + /istanbul-lib-report/3.0.0: + resolution: {integrity: sha512-wcdi+uAKzfiGT2abPpKZ0hSU1rGQjUQnLvtY5MpQ7QCTahD3VODhcu4wcfY1YtkGaDD5yuydOLINXsfbus9ROw==} + engines: {node: '>=8'} + dependencies: + istanbul-lib-coverage: 3.2.0 + make-dir: 3.1.0 + supports-color: 7.2.0 + dev: true + + /istanbul-reports/3.1.5: + resolution: {integrity: sha512-nUsEMa9pBt/NOHqbcbeJEgqIlY/K7rVWUX6Lql2orY5e9roQOthbR3vtY4zzf2orPELg80fnxxk9zUyPlgwD1w==} + engines: {node: '>=8'} + dependencies: + html-escaper: 2.0.2 + istanbul-lib-report: 3.0.0 + dev: true + /javascript-natural-sort/0.7.1: resolution: {integrity: sha512-nO6jcEfZWQXDhOiBtG2KvKyEptz7RVbpGP4vTD2hLBdmNQSsCiicO2Ioinv6UI4y9ukqnBpy+XZ9H6uLNgJTlw==} dev: true @@ -5794,6 +6147,37 @@ packages: sourcemap-codec: 1.4.8 dev: true + /make-dir/3.1.0: + resolution: {integrity: sha512-g3FeP20LNwhALb/6Cz6Dd4F2ngze0jz7tbzrD2wAV+o9FeNHe4rL+yK2md0J/fiSf1sa1ADhXqi5+oVwOM/eGw==} + engines: {node: '>=8'} + dependencies: + semver: 6.3.0 + + /make-fetch-happen/9.1.0: + resolution: {integrity: sha512-+zopwDy7DNknmwPQplem5lAZX/eCOzSvSNNcSKm5eVwTkOBzoktEfXsa9L23J/GIRhxRsaxzkPEhrJEpE2F4Gg==} + engines: {node: '>= 10'} + dependencies: + agentkeepalive: 4.2.1 + cacache: 15.3.0 + http-cache-semantics: 4.1.0 + http-proxy-agent: 4.0.1 + https-proxy-agent: 5.0.1 + is-lambda: 1.0.1 + lru-cache: 6.0.0 + minipass: 3.3.6 + minipass-collect: 1.0.2 + minipass-fetch: 1.4.1 + minipass-flush: 1.0.5 + minipass-pipeline: 1.2.4 + negotiator: 0.6.3 + promise-retry: 2.0.1 + socks-proxy-agent: 6.2.1 + ssri: 8.0.1 + transitivePeerDependencies: + - bluebird + - supports-color + optional: true + /mammoth/1.5.1: resolution: {integrity: sha512-7ZioZBf/1HjYrm1qZJOO+DD+rYxLvwrHS+HVOwW89hwIp+r6ZqJ/Eq2rXSS+8ezZ3/DuW6FUUp2Dfz6e7B2pBQ==} hasBin: true @@ -5970,6 +6354,45 @@ packages: /minimist/1.2.7: resolution: {integrity: sha512-bzfL1YUZsP41gmu/qjrEk0Q6i2ix/cVeAhbCbqH9u3zYutS1cLg00qhrD0M2MVdCcx4Sc0UpP2eBWo9rotpq6g==} + /minipass-collect/1.0.2: + resolution: {integrity: sha512-6T6lH0H8OG9kITm/Jm6tdooIbogG9e0tLgpY6mphXSm/A9u8Nq1ryBG+Qspiub9LjWlBPsPS3tWQ/Botq4FdxA==} + engines: {node: '>= 8'} + dependencies: + minipass: 3.3.6 + optional: true + + /minipass-fetch/1.4.1: + resolution: {integrity: sha512-CGH1eblLq26Y15+Azk7ey4xh0J/XfJfrCox5LDJiKqI2Q2iwOLOKrlmIaODiSQS8d18jalF6y2K2ePUm0CmShw==} + engines: {node: '>=8'} + dependencies: + minipass: 3.3.6 + minipass-sized: 1.0.3 + minizlib: 2.1.2 + optionalDependencies: + encoding: 0.1.13 + optional: true + + /minipass-flush/1.0.5: + resolution: {integrity: sha512-JmQSYYpPUqX5Jyn1mXaRwOda1uQ8HP5KAT/oDSLCzt1BYRhQU0/hDtsB1ufZfEEzMZ9aAVmsBw8+FWsIXlClWw==} + engines: {node: '>= 8'} + dependencies: + minipass: 3.3.6 + optional: true + + /minipass-pipeline/1.2.4: + resolution: {integrity: sha512-xuIq7cIOt09RPRJ19gdi4b+RiNvDFYe5JH+ggNvBqGqpQXcru3PcRmOZuHBKWK1Txf9+cQ+HMVN4d6z46LZP7A==} + engines: {node: '>=8'} + dependencies: + minipass: 3.3.6 + optional: true + + /minipass-sized/1.0.3: + resolution: {integrity: sha512-MbkQQ2CTiBMlA2Dm/5cY+9SWFEN8pzzOXi6rlM5Xxq0Yqbda5ZQy9sU75a673FE9ZK0Zsbr6Y5iP6u9nktfg2g==} + engines: {node: '>=8'} + dependencies: + minipass: 3.3.6 + optional: true + /minipass/3.3.6: resolution: {integrity: sha512-DxiNidxSEK+tHG6zOIklvNOwm3hvCrbUrdtzY74U6HKTJxvIDfOUL5W5P2Ghd3DTkhhKPYGqeNUIh5qcM4YBfw==} engines: {node: '>=8'} @@ -5982,7 +6405,6 @@ packages: dependencies: minipass: 3.3.6 yallist: 4.0.0 - dev: false /mkdirp-classic/0.5.3: resolution: {integrity: sha512-gKLcREMhtuZRwRAfqP3RFW+TK4JqApVBtOIftVgjuABpAtpxhPGaDcfvbhNvD0B8iD1oUr/txX35NjcaY6Ns/A==} @@ -5993,9 +6415,14 @@ packages: engines: {node: '>=10'} hasBin: true + /moment-timezone/0.5.40: + resolution: {integrity: sha512-tWfmNkRYmBkPJz5mr9GVDn9vRlVZOTe6yqY92rFxiOdWXbjaR0+9LwQnZGGuNR63X456NqmEkbskte8tWL5ePg==} + dependencies: + moment: 2.29.4 + dev: false + /moment/2.29.4: resolution: {integrity: sha512-5LC9SOxjSc2HF6vO2CyuTDNivEdoz2IvyJJGj6X8DJ0eFyfszE0QiEd+iXmBvUP3WHxSjFH/vIsA0EN00cgr8w==} - dev: true /ms/2.0.0: resolution: {integrity: sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==} @@ -6006,7 +6433,6 @@ packages: /ms/2.1.3: resolution: {integrity: sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==} - dev: true /mz/2.7.0: resolution: {integrity: sha512-z81GNO7nnYMEhrGh9LeymoE4+Yr0Wn5McHIZMK5cfQCl+NDX08sCZgUc9/6MHni9IWuFLm1Z3HTCXu2z9fN62Q==} @@ -6039,6 +6465,11 @@ packages: resolution: {integrity: sha512-OWND8ei3VtNC9h7V60qff3SVobHr996CTwgxubgyQYEpg290h9J0buyECNNJexkFm5sOajh5G116RYA1c8ZMSw==} dev: true + /negotiator/0.6.3: + resolution: {integrity: sha512-+EUsqGPLsM+j/zdChZjsnX51g4XrHFOIXwfnCVPGlQk/k5giakcKsuxCObBRu6DSm9opw/O6slWbJdghQM4bBg==} + engines: {node: '>= 0.6'} + optional: true + /next-superjson-plugin/0.5.2_o7ninycgoz2lf73je52p7wq4ja: resolution: {integrity: sha512-k+hetZvvBvzFGxYGULdIZ2Esx0XWlfvXiMa33JW1nRYMp2A7HdU8j4hnM1oMym22bwRpzK9vdryINDLnwfJCwg==} peerDependencies: @@ -6114,10 +6545,24 @@ packages: semver: 7.3.8 dev: false + /node-addon-api/4.3.0: + resolution: {integrity: sha512-73sE9+3UaLYYFmDsFZnqCInzPyh3MqIwZO9cw58yIqAZhONrrabrYyYe3TuIqtIiOuTXVhsGau8hcrhhwSsDIQ==} + /node-domexception/1.0.0: resolution: {integrity: sha512-/jKZoMpw0F8GRwl4/eLROPA3cfcXtLApP0QzLmUT/HuPCZWyB7IY9ZrMeKw2O/nFIqPQB3PVM9aYm0F312AXDQ==} engines: {node: '>=10.5.0'} + /node-fetch/2.6.7: + resolution: {integrity: sha512-ZjMPFEfVx5j+y2yF35Kzx5sF7kDzxuDj6ziH4FFbOp87zKDZNx8yExJIb05OGF4Nlt9IHFIMBkRl41VdvcNdbQ==} + engines: {node: 4.x || >=6.0.0} + peerDependencies: + encoding: ^0.1.0 + peerDependenciesMeta: + encoding: + optional: true + dependencies: + whatwg-url: 5.0.0 + /node-fetch/3.3.0: resolution: {integrity: sha512-BKwRP/O0UvoMKp7GNdwPlObhYGB5DQqwhEDQlNKuoqwVYSxkSZCSbHjnFFmUEtwSKRPU4kNK8PbDYYitwaE3QA==} engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} @@ -6126,6 +6571,27 @@ packages: fetch-blob: 3.2.0 formdata-polyfill: 4.0.10 + /node-gyp/8.4.1: + resolution: {integrity: sha512-olTJRgUtAb/hOXG0E93wZDs5YiJlgbXxTwQAFHyNlRsXQnYzUaF2aGgujZbw+hR8aF4ZG/rST57bWMWD16jr9w==} + engines: {node: '>= 10.12.0'} + hasBin: true + requiresBuild: true + dependencies: + env-paths: 2.2.1 + glob: 7.2.3 + graceful-fs: 4.2.10 + make-fetch-happen: 9.1.0 + nopt: 5.0.0 + npmlog: 6.0.2 + rimraf: 3.0.2 + semver: 7.3.8 + tar: 6.1.12 + which: 2.0.2 + transitivePeerDependencies: + - bluebird + - supports-color + optional: true + /node-releases/2.0.6: resolution: {integrity: sha512-PiVXnNuFm5+iYkLBNeq5211hvO38y63T0i2KKh2KnUs3RpzJ+JtODFjkD8yjLwnDkTYF1eKXheUwdssR+NRZdg==} @@ -6134,6 +6600,13 @@ packages: engines: {node: '>=12.19'} dev: true + /nopt/5.0.0: + resolution: {integrity: sha512-Tbj67rffqceeLpcRXrT7vKAN8CwfPeIBgM7E6iBkmKLV7bEMwpGgYLGv0jACUsECaa/vuxP0IjEont6umdMgtQ==} + engines: {node: '>=6'} + hasBin: true + dependencies: + abbrev: 1.1.1 + /normalize-package-data/2.5.0: resolution: {integrity: sha512-/5CMN3T0R4XTj4DcGaexo+roZSdSFW/0AOOTROrjxzCG1wrWXEsGbRKevjlIL+ZDE4sZlJr5ED4YW0yqmkK+eA==} dependencies: @@ -6166,6 +6639,24 @@ packages: engines: {node: '>=10'} dev: true + /npmlog/5.0.1: + resolution: {integrity: sha512-AqZtDUWOMKs1G/8lwylVjrdYgqA4d9nu8hc+0gzRxlDb1I10+FHBGMXs6aiQHFdCUUlqH99MUMuLfzWDNDtfxw==} + dependencies: + are-we-there-yet: 2.0.0 + console-control-strings: 1.1.0 + gauge: 3.0.2 + set-blocking: 2.0.0 + + /npmlog/6.0.2: + resolution: {integrity: sha512-/vBvz5Jfr9dT/aFWd0FIRf+T/Q2WBsLENygUaFUqstqsycmZAP/t5BvFJTK0viFmSUxiUKTUplWy5vt+rvKIxg==} + engines: {node: ^12.13.0 || ^14.15.0 || >=16.0.0} + dependencies: + are-we-there-yet: 3.0.1 + console-control-strings: 1.1.0 + gauge: 4.0.4 + set-blocking: 2.0.0 + optional: true + /nprogress/0.2.0: resolution: {integrity: sha512-I19aIingLgR1fmhftnbWWO3dXc0hSxqHQHQb3H8m+K3TnEn/iSeTZZOyvKXWqQESMwuUVnatlCnZdLBZZt2VSA==} dev: false @@ -6245,6 +6736,10 @@ packages: resolution: {integrity: sha512-z+pI07qxo4c2CulUHCDf9lcqDlMSo72N/4rLUpRXf6fu+q8vjt8y0xS+Tlf8NTJDdTXHbdeO1n3MlbctwEoXZw==} dev: false + /ohm-js/16.4.0: + resolution: {integrity: sha512-u1QI5h2w29I4838+/m32rzqfNNH1Qej9L6O1MTZZMx7bVOu09orc/TO0HRVeYh5jStieZ3INszM7oqbCdx2x7A==} + engines: {node: '>=0.12.1'} + /on-exit-leak-free/2.1.0: resolution: {integrity: sha512-VuCaZZAjReZ3vUwgOB8LxAosIurDiAW0s13rI1YwmaP++jvcxP77AWoQvenZebpCA2m8WC1/EosPYPMjnRAp/w==} @@ -6348,6 +6843,13 @@ packages: p-limit: 4.0.0 dev: true + /p-map/4.0.0: + resolution: {integrity: sha512-/bjOqmgETBYB5BoEeGVea8dmvHb2m9GLy1E9W43yeyfP6QQCZGFNa+XRceJEuDB6zqr+gKpIAmlLebMpykw/MQ==} + engines: {node: '>=10'} + dependencies: + aggregate-error: 3.1.0 + optional: true + /p-map/5.5.0: resolution: {integrity: sha512-VFqfGDHlx87K66yZrNdI4YGtD70IRyd+zSvgks6mzHPRNkoKy+9EKP4SFC77/vTTQYmRmti7dvqC+m5jBrBAcg==} engines: {node: '>=12'} @@ -6956,6 +7458,23 @@ packages: resolution: {integrity: sha512-cdGef/drWFoydD1JsMzuFf8100nZl+GT+yacc2bEced5f9Rjk4z+WtFUTBu9PhOi9j/jfmBPu0mMEY4wIdAF8A==} engines: {node: '>= 0.6.0'} + /promise-inflight/1.0.1: + resolution: {integrity: sha512-6zWPyEOFaQBJYcGMHBKTKJ3u6TBsnMFOIZSa6ce1e/ZrrsOlnHRHbabMjLiBYKp+n44X9eUI6VUPaukCXHuG4g==} + peerDependencies: + bluebird: '*' + peerDependenciesMeta: + bluebird: + optional: true + optional: true + + /promise-retry/2.0.1: + resolution: {integrity: sha512-y+WKFlBR8BGXnsNlIHFGPZmyDf3DFMoLhaflAnyZgV6rG6xu+JwesTo2Q9R6XwYmtmwAFCkAk3e35jEdoeh/3g==} + engines: {node: '>=10'} + dependencies: + err-code: 2.0.3 + retry: 0.12.0 + optional: true + /prop-types/15.8.1: resolution: {integrity: sha512-oj87CgZICdulUohogVAR7AjlC0327U4el4L6eAvOqCeudMDVU0NThNaV+b9Df4dXgSP1gXMTnPdhfe/2qDH5cg==} dependencies: @@ -7325,10 +7844,19 @@ packages: supports-preserve-symlinks-flag: 1.0.0 dev: true + /retry-as-promised/5.0.0: + resolution: {integrity: sha512-6S+5LvtTl2ggBumk04hBo/4Uf6fRJUwIgunGZ7CYEBCeufGFW1Pu6ucUf/UskHeWOIsUcLOGLFXPig5tR5V1nA==} + dev: false + /retry-as-promised/6.1.0: resolution: {integrity: sha512-Hj/jY+wFC+SB9SDlIIFWiGOHnNG0swYbGYsOj2BJ8u2HKUaobNKab0OIC0zOLYzDy0mb7A4xA5BMo4LMz5YtEA==} dev: false + /retry/0.12.0: + resolution: {integrity: sha512-9LkiTwjUh6rT555DtE9rTX+BKByPfrMzEAtnlEtdEwr3Nkffwiihqe2bWADg+OQRjt9gl6ICdmB/ZFDCGAtSow==} + engines: {node: '>= 4'} + optional: true + /reusify/1.0.4: resolution: {integrity: sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw==} engines: {iojs: '>=1.0.0', node: '>=0.10.0'} @@ -7444,7 +7972,6 @@ packages: /safer-buffer/2.1.2: resolution: {integrity: sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==} - dev: true /sax/1.1.6: resolution: {integrity: sha512-8zci48uUQyfqynGDSkUMD7FCJB96hwLnlZOXlgs1l3TX+LW27t3psSWKUxC0fxVgA86i8tL4NwGcY1h/6t3ESg==} @@ -7474,7 +8001,6 @@ packages: /semver/6.3.0: resolution: {integrity: sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==} hasBin: true - dev: true /semver/7.3.8: resolution: {integrity: sha512-NB1ctGL5rlHrPJtFDVIVzTyQylMLu9N9VICA6HSFJo8MCGVTMW6gfpicwKmmK/dAjTOrqu5l63JJOpDSrAis3A==} @@ -7483,6 +8009,11 @@ packages: dependencies: lru-cache: 6.0.0 + /sequelize-pool/7.1.0: + resolution: {integrity: sha512-G9c0qlIWQSK29pR/5U2JF5dDQeqqHRragoyahj/Nx4KOOQ3CPPfzxnfqFPCSB7x5UgjOgnZ61nSxz+fjDpRlJg==} + engines: {node: '>= 10.0.0'} + dev: false + /sequelize-pool/8.0.0: resolution: {integrity: sha512-xY04c5ctp6lKE4ZoSVo7YJHN5FHVhoYMoH2Z8jWIJG26c9kJSkIjql5HgD9XG5cwJbYMF0Ko2Fhgws20HC90Ug==} engines: {node: '>= 10.0.0'} @@ -7495,6 +8026,9 @@ packages: type-fest: 0.13.1 dev: true + /set-blocking/2.0.0: + resolution: {integrity: sha512-KiKBS8AnWGEyLzofFfmvKwpdPzqiy16LvQfK3yv/fVH7Bj13/wl3JSR1J+rfgRE9q7xUJK4qvgS8raSOeLUehw==} + /setimmediate/1.0.5: resolution: {integrity: sha512-MATJdZp8sLqDl/68LfQmbP8zKPLQNV6BIZoIgrscFDQ+RsvK/BxeDQOgyxKKoh0y/8h3BqVFnCqQ/gd+reiIXA==} dev: false @@ -7533,7 +8067,6 @@ packages: /signal-exit/3.0.7: resolution: {integrity: sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ==} - dev: true /simple-concat/1.0.1: resolution: {integrity: sha512-cSFtAPtRhljv69IK0hTVZQ+OfE9nePi/rtJmw5UjHeVyVroEqJXP1sFztKUy1qU+xvz3u/sfYJLa947b7nAN2Q==} @@ -7570,6 +8103,30 @@ packages: is-fullwidth-code-point: 4.0.0 dev: true + /smart-buffer/4.2.0: + resolution: {integrity: sha512-94hK0Hh8rPqQl2xXc3HsaBoOXKV20MToPkcXvwbISWLEs+64sBq5kFgn2kJDHb1Pry9yrP0dxrCI9RRci7RXKg==} + engines: {node: '>= 6.0.0', npm: '>= 3.0.0'} + optional: true + + /socks-proxy-agent/6.2.1: + resolution: {integrity: sha512-a6KW9G+6B3nWZ1yB8G7pJwL3ggLy1uTzKAgCb7ttblwqdz9fMGJUuTy3uFzEP48FAs9FLILlmzDlE2JJhVQaXQ==} + engines: {node: '>= 10'} + dependencies: + agent-base: 6.0.2 + debug: 4.3.4 + socks: 2.7.1 + transitivePeerDependencies: + - supports-color + optional: true + + /socks/2.7.1: + resolution: {integrity: sha512-7maUZy1N7uo6+WVEX6psASxtNlKaNVMlGQKkG/63nEDdLOWNbiUMoLK7X4uYoLhQstau72mLgfEWcXcwsaHbYQ==} + engines: {node: '>= 10.13.0', npm: '>= 3.0.0'} + dependencies: + ip: 2.0.0 + smart-buffer: 4.2.0 + optional: true + /sonic-boom/3.2.0: resolution: {integrity: sha512-SbbZ+Kqj/XIunvIAgUZRlqd6CGQYq71tRRbXR92Za8J/R3Yh4Av+TWENiSiEgnlwckYLyP0YZQWVfyNC0dzLaA==} dependencies: @@ -7660,6 +8217,30 @@ packages: /sprintf-js/1.0.3: resolution: {integrity: sha512-D9cPgkvLlV3t3IzL0D0YLvGA9Ahk4PcvVwUbN0dSGr1aP0Nrt4AEnTUbuGvquEC0mA64Gqt1fzirlRs5ibXx8g==} + /sqlite3/5.1.4: + resolution: {integrity: sha512-i0UlWAzPlzX3B5XP2cYuhWQJsTtlMD6obOa1PgeEQ4DHEXUuyJkgv50I3isqZAP5oFc2T8OFvakmDh2W6I+YpA==} + requiresBuild: true + peerDependenciesMeta: + node-gyp: + optional: true + dependencies: + '@mapbox/node-pre-gyp': 1.0.10 + node-addon-api: 4.3.0 + tar: 6.1.12 + optionalDependencies: + node-gyp: 8.4.1 + transitivePeerDependencies: + - bluebird + - encoding + - supports-color + + /ssri/8.0.1: + resolution: {integrity: sha512-97qShzy1AiyxvPNIkLWoGua7xoQzzPjQ0HAH4B0rWKo7SZ6USuPcrUiAFrws0UH8RrbWmgq3LMTObhPIHbbBeQ==} + engines: {node: '>= 8'} + dependencies: + minipass: 3.3.6 + optional: true + /stable/0.1.8: resolution: {integrity: sha512-ji9qxRnOVfcuLDySj9qzhGSEFVobyt1kIOSkj1qZzYLzq7Tos/oUUWvotUPQLlrsidqsK6tBH89Bc9kL5zHA6w==} deprecated: 'Modern JS already guarantees Array#sort() is a stable sort, so this library is deprecated. See the compatibility table on MDN: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/sort#browser_compatibility' @@ -7679,7 +8260,6 @@ packages: emoji-regex: 8.0.0 is-fullwidth-code-point: 3.0.0 strip-ansi: 6.0.1 - dev: true /string-width/5.1.2: resolution: {integrity: sha512-HnLOCR3vjcY8beoNLtcjZ5/nxn2afmME6lhrDrebokqMap+XbeW8n9TXpPDOqdGK5qcI3oT0GKTW6wC7EMiVqA==} @@ -7735,7 +8315,6 @@ packages: engines: {node: '>=8'} dependencies: ansi-regex: 5.0.1 - dev: true /strip-ansi/7.0.1: resolution: {integrity: sha512-cXNxvT8dFNRVfhVME3JAe98mkXDYN2O1l7jmcwMnOslDeESg1rF/OZMtK0nRAhiari1unG5cD4jG3rapUAkLbw==} @@ -7989,13 +8568,21 @@ packages: minizlib: 2.1.2 mkdirp: 1.0.4 yallist: 4.0.0 - dev: false /temp-dir/3.0.0: resolution: {integrity: sha512-nHc6S/bwIilKHNRgK/3jlhDoIHcp45YgyiwcAk46Tr0LfEqGBVpmiAyuiuxeVE44m3mXnEeVhaipLOEWmH+Njw==} engines: {node: '>=14.16'} dev: true + /test-exclude/6.0.0: + resolution: {integrity: sha512-cAGWPIyOHU6zlmg88jwm7VRyXnMN7iV68OGAbYDk/Mh/xC/pzVPlQtY6ngoIH/5/tciuhGfvESU8GrHrcxD56w==} + engines: {node: '>=8'} + dependencies: + '@istanbuljs/schema': 0.1.3 + glob: 7.2.3 + minimatch: 3.1.2 + dev: true + /text-table/0.2.0: resolution: {integrity: sha512-N+8UisAXDGk8PFXP4HAzVR9nbfmVJ3zYLAWiTIoqC5v5isinhr+r5uaO8+7r3BMfuNIufIsA7RdpVgacC2cSpw==} dev: true @@ -8061,6 +8648,9 @@ packages: url-parse: 1.5.10 dev: true + /tr46/0.0.3: + resolution: {integrity: sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw==} + /tr46/3.0.0: resolution: {integrity: sha512-l7FvfAHlcmulp8kr+flpQZmVwtu7nfRV7NZujtN0OqES8EL4O4e0qqzL0DC5gAvx/ZC/9lk6rhcUwYvkBnBnYA==} engines: {node: '>=12'} @@ -8283,6 +8873,18 @@ packages: resolution: {integrity: sha512-+A5Sja4HP1M08MaXya7p5LvjuM7K6q/2EaC0+iovj/wOcMsTzMvDFbasi/oSapiwOlt252IqsKqPjCl7huKS0A==} dev: false + /unique-filename/1.1.1: + resolution: {integrity: sha512-Vmp0jIp2ln35UTXuryvjzkjGdRyf9b2lTXuSYUiPmzRcl3FDtYqAwOnTJkAngD9SWhnoJzDbTKwaOrZ+STtxNQ==} + dependencies: + unique-slug: 2.0.2 + optional: true + + /unique-slug/2.0.2: + resolution: {integrity: sha512-zoWr9ObaxALD3DOPfjPSqxt4fnZiWblxHIgeWqW8x7UqDzEtHEQLzji2cuJYQFCU6KmoJikOYAZlrTHHebjx2w==} + dependencies: + imurmurhash: 0.1.4 + optional: true + /universalify/0.2.0: resolution: {integrity: sha512-CJ1QgKmNg3CwvAv/kOFmtnEN05f0D/cn9QntgNOQlQF9dgvVTHj3t+8JPdjqawCHk7V/KA+fbUqzZ9XWhcqPUg==} engines: {node: '>= 4.0.0'} @@ -8343,11 +8945,25 @@ packages: engines: {node: '>= 4'} dev: false + /uuid/8.3.2: + resolution: {integrity: sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg==} + hasBin: true + dev: false + /uuid/9.0.0: resolution: {integrity: sha512-MXcSTerfPa4uqyzStbRoTgt5XIe3x5+42+q1sDuy3R5MDk66URdLMOZe5aPX/SQd+kuYAh0FdP/pO28IkQyTeg==} hasBin: true dev: false + /v8-to-istanbul/9.0.1: + resolution: {integrity: sha512-74Y4LqY74kLE6IFyIjPtkSTWzUZmj8tdHT9Ii/26dvQ6K9Dl2NbEfj0XgU2sHCtKgt5VupqhlO/5aWuqS+IY1w==} + engines: {node: '>=10.12.0'} + dependencies: + '@jridgewell/trace-mapping': 0.3.17 + '@types/istanbul-lib-coverage': 2.0.4 + convert-source-map: 1.9.0 + dev: true + /validate-npm-package-license/3.0.4: resolution: {integrity: sha512-DpKm2Ui/xN7/HQKCtpZxoRWBhZ9Z0kqtygG8XCgNQ8ZlDnxuQmWhj566j8fN4Cu3/JmbhsDo7fcAJq4s9h27Ew==} dependencies: @@ -8412,6 +9028,9 @@ packages: resolution: {integrity: sha512-e0MO3wdXWKrLbL0DgGnUV7WHVuw9OUvL4hjgnPkIeEvESk74gAITi5G606JtZPp39cd8HA9VQzCIvA49LpPN5Q==} engines: {node: '>= 8'} + /webidl-conversions/3.0.1: + resolution: {integrity: sha512-2JAn3z8AR6rjK8Sm8orRC0h/bcl/DqL7tRPdGZ4I1CjdF+EaMLmYxBHyXuKL849eucPFhvBoxMsflfOb8kxaeQ==} + /webidl-conversions/7.0.0: resolution: {integrity: sha512-VwddBukDzu71offAQR975unBIGqfKZpM+8ZX6ySk8nYhVoo5CYaZyzt3YBvYtRtO+aoGlqxPg/B87NGVZ/fu6g==} engines: {node: '>=12'} @@ -8442,6 +9061,12 @@ packages: webidl-conversions: 7.0.0 dev: true + /whatwg-url/5.0.0: + resolution: {integrity: sha512-saE57nupxk6v3HY35+jzBwYa0rKSy0XR8JSxZPwgLr7ys0IBzhGviA1/TUGJLmSVqs8pb9AnvICXEuOHLprYTw==} + dependencies: + tr46: 0.0.3 + webidl-conversions: 3.0.1 + /which-boxed-primitive/1.0.2: resolution: {integrity: sha512-bwZdv0AKLpplFY2KZRX6TvyuN7ojjr7lwkg6ml0roIy9YeuSr7JS372qlNW18UQYzgYK9ziGcerWqZOmEn9VNg==} dependencies: @@ -8458,7 +9083,11 @@ packages: hasBin: true dependencies: isexe: 2.0.0 - dev: true + + /wide-align/1.1.5: + resolution: {integrity: sha512-eDMORYaPNZ4sQIuuYPDHdQvf4gyCF9rEEV/yPxGfwPkRodwEgiMUUXTx/dex+Me0wxx53S+NgUHaP7y3MGlDmg==} + dependencies: + string-width: 4.2.3 /wkx/0.5.0: resolution: {integrity: sha512-Xng/d4Ichh8uN4l0FToV/258EjMGU9MGcA0HV2d9B/ZpZB3lqQm7nkOdZdm5GhKtLLhAE7PiVQwN4eN+2YJJUg==} @@ -8590,6 +9219,19 @@ packages: engines: {node: '>=12'} dev: true + /yargs/16.2.0: + resolution: {integrity: sha512-D1mvvtDG0L5ft/jGWkLpG1+m0eQxOfaBvTNELraWj22wSVUMWxZUvYgJYcKh6jGGIkJFhH4IZPQhR4TKpc8mBw==} + engines: {node: '>=10'} + dependencies: + cliui: 7.0.4 + escalade: 3.1.1 + get-caller-file: 2.0.5 + require-directory: 2.1.1 + string-width: 4.2.3 + y18n: 5.0.8 + yargs-parser: 20.2.9 + dev: true + /yargs/17.6.2: resolution: {integrity: sha512-1/9UrdHjDZc0eOU0HxOHoS78C69UD3JRMvzlJ7S79S2nTaWRA/whGCTV8o9e/N/1Va9YIV7Q4sOxD8VV4pCWOw==} engines: {node: '>=12'}