@cedarjs/api 5.0.6-rc.4 → 5.0.7-next.186
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.d.ts +9 -0
- package/dist/auth/index.d.ts.map +1 -1
- package/dist/auth/index.js +7 -0
- package/dist/bins/cedar.js +14 -0
- package/dist/bins/cfw.js +14 -0
- package/dist/bins/redwood.js +14 -0
- package/dist/bins/tsc.js +8 -0
- package/dist/index.js +3 -3
- package/dist/runtime.d.ts +0 -26
- package/dist/runtime.d.ts.map +1 -1
- package/dist/runtime.js +1 -22
- package/package.json +17 -41
- package/dist/cjs/auth/index.d.ts +0 -64
- package/dist/cjs/auth/index.d.ts.map +0 -1
- package/dist/cjs/auth/index.js +0 -143
- package/dist/cjs/auth/parseJWT.d.ts +0 -6
- package/dist/cjs/auth/parseJWT.d.ts.map +0 -1
- package/dist/cjs/auth/parseJWT.js +0 -57
- package/dist/cjs/auth/verifiers/base64Sha1Verifier.d.ts +0 -18
- package/dist/cjs/auth/verifiers/base64Sha1Verifier.d.ts.map +0 -1
- package/dist/cjs/auth/verifiers/base64Sha1Verifier.js +0 -77
- package/dist/cjs/auth/verifiers/base64Sha256Verifier.d.ts +0 -18
- package/dist/cjs/auth/verifiers/base64Sha256Verifier.d.ts.map +0 -1
- package/dist/cjs/auth/verifiers/base64Sha256Verifier.js +0 -77
- package/dist/cjs/auth/verifiers/common.d.ts +0 -112
- package/dist/cjs/auth/verifiers/common.d.ts.map +0 -1
- package/dist/cjs/auth/verifiers/common.js +0 -89
- package/dist/cjs/auth/verifiers/index.d.ts +0 -8
- package/dist/cjs/auth/verifiers/index.d.ts.map +0 -1
- package/dist/cjs/auth/verifiers/index.js +0 -39
- package/dist/cjs/auth/verifiers/jwtVerifier.d.ts +0 -18
- package/dist/cjs/auth/verifiers/jwtVerifier.d.ts.map +0 -1
- package/dist/cjs/auth/verifiers/jwtVerifier.js +0 -84
- package/dist/cjs/auth/verifiers/secretKeyVerifier.d.ts +0 -11
- package/dist/cjs/auth/verifiers/secretKeyVerifier.d.ts.map +0 -1
- package/dist/cjs/auth/verifiers/secretKeyVerifier.js +0 -43
- package/dist/cjs/auth/verifiers/sha1Verifier.d.ts +0 -17
- package/dist/cjs/auth/verifiers/sha1Verifier.d.ts.map +0 -1
- package/dist/cjs/auth/verifiers/sha1Verifier.js +0 -85
- package/dist/cjs/auth/verifiers/sha256Verifier.d.ts +0 -17
- package/dist/cjs/auth/verifiers/sha256Verifier.d.ts.map +0 -1
- package/dist/cjs/auth/verifiers/sha256Verifier.js +0 -85
- package/dist/cjs/auth/verifiers/skipVerifier.d.ts +0 -11
- package/dist/cjs/auth/verifiers/skipVerifier.d.ts.map +0 -1
- package/dist/cjs/auth/verifiers/skipVerifier.js +0 -40
- package/dist/cjs/auth/verifiers/timestampSchemeVerifier.d.ts +0 -14
- package/dist/cjs/auth/verifiers/timestampSchemeVerifier.d.ts.map +0 -1
- package/dist/cjs/auth/verifiers/timestampSchemeVerifier.js +0 -86
- package/dist/cjs/bins/cedar.d.ts +0 -9
- package/dist/cjs/bins/cedar.d.ts.map +0 -1
- package/dist/cjs/bins/cedar.js +0 -36
- package/dist/cjs/bins/cfw.d.ts +0 -3
- package/dist/cjs/bins/cfw.d.ts.map +0 -1
- package/dist/cjs/bins/cfw.js +0 -36
- package/dist/cjs/bins/redwood.d.ts +0 -9
- package/dist/cjs/bins/redwood.d.ts.map +0 -1
- package/dist/cjs/bins/redwood.js +0 -36
- package/dist/cjs/bins/tsc.d.ts +0 -3
- package/dist/cjs/bins/tsc.d.ts.map +0 -1
- package/dist/cjs/bins/tsc.js +0 -30
- package/dist/cjs/cache/clients/BaseClient.d.ts +0 -11
- package/dist/cjs/cache/clients/BaseClient.d.ts.map +0 -1
- package/dist/cjs/cache/clients/BaseClient.js +0 -31
- package/dist/cjs/cache/clients/InMemoryClient.d.ts +0 -31
- package/dist/cjs/cache/clients/InMemoryClient.d.ts.map +0 -1
- package/dist/cjs/cache/clients/InMemoryClient.js +0 -94
- package/dist/cjs/cache/clients/MemcachedClient.d.ts +0 -16
- package/dist/cjs/cache/clients/MemcachedClient.d.ts.map +0 -1
- package/dist/cjs/cache/clients/MemcachedClient.js +0 -79
- package/dist/cjs/cache/clients/RedisClient.d.ts +0 -20
- package/dist/cjs/cache/clients/RedisClient.d.ts.map +0 -1
- package/dist/cjs/cache/clients/RedisClient.js +0 -83
- package/dist/cjs/cache/errors.d.ts +0 -4
- package/dist/cjs/cache/errors.d.ts.map +0 -1
- package/dist/cjs/cache/errors.js +0 -33
- package/dist/cjs/cache/index.d.ts +0 -35
- package/dist/cjs/cache/index.d.ts.map +0 -1
- package/dist/cjs/cache/index.js +0 -165
- package/dist/cjs/cors.d.ts +0 -16
- package/dist/cjs/cors.d.ts.map +0 -1
- package/dist/cjs/cors.js +0 -93
- package/dist/cjs/errors.d.ts +0 -5
- package/dist/cjs/errors.d.ts.map +0 -1
- package/dist/cjs/errors.js +0 -38
- package/dist/cjs/event.d.ts +0 -3
- package/dist/cjs/event.d.ts.map +0 -1
- package/dist/cjs/event.js +0 -34
- package/dist/cjs/functions/fixtures/apiGatewayProxyEvent.fixture.d.ts +0 -4
- package/dist/cjs/functions/fixtures/apiGatewayProxyEvent.fixture.d.ts.map +0 -1
- package/dist/cjs/functions/fixtures/apiGatewayProxyEvent.fixture.js +0 -72
- package/dist/cjs/index.d.ts +0 -15
- package/dist/cjs/index.d.ts.map +0 -1
- package/dist/cjs/index.js +0 -54
- package/dist/cjs/logger/index.d.ts +0 -179
- package/dist/cjs/logger/index.d.ts.map +0 -1
- package/dist/cjs/logger/index.js +0 -185
- package/dist/cjs/package.json +0 -1
- package/dist/cjs/runtime.d.ts +0 -68
- package/dist/cjs/runtime.d.ts.map +0 -1
- package/dist/cjs/runtime.js +0 -200
- package/dist/cjs/transforms.d.ts +0 -36
- package/dist/cjs/transforms.d.ts.map +0 -1
- package/dist/cjs/transforms.js +0 -176
- package/dist/cjs/types.d.ts +0 -25
- package/dist/cjs/types.d.ts.map +0 -1
- package/dist/cjs/types.js +0 -16
- package/dist/cjs/validations/errors.d.ts +0 -101
- package/dist/cjs/validations/errors.d.ts.map +0 -1
- package/dist/cjs/validations/errors.js +0 -298
- package/dist/cjs/validations/validations.d.ts +0 -235
- package/dist/cjs/validations/validations.d.ts.map +0 -1
- package/dist/cjs/validations/validations.js +0 -353
- package/dist/cjs/webhooks/index.d.ts +0 -77
- package/dist/cjs/webhooks/index.d.ts.map +0 -1
- package/dist/cjs/webhooks/index.js +0 -102
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"runtime.d.ts","sourceRoot":"","sources":["../../src/runtime.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,oBAAoB,EAEpB,qBAAqB,EACrB,OAAO,IAAI,aAAa,EACzB,MAAM,YAAY,CAAA;AAInB,OAAO,EAAE,wBAAwB,EAAE,MAAM,iBAAiB,CAAA;AAC1D,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,iBAAiB,CAAA;AAG9C;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,eAAO,MAAM,eAAe,EAAE,OAA0B,CAAA;AAExD,MAAM,WAAW,mBAAmB;IAClC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;IAC9B,KAAK,EAAE,eAAe,CAAA;IACtB,OAAO,EAAE,WAAW,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;IACpC,eAAe,CAAC,EAAE,OAAO,CAAC,UAAU,CAAC,OAAO,wBAAwB,CAAC,CAAC,CAAA;CACvE;AAED,MAAM,MAAM,YAAY,GAAG,CACzB,OAAO,EAAE,OAAO,EAChB,GAAG,EAAE,mBAAmB,KACrB,OAAO,CAAC,QAAQ,CAAC,GAAG,QAAQ,CAAA;AAEjC,MAAM,MAAM,eAAe,GAAG,CAC5B,OAAO,EAAE,OAAO,EAChB,GAAG,EAAE,mBAAmB,EACxB,IAAI,EAAE,MAAM,OAA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AE,GAAG,MAAM,CAEtE;AAED,wBAAgB,iBAAiB,CAC/B,aAAa,EAAE,aAAa,EAC5B,OAAO,GAAE,wBAA6B,GACrC,YAAY,CAQd;AAED,wBAAsB,oBAAoB,CACxC,OAAO,EAAE,OAAO,EAChB,GAAG,EAAE,mBAAmB,GACvB,OAAO,CAAC,oBAAoB,CAAC,CAqB/B;AAED,wBAAgB,sBAAsB,CAAC,MAAM,EAAE,mBAAmB,GAAG,QAAQ,CAsD5E"}
|
package/dist/cjs/runtime.js
DELETED
|
@@ -1,200 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __create = Object.create;
|
|
3
|
-
var __defProp = Object.defineProperty;
|
|
4
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
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 runtime_exports = {};
|
|
30
|
-
__export(runtime_exports, {
|
|
31
|
-
buildCedarContext: () => buildCedarContext,
|
|
32
|
-
composeCedarMiddleware: () => composeCedarMiddleware,
|
|
33
|
-
createRouteManifest: () => createRouteManifest,
|
|
34
|
-
legacyResultToResponse: () => legacyResultToResponse,
|
|
35
|
-
noopAuthDecoder: () => noopAuthDecoder,
|
|
36
|
-
requestToLegacyEvent: () => requestToLegacyEvent,
|
|
37
|
-
routeManifestToJSON: () => routeManifestToJSON,
|
|
38
|
-
wrapLegacyHandler: () => wrapLegacyHandler
|
|
39
|
-
});
|
|
40
|
-
module.exports = __toCommonJS(runtime_exports);
|
|
41
|
-
var cookie = __toESM(require("cookie"), 1);
|
|
42
|
-
var import_picoquery = require("picoquery");
|
|
43
|
-
var import_auth = require("./auth/index.js");
|
|
44
|
-
var import_transforms = require("./transforms.js");
|
|
45
|
-
const noopAuthDecoder = async () => null;
|
|
46
|
-
const DEFAULT_LAMBDA_CONTEXT = {
|
|
47
|
-
callbackWaitsForEmptyEventLoop: false,
|
|
48
|
-
functionName: "cedar",
|
|
49
|
-
functionVersion: "$LATEST",
|
|
50
|
-
invokedFunctionArn: "cedar",
|
|
51
|
-
memoryLimitInMB: "0",
|
|
52
|
-
awsRequestId: "cedar-request",
|
|
53
|
-
logGroupName: "cedar",
|
|
54
|
-
logStreamName: "cedar",
|
|
55
|
-
getRemainingTimeInMillis() {
|
|
56
|
-
return 0;
|
|
57
|
-
},
|
|
58
|
-
done() {
|
|
59
|
-
return void 0;
|
|
60
|
-
},
|
|
61
|
-
fail() {
|
|
62
|
-
return void 0;
|
|
63
|
-
},
|
|
64
|
-
succeed() {
|
|
65
|
-
return void 0;
|
|
66
|
-
}
|
|
67
|
-
};
|
|
68
|
-
function hasAuthDecoder(authDecoder) {
|
|
69
|
-
if (Array.isArray(authDecoder)) {
|
|
70
|
-
return authDecoder.length > 0;
|
|
71
|
-
}
|
|
72
|
-
return !!authDecoder;
|
|
73
|
-
}
|
|
74
|
-
async function buildCedarContext(request, options = {}) {
|
|
75
|
-
const url = new URL(request.url);
|
|
76
|
-
const query = url.searchParams;
|
|
77
|
-
const cookies = new Map(
|
|
78
|
-
Object.entries(cookie.parse(request.headers.get("cookie") ?? "")).filter(
|
|
79
|
-
(entry) => {
|
|
80
|
-
return entry[1] !== void 0;
|
|
81
|
-
}
|
|
82
|
-
)
|
|
83
|
-
);
|
|
84
|
-
const params = options.params ?? {};
|
|
85
|
-
const serverAuthState = hasAuthDecoder(options.authDecoder) ? await (0, import_auth.getAuthenticationContext)({
|
|
86
|
-
authDecoder: options.authDecoder,
|
|
87
|
-
event: request,
|
|
88
|
-
context: options.lambdaContext
|
|
89
|
-
}) : void 0;
|
|
90
|
-
return {
|
|
91
|
-
params,
|
|
92
|
-
query,
|
|
93
|
-
cookies,
|
|
94
|
-
serverAuthState
|
|
95
|
-
};
|
|
96
|
-
}
|
|
97
|
-
function composeCedarMiddleware(handler, middleware) {
|
|
98
|
-
return middleware.reduceRight((next, current) => {
|
|
99
|
-
return (request, ctx) => {
|
|
100
|
-
return current(request, ctx, async () => next(request, ctx));
|
|
101
|
-
};
|
|
102
|
-
}, handler);
|
|
103
|
-
}
|
|
104
|
-
function createRouteManifest(routes) {
|
|
105
|
-
return routes.map((route) => {
|
|
106
|
-
return {
|
|
107
|
-
...route,
|
|
108
|
-
methods: [...route.methods]
|
|
109
|
-
};
|
|
110
|
-
});
|
|
111
|
-
}
|
|
112
|
-
function routeManifestToJSON(routes) {
|
|
113
|
-
return JSON.stringify(createRouteManifest(routes), null, 2);
|
|
114
|
-
}
|
|
115
|
-
function wrapLegacyHandler(legacyHandler, options = {}) {
|
|
116
|
-
return async (request, ctx) => {
|
|
117
|
-
const lambdaContext = options.lambdaContext ?? DEFAULT_LAMBDA_CONTEXT;
|
|
118
|
-
const event = await requestToLegacyEvent(request, ctx);
|
|
119
|
-
const result = await legacyHandler(event, lambdaContext);
|
|
120
|
-
return legacyResultToResponse(result);
|
|
121
|
-
};
|
|
122
|
-
}
|
|
123
|
-
async function requestToLegacyEvent(request, ctx) {
|
|
124
|
-
const url = new URL(request.url);
|
|
125
|
-
const base = await (0, import_transforms.requestToBaseEvent)(request);
|
|
126
|
-
const queryStringParameters = (0, import_picoquery.parse)(url.search ? url.search.slice(1) : "", {
|
|
127
|
-
nestingSyntax: "index",
|
|
128
|
-
arrayRepeat: true,
|
|
129
|
-
arrayRepeatSyntax: "bracket"
|
|
130
|
-
});
|
|
131
|
-
return {
|
|
132
|
-
...base,
|
|
133
|
-
queryStringParameters,
|
|
134
|
-
multiValueQueryStringParameters: toMultiValueQueryStringParameters(url),
|
|
135
|
-
pathParameters: Object.keys(ctx.params).length > 0 ? ctx.params : base.pathParameters
|
|
136
|
-
};
|
|
137
|
-
}
|
|
138
|
-
function legacyResultToResponse(result) {
|
|
139
|
-
if (result instanceof Response) {
|
|
140
|
-
return result;
|
|
141
|
-
}
|
|
142
|
-
const headers = new Headers();
|
|
143
|
-
if (result.headers) {
|
|
144
|
-
for (const [name, value] of Object.entries(result.headers)) {
|
|
145
|
-
if (Array.isArray(value)) {
|
|
146
|
-
for (const item of value) {
|
|
147
|
-
headers.append(name, item);
|
|
148
|
-
}
|
|
149
|
-
} else if (value !== void 0) {
|
|
150
|
-
headers.set(name, String(value));
|
|
151
|
-
}
|
|
152
|
-
}
|
|
153
|
-
}
|
|
154
|
-
if (result.multiValueHeaders) {
|
|
155
|
-
for (const [name, values] of Object.entries(result.multiValueHeaders)) {
|
|
156
|
-
if (!values) {
|
|
157
|
-
continue;
|
|
158
|
-
}
|
|
159
|
-
for (const value of values) {
|
|
160
|
-
headers.append(name, String(value));
|
|
161
|
-
}
|
|
162
|
-
}
|
|
163
|
-
}
|
|
164
|
-
const status = result.statusCode ?? 200;
|
|
165
|
-
const isNoBodyStatus = status === 204 || status === 205 || status === 304;
|
|
166
|
-
const body = isNoBodyStatus ? null : result.body ?? "";
|
|
167
|
-
if (result.isBase64Encoded && !isNoBodyStatus) {
|
|
168
|
-
return new Response(Buffer.from(body || "", "base64"), {
|
|
169
|
-
status,
|
|
170
|
-
headers
|
|
171
|
-
});
|
|
172
|
-
}
|
|
173
|
-
return new Response(body, {
|
|
174
|
-
status,
|
|
175
|
-
headers
|
|
176
|
-
});
|
|
177
|
-
}
|
|
178
|
-
function toMultiValueQueryStringParameters(url) {
|
|
179
|
-
const values = /* @__PURE__ */ new Map();
|
|
180
|
-
for (const [name, value] of url.searchParams.entries()) {
|
|
181
|
-
const existing = values.get(name) ?? [];
|
|
182
|
-
existing.push(value);
|
|
183
|
-
values.set(name, existing);
|
|
184
|
-
}
|
|
185
|
-
if (values.size === 0) {
|
|
186
|
-
return null;
|
|
187
|
-
}
|
|
188
|
-
return Object.fromEntries(values.entries());
|
|
189
|
-
}
|
|
190
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
191
|
-
0 && (module.exports = {
|
|
192
|
-
buildCedarContext,
|
|
193
|
-
composeCedarMiddleware,
|
|
194
|
-
createRouteManifest,
|
|
195
|
-
legacyResultToResponse,
|
|
196
|
-
noopAuthDecoder,
|
|
197
|
-
requestToLegacyEvent,
|
|
198
|
-
routeManifestToJSON,
|
|
199
|
-
wrapLegacyHandler
|
|
200
|
-
});
|
package/dist/cjs/transforms.d.ts
DELETED
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
import type { APIGatewayProxyEvent } from 'aws-lambda';
|
|
2
|
-
export interface PartialRequest<TBody = Record<string, any>> {
|
|
3
|
-
jsonBody: TBody;
|
|
4
|
-
headers: Headers;
|
|
5
|
-
method: string;
|
|
6
|
-
query: any;
|
|
7
|
-
}
|
|
8
|
-
/**
|
|
9
|
-
* Extracts and parses body payload from event with base64 encoding check
|
|
10
|
-
*/
|
|
11
|
-
export declare const parseLambdaEventBody: (event: APIGatewayProxyEvent) => any;
|
|
12
|
-
/**
|
|
13
|
-
* Extracts and parses body payload from Fetch Request
|
|
14
|
-
* with check for empty body
|
|
15
|
-
*
|
|
16
|
-
* NOTE: whatwg/server expects that you will decode the base64 body yourself
|
|
17
|
-
* see readme here: https://github.com/ardatan/whatwg-node/tree/master/packages/server#aws-lambda
|
|
18
|
-
*/
|
|
19
|
-
export declare const parseFetchEventBody: (event: Request) => Promise<any>;
|
|
20
|
-
export declare const requestToBaseEvent: (request: Request) => Promise<APIGatewayProxyEvent>;
|
|
21
|
-
export declare const isFetchApiRequest: (event: Request | APIGatewayProxyEvent) => event is Request;
|
|
22
|
-
/**
|
|
23
|
-
*
|
|
24
|
-
* This function returns a an object that lets you access _some_ of the request properties in a consistent way
|
|
25
|
-
* You can give it either a LambdaEvent or a Fetch API Request
|
|
26
|
-
*
|
|
27
|
-
* NOTE: It does NOT return a full Request object!
|
|
28
|
-
*/
|
|
29
|
-
export declare function normalizeRequest(event: APIGatewayProxyEvent | Request): Promise<PartialRequest>;
|
|
30
|
-
/**
|
|
31
|
-
* Useful for removing nulls from an object, such as an input from a GraphQL mutation used directly in a Prisma query
|
|
32
|
-
* @param input - Object to remove nulls from
|
|
33
|
-
* See {@link https://www.prisma.io/docs/concepts/components/prisma-client/null-and-undefined Prisma docs: null vs undefined}
|
|
34
|
-
*/
|
|
35
|
-
export declare const removeNulls: (input: Record<number | symbol | string, any>) => Record<string | number | symbol, any>;
|
|
36
|
-
//# sourceMappingURL=transforms.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"transforms.d.ts","sourceRoot":"","sources":["../../src/transforms.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,YAAY,CAAA;AAKtD,MAAM,WAAW,cAAc,CAAC,KAAK,GAAG,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC;IACzD,QAAQ,EAAE,KAAK,CAAA;IACf,OAAO,EAAE,OAAO,CAAA;IAChB,MAAM,EAAE,MAAM,CAAA;IACd,KAAK,EAAE,GAAG,CAAA;CACX;AAED;;GAEG;AACH,eAAO,MAAM,oBAAoB,GAAI,OAAO,oBAAoB,QAU/D,CAAA;AAED;;;;;;GAMG;AACH,eAAO,MAAM,mBAAmB,GAAU,OAAO,OAAO,iBAQvD,CAAA;AAED,eAAO,MAAM,kBAAkB,GAC7B,SAAS,OAAO,KACf,OAAO,CAAC,oBAAoB,CAsD9B,CAAA;AAoCD,eAAO,MAAM,iBAAiB,GAC5B,OAAO,OAAO,GAAG,oBAAoB,KACpC,KAAK,IAAI,OAcX,CAAA;AAaD;;;;;;GAMG;AACH,wBAAsB,gBAAgB,CACpC,KAAK,EAAE,oBAAoB,GAAG,OAAO,GACpC,OAAO,CAAC,cAAc,CAAC,CAkBzB;AAID;;;;GAIG;AACH,eAAO,MAAM,WAAW,GAAI,OAAO,MAAM,CAAC,MAAM,GAAG,MAAM,GAAG,MAAM,EAAE,GAAG,CAAC,0CAcvE,CAAA"}
|
package/dist/cjs/transforms.js
DELETED
|
@@ -1,176 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
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 transforms_exports = {};
|
|
20
|
-
__export(transforms_exports, {
|
|
21
|
-
isFetchApiRequest: () => isFetchApiRequest,
|
|
22
|
-
normalizeRequest: () => normalizeRequest,
|
|
23
|
-
parseFetchEventBody: () => parseFetchEventBody,
|
|
24
|
-
parseLambdaEventBody: () => parseLambdaEventBody,
|
|
25
|
-
removeNulls: () => removeNulls,
|
|
26
|
-
requestToBaseEvent: () => requestToBaseEvent
|
|
27
|
-
});
|
|
28
|
-
module.exports = __toCommonJS(transforms_exports);
|
|
29
|
-
var import_fetch = require("@whatwg-node/fetch");
|
|
30
|
-
const parseLambdaEventBody = (event) => {
|
|
31
|
-
if (!event.body) {
|
|
32
|
-
return {};
|
|
33
|
-
}
|
|
34
|
-
if (event.isBase64Encoded) {
|
|
35
|
-
return JSON.parse(Buffer.from(event.body, "base64").toString("utf-8"));
|
|
36
|
-
} else {
|
|
37
|
-
return JSON.parse(event.body);
|
|
38
|
-
}
|
|
39
|
-
};
|
|
40
|
-
const parseFetchEventBody = async (event) => {
|
|
41
|
-
if (!event.body) {
|
|
42
|
-
return {};
|
|
43
|
-
}
|
|
44
|
-
const body = await event.text();
|
|
45
|
-
return body ? JSON.parse(body) : {};
|
|
46
|
-
};
|
|
47
|
-
const requestToBaseEvent = async (request) => {
|
|
48
|
-
const url = new URL(request.url);
|
|
49
|
-
const bodyText = await request.clone().text();
|
|
50
|
-
const queryStringParameters = {};
|
|
51
|
-
url.searchParams.forEach((value, key) => {
|
|
52
|
-
queryStringParameters[key] = value;
|
|
53
|
-
});
|
|
54
|
-
const event = {
|
|
55
|
-
headers: Object.fromEntries(request.headers.entries()),
|
|
56
|
-
body: bodyText || null,
|
|
57
|
-
httpMethod: request.method,
|
|
58
|
-
path: url.pathname,
|
|
59
|
-
queryStringParameters,
|
|
60
|
-
isBase64Encoded: false,
|
|
61
|
-
multiValueHeaders: toMultiValueHeaders(request.headers),
|
|
62
|
-
multiValueQueryStringParameters: toMultiValueQueryStringParameters(url),
|
|
63
|
-
pathParameters: null,
|
|
64
|
-
stageVariables: null,
|
|
65
|
-
resource: url.pathname,
|
|
66
|
-
requestContext: {
|
|
67
|
-
accountId: "cedar",
|
|
68
|
-
apiId: "cedar",
|
|
69
|
-
authorizer: void 0,
|
|
70
|
-
protocol: "HTTP/1.1",
|
|
71
|
-
identity: {
|
|
72
|
-
accessKey: null,
|
|
73
|
-
accountId: null,
|
|
74
|
-
apiKey: null,
|
|
75
|
-
apiKeyId: null,
|
|
76
|
-
caller: null,
|
|
77
|
-
clientCert: null,
|
|
78
|
-
cognitoAuthenticationProvider: null,
|
|
79
|
-
cognitoAuthenticationType: null,
|
|
80
|
-
cognitoIdentityId: null,
|
|
81
|
-
cognitoIdentityPoolId: null,
|
|
82
|
-
principalOrgId: null,
|
|
83
|
-
sourceIp: "",
|
|
84
|
-
user: null,
|
|
85
|
-
userAgent: request.headers.get("user-agent"),
|
|
86
|
-
userArn: null
|
|
87
|
-
},
|
|
88
|
-
path: url.pathname,
|
|
89
|
-
stage: "",
|
|
90
|
-
requestId: "cedar-request",
|
|
91
|
-
requestTimeEpoch: Date.now(),
|
|
92
|
-
resourceId: "cedar",
|
|
93
|
-
resourcePath: url.pathname,
|
|
94
|
-
httpMethod: request.method
|
|
95
|
-
}
|
|
96
|
-
};
|
|
97
|
-
return event;
|
|
98
|
-
};
|
|
99
|
-
function toMultiValueHeaders(headers) {
|
|
100
|
-
const values = /* @__PURE__ */ new Map();
|
|
101
|
-
for (const [name, value] of headers.entries()) {
|
|
102
|
-
const existing = values.get(name) ?? [];
|
|
103
|
-
existing.push(value);
|
|
104
|
-
values.set(name, existing);
|
|
105
|
-
}
|
|
106
|
-
if (values.size === 0) {
|
|
107
|
-
return {};
|
|
108
|
-
}
|
|
109
|
-
return Object.fromEntries(values.entries());
|
|
110
|
-
}
|
|
111
|
-
function toMultiValueQueryStringParameters(url) {
|
|
112
|
-
const values = /* @__PURE__ */ new Map();
|
|
113
|
-
for (const [name, value] of url.searchParams.entries()) {
|
|
114
|
-
const existing = values.get(name) ?? [];
|
|
115
|
-
existing.push(value);
|
|
116
|
-
values.set(name, existing);
|
|
117
|
-
}
|
|
118
|
-
if (values.size === 0) {
|
|
119
|
-
return null;
|
|
120
|
-
}
|
|
121
|
-
return Object.fromEntries(values.entries());
|
|
122
|
-
}
|
|
123
|
-
const isFetchApiRequest = (event) => {
|
|
124
|
-
if (event.constructor.name === "Request" || event.constructor.name === import_fetch.Request.name) {
|
|
125
|
-
return true;
|
|
126
|
-
}
|
|
127
|
-
if (Symbol.iterator in Object(event.headers)) {
|
|
128
|
-
return true;
|
|
129
|
-
}
|
|
130
|
-
return false;
|
|
131
|
-
};
|
|
132
|
-
function getQueryStringParams(reqUrl) {
|
|
133
|
-
const url = new URL(reqUrl);
|
|
134
|
-
const params = new URLSearchParams(url.search);
|
|
135
|
-
const paramObject = {};
|
|
136
|
-
for (const entry of params.entries()) {
|
|
137
|
-
paramObject[entry[0]] = entry[1];
|
|
138
|
-
}
|
|
139
|
-
return paramObject;
|
|
140
|
-
}
|
|
141
|
-
async function normalizeRequest(event) {
|
|
142
|
-
if (isFetchApiRequest(event)) {
|
|
143
|
-
return {
|
|
144
|
-
headers: event.headers,
|
|
145
|
-
method: event.method,
|
|
146
|
-
query: getQueryStringParams(event.url),
|
|
147
|
-
jsonBody: await parseFetchEventBody(event)
|
|
148
|
-
};
|
|
149
|
-
}
|
|
150
|
-
const jsonBody = parseLambdaEventBody(event);
|
|
151
|
-
return {
|
|
152
|
-
headers: new import_fetch.Headers(event.headers),
|
|
153
|
-
method: event.httpMethod,
|
|
154
|
-
query: event.queryStringParameters,
|
|
155
|
-
jsonBody
|
|
156
|
-
};
|
|
157
|
-
}
|
|
158
|
-
const removeNulls = (input) => {
|
|
159
|
-
for (const key in input) {
|
|
160
|
-
if (input[key] === null) {
|
|
161
|
-
input[key] = void 0;
|
|
162
|
-
} else if (typeof input[key] === "object" && !(input[key] instanceof Date)) {
|
|
163
|
-
input[key] = removeNulls(input[key]);
|
|
164
|
-
}
|
|
165
|
-
}
|
|
166
|
-
return input;
|
|
167
|
-
};
|
|
168
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
169
|
-
0 && (module.exports = {
|
|
170
|
-
isFetchApiRequest,
|
|
171
|
-
normalizeRequest,
|
|
172
|
-
parseFetchEventBody,
|
|
173
|
-
parseLambdaEventBody,
|
|
174
|
-
removeNulls,
|
|
175
|
-
requestToBaseEvent
|
|
176
|
-
});
|
package/dist/cjs/types.d.ts
DELETED
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Houses utility types commonly used on the api side
|
|
3
|
-
*/
|
|
4
|
-
import type { O, A } from 'ts-toolbelt';
|
|
5
|
-
/**
|
|
6
|
-
* ---- Prisma SDL Type Merge ----
|
|
7
|
-
* SDL is source of truth for KEYS
|
|
8
|
-
* Prisma types is source of truth for VALUES (unless SDL-only field)
|
|
9
|
-
*/
|
|
10
|
-
type AnyObject = Record<string | symbol | number, unknown>;
|
|
11
|
-
type SdlOnlyFields<TPrisma, TSdl> = Omit<TSdl, keyof TPrisma>;
|
|
12
|
-
type PrismaTypeWithOptionalKeysFromSdl<TPrisma extends AnyObject, TSdl extends AnyObject> = Pick<TPrisma, O.OptionalKeys<TSdl>>;
|
|
13
|
-
type PrismaTypeWithOptionalKeysAndNullableValues<TPrisma extends AnyObject, TSdl extends AnyObject> = {
|
|
14
|
-
[k in keyof PrismaTypeWithOptionalKeysFromSdl<TPrisma, TSdl>]?: PrismaTypeWithOptionalKeysFromSdl<TPrisma, TSdl>[k] | null;
|
|
15
|
-
};
|
|
16
|
-
type PrismaTypeWithRequiredKeysFromSdl<TPrisma extends AnyObject, TSdl extends AnyObject> = Pick<TPrisma, O.RequiredKeys<TSdl>>;
|
|
17
|
-
type OptionalsAndSdlOnly<TPrisma extends AnyObject, TSdl extends AnyObject> = PrismaTypeWithOptionalKeysAndNullableValues<TPrisma, TSdl> & SdlOnlyFields<TPrisma, TSdl>;
|
|
18
|
-
export type MakeRelationsOptional<T, TAllMappedModels> = {
|
|
19
|
-
[key in keyof T as T[key] extends TAllMappedModels ? key : never]?: MakeRelationsOptional<T[key], TAllMappedModels>;
|
|
20
|
-
} & {
|
|
21
|
-
[key in keyof T as T[key] extends TAllMappedModels ? never : key]: T[key];
|
|
22
|
-
};
|
|
23
|
-
export type MergePrismaWithSdlTypes<TPrisma extends AnyObject, TSdl extends AnyObject, TAllMappedModels> = A.Compute<OptionalsAndSdlOnly<TPrisma, MakeRelationsOptional<TSdl, TAllMappedModels>> & PrismaTypeWithRequiredKeysFromSdl<TPrisma, MakeRelationsOptional<TSdl, TAllMappedModels>>>;
|
|
24
|
-
export {};
|
|
25
|
-
//# sourceMappingURL=types.d.ts.map
|
package/dist/cjs/types.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/types.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,EAAE,CAAC,EAAE,CAAC,EAAE,MAAM,aAAa,CAAA;AAEvC;;;;GAIG;AAEH,KAAK,SAAS,GAAG,MAAM,CAAC,MAAM,GAAG,MAAM,GAAG,MAAM,EAAE,OAAO,CAAC,CAAA;AAE1D,KAAK,aAAa,CAAC,OAAO,EAAE,IAAI,IAAI,IAAI,CAAC,IAAI,EAAE,MAAM,OAAO,CAAC,CAAA;AAG7D,KAAK,iCAAiC,CACpC,OAAO,SAAS,SAAS,EACzB,IAAI,SAAS,SAAS,IACpB,IAAI,CAAC,OAAO,EAAE,CAAC,CAAC,YAAY,CAAC,IAAI,CAAC,CAAC,CAAA;AAGvC,KAAK,2CAA2C,CAC9C,OAAO,SAAS,SAAS,EACzB,IAAI,SAAS,SAAS,IACpB;KACD,CAAC,IAAI,MAAM,i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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,101 +0,0 @@
|
|
|
1
|
-
import { RedwoodError } from '../errors.js';
|
|
2
|
-
export declare class ServiceValidationError extends RedwoodError {
|
|
3
|
-
constructor(message: string, substitutions?: {});
|
|
4
|
-
}
|
|
5
|
-
export declare class AbsenceValidationError extends ServiceValidationError {
|
|
6
|
-
constructor(name: string, message?: string, substitutions?: {});
|
|
7
|
-
}
|
|
8
|
-
export declare class AcceptanceValidationError extends ServiceValidationError {
|
|
9
|
-
constructor(name: string, message?: string, substitutions?: {});
|
|
10
|
-
}
|
|
11
|
-
export declare class EmailValidationError extends ServiceValidationError {
|
|
12
|
-
constructor(name: string, message?: string, substitutions?: {});
|
|
13
|
-
}
|
|
14
|
-
export declare class ExclusionValidationError extends ServiceValidationError {
|
|
15
|
-
constructor(name: string, message?: string, substitutions?: {});
|
|
16
|
-
}
|
|
17
|
-
export declare class FormatValidationError extends ServiceValidationError {
|
|
18
|
-
constructor(name: string, message?: string, substitutions?: {});
|
|
19
|
-
}
|
|
20
|
-
export declare class InclusionValidationError extends ServiceValidationError {
|
|
21
|
-
constructor(name: string, message?: string, substitutions?: {});
|
|
22
|
-
}
|
|
23
|
-
export declare class MinLengthValidationError extends ServiceValidationError {
|
|
24
|
-
constructor(name: string, message?: string, substitutions?: {
|
|
25
|
-
min?: number;
|
|
26
|
-
});
|
|
27
|
-
}
|
|
28
|
-
export declare class MaxLengthValidationError extends ServiceValidationError {
|
|
29
|
-
constructor(name: string, message?: string, substitutions?: {
|
|
30
|
-
max?: number;
|
|
31
|
-
});
|
|
32
|
-
}
|
|
33
|
-
export declare class EqualLengthValidationError extends ServiceValidationError {
|
|
34
|
-
constructor(name: string, message?: string, substitutions?: {
|
|
35
|
-
equal?: number;
|
|
36
|
-
});
|
|
37
|
-
}
|
|
38
|
-
export declare class BetweenLengthValidationError extends ServiceValidationError {
|
|
39
|
-
constructor(name: string, message?: string, substitutions?: {
|
|
40
|
-
min?: number;
|
|
41
|
-
max?: number;
|
|
42
|
-
});
|
|
43
|
-
}
|
|
44
|
-
export declare class PresenceValidationError extends ServiceValidationError {
|
|
45
|
-
constructor(name: string, message?: string, substitutions?: {});
|
|
46
|
-
}
|
|
47
|
-
export declare class TypeNumericalityValidationError extends ServiceValidationError {
|
|
48
|
-
constructor(name: string, message?: string, substitutions?: {});
|
|
49
|
-
}
|
|
50
|
-
export declare class IntegerNumericalityValidationError extends ServiceValidationError {
|
|
51
|
-
constructor(name: string, message?: string, substitutions?: {});
|
|
52
|
-
}
|
|
53
|
-
export declare class LessThanNumericalityValidationError extends ServiceValidationError {
|
|
54
|
-
constructor(name: string, message?: string, substitutions?: {
|
|
55
|
-
lessThan?: number;
|
|
56
|
-
});
|
|
57
|
-
}
|
|
58
|
-
export declare class LessThanOrEqualNumericalityValidationError extends ServiceValidationError {
|
|
59
|
-
constructor(name: string, message?: string, substitutions?: {
|
|
60
|
-
lessThanOrEqual?: number;
|
|
61
|
-
});
|
|
62
|
-
}
|
|
63
|
-
export declare class GreaterThanNumericalityValidationError extends ServiceValidationError {
|
|
64
|
-
constructor(name: string, message?: string, substitutions?: {
|
|
65
|
-
greaterThan?: number;
|
|
66
|
-
});
|
|
67
|
-
}
|
|
68
|
-
export declare class GreaterThanOrEqualNumericalityValidationError extends ServiceValidationError {
|
|
69
|
-
constructor(name: string, message?: string, substitutions?: {
|
|
70
|
-
greaterThanOrEqual?: number;
|
|
71
|
-
});
|
|
72
|
-
}
|
|
73
|
-
export declare class EqualNumericalityValidationError extends ServiceValidationError {
|
|
74
|
-
constructor(name: string, message?: string, substitutions?: {
|
|
75
|
-
equal?: number;
|
|
76
|
-
});
|
|
77
|
-
}
|
|
78
|
-
export declare class OtherThanNumericalityValidationError extends ServiceValidationError {
|
|
79
|
-
constructor(name: string, message?: string, substitutions?: {
|
|
80
|
-
otherThan?: number;
|
|
81
|
-
});
|
|
82
|
-
}
|
|
83
|
-
export declare class EvenNumericalityValidationError extends ServiceValidationError {
|
|
84
|
-
constructor(name: string, message?: string, substitutions?: {});
|
|
85
|
-
}
|
|
86
|
-
export declare class OddNumericalityValidationError extends ServiceValidationError {
|
|
87
|
-
constructor(name: string, message?: string, substitutions?: {});
|
|
88
|
-
}
|
|
89
|
-
export declare class PositiveNumericalityValidationError extends ServiceValidationError {
|
|
90
|
-
constructor(name: string, message?: string, substitutions?: {});
|
|
91
|
-
}
|
|
92
|
-
export declare class NegativeNumericalityValidationError extends ServiceValidationError {
|
|
93
|
-
constructor(name: string, message?: string, substitutions?: {});
|
|
94
|
-
}
|
|
95
|
-
export declare class CustomValidationError extends ServiceValidationError {
|
|
96
|
-
constructor(name: string, message?: string, substitutions?: {});
|
|
97
|
-
}
|
|
98
|
-
export declare class UniquenessValidationError extends ServiceValidationError {
|
|
99
|
-
constructor(name: string, message: string | undefined, substitutions?: {});
|
|
100
|
-
}
|
|
101
|
-
//# sourceMappingURL=errors.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../../../src/validations/errors.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAA;AAE3C,qBAAa,s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