@niledatabase/server 1.0.0-alpha.199 → 1.0.0-alpha.201
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/README.md +1 -1
- package/dist/Server.d.ts +36 -36
- package/dist/auth/index.d.ts +20 -20
- package/dist/db/DBManager.d.ts +8 -8
- package/dist/db/NileInstance.d.ts +15 -15
- package/dist/db/index.d.ts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/server.cjs.development.js +225 -131
- package/dist/server.cjs.development.js.map +1 -1
- package/dist/server.cjs.production.min.js +1 -1
- package/dist/server.cjs.production.min.js.map +1 -1
- package/dist/server.esm.js +223 -127
- package/dist/server.esm.js.map +1 -1
- package/dist/tenants/index.d.ts +12 -12
- package/dist/types.d.ts +77 -56
- package/dist/users/index.d.ts +15 -11
- package/dist/utils/Config.d.ts +31 -33
- package/dist/utils/Event/index.d.ts +11 -11
- package/dist/utils/Requester/index.d.ts +22 -22
- package/dist/utils/Requester/types.d.ts +52 -52
- package/dist/utils/ResponseError.d.ts +4 -4
- package/dist/utils/Server/index.d.ts +4 -4
- package/dist/utils/fetch.d.ts +9 -9
- package/package.json +21 -20
package/README.md
CHANGED
|
@@ -10,9 +10,9 @@ import Server from '@niledatabase/server';
|
|
|
10
10
|
const connection = {
|
|
11
11
|
user: process.env.NILE_USER,
|
|
12
12
|
password: process.env.NILE_PASSWORD,
|
|
13
|
+
host: process.env.NILE_DB_HOST,
|
|
13
14
|
};
|
|
14
15
|
const nile = Server({
|
|
15
|
-
workspace: String(process.env.NILE_WORKSPACE),
|
|
16
16
|
database: String(process.env.NILE_DATABASE),
|
|
17
17
|
api: {
|
|
18
18
|
basePath: String(process.env.BASE_PATH),
|
package/dist/Server.d.ts
CHANGED
|
@@ -1,36 +1,36 @@
|
|
|
1
|
-
import { InstanceConfig, ServerConfig } from './types';
|
|
2
|
-
import { Config } from './utils/Config';
|
|
3
|
-
import Auth from './auth';
|
|
4
|
-
import Users from './users';
|
|
5
|
-
import Tenants from './tenants';
|
|
6
|
-
import { NileDatabaseI } from './db';
|
|
7
|
-
|
|
8
|
-
auth: Auth;
|
|
9
|
-
users: Users;
|
|
10
|
-
tenants: Tenants;
|
|
11
|
-
};
|
|
12
|
-
declare class Server {
|
|
13
|
-
config: Config;
|
|
14
|
-
api: Api;
|
|
15
|
-
private manager;
|
|
16
|
-
private servers;
|
|
17
|
-
constructor(config?: ServerConfig);
|
|
18
|
-
setConfig(cfg: Config): void;
|
|
19
|
-
set database(val: string | void);
|
|
20
|
-
set workspace(val: string | void);
|
|
21
|
-
get userId(): string | undefined | null;
|
|
22
|
-
set userId(userId: string | undefined | null);
|
|
23
|
-
get tenantId(): string | undefined | null;
|
|
24
|
-
set tenantId(tenantId: string | undefined | null);
|
|
25
|
-
get token(): string | undefined | null;
|
|
26
|
-
set token(token: string | undefined | null);
|
|
27
|
-
get db(): NileDatabaseI;
|
|
28
|
-
/**
|
|
29
|
-
* A utility function if you want to manage different NileDB instances yourself
|
|
30
|
-
* returns the global Server object, an existing server that's already been configured,
|
|
31
|
-
* or a new one if the config isn't in the cache
|
|
32
|
-
*/
|
|
33
|
-
getInstance(config: InstanceConfig): Server;
|
|
34
|
-
}
|
|
35
|
-
export default function Nile(config: ServerConfig): Server;
|
|
36
|
-
export {};
|
|
1
|
+
import { InstanceConfig, ServerConfig } from './types';
|
|
2
|
+
import { Config } from './utils/Config';
|
|
3
|
+
import Auth from './auth';
|
|
4
|
+
import Users from './users';
|
|
5
|
+
import Tenants from './tenants';
|
|
6
|
+
import { NileDatabaseI } from './db';
|
|
7
|
+
type Api = {
|
|
8
|
+
auth: Auth;
|
|
9
|
+
users: Users;
|
|
10
|
+
tenants: Tenants;
|
|
11
|
+
};
|
|
12
|
+
declare class Server {
|
|
13
|
+
config: Config;
|
|
14
|
+
api: Api;
|
|
15
|
+
private manager;
|
|
16
|
+
private servers;
|
|
17
|
+
constructor(config?: ServerConfig);
|
|
18
|
+
setConfig(cfg: Config): void;
|
|
19
|
+
set database(val: string | void);
|
|
20
|
+
set workspace(val: string | void);
|
|
21
|
+
get userId(): string | undefined | null;
|
|
22
|
+
set userId(userId: string | undefined | null);
|
|
23
|
+
get tenantId(): string | undefined | null;
|
|
24
|
+
set tenantId(tenantId: string | undefined | null);
|
|
25
|
+
get token(): string | undefined | null;
|
|
26
|
+
set token(token: string | undefined | null);
|
|
27
|
+
get db(): NileDatabaseI;
|
|
28
|
+
/**
|
|
29
|
+
* A utility function if you want to manage different NileDB instances yourself
|
|
30
|
+
* returns the global Server object, an existing server that's already been configured,
|
|
31
|
+
* or a new one if the config isn't in the cache
|
|
32
|
+
*/
|
|
33
|
+
getInstance(config: InstanceConfig): Server;
|
|
34
|
+
}
|
|
35
|
+
export default function Nile(config: ServerConfig): Server;
|
|
36
|
+
export {};
|
package/dist/auth/index.d.ts
CHANGED
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
import { RestModels } from '@niledatabase/js';
|
|
2
|
-
import { Config } from '../utils/Config';
|
|
3
|
-
import { NileRequest, NileResponse } from '../utils/Requester';
|
|
4
|
-
export default class Auth extends Config {
|
|
5
|
-
constructor(config: Config);
|
|
6
|
-
get loginUrl(): string;
|
|
7
|
-
login: (req: NileRequest<RestModels.CreateBasicUserRequest>, init?: RequestInit
|
|
8
|
-
loginSSO: (redirectUrl: string) => (req: NileRequest<unknown>) => NileResponse<RestModels.TenantSSORegistration[]>;
|
|
9
|
-
loginSSOUrl: (provider: string) => string;
|
|
10
|
-
get signUpUrl(): string;
|
|
11
|
-
signUp: (req: NileRequest<RestModels.CreateBasicUserRequest>, init?: RequestInit
|
|
12
|
-
updateProviderUrl(providerName: string): string;
|
|
13
|
-
get listTenantProvidersUrl(): string;
|
|
14
|
-
listTenantProviders: (req: NileRequest<void | Headers>, init?: RequestInit
|
|
15
|
-
createProvider: (req: NileRequest<RestModels.RegisterTenantSSORequest>, init?: RequestInit
|
|
16
|
-
updateProvider: (req: NileRequest<RestModels.RegisterTenantSSORequest>, init?: RequestInit
|
|
17
|
-
providerUrl(email?: undefined | string): string;
|
|
18
|
-
listProviders: (req: NileRequest<void | RestModels.CreateBasicUserRequest>, init?: RequestInit
|
|
19
|
-
getSSOCallbackUrl: (param: Headers | string) => string;
|
|
20
|
-
}
|
|
1
|
+
import { RestModels } from '@niledatabase/js';
|
|
2
|
+
import { Config } from '../utils/Config';
|
|
3
|
+
import { NileRequest, NileResponse } from '../utils/Requester';
|
|
4
|
+
export default class Auth extends Config {
|
|
5
|
+
constructor(config: Config);
|
|
6
|
+
get loginUrl(): string;
|
|
7
|
+
login: (req: NileRequest<RestModels.CreateBasicUserRequest>, init?: RequestInit) => NileResponse<RestModels.LoginUserResponse>;
|
|
8
|
+
loginSSO: (redirectUrl: string) => (req: NileRequest<unknown>) => NileResponse<RestModels.TenantSSORegistration[]>;
|
|
9
|
+
loginSSOUrl: (provider: string) => string;
|
|
10
|
+
get signUpUrl(): string;
|
|
11
|
+
signUp: (req: NileRequest<RestModels.CreateBasicUserRequest>, init?: RequestInit) => NileResponse<RestModels.LoginUserResponse>;
|
|
12
|
+
updateProviderUrl(providerName: string): string;
|
|
13
|
+
get listTenantProvidersUrl(): string;
|
|
14
|
+
listTenantProviders: (req: NileRequest<void | Headers>, init?: RequestInit) => NileResponse<RestModels.TenantSSORegistration[]>;
|
|
15
|
+
createProvider: (req: NileRequest<RestModels.RegisterTenantSSORequest>, init?: RequestInit) => NileResponse<RestModels.TenantSSORegistration>;
|
|
16
|
+
updateProvider: (req: NileRequest<RestModels.RegisterTenantSSORequest>, init?: RequestInit) => NileResponse<RestModels.TenantSSORegistration>;
|
|
17
|
+
providerUrl(email?: undefined | string): string;
|
|
18
|
+
listProviders: (req: NileRequest<void | RestModels.CreateBasicUserRequest>, init?: RequestInit) => NileResponse<RestModels.TenantSSORegistration[]>;
|
|
19
|
+
getSSOCallbackUrl: (param: Headers | string) => string;
|
|
20
|
+
}
|
package/dist/db/DBManager.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { Config } from '../utils/Config';
|
|
2
|
-
import NileDatabase, { NileDatabaseI } from './NileInstance';
|
|
3
|
-
export default class DBManager {
|
|
4
|
-
connections: Map<string, NileDatabase>;
|
|
5
|
-
private makeId;
|
|
6
|
-
constructor(config: Config);
|
|
7
|
-
getConnection(config: Config): NileDatabaseI;
|
|
8
|
-
}
|
|
1
|
+
import { Config } from '../utils/Config';
|
|
2
|
+
import NileDatabase, { NileDatabaseI } from './NileInstance';
|
|
3
|
+
export default class DBManager {
|
|
4
|
+
connections: Map<string, NileDatabase>;
|
|
5
|
+
private makeId;
|
|
6
|
+
constructor(config: Config);
|
|
7
|
+
getConnection(config: Config): NileDatabaseI;
|
|
8
|
+
}
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
/// <reference types="node" />
|
|
2
|
-
import { Knex } from 'knex';
|
|
3
|
-
import { Config } from '../utils/Config';
|
|
4
|
-
declare class NileDatabase {
|
|
5
|
-
knex: Knex;
|
|
6
|
-
tenantId?: undefined | null | string;
|
|
7
|
-
userId?: undefined | null | string;
|
|
8
|
-
id: string;
|
|
9
|
-
config: any;
|
|
10
|
-
timer: NodeJS.Timeout | undefined;
|
|
11
|
-
constructor(config: Config, id: string);
|
|
12
|
-
startTimeout(): void;
|
|
13
|
-
}
|
|
14
|
-
export
|
|
15
|
-
export default NileDatabase;
|
|
1
|
+
/// <reference types="node" />
|
|
2
|
+
import { Knex } from 'knex';
|
|
3
|
+
import { Config } from '../utils/Config';
|
|
4
|
+
declare class NileDatabase {
|
|
5
|
+
knex: Knex;
|
|
6
|
+
tenantId?: undefined | null | string;
|
|
7
|
+
userId?: undefined | null | string;
|
|
8
|
+
id: string;
|
|
9
|
+
config: any;
|
|
10
|
+
timer: NodeJS.Timeout | undefined;
|
|
11
|
+
constructor(config: Config, id: string);
|
|
12
|
+
startTimeout(): void;
|
|
13
|
+
}
|
|
14
|
+
export type NileDatabaseI = (table?: string) => Knex;
|
|
15
|
+
export default NileDatabase;
|
package/dist/db/index.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { default } from './DBManager';
|
|
2
|
-
export { NileDatabaseI } from './NileInstance';
|
|
1
|
+
export { default } from './DBManager';
|
|
2
|
+
export { NileDatabaseI } from './NileInstance';
|
package/dist/index.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { default as Server } from './Server';
|
|
2
|
-
export default Server;
|
|
1
|
+
import { default as Server } from './Server';
|
|
2
|
+
export default Server;
|