modelence 0.8.0 → 0.9.0
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/bin/modelence.js +1 -1
- package/dist/{chunk-3YAV3UUU.js → chunk-YOLALUSB.js} +3 -3
- package/dist/{chunk-3YAV3UUU.js.map → chunk-YOLALUSB.js.map} +1 -1
- package/dist/client.d.ts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/{package-3YQBVIVQ.js → package-FGEKA4ES.js} +2 -2
- package/dist/{package-3YQBVIVQ.js.map → package-FGEKA4ES.js.map} +1 -1
- package/dist/server.d.ts +9 -23
- package/dist/server.js +7 -7
- package/dist/server.js.map +1 -1
- package/dist/{types-Ds1ESQSs.d.ts → types-BOFsm7A2.d.ts} +50 -1
- package/dist/{types-WgRbQ-tj.d.ts → types-SXHKNPNY.d.ts} +3 -39
- package/dist/types.d.ts +3 -3
- package/package.json +1 -1
|
@@ -39,6 +39,55 @@ type RoleDefinition = {
|
|
|
39
39
|
description?: string;
|
|
40
40
|
permissions: Permission[];
|
|
41
41
|
};
|
|
42
|
+
type AuthProvider = 'google' | 'github' | 'email';
|
|
43
|
+
type AuthSuccessProps = {
|
|
44
|
+
provider: AuthProvider;
|
|
45
|
+
user: User;
|
|
46
|
+
session: Session | null;
|
|
47
|
+
connectionInfo: ConnectionInfo;
|
|
48
|
+
};
|
|
49
|
+
type AuthErrorProps = {
|
|
50
|
+
provider: AuthProvider;
|
|
51
|
+
error: Error;
|
|
52
|
+
session: Session | null;
|
|
53
|
+
connectionInfo: ConnectionInfo;
|
|
54
|
+
};
|
|
55
|
+
|
|
56
|
+
type ClientInfo = {
|
|
57
|
+
screenWidth: number;
|
|
58
|
+
screenHeight: number;
|
|
59
|
+
windowWidth: number;
|
|
60
|
+
windowHeight: number;
|
|
61
|
+
pixelRatio: number;
|
|
62
|
+
orientation: string | null;
|
|
63
|
+
};
|
|
64
|
+
type ConnectionInfo = {
|
|
65
|
+
ip?: string;
|
|
66
|
+
userAgent?: string;
|
|
67
|
+
acceptLanguage?: string;
|
|
68
|
+
referrer?: string;
|
|
69
|
+
baseUrl?: string;
|
|
70
|
+
};
|
|
71
|
+
type Context = {
|
|
72
|
+
session: Session | null;
|
|
73
|
+
user: UserInfo | null;
|
|
74
|
+
roles: string[];
|
|
75
|
+
clientInfo: ClientInfo;
|
|
76
|
+
connectionInfo: ConnectionInfo;
|
|
77
|
+
};
|
|
78
|
+
type Args = Record<string, unknown>;
|
|
79
|
+
type Handler<T = unknown> = (args: Args, context: Context) => Promise<T> | T;
|
|
80
|
+
type MethodType = 'query' | 'mutation';
|
|
81
|
+
type MethodDefinition<T = unknown> = {
|
|
82
|
+
permissions?: Permission[];
|
|
83
|
+
handler: Handler<T>;
|
|
84
|
+
} | Handler<T>;
|
|
85
|
+
type Method<T = unknown> = {
|
|
86
|
+
type: MethodType;
|
|
87
|
+
name: string;
|
|
88
|
+
permissions: Permission[];
|
|
89
|
+
handler: Handler<T>;
|
|
90
|
+
};
|
|
42
91
|
|
|
43
92
|
type canAccessChannel = (props: {
|
|
44
93
|
user: User | null;
|
|
@@ -103,4 +152,4 @@ interface WebsocketClientProvider {
|
|
|
103
152
|
}): void;
|
|
104
153
|
}
|
|
105
154
|
|
|
106
|
-
export { type
|
|
155
|
+
export { type AuthSuccessProps as A, type ConfigSchema as C, type DefaultRoles as D, type Handler as H, type MethodDefinition as M, type Permission as P, type RoleDefinition as R, ServerChannel as S, type User as U, type WebsocketServerProvider as W, type WebsocketClientProvider as a, type ConfigKey as b, ClientChannel as c, type AuthErrorProps as d, type AppConfig as e, type Session as f, type UserInfo as g, type Role as h, type Context as i, type ClientInfo as j, type ConnectionInfo as k, type Args as l, type MethodType as m, type Method as n, type ConfigType as o, type Configs as p, type AuthProvider as q };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import './index-CwdohC5n.js';
|
|
2
|
-
import {
|
|
2
|
+
import { i as Context } from './types-BOFsm7A2.js';
|
|
3
3
|
import * as mongodb from 'mongodb';
|
|
4
4
|
import { WithId, IndexDescription, SearchIndexDescription, MongoClient, Collection, FilterOperators, Document, FindOptions, ObjectId, OptionalUnlessRequiredId, InsertOneResult, InsertManyResult, UpdateFilter, UpdateResult, ClientSession, DeleteResult, AggregateOptions, AggregationCursor, AnyBulkWriteOperation, BulkWriteResult } from 'mongodb';
|
|
5
5
|
import { z, ZodNumber, ZodArray } from 'zod';
|
|
@@ -30,42 +30,6 @@ interface EmailProvider {
|
|
|
30
30
|
sendEmail(data: EmailPayload): Promise<void>;
|
|
31
31
|
}
|
|
32
32
|
|
|
33
|
-
type ClientInfo = {
|
|
34
|
-
screenWidth: number;
|
|
35
|
-
screenHeight: number;
|
|
36
|
-
windowWidth: number;
|
|
37
|
-
windowHeight: number;
|
|
38
|
-
pixelRatio: number;
|
|
39
|
-
orientation: string | null;
|
|
40
|
-
};
|
|
41
|
-
type ConnectionInfo = {
|
|
42
|
-
ip?: string;
|
|
43
|
-
userAgent?: string;
|
|
44
|
-
acceptLanguage?: string;
|
|
45
|
-
referrer?: string;
|
|
46
|
-
baseUrl?: string;
|
|
47
|
-
};
|
|
48
|
-
type Context = {
|
|
49
|
-
session: Session | null;
|
|
50
|
-
user: UserInfo | null;
|
|
51
|
-
roles: string[];
|
|
52
|
-
clientInfo: ClientInfo;
|
|
53
|
-
connectionInfo: ConnectionInfo;
|
|
54
|
-
};
|
|
55
|
-
type Args = Record<string, unknown>;
|
|
56
|
-
type Handler<T = unknown> = (args: Args, context: Context) => Promise<T> | T;
|
|
57
|
-
type MethodType = 'query' | 'mutation';
|
|
58
|
-
type MethodDefinition<T = unknown> = {
|
|
59
|
-
permissions?: Permission[];
|
|
60
|
-
handler: Handler<T>;
|
|
61
|
-
} | Handler<T>;
|
|
62
|
-
type Method<T = unknown> = {
|
|
63
|
-
type: MethodType;
|
|
64
|
-
name: string;
|
|
65
|
-
permissions: Permission[];
|
|
66
|
-
handler: Handler<T>;
|
|
67
|
-
};
|
|
68
|
-
|
|
69
33
|
type RateLimitType = 'ip' | 'user';
|
|
70
34
|
type RateLimitRule = {
|
|
71
35
|
/** Logical action being limited, e.g. "signup" */
|
|
@@ -201,7 +165,7 @@ type StrictRootFilterOperators<TSchema> = {
|
|
|
201
165
|
type TypedFilter<T> = {
|
|
202
166
|
[K in keyof WithId<T>]?: WithId<T>[K] | FilterOperators<WithId<T>[K]>;
|
|
203
167
|
} & StrictRootFilterOperators<T> & {
|
|
204
|
-
[K:
|
|
168
|
+
[K: `${string}.${string}`]: any;
|
|
205
169
|
};
|
|
206
170
|
/**
|
|
207
171
|
* Helper type to preserve method types when extending a store.
|
|
@@ -642,4 +606,4 @@ type RouteDefinition = {
|
|
|
642
606
|
};
|
|
643
607
|
type ExpressHandler = (req: Request, res: Response) => Promise<void> | void;
|
|
644
608
|
|
|
645
|
-
export { type
|
|
609
|
+
export { type BodyConfig as B, type CronJobInputParams as C, type EmailProvider as E, type HttpMethod as H, type InferDocumentType as I, type ModelSchema as M, type RouteDefinition as R, Store as S, type RateLimitRule as a, type RateLimitType as b, type EmailPayload as c, type RouteHandler as d, type RouteParams as e, type RouteResponse as f, type EmailAttachment as g, type CronJob as h, type CronJobMetadata as i, type RouteHandlers as j, type ExpressHandler as k, schema as s };
|
package/dist/types.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export { A as AppServer, E as ExpressMiddleware, M as ModelenceConfig } from './index-CwdohC5n.js';
|
|
2
|
-
export {
|
|
3
|
-
export {
|
|
2
|
+
export { e as AppConfig, l as Args, d as AuthErrorProps, q as AuthProvider, A as AuthSuccessProps, j as ClientInfo, b as ConfigKey, C as ConfigSchema, o as ConfigType, p as Configs, k as ConnectionInfo, i as Context, D as DefaultRoles, H as Handler, n as Method, M as MethodDefinition, m as MethodType, P as Permission, h as Role, R as RoleDefinition, f as Session, U as User, g as UserInfo, a as WebsocketClientProvider, W as WebsocketServerProvider } from './types-BOFsm7A2.js';
|
|
3
|
+
export { B as BodyConfig, h as CronJob, C as CronJobInputParams, i as CronJobMetadata, g as EmailAttachment, c as EmailPayload, E as EmailProvider, k as ExpressHandler, H as HttpMethod, I as InferDocumentType, M as ModelSchema, a as RateLimitRule, b as RateLimitType, R as RouteDefinition, d as RouteHandler, j as RouteHandlers, e as RouteParams, f as RouteResponse, s as schema } from './types-SXHKNPNY.js';
|
|
4
4
|
import 'express';
|
|
5
|
+
import 'http';
|
|
5
6
|
import 'mongodb';
|
|
6
7
|
import 'zod';
|
|
7
|
-
import 'http';
|