modelence 0.9.0-dev.0 → 0.9.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/dist/bin/modelence.js +3 -57
- package/dist/bin/modelence.js.map +1 -1
- package/dist/chunk-3S2FFBNS.js +2 -0
- package/dist/chunk-3S2FFBNS.js.map +1 -0
- package/dist/chunk-55J6XMHW.js +2 -0
- package/dist/chunk-55J6XMHW.js.map +1 -0
- package/dist/chunk-C3UESBRX.js +2 -0
- package/dist/chunk-C3UESBRX.js.map +1 -0
- package/dist/chunk-DO5TZLF5.js +2 -0
- package/dist/chunk-DO5TZLF5.js.map +1 -0
- package/dist/chunk-EAKMFYSK.js +3 -0
- package/dist/chunk-EAKMFYSK.js.map +1 -0
- package/dist/chunk-PB6WQQ4L.js +3 -0
- package/dist/chunk-PB6WQQ4L.js.map +1 -0
- package/dist/client.d.ts +133 -10
- package/dist/client.js +1 -14
- package/dist/client.js.map +1 -1
- package/dist/index-CwdohC5n.d.ts +15 -0
- package/dist/index.d.ts +31 -6
- package/dist/index.js +1 -2
- package/dist/index.js.map +1 -1
- package/dist/mongo.d.ts +3 -2
- package/dist/mongo.js +1 -2
- package/dist/mongo.js.map +1 -1
- package/dist/package-PESFLDOK.js +2 -0
- package/dist/package-PESFLDOK.js.map +1 -0
- package/dist/server.d.ts +537 -19
- package/dist/server.js +18 -15
- package/dist/server.js.map +1 -1
- package/dist/telemetry.d.ts +11 -2
- package/dist/telemetry.js +1 -1
- package/dist/telemetry.js.map +1 -1
- package/dist/types-BOFsm7A2.d.ts +155 -0
- package/dist/{data/store.d.ts → types-V9eDnP35.d.ts} +234 -15
- package/dist/types.d.ts +7 -10
- package/dist/types.js +1 -1
- package/dist/types.js.map +1 -1
- package/package.json +6 -5
- package/dist/app/authConfig.d.ts +0 -68
- package/dist/app/authConfig.d.ts.map +0 -1
- package/dist/app/authConfig.js +0 -8
- package/dist/app/authConfig.js.map +0 -1
- package/dist/app/backendApi.d.ts +0 -29
- package/dist/app/backendApi.d.ts.map +0 -1
- package/dist/app/backendApi.js +0 -69
- package/dist/app/backendApi.js.map +0 -1
- package/dist/app/email.d.ts +0 -3
- package/dist/app/email.d.ts.map +0 -1
- package/dist/app/email.js +0 -8
- package/dist/app/email.js.map +0 -1
- package/dist/app/emailConfig.d.ts +0 -27
- package/dist/app/emailConfig.d.ts.map +0 -1
- package/dist/app/emailConfig.js +0 -8
- package/dist/app/emailConfig.js.map +0 -1
- package/dist/app/index.d.ts +0 -20
- package/dist/app/index.d.ts.map +0 -1
- package/dist/app/index.js +0 -258
- package/dist/app/index.js.map +0 -1
- package/dist/app/loggerProcess.d.ts +0 -5
- package/dist/app/loggerProcess.d.ts.map +0 -1
- package/dist/app/loggerProcess.js +0 -90
- package/dist/app/loggerProcess.js.map +0 -1
- package/dist/app/metrics.d.ts +0 -6
- package/dist/app/metrics.d.ts.map +0 -1
- package/dist/app/metrics.js +0 -92
- package/dist/app/metrics.js.map +0 -1
- package/dist/app/module.d.ts +0 -77
- package/dist/app/module.d.ts.map +0 -1
- package/dist/app/module.js +0 -46
- package/dist/app/module.js.map +0 -1
- package/dist/app/server.d.ts +0 -37
- package/dist/app/server.d.ts.map +0 -1
- package/dist/app/server.js +0 -198
- package/dist/app/server.js.map +0 -1
- package/dist/app/state.d.ts +0 -19
- package/dist/app/state.d.ts.map +0 -1
- package/dist/app/state.js +0 -27
- package/dist/app/state.js.map +0 -1
- package/dist/app/websocketConfig.d.ts +0 -7
- package/dist/app/websocketConfig.d.ts.map +0 -1
- package/dist/app/websocketConfig.js +0 -8
- package/dist/app/websocketConfig.js.map +0 -1
- package/dist/auth/client/index.d.ts +0 -69
- package/dist/auth/client/index.d.ts.map +0 -1
- package/dist/auth/client/index.js +0 -79
- package/dist/auth/client/index.js.map +0 -1
- package/dist/auth/db.d.ts +0 -176
- package/dist/auth/db.d.ts.map +0 -1
- package/dist/auth/db.js +0 -117
- package/dist/auth/db.js.map +0 -1
- package/dist/auth/deleteUser.d.ts +0 -5
- package/dist/auth/deleteUser.d.ts.map +0 -1
- package/dist/auth/deleteUser.js +0 -34
- package/dist/auth/deleteUser.js.map +0 -1
- package/dist/auth/disposableEmails.d.ts +0 -6
- package/dist/auth/disposableEmails.d.ts.map +0 -1
- package/dist/auth/disposableEmails.js +0 -47
- package/dist/auth/disposableEmails.js.map +0 -1
- package/dist/auth/index.d.ts +0 -7
- package/dist/auth/index.d.ts.map +0 -1
- package/dist/auth/index.js +0 -33
- package/dist/auth/index.js.map +0 -1
- package/dist/auth/login.d.ts +0 -9
- package/dist/auth/login.d.ts.map +0 -1
- package/dist/auth/login.js +0 -100
- package/dist/auth/login.js.map +0 -1
- package/dist/auth/password.d.ts +0 -14
- package/dist/auth/password.d.ts.map +0 -1
- package/dist/auth/password.js +0 -26
- package/dist/auth/password.js.map +0 -1
- package/dist/auth/profile.d.ts +0 -10
- package/dist/auth/profile.d.ts.map +0 -1
- package/dist/auth/profile.js +0 -13
- package/dist/auth/profile.js.map +0 -1
- package/dist/auth/providers/github.d.ts +0 -3
- package/dist/auth/providers/github.d.ts.map +0 -1
- package/dist/auth/providers/github.js +0 -122
- package/dist/auth/providers/github.js.map +0 -1
- package/dist/auth/providers/google.d.ts +0 -3
- package/dist/auth/providers/google.d.ts.map +0 -1
- package/dist/auth/providers/google.js +0 -108
- package/dist/auth/providers/google.js.map +0 -1
- package/dist/auth/providers/oauth-common.d.ts +0 -13
- package/dist/auth/providers/oauth-common.d.ts.map +0 -1
- package/dist/auth/providers/oauth-common.js +0 -109
- package/dist/auth/providers/oauth-common.js.map +0 -1
- package/dist/auth/resetPassword.d.ts +0 -10
- package/dist/auth/resetPassword.d.ts.map +0 -1
- package/dist/auth/resetPassword.js +0 -108
- package/dist/auth/resetPassword.js.map +0 -1
- package/dist/auth/role.d.ts +0 -8
- package/dist/auth/role.d.ts.map +0 -1
- package/dist/auth/role.js +0 -37
- package/dist/auth/role.js.map +0 -1
- package/dist/auth/session.d.ts +0 -24
- package/dist/auth/session.d.ts.map +0 -1
- package/dist/auth/session.js +0 -84
- package/dist/auth/session.js.map +0 -1
- package/dist/auth/signup.d.ts +0 -3
- package/dist/auth/signup.d.ts.map +0 -1
- package/dist/auth/signup.js +0 -89
- package/dist/auth/signup.js.map +0 -1
- package/dist/auth/templates/emailVerficationTemplate.d.ts +0 -6
- package/dist/auth/templates/emailVerficationTemplate.d.ts.map +0 -1
- package/dist/auth/templates/emailVerficationTemplate.js +0 -9
- package/dist/auth/templates/emailVerficationTemplate.js.map +0 -1
- package/dist/auth/types.d.ts +0 -22
- package/dist/auth/types.d.ts.map +0 -1
- package/dist/auth/types.js +0 -2
- package/dist/auth/types.js.map +0 -1
- package/dist/auth/user.d.ts +0 -5
- package/dist/auth/user.d.ts.map +0 -1
- package/dist/auth/user.js +0 -152
- package/dist/auth/user.js.map +0 -1
- package/dist/auth/validators.d.ts +0 -3
- package/dist/auth/validators.d.ts.map +0 -1
- package/dist/auth/validators.js +0 -8
- package/dist/auth/validators.js.map +0 -1
- package/dist/auth/verification.d.ts +0 -8
- package/dist/auth/verification.d.ts.map +0 -1
- package/dist/auth/verification.js +0 -94
- package/dist/auth/verification.js.map +0 -1
- package/dist/bin/auth.d.ts +0 -4
- package/dist/bin/auth.d.ts.map +0 -1
- package/dist/bin/auth.js +0 -48
- package/dist/bin/auth.js.map +0 -1
- package/dist/bin/build.d.ts +0 -2
- package/dist/bin/build.d.ts.map +0 -1
- package/dist/bin/build.js +0 -78
- package/dist/bin/build.js.map +0 -1
- package/dist/bin/config.d.ts +0 -11
- package/dist/bin/config.d.ts.map +0 -1
- package/dist/bin/config.js +0 -91
- package/dist/bin/config.js.map +0 -1
- package/dist/bin/deploy.d.ts +0 -6
- package/dist/bin/deploy.d.ts.map +0 -1
- package/dist/bin/deploy.js +0 -129
- package/dist/bin/deploy.js.map +0 -1
- package/dist/bin/dev.d.ts +0 -2
- package/dist/bin/dev.d.ts.map +0 -1
- package/dist/bin/dev.js +0 -14
- package/dist/bin/dev.js.map +0 -1
- package/dist/bin/modelence.d.ts +0 -3
- package/dist/bin/modelence.d.ts.map +0 -1
- package/dist/bin/setup.d.ts +0 -5
- package/dist/bin/setup.d.ts.map +0 -1
- package/dist/bin/setup.js +0 -91
- package/dist/bin/setup.js.map +0 -1
- package/dist/bin/start.d.ts +0 -2
- package/dist/bin/start.d.ts.map +0 -1
- package/dist/bin/start.js +0 -15
- package/dist/bin/start.js.map +0 -1
- package/dist/client/AppProvider.d.ts +0 -8
- package/dist/client/AppProvider.d.ts.map +0 -1
- package/dist/client/AppProvider.js +0 -31
- package/dist/client/AppProvider.js.map +0 -1
- package/dist/client/errorHandler.d.ts +0 -4
- package/dist/client/errorHandler.d.ts.map +0 -1
- package/dist/client/errorHandler.js +0 -10
- package/dist/client/errorHandler.js.map +0 -1
- package/dist/client/localStorage.d.ts +0 -3
- package/dist/client/localStorage.d.ts.map +0 -1
- package/dist/client/localStorage.js +0 -14
- package/dist/client/localStorage.js.map +0 -1
- package/dist/client/method.d.ts +0 -6
- package/dist/client/method.d.ts.map +0 -1
- package/dist/client/method.js +0 -52
- package/dist/client/method.js.map +0 -1
- package/dist/client/renderApp.d.ts +0 -9
- package/dist/client/renderApp.d.ts.map +0 -1
- package/dist/client/renderApp.js +0 -28
- package/dist/client/renderApp.js.map +0 -1
- package/dist/client/session.d.ts +0 -34
- package/dist/client/session.d.ts.map +0 -1
- package/dist/client/session.js +0 -83
- package/dist/client/session.js.map +0 -1
- package/dist/client.d.ts.map +0 -1
- package/dist/config/client.d.ts +0 -10
- package/dist/config/client.d.ts.map +0 -1
- package/dist/config/client.js +0 -14
- package/dist/config/client.js.map +0 -1
- package/dist/config/server.d.ts +0 -48
- package/dist/config/server.d.ts.map +0 -1
- package/dist/config/server.js +0 -85
- package/dist/config/server.js.map +0 -1
- package/dist/config/sync.d.ts +0 -2
- package/dist/config/sync.d.ts.map +0 -1
- package/dist/config/sync.js +0 -32
- package/dist/config/sync.js.map +0 -1
- package/dist/config/types.d.ts +0 -19
- package/dist/config/types.d.ts.map +0 -1
- package/dist/config/types.js +0 -2
- package/dist/config/types.js.map +0 -1
- package/dist/cron/jobs.d.ts +0 -13
- package/dist/cron/jobs.d.ts.map +0 -1
- package/dist/cron/jobs.js +0 -155
- package/dist/cron/jobs.js.map +0 -1
- package/dist/cron/types.d.ts +0 -29
- package/dist/cron/types.d.ts.map +0 -1
- package/dist/cron/types.js +0 -2
- package/dist/cron/types.js.map +0 -1
- package/dist/data/schemaSerializer.d.ts +0 -37
- package/dist/data/schemaSerializer.d.ts.map +0 -1
- package/dist/data/schemaSerializer.js +0 -104
- package/dist/data/schemaSerializer.js.map +0 -1
- package/dist/data/store.d.ts.map +0 -1
- package/dist/data/store.js +0 -501
- package/dist/data/store.js.map +0 -1
- package/dist/data/types.d.ts +0 -47
- package/dist/data/types.d.ts.map +0 -1
- package/dist/data/types.js +0 -35
- package/dist/data/types.js.map +0 -1
- package/dist/db/client.d.ts +0 -5
- package/dist/db/client.d.ts.map +0 -1
- package/dist/db/client.js +0 -41
- package/dist/db/client.js.map +0 -1
- package/dist/error.d.ts +0 -16
- package/dist/error.d.ts.map +0 -1
- package/dist/error.js +0 -24
- package/dist/error.js.map +0 -1
- package/dist/index.d.ts.map +0 -1
- package/dist/lock/db.d.ts +0 -19
- package/dist/lock/db.d.ts.map +0 -1
- package/dist/lock/db.js +0 -28
- package/dist/lock/db.js.map +0 -1
- package/dist/lock/helpers.d.ts +0 -28
- package/dist/lock/helpers.d.ts.map +0 -1
- package/dist/lock/helpers.js +0 -107
- package/dist/lock/helpers.js.map +0 -1
- package/dist/lock/index.d.ts +0 -4
- package/dist/lock/index.d.ts.map +0 -1
- package/dist/lock/index.js +0 -4
- package/dist/lock/index.js.map +0 -1
- package/dist/lock/module.d.ts +0 -7
- package/dist/lock/module.d.ts.map +0 -1
- package/dist/lock/module.js +0 -9
- package/dist/lock/module.js.map +0 -1
- package/dist/methods/index.d.ts +0 -7
- package/dist/methods/index.d.ts.map +0 -1
- package/dist/methods/index.js +0 -65
- package/dist/methods/index.js.map +0 -1
- package/dist/methods/serialize.d.ts +0 -15
- package/dist/methods/serialize.d.ts.map +0 -1
- package/dist/methods/serialize.js +0 -56
- package/dist/methods/serialize.js.map +0 -1
- package/dist/methods/types.d.ts +0 -37
- package/dist/methods/types.d.ts.map +0 -1
- package/dist/methods/types.js +0 -2
- package/dist/methods/types.js.map +0 -1
- package/dist/migration/db.d.ts +0 -17
- package/dist/migration/db.d.ts.map +0 -1
- package/dist/migration/db.js +0 -13
- package/dist/migration/db.js.map +0 -1
- package/dist/migration/index.d.ts +0 -11
- package/dist/migration/index.d.ts.map +0 -1
- package/dist/migration/index.js +0 -85
- package/dist/migration/index.js.map +0 -1
- package/dist/mongo.d.ts.map +0 -1
- package/dist/rate-limit/db.d.ts +0 -29
- package/dist/rate-limit/db.d.ts.map +0 -1
- package/dist/rate-limit/db.js +0 -25
- package/dist/rate-limit/db.js.map +0 -1
- package/dist/rate-limit/index.d.ts +0 -4
- package/dist/rate-limit/index.d.ts.map +0 -1
- package/dist/rate-limit/index.js +0 -6
- package/dist/rate-limit/index.js.map +0 -1
- package/dist/rate-limit/rules.d.ts +0 -22
- package/dist/rate-limit/rules.d.ts.map +0 -1
- package/dist/rate-limit/rules.js +0 -112
- package/dist/rate-limit/rules.js.map +0 -1
- package/dist/rate-limit/types.d.ts +0 -12
- package/dist/rate-limit/types.d.ts.map +0 -1
- package/dist/rate-limit/types.js +0 -2
- package/dist/rate-limit/types.js.map +0 -1
- package/dist/routes/handler.d.ts +0 -4
- package/dist/routes/handler.d.ts.map +0 -1
- package/dist/routes/handler.js +0 -66
- package/dist/routes/handler.js.map +0 -1
- package/dist/routes/types.d.ts +0 -45
- package/dist/routes/types.d.ts.map +0 -1
- package/dist/routes/types.js +0 -2
- package/dist/routes/types.js.map +0 -1
- package/dist/server.d.ts.map +0 -1
- package/dist/system/index.d.ts +0 -4
- package/dist/system/index.d.ts.map +0 -1
- package/dist/system/index.js +0 -21
- package/dist/system/index.js.map +0 -1
- package/dist/telemetry/index.d.ts +0 -11
- package/dist/telemetry/index.d.ts.map +0 -1
- package/dist/telemetry/index.js +0 -79
- package/dist/telemetry/index.js.map +0 -1
- package/dist/telemetry.d.ts.map +0 -1
- package/dist/time.d.ts +0 -8
- package/dist/time.d.ts.map +0 -1
- package/dist/time.js +0 -13
- package/dist/time.js.map +0 -1
- package/dist/types/email.d.ts +0 -25
- package/dist/types/email.d.ts.map +0 -1
- package/dist/types/email.js +0 -2
- package/dist/types/email.js.map +0 -1
- package/dist/types/index.d.ts +0 -14
- package/dist/types/index.d.ts.map +0 -1
- package/dist/types/index.js +0 -2
- package/dist/types/index.js.map +0 -1
- package/dist/types.d.ts.map +0 -1
- package/dist/utils/index.d.ts +0 -4
- package/dist/utils/index.d.ts.map +0 -1
- package/dist/utils/index.js +0 -15
- package/dist/utils/index.js.map +0 -1
- package/dist/viteServer.d.ts +0 -13
- package/dist/viteServer.d.ts.map +0 -1
- package/dist/viteServer.js +0 -132
- package/dist/viteServer.js.map +0 -1
- package/dist/websocket/client.d.ts +0 -9
- package/dist/websocket/client.d.ts.map +0 -1
- package/dist/websocket/client.js +0 -16
- package/dist/websocket/client.js.map +0 -1
- package/dist/websocket/clientChannel.d.ts +0 -9
- package/dist/websocket/clientChannel.d.ts.map +0 -1
- package/dist/websocket/clientChannel.js +0 -26
- package/dist/websocket/clientChannel.js.map +0 -1
- package/dist/websocket/serverChannel.d.ts +0 -14
- package/dist/websocket/serverChannel.d.ts.map +0 -1
- package/dist/websocket/serverChannel.js +0 -21
- package/dist/websocket/serverChannel.js.map +0 -1
- package/dist/websocket/socketio/client.d.ts +0 -4
- package/dist/websocket/socketio/client.d.ts.map +0 -1
- package/dist/websocket/socketio/client.js +0 -48
- package/dist/websocket/socketio/client.js.map +0 -1
- package/dist/websocket/socketio/server.d.ts +0 -10
- package/dist/websocket/socketio/server.d.ts.map +0 -1
- package/dist/websocket/socketio/server.js +0 -80
- package/dist/websocket/socketio/server.js.map +0 -1
- package/dist/websocket/types.d.ts +0 -45
- package/dist/websocket/types.d.ts.map +0 -1
- package/dist/websocket/types.js +0 -2
- package/dist/websocket/types.js.map +0 -1
package/dist/index.js
CHANGED
|
@@ -1,3 +1,2 @@
|
|
|
1
|
-
export
|
|
2
|
-
export { AuthError, ValidationError, RateLimitError } from './error';
|
|
1
|
+
export{b as AuthError,d as RateLimitError,c as ValidationError}from'./chunk-C3UESBRX.js';export{a as time}from'./chunk-DO5TZLF5.js';import'./chunk-55J6XMHW.js';//# sourceMappingURL=index.js.map
|
|
3
2
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":"","file":"index.js"}
|
package/dist/mongo.d.ts
CHANGED
package/dist/mongo.js
CHANGED
package/dist/mongo.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"sources":["../src/mongo.ts"],"names":["mongo_default"],"mappings":"4CAEA,IAAOA,EAAQ","file":"mongo.js","sourcesContent":["export { ClientSession, ObjectId } from 'mongodb';\n\nexport default {};\n"]}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
export{l as author,i as bin,n as bugs,s as default,q as dependencies,d as description,p as devDependencies,g as exports,h as files,o as homepage,m as license,e as main,b as name,r as peerDependencies,k as repository,j as scripts,a as type,f as types,c as version}from'./chunk-EAKMFYSK.js';//# sourceMappingURL=package-PESFLDOK.js.map
|
|
2
|
+
//# sourceMappingURL=package-PESFLDOK.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":"","file":"package-PESFLDOK.js"}
|
package/dist/server.d.ts
CHANGED
|
@@ -1,20 +1,538 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
export { RouteHandler, RouteParams, RouteResponse,
|
|
1
|
+
import { A as AppServer } from './index-CwdohC5n.js';
|
|
2
|
+
import { M as MethodDefinition, C as ConfigSchema, S as ServerChannel, A as AuthSuccessProps, d as AuthErrorProps, U as User, W as WebsocketServerProvider, R as RoleDefinition, b as ConfigKey, e as AppConfig, f as Session, g as UserInfo, h as Role } from './types-BOFsm7A2.js';
|
|
3
|
+
import { S as Store, R as RouteDefinition, C as CronJobInputParams, a as RateLimitRule, E as EmailProvider, I as InferDocumentType, b as RateLimitType, c as EmailPayload } from './types-V9eDnP35.js';
|
|
4
|
+
export { H as HttpMethod, d as RouteHandler, e as RouteParams, f as RouteResponse, s as schema } from './types-V9eDnP35.js';
|
|
5
|
+
import { ObjectId as ObjectId$1 } from 'mongodb';
|
|
5
6
|
export { ObjectId } from 'mongodb';
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
7
|
+
import * as zod from 'zod';
|
|
8
|
+
import 'express';
|
|
9
|
+
import 'http';
|
|
10
|
+
|
|
11
|
+
/** Array of Store instances that will be provisioned when the module is loaded */
|
|
12
|
+
type Stores = Store<any, any>[];
|
|
13
|
+
/** Record of query methods that can be called from the client */
|
|
14
|
+
type Queries = Record<string, MethodDefinition<any>>;
|
|
15
|
+
/** Record of mutation methods that can be called from the client */
|
|
16
|
+
type Mutations = Record<string, MethodDefinition<any>>;
|
|
17
|
+
/**
|
|
18
|
+
* The Module class is a core building block of a Modelence application that encapsulates related functionality.
|
|
19
|
+
* Modules can contain stores, queries, mutations, routes, cron jobs and configurations.
|
|
20
|
+
*
|
|
21
|
+
* @category Module
|
|
22
|
+
*
|
|
23
|
+
* @example
|
|
24
|
+
* ```ts
|
|
25
|
+
* const todoModule = new Module('todo', {
|
|
26
|
+
* stores: [dbTodos],
|
|
27
|
+
* queries: {
|
|
28
|
+
* async getAll() {
|
|
29
|
+
* // Fetch and return all Todo items
|
|
30
|
+
* }
|
|
31
|
+
* },
|
|
32
|
+
* mutations: {
|
|
33
|
+
* async create({ title }, { user }) {
|
|
34
|
+
* // Create a new Todo item
|
|
35
|
+
* }
|
|
36
|
+
* }
|
|
37
|
+
* });
|
|
38
|
+
* ```
|
|
39
|
+
*/
|
|
40
|
+
declare class Module {
|
|
41
|
+
/** @internal */
|
|
42
|
+
readonly name: string;
|
|
43
|
+
/** @internal */
|
|
44
|
+
readonly stores: Stores;
|
|
45
|
+
/** @internal */
|
|
46
|
+
readonly queries: Queries;
|
|
47
|
+
/** @internal */
|
|
48
|
+
readonly mutations: Mutations;
|
|
49
|
+
/** @internal */
|
|
50
|
+
readonly routes: RouteDefinition[];
|
|
51
|
+
/** @internal */
|
|
52
|
+
readonly cronJobs: Record<string, CronJobInputParams>;
|
|
53
|
+
/** @internal */
|
|
54
|
+
readonly configSchema: ConfigSchema;
|
|
55
|
+
/** @internal */
|
|
56
|
+
readonly rateLimits: RateLimitRule[];
|
|
57
|
+
/** @internal */
|
|
58
|
+
readonly channels: ServerChannel[];
|
|
59
|
+
/**
|
|
60
|
+
* Creates a new Module instance
|
|
61
|
+
*
|
|
62
|
+
* @param name - The unique name of the module.
|
|
63
|
+
* This name is used to namespace queries, mutations,
|
|
64
|
+
* cron jobs and configuration values with a prefix (e.g. "todo.create")
|
|
65
|
+
*
|
|
66
|
+
* @param options - Module configuration options
|
|
67
|
+
*/
|
|
68
|
+
constructor(name: string, { stores, queries, mutations, routes, cronJobs, configSchema, rateLimits, channels, }: {
|
|
69
|
+
stores?: Store<any, any>[];
|
|
70
|
+
queries?: Queries;
|
|
71
|
+
mutations?: Mutations;
|
|
72
|
+
routes?: RouteDefinition[];
|
|
73
|
+
cronJobs?: Record<string, CronJobInputParams>;
|
|
74
|
+
configSchema?: ConfigSchema;
|
|
75
|
+
rateLimits?: RateLimitRule[];
|
|
76
|
+
channels?: ServerChannel[];
|
|
77
|
+
});
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
type MigrationScript = {
|
|
81
|
+
version: number;
|
|
82
|
+
description: string;
|
|
83
|
+
handler: () => Promise<string | void>;
|
|
84
|
+
};
|
|
85
|
+
|
|
86
|
+
type EmailConfig = {
|
|
87
|
+
provider?: EmailProvider;
|
|
88
|
+
from?: string;
|
|
89
|
+
verification?: {
|
|
90
|
+
subject?: string;
|
|
91
|
+
template?: (props: {
|
|
92
|
+
name: string;
|
|
93
|
+
email: string;
|
|
94
|
+
verificationUrl: string;
|
|
95
|
+
}) => string;
|
|
96
|
+
redirectUrl?: string;
|
|
97
|
+
};
|
|
98
|
+
passwordReset?: {
|
|
99
|
+
subject?: string;
|
|
100
|
+
template?: (props: {
|
|
101
|
+
name: string;
|
|
102
|
+
email: string;
|
|
103
|
+
resetUrl: string;
|
|
104
|
+
}) => string;
|
|
105
|
+
redirectUrl?: string;
|
|
106
|
+
};
|
|
107
|
+
emailVerifiedRedirectUrl?: string;
|
|
108
|
+
};
|
|
109
|
+
|
|
110
|
+
/**
|
|
111
|
+
* Callback options for authentication operations
|
|
112
|
+
*/
|
|
113
|
+
type AuthOption = {
|
|
114
|
+
/** Callback executed when authentication succeeds */
|
|
115
|
+
onSuccess?: (user: User) => void;
|
|
116
|
+
/** Callback executed when authentication fails */
|
|
117
|
+
onError?: (error: Error) => void;
|
|
118
|
+
};
|
|
119
|
+
/**
|
|
120
|
+
* Authentication configuration for the application
|
|
121
|
+
*
|
|
122
|
+
* @example
|
|
123
|
+
* ```typescript
|
|
124
|
+
* import { startApp } from 'modelence/server';
|
|
125
|
+
*
|
|
126
|
+
* startApp({
|
|
127
|
+
* auth: {
|
|
128
|
+
* onAfterLogin: ({ user }) => {
|
|
129
|
+
* console.log('User logged in:', user.name);
|
|
130
|
+
* // Redirect to dashboard
|
|
131
|
+
* },
|
|
132
|
+
* onLoginError: ({ error }) => {
|
|
133
|
+
* console.error('Login failed:', error.message);
|
|
134
|
+
* // Show error toast
|
|
135
|
+
* },
|
|
136
|
+
* onAfterSignup: ({ user }) => {
|
|
137
|
+
* console.log('User signed up:', user.email);
|
|
138
|
+
* // Send welcome email
|
|
139
|
+
* },
|
|
140
|
+
* onSignupError: ({ error }) => {
|
|
141
|
+
* console.error('Signup failed:', error.message);
|
|
142
|
+
* }
|
|
143
|
+
* }
|
|
144
|
+
* });
|
|
145
|
+
* ```
|
|
146
|
+
*/
|
|
147
|
+
type AuthConfig = {
|
|
148
|
+
onAfterLogin?: (props: AuthSuccessProps) => void;
|
|
149
|
+
onLoginError?: (props: AuthErrorProps) => void;
|
|
150
|
+
onAfterSignup?: (props: AuthSuccessProps) => void;
|
|
151
|
+
onSignupError?: (props: AuthErrorProps) => void;
|
|
152
|
+
onAfterEmailVerification?: (props: AuthSuccessProps) => void;
|
|
153
|
+
onEmailVerificationError?: (props: AuthErrorProps) => void;
|
|
154
|
+
/** deprecated: use onAfterLogin and onLoginError */
|
|
155
|
+
login?: AuthOption;
|
|
156
|
+
/** deprecated: user onAfterSignup and onSignupError */
|
|
157
|
+
signup?: AuthOption;
|
|
158
|
+
};
|
|
159
|
+
|
|
160
|
+
type WebsocketConfig = {
|
|
161
|
+
provider?: WebsocketServerProvider;
|
|
162
|
+
};
|
|
163
|
+
|
|
164
|
+
type AppOptions = {
|
|
165
|
+
modules?: Module[];
|
|
166
|
+
server?: AppServer;
|
|
167
|
+
email?: EmailConfig;
|
|
168
|
+
auth?: AuthConfig;
|
|
169
|
+
roles?: Record<string, RoleDefinition>;
|
|
170
|
+
defaultRoles?: Record<string, string>;
|
|
171
|
+
migrations?: Array<MigrationScript>;
|
|
172
|
+
websocket?: WebsocketConfig;
|
|
173
|
+
};
|
|
174
|
+
declare function startApp({ modules, roles, defaultRoles, server, migrations, email, auth, websocket, }: AppOptions): Promise<void>;
|
|
175
|
+
|
|
176
|
+
declare function createQuery<T extends unknown[]>(name: string, methodDef: MethodDefinition<T>): void;
|
|
177
|
+
|
|
178
|
+
/** @public */
|
|
179
|
+
declare abstract class BSONValue {
|
|
180
|
+
/** @public */
|
|
181
|
+
abstract get _bsontype(): string;
|
|
182
|
+
/* Excluded from this release type: [BSON_VERSION_SYMBOL] */
|
|
183
|
+
/**
|
|
184
|
+
* @public
|
|
185
|
+
* Prints a human-readable string of BSON value information
|
|
186
|
+
* If invoked manually without node.js.inspect function, this will default to a modified JSON.stringify
|
|
187
|
+
*/
|
|
188
|
+
abstract inspect(depth?: number, options?: unknown, inspect?: InspectFn): string;
|
|
189
|
+
/* Excluded from this release type: toExtendedJSON */
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
declare type InspectFn = (x: unknown, options?: unknown) => string;
|
|
193
|
+
|
|
194
|
+
/**
|
|
195
|
+
* A class representation of the BSON ObjectId type.
|
|
196
|
+
* @public
|
|
197
|
+
* @category BSONType
|
|
198
|
+
*/
|
|
199
|
+
declare class ObjectId extends BSONValue {
|
|
200
|
+
get _bsontype(): 'ObjectId';
|
|
201
|
+
/* Excluded from this release type: index */
|
|
202
|
+
static cacheHexString: boolean;
|
|
203
|
+
/* Excluded from this release type: buffer */
|
|
204
|
+
/**
|
|
205
|
+
* Create ObjectId from a number.
|
|
206
|
+
*
|
|
207
|
+
* @param inputId - A number.
|
|
208
|
+
* @deprecated Instead, use `static createFromTime()` to set a numeric value for the new ObjectId.
|
|
209
|
+
*/
|
|
210
|
+
constructor(inputId: number);
|
|
211
|
+
/**
|
|
212
|
+
* Create ObjectId from a 24 character hex string.
|
|
213
|
+
*
|
|
214
|
+
* @param inputId - A 24 character hex string.
|
|
215
|
+
*/
|
|
216
|
+
constructor(inputId: string);
|
|
217
|
+
/**
|
|
218
|
+
* Create ObjectId from the BSON ObjectId type.
|
|
219
|
+
*
|
|
220
|
+
* @param inputId - The BSON ObjectId type.
|
|
221
|
+
*/
|
|
222
|
+
constructor(inputId: ObjectId);
|
|
223
|
+
/**
|
|
224
|
+
* Create ObjectId from the object type that has the toHexString method.
|
|
225
|
+
*
|
|
226
|
+
* @param inputId - The ObjectIdLike type.
|
|
227
|
+
*/
|
|
228
|
+
constructor(inputId: ObjectIdLike);
|
|
229
|
+
/**
|
|
230
|
+
* Create ObjectId from a 12 byte binary Buffer.
|
|
231
|
+
*
|
|
232
|
+
* @param inputId - A 12 byte binary Buffer.
|
|
233
|
+
*/
|
|
234
|
+
constructor(inputId: Uint8Array);
|
|
235
|
+
/** To generate a new ObjectId, use ObjectId() with no argument. */
|
|
236
|
+
constructor();
|
|
237
|
+
/**
|
|
238
|
+
* Implementation overload.
|
|
239
|
+
*
|
|
240
|
+
* @param inputId - All input types that are used in the constructor implementation.
|
|
241
|
+
*/
|
|
242
|
+
constructor(inputId?: string | number | ObjectId | ObjectIdLike | Uint8Array);
|
|
243
|
+
/**
|
|
244
|
+
* The ObjectId bytes
|
|
245
|
+
* @readonly
|
|
246
|
+
*/
|
|
247
|
+
get id(): Uint8Array;
|
|
248
|
+
set id(value: Uint8Array);
|
|
249
|
+
/* Excluded from this release type: validateHexString */
|
|
250
|
+
/** Returns the ObjectId id as a 24 lowercase character hex string representation */
|
|
251
|
+
toHexString(): string;
|
|
252
|
+
/* Excluded from this release type: getInc */
|
|
253
|
+
/**
|
|
254
|
+
* Generate a 12 byte id buffer used in ObjectId's
|
|
255
|
+
*
|
|
256
|
+
* @param time - pass in a second based timestamp.
|
|
257
|
+
*/
|
|
258
|
+
static generate(time?: number): Uint8Array;
|
|
259
|
+
/**
|
|
260
|
+
* Converts the id into a 24 character hex string for printing, unless encoding is provided.
|
|
261
|
+
* @param encoding - hex or base64
|
|
262
|
+
*/
|
|
263
|
+
toString(encoding?: 'hex' | 'base64'): string;
|
|
264
|
+
/** Converts to its JSON the 24 character hex string representation. */
|
|
265
|
+
toJSON(): string;
|
|
266
|
+
/* Excluded from this release type: is */
|
|
267
|
+
/**
|
|
268
|
+
* Compares the equality of this ObjectId with `otherID`.
|
|
269
|
+
*
|
|
270
|
+
* @param otherId - ObjectId instance to compare against.
|
|
271
|
+
*/
|
|
272
|
+
equals(otherId: string | ObjectId | ObjectIdLike | undefined | null): boolean;
|
|
273
|
+
/** Returns the generation date (accurate up to the second) that this ID was generated. */
|
|
274
|
+
getTimestamp(): Date;
|
|
275
|
+
/* Excluded from this release type: createPk */
|
|
276
|
+
/* Excluded from this release type: serializeInto */
|
|
277
|
+
/**
|
|
278
|
+
* Creates an ObjectId from a second based number, with the rest of the ObjectId zeroed out. Used for comparisons or sorting the ObjectId.
|
|
279
|
+
*
|
|
280
|
+
* @param time - an integer number representing a number of seconds.
|
|
281
|
+
*/
|
|
282
|
+
static createFromTime(time: number): ObjectId;
|
|
283
|
+
/**
|
|
284
|
+
* Creates an ObjectId from a hex string representation of an ObjectId.
|
|
285
|
+
*
|
|
286
|
+
* @param hexString - create a ObjectId from a passed in 24 character hexstring.
|
|
287
|
+
*/
|
|
288
|
+
static createFromHexString(hexString: string): ObjectId;
|
|
289
|
+
/** Creates an ObjectId instance from a base64 string */
|
|
290
|
+
static createFromBase64(base64: string): ObjectId;
|
|
291
|
+
/**
|
|
292
|
+
* Checks if a value can be used to create a valid bson ObjectId
|
|
293
|
+
* @param id - any JS value
|
|
294
|
+
*/
|
|
295
|
+
static isValid(id: string | number | ObjectId | ObjectIdLike | Uint8Array): boolean;
|
|
296
|
+
/* Excluded from this release type: toExtendedJSON */
|
|
297
|
+
/* Excluded from this release type: fromExtendedJSON */
|
|
298
|
+
/* Excluded from this release type: isCached */
|
|
299
|
+
/**
|
|
300
|
+
* Converts to a string representation of this Id.
|
|
301
|
+
*
|
|
302
|
+
* @returns return the 24 character hex string representation.
|
|
303
|
+
*/
|
|
304
|
+
inspect(depth?: number, options?: unknown, inspect?: InspectFn): string;
|
|
305
|
+
}
|
|
306
|
+
|
|
307
|
+
/** @public */
|
|
308
|
+
declare interface ObjectIdLike {
|
|
309
|
+
id: string | Uint8Array;
|
|
310
|
+
__id?: string;
|
|
311
|
+
toHexString(): string;
|
|
312
|
+
}
|
|
313
|
+
|
|
314
|
+
/**
|
|
315
|
+
* Database collection for storing user accounts with authentication methods and profile information.
|
|
316
|
+
*
|
|
317
|
+
* This is where **signupWithPassword** automatically creates new users.
|
|
318
|
+
*
|
|
319
|
+
* @example
|
|
320
|
+
* ```typescript
|
|
321
|
+
* // Find user by email
|
|
322
|
+
* const user = await dbUsers.findOne(
|
|
323
|
+
* { 'emails.address': 'john@example.com' }
|
|
324
|
+
* );
|
|
325
|
+
* ```
|
|
326
|
+
*
|
|
327
|
+
*/
|
|
328
|
+
declare const usersCollection: Store<{
|
|
329
|
+
handle: zod.ZodString;
|
|
330
|
+
emails: zod.ZodOptional<zod.ZodArray<zod.ZodObject<{
|
|
331
|
+
address: zod.ZodString;
|
|
332
|
+
verified: zod.ZodBoolean;
|
|
333
|
+
}, "strip", zod.ZodTypeAny, {
|
|
334
|
+
address: string;
|
|
335
|
+
verified: boolean;
|
|
336
|
+
}, {
|
|
337
|
+
address: string;
|
|
338
|
+
verified: boolean;
|
|
339
|
+
}>, "many">>;
|
|
340
|
+
status: zod.ZodOptional<zod.ZodEnum<["active", "disabled", "deleted"]>>;
|
|
341
|
+
createdAt: zod.ZodDate;
|
|
342
|
+
disabledAt: zod.ZodOptional<zod.ZodDate>;
|
|
343
|
+
deletedAt: zod.ZodOptional<zod.ZodDate>;
|
|
344
|
+
roles: zod.ZodOptional<zod.ZodArray<zod.ZodString, "many">>;
|
|
345
|
+
authMethods: zod.ZodObject<{
|
|
346
|
+
password: zod.ZodOptional<zod.ZodObject<{
|
|
347
|
+
hash: zod.ZodString;
|
|
348
|
+
}, "strip", zod.ZodTypeAny, {
|
|
349
|
+
hash: string;
|
|
350
|
+
}, {
|
|
351
|
+
hash: string;
|
|
352
|
+
}>>;
|
|
353
|
+
google: zod.ZodOptional<zod.ZodObject<{
|
|
354
|
+
id: zod.ZodString;
|
|
355
|
+
}, "strip", zod.ZodTypeAny, {
|
|
356
|
+
id: string;
|
|
357
|
+
}, {
|
|
358
|
+
id: string;
|
|
359
|
+
}>>;
|
|
360
|
+
github: zod.ZodOptional<zod.ZodObject<{
|
|
361
|
+
id: zod.ZodString;
|
|
362
|
+
}, "strip", zod.ZodTypeAny, {
|
|
363
|
+
id: string;
|
|
364
|
+
}, {
|
|
365
|
+
id: string;
|
|
366
|
+
}>>;
|
|
367
|
+
}, "strip", zod.ZodTypeAny, {
|
|
368
|
+
password?: {
|
|
369
|
+
hash: string;
|
|
370
|
+
} | undefined;
|
|
371
|
+
google?: {
|
|
372
|
+
id: string;
|
|
373
|
+
} | undefined;
|
|
374
|
+
github?: {
|
|
375
|
+
id: string;
|
|
376
|
+
} | undefined;
|
|
377
|
+
}, {
|
|
378
|
+
password?: {
|
|
379
|
+
hash: string;
|
|
380
|
+
} | undefined;
|
|
381
|
+
google?: {
|
|
382
|
+
id: string;
|
|
383
|
+
} | undefined;
|
|
384
|
+
github?: {
|
|
385
|
+
id: string;
|
|
386
|
+
} | undefined;
|
|
387
|
+
}>;
|
|
388
|
+
}, Record<string, (this: Pick<InferDocumentType<{
|
|
389
|
+
handle: zod.ZodString;
|
|
390
|
+
emails: zod.ZodOptional<zod.ZodArray<zod.ZodObject<{
|
|
391
|
+
address: zod.ZodString;
|
|
392
|
+
verified: zod.ZodBoolean;
|
|
393
|
+
}, "strip", zod.ZodTypeAny, {
|
|
394
|
+
address: string;
|
|
395
|
+
verified: boolean;
|
|
396
|
+
}, {
|
|
397
|
+
address: string;
|
|
398
|
+
verified: boolean;
|
|
399
|
+
}>, "many">>;
|
|
400
|
+
status: zod.ZodOptional<zod.ZodEnum<["active", "disabled", "deleted"]>>;
|
|
401
|
+
createdAt: zod.ZodDate;
|
|
402
|
+
disabledAt: zod.ZodOptional<zod.ZodDate>;
|
|
403
|
+
deletedAt: zod.ZodOptional<zod.ZodDate>;
|
|
404
|
+
roles: zod.ZodOptional<zod.ZodArray<zod.ZodString, "many">>;
|
|
405
|
+
authMethods: zod.ZodObject<{
|
|
406
|
+
password: zod.ZodOptional<zod.ZodObject<{
|
|
407
|
+
hash: zod.ZodString;
|
|
408
|
+
}, "strip", zod.ZodTypeAny, {
|
|
409
|
+
hash: string;
|
|
410
|
+
}, {
|
|
411
|
+
hash: string;
|
|
412
|
+
}>>;
|
|
413
|
+
google: zod.ZodOptional<zod.ZodObject<{
|
|
414
|
+
id: zod.ZodString;
|
|
415
|
+
}, "strip", zod.ZodTypeAny, {
|
|
416
|
+
id: string;
|
|
417
|
+
}, {
|
|
418
|
+
id: string;
|
|
419
|
+
}>>;
|
|
420
|
+
github: zod.ZodOptional<zod.ZodObject<{
|
|
421
|
+
id: zod.ZodString;
|
|
422
|
+
}, "strip", zod.ZodTypeAny, {
|
|
423
|
+
id: string;
|
|
424
|
+
}, {
|
|
425
|
+
id: string;
|
|
426
|
+
}>>;
|
|
427
|
+
}, "strip", zod.ZodTypeAny, {
|
|
428
|
+
password?: {
|
|
429
|
+
hash: string;
|
|
430
|
+
} | undefined;
|
|
431
|
+
google?: {
|
|
432
|
+
id: string;
|
|
433
|
+
} | undefined;
|
|
434
|
+
github?: {
|
|
435
|
+
id: string;
|
|
436
|
+
} | undefined;
|
|
437
|
+
}, {
|
|
438
|
+
password?: {
|
|
439
|
+
hash: string;
|
|
440
|
+
} | undefined;
|
|
441
|
+
google?: {
|
|
442
|
+
id: string;
|
|
443
|
+
} | undefined;
|
|
444
|
+
github?: {
|
|
445
|
+
id: string;
|
|
446
|
+
} | undefined;
|
|
447
|
+
}>;
|
|
448
|
+
}>, "handle" | "roles" | "status" | "createdAt" | "emails" | "disabledAt" | "deletedAt" | "authMethods"> & {
|
|
449
|
+
_id: ObjectId;
|
|
450
|
+
}, ...args: any[]) => any>>;
|
|
451
|
+
|
|
452
|
+
declare function disableUser(userId: ObjectId$1): Promise<void>;
|
|
453
|
+
declare function deleteUser(userId: ObjectId$1): Promise<void>;
|
|
454
|
+
|
|
455
|
+
/**
|
|
456
|
+
* This function will check all rate limit rules on the specified bucket and type,
|
|
457
|
+
* throw an error if any of them are exceeded and increase the count of the rate limit record.
|
|
458
|
+
*
|
|
459
|
+
* @category Rate Limits
|
|
460
|
+
*
|
|
461
|
+
* @example
|
|
462
|
+
* ```ts
|
|
463
|
+
* await consumeRateLimit({ bucket: 'api', type: 'ip', value: '127.0.0.1' });
|
|
464
|
+
* ```
|
|
465
|
+
* @param options.bucket - The bucket for the rate limit.
|
|
466
|
+
* @param options.type - The type of the rate limit.
|
|
467
|
+
* @param options.value - The value for the rate limit.
|
|
468
|
+
*/
|
|
469
|
+
declare function consumeRateLimit(options: {
|
|
470
|
+
bucket: string;
|
|
471
|
+
type: RateLimitType;
|
|
472
|
+
value: string;
|
|
473
|
+
}): Promise<void>;
|
|
474
|
+
|
|
475
|
+
/**
|
|
476
|
+
* @sidebarTitle getConfig (server)
|
|
477
|
+
*
|
|
478
|
+
* @param key - The configuration key to retrieve
|
|
479
|
+
* @returns The configuration value (string, number, or boolean)
|
|
480
|
+
*
|
|
481
|
+
* @example
|
|
482
|
+
* ```ts
|
|
483
|
+
* import { getConfig } from 'modelence/server';
|
|
484
|
+
*
|
|
485
|
+
* // Get the site URL
|
|
486
|
+
* const siteUrl = getConfig('_system.site.url');
|
|
487
|
+
* ```
|
|
488
|
+
*
|
|
489
|
+
* Set via environment variable:
|
|
490
|
+
* ```bash
|
|
491
|
+
* MODELENCE_SITE_URL=https://myapp.com
|
|
492
|
+
* ```
|
|
493
|
+
*
|
|
494
|
+
* @example
|
|
495
|
+
* ```ts
|
|
496
|
+
* import { getConfig } from 'modelence/server';
|
|
497
|
+
*
|
|
498
|
+
* // Get the current environment (e.g., 'development', 'staging', 'production')
|
|
499
|
+
* const env = getConfig('_system.env');
|
|
500
|
+
*
|
|
501
|
+
* if (env === 'production') {
|
|
502
|
+
* // Enable production features
|
|
503
|
+
* }
|
|
504
|
+
* ```
|
|
505
|
+
*
|
|
506
|
+
* Set via environment variable:
|
|
507
|
+
* ```bash
|
|
508
|
+
* MODELENCE_SITE_ENV=production
|
|
509
|
+
* ```
|
|
510
|
+
*/
|
|
511
|
+
declare function getConfig(key: ConfigKey): string | number | boolean;
|
|
512
|
+
|
|
513
|
+
type CloudBackendConnectOkResponse = {
|
|
514
|
+
status: 'ok';
|
|
515
|
+
configs: AppConfig[];
|
|
516
|
+
environmentId: string;
|
|
517
|
+
appAlias: string;
|
|
518
|
+
environmentAlias: string;
|
|
519
|
+
telemetry: {
|
|
520
|
+
isEnabled: boolean;
|
|
521
|
+
serviceName: string;
|
|
522
|
+
};
|
|
523
|
+
};
|
|
524
|
+
type CloudBackendConnectErrorResponse = {
|
|
525
|
+
status: 'error';
|
|
526
|
+
error: string;
|
|
527
|
+
};
|
|
528
|
+
type CloudBackendConnectResponse = CloudBackendConnectOkResponse | CloudBackendConnectErrorResponse;
|
|
529
|
+
|
|
530
|
+
declare function authenticate(authToken: string | null): Promise<{
|
|
531
|
+
session: Session;
|
|
532
|
+
user: UserInfo | null;
|
|
533
|
+
roles: Role[];
|
|
534
|
+
}>;
|
|
535
|
+
|
|
536
|
+
declare function sendEmail(payload: EmailPayload): Promise<void> | undefined;
|
|
537
|
+
|
|
538
|
+
export { type AppOptions, type AuthConfig, type AuthOption, type CloudBackendConnectResponse, CronJobInputParams, Module, RateLimitRule, RateLimitType, RouteDefinition, ServerChannel, Store, UserInfo, authenticate, consumeRateLimit, createQuery, usersCollection as dbUsers, deleteUser, disableUser, getConfig, sendEmail, startApp };
|