orange-orm 4.0.0 → 4.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -217,7 +217,7 @@ The init.ts script resets our SQLite database. It's worth noting that SQLite dat
217
217
 
218
218
  At the start of the script, we import our database mapping from the map.ts file. This gives us access to the db object, which we'll use to interact with our SQLite database.
219
219
 
220
- Then, we define a SQL string. This string outlines the structure of our SQLite database. It first specifies to drop existing tables named 'deliveryAddress', 'orderLine', '_order', and 'customer' if they exist. This ensures we have a clean slate. Then, it dictates how to create these tables anew with the necessary columns and constraints.
220
+ Then, we define a SQL string. This string outlines the structure of our SQLite database. It first specifies to drop existing tables named 'deliveryAddress', 'package', 'orderLine', '_order', and 'customer' if they exist. This ensures we have a clean slate. Then, it dictates how to create these tables anew with the necessary columns and constraints.
221
221
 
222
222
  Because of a peculiarity in SQLite, which only allows one statement execution at a time, we split this SQL string into separate statements. We do this using the split() method, which breaks up the string at every semicolon.
223
223
 
@@ -226,7 +226,7 @@ Because of a peculiarity in SQLite, which only allows one statement execution at
226
226
  import map from './map';
227
227
  const db = map.sqlite('demo.db');
228
228
 
229
- const sql = `DROP TABLE IF EXISTS deliveryAddress; DROP TABLE IF EXISTS orderLine; DROP TABLE IF EXISTS _order; DROP TABLE IF EXISTS customer;
229
+ const sql = `DROP TABLE IF EXISTS deliveryAddress; DROP TABLE IF EXISTS package; DROP TABLE IF EXISTS orderLine; DROP TABLE IF EXISTS _order; DROP TABLE IF EXISTS customer;
230
230
  CREATE TABLE customer (
231
231
  id INTEGER PRIMARY KEY,
232
232
  name TEXT,
package/docs/changelog.md CHANGED
@@ -1,4 +1,6 @@
1
1
  ## Changelog
2
+ __4.0.1_
3
+ Inhouse definitions of ajv to avoid trouble with nestjs.
2
4
  __4.0.0__
3
5
  Changed the behaviour of `update` to accept a `where` filter and only update passed in columns and relations. The previous behaviour of `update` has moved to `replace` method.
4
6
  __3.10.3__
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "orange-orm",
3
- "version": "4.0.0",
3
+ "version": "4.0.1",
4
4
  "main": "./src/index.js",
5
5
  "browser": "./src/client/index.mjs",
6
6
  "bin": {
@@ -118,7 +118,7 @@
118
118
  "pg-query-stream": "^3.3.2",
119
119
  "rollup": "^2.52.7",
120
120
  "sqlite3": "^5.0.2",
121
- "tedious": "^18.1.0",
121
+ "tedious": "^18.2.0",
122
122
  "typescript": "^5.4.5",
123
123
  "vitest": "^0.34.1"
124
124
  },
package/src/ajv.d.ts ADDED
@@ -0,0 +1,47 @@
1
+ export interface Options {
2
+ $data?: boolean;
3
+ allErrors?: boolean;
4
+ verbose?: boolean;
5
+ jsonPointers?: boolean;
6
+ uniqueItems?: boolean;
7
+ unicode?: boolean;
8
+ format?: false | string;
9
+ formats?: object;
10
+ keywords?: object;
11
+ unknownFormats?: true | string[] | 'ignore';
12
+ schemas?: Array<object> | object;
13
+ schemaId?: '$id' | 'id' | 'auto';
14
+ missingRefs?: true | 'ignore' | 'fail';
15
+ extendRefs?: true | 'ignore' | 'fail';
16
+ loadSchema?: (uri: string, cb?: (err: Error, schema: object) => void) => PromiseLike<object | boolean>;
17
+ removeAdditional?: boolean | 'all' | 'failing';
18
+ useDefaults?: boolean | 'empty' | 'shared';
19
+ coerceTypes?: boolean | 'array';
20
+ strictDefaults?: boolean | 'log';
21
+ strictKeywords?: boolean | 'log';
22
+ strictNumbers?: boolean;
23
+ async?: boolean | string;
24
+ transpile?: string | ((code: string) => string);
25
+ meta?: boolean | object;
26
+ validateSchema?: boolean | 'log';
27
+ addUsedSchema?: boolean;
28
+ inlineRefs?: boolean | number;
29
+ passContext?: boolean;
30
+ loopRequired?: number;
31
+ ownProperties?: boolean;
32
+ multipleOfPrecision?: boolean | number;
33
+ errorDataPath?: string,
34
+ messages?: boolean;
35
+ sourceCode?: boolean;
36
+ processCode?: (code: string, schema: object) => string;
37
+ cache?: object;
38
+ logger?: CustomLogger | false;
39
+ nullable?: boolean;
40
+ serialize?: ((schema: object | boolean) => any) | false;
41
+ }
42
+
43
+ export interface CustomLogger {
44
+ log(...args: any[]): any;
45
+ warn(...args: any[]): any;
46
+ error(...args: any[]): any;
47
+ }
@@ -54,10 +54,14 @@ export interface ${Name}Table {
54
54
  getById(${getIdArgs(table)}): Promise<${Name}Row>;
55
55
  getById(${getIdArgs(table)}, fetchingStrategy: ${Name}Strategy): Promise<${Name}Row>;
56
56
 
57
- update(${name}s: ${Name}[]): Promise<${Name}Array>;
58
- update(${name}s: ${Name}[], fetchingStrategy: ${Name}Strategy): Promise<${Name}Array>;
59
- update(${name}: ${Name}): Promise<${Name}Row>;
60
- update(${name}: ${Name}, fetchingStrategy: ${Name}Strategy): Promise<${Name}Row>;
57
+ replace(${name}s: ${Name}[] | ${Name}): Promise<void>;
58
+ replace(${name}s: ${Name}[], fetchingStrategy: ${Name}Strategy): Promise<${Name}Array>;
59
+ replace(${name}: ${Name}, fetchingStrategy: ${Name}Strategy): Promise<${Name}Row>;
60
+
61
+ update(${name}: ${Name}): Promise<void>;
62
+ update(${name}: ${Name}, whereStrategy: ${Name}Strategy): Promise<void>;
63
+ update(${name}: ${Name}, whereStrategy: ${Name}Strategy): Promise<void>;
64
+ update(${name}: ${Name}, whereStrategy: ${Name}Strategy, fetchingStrategy: ${Name}Strategy): Promise<${Name}Row[]>;
61
65
 
62
66
  updateChanges(${name}s: ${Name}[], old${name}s: ${Name}[]): Promise<${Name}Array>;
63
67
  updateChanges(${name}s: ${Name}[],old${name}s: ${Name}[], fetchingStrategy: ${Name}Strategy): Promise<${Name}Array>;
package/src/index.d.ts CHANGED
@@ -1,8 +1,8 @@
1
- import { Options } from 'ajv';
2
- import { RequestHandler } from 'express';
3
- import { ConnectionConfiguration } from 'tedious';
4
- import { PoolAttributes } from 'oracledb';
5
- import { AllowedDbMap, DbMapper, MappedDbDef } from './map';
1
+ import type { Options } from './ajv';
2
+ import type { RequestHandler } from 'express';
3
+ import type { ConnectionConfiguration } from 'tedious';
4
+ import type { PoolAttributes } from 'oracledb';
5
+ import type { AllowedDbMap, DbMapper, MappedDbDef } from './map';
6
6
 
7
7
  declare function r(config: r.Config): unknown;
8
8
 
package/src/map.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import type { Options } from 'ajv';
1
+ import type { Options } from './ajv';
2
2
  import type { ConnectionConfiguration } from 'tedious';
3
3
  import type { PoolAttributes } from 'oracledb';
4
4
  import type { AxiosInterceptorManager, InternalAxiosRequestConfig, AxiosResponse } from 'axios';
@@ -1774,4 +1774,5 @@ type Increment<C extends number> = C extends 0
1774
1774
  ? 4
1775
1775
  : C extends 4
1776
1776
  ? 5
1777
- : 0;
1777
+ : 0;
1778
+