@niledatabase/server 3.0.0-alpha.9 → 3.0.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/express.d.mts +24 -0
- package/dist/express.d.ts +24 -0
- package/dist/express.js +147 -0
- package/dist/express.js.map +1 -0
- package/dist/express.mjs +144 -0
- package/dist/express.mjs.map +1 -0
- package/dist/index.d.mts +323 -0
- package/dist/index.d.ts +323 -5
- package/dist/index.js +2382 -5
- package/dist/index.js.map +1 -0
- package/dist/index.mjs +2377 -0
- package/dist/index.mjs.map +1 -0
- package/package.json +17 -4
- package/dist/Api.d.ts +0 -22
- package/dist/Server.d.ts +0 -29
- package/dist/api/handlers/DELETE.d.ts +0 -3
- package/dist/api/handlers/GET.d.ts +0 -3
- package/dist/api/handlers/POST.d.ts +0 -3
- package/dist/api/handlers/PUT.d.ts +0 -3
- package/dist/api/handlers/index.d.ts +0 -8
- package/dist/api/routes/auth/callback.d.ts +0 -3
- package/dist/api/routes/auth/csrf.d.ts +0 -3
- package/dist/api/routes/auth/error.d.ts +0 -3
- package/dist/api/routes/auth/index.d.ts +0 -7
- package/dist/api/routes/auth/providers.d.ts +0 -3
- package/dist/api/routes/auth/session.d.ts +0 -4
- package/dist/api/routes/auth/signin.d.ts +0 -33
- package/dist/api/routes/auth/signout.d.ts +0 -3
- package/dist/api/routes/me/index.d.ts +0 -4
- package/dist/api/routes/tenants/GET.d.ts +0 -32
- package/dist/api/routes/tenants/POST.d.ts +0 -45
- package/dist/api/routes/tenants/[tenantId]/DELETE.d.ts +0 -34
- package/dist/api/routes/tenants/[tenantId]/users/GET.d.ts +0 -35
- package/dist/api/routes/tenants/[tenantId]/users/POST.d.ts +0 -44
- package/dist/api/routes/tenants/[tenantId]/users/PUT.d.ts +0 -29
- package/dist/api/routes/tenants/[tenantId]/users/[userId]/DELETE.d.ts +0 -30
- package/dist/api/routes/tenants/[tenantId]/users/index.d.ts +0 -4
- package/dist/api/routes/tenants/index.d.ts +0 -4
- package/dist/api/routes/users/GET.d.ts +0 -34
- package/dist/api/routes/users/POST.d.ts +0 -66
- package/dist/api/routes/users/[userId]/PUT.d.ts +0 -40
- package/dist/api/routes/users/index.d.ts +0 -4
- package/dist/api/swagger.d.ts +0 -152
- package/dist/api/types.d.ts +0 -18
- package/dist/api/utils/auth.d.ts +0 -14
- package/dist/api/utils/request.d.ts +0 -4
- package/dist/api/utils/routes/apiRoutes.d.ts +0 -14
- package/dist/api/utils/routes/defaultRoutes.d.ts +0 -2
- package/dist/api/utils/routes/makeRestUrl.d.ts +0 -1
- package/dist/api/utils/routes/proxyRoutes.d.ts +0 -12
- package/dist/api/utils/routes/urlMatches.d.ts +0 -1
- package/dist/auth/index.d.ts +0 -13
- package/dist/db/DBManager.d.ts +0 -12
- package/dist/db/NileInstance.d.ts +0 -14
- package/dist/db/PoolProxy.d.ts +0 -3
- package/dist/db/index.d.ts +0 -1
- package/dist/db/isUUID.d.ts +0 -1
- package/dist/server.cjs.development.js +0 -3976
- package/dist/server.cjs.development.js.map +0 -1
- package/dist/server.cjs.production.min.js +0 -2
- package/dist/server.cjs.production.min.js.map +0 -1
- package/dist/server.esm.js +0 -3974
- package/dist/server.esm.js.map +0 -1
- package/dist/tenants/index.d.ts +0 -21
- package/dist/types.d.ts +0 -37
- package/dist/users/index.d.ts +0 -52
- package/dist/utils/Config/envVars.d.ts +0 -22
- package/dist/utils/Config/index.d.ts +0 -47
- package/dist/utils/Event/index.d.ts +0 -12
- package/dist/utils/Logger.d.ts +0 -7
- package/dist/utils/Requester/index.d.ts +0 -23
- package/dist/utils/Requester/types.d.ts +0 -88
- package/dist/utils/ResponseError.d.ts +0 -4
- package/dist/utils/Server/index.d.ts +0 -4
- package/dist/utils/fetch.d.ts +0 -9
package/dist/api/utils/auth.d.ts
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { Config } from '../../utils/Config';
|
|
2
|
-
export type ActiveSession = {
|
|
3
|
-
id: string;
|
|
4
|
-
email: string;
|
|
5
|
-
expires: Date;
|
|
6
|
-
user?: {
|
|
7
|
-
id: string;
|
|
8
|
-
name: string;
|
|
9
|
-
image: string;
|
|
10
|
-
email: string;
|
|
11
|
-
emailVerified: void | Date;
|
|
12
|
-
};
|
|
13
|
-
};
|
|
14
|
-
export default function auth(req: Request, config: Config): Promise<void | ActiveSession>;
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
type ApiRouteKeys = keyof typeof apiRoutes;
|
|
2
|
-
export type ApiRoutePaths = (typeof apiRoutes)[ApiRouteKeys];
|
|
3
|
-
export declare const apiRoutes: {
|
|
4
|
-
ME: string;
|
|
5
|
-
USERS: (tenantId?: string) => string;
|
|
6
|
-
USER: (userId: string) => string;
|
|
7
|
-
TENANTS: string;
|
|
8
|
-
TENANT: (tenantId: string) => string;
|
|
9
|
-
SIGNUP: string;
|
|
10
|
-
TENANT_USERS: (tenantId: string) => string;
|
|
11
|
-
TENANT_USER: (tenantId: string, userId: string) => string;
|
|
12
|
-
USER_TENANTS: (userId: string) => string;
|
|
13
|
-
};
|
|
14
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare function makeRestUrl(path: string, qp?: Record<string, string>): string;
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
export declare const proxyRoutes: {
|
|
2
|
-
SIGNIN: string;
|
|
3
|
-
PROVIDERS: string;
|
|
4
|
-
SESSION: string;
|
|
5
|
-
CSRF: string;
|
|
6
|
-
CALLBACK: string;
|
|
7
|
-
SIGNOUT: string;
|
|
8
|
-
ERROR: string;
|
|
9
|
-
};
|
|
10
|
-
type ProxyKeys = keyof typeof proxyRoutes;
|
|
11
|
-
export type ProxyPaths = (typeof proxyRoutes)[ProxyKeys];
|
|
12
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export default function urlMatches(requestUrl: string, route: string): boolean;
|
package/dist/auth/index.d.ts
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { Config } from '../utils/Config';
|
|
2
|
-
/**
|
|
3
|
-
* a helper function to log in server side.
|
|
4
|
-
*/
|
|
5
|
-
export default function serverAuth(config: Config, handlers: {
|
|
6
|
-
GET: (req: Request) => Promise<void | Response>;
|
|
7
|
-
POST: (req: Request) => Promise<void | Response>;
|
|
8
|
-
DELETE: (req: Request) => Promise<void | Response>;
|
|
9
|
-
PUT: (req: Request) => Promise<void | Response>;
|
|
10
|
-
}): ({ email, password, }: {
|
|
11
|
-
email: string;
|
|
12
|
-
password: string;
|
|
13
|
-
}) => Promise<Headers>;
|
package/dist/db/DBManager.d.ts
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { Pool } from 'pg';
|
|
2
|
-
import { ServerConfig } from '../types';
|
|
3
|
-
import NileDatabase from './NileInstance';
|
|
4
|
-
export default class DBManager {
|
|
5
|
-
connections: Map<string, NileDatabase>;
|
|
6
|
-
cleared: boolean;
|
|
7
|
-
private makeId;
|
|
8
|
-
constructor(config: ServerConfig);
|
|
9
|
-
poolWatcher: (config: ServerConfig) => (id: undefined | null | string) => void;
|
|
10
|
-
getConnection: (config: ServerConfig) => Pool;
|
|
11
|
-
clear: (config: ServerConfig) => void;
|
|
12
|
-
}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
/// <reference types="node" />
|
|
2
|
-
import { Pool } from 'pg';
|
|
3
|
-
import { Config } from '../utils/Config';
|
|
4
|
-
declare class NileDatabase {
|
|
5
|
-
pool: Pool;
|
|
6
|
-
tenantId?: undefined | null | string;
|
|
7
|
-
userId?: undefined | null | string;
|
|
8
|
-
id: string;
|
|
9
|
-
config: Config;
|
|
10
|
-
timer: NodeJS.Timeout | undefined;
|
|
11
|
-
constructor(config: Config, id: string);
|
|
12
|
-
startTimeout(): void;
|
|
13
|
-
}
|
|
14
|
-
export default NileDatabase;
|
package/dist/db/PoolProxy.d.ts
DELETED
package/dist/db/index.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { default } from './DBManager';
|
package/dist/db/isUUID.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare function isUUID(value: string | null | undefined): boolean;
|