Skip to content

Commit f9818e7

Browse files
refactor: removed jsonschema dependency (#286)
* removed jsonschema dependency * code review changes
1 parent c0f6052 commit f9818e7

File tree

35 files changed

+24
-1444
lines changed

35 files changed

+24
-1444
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
77

88
## [unreleased]
99

10+
- removed jsonschema dependency
11+
1012
## [9.1.1] - 2022-03-24
1113

1214
### Fixes:

lib/build/recipe/emailpassword/types.d.ts

Lines changed: 0 additions & 70 deletions
Original file line numberDiff line numberDiff line change
@@ -61,18 +61,6 @@ export declare type TypeInputResetPasswordUsingTokenFeature = {
6161
getResetPasswordURL?: (user: User, userContext: any) => Promise<string>;
6262
createAndSendCustomEmail?: (user: User, passwordResetURLWithToken: string, userContext: any) => Promise<void>;
6363
};
64-
export declare const InputResetPasswordUsingTokenFeatureSchema: {
65-
type: string;
66-
properties: {
67-
getResetPasswordURL: {
68-
type: string;
69-
};
70-
createAndSendCustomEmail: {
71-
type: string;
72-
};
73-
};
74-
additionalProperties: boolean;
75-
};
7664
export declare type TypeNormalisedInputResetPasswordUsingTokenFeature = {
7765
getResetPasswordURL: (user: User, userContext: any) => Promise<string>;
7866
createAndSendCustomEmail: (user: User, passwordResetURLWithToken: string, userContext: any) => Promise<void>;
@@ -106,64 +94,6 @@ export declare type TypeInput = {
10694
};
10795
};
10896
};
109-
export declare const InputSchema: {
110-
type: string;
111-
properties: {
112-
signUpFeature: {
113-
type: string;
114-
properties: {
115-
formFields: {
116-
type: string;
117-
items: {
118-
type: string;
119-
properties: {
120-
id: {
121-
type: string;
122-
};
123-
validate: {
124-
type: string;
125-
};
126-
optional: {
127-
type: string;
128-
};
129-
};
130-
required: string[];
131-
additionalProperties: boolean;
132-
};
133-
};
134-
};
135-
additionalProperties: boolean;
136-
};
137-
resetPasswordUsingTokenFeature: {
138-
type: string;
139-
properties: {
140-
getResetPasswordURL: {
141-
type: string;
142-
};
143-
createAndSendCustomEmail: {
144-
type: string;
145-
};
146-
};
147-
additionalProperties: boolean;
148-
};
149-
emailVerificationFeature: {
150-
type: string;
151-
properties: {
152-
getEmailVerificationURL: {
153-
type: string;
154-
};
155-
createAndSendCustomEmail: {
156-
type: string;
157-
};
158-
};
159-
additionalProperties: boolean;
160-
};
161-
override: {
162-
type: string;
163-
};
164-
};
165-
additionalProperties: boolean;
166-
};
16797
export declare type RecipeInterface = {
16898
signUp(input: {
16999
email: string;

lib/build/recipe/emailpassword/types.js

Lines changed: 0 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -14,57 +14,3 @@
1414
* under the License.
1515
*/
1616
Object.defineProperty(exports, "__esModule", { value: true });
17-
const TypeString = {
18-
type: "string",
19-
};
20-
const TypeBoolean = {
21-
type: "boolean",
22-
};
23-
const TypeAny = {
24-
type: "any",
25-
};
26-
const InputEmailVerificationFeatureSchema = {
27-
type: "object",
28-
properties: {
29-
getEmailVerificationURL: TypeAny,
30-
createAndSendCustomEmail: TypeAny,
31-
},
32-
additionalProperties: false,
33-
};
34-
const InputSignUpSchema = {
35-
type: "object",
36-
properties: {
37-
formFields: {
38-
type: "array",
39-
items: {
40-
type: "object",
41-
properties: {
42-
id: TypeString,
43-
validate: TypeAny,
44-
optional: TypeBoolean,
45-
},
46-
required: ["id"],
47-
additionalProperties: false,
48-
},
49-
},
50-
},
51-
additionalProperties: false,
52-
};
53-
exports.InputResetPasswordUsingTokenFeatureSchema = {
54-
type: "object",
55-
properties: {
56-
getResetPasswordURL: TypeAny,
57-
createAndSendCustomEmail: TypeAny,
58-
},
59-
additionalProperties: false,
60-
};
61-
exports.InputSchema = {
62-
type: "object",
63-
properties: {
64-
signUpFeature: InputSignUpSchema,
65-
resetPasswordUsingTokenFeature: exports.InputResetPasswordUsingTokenFeatureSchema,
66-
emailVerificationFeature: InputEmailVerificationFeatureSchema,
67-
override: TypeAny,
68-
},
69-
additionalProperties: false,
70-
};

lib/build/recipe/emailpassword/utils.js

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,12 +45,9 @@ var __awaiter =
4545
});
4646
};
4747
Object.defineProperty(exports, "__esModule", { value: true });
48-
const types_1 = require("./types");
4948
const constants_1 = require("./constants");
5049
const passwordResetFunctions_1 = require("./passwordResetFunctions");
51-
const utils_1 = require("../../utils");
5250
function validateAndNormaliseUserInput(recipeInstance, appInfo, config) {
53-
utils_1.validateTheStructureOfUserInput(config, types_1.InputSchema, "emailpassword recipe");
5451
let signUpFeature = validateAndNormaliseSignupConfig(
5552
recipeInstance,
5653
appInfo,

lib/build/recipe/session/types.d.ts

Lines changed: 0 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -48,18 +48,6 @@ export declare type CreateOrRefreshAPIResponse = {
4848
};
4949
antiCsrfToken: string | undefined;
5050
};
51-
export declare const InputSchemaErrorHandlers: {
52-
type: string;
53-
properties: {
54-
onUnauthorised: {
55-
type: string;
56-
};
57-
onTokenTheftDetected: {
58-
type: string;
59-
};
60-
};
61-
additionalProperties: boolean;
62-
};
6351
export interface ErrorHandlers {
6452
onUnauthorised?: ErrorHandlerMiddleware;
6553
onTokenTheftDetected?: TokenTheftErrorHandlerMiddleware;
@@ -108,45 +96,6 @@ export declare type TypeInput = {
10896
};
10997
};
11098
};
111-
export declare const InputSchema: {
112-
type: string;
113-
properties: {
114-
cookieSecure: {
115-
type: string;
116-
};
117-
cookieSameSite: {
118-
type: string;
119-
};
120-
sessionExpiredStatusCode: {
121-
type: string;
122-
};
123-
cookieDomain: {
124-
type: string;
125-
};
126-
errorHandlers: {
127-
type: string;
128-
properties: {
129-
onUnauthorised: {
130-
type: string;
131-
};
132-
onTokenTheftDetected: {
133-
type: string;
134-
};
135-
};
136-
additionalProperties: boolean;
137-
};
138-
antiCsrf: {
139-
type: string;
140-
};
141-
jwt: {
142-
type: string;
143-
};
144-
override: {
145-
type: string;
146-
};
147-
};
148-
additionalProperties: boolean;
149-
};
15099
export declare type TypeNormalisedInput = {
151100
refreshTokenPath: NormalisedURLPath;
152101
cookieDomain: string | undefined;

lib/build/recipe/session/types.js

Lines changed: 0 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,2 @@
11
"use strict";
22
Object.defineProperty(exports, "__esModule", { value: true });
3-
const TypeString = {
4-
type: "string",
5-
};
6-
const TypeBoolean = {
7-
type: "boolean",
8-
};
9-
const TypeNumber = {
10-
type: "number",
11-
};
12-
const TypeAny = {
13-
type: "any",
14-
};
15-
exports.InputSchemaErrorHandlers = {
16-
type: "object",
17-
properties: {
18-
onUnauthorised: TypeAny,
19-
onTokenTheftDetected: TypeAny,
20-
},
21-
additionalProperties: false,
22-
};
23-
exports.InputSchema = {
24-
type: "object",
25-
properties: {
26-
cookieSecure: TypeBoolean,
27-
cookieSameSite: TypeString,
28-
sessionExpiredStatusCode: TypeNumber,
29-
cookieDomain: TypeString,
30-
errorHandlers: exports.InputSchemaErrorHandlers,
31-
antiCsrf: TypeString,
32-
jwt: TypeAny,
33-
override: TypeAny,
34-
},
35-
additionalProperties: false,
36-
};

lib/build/recipe/session/utils.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,6 @@ var __awaiter =
4545
});
4646
};
4747
Object.defineProperty(exports, "__esModule", { value: true });
48-
const types_1 = require("./types");
4948
const cookieAndHeaders_1 = require("./cookieAndHeaders");
5049
const url_1 = require("url");
5150
const constants_1 = require("./constants");
@@ -125,7 +124,6 @@ function getURLProtocol(url) {
125124
}
126125
exports.getURLProtocol = getURLProtocol;
127126
function validateAndNormaliseUserInput(recipeInstance, appInfo, config) {
128-
utils_1.validateTheStructureOfUserInput(config, types_1.InputSchema, "session recipe");
129127
let cookieDomain =
130128
config === undefined || config.cookieDomain === undefined
131129
? undefined

lib/build/recipe/thirdparty/types.d.ts

Lines changed: 0 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -81,38 +81,6 @@ export declare type TypeInput = {
8181
};
8282
};
8383
};
84-
export declare const InputSchema: {
85-
type: string;
86-
properties: {
87-
signInAndUpFeature: {
88-
type: string;
89-
properties: {
90-
providers: {
91-
type: string;
92-
};
93-
};
94-
required: string[];
95-
additionalProperties: boolean;
96-
};
97-
emailVerificationFeature: {
98-
type: string;
99-
properties: {
100-
getEmailVerificationURL: {
101-
type: string;
102-
};
103-
createAndSendCustomEmail: {
104-
type: string;
105-
};
106-
};
107-
additionalProperties: boolean;
108-
};
109-
override: {
110-
type: string;
111-
};
112-
};
113-
required: string[];
114-
additionalProperties: boolean;
115-
};
11684
export declare type TypeNormalisedInput = {
11785
signInAndUpFeature: TypeNormalisedInputSignInAndUp;
11886
emailVerificationFeature: TypeInputEmailVerification;

lib/build/recipe/thirdparty/types.js

Lines changed: 0 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -14,34 +14,3 @@
1414
* under the License.
1515
*/
1616
Object.defineProperty(exports, "__esModule", { value: true });
17-
const TypeAny = {
18-
type: "any",
19-
};
20-
const InputEmailVerificationFeatureSchema = {
21-
type: "object",
22-
properties: {
23-
getEmailVerificationURL: TypeAny,
24-
createAndSendCustomEmail: TypeAny,
25-
},
26-
additionalProperties: false,
27-
};
28-
const InputSignInAndUpSchema = {
29-
type: "object",
30-
properties: {
31-
providers: {
32-
type: "array",
33-
},
34-
},
35-
required: ["providers"],
36-
additionalProperties: false,
37-
};
38-
exports.InputSchema = {
39-
type: "object",
40-
properties: {
41-
signInAndUpFeature: InputSignInAndUpSchema,
42-
emailVerificationFeature: InputEmailVerificationFeatureSchema,
43-
override: TypeAny,
44-
},
45-
required: ["signInAndUpFeature"],
46-
additionalProperties: false,
47-
};

lib/build/recipe/thirdparty/utils.js

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,10 +45,7 @@ var __awaiter =
4545
});
4646
};
4747
Object.defineProperty(exports, "__esModule", { value: true });
48-
const utils_1 = require("../../utils");
49-
const types_1 = require("./types");
5048
function validateAndNormaliseUserInput(recipeInstance, appInfo, config) {
51-
utils_1.validateTheStructureOfUserInput(config, types_1.InputSchema, "thirdparty recipe");
5249
let emailVerificationFeature = validateAndNormaliseEmailVerificationConfig(recipeInstance, appInfo, config);
5350
let signInAndUpFeature = validateAndNormaliseSignInAndUpConfig(appInfo, config.signInAndUpFeature);
5451
let override = Object.assign(

0 commit comments

Comments
 (0)