@redmix/api 9.0.0-canary.581 → 9.0.0-canary.582
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/auth/index.js +10 -49
- package/dist/auth/parseJWT.js +3 -26
- package/dist/auth/verifiers/base64Sha1Verifier.js +18 -37
- package/dist/auth/verifiers/base64Sha256Verifier.js +18 -37
- package/dist/auth/verifiers/common.js +19 -58
- package/dist/auth/verifiers/index.js +8 -33
- package/dist/auth/verifiers/jwtVerifier.js +17 -47
- package/dist/auth/verifiers/secretKeyVerifier.js +7 -26
- package/dist/auth/verifiers/sha1Verifier.js +18 -37
- package/dist/auth/verifiers/sha256Verifier.js +18 -37
- package/dist/auth/verifiers/skipVerifier.js +4 -23
- package/dist/auth/verifiers/timestampSchemeVerifier.js +18 -33
- package/dist/cache/clients/BaseClient.js +4 -23
- package/dist/cache/clients/InMemoryClient.js +6 -35
- package/dist/cache/clients/MemcachedClient.js +6 -35
- package/dist/cache/clients/RedisClient.js +6 -35
- package/dist/cache/errors.js +3 -26
- package/dist/cache/index.js +14 -52
- package/dist/cjs/auth/index.d.ts +51 -0
- package/dist/cjs/auth/index.d.ts.map +1 -0
- package/dist/cjs/auth/index.js +129 -0
- package/dist/cjs/auth/parseJWT.d.ts +6 -0
- package/dist/cjs/auth/parseJWT.d.ts.map +1 -0
- package/dist/cjs/auth/parseJWT.js +57 -0
- package/dist/cjs/auth/verifiers/base64Sha1Verifier.d.ts +19 -0
- package/dist/cjs/auth/verifiers/base64Sha1Verifier.d.ts.map +1 -0
- package/dist/cjs/auth/verifiers/base64Sha1Verifier.js +77 -0
- package/dist/cjs/auth/verifiers/base64Sha256Verifier.d.ts +19 -0
- package/dist/cjs/auth/verifiers/base64Sha256Verifier.d.ts.map +1 -0
- package/dist/cjs/auth/verifiers/base64Sha256Verifier.js +77 -0
- package/dist/cjs/auth/verifiers/common.d.ts +104 -0
- package/dist/cjs/auth/verifiers/common.d.ts.map +1 -0
- package/dist/cjs/auth/verifiers/common.js +99 -0
- package/dist/cjs/auth/verifiers/index.d.ts +8 -0
- package/dist/cjs/auth/verifiers/index.d.ts.map +1 -0
- package/dist/cjs/auth/verifiers/index.js +38 -0
- package/dist/cjs/auth/verifiers/jwtVerifier.d.ts +26 -0
- package/dist/cjs/auth/verifiers/jwtVerifier.d.ts.map +1 -0
- package/dist/cjs/auth/verifiers/jwtVerifier.js +86 -0
- package/dist/cjs/auth/verifiers/secretKeyVerifier.d.ts +14 -0
- package/dist/cjs/auth/verifiers/secretKeyVerifier.d.ts.map +1 -0
- package/dist/cjs/auth/verifiers/secretKeyVerifier.js +40 -0
- package/dist/cjs/auth/verifiers/sha1Verifier.d.ts +25 -0
- package/dist/cjs/auth/verifiers/sha1Verifier.d.ts.map +1 -0
- package/dist/cjs/auth/verifiers/sha1Verifier.js +85 -0
- package/dist/cjs/auth/verifiers/sha256Verifier.d.ts +25 -0
- package/dist/cjs/auth/verifiers/sha256Verifier.d.ts.map +1 -0
- package/dist/cjs/auth/verifiers/sha256Verifier.js +85 -0
- package/dist/cjs/auth/verifiers/skipVerifier.d.ts +13 -0
- package/dist/cjs/auth/verifiers/skipVerifier.d.ts.map +1 -0
- package/dist/cjs/auth/verifiers/skipVerifier.js +37 -0
- package/dist/cjs/auth/verifiers/timestampSchemeVerifier.d.ts +16 -0
- package/dist/cjs/auth/verifiers/timestampSchemeVerifier.d.ts.map +1 -0
- package/dist/cjs/auth/verifiers/timestampSchemeVerifier.js +81 -0
- package/dist/cjs/bins/redwood.d.ts +9 -0
- package/dist/cjs/bins/redwood.d.ts.map +1 -0
- package/dist/cjs/bins/rwfw.d.ts +3 -0
- package/dist/cjs/bins/rwfw.d.ts.map +1 -0
- package/dist/cjs/bins/tsc.d.ts +3 -0
- package/dist/cjs/bins/tsc.d.ts.map +1 -0
- package/dist/{bins → cjs/bins}/tsc.js +2 -2
- package/dist/cjs/cache/clients/BaseClient.d.ts +11 -0
- package/dist/cjs/cache/clients/BaseClient.d.ts.map +1 -0
- package/dist/cjs/cache/clients/BaseClient.js +27 -0
- package/dist/cjs/cache/clients/InMemoryClient.d.ts +31 -0
- package/dist/cjs/cache/clients/InMemoryClient.d.ts.map +1 -0
- package/dist/cjs/cache/clients/InMemoryClient.js +100 -0
- package/dist/cjs/cache/clients/MemcachedClient.d.ts +16 -0
- package/dist/cjs/cache/clients/MemcachedClient.d.ts.map +1 -0
- package/dist/cjs/cache/clients/MemcachedClient.js +75 -0
- package/dist/cjs/cache/clients/RedisClient.d.ts +20 -0
- package/dist/cjs/cache/clients/RedisClient.d.ts.map +1 -0
- package/dist/cjs/cache/clients/RedisClient.js +79 -0
- package/dist/cjs/cache/errors.d.ts +4 -0
- package/dist/cjs/cache/errors.d.ts.map +1 -0
- package/dist/cjs/cache/errors.js +33 -0
- package/dist/cjs/cache/index.d.ts +35 -0
- package/dist/cjs/cache/index.d.ts.map +1 -0
- package/dist/cjs/cache/index.js +171 -0
- package/dist/cjs/cors.d.ts +16 -0
- package/dist/cjs/cors.d.ts.map +1 -0
- package/dist/cjs/cors.js +93 -0
- package/dist/cjs/errors.d.ts +5 -0
- package/dist/cjs/errors.d.ts.map +1 -0
- package/dist/cjs/errors.js +38 -0
- package/dist/cjs/event.d.ts +3 -0
- package/dist/cjs/event.d.ts.map +1 -0
- package/dist/cjs/event.js +34 -0
- package/dist/cjs/functions/fixtures/apiGatewayProxyEvent.fixture.d.ts +4 -0
- package/dist/cjs/functions/fixtures/apiGatewayProxyEvent.fixture.d.ts.map +1 -0
- package/dist/cjs/functions/fixtures/apiGatewayProxyEvent.fixture.js +72 -0
- package/dist/cjs/index.d.ts +11 -0
- package/dist/cjs/index.d.ts.map +1 -0
- package/dist/cjs/index.js +63 -0
- package/dist/cjs/logger/index.d.ts +179 -0
- package/dist/cjs/logger/index.d.ts.map +1 -0
- package/dist/cjs/logger/index.js +195 -0
- package/dist/cjs/package.json +1 -0
- package/dist/cjs/transforms.d.ts +35 -0
- package/dist/cjs/transforms.d.ts.map +1 -0
- package/dist/cjs/transforms.js +98 -0
- package/dist/cjs/types.d.ts +25 -0
- package/dist/cjs/types.d.ts.map +1 -0
- package/dist/cjs/types.js +16 -0
- package/dist/cjs/validations/errors.d.ts +101 -0
- package/dist/cjs/validations/errors.d.ts.map +1 -0
- package/dist/cjs/validations/errors.js +298 -0
- package/dist/cjs/validations/validations.d.ts +222 -0
- package/dist/cjs/validations/validations.d.ts.map +1 -0
- package/dist/cjs/validations/validations.js +351 -0
- package/dist/cjs/webhooks/index.d.ts +76 -0
- package/dist/cjs/webhooks/index.d.ts.map +1 -0
- package/dist/cjs/webhooks/index.js +107 -0
- package/dist/cors.js +7 -30
- package/dist/errors.js +3 -26
- package/dist/event.js +5 -28
- package/dist/functions/fixtures/apiGatewayProxyEvent.fixture.js +4 -27
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +17 -46
- package/dist/logger/index.d.ts.map +1 -1
- package/dist/logger/index.js +6 -48
- package/dist/package.json +1 -0
- package/dist/transforms.js +6 -33
- package/dist/types.js +1 -16
- package/dist/validations/errors.js +8 -66
- package/dist/validations/validations.js +8 -44
- package/dist/webhooks/index.js +25 -46
- package/package.json +53 -18
- /package/dist/{bins → cjs/bins}/redwood.js +0 -0
- /package/dist/{bins → cjs/bins}/rwfw.js +0 -0
@@ -1,27 +1,4 @@
|
|
1
|
-
"
|
2
|
-
var __defProp = Object.defineProperty;
|
3
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
4
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
5
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
6
|
-
var __export = (target, all) => {
|
7
|
-
for (var name in all)
|
8
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
9
|
-
};
|
10
|
-
var __copyProps = (to, from, except, desc) => {
|
11
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
12
|
-
for (let key of __getOwnPropNames(from))
|
13
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
14
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
15
|
-
}
|
16
|
-
return to;
|
17
|
-
};
|
18
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
19
|
-
var apiGatewayProxyEvent_fixture_exports = {};
|
20
|
-
__export(apiGatewayProxyEvent_fixture_exports, {
|
21
|
-
default: () => apiGatewayProxyEvent_fixture_default,
|
22
|
-
mockedAPIGatewayProxyEvent: () => mockedAPIGatewayProxyEvent
|
23
|
-
});
|
24
|
-
module.exports = __toCommonJS(apiGatewayProxyEvent_fixture_exports);
|
1
|
+
import bannerPath from "node:path"; import bannerUrl from "node:url"; const __filename = bannerUrl.fileURLToPath(import.meta.url); const __dirname = bannerPath.dirname(__filename);
|
25
2
|
const mockedAPIGatewayProxyEvent = {
|
26
3
|
body: "MOCKED_BODY",
|
27
4
|
headers: {},
|
@@ -66,7 +43,7 @@ const mockedAPIGatewayProxyEvent = {
|
|
66
43
|
resource: "MOCKED_RESOURCE"
|
67
44
|
};
|
68
45
|
var apiGatewayProxyEvent_fixture_default = mockedAPIGatewayProxyEvent;
|
69
|
-
|
70
|
-
|
46
|
+
export {
|
47
|
+
apiGatewayProxyEvent_fixture_default as default,
|
71
48
|
mockedAPIGatewayProxyEvent
|
72
|
-
}
|
49
|
+
};
|
package/dist/index.d.ts.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAGA,cAAc,iBAAiB,CAAA;AAC/B,cAAc,aAAa,CAAA;AAC3B,cAAc,8BAA8B,CAAA;AAC5C,cAAc,yBAAyB,CAAA;AACvC,cAAc,YAAY,CAAA;AAC1B,cAAc,iBAAiB,CAAA;AAC/B,cAAc,WAAW,CAAA;AACzB,cAAc,YAAY,CAAA;AAM1B,eAAO,MAAM,aAAa,KAA8C,CAAA;AACxE,eAAO,MAAM,cAAc,KAAuB,CAAA"}
|
package/dist/index.js
CHANGED
@@ -1,49 +1,20 @@
|
|
1
|
-
"
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
}
|
16
|
-
return to;
|
17
|
-
};
|
18
|
-
var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
|
19
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
20
|
-
var index_exports = {};
|
21
|
-
__export(index_exports, {
|
22
|
-
prismaVersion: () => prismaVersion,
|
23
|
-
redwoodVersion: () => redwoodVersion
|
24
|
-
});
|
25
|
-
module.exports = __toCommonJS(index_exports);
|
26
|
-
__reExport(index_exports, require("./auth/index.js"), module.exports);
|
27
|
-
__reExport(index_exports, require("./errors.js"), module.exports);
|
28
|
-
__reExport(index_exports, require("./validations/validations.js"), module.exports);
|
29
|
-
__reExport(index_exports, require("./validations/errors.js"), module.exports);
|
30
|
-
__reExport(index_exports, require("./types.js"), module.exports);
|
31
|
-
__reExport(index_exports, require("./transforms.js"), module.exports);
|
32
|
-
__reExport(index_exports, require("./cors.js"), module.exports);
|
33
|
-
__reExport(index_exports, require("./event.js"), module.exports);
|
34
|
-
const packageJson = require("../package.json");
|
1
|
+
import bannerPath from "node:path"; import bannerUrl from "node:url"; const __filename = bannerUrl.fileURLToPath(import.meta.url); const __dirname = bannerPath.dirname(__filename);
|
2
|
+
import fs from "node:fs";
|
3
|
+
import path from "node:path";
|
4
|
+
export * from "./auth/index.js";
|
5
|
+
export * from "./errors.js";
|
6
|
+
export * from "./validations/validations.js";
|
7
|
+
export * from "./validations/errors.js";
|
8
|
+
export * from "./types.js";
|
9
|
+
export * from "./transforms.js";
|
10
|
+
export * from "./cors.js";
|
11
|
+
export * from "./event.js";
|
12
|
+
const packageJson = JSON.parse(
|
13
|
+
fs.readFileSync(path.join(__dirname, "../package.json"), "utf8")
|
14
|
+
);
|
35
15
|
const prismaVersion = packageJson?.dependencies["@prisma/client"];
|
36
16
|
const redwoodVersion = packageJson?.version;
|
37
|
-
|
38
|
-
0 && (module.exports = {
|
17
|
+
export {
|
39
18
|
prismaVersion,
|
40
|
-
redwoodVersion
|
41
|
-
|
42
|
-
...require("./errors.js"),
|
43
|
-
...require("./validations/validations.js"),
|
44
|
-
...require("./validations/errors.js"),
|
45
|
-
...require("./types.js"),
|
46
|
-
...require("./transforms.js"),
|
47
|
-
...require("./cors.js"),
|
48
|
-
...require("./event.js")
|
49
|
-
});
|
19
|
+
redwoodVersion
|
20
|
+
};
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/logger/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,MAAM,CAAA;AAGzB;;;GAGG;AACH,MAAM,MAAM,MAAM,GAAG,CAAC,CAAC,MAAM,CAAA;AAC7B,MAAM,MAAM,UAAU,GAAG,CAAC,CAAC,UAAU,CAAA;AACrC,MAAM,MAAM,iBAAiB,GAAG,CAAC,CAAC,iBAAiB,CAAA;AACnD,MAAM,MAAM,eAAe,GAAG,CAAC,CAAC,eAAe,CAAA;AAC/C,MAAM,MAAM,aAAa,GAAG,CAAC,CAAC,aAAa,CAAA;AAC3C,MAAM,MAAM,QAAQ,GAAG,MAAM,GAAG,OAAO,GAAG,MAAM,GAAG,OAAO,CAAA;AAI1D,KAAK,YAAY,GAAG,GAAG,CAAA;AAEvB,KAAK,aAAa,GAAG;IACnB,KAAK,EAAE,QAAQ,CAAA;IACf,IAAI,EAAE,QAAQ,GAAG,OAAO,CAAA;CACzB,CAAA;AAgBD;;;;;GAKG;AACH,eAAO,MAAM,aAAa,SAAyC,CAAA;AA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nPropNames = Object.getOwnPropertyNames;
|
6
|
-
var __getProtoOf = Object.getPrototypeOf;
|
7
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
8
|
-
var __export = (target, all) => {
|
9
|
-
for (var name in all)
|
10
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
11
|
-
};
|
12
|
-
var __copyProps = (to, from, except, desc) => {
|
13
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
14
|
-
for (let key of __getOwnPropNames(from))
|
15
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
16
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
17
|
-
}
|
18
|
-
return to;
|
19
|
-
};
|
20
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
21
|
-
// If the importer is in node compatibility mode or this is not an ESM
|
22
|
-
// file that has been converted to a CommonJS file using a Babel-
|
23
|
-
// compatible transform (i.e. "__esModule" has not been set), then set
|
24
|
-
// "default" to the CommonJS "module.exports" for node compatibility.
|
25
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
26
|
-
mod
|
27
|
-
));
|
28
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
29
|
-
var logger_exports = {};
|
30
|
-
__export(logger_exports, {
|
31
|
-
createLogger: () => createLogger,
|
32
|
-
defaultLogLevels: () => defaultLogLevels,
|
33
|
-
defaultLoggerOptions: () => defaultLoggerOptions,
|
34
|
-
emitLogLevels: () => emitLogLevels,
|
35
|
-
handlePrismaLogging: () => handlePrismaLogging,
|
36
|
-
isDevelopment: () => isDevelopment,
|
37
|
-
isProduction: () => isProduction,
|
38
|
-
isTest: () => isTest,
|
39
|
-
logLevel: () => logLevel,
|
40
|
-
redactionsList: () => redactionsList
|
41
|
-
});
|
42
|
-
module.exports = __toCommonJS(logger_exports);
|
43
|
-
var import_pino = __toESM(require("pino"));
|
1
|
+
import bannerPath from "node:path"; import bannerUrl from "node:url"; const __filename = bannerUrl.fileURLToPath(import.meta.url); const __dirname = bannerPath.dirname(__filename);
|
2
|
+
import pino from "pino";
|
44
3
|
const isDevelopment = process.env.NODE_ENV === "development";
|
45
4
|
const isTest = process.env.NODE_ENV === "test";
|
46
5
|
const isProduction = !isDevelopment && !isTest;
|
@@ -119,14 +78,14 @@ const createLogger = ({
|
|
119
78
|
"Please make certain that file system access is available when logging to a file in a production environment."
|
120
79
|
);
|
121
80
|
}
|
122
|
-
return (
|
81
|
+
return pino(options, stream);
|
123
82
|
} else {
|
124
83
|
if (isStream && isDevelopment && !isTest) {
|
125
84
|
console.warn(
|
126
85
|
"Logs will be sent to the transport stream in the current development environment."
|
127
86
|
);
|
128
87
|
}
|
129
|
-
return (
|
88
|
+
return pino(options, stream);
|
130
89
|
}
|
131
90
|
};
|
132
91
|
const DEFAULT_SLOW_QUERY_THRESHOLD = 2e3;
|
@@ -180,8 +139,7 @@ const handlePrismaLogging = (config) => {
|
|
180
139
|
});
|
181
140
|
return;
|
182
141
|
};
|
183
|
-
|
184
|
-
0 && (module.exports = {
|
142
|
+
export {
|
185
143
|
createLogger,
|
186
144
|
defaultLogLevels,
|
187
145
|
defaultLoggerOptions,
|
@@ -192,4 +150,4 @@ const handlePrismaLogging = (config) => {
|
|
192
150
|
isTest,
|
193
151
|
logLevel,
|
194
152
|
redactionsList
|
195
|
-
}
|
153
|
+
};
|
@@ -0,0 +1 @@
|
|
1
|
+
{"type":"module","version":"9.0.0-canary.582+24d77010b","dependencies":{"@prisma/client":"5.20.0","@whatwg-node/fetch":"0.9.21","cookie":"1.0.2","humanize-string":"2.1.0","jsonwebtoken":"9.0.2","pascalcase":"1.0.0","pino":"9.4.0","title-case":"3.0.3"}}
|
package/dist/transforms.js
CHANGED
@@ -1,31 +1,5 @@
|
|
1
|
-
"
|
2
|
-
|
3
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
4
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
5
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
6
|
-
var __export = (target, all) => {
|
7
|
-
for (var name in all)
|
8
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
9
|
-
};
|
10
|
-
var __copyProps = (to, from, except, desc) => {
|
11
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
12
|
-
for (let key of __getOwnPropNames(from))
|
13
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
14
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
15
|
-
}
|
16
|
-
return to;
|
17
|
-
};
|
18
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
19
|
-
var transforms_exports = {};
|
20
|
-
__export(transforms_exports, {
|
21
|
-
isFetchApiRequest: () => isFetchApiRequest,
|
22
|
-
normalizeRequest: () => normalizeRequest,
|
23
|
-
parseFetchEventBody: () => parseFetchEventBody,
|
24
|
-
parseLambdaEventBody: () => parseLambdaEventBody,
|
25
|
-
removeNulls: () => removeNulls
|
26
|
-
});
|
27
|
-
module.exports = __toCommonJS(transforms_exports);
|
28
|
-
var import_fetch = require("@whatwg-node/fetch");
|
1
|
+
import bannerPath from "node:path"; import bannerUrl from "node:url"; const __filename = bannerUrl.fileURLToPath(import.meta.url); const __dirname = bannerPath.dirname(__filename);
|
2
|
+
import { Headers, Request as PonyfillRequest } from "@whatwg-node/fetch";
|
29
3
|
const parseLambdaEventBody = (event) => {
|
30
4
|
if (!event.body) {
|
31
5
|
return {};
|
@@ -44,7 +18,7 @@ const parseFetchEventBody = async (event) => {
|
|
44
18
|
return body ? JSON.parse(body) : {};
|
45
19
|
};
|
46
20
|
const isFetchApiRequest = (event) => {
|
47
|
-
if (event.constructor.name === "Request" || event.constructor.name ===
|
21
|
+
if (event.constructor.name === "Request" || event.constructor.name === PonyfillRequest.name) {
|
48
22
|
return true;
|
49
23
|
}
|
50
24
|
if (Symbol.iterator in Object(event.headers)) {
|
@@ -72,7 +46,7 @@ async function normalizeRequest(event) {
|
|
72
46
|
}
|
73
47
|
const jsonBody = parseLambdaEventBody(event);
|
74
48
|
return {
|
75
|
-
headers: new
|
49
|
+
headers: new Headers(event.headers),
|
76
50
|
method: event.httpMethod,
|
77
51
|
query: event.queryStringParameters,
|
78
52
|
jsonBody
|
@@ -88,11 +62,10 @@ const removeNulls = (input) => {
|
|
88
62
|
}
|
89
63
|
return input;
|
90
64
|
};
|
91
|
-
|
92
|
-
0 && (module.exports = {
|
65
|
+
export {
|
93
66
|
isFetchApiRequest,
|
94
67
|
normalizeRequest,
|
95
68
|
parseFetchEventBody,
|
96
69
|
parseLambdaEventBody,
|
97
70
|
removeNulls
|
98
|
-
}
|
71
|
+
};
|
package/dist/types.js
CHANGED
@@ -1,16 +1 @@
|
|
1
|
-
"
|
2
|
-
var __defProp = Object.defineProperty;
|
3
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
4
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
5
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
6
|
-
var __copyProps = (to, from, except, desc) => {
|
7
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
8
|
-
for (let key of __getOwnPropNames(from))
|
9
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
10
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
11
|
-
}
|
12
|
-
return to;
|
13
|
-
};
|
14
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
15
|
-
var types_exports = {};
|
16
|
-
module.exports = __toCommonJS(types_exports);
|
1
|
+
import bannerPath from "node:path"; import bannerUrl from "node:url"; const __filename = bannerUrl.fileURLToPath(import.meta.url); const __dirname = bannerPath.dirname(__filename);
|
@@ -1,72 +1,15 @@
|
|
1
|
-
"
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
var __getProtoOf = Object.getPrototypeOf;
|
7
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
8
|
-
var __export = (target, all) => {
|
9
|
-
for (var name in all)
|
10
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
11
|
-
};
|
12
|
-
var __copyProps = (to, from, except, desc) => {
|
13
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
14
|
-
for (let key of __getOwnPropNames(from))
|
15
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
16
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
17
|
-
}
|
18
|
-
return to;
|
19
|
-
};
|
20
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
21
|
-
// If the importer is in node compatibility mode or this is not an ESM
|
22
|
-
// file that has been converted to a CommonJS file using a Babel-
|
23
|
-
// compatible transform (i.e. "__esModule" has not been set), then set
|
24
|
-
// "default" to the CommonJS "module.exports" for node compatibility.
|
25
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
26
|
-
mod
|
27
|
-
));
|
28
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
29
|
-
var errors_exports = {};
|
30
|
-
__export(errors_exports, {
|
31
|
-
AbsenceValidationError: () => AbsenceValidationError,
|
32
|
-
AcceptanceValidationError: () => AcceptanceValidationError,
|
33
|
-
BetweenLengthValidationError: () => BetweenLengthValidationError,
|
34
|
-
CustomValidationError: () => CustomValidationError,
|
35
|
-
EmailValidationError: () => EmailValidationError,
|
36
|
-
EqualLengthValidationError: () => EqualLengthValidationError,
|
37
|
-
EqualNumericalityValidationError: () => EqualNumericalityValidationError,
|
38
|
-
EvenNumericalityValidationError: () => EvenNumericalityValidationError,
|
39
|
-
ExclusionValidationError: () => ExclusionValidationError,
|
40
|
-
FormatValidationError: () => FormatValidationError,
|
41
|
-
GreaterThanNumericalityValidationError: () => GreaterThanNumericalityValidationError,
|
42
|
-
GreaterThanOrEqualNumericalityValidationError: () => GreaterThanOrEqualNumericalityValidationError,
|
43
|
-
InclusionValidationError: () => InclusionValidationError,
|
44
|
-
IntegerNumericalityValidationError: () => IntegerNumericalityValidationError,
|
45
|
-
LessThanNumericalityValidationError: () => LessThanNumericalityValidationError,
|
46
|
-
LessThanOrEqualNumericalityValidationError: () => LessThanOrEqualNumericalityValidationError,
|
47
|
-
MaxLengthValidationError: () => MaxLengthValidationError,
|
48
|
-
MinLengthValidationError: () => MinLengthValidationError,
|
49
|
-
NegativeNumericalityValidationError: () => NegativeNumericalityValidationError,
|
50
|
-
OddNumericalityValidationError: () => OddNumericalityValidationError,
|
51
|
-
OtherThanNumericalityValidationError: () => OtherThanNumericalityValidationError,
|
52
|
-
PositiveNumericalityValidationError: () => PositiveNumericalityValidationError,
|
53
|
-
PresenceValidationError: () => PresenceValidationError,
|
54
|
-
ServiceValidationError: () => ServiceValidationError,
|
55
|
-
TypeNumericalityValidationError: () => TypeNumericalityValidationError,
|
56
|
-
UniquenessValidationError: () => UniquenessValidationError
|
57
|
-
});
|
58
|
-
module.exports = __toCommonJS(errors_exports);
|
59
|
-
var import_humanize_string = __toESM(require("humanize-string"));
|
60
|
-
var import_title_case = require("title-case");
|
61
|
-
var import_errors = require("../errors.js");
|
62
|
-
class ServiceValidationError extends import_errors.RedwoodError {
|
1
|
+
import bannerPath from "node:path"; import bannerUrl from "node:url"; const __filename = bannerUrl.fileURLToPath(import.meta.url); const __dirname = bannerPath.dirname(__filename);
|
2
|
+
import humanize from "humanize-string";
|
3
|
+
import { titleCase } from "title-case";
|
4
|
+
import { RedwoodError } from "../errors.js";
|
5
|
+
class ServiceValidationError extends RedwoodError {
|
63
6
|
constructor(message, substitutions = {}) {
|
64
7
|
let errorMessage = message;
|
65
8
|
let extensions = {};
|
66
9
|
for (const [key, value] of Object.entries(substitutions)) {
|
67
10
|
errorMessage = errorMessage.replaceAll(
|
68
11
|
`\${${key}}`,
|
69
|
-
|
12
|
+
titleCase(humanize(String(value)))
|
70
13
|
);
|
71
14
|
extensions = {
|
72
15
|
code: "BAD_USER_INPUT",
|
@@ -267,8 +210,7 @@ class UniquenessValidationError extends ServiceValidationError {
|
|
267
210
|
Object.setPrototypeOf(this, UniquenessValidationError.prototype);
|
268
211
|
}
|
269
212
|
}
|
270
|
-
|
271
|
-
0 && (module.exports = {
|
213
|
+
export {
|
272
214
|
AbsenceValidationError,
|
273
215
|
AcceptanceValidationError,
|
274
216
|
BetweenLengthValidationError,
|
@@ -295,4 +237,4 @@ class UniquenessValidationError extends ServiceValidationError {
|
|
295
237
|
ServiceValidationError,
|
296
238
|
TypeNumericalityValidationError,
|
297
239
|
UniquenessValidationError
|
298
|
-
}
|
240
|
+
};
|
@@ -1,42 +1,7 @@
|
|
1
|
-
"
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
6
|
-
var __getProtoOf = Object.getPrototypeOf;
|
7
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
8
|
-
var __export = (target, all) => {
|
9
|
-
for (var name in all)
|
10
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
11
|
-
};
|
12
|
-
var __copyProps = (to, from, except, desc) => {
|
13
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
14
|
-
for (let key of __getOwnPropNames(from))
|
15
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
16
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
17
|
-
}
|
18
|
-
return to;
|
19
|
-
};
|
20
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
21
|
-
// If the importer is in node compatibility mode or this is not an ESM
|
22
|
-
// file that has been converted to a CommonJS file using a Babel-
|
23
|
-
// compatible transform (i.e. "__esModule" has not been set), then set
|
24
|
-
// "default" to the CommonJS "module.exports" for node compatibility.
|
25
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
26
|
-
mod
|
27
|
-
));
|
28
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
29
|
-
var validations_exports = {};
|
30
|
-
__export(validations_exports, {
|
31
|
-
validate: () => validate,
|
32
|
-
validateUniqueness: () => validateUniqueness,
|
33
|
-
validateWith: () => validateWith,
|
34
|
-
validateWithSync: () => validateWithSync
|
35
|
-
});
|
36
|
-
module.exports = __toCommonJS(validations_exports);
|
37
|
-
var import_client = require("@prisma/client");
|
38
|
-
var import_pascalcase = __toESM(require("pascalcase"));
|
39
|
-
var ValidationErrors = __toESM(require("./errors.js"));
|
1
|
+
import bannerPath from "node:path"; import bannerUrl from "node:url"; const __filename = bannerUrl.fileURLToPath(import.meta.url); const __dirname = bannerPath.dirname(__filename);
|
2
|
+
import { PrismaClient } from "@prisma/client";
|
3
|
+
import pascalcase from "pascalcase";
|
4
|
+
import * as ValidationErrors from "./errors.js";
|
40
5
|
const VALIDATORS = {
|
41
6
|
// Requires that the given value is `null` or `undefined`
|
42
7
|
//
|
@@ -259,7 +224,7 @@ const fieldsToString = (fields) => {
|
|
259
224
|
return output.join(", ");
|
260
225
|
};
|
261
226
|
const validationError = (type, name, options, substitutions = {}) => {
|
262
|
-
const errorClassName = `${(
|
227
|
+
const errorClassName = `${pascalcase(
|
263
228
|
type
|
264
229
|
)}ValidationError`;
|
265
230
|
const ErrorClass = ValidationErrors[errorClassName];
|
@@ -322,7 +287,7 @@ async function validateUniqueness(model, fields, optionsOrCallback, callback) {
|
|
322
287
|
options = restOptions;
|
323
288
|
db = customDb;
|
324
289
|
} else {
|
325
|
-
db = new
|
290
|
+
db = new PrismaClient();
|
326
291
|
}
|
327
292
|
const where = {
|
328
293
|
AND: [rest],
|
@@ -342,10 +307,9 @@ async function validateUniqueness(model, fields, optionsOrCallback, callback) {
|
|
342
307
|
return validCallback(tx);
|
343
308
|
});
|
344
309
|
}
|
345
|
-
|
346
|
-
0 && (module.exports = {
|
310
|
+
export {
|
347
311
|
validate,
|
348
312
|
validateUniqueness,
|
349
313
|
validateWith,
|
350
314
|
validateWithSync
|
351
|
-
}
|
315
|
+
};
|
package/dist/webhooks/index.js
CHANGED
@@ -1,36 +1,16 @@
|
|
1
|
-
"
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
15
|
-
}
|
16
|
-
return to;
|
17
|
-
};
|
18
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
19
|
-
var webhooks_exports = {};
|
20
|
-
__export(webhooks_exports, {
|
21
|
-
DEFAULT_WEBHOOK_SECRET: () => import_verifiers2.DEFAULT_WEBHOOK_SECRET,
|
22
|
-
DEFAULT_WEBHOOK_SIGNATURE_HEADER: () => DEFAULT_WEBHOOK_SIGNATURE_HEADER,
|
23
|
-
SupportedVerifierTypes: () => import_verifiers2.SupportedVerifierTypes,
|
24
|
-
VerifyOptions: () => import_verifiers2.VerifyOptions,
|
25
|
-
WebhookVerificationError: () => import_verifiers2.WebhookVerificationError,
|
26
|
-
signPayload: () => signPayload,
|
27
|
-
signatureFromEvent: () => signatureFromEvent,
|
28
|
-
verifyEvent: () => verifyEvent,
|
29
|
-
verifySignature: () => verifySignature
|
30
|
-
});
|
31
|
-
module.exports = __toCommonJS(webhooks_exports);
|
32
|
-
var import_verifiers = require("../auth/verifiers/index.js");
|
33
|
-
var import_verifiers2 = require("../auth/verifiers/index.js");
|
1
|
+
import bannerPath from "node:path"; import bannerUrl from "node:url"; const __filename = bannerUrl.fileURLToPath(import.meta.url); const __dirname = bannerPath.dirname(__filename);
|
2
|
+
import {
|
3
|
+
createVerifier,
|
4
|
+
WebhookVerificationError,
|
5
|
+
DEFAULT_WEBHOOK_SECRET,
|
6
|
+
DEFAULT_TOLERANCE
|
7
|
+
} from "../auth/verifiers/index.js";
|
8
|
+
import {
|
9
|
+
VerifyOptions,
|
10
|
+
WebhookVerificationError as WebhookVerificationError2,
|
11
|
+
DEFAULT_WEBHOOK_SECRET as DEFAULT_WEBHOOK_SECRET2,
|
12
|
+
SupportedVerifierTypes
|
13
|
+
} from "../auth/verifiers/index.js";
|
34
14
|
const DEFAULT_WEBHOOK_SIGNATURE_HEADER = "RW-WEBHOOK-SIGNATURE";
|
35
15
|
const eventBody = (event) => {
|
36
16
|
if (event.isBase64Encoded) {
|
@@ -49,7 +29,7 @@ const signatureFromEvent = ({
|
|
49
29
|
const verifyEvent = (type, {
|
50
30
|
event,
|
51
31
|
payload,
|
52
|
-
secret =
|
32
|
+
secret = DEFAULT_WEBHOOK_SECRET,
|
53
33
|
options
|
54
34
|
}) => {
|
55
35
|
let body = "";
|
@@ -68,40 +48,39 @@ const verifyEvent = (type, {
|
|
68
48
|
if (options?.eventTimestamp) {
|
69
49
|
const timestamp = options?.currentTimestampOverride ?? Date.now();
|
70
50
|
const difference = Math.abs(timestamp - options?.eventTimestamp);
|
71
|
-
const tolerance = options?.tolerance ??
|
51
|
+
const tolerance = options?.tolerance ?? DEFAULT_TOLERANCE;
|
72
52
|
if (difference > tolerance) {
|
73
|
-
throw new
|
53
|
+
throw new WebhookVerificationError();
|
74
54
|
}
|
75
55
|
}
|
76
|
-
const { verify } =
|
56
|
+
const { verify } = createVerifier(type, options);
|
77
57
|
return verify({ payload: body, secret, signature });
|
78
58
|
};
|
79
59
|
const verifySignature = (type, {
|
80
60
|
payload,
|
81
|
-
secret =
|
61
|
+
secret = DEFAULT_WEBHOOK_SECRET,
|
82
62
|
signature,
|
83
63
|
options
|
84
64
|
}) => {
|
85
|
-
const { verify } =
|
65
|
+
const { verify } = createVerifier(type, options);
|
86
66
|
return verify({ payload, secret, signature });
|
87
67
|
};
|
88
68
|
const signPayload = (type, {
|
89
69
|
payload,
|
90
|
-
secret =
|
70
|
+
secret = DEFAULT_WEBHOOK_SECRET,
|
91
71
|
options
|
92
72
|
}) => {
|
93
|
-
const { sign } =
|
73
|
+
const { sign } = createVerifier(type, options);
|
94
74
|
return sign({ payload, secret });
|
95
75
|
};
|
96
|
-
|
97
|
-
|
98
|
-
DEFAULT_WEBHOOK_SECRET,
|
76
|
+
export {
|
77
|
+
DEFAULT_WEBHOOK_SECRET2 as DEFAULT_WEBHOOK_SECRET,
|
99
78
|
DEFAULT_WEBHOOK_SIGNATURE_HEADER,
|
100
79
|
SupportedVerifierTypes,
|
101
80
|
VerifyOptions,
|
102
|
-
WebhookVerificationError,
|
81
|
+
WebhookVerificationError2 as WebhookVerificationError,
|
103
82
|
signPayload,
|
104
83
|
signatureFromEvent,
|
105
84
|
verifyEvent,
|
106
85
|
verifySignature
|
107
|
-
}
|
86
|
+
};
|