@webiny/db 0.0.0-ee-vpcs.549378cf03
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/LICENSE +21 -0
- package/README.md +20 -0
- package/index.d.ts +77 -0
- package/index.js +207 -0
- package/index.js.map +1 -0
- package/package.json +28 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) Webiny
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
# @webiny/db
|
|
2
|
+
[](https://www.npmjs.com/package/webiny-data)
|
|
3
|
+
[](https://www.npmjs.com/package/webiny-data)
|
|
4
|
+
[](https://github.com/prettier/prettier)
|
|
5
|
+
[](http://makeapullrequest.com)
|
|
6
|
+
|
|
7
|
+
A set of frequently used data higher order functions.
|
|
8
|
+
|
|
9
|
+
For more information, please visit
|
|
10
|
+
[the official docs](https://github.com/doitadrian/data).
|
|
11
|
+
|
|
12
|
+
## Install
|
|
13
|
+
```
|
|
14
|
+
npm install --save @webiny/db
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
Or if you prefer yarn:
|
|
18
|
+
```
|
|
19
|
+
yarn add @webiny/db
|
|
20
|
+
```
|
package/index.d.ts
ADDED
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* TODO Remove when moved all packages to standalone storage opts.
|
|
3
|
+
*/
|
|
4
|
+
interface KeyField {
|
|
5
|
+
name: string;
|
|
6
|
+
}
|
|
7
|
+
export interface Key {
|
|
8
|
+
primary?: boolean;
|
|
9
|
+
unique?: boolean;
|
|
10
|
+
name: string;
|
|
11
|
+
fields: KeyField[];
|
|
12
|
+
}
|
|
13
|
+
export interface ArgsBatch {
|
|
14
|
+
instance: Batch;
|
|
15
|
+
operation: Operation;
|
|
16
|
+
}
|
|
17
|
+
export interface Args {
|
|
18
|
+
__batch?: ArgsBatch;
|
|
19
|
+
table?: string;
|
|
20
|
+
meta?: boolean;
|
|
21
|
+
limit?: number;
|
|
22
|
+
sort?: Record<string, 1 | -1>;
|
|
23
|
+
data?: Record<string, any>;
|
|
24
|
+
query?: Record<string, any>;
|
|
25
|
+
keys?: Key[];
|
|
26
|
+
}
|
|
27
|
+
export declare type Result<T = any> = [T, Record<string, any>];
|
|
28
|
+
export interface DbDriver {
|
|
29
|
+
create: (args: Args) => Promise<Result<true>>;
|
|
30
|
+
read: <T = Record<string, any>>(args: Args) => Promise<Result<T[]>>;
|
|
31
|
+
update: (args: Args) => Promise<Result<true>>;
|
|
32
|
+
delete: (args: Args) => Promise<Result<true>>;
|
|
33
|
+
createLog: (args: {
|
|
34
|
+
operation: string;
|
|
35
|
+
data: Args;
|
|
36
|
+
table: string;
|
|
37
|
+
id: string;
|
|
38
|
+
}) => Promise<Result<true>>;
|
|
39
|
+
readLogs: <T = Record<string, any>>(args: {
|
|
40
|
+
table: string;
|
|
41
|
+
}) => Promise<Result<T[]>>;
|
|
42
|
+
}
|
|
43
|
+
export declare type OperationType = "create" | "read" | "update" | "delete";
|
|
44
|
+
export declare type Operation = [OperationType, Args];
|
|
45
|
+
export declare type ConstructorArgs = {
|
|
46
|
+
driver: DbDriver;
|
|
47
|
+
table?: string;
|
|
48
|
+
logTable?: string;
|
|
49
|
+
};
|
|
50
|
+
declare class Db {
|
|
51
|
+
driver: DbDriver;
|
|
52
|
+
table: string;
|
|
53
|
+
logTable?: string;
|
|
54
|
+
constructor({ driver, table, logTable }: ConstructorArgs);
|
|
55
|
+
create(args: Args): Promise<Result<true>>;
|
|
56
|
+
read<T = Record<string, any>>(args: Args): Promise<Result<T[]>>;
|
|
57
|
+
update(args: Args): Promise<Result<true>>;
|
|
58
|
+
delete(args: Args): Promise<Result<true>>;
|
|
59
|
+
createLog(operation: string, args: Args): Promise<Result<true> | null>;
|
|
60
|
+
readLogs<T = Record<string, any>>(): Promise<Result<T[]> | null>;
|
|
61
|
+
batch<T0 = any, T1 = any, T2 = any, T3 = any, T4 = any, T5 = any, T6 = any, T7 = any, T8 = any, T9 = any>(): Batch;
|
|
62
|
+
}
|
|
63
|
+
declare class Batch<T0 = any, T1 = any, T2 = any, T3 = any, T4 = any, T5 = any, T6 = any, T7 = any, T8 = any, T9 = any> {
|
|
64
|
+
db: Db;
|
|
65
|
+
type: "batch" | "transaction";
|
|
66
|
+
id: string;
|
|
67
|
+
meta: Record<string, any>;
|
|
68
|
+
operations: Operation[];
|
|
69
|
+
constructor(db: Db);
|
|
70
|
+
push(...operations: Operation[]): this;
|
|
71
|
+
create(...args: Args[]): this;
|
|
72
|
+
read(...args: Args[]): this;
|
|
73
|
+
update(...args: Args[]): this;
|
|
74
|
+
delete(...args: Args[]): this;
|
|
75
|
+
execute(): Promise<[T0?, T1?, T2?, T3?, T4?, T5?, T6?, T7?, T8?, T9?]>;
|
|
76
|
+
}
|
|
77
|
+
export { Batch, Db };
|
package/index.js
ADDED
|
@@ -0,0 +1,207 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
|
+
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
exports.Db = exports.Batch = void 0;
|
|
9
|
+
|
|
10
|
+
var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/objectSpread2"));
|
|
11
|
+
|
|
12
|
+
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* TODO Remove when moved all packages to standalone storage opts.
|
|
16
|
+
*/
|
|
17
|
+
// Generates a short and sortable ID, e.g. "1607677774994.tfz58m".
|
|
18
|
+
const shortId = () => {
|
|
19
|
+
const time = new Date().getTime();
|
|
20
|
+
const uniqueId = Math.random().toString(36).slice(-6);
|
|
21
|
+
return `${time}.${uniqueId}`;
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
// Picks necessary data from received args, ready to be stored in the log table.
|
|
25
|
+
const getCreateLogData = args => {
|
|
26
|
+
const {
|
|
27
|
+
table,
|
|
28
|
+
meta,
|
|
29
|
+
limit,
|
|
30
|
+
sort,
|
|
31
|
+
data,
|
|
32
|
+
query,
|
|
33
|
+
keys
|
|
34
|
+
} = args;
|
|
35
|
+
return {
|
|
36
|
+
table,
|
|
37
|
+
meta,
|
|
38
|
+
limit,
|
|
39
|
+
sort,
|
|
40
|
+
data,
|
|
41
|
+
query,
|
|
42
|
+
keys,
|
|
43
|
+
batch: args.__batch ? {
|
|
44
|
+
id: args.__batch.instance.id,
|
|
45
|
+
type: args.__batch.instance.type
|
|
46
|
+
} : null
|
|
47
|
+
};
|
|
48
|
+
};
|
|
49
|
+
|
|
50
|
+
class Db {
|
|
51
|
+
constructor({
|
|
52
|
+
driver,
|
|
53
|
+
table,
|
|
54
|
+
logTable
|
|
55
|
+
}) {
|
|
56
|
+
(0, _defineProperty2.default)(this, "driver", void 0);
|
|
57
|
+
(0, _defineProperty2.default)(this, "table", void 0);
|
|
58
|
+
(0, _defineProperty2.default)(this, "logTable", void 0);
|
|
59
|
+
this.driver = driver; // @ts-ignore
|
|
60
|
+
|
|
61
|
+
this.table = table;
|
|
62
|
+
this.logTable = logTable;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
async create(args) {
|
|
66
|
+
const createArgs = (0, _objectSpread2.default)((0, _objectSpread2.default)({}, args), {}, {
|
|
67
|
+
table: args.table || this.table
|
|
68
|
+
});
|
|
69
|
+
await this.createLog("create", createArgs);
|
|
70
|
+
return this.driver.create(createArgs);
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
async read(args) {
|
|
74
|
+
const readArgs = (0, _objectSpread2.default)((0, _objectSpread2.default)({}, args), {}, {
|
|
75
|
+
table: args.table || this.table
|
|
76
|
+
});
|
|
77
|
+
await this.createLog("read", readArgs);
|
|
78
|
+
return this.driver.read(readArgs);
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
async update(args) {
|
|
82
|
+
const updateArgs = (0, _objectSpread2.default)((0, _objectSpread2.default)({}, args), {}, {
|
|
83
|
+
table: args.table || this.table
|
|
84
|
+
});
|
|
85
|
+
await this.createLog("update", updateArgs);
|
|
86
|
+
return this.driver.update(updateArgs);
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
async delete(args) {
|
|
90
|
+
const deleteArgs = (0, _objectSpread2.default)((0, _objectSpread2.default)({}, args), {}, {
|
|
91
|
+
table: args.table || this.table
|
|
92
|
+
});
|
|
93
|
+
await this.createLog("delete", deleteArgs);
|
|
94
|
+
return this.driver.delete(deleteArgs);
|
|
95
|
+
} // Logging functions.
|
|
96
|
+
|
|
97
|
+
|
|
98
|
+
async createLog(operation, args) {
|
|
99
|
+
if (!this.logTable) {
|
|
100
|
+
return null;
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
const data = getCreateLogData(args);
|
|
104
|
+
return this.driver.createLog({
|
|
105
|
+
operation,
|
|
106
|
+
data,
|
|
107
|
+
table: this.logTable,
|
|
108
|
+
id: shortId()
|
|
109
|
+
});
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
async readLogs() {
|
|
113
|
+
if (!this.logTable) {
|
|
114
|
+
return null;
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
return this.driver.readLogs({
|
|
118
|
+
table: this.logTable
|
|
119
|
+
});
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
batch() {
|
|
123
|
+
return new Batch(this);
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
exports.Db = Db;
|
|
129
|
+
|
|
130
|
+
class Batch {
|
|
131
|
+
constructor(db) {
|
|
132
|
+
(0, _defineProperty2.default)(this, "db", void 0);
|
|
133
|
+
(0, _defineProperty2.default)(this, "type", void 0);
|
|
134
|
+
(0, _defineProperty2.default)(this, "id", void 0);
|
|
135
|
+
(0, _defineProperty2.default)(this, "meta", void 0);
|
|
136
|
+
(0, _defineProperty2.default)(this, "operations", void 0);
|
|
137
|
+
this.db = db;
|
|
138
|
+
this.type = "batch";
|
|
139
|
+
this.id = shortId();
|
|
140
|
+
this.meta = {};
|
|
141
|
+
this.operations = [];
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
push(...operations) {
|
|
145
|
+
for (let i = 0; i < operations.length; i++) {
|
|
146
|
+
const item = operations[i];
|
|
147
|
+
this.operations.push(item);
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
return this;
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
create(...args) {
|
|
154
|
+
for (let i = 0; i < args.length; i++) {
|
|
155
|
+
this.push(["create", args[i]]);
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
return this;
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
read(...args) {
|
|
162
|
+
for (let i = 0; i < args.length; i++) {
|
|
163
|
+
this.push(["read", args[i]]);
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
return this;
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
update(...args) {
|
|
170
|
+
for (let i = 0; i < args.length; i++) {
|
|
171
|
+
this.push(["update", args[i]]);
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
return this;
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
delete(...args) {
|
|
178
|
+
for (let i = 0; i < args.length; i++) {
|
|
179
|
+
this.push(["delete", args[i]]);
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
return this;
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
async execute() {
|
|
186
|
+
/**
|
|
187
|
+
* TODO: figure out which exact type to use instead of any.
|
|
188
|
+
*/
|
|
189
|
+
const promises = [];
|
|
190
|
+
|
|
191
|
+
for (let i = 0; i < this.operations.length; i++) {
|
|
192
|
+
const [operation, args] = this.operations[i];
|
|
193
|
+
promises.push(this.db[operation]((0, _objectSpread2.default)((0, _objectSpread2.default)({}, args), {}, {
|
|
194
|
+
__batch: {
|
|
195
|
+
instance: this,
|
|
196
|
+
operation: this.operations[i]
|
|
197
|
+
}
|
|
198
|
+
})));
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
const result = Promise.all(promises);
|
|
202
|
+
return result;
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
exports.Batch = Batch;
|
package/index.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["shortId","time","Date","getTime","uniqueId","Math","random","toString","slice","getCreateLogData","args","table","meta","limit","sort","data","query","keys","batch","__batch","id","instance","type","Db","constructor","driver","logTable","create","createArgs","createLog","read","readArgs","update","updateArgs","delete","deleteArgs","operation","readLogs","Batch","db","operations","push","i","length","item","execute","promises","result","Promise","all"],"sources":["index.ts"],"sourcesContent":["/**\n * TODO Remove when moved all packages to standalone storage opts.\n */\ninterface KeyField {\n name: string;\n}\n\nexport interface Key {\n primary?: boolean;\n unique?: boolean;\n name: string;\n fields: KeyField[];\n}\n\nexport interface ArgsBatch {\n instance: Batch;\n operation: Operation;\n}\nexport interface Args {\n __batch?: ArgsBatch;\n table?: string;\n meta?: boolean;\n limit?: number;\n sort?: Record<string, 1 | -1>;\n data?: Record<string, any>;\n query?: Record<string, any>;\n keys?: Key[];\n}\n\nexport type Result<T = any> = [T, Record<string, any>];\n\nexport interface DbDriver {\n create: (args: Args) => Promise<Result<true>>;\n read: <T = Record<string, any>>(args: Args) => Promise<Result<T[]>>;\n update: (args: Args) => Promise<Result<true>>;\n delete: (args: Args) => Promise<Result<true>>;\n\n // Logging functions.\n createLog: (args: {\n operation: string;\n data: Args;\n table: string;\n id: string;\n }) => Promise<Result<true>>;\n readLogs: <T = Record<string, any>>(args: { table: string }) => Promise<Result<T[]>>;\n}\n\nexport type OperationType = \"create\" | \"read\" | \"update\" | \"delete\";\nexport type Operation = [OperationType, Args];\n\nexport type ConstructorArgs = {\n driver: DbDriver;\n table?: string;\n logTable?: string;\n};\n\n// Generates a short and sortable ID, e.g. \"1607677774994.tfz58m\".\nconst shortId = () => {\n const time = new Date().getTime();\n const uniqueId = Math.random().toString(36).slice(-6);\n\n return `${time}.${uniqueId}`;\n};\n\ninterface LogDataBatch {\n id: string;\n type: string;\n}\ninterface LogData\n extends Pick<Args, \"table\" | \"meta\" | \"limit\" | \"sort\" | \"data\" | \"query\" | \"keys\"> {\n batch: LogDataBatch | null;\n}\n\n// Picks necessary data from received args, ready to be stored in the log table.\nconst getCreateLogData = (args: Args): LogData => {\n const { table, meta, limit, sort, data, query, keys } = args;\n\n return {\n table,\n meta,\n limit,\n sort,\n data,\n query,\n keys,\n batch: args.__batch\n ? {\n id: args.__batch.instance.id,\n type: args.__batch.instance.type\n }\n : null\n };\n};\n\nclass Db {\n public driver: DbDriver;\n public table: string;\n public logTable?: string;\n\n constructor({ driver, table, logTable }: ConstructorArgs) {\n this.driver = driver;\n // @ts-ignore\n this.table = table;\n this.logTable = logTable;\n }\n\n public async create(args: Args): Promise<Result<true>> {\n const createArgs = { ...args, table: args.table || this.table };\n await this.createLog(\"create\", createArgs);\n return this.driver.create(createArgs);\n }\n\n public async read<T = Record<string, any>>(args: Args): Promise<Result<T[]>> {\n const readArgs = { ...args, table: args.table || this.table };\n await this.createLog(\"read\", readArgs);\n return this.driver.read(readArgs);\n }\n\n public async update(args: Args): Promise<Result<true>> {\n const updateArgs = { ...args, table: args.table || this.table };\n await this.createLog(\"update\", updateArgs);\n return this.driver.update(updateArgs);\n }\n\n public async delete(args: Args): Promise<Result<true>> {\n const deleteArgs = { ...args, table: args.table || this.table };\n await this.createLog(\"delete\", deleteArgs);\n return this.driver.delete(deleteArgs);\n }\n\n // Logging functions.\n public async createLog(operation: string, args: Args): Promise<Result<true> | null> {\n if (!this.logTable) {\n return null;\n }\n\n const data = getCreateLogData(args);\n return this.driver.createLog({ operation, data, table: this.logTable, id: shortId() });\n }\n\n public async readLogs<T = Record<string, any>>(): Promise<Result<T[]> | null> {\n if (!this.logTable) {\n return null;\n }\n\n return this.driver.readLogs({\n table: this.logTable\n });\n }\n\n public batch<\n T0 = any,\n T1 = any,\n T2 = any,\n T3 = any,\n T4 = any,\n T5 = any,\n T6 = any,\n T7 = any,\n T8 = any,\n T9 = any\n >(): Batch {\n return new Batch<T0, T1, T2, T3, T4, T5, T6, T7, T8, T9>(this);\n }\n}\n\nclass Batch<\n T0 = any,\n T1 = any,\n T2 = any,\n T3 = any,\n T4 = any,\n T5 = any,\n T6 = any,\n T7 = any,\n T8 = any,\n T9 = any\n> {\n db: Db;\n type: \"batch\" | \"transaction\";\n id: string;\n meta: Record<string, any>;\n operations: Operation[];\n\n constructor(db: Db) {\n this.db = db;\n this.type = \"batch\";\n this.id = shortId();\n\n this.meta = {};\n this.operations = [];\n }\n\n push(...operations: Operation[]) {\n for (let i = 0; i < operations.length; i++) {\n const item = operations[i];\n this.operations.push(item);\n }\n return this;\n }\n\n create(...args: Args[]) {\n for (let i = 0; i < args.length; i++) {\n this.push([\"create\", args[i]]);\n }\n return this;\n }\n\n read(...args: Args[]) {\n for (let i = 0; i < args.length; i++) {\n this.push([\"read\", args[i]]);\n }\n return this;\n }\n\n update(...args: Args[]) {\n for (let i = 0; i < args.length; i++) {\n this.push([\"update\", args[i]]);\n }\n return this;\n }\n\n delete(...args: Args[]) {\n for (let i = 0; i < args.length; i++) {\n this.push([\"delete\", args[i]]);\n }\n return this;\n }\n\n async execute(): Promise<[T0?, T1?, T2?, T3?, T4?, T5?, T6?, T7?, T8?, T9?]> {\n /**\n * TODO: figure out which exact type to use instead of any.\n */\n const promises: Promise<any>[] = [];\n for (let i = 0; i < this.operations.length; i++) {\n const [operation, args] = this.operations[i];\n promises.push(\n this.db[operation]({\n ...args,\n __batch: {\n instance: this,\n operation: this.operations[i]\n }\n })\n );\n }\n\n const result = Promise.all(promises);\n\n return result as Promise<[T0?, T1?, T2?, T3?, T4?, T5?, T6?, T7?, T8?, T9?]>;\n }\n}\n\nexport { Batch, Db };\n"],"mappings":";;;;;;;;;;;;;AAAA;AACA;AACA;AAsDA;AACA,MAAMA,OAAO,GAAG,MAAM;EAClB,MAAMC,IAAI,GAAG,IAAIC,IAAJ,GAAWC,OAAX,EAAb;EACA,MAAMC,QAAQ,GAAGC,IAAI,CAACC,MAAL,GAAcC,QAAd,CAAuB,EAAvB,EAA2BC,KAA3B,CAAiC,CAAC,CAAlC,CAAjB;EAEA,OAAQ,GAAEP,IAAK,IAAGG,QAAS,EAA3B;AACH,CALD;;AAgBA;AACA,MAAMK,gBAAgB,GAAIC,IAAD,IAAyB;EAC9C,MAAM;IAAEC,KAAF;IAASC,IAAT;IAAeC,KAAf;IAAsB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AC,GAAG,CAAb,EAAgBA,CAAC,GAAGhC,IAAI,CAACiC,MAAzB,EAAiCD,CAAC,EAAlC,EAAsC;MAClC,KAAKD,IAAL,CAAU,CAAC,QAAD,EAAW/B,IAAI,CAACgC,CAAD,CAAf,CAAV;IACH;;IACD,OAAO,IAAP;EACH;;EAEY,MAAPG,OAAO,GAAgE;IACzE;AACR;AACA;IACQ,MAAMC,QAAwB,GAAG,EAAjC;;IACA,KAAK,IAAIJ,CAAC,GAAG,CAAb,EAAgBA,CAAC,GAAG,KAAKF,UAAL,CAAgBG,MAApC,EAA4CD,CAAC,EAA7C,EAAiD;MAC7C,MAAM,CAACN,SAAD,EAAY1B,IAAZ,IAAoB,KAAK8B,UAAL,CAAgBE,CAAhB,CAA1B;MACAI,QAAQ,CAACL,IAAT,CACI,KAAKF,EAAL,CAAQH,SAAR,8DACO1B,IADP;QAEIS,OAAO,EAAE;UACLE,QAAQ,EAAE,IADL;UAELe,SAAS,EAAE,KAAKI,UAAL,CAAgBE,CAAhB;QAFN;MAFb,GADJ;IASH;;IAED,MAAMK,MAAM,GAAGC,OAAO,CAACC,GAAR,CAAYH,QAAZ,CAAf;IAEA,OAAOC,MAAP;EACH;;AAzEH"}
|
package/package.json
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@webiny/db",
|
|
3
|
+
"version": "0.0.0-ee-vpcs.549378cf03",
|
|
4
|
+
"main": "index.js",
|
|
5
|
+
"repository": {
|
|
6
|
+
"type": "git",
|
|
7
|
+
"url": "https://github.com/webiny/webiny-js.git"
|
|
8
|
+
},
|
|
9
|
+
"description": "A simple multi-database client.",
|
|
10
|
+
"license": "MIT",
|
|
11
|
+
"publishConfig": {
|
|
12
|
+
"access": "public",
|
|
13
|
+
"directory": "dist"
|
|
14
|
+
},
|
|
15
|
+
"devDependencies": {
|
|
16
|
+
"@babel/cli": "^7.19.3",
|
|
17
|
+
"@babel/core": "^7.19.3",
|
|
18
|
+
"@webiny/cli": "^0.0.0-ee-vpcs.549378cf03",
|
|
19
|
+
"@webiny/project-utils": "^0.0.0-ee-vpcs.549378cf03",
|
|
20
|
+
"rimraf": "^3.0.2",
|
|
21
|
+
"typescript": "4.7.4"
|
|
22
|
+
},
|
|
23
|
+
"scripts": {
|
|
24
|
+
"build": "yarn webiny run build",
|
|
25
|
+
"watch": "yarn webiny run watch"
|
|
26
|
+
},
|
|
27
|
+
"gitHead": "549378cf03fcd27845fc3fa23d1dc6b32896f630"
|
|
28
|
+
}
|