wabe 0.6.3 → 0.6.5

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 (90) hide show
  1. package/README.md +2 -1
  2. package/dist/ai/index.d.ts +1 -0
  3. package/dist/ai/interface.d.ts +9 -0
  4. package/dist/authentication/OTP.d.ts +8 -0
  5. package/dist/authentication/Session.d.ts +21 -0
  6. package/dist/authentication/defaultAuthentication.d.ts +3 -0
  7. package/dist/authentication/index.d.ts +2 -0
  8. package/dist/authentication/interface.d.ts +118 -0
  9. package/dist/authentication/oauth/GitHub.d.ts +13 -0
  10. package/dist/authentication/oauth/Google.d.ts +13 -0
  11. package/dist/authentication/oauth/Oauth2Client.d.ts +33 -0
  12. package/dist/authentication/oauth/index.d.ts +2 -0
  13. package/dist/authentication/oauth/utils.d.ts +14 -0
  14. package/dist/authentication/providers/EmailOTP.d.ts +11 -0
  15. package/dist/authentication/providers/EmailPassword.d.ts +13 -0
  16. package/dist/authentication/providers/GitHub.d.ts +12 -0
  17. package/dist/authentication/providers/Google.d.ts +12 -0
  18. package/dist/authentication/providers/OAuth.d.ts +6 -0
  19. package/dist/authentication/providers/PhonePassword.d.ts +13 -0
  20. package/dist/authentication/providers/index.d.ts +5 -0
  21. package/dist/authentication/resolvers/refreshResolver.d.ts +1 -0
  22. package/dist/authentication/resolvers/signInWithResolver.d.ts +1 -0
  23. package/dist/authentication/resolvers/signOutResolver.d.ts +1 -0
  24. package/dist/authentication/resolvers/signUpWithResolver.d.ts +1 -0
  25. package/dist/authentication/resolvers/verifyChallenge.d.ts +1 -0
  26. package/dist/authentication/roles.d.ts +1 -0
  27. package/dist/authentication/srp/processSRPChallenge.d.ts +1 -0
  28. package/dist/authentication/srp/signInWithSRP.d.ts +1 -0
  29. package/dist/authentication/srp/signUpWithSRP.d.ts +1 -0
  30. package/dist/authentication/utils.d.ts +8 -0
  31. package/dist/cron/index.d.ts +32 -0
  32. package/dist/database/adapters/MongoAdapter.d.ts +64 -0
  33. package/dist/database/adapters/adaptersInterface.d.ts +263 -0
  34. package/dist/database/adapters/index.d.ts +2 -0
  35. package/dist/database/controllers/DatabaseController.d.ts +90 -0
  36. package/dist/database/controllers/index.d.ts +1 -0
  37. package/dist/database/index.d.ts +10 -0
  38. package/dist/email/DevAdapter.d.ts +4 -0
  39. package/dist/email/EmailController.d.ts +6 -0
  40. package/dist/email/index.d.ts +2 -0
  41. package/dist/email/interface.d.ts +35 -0
  42. package/dist/email/templates/sendOtpCode.d.ts +1 -0
  43. package/dist/files/FileController.d.ts +10 -0
  44. package/dist/files/FileDevAdapter.d.ts +8 -0
  45. package/dist/files/hookDeleteFile.d.ts +1 -0
  46. package/dist/files/hookReadFile.d.ts +1 -0
  47. package/dist/files/hookUploadFile.d.ts +2 -0
  48. package/dist/files/index.d.ts +2 -0
  49. package/dist/files/interface.d.ts +30 -0
  50. package/dist/graphql/GraphQLSchema.d.ts +75 -0
  51. package/dist/graphql/index.d.ts +2 -0
  52. package/dist/graphql/parser.d.ts +38 -0
  53. package/dist/graphql/pointerAndRelationFunction.d.ts +20 -0
  54. package/dist/graphql/resolvers.d.ts +20 -0
  55. package/dist/graphql/types.d.ts +18 -0
  56. package/dist/hooks/HookObject.d.ts +39 -0
  57. package/dist/hooks/authentication.d.ts +2 -0
  58. package/dist/hooks/defaultFields.d.ts +3 -0
  59. package/dist/hooks/deleteSession.d.ts +1 -0
  60. package/dist/hooks/index.d.ts +41 -0
  61. package/dist/hooks/permissions.d.ts +6 -0
  62. package/dist/hooks/protected.d.ts +3 -0
  63. package/dist/hooks/searchableFields.d.ts +3 -0
  64. package/dist/hooks/session.d.ts +3 -0
  65. package/dist/hooks/setEmail.d.ts +2 -0
  66. package/dist/hooks/setupAcl.d.ts +2 -0
  67. package/dist/index.d.ts +11 -1459
  68. package/dist/index.js +486 -76812
  69. package/dist/payment/DevAdapter.d.ts +17 -0
  70. package/dist/payment/PaymentController.d.ts +19 -0
  71. package/dist/payment/index.d.ts +2 -0
  72. package/dist/payment/interface.d.ts +235 -0
  73. package/dist/schema/Schema.d.ts +164 -0
  74. package/dist/schema/defaultResolvers.d.ts +7 -0
  75. package/dist/schema/index.d.ts +1 -0
  76. package/dist/schema/resolvers/meResolver.d.ts +1 -0
  77. package/dist/schema/resolvers/resetPassword.d.ts +1 -0
  78. package/dist/schema/resolvers/sendEmail.d.ts +1 -0
  79. package/dist/schema/resolvers/sendOtpCode.d.ts +1 -0
  80. package/dist/server/defaultHandlers.d.ts +1 -0
  81. package/dist/server/generateCodegen.d.ts +1 -0
  82. package/dist/server/index.d.ts +77 -0
  83. package/dist/server/routes/authHandler.d.ts +2 -0
  84. package/dist/server/routes/index.d.ts +8 -0
  85. package/dist/utils/export.d.ts +2 -0
  86. package/dist/utils/helper.d.ts +21 -0
  87. package/dist/utils/index.d.ts +17 -0
  88. package/generated/schema.graphql +126 -21
  89. package/generated/wabe.ts +135 -25
  90. package/package.json +8 -7
@@ -0,0 +1,18 @@
1
+ export declare const AnyScalarType: unknown;
2
+ export declare const DateScalarType: unknown;
3
+ export declare const EmailScalarType: unknown;
4
+ export declare const PhoneScalarType: unknown;
5
+ export declare const FileScalarType: unknown;
6
+ export declare const SearchScalarType: unknown;
7
+ export declare const SearchWhereInput: unknown;
8
+ export declare const AnyWhereInput: unknown;
9
+ export declare const FileWhereInput: unknown;
10
+ export declare const ArrayWhereInput: unknown;
11
+ export declare const DateWhereInput: unknown;
12
+ export declare const EmailWhereInput: unknown;
13
+ export declare const PhoneWhereInput: unknown;
14
+ export declare const IdWhereInput: unknown;
15
+ export declare const StringWhereInput: unknown;
16
+ export declare const IntWhereInput: unknown;
17
+ export declare const FloatWhereInput: unknown;
18
+ export declare const BooleanWhereInput: unknown;
@@ -0,0 +1,39 @@
1
+ import type { OperationType } from ".";
2
+ import type { RoleEnum } from "../../generated/wabe";
3
+ import type { MutationData, OutputType, Select } from "../database";
4
+ import type { WabeTypes } from "../server";
5
+ import type { WabeContext } from "../server/interface";
6
+ type AddACLOpptions = {
7
+ userId?: string
8
+ role?: RoleEnum
9
+ read: boolean
10
+ write: boolean
11
+ } | null;
12
+ export declare class HookObject<
13
+ T extends WabeTypes,
14
+ K extends keyof WabeTypes["types"]
15
+ > {
16
+ className: K;
17
+ private newData;
18
+ private operationType;
19
+ context: WabeContext<T>;
20
+ object: OutputType<T, K, keyof T["types"][K]>;
21
+ originalObject: OutputType<T, K, keyof T["types"][K]> | undefined;
22
+ select: Select;
23
+ constructor({ newData, className, operationType, context, object, originalObject, select }: {
24
+ className: K
25
+ newData?: MutationData<T, K, keyof T["types"][K]>
26
+ operationType: OperationType
27
+ context: WabeContext<T>
28
+ object: OutputType<T, K, keyof T["types"][K]>
29
+ originalObject?: OutputType<T, K, keyof T["types"][K]>
30
+ select: Select
31
+ });
32
+ getUser();
33
+ isFieldUpdated(field: keyof T["types"][K]);
34
+ upsertNewData(field: keyof T["types"][K], value: any);
35
+ getNewData(): MutationData<T, K, keyof T["types"][K]>;
36
+ fetch(): Promise<OutputType<T, K, keyof T["types"][K]>>;
37
+ addACL(type: "users" | "roles", options: AddACLOpptions);
38
+ }
39
+ export {};
@@ -0,0 +1,2 @@
1
+ export declare const defaultCallAuthenticationProviderOnBeforeCreateUser: unknown;
2
+ export declare const defaultCallAuthenticationProviderOnBeforeUpdateUser: unknown;
@@ -0,0 +1,3 @@
1
+ export declare const defaultBeforeCreateForCreatedAt: unknown;
2
+ export declare const defaultBeforeUpdateForUpdatedAt: unknown;
3
+ export declare const defaultBeforeCreateForDefaultValue: unknown;
@@ -0,0 +1 @@
1
+ export declare const defaultDeleteSessionOnDeleteUser: unknown;
@@ -0,0 +1,41 @@
1
+ import type { MutationData, OutputType, Select } from "../database";
2
+ import type { WabeTypes } from "../server";
3
+ import type { WabeContext } from "../server/interface";
4
+ import type { DevWabeTypes } from "../utils/helper";
5
+ import { HookObject } from "./HookObject";
6
+ export declare enum OperationType {
7
+ AfterCreate = "afterCreate",
8
+ AfterUpdate = "afterUpdate",
9
+ AfterDelete = "afterDelete",
10
+ AfterRead = "afterRead",
11
+ BeforeCreate = "beforeCreate",
12
+ BeforeUpdate = "beforeUpdate",
13
+ BeforeDelete = "beforeDelete",
14
+ BeforeRead = "beforeRead",
15
+ }
16
+ export type Hook<
17
+ T extends WabeTypes,
18
+ K extends keyof WabeTypes["types"]
19
+ > = {
20
+ operationType: OperationType
21
+ className?: K
22
+ priority: number
23
+ callback: (hookObject: HookObject<T, K>) => Promise<void> | void
24
+ };
25
+ export declare const _findHooksByPriority: unknown;
26
+ export declare const initializeHook: <
27
+ T extends WabeTypes,
28
+ K extends keyof T["types"]
29
+ >({ className, newData, context, select }: {
30
+ className: K
31
+ newData?: MutationData<DevWabeTypes, any, any>
32
+ select: Select
33
+ context: WabeContext<any>
34
+ }) => {
35
+ runOnSingleObject: (options: {
36
+ operationType: OperationType
37
+ id?: string
38
+ originalObject?: OutputType<DevWabeTypes, any, any>
39
+ }) => Promise<MutationData<T, K, any>>
40
+ };
41
+ export declare const getDefaultHooks: () => Hook<any, any>[];
@@ -0,0 +1,6 @@
1
+ export declare const _getPermissionPropertiesOfAClass: unknown;
2
+ export declare const _checkCLP: unknown;
3
+ export declare const defaultCheckPermissionOnRead: unknown;
4
+ export declare const defaultCheckPermissionOnCreate: unknown;
5
+ export declare const defaultCheckPermissionOnUpdate: unknown;
6
+ export declare const defaultCheckPermissionOnDelete: unknown;
@@ -0,0 +1,3 @@
1
+ export declare const defaultCheckProtectedOnBeforeRead: unknown;
2
+ export declare const defaultCheckProtectedOnBeforeUpdate: unknown;
3
+ export declare const defaultCheckProtectedOnBeforeCreate: unknown;
@@ -0,0 +1,3 @@
1
+ export declare const stringExtraction: (value: any) => Array<string>;
2
+ export declare const defaultSearchableFieldsBeforeCreate: unknown;
3
+ export declare const defaultSearchableFieldsBeforeUpdate: unknown;
@@ -0,0 +1,3 @@
1
+ export declare const defaultAfterCreateSession: unknown;
2
+ export declare const defaultAfterDeleteSession: unknown;
3
+ export declare const defaultBeforeUpdateSessionOnUser: unknown;
@@ -0,0 +1,2 @@
1
+ export declare const defaultSetEmail: unknown;
2
+ export declare const defaultSetEmailOnUpdate: unknown;
@@ -0,0 +1,2 @@
1
+ export declare const defaultSetupAclBeforeCreate: unknown;
2
+ export declare const defaultSetupAclOnUserAfterCreate: unknown;