wabe 0.6.11 → 0.6.13
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/authentication/Session.d.ts +10 -12
- package/dist/authentication/cookies.d.ts +1 -0
- package/dist/authentication/index.d.ts +1 -0
- package/dist/authentication/interface.d.ts +20 -0
- package/dist/authentication/security.d.ts +18 -0
- package/dist/database/DatabaseController.d.ts +57 -3
- package/dist/database/interface.d.ts +5 -0
- package/dist/file/interface.d.ts +23 -0
- package/dist/file/security.d.ts +6 -0
- package/dist/graphql/GraphQLSchema.d.ts +1 -1
- package/dist/graphql/resolvers.d.ts +1 -0
- package/dist/hooks/protected.d.ts +3 -0
- package/dist/hooks/virtualFields.d.ts +3 -0
- package/dist/index.js +1757 -818
- package/dist/schema/Schema.d.ts +66 -7
- package/dist/server/index.d.ts +2 -1
- package/dist/server/routes/index.d.ts +4 -1
- package/dist/utils/database.d.ts +1 -0
- package/dist/utils/export.d.ts +1 -0
- package/dist/utils/index.d.ts +1 -0
- package/package.json +7 -4
- package/bucket/b.txt +0 -1
- package/dev/index.ts +0 -215
- package/generated/schema.graphql +0 -1892
- package/generated/wabe.ts +0 -439
- package/src/authentication/OTP.test.ts +0 -69
- package/src/authentication/OTP.ts +0 -64
- package/src/authentication/Session.test.ts +0 -629
- package/src/authentication/Session.ts +0 -493
- package/src/authentication/defaultAuthentication.ts +0 -209
- package/src/authentication/index.ts +0 -3
- package/src/authentication/interface.ts +0 -155
- package/src/authentication/oauth/GitHub.test.ts +0 -91
- package/src/authentication/oauth/GitHub.ts +0 -121
- package/src/authentication/oauth/Google.test.ts +0 -91
- package/src/authentication/oauth/Google.ts +0 -101
- package/src/authentication/oauth/Oauth2Client.test.ts +0 -219
- package/src/authentication/oauth/Oauth2Client.ts +0 -135
- package/src/authentication/oauth/index.ts +0 -2
- package/src/authentication/oauth/utils.test.ts +0 -33
- package/src/authentication/oauth/utils.ts +0 -27
- package/src/authentication/providers/EmailOTP.test.ts +0 -127
- package/src/authentication/providers/EmailOTP.ts +0 -84
- package/src/authentication/providers/EmailPassword.test.ts +0 -176
- package/src/authentication/providers/EmailPassword.ts +0 -116
- package/src/authentication/providers/EmailPasswordSRP.test.ts +0 -208
- package/src/authentication/providers/EmailPasswordSRP.ts +0 -179
- package/src/authentication/providers/GitHub.ts +0 -24
- package/src/authentication/providers/Google.ts +0 -24
- package/src/authentication/providers/OAuth.test.ts +0 -185
- package/src/authentication/providers/OAuth.ts +0 -106
- package/src/authentication/providers/PhonePassword.test.ts +0 -176
- package/src/authentication/providers/PhonePassword.ts +0 -115
- package/src/authentication/providers/QRCodeOTP.test.ts +0 -77
- package/src/authentication/providers/QRCodeOTP.ts +0 -58
- package/src/authentication/providers/index.ts +0 -6
- package/src/authentication/resolvers/refreshResolver.test.ts +0 -30
- package/src/authentication/resolvers/refreshResolver.ts +0 -19
- package/src/authentication/resolvers/signInWithResolver.inte.test.ts +0 -59
- package/src/authentication/resolvers/signInWithResolver.test.ts +0 -293
- package/src/authentication/resolvers/signInWithResolver.ts +0 -92
- package/src/authentication/resolvers/signOutResolver.test.ts +0 -38
- package/src/authentication/resolvers/signOutResolver.ts +0 -18
- package/src/authentication/resolvers/signUpWithResolver.test.ts +0 -180
- package/src/authentication/resolvers/signUpWithResolver.ts +0 -65
- package/src/authentication/resolvers/verifyChallenge.test.ts +0 -133
- package/src/authentication/resolvers/verifyChallenge.ts +0 -62
- package/src/authentication/roles.test.ts +0 -49
- package/src/authentication/roles.ts +0 -40
- package/src/authentication/utils.test.ts +0 -97
- package/src/authentication/utils.ts +0 -39
- package/src/cache/InMemoryCache.test.ts +0 -62
- package/src/cache/InMemoryCache.ts +0 -45
- package/src/cron/index.test.ts +0 -17
- package/src/cron/index.ts +0 -43
- package/src/database/DatabaseController.test.ts +0 -613
- package/src/database/DatabaseController.ts +0 -1007
- package/src/database/index.test.ts +0 -1372
- package/src/database/index.ts +0 -9
- package/src/database/interface.ts +0 -302
- package/src/email/DevAdapter.ts +0 -7
- package/src/email/EmailController.test.ts +0 -29
- package/src/email/EmailController.ts +0 -13
- package/src/email/index.ts +0 -2
- package/src/email/interface.ts +0 -36
- package/src/email/templates/sendOtpCode.ts +0 -120
- package/src/file/FileController.ts +0 -28
- package/src/file/FileDevAdapter.ts +0 -51
- package/src/file/hookDeleteFile.ts +0 -25
- package/src/file/hookReadFile.ts +0 -66
- package/src/file/hookUploadFile.ts +0 -50
- package/src/file/index.test.ts +0 -932
- package/src/file/index.ts +0 -2
- package/src/file/interface.ts +0 -39
- package/src/graphql/GraphQLSchema.test.ts +0 -4408
- package/src/graphql/GraphQLSchema.ts +0 -880
- package/src/graphql/index.ts +0 -2
- package/src/graphql/parseGraphqlSchema.ts +0 -85
- package/src/graphql/parser.test.ts +0 -203
- package/src/graphql/parser.ts +0 -542
- package/src/graphql/pointerAndRelationFunction.ts +0 -191
- package/src/graphql/resolvers.ts +0 -442
- package/src/graphql/tests/aggregation.test.ts +0 -1115
- package/src/graphql/tests/e2e.test.ts +0 -590
- package/src/graphql/tests/scalars.test.ts +0 -250
- package/src/graphql/types.ts +0 -227
- package/src/hooks/HookObject.test.ts +0 -122
- package/src/hooks/HookObject.ts +0 -165
- package/src/hooks/authentication.ts +0 -67
- package/src/hooks/createUser.test.ts +0 -77
- package/src/hooks/createUser.ts +0 -10
- package/src/hooks/defaultFields.test.ts +0 -176
- package/src/hooks/defaultFields.ts +0 -32
- package/src/hooks/deleteSession.test.ts +0 -181
- package/src/hooks/deleteSession.ts +0 -20
- package/src/hooks/hashFieldHook.test.ts +0 -152
- package/src/hooks/hashFieldHook.ts +0 -89
- package/src/hooks/index.test.ts +0 -258
- package/src/hooks/index.ts +0 -414
- package/src/hooks/permissions.test.ts +0 -412
- package/src/hooks/permissions.ts +0 -93
- package/src/hooks/protected.test.ts +0 -551
- package/src/hooks/protected.ts +0 -60
- package/src/hooks/searchableFields.test.ts +0 -147
- package/src/hooks/searchableFields.ts +0 -86
- package/src/hooks/session.test.ts +0 -134
- package/src/hooks/session.ts +0 -76
- package/src/hooks/setEmail.test.ts +0 -216
- package/src/hooks/setEmail.ts +0 -33
- package/src/hooks/setupAcl.test.ts +0 -618
- package/src/hooks/setupAcl.ts +0 -25
- package/src/index.ts +0 -9
- package/src/schema/Schema.test.ts +0 -482
- package/src/schema/Schema.ts +0 -757
- package/src/schema/defaultResolvers.ts +0 -93
- package/src/schema/index.ts +0 -1
- package/src/schema/resolvers/meResolver.test.ts +0 -62
- package/src/schema/resolvers/meResolver.ts +0 -10
- package/src/schema/resolvers/resetPassword.test.ts +0 -341
- package/src/schema/resolvers/resetPassword.ts +0 -63
- package/src/schema/resolvers/sendEmail.test.ts +0 -118
- package/src/schema/resolvers/sendEmail.ts +0 -21
- package/src/schema/resolvers/sendOtpCode.test.ts +0 -141
- package/src/schema/resolvers/sendOtpCode.ts +0 -52
- package/src/security.test.ts +0 -3434
- package/src/server/defaultSessionHandler.test.ts +0 -62
- package/src/server/defaultSessionHandler.ts +0 -105
- package/src/server/generateCodegen.ts +0 -433
- package/src/server/index.test.ts +0 -532
- package/src/server/index.ts +0 -334
- package/src/server/interface.ts +0 -11
- package/src/server/routes/authHandler.ts +0 -169
- package/src/server/routes/index.ts +0 -39
- package/src/utils/crypto.test.ts +0 -41
- package/src/utils/crypto.ts +0 -105
- package/src/utils/export.ts +0 -11
- package/src/utils/helper.ts +0 -204
- package/src/utils/index.test.ts +0 -11
- package/src/utils/index.ts +0 -189
- package/src/utils/preload.ts +0 -8
- package/src/utils/testHelper.ts +0 -116
- package/tsconfig.json +0 -32
|
@@ -1,24 +1,22 @@
|
|
|
1
1
|
import type { WabeContext } from "../server/interface";
|
|
2
|
-
import type {
|
|
3
|
-
|
|
4
|
-
import type { DevWabeTypes } from "../utils/helper";
|
|
5
|
-
export declare class Session {
|
|
2
|
+
import type { WabeConfig, WabeTypes } from "../server";
|
|
3
|
+
export declare class Session<T extends WabeTypes> {
|
|
6
4
|
private accessToken;
|
|
7
5
|
private refreshToken;
|
|
8
|
-
getAccessTokenExpireAt(config: WabeConfig<
|
|
9
|
-
_getRefreshTokenExpiresInMs(config: WabeConfig<
|
|
10
|
-
getRefreshTokenExpireAt(config: WabeConfig<
|
|
6
|
+
getAccessTokenExpireAt(config: WabeConfig<T>);
|
|
7
|
+
_getRefreshTokenExpiresInMs(config: WabeConfig<T>);
|
|
8
|
+
getRefreshTokenExpireAt(config: WabeConfig<T>);
|
|
11
9
|
meFromAccessToken({ accessToken, csrfToken }: {
|
|
12
10
|
accessToken: string;
|
|
13
11
|
csrfToken: string;
|
|
14
|
-
}, context: WabeContext<
|
|
12
|
+
}, context: WabeContext<T>): Promise<{
|
|
15
13
|
sessionId: string | null;
|
|
16
|
-
user: User | null;
|
|
14
|
+
user: T["types"]["User"] | null;
|
|
17
15
|
accessToken: string | null;
|
|
18
16
|
refreshToken?: string | null;
|
|
19
17
|
}>;
|
|
20
|
-
create(userId: string, context: WabeContext<
|
|
21
|
-
refresh(accessToken: string, refreshToken: string, context: WabeContext<
|
|
22
|
-
delete(context: WabeContext<
|
|
18
|
+
create(userId: string, context: WabeContext<T>);
|
|
19
|
+
refresh(accessToken: string, refreshToken: string, context: WabeContext<T>);
|
|
20
|
+
delete(context: WabeContext<T>);
|
|
23
21
|
_isRefreshTokenExpired(userRefreshTokenExpiresAt: Date, refreshTokenAgeInMs: number);
|
|
24
22
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const getSessionCookieSameSite: unknown;
|
|
@@ -121,6 +121,25 @@ export interface SessionConfig<T extends WabeTypes> {
|
|
|
121
121
|
*/
|
|
122
122
|
jwtTokenFields?: SelectType<T, "User", keyof T["types"]["User"]>;
|
|
123
123
|
}
|
|
124
|
+
export interface AuthenticationRateLimitConfig {
|
|
125
|
+
/**
|
|
126
|
+
* Enable this rate limiter. Enabled by default in production.
|
|
127
|
+
*/
|
|
128
|
+
enabled?: boolean;
|
|
129
|
+
maxAttempts?: number;
|
|
130
|
+
windowMs?: number;
|
|
131
|
+
blockDurationMs?: number;
|
|
132
|
+
}
|
|
133
|
+
export interface AuthenticationSecurityConfig {
|
|
134
|
+
signInRateLimit?: AuthenticationRateLimitConfig;
|
|
135
|
+
signUpRateLimit?: AuthenticationRateLimitConfig;
|
|
136
|
+
verifyChallengeRateLimit?: AuthenticationRateLimitConfig;
|
|
137
|
+
mfaChallengeTtlMs?: number;
|
|
138
|
+
/**
|
|
139
|
+
* Require a valid challenge token during verifyChallenge in production.
|
|
140
|
+
*/
|
|
141
|
+
requireMfaChallengeInProduction?: boolean;
|
|
142
|
+
}
|
|
124
143
|
export interface AuthenticationConfig<T extends WabeTypes> {
|
|
125
144
|
session?: SessionConfig<T>;
|
|
126
145
|
roles?: RoleConfig;
|
|
@@ -132,6 +151,7 @@ export interface AuthenticationConfig<T extends WabeTypes> {
|
|
|
132
151
|
customAuthenticationMethods?: CustomAuthenticationMethods<T>[];
|
|
133
152
|
sessionHandler?: (context: WobeCustomContext<T>) => void | Promise<void>;
|
|
134
153
|
disableSignUp?: boolean;
|
|
154
|
+
security?: AuthenticationSecurityConfig;
|
|
135
155
|
}
|
|
136
156
|
export interface CreateTokenFromAuthorizationCodeOptions {
|
|
137
157
|
code: string;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { WabeContext } from "../server/interface";
|
|
2
|
+
import type { WabeTypes } from "../server";
|
|
3
|
+
import { DevWabeTypes } from "src/utils/helper";
|
|
4
|
+
type RateLimitScope = "signIn" | "signUp" | "verifyChallenge";
|
|
5
|
+
export declare const isRateLimited: <T extends WabeTypes>(context: WabeContext<T>, scope: RateLimitScope, key: string) => boolean;
|
|
6
|
+
export declare const registerRateLimitFailure: unknown;
|
|
7
|
+
export declare const clearRateLimit: unknown;
|
|
8
|
+
export declare const createMfaChallenge: (context: WabeContext<DevWabeTypes>, { userId, provider }: {
|
|
9
|
+
userId: string;
|
|
10
|
+
provider: string;
|
|
11
|
+
}) => Promise<string>;
|
|
12
|
+
export declare const consumeMfaChallenge: (context: WabeContext<DevWabeTypes>, { challengeToken, userId, provider }: {
|
|
13
|
+
challengeToken: string;
|
|
14
|
+
userId: string;
|
|
15
|
+
provider: string;
|
|
16
|
+
}) => Promise<boolean>;
|
|
17
|
+
export declare const shouldRequireMfaChallenge: unknown;
|
|
18
|
+
export {};
|
|
@@ -2,7 +2,7 @@ import type { WabeTypes } from "../..";
|
|
|
2
2
|
import { OperationType } from "../hooks";
|
|
3
3
|
import type { SchemaInterface } from "../schema";
|
|
4
4
|
import type { WabeContext } from "../server/interface";
|
|
5
|
-
import type
|
|
5
|
+
import { type CountOptions, type CreateObjectOptions, type CreateObjectsOptions, type DatabaseAdapter, type DeleteObjectOptions, type DeleteObjectsOptions, type GetObjectOptions, type GetObjectsOptions, type OutputType, type UpdateObjectOptions, type UpdateObjectsOptions, type WhereType } from "./interface";
|
|
6
6
|
export type Select = Record<string, boolean>;
|
|
7
7
|
type SelectWithObject = Record<string, object | boolean>;
|
|
8
8
|
export declare class DatabaseController<T extends WabeTypes> {
|
|
@@ -19,6 +19,43 @@ export declare class DatabaseController<T extends WabeTypes> {
|
|
|
19
19
|
type: string;
|
|
20
20
|
class?: string;
|
|
21
21
|
} | undefined;
|
|
22
|
+
_getVirtualFieldsForClass(className: keyof T["types"], context: WabeContext<T>);
|
|
23
|
+
_buildReadSelects({ className, context, selectWithoutPointers }: {
|
|
24
|
+
className: keyof T["types"];
|
|
25
|
+
context: WabeContext<T>;
|
|
26
|
+
selectWithoutPointers: Select;
|
|
27
|
+
}): {};
|
|
28
|
+
_buildHookReadSelect({ className, context, userSelect, selectWithoutPointers }: {
|
|
29
|
+
className: keyof T["types"];
|
|
30
|
+
context: WabeContext<T>;
|
|
31
|
+
userSelect: Select;
|
|
32
|
+
selectWithoutPointers: Select;
|
|
33
|
+
}): Select;
|
|
34
|
+
_initializeReadHook<K extends keyof T["types"]>({ className, context, userSelect, selectWithoutPointers, _skipHooks }: {
|
|
35
|
+
className: K;
|
|
36
|
+
context: WabeContext<T>;
|
|
37
|
+
userSelect: Select;
|
|
38
|
+
selectWithoutPointers: Select;
|
|
39
|
+
_skipHooks?: boolean;
|
|
40
|
+
});
|
|
41
|
+
_buildSelectWithPointers({ adapterSelect, pointers }: {
|
|
42
|
+
adapterSelect: Select;
|
|
43
|
+
pointers: Record<string, {
|
|
44
|
+
className: string;
|
|
45
|
+
select: Select;
|
|
46
|
+
}>;
|
|
47
|
+
});
|
|
48
|
+
_isEmptySelect(select?: Record<string, unknown>): boolean;
|
|
49
|
+
_projectObjectForUserSelect({ object, select }: {
|
|
50
|
+
object: Record<string, any> | null | undefined;
|
|
51
|
+
select?: SelectWithObject;
|
|
52
|
+
}): any;
|
|
53
|
+
_stripVirtualFieldsFromPayload({ className, context, payload }: {
|
|
54
|
+
className: keyof T["types"];
|
|
55
|
+
context: WabeContext<T>;
|
|
56
|
+
payload: unknown;
|
|
57
|
+
}): any;
|
|
58
|
+
_stripVirtualFieldsFromSchema(schema: SchemaInterface<T>): SchemaInterface<T>;
|
|
22
59
|
_getSelectMinusPointersAndRelations({ className, context, select }: {
|
|
23
60
|
className: keyof T["types"];
|
|
24
61
|
context: WabeContext<T>;
|
|
@@ -61,14 +98,31 @@ export declare class DatabaseController<T extends WabeTypes> {
|
|
|
61
98
|
id: string;
|
|
62
99
|
} | null>;
|
|
63
100
|
});
|
|
101
|
+
_getRelationSelectWithoutTotalCount(currentSelect?: Select): Select;
|
|
102
|
+
_resolvePointerField({ currentClassName, object, pointerField, currentSelect, context, _skipHooks }: {
|
|
103
|
+
currentClassName: string;
|
|
104
|
+
object: Record<string, any>;
|
|
105
|
+
pointerField: string;
|
|
106
|
+
currentSelect?: Select;
|
|
107
|
+
context: WabeContext<any>;
|
|
108
|
+
_skipHooks?: boolean;
|
|
109
|
+
});
|
|
110
|
+
_resolveRelationField({ currentClassName, object, pointerField, currentSelect, context, _skipHooks }: {
|
|
111
|
+
currentClassName: string;
|
|
112
|
+
object: Record<string, any>;
|
|
113
|
+
pointerField: string;
|
|
114
|
+
currentSelect?: Select;
|
|
115
|
+
context: WabeContext<any>;
|
|
116
|
+
_skipHooks?: boolean;
|
|
117
|
+
});
|
|
64
118
|
_getFinalObjectWithPointerAndRelation({ pointers, context, originClassName, object, _skipHooks }: {
|
|
65
|
-
originClassName:
|
|
119
|
+
originClassName: keyof T["types"];
|
|
66
120
|
pointers: Record<string, {
|
|
67
121
|
className: string;
|
|
68
122
|
select: Select;
|
|
69
123
|
}>;
|
|
70
124
|
context: WabeContext<any>;
|
|
71
|
-
object: Record<string, any
|
|
125
|
+
object: Record<string, any> | null | undefined;
|
|
72
126
|
_skipHooks?: boolean;
|
|
73
127
|
});
|
|
74
128
|
close();
|
|
@@ -46,6 +46,11 @@ export type WhereType<
|
|
|
46
46
|
T extends WabeTypes,
|
|
47
47
|
K = keyof T["where"]
|
|
48
48
|
> = Partial<WhereAggregation<T, K>> & WhereConditional<T, K>;
|
|
49
|
+
/** Structure for relation where input (have / isEmpty) */
|
|
50
|
+
export type RelationWhereInput<THave = unknown> = {
|
|
51
|
+
have?: THave;
|
|
52
|
+
isEmpty?: boolean;
|
|
53
|
+
};
|
|
49
54
|
type SelectObject<
|
|
50
55
|
T,
|
|
51
56
|
K extends WabeTypes,
|
package/dist/file/interface.d.ts
CHANGED
|
@@ -1,4 +1,26 @@
|
|
|
1
1
|
import type { WabeContext, WabeTypes } from "src/server";
|
|
2
|
+
export type FileUploadSecurityConfig = {
|
|
3
|
+
/**
|
|
4
|
+
* Enable upload validation rules. Enabled by default in production.
|
|
5
|
+
*/
|
|
6
|
+
enabled?: boolean;
|
|
7
|
+
/**
|
|
8
|
+
* Maximum allowed file size in bytes.
|
|
9
|
+
*/
|
|
10
|
+
maxFileSizeBytes?: number;
|
|
11
|
+
/**
|
|
12
|
+
* Allowlist of MIME types accepted by uploads.
|
|
13
|
+
*/
|
|
14
|
+
allowedMimeTypes?: string[];
|
|
15
|
+
/**
|
|
16
|
+
* Allowlist of file extensions accepted by uploads (without dot).
|
|
17
|
+
*/
|
|
18
|
+
allowedExtensions?: string[];
|
|
19
|
+
/**
|
|
20
|
+
* Randomize uploaded file names (enabled by default in production).
|
|
21
|
+
*/
|
|
22
|
+
randomizeFileName?: boolean;
|
|
23
|
+
};
|
|
2
24
|
/**
|
|
3
25
|
* The file config contains the adapter to use to upload file
|
|
4
26
|
* @param adapter: FileAdapter
|
|
@@ -10,6 +32,7 @@ export type FileConfig<T extends WabeTypes> = {
|
|
|
10
32
|
urlCacheInSeconds?: number;
|
|
11
33
|
devDirectory?: string;
|
|
12
34
|
beforeUpload?: (file: File, context: WabeContext<T>) => Promise<File> | File;
|
|
35
|
+
security?: FileUploadSecurityConfig;
|
|
13
36
|
};
|
|
14
37
|
export interface ReadFileOptions {
|
|
15
38
|
urlExpiresIn?: number;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { WabeContext, WabeTypes } from "src/server";
|
|
2
|
+
import type { FileUploadSecurityConfig } from "./interface";
|
|
3
|
+
declare const getUploadSecurityConfig: <T extends WabeTypes>(context: WabeContext<T>) => {};
|
|
4
|
+
export declare const secureUploadedFile: <T extends WabeTypes>(file: File, context: WabeContext<T>) => Promise<File>;
|
|
5
|
+
export declare const getUploadSecurityConfigForTests: <T extends WabeTypes>(context: WabeContext<T>) => ReturnType<typeof getUploadSecurityConfig>;
|
|
6
|
+
export type { FileUploadSecurityConfig };
|
|
@@ -2,7 +2,7 @@ import { GraphQLEnumType, type GraphQLFieldConfig, GraphQLInputObjectType, Graph
|
|
|
2
2
|
import type { ClassInterface, MutationResolver, QueryResolver, Schema, SchemaFields } from "../schema";
|
|
3
3
|
import type { DevWabeTypes } from "../utils/helper";
|
|
4
4
|
import { type GraphqlParserFactory } from "./parser";
|
|
5
|
-
type AllPossibleObject = "object" | "inputObject" | "whereInputObject" | "connectionObject" | "pointerInputObject" | "relationInputObject" | "updateInputObject" | "createInputObject" | "orderEnumType";
|
|
5
|
+
type AllPossibleObject = "object" | "inputObject" | "whereInputObject" | "connectionObject" | "pointerInputObject" | "relationInputObject" | "relationWhereInputObject" | "updateInputObject" | "createInputObject" | "orderEnumType";
|
|
6
6
|
export type AllObjects = Record<string, Partial<Record<AllPossibleObject, any>>>;
|
|
7
7
|
export declare class GraphQLSchema {
|
|
8
8
|
private schemas;
|
|
@@ -2,6 +2,7 @@ import type { SelectionSetNode, FragmentDefinitionNode } from "graphql";
|
|
|
2
2
|
import type { WabeContext } from "../server/interface";
|
|
3
3
|
export declare const extractFieldsFromSetNode: (selectionSet: SelectionSetNode, className: string, fragments?: Record<string, FragmentDefinitionNode>, options?: {
|
|
4
4
|
ignoreClassField?: boolean;
|
|
5
|
+
variables?: Record<string, any>;
|
|
5
6
|
}) => Record<string, any>;
|
|
6
7
|
export declare const getFieldsOfClassName: ({ fields, className, context }: {
|
|
7
8
|
fields: string[];
|
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
import type { SchemaClassWithProtectedFields } from "../schema/Schema";
|
|
2
|
+
import type { WabeContext } from "../server/interface";
|
|
3
|
+
export declare const canUserReadField: (schemaClass: SchemaClassWithProtectedFields, fieldName: string, context: Pick<WabeContext<any>, "isRoot" | "user">) => boolean;
|
|
1
4
|
export declare const defaultCheckProtectedOnBeforeRead: unknown;
|
|
2
5
|
export declare const defaultCheckProtectedOnBeforeUpdate: unknown;
|
|
3
6
|
export declare const defaultCheckProtectedOnBeforeCreate: unknown;
|