rads-db 0.1.11 → 0.1.13
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/dist/index.cjs +2 -3
- package/dist/index.d.ts +1 -1
- package/dist/index.mjs +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -3,13 +3,12 @@
|
|
|
3
3
|
const zod = require('zod');
|
|
4
4
|
const _ = require('lodash');
|
|
5
5
|
const pluralize = require('pluralize');
|
|
6
|
-
const
|
|
6
|
+
const _radsDb = require('_rads-db');
|
|
7
7
|
|
|
8
8
|
function _interopDefaultCompat (e) { return e && typeof e === 'object' && 'default' in e ? e.default : e; }
|
|
9
9
|
|
|
10
10
|
const ___default = /*#__PURE__*/_interopDefaultCompat(_);
|
|
11
11
|
const pluralize__default = /*#__PURE__*/_interopDefaultCompat(pluralize);
|
|
12
|
-
const schema__default = /*#__PURE__*/_interopDefaultCompat(schema);
|
|
13
12
|
|
|
14
13
|
function generateValidators(schema) {
|
|
15
14
|
const zodSchemas = {};
|
|
@@ -379,7 +378,7 @@ function field(meta) {
|
|
|
379
378
|
|
|
380
379
|
function createRads(args) {
|
|
381
380
|
args = { ...args };
|
|
382
|
-
const s = args.schema ||
|
|
381
|
+
const s = args.schema || _radsDb.schema;
|
|
383
382
|
const validators = generateValidators(s);
|
|
384
383
|
return generateMethods(s, validators, args);
|
|
385
384
|
}
|
package/dist/index.d.ts
CHANGED
|
@@ -110,7 +110,7 @@ interface GenerateClientNormalizedOptions {
|
|
|
110
110
|
declare function entity(meta?: EntityDecoratorArgs): (classConstructor: Function, _ctx?: ClassDecoratorContext<any>) => void;
|
|
111
111
|
declare function field(meta?: FieldDecoratorArgs): (a: any, b?: ClassFieldDecoratorContext) => void;
|
|
112
112
|
|
|
113
|
-
declare function createRads(args?: CreateRadsArgs):
|
|
113
|
+
declare function createRads(args?: CreateRadsArgs): RadsDb;
|
|
114
114
|
declare function getRestRoutes(db: RadsDb, prefix?: string): Record<string, Record<string, Function>>;
|
|
115
115
|
|
|
116
116
|
export { CreateRadsArgs, Driver, DriverOptions, EntityDecoratorArgs, EntityMethods, FieldDecoratorArgs, FieldDefinition, GenerateClientNormalizedOptions, GenerateClientOptions, GetArgs, GetArgsAny, GetArgsInclude, GetManyArgs, GetManyArgsAny, GetManyResponse, GetResponse, GetResponseInclude, GetResponseIncludeSelect, GetResponseNoInclude, MemoryDriverOptions, MinimalDriver, PutArgs, RestDriverOptions, Schema, SchemaValidators, TypeDefinition, createRads, entity, field, getRestRoutes };
|
package/dist/index.mjs
CHANGED