@appconda/nextjs 1.0.102 → 1.0.104
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/getSDKForCurrentUser.d.ts +2 -0
- package/dist/getSDKForCurrentUser.js +4 -3
- package/dist/getSDKForTenant.d.ts +20 -0
- package/dist/getSDKForTenant.js +44 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +2 -1
- package/dist/modules/acl/service.d.ts +26 -0
- package/dist/modules/acl/service.js +27 -0
- package/package.json +1 -1
- package/src/getSDKForCurrentUser.ts +3 -2
- package/src/getSDKForTenant.ts +52 -0
- package/src/index.ts +1 -0
- package/src/modules/acl/service.ts +55 -0
@@ -16,6 +16,7 @@ import { Node } from "./modules/ai/node/service";
|
|
16
16
|
import { AgentService } from "./modules/agent/service";
|
17
17
|
import { ChatFlow } from "./services/chat-flow";
|
18
18
|
import { TenantService } from "./modules";
|
19
|
+
import { Acl } from "./modules/acl/service";
|
19
20
|
export declare function getSDKForCurrentUser(): Promise<{
|
20
21
|
currentUser: import("./modules/account/types").User<import("./modules/account/types").Preferences>;
|
21
22
|
accounts: Account;
|
@@ -32,6 +33,7 @@ export declare function getSDKForCurrentUser(): Promise<{
|
|
32
33
|
subscription: Subscription;
|
33
34
|
pricing: Pricing;
|
34
35
|
configuration: Configuration;
|
36
|
+
acl: Acl;
|
35
37
|
node: Node;
|
36
38
|
waitlist: WaitlistService;
|
37
39
|
agent: AgentService;
|
@@ -18,6 +18,7 @@ import { Node } from "./modules/ai/node/service";
|
|
18
18
|
import { AgentService } from "./modules/agent/service";
|
19
19
|
import { ChatFlow } from "./services/chat-flow";
|
20
20
|
import { TenantService } from "./modules";
|
21
|
+
import { Acl } from "./modules/acl/service";
|
21
22
|
export async function getSDKForCurrentUser() {
|
22
23
|
const adminClient = await getAppcondaClient();
|
23
24
|
const c = await cookies();
|
@@ -41,7 +42,7 @@ export async function getSDKForCurrentUser() {
|
|
41
42
|
const subscription = new Subscription(adminClient);
|
42
43
|
const pricing = new Pricing(adminClient);
|
43
44
|
const configuration = new Configuration(adminClient);
|
44
|
-
|
45
|
+
const acl = new Acl(adminClient);
|
45
46
|
const node = new Node(adminClient);
|
46
47
|
const waitlist = new WaitlistService(adminClient);
|
47
48
|
const agent = new AgentService(adminClient);
|
@@ -62,11 +63,11 @@ export async function getSDKForCurrentUser() {
|
|
62
63
|
subscription,
|
63
64
|
pricing,
|
64
65
|
configuration,
|
65
|
-
|
66
|
+
acl,
|
66
67
|
node,
|
67
68
|
waitlist,
|
68
69
|
agent,
|
69
70
|
chatFlow
|
70
71
|
};
|
71
72
|
}
|
72
|
-
//# sourceMappingURL=data:application/json;base64,
|
73
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZ2V0U0RLRm9yQ3VycmVudFVzZXIuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi9zcmMvZ2V0U0RLRm9yQ3VycmVudFVzZXIudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsT0FBTyxFQUFFLE9BQU8sRUFBRSxNQUFNLGNBQWMsQ0FBQztBQUN2QyxPQUFPLEVBQUUsaUJBQWlCLEVBQUUsTUFBTSxxQkFBcUIsQ0FBQztBQUN4RCxPQUFPLEVBQUUsU0FBUyxFQUFFLE1BQU0sc0JBQXNCLENBQUM7QUFDakQsT0FBTyxFQUFFLGFBQWEsRUFBRSxNQUFNLDBCQUEwQixDQUFDO0FBQ3pELE9BQU8sRUFBRSxTQUFTLEVBQUUsTUFBTSxzQkFBc0IsQ0FBQztBQUNqRCxPQUFPLEVBQUUsT0FBTyxFQUFFLE1BQU0sb0JBQW9CLENBQUM7QUFDN0MsT0FBTyxFQUFFLFFBQVEsRUFBRSxNQUFNLHFCQUFxQixDQUFDO0FBQy9DLE9BQU8sRUFBRSxLQUFLLEVBQUUsTUFBTSxrQkFBa0IsQ0FBQztBQUN6QyxPQUFPLEVBQU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zLFxuICAgICAgICB0ZW5hbnRzLFxuICAgICAgICByb2xlcyxcbiAgICAgICAgcGVybWlzc2lvbnMsXG4gICAgICAgIHNjaGVtYXMsXG4gICAgICAgIGNvbW11bml0eSxcbiAgICAgICAgdGVuYW50U3Vic2NyaXB0aW9ucyxcbiAgICAgICAgc3Vic2NyaXB0aW9uLFxuICAgICAgICBwcmljaW5nLFxuICAgICAgICBjb25maWd1cmF0aW9uLFxuICAgICAgICBhY2wsXG4gICAgICAgIG5vZGUsXG4gICAgICAgIHdhaXRsaXN0LFxuICAgICAgICBhZ2VudCxcbiAgICAgICAgY2hhdEZsb3dcbiAgICB9XG59Il19
|
@@ -0,0 +1,20 @@
|
|
1
|
+
import { Account, TenantService } from "./modules";
|
2
|
+
import { Databases } from "./services/databases";
|
3
|
+
import { Projects } from "./services/projects";
|
4
|
+
import { Roles } from "./services/roles";
|
5
|
+
import { Schemas } from "./services/schema";
|
6
|
+
import { Teams } from "./services/teams";
|
7
|
+
import { Users } from "./services/users";
|
8
|
+
import { Permissions } from "./services/permissions";
|
9
|
+
export declare function getSDKForTenant(tenantId: string): Promise<{
|
10
|
+
currentUser: import("./modules/account/types").User<import("./modules/account/types").Preferences>;
|
11
|
+
accounts: Account;
|
12
|
+
databases: Databases;
|
13
|
+
projects: Projects;
|
14
|
+
users: Users;
|
15
|
+
teams: Teams;
|
16
|
+
tenants: TenantService;
|
17
|
+
roles: Roles;
|
18
|
+
permissions: Permissions;
|
19
|
+
schemas: Schemas;
|
20
|
+
}>;
|
@@ -0,0 +1,44 @@
|
|
1
|
+
import { cookies } from "next/headers";
|
2
|
+
import { getAppcondaClient } from "./getAppcondaClient";
|
3
|
+
import { Account, TenantService } from "./modules";
|
4
|
+
import { Databases } from "./services/databases";
|
5
|
+
import { Projects } from "./services/projects";
|
6
|
+
import { Roles } from "./services/roles";
|
7
|
+
import { Schemas } from "./services/schema";
|
8
|
+
import { Teams } from "./services/teams";
|
9
|
+
import { Users } from "./services/users";
|
10
|
+
import { Permissions } from "./services/permissions";
|
11
|
+
export async function getSDKForTenant(tenantId) {
|
12
|
+
const adminClient = await getAppcondaClient();
|
13
|
+
adminClient.setProject(tenantId);
|
14
|
+
adminClient.setMode('admin');
|
15
|
+
const c = await cookies();
|
16
|
+
const s = c.get('a_session') || c.get('a_session_console_legacy');
|
17
|
+
if (!s || !s.value) {
|
18
|
+
throw new Error("No session");
|
19
|
+
}
|
20
|
+
adminClient.setSession(s.value);
|
21
|
+
const accounts = new Account(adminClient);
|
22
|
+
const databases = new Databases(adminClient);
|
23
|
+
const projects = new Projects(adminClient);
|
24
|
+
const currentUser = await accounts.get();
|
25
|
+
const users = new Users(adminClient);
|
26
|
+
const teams = new Teams(adminClient);
|
27
|
+
const tenants = new TenantService(adminClient);
|
28
|
+
const roles = new Roles(adminClient);
|
29
|
+
const permissions = new Permissions(adminClient);
|
30
|
+
const schemas = new Schemas(adminClient);
|
31
|
+
return {
|
32
|
+
currentUser,
|
33
|
+
accounts,
|
34
|
+
databases,
|
35
|
+
projects,
|
36
|
+
users,
|
37
|
+
teams,
|
38
|
+
tenants,
|
39
|
+
roles,
|
40
|
+
permissions,
|
41
|
+
schemas
|
42
|
+
};
|
43
|
+
}
|
44
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZ2V0U0RLRm9yVGVuYW50LmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vc3JjL2dldFNES0ZvclRlbmFudC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxPQUFPLEVBQUUsT0FBTyxFQUFFLE1BQU0sY0FBYyxDQUFDO0FBQ3ZDLE9BQU8sRUFBRSxpQkFBaUIsRUFBRSxNQUFNLHFCQUFxQixDQUFDO0FBQ3hELE9BQU8sRUFBRSxPQUFPLEVBQUUsYUFBYSxFQUFFLE1BQU0sV0FBVyxDQUFDO0FBQ25ELE9BQU8sRUFBRSxTQUFTLEVBQUUsTUF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XRhYmFzZXMoYWRtaW5DbGllbnQpO1xuXG4gICAgY29uc3QgcHJvamVjdHMgPSBuZXcgUHJvamVjdHMoYWRtaW5DbGllbnQpO1xuXG4gICAgY29uc3QgY3VycmVudFVzZXIgPSBhd2FpdCBhY2NvdW50cy5nZXQoKTtcblxuICAgIGNvbnN0IHVzZXJzID0gbmV3IFVzZXJzKGFkbWluQ2xpZW50KTtcbiAgICBjb25zdCB0ZWFtcyA9IG5ldyBUZWFtcyhhZG1pbkNsaWVudCk7XG5cbiAgICBjb25zdCB0ZW5hbnRzID0gbmV3IFRlbmFudFNlcnZpY2UoYWRtaW5DbGllbnQpO1xuICAgIGNvbnN0IHJvbGVzID0gbmV3IFJvbGVzKGFkbWluQ2xpZW50KTtcbiAgICBjb25zdCBwZXJtaXNzaW9ucyA9IG5ldyBQZXJtaXNzaW9ucyhhZG1pbkNsaWVudCk7XG4gICAgY29uc3Qgc2NoZW1hcyA9IG5ldyBTY2hlbWFzKGFkbWluQ2xpZW50KTtcblxuICAgIHJldHVybiB7XG4gICAgICAgIGN1cnJlbnRVc2VyLFxuICAgICAgICBhY2NvdW50cyxcbiAgICAgICAgZGF0YWJhc2VzLFxuICAgICAgICBwcm9qZWN0cyxcbiAgICAgICAgdXNlcnMsXG4gICAgICAgIHRlYW1zLFxuICAgICAgICB0ZW5hbnRzLFxuICAgICAgICByb2xlcyxcbiAgICAgICAgcGVybWlzc2lvbnMsXG4gICAgICAgIHNjaGVtYXNcbiAgICB9XG59Il19
|
package/dist/index.d.ts
CHANGED
@@ -37,6 +37,7 @@ export { MessagingProviderType } from './enums/messaging-provider-type';
|
|
37
37
|
export { getSDKForCurrentUser } from './getSDKForCurrentUser';
|
38
38
|
export { getSDKForService } from './getSDKForService';
|
39
39
|
export { getAppcondaClient } from './getAppcondaClient';
|
40
|
+
export { getSDKForTenant } from './getSDKForTenant';
|
40
41
|
export * from './modules';
|
41
42
|
export type { SafeActionFn } from 'next-safe-action';
|
42
43
|
export * from './actions';
|
package/dist/index.js
CHANGED
@@ -35,7 +35,8 @@ export { MessagingProviderType } from './enums/messaging-provider-type';
|
|
35
35
|
export { getSDKForCurrentUser } from './getSDKForCurrentUser';
|
36
36
|
export { getSDKForService } from './getSDKForService';
|
37
37
|
export { getAppcondaClient } from './getAppcondaClient';
|
38
|
+
export { getSDKForTenant } from './getSDKForTenant';
|
38
39
|
export * from './modules';
|
39
40
|
export * from './actions';
|
40
41
|
export * from './lib';
|
41
|
-
//# sourceMappingURL=data:application/json;base64,
|
42
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi9zcmMvaW5kZXgudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsT0FBTyxFQUFFLE1BQU0sRUFBRSxLQUFLLEVBQUUsaUJBQWlCLEVBQUUsTUFBTSxVQUFVLENBQUM7QUFDNUQsT0FBTyxFQUFFLE9BQU8sRUFBRSxNQUFNLDJCQUEyQixDQUFDO0FBQ3BELE9BQU8sRUFBRSxPQUFPLEVBQUUsTUFBTSxvQkFBb0IsQ0FBQztBQUM3QyxPQUFPLEVBQUUsU0FBUyxFQUFFLE1BQU0sc0JBQXNCLENBQUM7QUFDakQsT0FBTyxFQUFFLE9BQU8sRUFBRSxNQUFNLG9CQUFvQixDQUFDO0FBQzdDLE9BQU8sRUFBRSxTQUFTLEVBQUUsTUFBTSxzQkFBc0IsQ0FBQztBQUNqRCxPQUFPLEVBQUUsT0FBTyxFQUFFLE1BQU0sb0JBQW9CLENBQUM7QUFDN0MsT0FBTyxFQUFFLE1BQU0sRUFBRSxNQUFNLG1CQUFtQixDQUFDO0FBQzNDLE9BQU8sRUFBRSxNQUFNLEVBQUUsTUFBTSxtQkFBbUIsQ0FBQztBQUMzQyxPQUFPLEVBQUUsU0FBUyxFQUFFLE1BQU0sc0JBQXNCLENBQUM7QUFDakQsT0FBTyxFQUFF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ZXRTREtGb3JDdXJyZW50VXNlciB9IGZyb20gJy4vZ2V0U0RLRm9yQ3VycmVudFVzZXInO1xuZXhwb3J0IHsgZ2V0U0RLRm9yU2VydmljZSB9IGZyb20gJy4vZ2V0U0RLRm9yU2VydmljZSc7XG5leHBvcnQgeyBnZXRBcHBjb25kYUNsaWVudCB9IGZyb20gJy4vZ2V0QXBwY29uZGFDbGllbnQnO1xuZXhwb3J0IHsgZ2V0U0RLRm9yVGVuYW50IH0gZnJvbSAnLi9nZXRTREtGb3JUZW5hbnQnO1xuZXhwb3J0ICogZnJvbSAnLi9tb2R1bGVzJztcbmV4cG9ydCB0eXBlIHsgU2FmZUFjdGlvbkZuIH0gZnJvbSAnbmV4dC1zYWZlLWFjdGlvbic7IFxuZXhwb3J0ICogZnJvbSAnLi9hY3Rpb25zJztcbmV4cG9ydCAqIGZyb20gJy4vbGliJztcbiJdfQ==
|
@@ -0,0 +1,26 @@
|
|
1
|
+
import { ServiceClient } from "../../service-client";
|
2
|
+
type Blacklist = {
|
3
|
+
id: string;
|
4
|
+
createdAt: Date;
|
5
|
+
type: string;
|
6
|
+
value: string;
|
7
|
+
active: boolean;
|
8
|
+
registerAttempts: number;
|
9
|
+
};
|
10
|
+
export declare class Acl extends ServiceClient {
|
11
|
+
protected getServiceName(): string;
|
12
|
+
getBlacklist(filters?: any, pagination?: {
|
13
|
+
page: number;
|
14
|
+
pageSize: number;
|
15
|
+
}): Promise<{
|
16
|
+
items: Blacklist[];
|
17
|
+
pagination: any;
|
18
|
+
}>;
|
19
|
+
addToBlackList(type: string, value: string): Promise<Blacklist>;
|
20
|
+
deleteFromBlackList(type: string, value: string): Promise<boolean>;
|
21
|
+
getAllTenantIpAddresses(): Promise<{
|
22
|
+
items: any[];
|
23
|
+
pagination: PaginationDto;
|
24
|
+
}>;
|
25
|
+
}
|
26
|
+
export {};
|
@@ -0,0 +1,27 @@
|
|
1
|
+
import { ServiceClient } from "../../service-client";
|
2
|
+
export class Acl extends ServiceClient {
|
3
|
+
getServiceName() {
|
4
|
+
return 'com.appconda.service.acl';
|
5
|
+
}
|
6
|
+
async getBlacklist(filters, pagination) {
|
7
|
+
const payload = {};
|
8
|
+
return await this.actionCall('GetBlackList', payload);
|
9
|
+
}
|
10
|
+
async addToBlackList(type, value) {
|
11
|
+
const payload = {};
|
12
|
+
payload['type'] = type;
|
13
|
+
payload['value'] = value;
|
14
|
+
return await this.actionCall('AddToBlackList', payload);
|
15
|
+
}
|
16
|
+
async deleteFromBlackList(type, value) {
|
17
|
+
const payload = {};
|
18
|
+
payload['type'] = type;
|
19
|
+
payload['value'] = value;
|
20
|
+
return await this.actionCall('DeleteFromBlackList', payload);
|
21
|
+
}
|
22
|
+
async getAllTenantIpAddresses() {
|
23
|
+
const payload = {};
|
24
|
+
return await this.actionCall('GetAllTenantIpAddresses', payload);
|
25
|
+
}
|
26
|
+
}
|
27
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic2VydmljZS5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uL3NyYy9tb2R1bGVzL2FjbC9zZXJ2aWNlLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUVBLE9BQU8sRUFBRSxhQUFhLEVBQUUsTUFBTSxzQkFBc0IsQ0FBQztBQVdyRCxNQUFNLE9BQU8sR0FBSSxTQUFRLGFBQWE7SUFFeEIsY0FBYztRQUNwQixPQUFPLDBCQUEwQixDQUFDO0lBQ3RDLENBQUM7SUFFTSxLQUFLLENBQUMsWUFBWSxDQUNyQixPQUFhLEVBQ2IsVUFBK0M7UUFHL0MsTUFBTSxPQUFPLEdBQVksRUFBRSxDQUFDO1FBRTVCLE9BQU8sTUFBTSxJQUFJLENBQUMsVUFBVSxDQUFDLGNBQWMsRUFBRSxPQUFPLENBQUMsQ0FBQztJQUUxRCxDQUFDO0lBRU0sS0FBSyxDQUFDLGNBQWMsQ0FBQyxJQUFZLE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7XG5cbiAgICAgICAgY29uc3QgcGF5bG9hZDogUGF5bG9hZCA9IHt9O1xuICAgICAgICBwYXlsb2FkWyd0eXBlJ10gPSB0eXBlO1xuICAgICAgICBwYXlsb2FkWyd2YWx1ZSddID0gdmFsdWU7XG4gICAgICAgIHJldHVybiBhd2FpdCB0aGlzLmFjdGlvbkNhbGwoJ0RlbGV0ZUZyb21CbGFja0xpc3QnLCBwYXlsb2FkKTtcblxuICAgIH1cblxuICAgIHB1YmxpYyBhc3luYyBnZXRBbGxUZW5hbnRJcEFkZHJlc3NlcygpOiBQcm9taXNlPHsgaXRlbXM6IGFueVtdOyBwYWdpbmF0aW9uOiBQYWdpbmF0aW9uRHRvIH0+IHtcblxuICAgICAgICBjb25zdCBwYXlsb2FkOiBQYXlsb2FkID0ge307XG4gICAgICAgIHJldHVybiBhd2FpdCB0aGlzLmFjdGlvbkNhbGwoJ0dldEFsbFRlbmFudElwQWRkcmVzc2VzJywgcGF5bG9hZCk7XG5cbiAgICB9XG59Il19
|
package/package.json
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
"name": "@appconda/nextjs",
|
3
3
|
"homepage": "https://appconda.io/support",
|
4
4
|
"description": "Appconda is an open-source self-hosted backend server that abstract and simplify complex and repetitive development tasks behind a very simple REST API",
|
5
|
-
"version": "1.0.
|
5
|
+
"version": "1.0.104",
|
6
6
|
"license": "BSD-3-Clause",
|
7
7
|
"main": "dist/index.js",
|
8
8
|
"types": "dist/index.d.ts",
|
@@ -18,6 +18,7 @@ import { Node } from "./modules/ai/node/service";
|
|
18
18
|
import { AgentService } from "./modules/agent/service";
|
19
19
|
import { ChatFlow } from "./services/chat-flow";
|
20
20
|
import { TenantService } from "./modules";
|
21
|
+
import { Acl } from "./modules/acl/service";
|
21
22
|
|
22
23
|
export async function getSDKForCurrentUser() {
|
23
24
|
const adminClient = await getAppcondaClient();
|
@@ -52,7 +53,7 @@ export async function getSDKForCurrentUser() {
|
|
52
53
|
const subscription = new Subscription(adminClient);
|
53
54
|
const pricing = new Pricing(adminClient);
|
54
55
|
const configuration = new Configuration(adminClient);
|
55
|
-
|
56
|
+
const acl = new Acl(adminClient);
|
56
57
|
|
57
58
|
const node = new Node(adminClient);
|
58
59
|
const waitlist = new WaitlistService(adminClient);
|
@@ -75,7 +76,7 @@ export async function getSDKForCurrentUser() {
|
|
75
76
|
subscription,
|
76
77
|
pricing,
|
77
78
|
configuration,
|
78
|
-
|
79
|
+
acl,
|
79
80
|
node,
|
80
81
|
waitlist,
|
81
82
|
agent,
|
@@ -0,0 +1,52 @@
|
|
1
|
+
import { cookies } from "next/headers";
|
2
|
+
import { getAppcondaClient } from "./getAppcondaClient";
|
3
|
+
import { Account, TenantService } from "./modules";
|
4
|
+
import { Databases } from "./services/databases";
|
5
|
+
import { Projects } from "./services/projects";
|
6
|
+
import { Roles } from "./services/roles";
|
7
|
+
import { Schemas } from "./services/schema";
|
8
|
+
import { Teams } from "./services/teams";
|
9
|
+
import { Users } from "./services/users";
|
10
|
+
import { Permissions } from "./services/permissions";
|
11
|
+
|
12
|
+
export async function getSDKForTenant(tenantId: string) {
|
13
|
+
const adminClient = await getAppcondaClient();
|
14
|
+
adminClient.setProject(tenantId);
|
15
|
+
adminClient.setMode('admin');
|
16
|
+
|
17
|
+
const c = await cookies()
|
18
|
+
const s = c.get('a_session') || c.get('a_session_console_legacy');
|
19
|
+
if (!s || !s.value) {
|
20
|
+
throw new Error("No session");
|
21
|
+
}
|
22
|
+
|
23
|
+
adminClient.setSession(s.value);
|
24
|
+
|
25
|
+
const accounts = new Account(adminClient);
|
26
|
+
const databases = new Databases(adminClient);
|
27
|
+
|
28
|
+
const projects = new Projects(adminClient);
|
29
|
+
|
30
|
+
const currentUser = await accounts.get();
|
31
|
+
|
32
|
+
const users = new Users(adminClient);
|
33
|
+
const teams = new Teams(adminClient);
|
34
|
+
|
35
|
+
const tenants = new TenantService(adminClient);
|
36
|
+
const roles = new Roles(adminClient);
|
37
|
+
const permissions = new Permissions(adminClient);
|
38
|
+
const schemas = new Schemas(adminClient);
|
39
|
+
|
40
|
+
return {
|
41
|
+
currentUser,
|
42
|
+
accounts,
|
43
|
+
databases,
|
44
|
+
projects,
|
45
|
+
users,
|
46
|
+
teams,
|
47
|
+
tenants,
|
48
|
+
roles,
|
49
|
+
permissions,
|
50
|
+
schemas
|
51
|
+
}
|
52
|
+
}
|
package/src/index.ts
CHANGED
@@ -37,6 +37,7 @@ export { MessagingProviderType } from './enums/messaging-provider-type';
|
|
37
37
|
export { getSDKForCurrentUser } from './getSDKForCurrentUser';
|
38
38
|
export { getSDKForService } from './getSDKForService';
|
39
39
|
export { getAppcondaClient } from './getAppcondaClient';
|
40
|
+
export { getSDKForTenant } from './getSDKForTenant';
|
40
41
|
export * from './modules';
|
41
42
|
export type { SafeActionFn } from 'next-safe-action';
|
42
43
|
export * from './actions';
|
@@ -0,0 +1,55 @@
|
|
1
|
+
|
2
|
+
import { Payload } from "../../client";
|
3
|
+
import { ServiceClient } from "../../service-client";
|
4
|
+
|
5
|
+
type Blacklist = {
|
6
|
+
id: string
|
7
|
+
createdAt: Date
|
8
|
+
type: string
|
9
|
+
value: string
|
10
|
+
active: boolean
|
11
|
+
registerAttempts: number
|
12
|
+
}
|
13
|
+
|
14
|
+
export class Acl extends ServiceClient {
|
15
|
+
|
16
|
+
protected getServiceName(): string {
|
17
|
+
return 'com.appconda.service.acl';
|
18
|
+
}
|
19
|
+
|
20
|
+
public async getBlacklist(
|
21
|
+
filters?: any,
|
22
|
+
pagination?: { page: number; pageSize: number }
|
23
|
+
): Promise<{ items: Blacklist[]; pagination: any }> {
|
24
|
+
|
25
|
+
const payload: Payload = {};
|
26
|
+
|
27
|
+
return await this.actionCall('GetBlackList', payload);
|
28
|
+
|
29
|
+
}
|
30
|
+
|
31
|
+
public async addToBlackList(type: string, value: string ): Promise<Blacklist> {
|
32
|
+
|
33
|
+
const payload: Payload = {};
|
34
|
+
payload['type'] = type;
|
35
|
+
payload['value'] = value;
|
36
|
+
return await this.actionCall('AddToBlackList', payload);
|
37
|
+
|
38
|
+
}
|
39
|
+
|
40
|
+
public async deleteFromBlackList(type: string, value: string ): Promise<boolean> {
|
41
|
+
|
42
|
+
const payload: Payload = {};
|
43
|
+
payload['type'] = type;
|
44
|
+
payload['value'] = value;
|
45
|
+
return await this.actionCall('DeleteFromBlackList', payload);
|
46
|
+
|
47
|
+
}
|
48
|
+
|
49
|
+
public async getAllTenantIpAddresses(): Promise<{ items: any[]; pagination: PaginationDto }> {
|
50
|
+
|
51
|
+
const payload: Payload = {};
|
52
|
+
return await this.actionCall('GetAllTenantIpAddresses', payload);
|
53
|
+
|
54
|
+
}
|
55
|
+
}
|