@redmix/api 0.0.1
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/LICENSE +21 -0
- package/README.md +51 -0
- package/dist/auth/index.d.ts +51 -0
- package/dist/auth/index.d.ts.map +1 -0
- package/dist/auth/index.js +129 -0
- package/dist/auth/parseJWT.d.ts +6 -0
- package/dist/auth/parseJWT.d.ts.map +1 -0
- package/dist/auth/parseJWT.js +57 -0
- package/dist/auth/verifiers/base64Sha1Verifier.d.ts +19 -0
- package/dist/auth/verifiers/base64Sha1Verifier.d.ts.map +1 -0
- package/dist/auth/verifiers/base64Sha1Verifier.js +77 -0
- package/dist/auth/verifiers/base64Sha256Verifier.d.ts +19 -0
- package/dist/auth/verifiers/base64Sha256Verifier.d.ts.map +1 -0
- package/dist/auth/verifiers/base64Sha256Verifier.js +77 -0
- package/dist/auth/verifiers/common.d.ts +104 -0
- package/dist/auth/verifiers/common.d.ts.map +1 -0
- package/dist/auth/verifiers/common.js +99 -0
- package/dist/auth/verifiers/index.d.ts +8 -0
- package/dist/auth/verifiers/index.d.ts.map +1 -0
- package/dist/auth/verifiers/index.js +38 -0
- package/dist/auth/verifiers/jwtVerifier.d.ts +26 -0
- package/dist/auth/verifiers/jwtVerifier.d.ts.map +1 -0
- package/dist/auth/verifiers/jwtVerifier.js +86 -0
- package/dist/auth/verifiers/secretKeyVerifier.d.ts +14 -0
- package/dist/auth/verifiers/secretKeyVerifier.d.ts.map +1 -0
- package/dist/auth/verifiers/secretKeyVerifier.js +40 -0
- package/dist/auth/verifiers/sha1Verifier.d.ts +25 -0
- package/dist/auth/verifiers/sha1Verifier.d.ts.map +1 -0
- package/dist/auth/verifiers/sha1Verifier.js +85 -0
- package/dist/auth/verifiers/sha256Verifier.d.ts +25 -0
- package/dist/auth/verifiers/sha256Verifier.d.ts.map +1 -0
- package/dist/auth/verifiers/sha256Verifier.js +85 -0
- package/dist/auth/verifiers/skipVerifier.d.ts +13 -0
- package/dist/auth/verifiers/skipVerifier.d.ts.map +1 -0
- package/dist/auth/verifiers/skipVerifier.js +37 -0
- package/dist/auth/verifiers/timestampSchemeVerifier.d.ts +16 -0
- package/dist/auth/verifiers/timestampSchemeVerifier.d.ts.map +1 -0
- package/dist/auth/verifiers/timestampSchemeVerifier.js +81 -0
- package/dist/bins/redwood.d.ts +3 -0
- package/dist/bins/redwood.d.ts.map +1 -0
- package/dist/bins/redwood.js +33 -0
- package/dist/bins/rwfw.d.ts +3 -0
- package/dist/bins/rwfw.d.ts.map +1 -0
- package/dist/bins/rwfw.js +33 -0
- package/dist/bins/tsc.d.ts +3 -0
- package/dist/bins/tsc.d.ts.map +1 -0
- package/dist/bins/tsc.js +30 -0
- package/dist/cache/clients/BaseClient.d.ts +11 -0
- package/dist/cache/clients/BaseClient.d.ts.map +1 -0
- package/dist/cache/clients/BaseClient.js +27 -0
- package/dist/cache/clients/InMemoryClient.d.ts +31 -0
- package/dist/cache/clients/InMemoryClient.d.ts.map +1 -0
- package/dist/cache/clients/InMemoryClient.js +100 -0
- package/dist/cache/clients/MemcachedClient.d.ts +16 -0
- package/dist/cache/clients/MemcachedClient.d.ts.map +1 -0
- package/dist/cache/clients/MemcachedClient.js +75 -0
- package/dist/cache/clients/RedisClient.d.ts +20 -0
- package/dist/cache/clients/RedisClient.d.ts.map +1 -0
- package/dist/cache/clients/RedisClient.js +79 -0
- package/dist/cache/errors.d.ts +4 -0
- package/dist/cache/errors.d.ts.map +1 -0
- package/dist/cache/errors.js +33 -0
- package/dist/cache/index.d.ts +35 -0
- package/dist/cache/index.d.ts.map +1 -0
- package/dist/cache/index.js +171 -0
- package/dist/cors.d.ts +16 -0
- package/dist/cors.d.ts.map +1 -0
- package/dist/cors.js +93 -0
- package/dist/errors.d.ts +5 -0
- package/dist/errors.d.ts.map +1 -0
- package/dist/errors.js +38 -0
- package/dist/event.d.ts +3 -0
- package/dist/event.d.ts.map +1 -0
- package/dist/event.js +34 -0
- package/dist/functions/fixtures/apiGatewayProxyEvent.fixture.d.ts +4 -0
- package/dist/functions/fixtures/apiGatewayProxyEvent.fixture.d.ts.map +1 -0
- package/dist/functions/fixtures/apiGatewayProxyEvent.fixture.js +72 -0
- package/dist/index.d.ts +11 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +49 -0
- package/dist/logger/index.d.ts +179 -0
- package/dist/logger/index.d.ts.map +1 -0
- package/dist/logger/index.js +195 -0
- package/dist/transforms.d.ts +35 -0
- package/dist/transforms.d.ts.map +1 -0
- package/dist/transforms.js +98 -0
- package/dist/types.d.ts +25 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +16 -0
- package/dist/validations/errors.d.ts +101 -0
- package/dist/validations/errors.d.ts.map +1 -0
- package/dist/validations/errors.js +298 -0
- package/dist/validations/validations.d.ts +222 -0
- package/dist/validations/validations.d.ts.map +1 -0
- package/dist/validations/validations.js +351 -0
- package/dist/webhooks/index.d.ts +76 -0
- package/dist/webhooks/index.d.ts.map +1 -0
- package/dist/webhooks/index.js +107 -0
- package/package.json +95 -0
@@ -0,0 +1,179 @@
|
|
1
|
+
import type P from 'pino';
|
2
|
+
/**
|
3
|
+
* Types from Pino
|
4
|
+
* @see https://github.com/pinojs/pino/blob/master/pino.d.ts
|
5
|
+
*/
|
6
|
+
export type Logger = P.Logger;
|
7
|
+
export type BaseLogger = P.BaseLogger;
|
8
|
+
export type DestinationStream = P.DestinationStream;
|
9
|
+
export type LevelWithSilent = P.LevelWithSilent;
|
10
|
+
export type LoggerOptions = P.LoggerOptions;
|
11
|
+
export type LogLevel = 'info' | 'query' | 'warn' | 'error';
|
12
|
+
type PrismaClient = any;
|
13
|
+
type LogDefinition = {
|
14
|
+
level: LogLevel;
|
15
|
+
emit: 'stdout' | 'event';
|
16
|
+
};
|
17
|
+
/**
|
18
|
+
* Determines if log environment is development
|
19
|
+
*
|
20
|
+
* @type {boolean}
|
21
|
+
*
|
22
|
+
*/
|
23
|
+
export declare const isDevelopment: boolean;
|
24
|
+
/**
|
25
|
+
* Determines if log environment is test
|
26
|
+
*
|
27
|
+
* @type {boolean}
|
28
|
+
*
|
29
|
+
*/
|
30
|
+
export declare const isTest: boolean;
|
31
|
+
/**
|
32
|
+
* Determines if log environment is production by checking if not development
|
33
|
+
*
|
34
|
+
* @type {boolean}
|
35
|
+
*
|
36
|
+
*/
|
37
|
+
export declare const isProduction: boolean;
|
38
|
+
export declare const redactionsList: string[];
|
39
|
+
/**
|
40
|
+
* Determines if log level based on environment variables and
|
41
|
+
* development or deployment environment defaults
|
42
|
+
*
|
43
|
+
* Set `LOG_LEVEL` env to the desired logging level. In order of priority, available levels are:
|
44
|
+
*
|
45
|
+
* - 'fatal'
|
46
|
+
* - 'error'
|
47
|
+
* - 'warn'
|
48
|
+
* - 'info'
|
49
|
+
* - 'debug'
|
50
|
+
* - 'trace'
|
51
|
+
*
|
52
|
+
* The logging level is a __minimum__ level. For instance if `logger.level` is `'info'` then all `'fatal'`, `'error'`, `'warn'`,
|
53
|
+
* and `'info'` logs will be enabled.
|
54
|
+
*
|
55
|
+
* You can pass `'silent'` to disable logging.
|
56
|
+
*
|
57
|
+
* @default 'warn' in Production
|
58
|
+
* @default 'trace' in Development
|
59
|
+
* @default 'silent' in Test
|
60
|
+
*
|
61
|
+
*/
|
62
|
+
export declare const logLevel: LevelWithSilent | string;
|
63
|
+
/**
|
64
|
+
* Defines an opinionated base logger configuration that defines
|
65
|
+
* how to log and what to ignore.
|
66
|
+
*
|
67
|
+
* @default logger options are:
|
68
|
+
*
|
69
|
+
* - Ignore certain event attributes like hostname and pid for cleaner log statements
|
70
|
+
* - Prefix the log output with log level
|
71
|
+
* - Use a shorted log message that omits server name
|
72
|
+
* - Humanize time in GMT
|
73
|
+
* - Set the default log level in test to silent, development to trace
|
74
|
+
* and warn in prod
|
75
|
+
* Or set via LOG_LEVEL environment variable
|
76
|
+
* - Redact the host and other keys via a set redactionList
|
77
|
+
*
|
78
|
+
* Each path must be a string using a syntax which corresponds to JavaScript dot and bracket notation.
|
79
|
+
*
|
80
|
+
* If an object is supplied, three options can be specified:
|
81
|
+
*
|
82
|
+
* paths (String[]): Required. An array of paths
|
83
|
+
* censor (String): Optional. A value to overwrite key which are to be redacted. Default: '[Redacted]'
|
84
|
+
* remove (Boolean): Optional. Instead of censoring the value, remove both the key and the value. Default: false
|
85
|
+
*
|
86
|
+
* @see {@link https://github.com/pinojs/pino/blob/master/docs/api.md}
|
87
|
+
*/
|
88
|
+
export declare const defaultLoggerOptions: {
|
89
|
+
level: string;
|
90
|
+
redact: string[];
|
91
|
+
};
|
92
|
+
/**
|
93
|
+
* RedwoodLoggerOptions defines custom logger options that extend those available in LoggerOptions
|
94
|
+
* and can define a destination like a file or other supported pin log transport stream
|
95
|
+
*
|
96
|
+
* @typedef {Object} RedwoodLoggerOptions
|
97
|
+
* @extends LoggerOptions
|
98
|
+
* @property {options} LoggerOptions - options define how to log
|
99
|
+
* @property {string | DestinationStream} destination - destination defines where to log
|
100
|
+
* @property {boolean} showConfig - Display logger configuration on initialization
|
101
|
+
*/
|
102
|
+
export interface RedwoodLoggerOptions {
|
103
|
+
options?: LoggerOptions;
|
104
|
+
destination?: string | DestinationStream;
|
105
|
+
showConfig?: boolean;
|
106
|
+
}
|
107
|
+
/**
|
108
|
+
* Creates the logger
|
109
|
+
*
|
110
|
+
* @param options {RedwoodLoggerOptions} - Override the default logger configuration
|
111
|
+
* @param destination {DestinationStream} - An optional destination stream
|
112
|
+
* @param showConfig {Boolean} - Show the logger configuration. This is off by default.
|
113
|
+
*
|
114
|
+
* @example
|
115
|
+
* // Create the logger to log just at the error level
|
116
|
+
* createLogger({ options: { level: 'error' } })
|
117
|
+
*
|
118
|
+
* @example
|
119
|
+
* // Create the logger to log to a file
|
120
|
+
* createLogger({ destination: { 'var/logs/redwood-api.log' } })
|
121
|
+
*
|
122
|
+
* @return {Logger} - The configured logger
|
123
|
+
*/
|
124
|
+
export declare const createLogger: ({ options, destination, showConfig, }: RedwoodLoggerOptions) => Logger;
|
125
|
+
/**
|
126
|
+
* Determines the type and level of logging.
|
127
|
+
*
|
128
|
+
* @see {@link https://www.prisma.io/docs/reference/api-reference/prisma-client-reference#log}
|
129
|
+
*/
|
130
|
+
export declare const defaultLogLevels: LogLevel[];
|
131
|
+
/**
|
132
|
+
* Generates the Prisma Log Definitions for the Prisma Client to emit
|
133
|
+
*
|
134
|
+
* @return Prisma.LogDefinition[]
|
135
|
+
*/
|
136
|
+
export declare const emitLogLevels: (setLogLevels: LogLevel[]) => LogDefinition[];
|
137
|
+
/**
|
138
|
+
* Defines what is needed to setup Prisma Client logging used in handlePrismaLogging
|
139
|
+
*
|
140
|
+
*
|
141
|
+
* @param db {PrismaClient} - The Prisma Client instance
|
142
|
+
* @param logger {BaseLogger} - The Redwood logger instance
|
143
|
+
* @param logLevels {LogLevel[]} - The log levels . Should match those set with emitLogLevels
|
144
|
+
* @param slowQueryThreshold {number} - The threshold for slow queries. Default: 2 seconds
|
145
|
+
*
|
146
|
+
* @see emitLogLevels
|
147
|
+
*
|
148
|
+
*/
|
149
|
+
interface PrismaLoggingConfig {
|
150
|
+
db: PrismaClient;
|
151
|
+
logger: Logger;
|
152
|
+
logLevels: LogLevel[];
|
153
|
+
slowQueryThreshold?: number;
|
154
|
+
}
|
155
|
+
/**
|
156
|
+
* Sets up event-based logging on the Prisma client
|
157
|
+
*
|
158
|
+
* Sets emit to event for a specific log level, such as query
|
159
|
+
* using the $on() method to subscribe to the event
|
160
|
+
*
|
161
|
+
* @see {@link https://www.prisma.io/docs/concepts/components/prisma-client/working-with-prismaclient/logging}
|
162
|
+
*
|
163
|
+
* @param PrismaLoggingConfig
|
164
|
+
*
|
165
|
+
* @example
|
166
|
+
*
|
167
|
+
* handlePrismaLogging({
|
168
|
+
* db,
|
169
|
+
* logger,
|
170
|
+
* logLevels: ['info', 'warn', 'error'],
|
171
|
+
* slowQueryThreshold: 2000,
|
172
|
+
* })
|
173
|
+
*
|
174
|
+
* @return {void}
|
175
|
+
*
|
176
|
+
*/
|
177
|
+
export declare const handlePrismaLogging: (config: PrismaLoggingConfig) => void;
|
178
|
+
export {};
|
179
|
+
//# sourceMappingURL=index.d.ts.map
|
@@ -0,0 +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;AAEnE;;;;;GAKG;AACH,eAAO,MAAM,MAAM,SAAkC,CAAA;AAErD;;;;;GAKG;AACH,eAAO,MAAM,YAAY,SAA4B,CAAA;AAQrD,eAAO,MAAM,cAAc,EAAE,MAAM,EAgClC,CAAA;AAED;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,eAAO,MAAM,QAAQ,EAAE,eAAe,GAAG,MAUrC,CAAA;AAEJ;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,eAAO,MAAM,oBAAoB;;;CAGR,CAAA;AAEzB;;;;;;;;;GASG;AACH,MAAM,WAAW,oBAAoB;IACnC,OAAO,CAAC,EAAE,aAAa,CAAA;IACvB,WAAW,CAAC,EAAE,MAAM,GAAG,iBAAiB,CAAA;IACxC,UAAU,CAAC,EAAE,OAAO,CAAA;CACrB;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,eAAO,MAAM,YAAY,0CAItB,oBAAoB,KAAG,MAqCzB,CAAA;AAQD;;;;GAIG;AACH,eAAO,MAAM,gBAAgB,EAAE,QAAQ,EAA8B,CAAA;AAErE;;;;GAIG;AACH,eAAO,MAAM,aAAa,iBAAkB,QAAQ,EAAE,KAAG,aAAa,EAIrE,CAAA;AAED;;;;;;;;;;;GAWG;AACH,UAAU,mBAAmB;IAC3B,EAAE,EAAE,YAAY,CAAA;IAChB,MAAM,EAAE,MAAM,CAAA;IACd,SAAS,EAAE,QAAQ,EAAE,CAAA;IACrB,kBAAkB,CAAC,EAAE,MAAM,CAAA;CAC5B;AAED;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,eAAO,MAAM,mBAAmB,WAAY,mBAAmB,KAAG,IA8CjE,CAAA"}
|
@@ -0,0 +1,195 @@
|
|
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 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"));
|
44
|
+
const isDevelopment = process.env.NODE_ENV === "development";
|
45
|
+
const isTest = process.env.NODE_ENV === "test";
|
46
|
+
const isProduction = !isDevelopment && !isTest;
|
47
|
+
const redactionsList = [
|
48
|
+
"access_token",
|
49
|
+
"data.access_token",
|
50
|
+
"data.*.access_token",
|
51
|
+
"data.*.accessToken",
|
52
|
+
"accessToken",
|
53
|
+
"data.accessToken",
|
54
|
+
"DATABASE_URL",
|
55
|
+
"data.*.email",
|
56
|
+
"data.email",
|
57
|
+
"email",
|
58
|
+
"event.headers.authorization",
|
59
|
+
"data.hashedPassword",
|
60
|
+
"data.*.hashedPassword",
|
61
|
+
"hashedPassword",
|
62
|
+
"host",
|
63
|
+
"jwt",
|
64
|
+
"data.jwt",
|
65
|
+
"data.*.jwt",
|
66
|
+
"JWT",
|
67
|
+
"data.JWT",
|
68
|
+
"data.*.JWT",
|
69
|
+
"password",
|
70
|
+
"data.password",
|
71
|
+
"data.*.password",
|
72
|
+
"params",
|
73
|
+
"data.salt",
|
74
|
+
"data.*.salt",
|
75
|
+
"salt",
|
76
|
+
"secret",
|
77
|
+
"data.secret",
|
78
|
+
"data.*.secret"
|
79
|
+
];
|
80
|
+
const logLevel = (() => {
|
81
|
+
if (typeof process.env.LOG_LEVEL !== "undefined") {
|
82
|
+
return process.env.LOG_LEVEL;
|
83
|
+
} else if (isProduction) {
|
84
|
+
return "warn";
|
85
|
+
} else if (isTest) {
|
86
|
+
return "silent";
|
87
|
+
} else {
|
88
|
+
return "trace";
|
89
|
+
}
|
90
|
+
})();
|
91
|
+
const defaultLoggerOptions = {
|
92
|
+
level: logLevel,
|
93
|
+
redact: redactionsList
|
94
|
+
};
|
95
|
+
const createLogger = ({
|
96
|
+
options,
|
97
|
+
destination,
|
98
|
+
showConfig = false
|
99
|
+
}) => {
|
100
|
+
const hasDestination = typeof destination !== "undefined";
|
101
|
+
const isFile = hasDestination && typeof destination === "string";
|
102
|
+
const isStream = hasDestination && !isFile;
|
103
|
+
const stream = destination;
|
104
|
+
options = { ...defaultLoggerOptions, ...options };
|
105
|
+
if (showConfig) {
|
106
|
+
console.log("Logger Configuration");
|
107
|
+
console.log(`isProduction: ${isProduction}`);
|
108
|
+
console.log(`isDevelopment: ${isDevelopment}`);
|
109
|
+
console.log(`isTest: ${isTest}`);
|
110
|
+
console.log(`isFile: ${isFile}`);
|
111
|
+
console.log(`isStream: ${isStream}`);
|
112
|
+
console.log(`logLevel: ${logLevel}`);
|
113
|
+
console.log(`options: ${JSON.stringify(options, null, 2)}`);
|
114
|
+
console.log(`destination: ${destination}`);
|
115
|
+
}
|
116
|
+
if (isFile) {
|
117
|
+
if (isProduction) {
|
118
|
+
console.warn(
|
119
|
+
"Please make certain that file system access is available when logging to a file in a production environment."
|
120
|
+
);
|
121
|
+
}
|
122
|
+
return (0, import_pino.default)(options, stream);
|
123
|
+
} else {
|
124
|
+
if (isStream && isDevelopment && !isTest) {
|
125
|
+
console.warn(
|
126
|
+
"Logs will be sent to the transport stream in the current development environment."
|
127
|
+
);
|
128
|
+
}
|
129
|
+
return (0, import_pino.default)(options, stream);
|
130
|
+
}
|
131
|
+
};
|
132
|
+
const DEFAULT_SLOW_QUERY_THRESHOLD = 2e3;
|
133
|
+
const defaultLogLevels = ["info", "warn", "error"];
|
134
|
+
const emitLogLevels = (setLogLevels) => {
|
135
|
+
return setLogLevels?.map((level) => {
|
136
|
+
return { emit: "event", level };
|
137
|
+
});
|
138
|
+
};
|
139
|
+
const handlePrismaLogging = (config) => {
|
140
|
+
const logger = config.logger.child({
|
141
|
+
// @TODO Change this once this issue is resolved
|
142
|
+
// See https://github.com/prisma/prisma/issues/8290
|
143
|
+
prisma: { clientVersion: config.db["_clientVersion"] }
|
144
|
+
});
|
145
|
+
const slowQueryThreshold = config.slowQueryThreshold ?? DEFAULT_SLOW_QUERY_THRESHOLD;
|
146
|
+
config.logLevels?.forEach((level) => {
|
147
|
+
if (level === "query") {
|
148
|
+
config.db.$on(level, (event) => {
|
149
|
+
const queryEvent = event;
|
150
|
+
if (queryEvent.duration >= slowQueryThreshold) {
|
151
|
+
logger.warn(
|
152
|
+
{ ...queryEvent },
|
153
|
+
`Slow Query performed in ${queryEvent.duration} msec`
|
154
|
+
);
|
155
|
+
} else {
|
156
|
+
logger.debug(
|
157
|
+
{ ...queryEvent },
|
158
|
+
`Query performed in ${queryEvent.duration} msec`
|
159
|
+
);
|
160
|
+
}
|
161
|
+
});
|
162
|
+
} else {
|
163
|
+
config.db.$on(level, (event) => {
|
164
|
+
const logEvent = event;
|
165
|
+
switch (level) {
|
166
|
+
case "info":
|
167
|
+
logger.info({ ...logEvent }, logEvent.message);
|
168
|
+
break;
|
169
|
+
case "warn":
|
170
|
+
logger.warn({ ...logEvent }, logEvent.message);
|
171
|
+
break;
|
172
|
+
case "error":
|
173
|
+
logger.error({ ...logEvent }, logEvent.message);
|
174
|
+
break;
|
175
|
+
default:
|
176
|
+
logger.info({ ...logEvent }, logEvent.message);
|
177
|
+
}
|
178
|
+
});
|
179
|
+
}
|
180
|
+
});
|
181
|
+
return;
|
182
|
+
};
|
183
|
+
// Annotate the CommonJS export names for ESM import in node:
|
184
|
+
0 && (module.exports = {
|
185
|
+
createLogger,
|
186
|
+
defaultLogLevels,
|
187
|
+
defaultLoggerOptions,
|
188
|
+
emitLogLevels,
|
189
|
+
handlePrismaLogging,
|
190
|
+
isDevelopment,
|
191
|
+
isProduction,
|
192
|
+
isTest,
|
193
|
+
logLevel,
|
194
|
+
redactionsList
|
195
|
+
});
|
@@ -0,0 +1,35 @@
|
|
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 isFetchApiRequest: (event: Request | APIGatewayProxyEvent) => event is Request;
|
21
|
+
/**
|
22
|
+
*
|
23
|
+
* This function returns a an object that lets you access _some_ of the request properties in a consistent way
|
24
|
+
* You can give it either a LambdaEvent or a Fetch API Request
|
25
|
+
*
|
26
|
+
* NOTE: It does NOT return a full Request object!
|
27
|
+
*/
|
28
|
+
export declare function normalizeRequest(event: APIGatewayProxyEvent | Request): Promise<PartialRequest>;
|
29
|
+
/**
|
30
|
+
* Useful for removing nulls from an object, such as an input from a GraphQL mutation used directly in a Prisma query
|
31
|
+
* @param input - Object to remove nulls from
|
32
|
+
* See {@link https://www.prisma.io/docs/concepts/components/prisma-client/null-and-undefined Prisma docs: null vs undefined}
|
33
|
+
*/
|
34
|
+
export declare const removeNulls: (input: Record<number | symbol | string, any>) => Record<string | number | symbol, any>;
|
35
|
+
//# sourceMappingURL=transforms.d.ts.map
|
@@ -0,0 +1 @@
|
|
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,UAAW,oBAAoB,QAU/D,CAAA;AAED;;;;;;GAMG;AACH,eAAO,MAAM,mBAAmB,UAAiB,OAAO,iBAQvD,CAAA;AAED,eAAO,MAAM,iBAAiB,UACrB,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,UAAW,MAAM,CAAC,MAAM,GAAG,MAAM,GAAG,MAAM,EAAE,GAAG,CAAC,0CAcvE,CAAA"}
|
@@ -0,0 +1,98 @@
|
|
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
|
+
});
|
27
|
+
module.exports = __toCommonJS(transforms_exports);
|
28
|
+
var import_fetch = require("@whatwg-node/fetch");
|
29
|
+
const parseLambdaEventBody = (event) => {
|
30
|
+
if (!event.body) {
|
31
|
+
return {};
|
32
|
+
}
|
33
|
+
if (event.isBase64Encoded) {
|
34
|
+
return JSON.parse(Buffer.from(event.body, "base64").toString("utf-8"));
|
35
|
+
} else {
|
36
|
+
return JSON.parse(event.body);
|
37
|
+
}
|
38
|
+
};
|
39
|
+
const parseFetchEventBody = async (event) => {
|
40
|
+
if (!event.body) {
|
41
|
+
return {};
|
42
|
+
}
|
43
|
+
const body = await event.text();
|
44
|
+
return body ? JSON.parse(body) : {};
|
45
|
+
};
|
46
|
+
const isFetchApiRequest = (event) => {
|
47
|
+
if (event.constructor.name === "Request" || event.constructor.name === import_fetch.Request.name) {
|
48
|
+
return true;
|
49
|
+
}
|
50
|
+
if (Symbol.iterator in Object(event.headers)) {
|
51
|
+
return true;
|
52
|
+
}
|
53
|
+
return false;
|
54
|
+
};
|
55
|
+
function getQueryStringParams(reqUrl) {
|
56
|
+
const url = new URL(reqUrl);
|
57
|
+
const params = new URLSearchParams(url.search);
|
58
|
+
const paramObject = {};
|
59
|
+
for (const entry of params.entries()) {
|
60
|
+
paramObject[entry[0]] = entry[1];
|
61
|
+
}
|
62
|
+
return paramObject;
|
63
|
+
}
|
64
|
+
async function normalizeRequest(event) {
|
65
|
+
if (isFetchApiRequest(event)) {
|
66
|
+
return {
|
67
|
+
headers: event.headers,
|
68
|
+
method: event.method,
|
69
|
+
query: getQueryStringParams(event.url),
|
70
|
+
jsonBody: await parseFetchEventBody(event)
|
71
|
+
};
|
72
|
+
}
|
73
|
+
const jsonBody = parseLambdaEventBody(event);
|
74
|
+
return {
|
75
|
+
headers: new import_fetch.Headers(event.headers),
|
76
|
+
method: event.httpMethod,
|
77
|
+
query: event.queryStringParameters,
|
78
|
+
jsonBody
|
79
|
+
};
|
80
|
+
}
|
81
|
+
const removeNulls = (input) => {
|
82
|
+
for (const key in input) {
|
83
|
+
if (input[key] === null) {
|
84
|
+
input[key] = void 0;
|
85
|
+
} else if (typeof input[key] === "object" && !(input[key] instanceof Date)) {
|
86
|
+
input[key] = removeNulls(input[key]);
|
87
|
+
}
|
88
|
+
}
|
89
|
+
return input;
|
90
|
+
};
|
91
|
+
// Annotate the CommonJS export names for ESM import in node:
|
92
|
+
0 && (module.exports = {
|
93
|
+
isFetchApiRequest,
|
94
|
+
normalizeRequest,
|
95
|
+
parseFetchEventBody,
|
96
|
+
parseLambdaEventBody,
|
97
|
+
removeNulls
|
98
|
+
});
|
package/dist/types.d.ts
ADDED
@@ -0,0 +1,25 @@
|
|
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
|
+
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AC9C,GAAG,GACH,KAAK,CAAC,CAAC,EAAE,qBAAqB,CAAC,CAAC,CAAC,GAAG,CAAC,EAAE,gBAAgB,CAAC;CAC7D,GAAG;KAED,GAAG,IAAI,MAAM,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC,SAAS,gBAAgB,GAAG,KAAK,GAAG,GAAG,GAAG,CAAC,CAAC,GAAG,CAAC;CAC1E,CAAA;AAID,MAAM,MAAM,uBAAuB,CACjC,OAAO,SAAS,SAAS,EACzB,IAAI,SAAS,SAAS,EACtB,gBAAgB,IACd,CAAC,CAAC,OAAO,CACX,mBAAmB,CAAC,OAAO,EAAE,qBAAqB,CAAC,IAAI,EAAE,gBAAgB,CAAC,CAAC,GACzE,iCAAiC,CAC/B,OAAO,EACP,qBAAqB,CAAC,IAAI,EAAE,gBAAgB,CAAC,CAC9C,CACJ,CAAA"}
|
package/dist/types.js
ADDED
@@ -0,0 +1,16 @@
|
|
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 __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);
|
@@ -0,0 +1,101 @@
|
|
1
|
+
import { RedwoodError } from '../errors';
|
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
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../../src/validations/errors.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,YAAY,EAAE,MAAM,WAAW,CAAA;AAExC,qBAAa,sBAAuB,SAAQ,YAAY;gBAC1C,OAAO,EAAE,MAAM,EAAE,aAAa,KAAK;CA+BhD;AAED,qBAAa,sBAAuB,SAAQ,sBAAsB;gBAE9D,IAAI,EAAE,MAAM,EACZ,OAAO,SAA0B,EACjC,aAAa,KAAK;CAOrB;AAED,qBAAa,yBAA0B,SAAQ,sBAAsB;gBAEjE,IAAI,EAAE,MAAM,EACZ,OAAO,SAA6B,EACpC,aAAa,KAAK;CAOrB;AAED,qBAAa,oBAAqB,SAAQ,sBAAsB;gBAE5D,IAAI,EAAE,MAAM,EACZ,OAAO,SAAoD,EAC3D,aAAa,KAAK;CAOrB;AACD,qBAAa,wBAAyB,SAAQ,sBAAsB;gBAEhE,IAAI,EAAE,MAAM,EACZ,OAAO,SAAwB,EAC/B,aAAa,KAAK;CAOrB;AAED,qBAAa,qBAAsB,SAAQ,sBAAsB;gBAE7D,IAAI,EAAE,MAAM,EACZ,OAAO,SAAuC,EAC9C,aAAa,KAAK;CAOrB;AAED,qBAAa,wBAAyB,SAAQ,sBAAsB;gBAEhE,IAAI,EAAE,MAAM,EACZ,OAAO,SAAwB,EAC/B,aAAa,KAAK;CAOrB;AAED,qBAAa,wBAAyB,SAAQ,sBAAsB;gBAEhE,IAAI,EAAE,MAAM,EACZ,OAAO,SAAiD,EACxD,aAAa,GAAE;QAAE,GAAG,CAAC,EAAE,MAAM,CAAA;KAAO;CAOvC;AAED,qBAAa,wB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