@nlabs/reaktor 0.9.0 → 0.10.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/README.md +9 -0
- package/coverage/index.html +92 -47
- package/dist/actions/apps.js +242 -0
- package/dist/actions/connections.js +90 -0
- package/dist/actions/conversations.js +350 -0
- package/dist/actions/dynamodb.js +150 -0
- package/dist/actions/email.js +152 -0
- package/dist/actions/files.js +283 -0
- package/dist/actions/groups.js +292 -0
- package/dist/actions/images.js +735 -0
- package/dist/actions/index.js +66 -0
- package/dist/actions/ios.js +164 -0
- package/dist/actions/locations.js +122 -0
- package/dist/actions/messages.js +208 -0
- package/dist/actions/notifications.js +59 -0
- package/dist/actions/payments.js +497 -0
- package/dist/actions/personas.js +110 -0
- package/dist/actions/posts.js +595 -0
- package/dist/actions/reactions.js +322 -0
- package/dist/actions/s3.js +133 -0
- package/dist/actions/search.js +90 -0
- package/dist/actions/sms.js +108 -0
- package/dist/actions/statistics.js +62 -0
- package/dist/actions/subscription.js +220 -0
- package/dist/actions/tags.js +292 -0
- package/dist/actions/users.js +784 -0
- package/dist/actions/websockets.js +174 -0
- package/dist/adapters/arangoAdapter.js +46 -0
- package/dist/adapters/fileAdapter.js +76 -0
- package/dist/adapters/imageAdapter.js +40 -0
- package/dist/adapters/messageAdapter.js +49 -0
- package/dist/adapters/postAdapter.js +70 -0
- package/dist/adapters/reaktorAdapter.js +44 -0
- package/dist/adapters/tagAdapter.js +50 -0
- package/dist/adapters/userAdapter.js +115 -0
- package/dist/config.js +125 -0
- package/dist/index.js +66 -0
- package/dist/lambdas/actions/websockets.js +132 -0
- package/dist/lambdas/authorizer.js +67 -0
- package/dist/lambdas/connection.js +91 -0
- package/dist/lambdas/utils/message.js +42 -0
- package/dist/lambdas/utils/websocket.js +105 -0
- package/dist/mocks/conversation.js +35 -0
- package/dist/mocks/file.js +38 -0
- package/dist/mocks/group.js +47 -0
- package/dist/mocks/image.js +44 -0
- package/dist/mocks/nlabs.png +0 -0
- package/dist/mocks/post.js +55 -0
- package/dist/mocks/tag.js +37 -0
- package/dist/mocks/user.js +88 -0
- package/dist/mutations/index.js +26 -0
- package/dist/mutations/locations.js +44 -0
- package/dist/mutations/messages.js +86 -0
- package/dist/mutations/personas.js +100 -0
- package/dist/mutations/posts.js +53 -0
- package/dist/mutations/reactions.js +51 -0
- package/dist/mutations/statistics.js +39 -0
- package/dist/mutations/subscriptions.js +56 -0
- package/dist/mutations/tags.js +120 -0
- package/dist/mutations/users.js +116 -0
- package/dist/objectTypes/app.js +173 -0
- package/dist/objectTypes/bankAccount.js +76 -0
- package/dist/objectTypes/connection.js +48 -0
- package/dist/objectTypes/conversation.js +77 -0
- package/dist/objectTypes/creditCard.js +86 -0
- package/dist/objectTypes/document.js +46 -0
- package/dist/objectTypes/error.js +46 -0
- package/dist/objectTypes/external.js +74 -0
- package/dist/objectTypes/file.js +100 -0
- package/dist/objectTypes/filter.js +43 -0
- package/dist/objectTypes/group.js +123 -0
- package/dist/objectTypes/iapSubscription.js +40 -0
- package/dist/objectTypes/image.js +129 -0
- package/dist/objectTypes/index.js +68 -0
- package/dist/objectTypes/location.js +109 -0
- package/dist/objectTypes/message.js +96 -0
- package/dist/objectTypes/passcode.js +42 -0
- package/dist/objectTypes/persona.js +87 -0
- package/dist/objectTypes/plan.js +95 -0
- package/dist/objectTypes/post.js +125 -0
- package/dist/objectTypes/reaction.js +61 -0
- package/dist/objectTypes/relation.js +49 -0
- package/dist/objectTypes/search.js +72 -0
- package/dist/objectTypes/statistics.js +39 -0
- package/dist/objectTypes/subscription.js +117 -0
- package/dist/objectTypes/tag.js +65 -0
- package/dist/objectTypes/user.js +144 -0
- package/dist/queries/index.js +33 -0
- package/dist/queries/locations.js +45 -0
- package/dist/queries/messages.js +52 -0
- package/dist/queries/posts.js +154 -0
- package/dist/queries/reactions.js +56 -0
- package/dist/queries/statistics.js +39 -0
- package/dist/queries/subscriptions.js +44 -0
- package/dist/queries/tags.js +75 -0
- package/dist/queries/users.js +64 -0
- package/dist/templates/email/layout.js +302 -0
- package/dist/templates/email/passwordForgot.js +38 -0
- package/dist/templates/email/passwordRecovery.js +35 -0
- package/dist/templates/email/verifyEmail.js +38 -0
- package/dist/templates/email/welcome.js +38 -0
- package/dist/templates/sms/passwordForgot.js +24 -0
- package/dist/templates/sms/passwordRecovery.js +24 -0
- package/dist/templates/sms/verifyEmail.js +24 -0
- package/dist/templates/sms/verifyPhone.js +24 -0
- package/dist/templates/sms/welcome.js +24 -0
- package/dist/types/apps.js +32 -0
- package/{lib → dist}/types/arangodb.js +1 -1
- package/{lib → dist}/types/auth.js +1 -1
- package/{lib → dist}/types/connections.js +1 -1
- package/dist/types/conversations.js +16 -0
- package/{lib → dist}/types/email.js +1 -1
- package/dist/types/files.js +16 -0
- package/dist/types/google.js +16 -0
- package/{lib → dist}/types/groups.js +1 -1
- package/dist/types/images.js +16 -0
- package/dist/types/index.js +60 -0
- package/{lib → dist}/types/locations.js +1 -1
- package/{lib → dist}/types/messages.js +1 -1
- package/{lib → dist}/types/notifications.js +1 -1
- package/dist/types/payments.js +16 -0
- package/dist/types/personas.js +16 -0
- package/dist/types/posts.js +16 -0
- package/{lib → dist}/types/tags.js +1 -1
- package/dist/types/users.js +16 -0
- package/dist/types/websockets.js +16 -0
- package/dist/utils/adapterUtils.js +45 -0
- package/dist/utils/analyticsUtils.js +72 -0
- package/dist/utils/arangodbUtils.js +165 -0
- package/dist/utils/auth.js +57 -0
- package/dist/utils/index.js +30 -0
- package/dist/utils/session.js +60 -0
- package/lex.config.cjs +13 -0
- package/lib/actions/apps.d.ts +3 -3
- package/lib/actions/apps.js +38 -48
- package/lib/actions/connections.d.ts +4 -0
- package/lib/actions/connections.js +90 -0
- package/lib/actions/conversations.d.ts +1 -1
- package/lib/actions/conversations.js +32 -21
- package/lib/actions/email.d.ts +1 -1
- package/lib/actions/email.js +11 -11
- package/lib/actions/files.d.ts +2 -2
- package/lib/actions/files.js +4 -8
- package/lib/actions/groups.d.ts +2 -2
- package/lib/actions/groups.js +12 -12
- package/lib/actions/images.d.ts +5 -5
- package/lib/actions/images.js +120 -66
- package/lib/actions/index.d.ts +2 -0
- package/lib/actions/index.js +5 -1
- package/lib/actions/ios.js +2 -2
- package/lib/actions/locations.d.ts +4 -3
- package/lib/actions/locations.js +16 -4
- package/lib/actions/messages.d.ts +4 -3
- package/lib/actions/messages.js +26 -23
- package/lib/actions/notifications.d.ts +1 -1
- package/lib/actions/notifications.js +1 -1
- package/lib/actions/payments.js +63 -60
- package/lib/actions/personas.d.ts +3 -0
- package/lib/actions/personas.js +110 -0
- package/lib/actions/posts.d.ts +5 -2
- package/lib/actions/posts.js +55 -41
- package/lib/actions/reactions.js +2 -2
- package/lib/actions/search.d.ts +2 -2
- package/lib/actions/search.js +5 -5
- package/lib/actions/sms.d.ts +9 -3
- package/lib/actions/sms.js +9 -7
- package/lib/actions/statistics.d.ts +1 -1
- package/lib/actions/statistics.js +2 -2
- package/lib/actions/subscription.d.ts +2 -2
- package/lib/actions/subscription.js +12 -22
- package/lib/actions/tags.d.ts +8 -3
- package/lib/actions/tags.js +46 -21
- package/lib/actions/users.d.ts +38 -13
- package/lib/actions/users.js +291 -61
- package/lib/actions/websockets.d.ts +6 -5
- package/lib/actions/websockets.js +37 -35
- package/lib/adapters/arangoAdapter.d.ts +1 -1
- package/lib/adapters/arangoAdapter.js +1 -1
- package/lib/adapters/imageAdapter.d.ts +2 -0
- package/lib/adapters/imageAdapter.js +40 -0
- package/lib/adapters/messageAdapter.d.ts +2 -0
- package/lib/adapters/messageAdapter.js +49 -0
- package/lib/adapters/postAdapter.js +4 -4
- package/lib/adapters/tagAdapter.js +2 -2
- package/lib/adapters/userAdapter.js +10 -5
- package/lib/config.js +2 -2
- package/lib/index.d.ts +7 -0
- package/lib/index.js +44 -8
- package/lib/lambdas/actions/websockets.d.ts +7 -6
- package/lib/lambdas/actions/websockets.js +9 -5
- package/lib/lambdas/authorizer.js +4 -4
- package/lib/lambdas/connection.js +16 -17
- package/lib/lambdas/utils/message.js +1 -1
- package/lib/lambdas/utils/websocket.js +1 -1
- package/lib/mocks/image.js +3 -2
- package/lib/mocks/user.js +3 -3
- package/lib/mutations/index.d.ts +3 -0
- package/lib/mutations/index.js +26 -0
- package/lib/mutations/locations.d.ts +2 -0
- package/lib/mutations/locations.js +44 -0
- package/lib/mutations/messages.d.ts +2 -0
- package/lib/mutations/messages.js +86 -0
- package/lib/mutations/personas.d.ts +2 -0
- package/lib/mutations/personas.js +100 -0
- package/lib/mutations/posts.d.ts +2 -0
- package/lib/mutations/posts.js +53 -0
- package/lib/mutations/reactions.d.ts +2 -0
- package/lib/mutations/reactions.js +51 -0
- package/lib/mutations/statistics.d.ts +2 -0
- package/lib/mutations/statistics.js +39 -0
- package/lib/mutations/subscriptions.d.ts +2 -0
- package/lib/mutations/subscriptions.js +56 -0
- package/lib/mutations/tags.d.ts +2 -0
- package/lib/mutations/tags.js +120 -0
- package/lib/mutations/users.d.ts +1 -0
- package/lib/mutations/users.js +116 -0
- package/lib/objectTypes/app.d.ts +3 -0
- package/lib/objectTypes/app.js +173 -0
- package/lib/objectTypes/bankAccount.d.ts +1 -0
- package/lib/objectTypes/bankAccount.js +76 -0
- package/lib/objectTypes/connection.d.ts +1 -0
- package/lib/objectTypes/connection.js +48 -0
- package/lib/objectTypes/conversation.d.ts +2 -0
- package/lib/objectTypes/conversation.js +77 -0
- package/lib/objectTypes/creditCard.d.ts +1 -0
- package/lib/objectTypes/creditCard.js +86 -0
- package/lib/objectTypes/document.d.ts +1 -0
- package/lib/objectTypes/document.js +46 -0
- package/lib/objectTypes/error.d.ts +1 -0
- package/lib/objectTypes/error.js +46 -0
- package/lib/objectTypes/external.d.ts +1 -0
- package/lib/objectTypes/external.js +74 -0
- package/lib/objectTypes/file.d.ts +2 -0
- package/lib/objectTypes/file.js +100 -0
- package/lib/objectTypes/filter.d.ts +1 -0
- package/lib/objectTypes/filter.js +43 -0
- package/lib/objectTypes/group.d.ts +3 -0
- package/lib/objectTypes/group.js +123 -0
- package/lib/objectTypes/iapSubscription.d.ts +1 -0
- package/lib/objectTypes/iapSubscription.js +40 -0
- package/lib/objectTypes/image.d.ts +2 -0
- package/lib/objectTypes/image.js +129 -0
- package/lib/objectTypes/index.d.ts +24 -0
- package/lib/objectTypes/index.js +68 -0
- package/lib/objectTypes/location.d.ts +2 -0
- package/lib/objectTypes/location.js +109 -0
- package/lib/objectTypes/message.d.ts +2 -0
- package/lib/objectTypes/message.js +96 -0
- package/lib/objectTypes/passcode.d.ts +1 -0
- package/lib/objectTypes/passcode.js +42 -0
- package/lib/objectTypes/persona.d.ts +3 -0
- package/lib/objectTypes/persona.js +87 -0
- package/lib/objectTypes/plan.d.ts +2 -0
- package/lib/objectTypes/plan.js +95 -0
- package/lib/objectTypes/post.d.ts +2 -0
- package/lib/objectTypes/post.js +125 -0
- package/lib/objectTypes/reaction.d.ts +2 -0
- package/lib/objectTypes/reaction.js +61 -0
- package/lib/objectTypes/relation.d.ts +1 -0
- package/lib/objectTypes/relation.js +49 -0
- package/lib/objectTypes/search.d.ts +1 -0
- package/lib/objectTypes/search.js +72 -0
- package/lib/objectTypes/statistics.d.ts +1 -0
- package/lib/objectTypes/statistics.js +39 -0
- package/lib/objectTypes/subscription.d.ts +2 -0
- package/lib/objectTypes/subscription.js +117 -0
- package/lib/objectTypes/tag.d.ts +2 -0
- package/lib/objectTypes/tag.js +65 -0
- package/lib/objectTypes/user.d.ts +4 -0
- package/lib/objectTypes/user.js +144 -0
- package/lib/queries/index.d.ts +3 -0
- package/lib/queries/index.js +33 -0
- package/lib/queries/locations.d.ts +2 -0
- package/lib/queries/locations.js +45 -0
- package/lib/queries/messages.d.ts +2 -0
- package/lib/queries/messages.js +52 -0
- package/lib/queries/posts.d.ts +2 -0
- package/lib/queries/posts.js +154 -0
- package/lib/queries/reactions.d.ts +2 -0
- package/lib/queries/reactions.js +56 -0
- package/lib/queries/statistics.d.ts +2 -0
- package/lib/queries/statistics.js +39 -0
- package/lib/queries/subscriptions.d.ts +2 -0
- package/lib/queries/subscriptions.js +44 -0
- package/lib/queries/tags.d.ts +2 -0
- package/lib/queries/tags.js +75 -0
- package/lib/queries/users.d.ts +1 -0
- package/lib/queries/users.js +64 -0
- package/lib/types/{apps.d.ts → apps.types.d.ts} +2 -2
- package/lib/types/apps.types.js +32 -0
- package/lib/types/{arangodb.d.ts → arangodb.types.d.ts} +4 -0
- package/lib/types/arangodb.types.js +16 -0
- package/lib/types/auth.types.d.ts +9 -0
- package/lib/types/auth.types.js +16 -0
- package/lib/types/{connections.d.ts → connections.types.d.ts} +1 -3
- package/lib/types/connections.types.js +16 -0
- package/lib/types/{conversations.d.ts → conversations.types.d.ts} +2 -4
- package/lib/types/conversations.types.js +16 -0
- package/lib/types/{email.d.ts → email.types.d.ts} +3 -3
- package/lib/types/email.types.js +16 -0
- package/lib/types/error.types.js +44 -0
- package/lib/types/{files.d.ts → files.types.d.ts} +1 -4
- package/lib/types/files.types.js +16 -0
- package/lib/types/google.types.js +16 -0
- package/lib/types/{groups.d.ts → groups.types.d.ts} +1 -4
- package/lib/types/groups.types.js +16 -0
- package/lib/types/{images.d.ts → images.types.d.ts} +9 -8
- package/lib/types/images.types.js +16 -0
- package/lib/types/index.d.ts +20 -18
- package/lib/types/index.js +41 -37
- package/lib/types/{locations.d.ts → locations.types.d.ts} +1 -3
- package/lib/types/locations.types.js +16 -0
- package/lib/types/{messages.d.ts → messages.types.d.ts} +5 -5
- package/lib/types/messages.types.js +16 -0
- package/lib/types/{notifications.d.ts → notifications.types.d.ts} +4 -2
- package/lib/types/notifications.types.js +16 -0
- package/lib/types/{payments.d.ts → payments.types.d.ts} +1 -4
- package/lib/types/payments.types.js +16 -0
- package/lib/types/personas.types.d.ts +32 -0
- package/lib/types/personas.types.js +16 -0
- package/lib/types/{posts.d.ts → posts.types.d.ts} +4 -7
- package/lib/types/posts.types.js +16 -0
- package/lib/types/statistics.types.js +16 -0
- package/lib/types/{tags.d.ts → tags.types.d.ts} +6 -1
- package/lib/types/tags.types.js +16 -0
- package/lib/types/{users.d.ts → users.types.d.ts} +12 -9
- package/lib/types/users.types.js +16 -0
- package/lib/types/{websocket.d.ts → websockets.types.d.ts} +6 -1
- package/lib/types/websockets.types.js +16 -0
- package/lib/utils/analyticsUtils.d.ts +3 -3
- package/lib/utils/analyticsUtils.js +3 -3
- package/lib/utils/arangodbUtils.d.ts +2 -1
- package/lib/utils/arangodbUtils.js +22 -1
- package/lib/utils/auth.d.ts +2 -1
- package/lib/utils/auth.js +8 -1
- package/lib/utils/index.js +1 -1
- package/lib/utils/session.d.ts +3 -1
- package/lib/utils/session.js +10 -7
- package/lib/utils/stripeUtils.d.ts +3 -0
- package/lib/utils/stripeUtils.js +43 -0
- package/package.json +35 -34
- package/.eslintrc +0 -10
- package/lib/types/apps.js +0 -32
- package/lib/types/auth.d.ts +0 -7
- package/lib/types/conversations.js +0 -16
- package/lib/types/files.js +0 -16
- package/lib/types/google.js +0 -16
- package/lib/types/images.js +0 -16
- package/lib/types/payments.js +0 -16
- package/lib/types/posts.js +0 -16
- package/lib/types/users.js +0 -16
- package/lib/types/websocket.js +0 -16
- /package/{lib → dist}/types/error.js +0 -0
- /package/{lib → dist}/types/statistics.js +0 -0
- /package/lib/types/{error.d.ts → error.types.d.ts} +0 -0
- /package/lib/types/{google.d.ts → google.types.d.ts} +0 -0
- /package/lib/types/{statistics.d.ts → statistics.types.d.ts} +0 -0
package/lib/actions/users.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import
|
|
2
|
-
import type { UserType } from '../types/users';
|
|
1
|
+
import { SessionError } from '../types/error.types';
|
|
3
2
|
import { SessionToken } from '../utils/session';
|
|
4
|
-
import {
|
|
3
|
+
import type { ApiContext } from '../types/auth.types';
|
|
4
|
+
import type { UserType } from '../types/users.types';
|
|
5
5
|
export interface UserOptions {
|
|
6
6
|
readonly from?: number;
|
|
7
7
|
readonly to?: number;
|
|
@@ -15,7 +15,11 @@ export declare enum UserAccess {
|
|
|
15
15
|
ADMIN = 4
|
|
16
16
|
}
|
|
17
17
|
export declare const createToken: (userId: string, username: string, userAccess: number, expiresInMinutes?: number) => SessionToken;
|
|
18
|
-
|
|
18
|
+
interface SelectAccumulator {
|
|
19
|
+
objects: string[];
|
|
20
|
+
queries: string[];
|
|
21
|
+
}
|
|
22
|
+
export declare const getUserOptional: (fields?: string[]) => SelectAccumulator;
|
|
19
23
|
export declare const parseUserOptions: (options?: UserOptions) => {
|
|
20
24
|
limit: import("..").ArangoDbLimit;
|
|
21
25
|
from?: number;
|
|
@@ -24,24 +28,45 @@ export declare const parseUserOptions: (options?: UserOptions) => {
|
|
|
24
28
|
};
|
|
25
29
|
export declare const addUser: (context: ApiContext, user: UserType) => Promise<UserType>;
|
|
26
30
|
export declare const updateUser: (context: ApiContext, user: UserType) => Promise<UserType>;
|
|
31
|
+
export declare const forgotPassword: (context: ApiContext, { email, phone, username }: {
|
|
32
|
+
email: any;
|
|
33
|
+
phone: any;
|
|
34
|
+
username: any;
|
|
35
|
+
}) => Promise<boolean>;
|
|
36
|
+
export declare const resetPassword: (context: ApiContext, { code, password, type, username }: {
|
|
37
|
+
code: number;
|
|
38
|
+
password: string;
|
|
39
|
+
type: "phone" | "email";
|
|
40
|
+
username: string;
|
|
41
|
+
}) => Promise<boolean>;
|
|
27
42
|
export declare const confirmCode: (context: ApiContext, { code, type }: {
|
|
28
|
-
code:
|
|
29
|
-
type:
|
|
43
|
+
code: number;
|
|
44
|
+
type: "phone" | "email";
|
|
30
45
|
}) => Promise<boolean>;
|
|
31
|
-
export declare const deleteUser: (context: ApiContext, user: UserType) => Promise<
|
|
46
|
+
export declare const deleteUser: (context: ApiContext, user: UserType) => Promise<UserType>;
|
|
32
47
|
export declare const deactivateUser: (context: ApiContext, user: UserType) => Promise<UserType>;
|
|
33
48
|
export declare const getDisplayName: (user: UserType) => string;
|
|
34
49
|
export declare const getSessionUser: (context: ApiContext) => Promise<UserType>;
|
|
35
50
|
export declare const getUser: (context: ApiContext, user: UserType) => Promise<UserType>;
|
|
36
51
|
export declare const getUsers: (context: ApiContext, options?: UserOptions) => Promise<UserType[]>;
|
|
37
|
-
export declare const getUsersByReactions: (context: ApiContext, { reactions, username }:
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
52
|
+
export declare const getUsersByReactions: (context: ApiContext, { reactions, username }: {
|
|
53
|
+
reactions?: any[];
|
|
54
|
+
username: any;
|
|
55
|
+
}, options?: UserOptions) => Promise<UserType[]>;
|
|
56
|
+
export declare const getUsersByTags: (context: ApiContext, { tags, username }: {
|
|
57
|
+
tags: any;
|
|
58
|
+
username: any;
|
|
59
|
+
}, options?: UserOptions) => Promise<UserType[]>;
|
|
60
|
+
export declare const getUsersByLatest: (context: ApiContext, { username }: {
|
|
61
|
+
username: any;
|
|
62
|
+
}, options?: UserOptions) => Promise<UserType[]>;
|
|
63
|
+
export declare const getUsersByConnection: (context: ApiContext, { userId }: UserType, options?: UserOptions) => Promise<UserType[]>;
|
|
64
|
+
export declare const refreshSession: ({ expires, token }: {
|
|
41
65
|
expires: any;
|
|
42
66
|
token: any;
|
|
43
|
-
}) =>
|
|
67
|
+
}) => SessionToken | SessionError;
|
|
44
68
|
export declare const signIn: (context: ApiContext, args: any) => Promise<SessionToken>;
|
|
45
69
|
export declare const signOut: (context: ApiContext) => Promise<boolean>;
|
|
46
|
-
export declare const getActiveUserCount: (context: ApiContext) => Promise<
|
|
70
|
+
export declare const getActiveUserCount: (context: ApiContext) => Promise<number>;
|
|
47
71
|
export declare const getUserByToken: (context: ApiContext, token: string) => Promise<UserType>;
|
|
72
|
+
export {};
|