@conduitplatform/grpc-sdk 0.16.25 → 0.17.0-alpha.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.
Files changed (78) hide show
  1. package/LICENSE +21 -0
  2. package/dist/index.cjs +18092 -14811
  3. package/dist/index.cjs.map +1 -1
  4. package/dist/index.d.cts +3388 -0
  5. package/dist/index.d.ts +3308 -21
  6. package/dist/index.esm.js +17840 -14619
  7. package/dist/index.esm.js.map +1 -1
  8. package/dist/module.proto +25 -0
  9. package/package.json +32 -36
  10. package/dist/classes/ConduitAuthorizedResource.d.ts +0 -12
  11. package/dist/classes/ConduitModule.d.ts +0 -28
  12. package/dist/classes/ConduitSchema.d.ts +0 -10
  13. package/dist/classes/Error.d.ts +0 -11
  14. package/dist/classes/HealthCheck.d.ts +0 -1
  15. package/dist/classes/index.d.ts +0 -5
  16. package/dist/constants/enums/PlatformTypesEnum.d.ts +0 -10
  17. package/dist/constants/enums/index.d.ts +0 -1
  18. package/dist/constants/index.d.ts +0 -1
  19. package/dist/interceptors/grpcSignedToken.d.ts +0 -2
  20. package/dist/interceptors/index.d.ts +0 -2
  21. package/dist/interceptors/moduleName.d.ts +0 -2
  22. package/dist/interfaces/ConduitMiddleware.d.ts +0 -7
  23. package/dist/interfaces/ConduitRoute.d.ts +0 -7
  24. package/dist/interfaces/ConduitRouteReturn.d.ts +0 -48
  25. package/dist/interfaces/ConduitSchemaExtension.d.ts +0 -5
  26. package/dist/interfaces/GrpcCallback.d.ts +0 -4
  27. package/dist/interfaces/IConduitLogger.d.ts +0 -13
  28. package/dist/interfaces/IConduitMetrics.d.ts +0 -16
  29. package/dist/interfaces/Indexable.d.ts +0 -9
  30. package/dist/interfaces/Model.d.ts +0 -170
  31. package/dist/interfaces/Params.d.ts +0 -8
  32. package/dist/interfaces/ProxyRoute.d.ts +0 -42
  33. package/dist/interfaces/RawQuery.d.ts +0 -22
  34. package/dist/interfaces/Route.d.ts +0 -71
  35. package/dist/interfaces/Socket.d.ts +0 -22
  36. package/dist/interfaces/UntypedArray.d.ts +0 -1
  37. package/dist/interfaces/index.d.ts +0 -16
  38. package/dist/interfaces/types.d.ts +0 -38
  39. package/dist/modules/admin/index.d.ts +0 -9
  40. package/dist/modules/authentication/index.d.ts +0 -23
  41. package/dist/modules/authorization/index.d.ts +0 -20
  42. package/dist/modules/chat/index.d.ts +0 -9
  43. package/dist/modules/config/index.d.ts +0 -33
  44. package/dist/modules/core/index.d.ts +0 -6
  45. package/dist/modules/database/index.d.ts +0 -63
  46. package/dist/modules/database/types.d.ts +0 -17
  47. package/dist/modules/email/index.d.ts +0 -36
  48. package/dist/modules/index.d.ts +0 -12
  49. package/dist/modules/pushNotifications/index.d.ts +0 -24
  50. package/dist/modules/pushNotifications/types.d.ts +0 -7
  51. package/dist/modules/router/index.d.ts +0 -10
  52. package/dist/modules/sms/index.d.ts +0 -9
  53. package/dist/modules/storage/index.d.ts +0 -24
  54. package/dist/modules/storage/types.d.ts +0 -24
  55. package/dist/protoUtils/authentication.d.ts +0 -665
  56. package/dist/protoUtils/authorization.d.ts +0 -524
  57. package/dist/protoUtils/chat.d.ts +0 -142
  58. package/dist/protoUtils/core.d.ts +0 -569
  59. package/dist/protoUtils/database.d.ts +0 -864
  60. package/dist/protoUtils/email.d.ts +0 -266
  61. package/dist/protoUtils/google/protobuf/empty.d.ts +0 -25
  62. package/dist/protoUtils/grpc_health_check.d.ts +0 -88
  63. package/dist/protoUtils/index.d.ts +0 -12
  64. package/dist/protoUtils/module.d.ts +0 -251
  65. package/dist/protoUtils/push-notifications.d.ts +0 -225
  66. package/dist/protoUtils/router.d.ts +0 -205
  67. package/dist/protoUtils/sms.d.ts +0 -147
  68. package/dist/protoUtils/storage.d.ts +0 -354
  69. package/dist/types/db.d.ts +0 -26
  70. package/dist/types/index.d.ts +0 -28
  71. package/dist/types/options.d.ts +0 -7
  72. package/dist/utilities/EventBus.d.ts +0 -12
  73. package/dist/utilities/RedisManager.d.ts +0 -24
  74. package/dist/utilities/StateManager.d.ts +0 -19
  75. package/dist/utilities/env.d.ts +0 -1
  76. package/dist/utilities/index.d.ts +0 -5
  77. package/dist/utilities/normalizeOptions.d.ts +0 -3
  78. package/dist/utilities/sleep.d.ts +0 -1
@@ -1,71 +0,0 @@
1
- import { allowedTypes, ConduitModel, TYPE } from './Model.js';
2
- import { Indexable } from './Indexable.js';
3
- export interface ModuleErrorDefinition {
4
- grpcCode: number;
5
- conduitCode: string;
6
- message: string;
7
- description: string;
8
- }
9
- export interface ConduitRouteParameters {
10
- params?: Indexable;
11
- path?: string;
12
- headers: Indexable;
13
- context?: Indexable;
14
- cookies?: Indexable;
15
- bodyParams?: Indexable;
16
- urlParams?: Indexable;
17
- queryParams?: Indexable;
18
- }
19
- type AllowedTypes = TYPE.String | TYPE.Number | TYPE.Boolean | TYPE.Date | TYPE.ObjectId;
20
- export type ConduitUrlParam = AllowedTypes | {
21
- type: AllowedTypes;
22
- required?: boolean;
23
- };
24
- export type ConduitQueryParam = ConduitUrlParam | AllowedTypes[] | {
25
- type: AllowedTypes[];
26
- required: boolean;
27
- } | {
28
- type: AllowedTypes;
29
- required?: boolean;
30
- }[];
31
- export type ConduitUrlParams = {
32
- [field in string]: ConduitUrlParam;
33
- };
34
- export type ConduitQueryParams = {
35
- [field in string]: ConduitQueryParam;
36
- };
37
- export type ConduitReturnField = keyof typeof TYPE | TYPE | ConduitModel | {
38
- [key: string]: TYPE | TYPE[] | ConduitModel | ConduitModel[];
39
- };
40
- export type ConduitReturnModel = {
41
- [field: string]: ConduitReturnField | allowedTypes | allowedTypes[] | string | string[];
42
- };
43
- export type ConduitReturn = ConduitReturnField | ConduitReturnModel | string;
44
- export declare enum ConduitRouteActions {
45
- GET = "GET",
46
- POST = "POST",
47
- UPDATE = "PUT",
48
- PATCH = "PATCH",
49
- DELETE = "DELETE"
50
- }
51
- export interface ConduitRouteOptions {
52
- queryParams?: ConduitQueryParams;
53
- bodyParams?: ConduitModel;
54
- urlParams?: ConduitUrlParams;
55
- action: ConduitRouteActions;
56
- path: string;
57
- name?: string;
58
- description?: string;
59
- middlewares?: string[];
60
- cacheControl?: string;
61
- errors?: ModuleErrorDefinition[];
62
- }
63
- export interface ConduitRouteObject {
64
- options: ConduitRouteOptions;
65
- returns: {
66
- name: string;
67
- fields: ConduitReturn;
68
- };
69
- grpcFunction: string;
70
- }
71
- export {};
@@ -1,22 +0,0 @@
1
- import { TYPE } from './Model.js';
2
- export type ConduitSocketParamTypes = (TYPE | ConduitSocketParamTypes)[];
3
- export interface ConduitSocketOptions {
4
- path: string;
5
- name?: string;
6
- description?: string;
7
- middlewares?: string[];
8
- }
9
- export interface EventsProtoDescription {
10
- [name: string]: {
11
- grpcFunction: string;
12
- params: string;
13
- returns: {
14
- name: string;
15
- fields: string;
16
- };
17
- };
18
- }
19
- export interface SocketProtoDescription {
20
- options: ConduitSocketOptions;
21
- events: string;
22
- }
@@ -1 +0,0 @@
1
- export type UntypedArray = any[];
@@ -1,16 +0,0 @@
1
- export * from './ConduitMiddleware.js';
2
- export * from './ConduitRoute.js';
3
- export * from './ProxyRoute.js';
4
- export * from './Route.js';
5
- export * from './Socket.js';
6
- export * from './types.js';
7
- export * from './Model.js';
8
- export * from './GrpcCallback.js';
9
- export * from './Indexable.js';
10
- export * from './RawQuery.js';
11
- export * from './UntypedArray.js';
12
- export * from './Params.js';
13
- export * from './ConduitRouteReturn.js';
14
- export * from './ConduitSchemaExtension.js';
15
- export * from './IConduitLogger.js';
16
- export * from './IConduitMetrics.js';
@@ -1,38 +0,0 @@
1
- import { Context, Cookies, Indexable, Params } from './Indexable.js';
2
- import { GrpcRequest } from '../types/index.js';
3
- export type ParsedRouterRequest = GrpcRequest<{
4
- params: Params;
5
- urlParams: Params;
6
- queryParams: Params;
7
- bodyParams: Params;
8
- path: string;
9
- headers: Headers & {
10
- authorization?: string;
11
- };
12
- context: Context;
13
- cookies: Cookies;
14
- }>;
15
- export type UnparsedRouterResponse = {
16
- result?: Indexable;
17
- redirect?: string;
18
- setCookies: Cookies[];
19
- removeCookies: Cookies[];
20
- } | Indexable | string;
21
- export type ParsedSocketRequest = GrpcRequest<{
22
- event: string;
23
- socketId: string;
24
- params: (string | Indexable)[];
25
- context: Context;
26
- cookies: Cookies;
27
- }>;
28
- type EventResponse = {
29
- event: string;
30
- data: Indexable;
31
- receivers?: string[];
32
- rooms?: string[];
33
- };
34
- export type UnparsedSocketResponse = EventResponse | JoinRoomResponse;
35
- type JoinRoomResponse = {
36
- rooms: string[];
37
- };
38
- export {};
@@ -1,9 +0,0 @@
1
- import { ConduitModule } from '../../classes/index.js';
2
- import { AdminDefinition, RegisterAdminRouteRequest_PathDefinition } from '../../protoUtils/index.js';
3
- import { ConduitRouteActions } from '../../interfaces/index.js';
4
- export declare class Admin extends ConduitModule<typeof AdminDefinition> {
5
- readonly moduleName: string;
6
- constructor(moduleName: string, url: string, grpcToken?: string);
7
- register(paths: RegisterAdminRouteRequest_PathDefinition[], serverUrl?: string): Promise<any>;
8
- patchRouteMiddlewares(path: string, action: ConduitRouteActions, middlewares: string[]): Promise<import("../../protoUtils/google/protobuf/empty.js").Empty>;
9
- }
@@ -1,23 +0,0 @@
1
- import { ConduitModule } from '../../classes/index.js';
2
- import { AuthenticationDefinition, TeamDeleteResponse, UserCreateResponse, UserDeleteResponse, UserLoginResponse, Team, ValidateAccessTokenResponse, UserModifyStatusResponse, InvitationDeleteResponse, InviteUserToTeamResponse } from '../../protoUtils/index.js';
3
- import { Indexable } from '../../interfaces';
4
- export declare class Authentication extends ConduitModule<typeof AuthenticationDefinition> {
5
- private readonly moduleName;
6
- constructor(moduleName: string, url: string, grpcToken?: string);
7
- userLogin(userId: string, clientId: string): Promise<UserLoginResponse>;
8
- userDelete(userId: string): Promise<UserDeleteResponse>;
9
- userCreate(email: string, verify?: boolean, password?: string, anonymousId?: string, userData?: Indexable): Promise<UserCreateResponse>;
10
- userCreateByUsername(username: string, password?: string, anonymousId?: string): Promise<UserCreateResponse>;
11
- anonymousUserCreate(clientId: string): Promise<UserLoginResponse>;
12
- changePass(email: string, password?: string): Promise<UserCreateResponse>;
13
- getTeam(teamId: string): Promise<Team>;
14
- createTeam(name: string, parentTeam?: string, isDefault?: boolean): Promise<Team>;
15
- teamDelete(teamId: string): Promise<TeamDeleteResponse>;
16
- addTeamMembers(teamId: string, memberIds: string[]): Promise<import("../../protoUtils/google/protobuf/empty.js").Empty>;
17
- removeTeamMembers(teamId: string, memberIds: string[]): Promise<import("../../protoUtils/google/protobuf/empty.js").Empty>;
18
- validateAccessToken(accessToken: string, path?: string): Promise<ValidateAccessTokenResponse>;
19
- userModifyStatus(userId: string, active: boolean): Promise<UserModifyStatusResponse>;
20
- invitationDelete(teamId: string, email: string): Promise<InvitationDeleteResponse>;
21
- inviteUserToTeam(teamId: string, email: string, role: string, inviterUserId: string, redirectUri?: string, userData?: Indexable): Promise<InviteUserToTeamResponse>;
22
- updateTeam(teamId: string, name?: string, newParentTeamId?: string): Promise<Team>;
23
- }
@@ -1,20 +0,0 @@
1
- import { ConduitModule } from '../../classes/index.js';
2
- import { AllowedResourcesRequest, AllowedResourcesResponse, AuthorizationDefinition, Decision, DeleteAllRelationsRequest, FindRelationRequest, FindRelationResponse, PermissionCheck, PermissionRequest, Relation, Resource, ResourceAccessListRequest, ResourceAccessListResponse } from '../../protoUtils/index.js';
3
- import { Empty } from '../../protoUtils/google/protobuf/empty.js';
4
- export declare class Authorization extends ConduitModule<typeof AuthorizationDefinition> {
5
- private readonly moduleName;
6
- constructor(moduleName: string, url: string, grpcToken?: string);
7
- defineResource(data: Resource): Promise<Empty>;
8
- updateResource(data: Resource): Promise<Empty>;
9
- deleteResource(data: Resource): Promise<unknown>;
10
- deleteRelation(data: Relation): Promise<unknown>;
11
- deleteAllRelations(data: DeleteAllRelationsRequest): Promise<unknown>;
12
- createRelation(data: Relation): Promise<unknown>;
13
- createRelations(subject: string, relation: string, resources: string[]): Promise<unknown>;
14
- findRelation(data: FindRelationRequest): Promise<FindRelationResponse>;
15
- can(data: PermissionCheck): Promise<Decision>;
16
- grantPermission(data: PermissionRequest): Promise<unknown>;
17
- removePermission(data: PermissionRequest): Promise<unknown>;
18
- getAllowedResources(data: AllowedResourcesRequest): Promise<AllowedResourcesResponse>;
19
- createResourceAccessList(data: ResourceAccessListRequest): Promise<ResourceAccessListResponse>;
20
- }
@@ -1,9 +0,0 @@
1
- import { ConduitModule } from '../../classes/index.js';
2
- import { ChatDefinition, Room, SendMessageRequest } from '../../protoUtils/chat.js';
3
- export declare class Chat extends ConduitModule<typeof ChatDefinition> {
4
- private readonly moduleName;
5
- constructor(moduleName: string, url: string, grpcToken?: string);
6
- sendMessage(messageData: SendMessageRequest): Promise<any>;
7
- createRoom(name: string, participants: string[]): Promise<Room>;
8
- deleteRoom(id: string): Promise<Room>;
9
- }
@@ -1,33 +0,0 @@
1
- import { EventEmitter } from 'events';
2
- import { ConduitModule } from '../../classes/index.js';
3
- import { HealthCheckStatus } from '../../types/index.js';
4
- import { ConfigDefinition } from '../../protoUtils/index.js';
5
- import { ClusterOptions, RedisOptions } from 'ioredis';
6
- export declare class Config extends ConduitModule<typeof ConfigDefinition> {
7
- readonly url: string;
8
- private readonly emitter;
9
- private coreLive;
10
- private readonly _serviceHealthStatusGetter?;
11
- constructor(moduleName: string, url: string, serviceHealthStatusGetter?: () => HealthCheckStatus, grpcToken?: string);
12
- getServerConfig(): Promise<any>;
13
- getModuleUrlByName(name: string): Promise<{
14
- url: string;
15
- }>;
16
- get(name: string): Promise<any>;
17
- configure(config: any, schema: any, override: boolean): Promise<any>;
18
- moduleExists(name: string): Promise<import("../../index.js").ModuleExistsResponse>;
19
- moduleList(): Promise<any[]>;
20
- getRedisDetails(): Promise<{
21
- standalone?: RedisOptions;
22
- cluster?: ClusterOptions;
23
- redisHost?: string;
24
- redisPort?: number;
25
- redisUsername?: string;
26
- redisPassword?: string;
27
- redisConfig?: string;
28
- }>;
29
- registerModule(name: string, url: string, healthStatus: Omit<HealthCheckStatus, HealthCheckStatus.SERVICE_UNKNOWN>): Promise<boolean>;
30
- moduleHealthProbe(name: string, url: string): void;
31
- getModuleWatcher(): EventEmitter<[never]>;
32
- watchModules(): Promise<void>;
33
- }
@@ -1,6 +0,0 @@
1
- import { ConduitModule } from '../../classes/index.js';
2
- import { CoreDefinition } from '../../protoUtils/core.js';
3
- export declare class Core extends ConduitModule<typeof CoreDefinition> {
4
- private readonly moduleName;
5
- constructor(moduleName: string, url: string, grpcToken?: string);
6
- }
@@ -1,63 +0,0 @@
1
- import { ConduitModule, ConduitSchema } from '../../classes/index.js';
2
- import { DatabaseProviderDefinition, DropCollectionResponse, Schema } from '../../protoUtils/database.js';
3
- import { ConduitSchemaExtension, Indexable, RawQuery, UntypedArray } from '../../interfaces/index.js';
4
- import { Query } from '../../types/db.js';
5
- import { FindOneOptions, FindManyOptions } from './types.js';
6
- import { AuthzOptions, PopulateAuthzOptions } from '../../types/options.js';
7
- export declare class DatabaseProvider extends ConduitModule<typeof DatabaseProviderDefinition> {
8
- private readonly moduleName;
9
- constructor(moduleName: string, url: string, grpcToken?: string);
10
- getSchema(schemaName: string): Promise<{
11
- name: string;
12
- fields: any;
13
- modelOptions: any;
14
- collectionName: string;
15
- fieldHash: string;
16
- }>;
17
- getSchemas(): Promise<{
18
- name: string;
19
- fields: any;
20
- modelOptions: any;
21
- fieldHash: string;
22
- }[]>;
23
- deleteSchema(schemaName: string, deleteData: boolean): Promise<DropCollectionResponse>;
24
- createSchemaFromAdapter(schema: ConduitSchema): Promise<Schema>;
25
- setSchemaExtension(extension: ConduitSchemaExtension): Promise<Schema>;
26
- processQuery<T>(query: Query<T>): string;
27
- findOne<T>(schemaName: string, query: Query<T>, select?: string, populate?: string | string[], userId?: string, scope?: string): Promise<T>;
28
- findOne<T>(schemaName: string, query: Query<T>, options?: FindOneOptions): Promise<T>;
29
- findMany<T>(schemaName: string, query: Query<T>, select?: string, skip?: number, limit?: number, sort?: {
30
- [field: string]: -1 | 1;
31
- } | string[] | string, populate?: string | string[], userId?: string, scope?: string): Promise<T[]>;
32
- findMany<T>(schemaName: string, query: Query<T>, options?: FindManyOptions): Promise<T[]>;
33
- create<T>(schemaName: string, query: Query<T>, userId?: string, scope?: string): Promise<T>;
34
- create<T>(schemaName: string, query: Query<T>, options?: AuthzOptions): Promise<T>;
35
- createMany<T>(schemaName: string, query: Query<T>[], userId?: string, scope?: string): Promise<T[] | UntypedArray>;
36
- createMany<T>(schemaName: string, query: Query<T>[], options?: AuthzOptions): Promise<T[] | UntypedArray>;
37
- findByIdAndUpdate<T>(schemaName: string, id: string, document: Query<T>, populate?: string | string[], userId?: string, scope?: string): Promise<T | any>;
38
- findByIdAndUpdate<T>(schemaName: string, id: string, document: Query<T>, options?: PopulateAuthzOptions): Promise<T | any>;
39
- findByIdAndReplace<T>(schemaName: string, id: string, document: Query<T>, populate?: string | string[], userId?: string, scope?: string): Promise<T | any>;
40
- findByIdAndReplace<T>(schemaName: string, id: string, document: Query<T>, options?: PopulateAuthzOptions): Promise<T | any>;
41
- updateMany<T>(schemaName: string, filterQuery: Query<T>, query: Query<T>, populate?: string | string[], userId?: string, scope?: string): Promise<any>;
42
- updateMany<T>(schemaName: string, filterQuery: Query<T>, query: Query<T>, options?: PopulateAuthzOptions): Promise<any>;
43
- updateOne<T>(schemaName: string, filterQuery: Query<T>, query: Query<T>, populate?: string | string[], userId?: string, scope?: string): Promise<any>;
44
- updateOne<T>(schemaName: string, filterQuery: Query<T>, query: Query<T>, options?: PopulateAuthzOptions): Promise<any>;
45
- replaceOne<T>(schemaName: string, filterQuery: Query<T>, query: Query<T>, populate?: string | string[], userId?: string, scope?: string): Promise<any>;
46
- replaceOne<T>(schemaName: string, filterQuery: Query<T>, query: Query<T>, options?: PopulateAuthzOptions): Promise<any>;
47
- deleteOne<T>(schemaName: string, query: Query<T>, userId?: string, scope?: string): Promise<any>;
48
- deleteOne<T>(schemaName: string, query: Query<T>, options?: AuthzOptions): Promise<any>;
49
- deleteMany<T>(schemaName: string, query: Query<T>, userId?: string, scope?: string): Promise<any>;
50
- deleteMany<T>(schemaName: string, query: Query<T>, options?: AuthzOptions): Promise<any>;
51
- countDocuments<T>(schemaName: string, query: Query<T>, userId?: string, scope?: string): Promise<number>;
52
- countDocuments<T>(schemaName: string, query: Query<T>, options?: AuthzOptions): Promise<number>;
53
- rawQuery(schemaName: string, query: RawQuery): Promise<any>;
54
- createView(schemaName: string, viewName: string, joinedSchemas: string[], query: {
55
- mongoQuery?: Indexable;
56
- sqlQuery?: string;
57
- }): Promise<import("../../protoUtils/google/protobuf/empty.js").Empty>;
58
- deleteView(viewName: string): Promise<import("../../protoUtils/google/protobuf/empty.js").Empty>;
59
- columnExistence(schemaName: string, columns: string[]): Promise<boolean>;
60
- migrate(schemaName: string): Promise<import("../../protoUtils/google/protobuf/empty.js").Empty>;
61
- getDatabaseType(): Promise<import("../../protoUtils/database.js").GetDatabaseTypeResponse>;
62
- private constructSortObj;
63
- }
@@ -1,17 +0,0 @@
1
- export type FindOneOptions = {
2
- select?: string;
3
- populate?: string | string[];
4
- userId?: string;
5
- scope?: string;
6
- };
7
- export type FindManyOptions = {
8
- select?: string;
9
- skip?: number;
10
- limit?: number;
11
- sort?: {
12
- [field: string]: -1 | 1;
13
- } | string[] | string;
14
- populate?: string | string[];
15
- userId?: string;
16
- scope?: string;
17
- };
@@ -1,36 +0,0 @@
1
- import { ConduitModule } from '../../classes/index.js';
2
- import { EmailDefinition } from '../../protoUtils/email.js';
3
- export declare class Email extends ConduitModule<typeof EmailDefinition> {
4
- private readonly moduleName;
5
- constructor(moduleName: string, url: string, grpcToken?: string);
6
- registerTemplate(template: {
7
- name: string;
8
- subject: string;
9
- body: string;
10
- variables: string[];
11
- sender?: string;
12
- }): Promise<any>;
13
- updateTemplate(templateId: string, params: {
14
- name?: string;
15
- subject?: string;
16
- body?: string;
17
- variables?: string[];
18
- sender?: string;
19
- }): Promise<any>;
20
- sendEmail(templateName: string, params: {
21
- email: string;
22
- variables: any;
23
- sender?: string;
24
- replyTo?: string;
25
- cc?: string[];
26
- attachments?: {
27
- filename: string;
28
- contentType?: string;
29
- content?: Buffer;
30
- href?: string;
31
- httpHeaders?: Record<string, string>;
32
- }[];
33
- }): Promise<string>;
34
- resendEmail(emailRecordId: string): Promise<string>;
35
- getEmailStatus(messageId: string): Promise<any>;
36
- }
@@ -1,12 +0,0 @@
1
- export * from './storage/index.js';
2
- export * from './router/index.js';
3
- export * from './email/index.js';
4
- export * from './database/index.js';
5
- export * from './config/index.js';
6
- export * from './core/index.js';
7
- export * from './admin/index.js';
8
- export * from './pushNotifications/index.js';
9
- export * from './sms/index.js';
10
- export * from './chat/index.js';
11
- export * from './authorization/index.js';
12
- export * from './authentication/index.js';
@@ -1,24 +0,0 @@
1
- import { ConduitModule } from '../../classes/index.js';
2
- import { PushNotificationsDefinition, SendNotificationResponse } from '../../protoUtils/index.js';
3
- import { SendNotificationOptions } from './types';
4
- export declare class PushNotifications extends ConduitModule<typeof PushNotificationsDefinition> {
5
- private readonly moduleName;
6
- constructor(moduleName: string, url: string, grpcToken?: string);
7
- sendNotificationToken(token: string, platform: string, userId: string): Promise<any>;
8
- getNotificationTokens(userId: string): Promise<any[]>;
9
- sendNotification(sendTo: string, title: string, body?: string, data?: string, platform?: string, doNotStore?: boolean, isSilent?: boolean): Promise<SendNotificationResponse>;
10
- sendNotification(sendTo: string, title: string, options?: SendNotificationOptions): Promise<SendNotificationResponse>;
11
- sendManyNotifications(notifications: [
12
- {
13
- sendTo: string;
14
- title: string;
15
- body?: string;
16
- data?: string;
17
- platform?: string;
18
- doNotStore?: boolean;
19
- isSilent?: boolean;
20
- }
21
- ]): Promise<SendNotificationResponse>;
22
- sendNotificationToManyDevices(sendTo: string[], title: string, body?: string, data?: string, platform?: string, doNotStore?: boolean, isSilent?: boolean): Promise<SendNotificationResponse>;
23
- sendNotificationToManyDevices(sendTo: string[], title: string, options?: SendNotificationOptions): Promise<SendNotificationResponse>;
24
- }
@@ -1,7 +0,0 @@
1
- export type SendNotificationOptions = {
2
- body?: string;
3
- data?: string;
4
- platform?: string;
5
- doNotStore?: boolean;
6
- isSilent?: boolean;
7
- };
@@ -1,10 +0,0 @@
1
- import { ConduitModule } from '../../classes/index.js';
2
- import { RegisterConduitRouteRequest_PathDefinition, RouterDefinition, SocketData } from '../../protoUtils/router.js';
3
- import { ConduitRouteActions } from '../../interfaces/index.js';
4
- export declare class Router extends ConduitModule<typeof RouterDefinition> {
5
- readonly moduleName: string;
6
- constructor(moduleName: string, url: string, grpcToken?: string);
7
- register(paths: RegisterConduitRouteRequest_PathDefinition[], url?: string): Promise<any>;
8
- socketPush(data: SocketData): Promise<import("../../protoUtils/google/protobuf/empty.js").Empty>;
9
- patchRouteMiddlewares(path: string, action: ConduitRouteActions, middlewares: string[]): Promise<import("../../protoUtils/google/protobuf/empty.js").Empty>;
10
- }
@@ -1,9 +0,0 @@
1
- import { ConduitModule } from '../../classes/index.js';
2
- import { SendSmsResponse, SendVerificationCodeResponse, SmsDefinition, VerifyResponse } from '../../protoUtils/sms.js';
3
- export declare class SMS extends ConduitModule<typeof SmsDefinition> {
4
- private readonly moduleName;
5
- constructor(moduleName: string, url: string, grpcToken?: string);
6
- sendSms(to: string, message: string): Promise<SendSmsResponse>;
7
- sendVerificationCode(to: string): Promise<SendVerificationCodeResponse>;
8
- verify(verificationSid: string, code: string): Promise<VerifyResponse>;
9
- }
@@ -1,24 +0,0 @@
1
- import { ConduitModule } from '../../classes/index.js';
2
- import { DeleteFileResponse, FileByUrlResponse, FileResponse, GetFileDataResponse, GetFileUrlResponse, StorageDefinition } from '../../protoUtils/storage.js';
3
- import { AuthzOptions } from '../../types';
4
- import { CreateFileByURLOptions, CreateFileOptions, UpdateFileByURLOptions, UpdateFileOptions } from './types';
5
- export declare class Storage extends ConduitModule<typeof StorageDefinition> {
6
- private readonly moduleName;
7
- constructor(moduleName: string, url: string, grpcToken?: string);
8
- getFile(id: string, userId?: string, scope?: string): Promise<FileResponse>;
9
- getFile(id: string, options?: AuthzOptions): Promise<FileResponse>;
10
- getFileUrl(id: string, userId?: string, scope?: string): Promise<GetFileUrlResponse>;
11
- getFileUrl(id: string, options?: AuthzOptions): Promise<GetFileUrlResponse>;
12
- getFileData(id: string, userId?: string, scope?: string): Promise<GetFileDataResponse>;
13
- getFileData(id: string, options?: AuthzOptions): Promise<GetFileDataResponse>;
14
- createFile(name: string | undefined, data: string, folder?: string, container?: string, mimeType?: string, isPublic?: boolean, userId?: string, scope?: string, alias?: string): Promise<FileResponse>;
15
- createFile(name: string | undefined, data: string, options?: CreateFileOptions): Promise<FileResponse>;
16
- updateFile(id: string, data: string, name?: string, folder?: string, container?: string, mimeType?: string, userId?: string, scope?: string, alias?: string): Promise<FileResponse>;
17
- updateFile(id: string, data: string, options?: UpdateFileOptions): Promise<FileResponse>;
18
- deleteFile(id: string, userId?: string, scope?: string): Promise<DeleteFileResponse>;
19
- deleteFile(id: string, options?: AuthzOptions): Promise<DeleteFileResponse>;
20
- createFileByUrl(name: string | undefined, folder?: string, container?: string, mimeType?: string, size?: number, isPublic?: boolean, userId?: string, scope?: string, alias?: string): Promise<FileByUrlResponse>;
21
- createFileByUrl(name: string | undefined, options?: CreateFileByURLOptions): Promise<FileByUrlResponse>;
22
- updateFileByUrl(id: string, name?: string, folder?: string, container?: string, mimeType?: string, size?: number, userId?: string, scope?: string, alias?: string): Promise<FileByUrlResponse>;
23
- updateFileByUrl(id: string, options?: UpdateFileByURLOptions): Promise<FileByUrlResponse>;
24
- }
@@ -1,24 +0,0 @@
1
- export type CreateFileOptions = {
2
- folder?: string;
3
- container?: string;
4
- mimeType?: string;
5
- isPublic?: boolean;
6
- userId?: string;
7
- scope?: string;
8
- alias?: string;
9
- };
10
- export type UpdateFileOptions = {
11
- name?: string;
12
- folder?: string;
13
- container?: string;
14
- mimeType?: string;
15
- userId?: string;
16
- scope?: string;
17
- alias?: string;
18
- };
19
- export type CreateFileByURLOptions = {
20
- size?: number;
21
- } & CreateFileOptions;
22
- export type UpdateFileByURLOptions = {
23
- size?: number;
24
- } & UpdateFileOptions;