@jaypie/testkit 1.1.36 → 1.2.0-rc.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/dist/index.d.ts +4 -105
- package/dist/index.js +3 -2
- package/dist/index.js.map +1 -1
- package/dist/matchers/toThrowJaypieError.matcher.d.ts +4 -3
- package/dist/matchers.module.d.ts +1 -96
- package/dist/mock/core.d.ts +165 -267
- package/dist/mock/datadog.d.ts +18 -2
- package/dist/mock/index.d.ts +196 -283
- package/dist/mock/index.js +92 -695
- package/dist/mock/index.js.map +1 -1
- package/dist/mock/matchers/toThrowJaypieError.matcher.d.ts +4 -3
- package/dist/mock/matchers.module.d.ts +1 -96
- package/dist/mock/mock/core.d.ts +165 -267
- package/dist/mock/mock/datadog.d.ts +18 -2
- package/dist/mock/mock/original.d.ts +9 -16
- package/dist/mock/mockLog.module.d.ts +1 -1
- package/dist/mock/original.d.ts +9 -16
- package/dist/mockLog.module.d.ts +1 -1
- package/package.json +21 -15
package/dist/mock/mock/core.d.ts
CHANGED
|
@@ -1,49 +1,29 @@
|
|
|
1
|
-
import { log } from "@jaypie/
|
|
2
|
-
import * as
|
|
3
|
-
|
|
4
|
-
export declare const
|
|
5
|
-
export declare const
|
|
6
|
-
export declare const
|
|
7
|
-
export declare const
|
|
8
|
-
export declare const
|
|
9
|
-
export declare const
|
|
10
|
-
export declare const
|
|
11
|
-
export declare const
|
|
12
|
-
export declare const
|
|
13
|
-
export declare const
|
|
14
|
-
export declare const
|
|
15
|
-
export declare const
|
|
16
|
-
export declare const
|
|
17
|
-
export declare const
|
|
18
|
-
export declare const
|
|
19
|
-
export declare const
|
|
20
|
-
export declare const
|
|
21
|
-
export declare const
|
|
22
|
-
export declare const
|
|
23
|
-
export declare const
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
array<T = unknown>(argument: unknown, options?: original.ValidationOptions): argument is T[];
|
|
28
|
-
boolean(argument: unknown, options?: original.ValidationOptions): argument is boolean;
|
|
29
|
-
class(argument: unknown, options?: original.ValidationOptions): boolean;
|
|
30
|
-
function(argument: unknown, options?: original.ValidationOptions): argument is (...args: unknown[]) => unknown;
|
|
31
|
-
null(argument: unknown, options?: original.ValidationOptions): argument is null;
|
|
32
|
-
number(argument: unknown, options?: original.ValidationOptions): argument is number;
|
|
33
|
-
object<T extends Record<string, unknown> = Record<string, unknown>>(argument: unknown, options?: original.ValidationOptions): argument is T;
|
|
34
|
-
string(argument: unknown, options?: original.ValidationOptions): argument is string;
|
|
35
|
-
undefined(argument: unknown, options?: original.ValidationOptions): argument is undefined;
|
|
36
|
-
optional: {
|
|
37
|
-
array<T = unknown>(argument: unknown, options?: original.ValidationOptions): argument is T[] | undefined;
|
|
38
|
-
boolean(argument: unknown, options?: original.ValidationOptions): argument is boolean | undefined;
|
|
39
|
-
class(argument: unknown, options?: original.ValidationOptions): boolean;
|
|
40
|
-
function(argument: unknown, options?: original.ValidationOptions): argument is ((...args: unknown[]) => unknown) | undefined;
|
|
41
|
-
null(argument: unknown, options?: original.ValidationOptions): argument is null | undefined;
|
|
42
|
-
number(argument: unknown, options?: original.ValidationOptions): argument is number | undefined;
|
|
43
|
-
object<T extends Record<string, unknown> = Record<string, unknown>>(argument: unknown, options?: original.ValidationOptions): argument is T | undefined;
|
|
44
|
-
string(argument: unknown, options?: original.ValidationOptions): argument is string | undefined;
|
|
45
|
-
};
|
|
46
|
-
};
|
|
1
|
+
import { log } from "@jaypie/logger";
|
|
2
|
+
import * as errors from "@jaypie/errors";
|
|
3
|
+
import * as kit from "@jaypie/kit";
|
|
4
|
+
export declare const JaypieError: typeof errors.JaypieError;
|
|
5
|
+
export declare const BadGatewayError: typeof errors.BadGatewayError;
|
|
6
|
+
export declare const BadRequestError: typeof errors.BadRequestError;
|
|
7
|
+
export declare const ConfigurationError: typeof errors.ConfigurationError;
|
|
8
|
+
export declare const CorsError: typeof errors.CorsError;
|
|
9
|
+
export declare const ForbiddenError: typeof errors.ForbiddenError;
|
|
10
|
+
export declare const GatewayTimeoutError: typeof errors.GatewayTimeoutError;
|
|
11
|
+
export declare const GoneError: typeof errors.GoneError;
|
|
12
|
+
export declare const IllogicalError: typeof errors.IllogicalError;
|
|
13
|
+
export declare const InternalError: typeof errors.InternalError;
|
|
14
|
+
export declare const MethodNotAllowedError: typeof errors.MethodNotAllowedError;
|
|
15
|
+
export declare const MultiError: typeof errors.InternalError;
|
|
16
|
+
export declare const NotFoundError: typeof errors.NotFoundError;
|
|
17
|
+
export declare const NotImplementedError: typeof errors.NotImplementedError;
|
|
18
|
+
export declare const ProjectError: typeof errors.InternalError;
|
|
19
|
+
export declare const ProjectMultiError: typeof errors.InternalError;
|
|
20
|
+
export declare const RejectedError: typeof errors.RejectedError;
|
|
21
|
+
export declare const TeapotError: typeof errors.TeapotError;
|
|
22
|
+
export declare const TooManyRequestsError: typeof errors.TooManyRequestsError;
|
|
23
|
+
export declare const UnauthorizedError: typeof errors.UnauthorizedError;
|
|
24
|
+
export declare const UnavailableError: typeof errors.UnavailableError;
|
|
25
|
+
export declare const UnhandledError: typeof errors.UnhandledError;
|
|
26
|
+
export declare const UnreachableCodeError: typeof errors.UnreachableCodeError;
|
|
47
27
|
export { log };
|
|
48
28
|
export declare const cloneDeep: import("vitest").Mock<(...args: any[]) => any>;
|
|
49
29
|
export declare const envBoolean: import("vitest").Mock<(...args: any[]) => any>;
|
|
@@ -52,45 +32,17 @@ export declare const errorFromStatusCode: ((statusCode: number, message?: string
|
|
|
52
32
|
mock: any;
|
|
53
33
|
};
|
|
54
34
|
export declare const formatError: import("vitest").Mock<(...args: any[]) => any>;
|
|
35
|
+
export declare const jaypieErrorFromStatus: ((statusCode: number, message?: string) => Error) & {
|
|
36
|
+
mock: any;
|
|
37
|
+
};
|
|
55
38
|
export declare const getHeaderFrom: import("vitest").Mock<(...args: any[]) => any>;
|
|
56
39
|
export declare const getObjectKeyCaseInsensitive: import("vitest").Mock<(...args: any[]) => any>;
|
|
57
40
|
export declare const isClass: import("vitest").Mock<(...args: any[]) => any>;
|
|
58
41
|
export declare const isJaypieError: import("vitest").Mock<(...args: any[]) => any>;
|
|
59
|
-
export declare const optional: {
|
|
60
|
-
(value: unknown, type: unknown, options?: Record<string, unknown>): boolean;
|
|
61
|
-
array<T = unknown>(value: unknown): value is T[] | undefined;
|
|
62
|
-
boolean(value: unknown): value is boolean | undefined;
|
|
63
|
-
number(value: unknown): value is number | undefined;
|
|
64
|
-
object<T extends Record<string, unknown> = Record<string, unknown>>(value: unknown): value is T | undefined;
|
|
65
|
-
positive(value: unknown): value is number | undefined;
|
|
66
|
-
string(value: unknown, defaultValue?: string): value is string | undefined;
|
|
67
|
-
};
|
|
68
|
-
export declare const required: {
|
|
69
|
-
(value: unknown, type: unknown, options?: Record<string, unknown>): boolean;
|
|
70
|
-
array<T = unknown>(value: unknown): value is T[];
|
|
71
|
-
boolean(value: unknown): value is boolean;
|
|
72
|
-
number(value: unknown): value is number;
|
|
73
|
-
object<T extends Record<string, unknown> = Record<string, unknown>>(value: unknown): value is T;
|
|
74
|
-
positive(value: unknown): value is number;
|
|
75
|
-
string(value: unknown, defaultValue?: string): value is string;
|
|
76
|
-
};
|
|
77
42
|
export declare const resolveValue: import("vitest").Mock<(...args: any[]) => any>;
|
|
78
43
|
export declare const safeParseFloat: import("vitest").Mock<(...args: any[]) => any>;
|
|
79
44
|
export declare const placeholders: import("vitest").Mock<(...args: any[]) => any>;
|
|
80
|
-
export declare const force:
|
|
81
|
-
(value: unknown, type: unknown, options?: string | {
|
|
82
|
-
key?: string;
|
|
83
|
-
maximum?: number;
|
|
84
|
-
minimum?: number;
|
|
85
|
-
nan?: boolean;
|
|
86
|
-
}): unknown;
|
|
87
|
-
array<T = unknown>(value: unknown): T[];
|
|
88
|
-
boolean(value: unknown): boolean;
|
|
89
|
-
number(value: unknown): number;
|
|
90
|
-
object<T extends Record<string, unknown> = Record<string, unknown>>(value: unknown, key?: string): T;
|
|
91
|
-
positive(value: unknown): number;
|
|
92
|
-
string(value: unknown, defaultValue?: string): string;
|
|
93
|
-
};
|
|
45
|
+
export declare const force: kit.ForceFunction;
|
|
94
46
|
export declare const jaypieHandler: ((handler: Function, options?: {
|
|
95
47
|
setup?: Function | Function[];
|
|
96
48
|
teardown?: Function | Function[];
|
|
@@ -101,215 +53,161 @@ export declare const jaypieHandler: ((handler: Function, options?: {
|
|
|
101
53
|
};
|
|
102
54
|
export declare const sleep: import("vitest").Mock<(...args: any[]) => any>;
|
|
103
55
|
export declare const uuid: import("vitest").Mock<(...args: any[]) => any>;
|
|
104
|
-
export declare const ERROR: {
|
|
105
|
-
MESSAGE: {
|
|
106
|
-
BAD_GATEWAY: "An unexpected error occurred on an upstream resource";
|
|
107
|
-
BAD_REQUEST: "The request was not properly formatted";
|
|
108
|
-
CONFIGURATION_ERROR: "The application responding to the request encountered a configuration error";
|
|
109
|
-
FORBIDDEN: "Access to this resource is not authorized";
|
|
110
|
-
GATEWAY_TIMEOUT: "The connection timed out waiting for an upstream resource";
|
|
111
|
-
GONE: "The requested resource is no longer available";
|
|
112
|
-
ILLOGICAL: "The application encountered an illogical condition while processing the request";
|
|
113
|
-
INTERNAL_ERROR: "An unexpected error occurred and the request was unable to complete";
|
|
114
|
-
METHOD_NOT_ALLOWED: "The requested method is not allowed";
|
|
115
|
-
NOT_FOUND: "The requested resource was not found";
|
|
116
|
-
NOT_IMPLEMENTED: "The request was understood but the resource is not implemented";
|
|
117
|
-
REJECTED: "The request was rejected prior to processing";
|
|
118
|
-
TEAPOT: "This resource is a teapot incapable of processing the request";
|
|
119
|
-
UNAUTHORIZED: "The request did not include valid authentication credentials";
|
|
120
|
-
UNAVAILABLE: "The requested resource is temporarily unavailable";
|
|
121
|
-
UNHANDLED: "An unhandled error occurred and the request was unable to complete";
|
|
122
|
-
UNREACHABLE_CODE: "The application encountered an unreachable condition while processing the request";
|
|
123
|
-
};
|
|
124
|
-
TITLE: {
|
|
125
|
-
BAD_GATEWAY: "Bad Gateway";
|
|
126
|
-
BAD_REQUEST: "Bad Request";
|
|
127
|
-
CONFIGURATION_ERROR: "Internal Configuration Error";
|
|
128
|
-
FORBIDDEN: "Forbidden";
|
|
129
|
-
GATEWAY_TIMEOUT: "Gateway Timeout";
|
|
130
|
-
GONE: "Gone";
|
|
131
|
-
INTERNAL_ERROR: "Internal Application Error";
|
|
132
|
-
METHOD_NOT_ALLOWED: "Method Not Allowed";
|
|
133
|
-
NOT_FOUND: "Not Found";
|
|
134
|
-
NOT_IMPLEMENTED: "Not Implemented";
|
|
135
|
-
REJECTED: "Request Rejected";
|
|
136
|
-
TEAPOT: "Teapot";
|
|
137
|
-
UNAUTHORIZED: "Service Unauthorized";
|
|
138
|
-
UNAVAILABLE: "Service Unavailable";
|
|
139
|
-
};
|
|
140
|
-
TYPE: {
|
|
141
|
-
BAD_GATEWAY: "BAD_GATEWAY";
|
|
142
|
-
BAD_REQUEST: "BAD_REQUEST";
|
|
143
|
-
CONFIGURATION_ERROR: "CONFIGURATION_ERROR";
|
|
144
|
-
FORBIDDEN: "FORBIDDEN";
|
|
145
|
-
GATEWAY_TIMEOUT: "GATEWAY_TIMEOUT";
|
|
146
|
-
GONE: "GONE";
|
|
147
|
-
ILLOGICAL: "ILLOGICAL";
|
|
148
|
-
INTERNAL_ERROR: "INTERNAL_ERROR";
|
|
149
|
-
METHOD_NOT_ALLOWED: "METHOD_NOT_ALLOWED";
|
|
150
|
-
MULTI_ERROR: "MULTI_ERROR";
|
|
151
|
-
NOT_FOUND: "NOT_FOUND";
|
|
152
|
-
NOT_IMPLEMENTED: "NOT_IMPLEMENTED";
|
|
153
|
-
REJECTED: "REJECTED";
|
|
154
|
-
TEAPOT: "TEAPOT";
|
|
155
|
-
UNAUTHORIZED: "UNAUTHORIZED";
|
|
156
|
-
UNAVAILABLE: "UNAVAILABLE";
|
|
157
|
-
UNHANDLED: "UNHANDLED";
|
|
158
|
-
UNKNOWN_TYPE: "UNKNOWN_TYPE";
|
|
159
|
-
UNREACHABLE_CODE: "UNREACHABLE_CODE";
|
|
160
|
-
};
|
|
161
|
-
};
|
|
162
56
|
export declare const HTTP: {
|
|
163
|
-
ALLOW: {
|
|
164
|
-
ANY: "*";
|
|
57
|
+
readonly ALLOW: {
|
|
58
|
+
readonly ANY: "*";
|
|
165
59
|
};
|
|
166
|
-
CODE: {
|
|
167
|
-
OK: 200;
|
|
168
|
-
CREATED: 201;
|
|
169
|
-
ACCEPTED: 202;
|
|
170
|
-
NO_CONTENT: 204;
|
|
171
|
-
FOUND: 302;
|
|
172
|
-
BAD_REQUEST: 400;
|
|
173
|
-
UNAUTHORIZED: 401;
|
|
174
|
-
FORBIDDEN: 403;
|
|
175
|
-
NOT_FOUND: 404;
|
|
176
|
-
METHOD_NOT_ALLOWED: 405;
|
|
177
|
-
CONFLICT: 409;
|
|
178
|
-
GONE: 410;
|
|
179
|
-
TEAPOT: 418;
|
|
180
|
-
INTERNAL_ERROR: 500;
|
|
181
|
-
BAD_GATEWAY: 502;
|
|
182
|
-
UNAVAILABLE: 503;
|
|
183
|
-
GATEWAY_TIMEOUT: 504;
|
|
60
|
+
readonly CODE: {
|
|
61
|
+
readonly OK: 200;
|
|
62
|
+
readonly CREATED: 201;
|
|
63
|
+
readonly ACCEPTED: 202;
|
|
64
|
+
readonly NO_CONTENT: 204;
|
|
65
|
+
readonly FOUND: 302;
|
|
66
|
+
readonly BAD_REQUEST: 400;
|
|
67
|
+
readonly UNAUTHORIZED: 401;
|
|
68
|
+
readonly FORBIDDEN: 403;
|
|
69
|
+
readonly NOT_FOUND: 404;
|
|
70
|
+
readonly METHOD_NOT_ALLOWED: 405;
|
|
71
|
+
readonly CONFLICT: 409;
|
|
72
|
+
readonly GONE: 410;
|
|
73
|
+
readonly TEAPOT: 418;
|
|
74
|
+
readonly INTERNAL_ERROR: 500;
|
|
75
|
+
readonly BAD_GATEWAY: 502;
|
|
76
|
+
readonly UNAVAILABLE: 503;
|
|
77
|
+
readonly GATEWAY_TIMEOUT: 504;
|
|
184
78
|
};
|
|
185
|
-
CONTENT: {
|
|
186
|
-
ANY: "*/*";
|
|
187
|
-
HTML: "text/html";
|
|
188
|
-
JSON: "application/json";
|
|
189
|
-
TEXT: "text/plain";
|
|
79
|
+
readonly CONTENT: {
|
|
80
|
+
readonly ANY: "*/*";
|
|
81
|
+
readonly HTML: "text/html";
|
|
82
|
+
readonly JSON: "application/json";
|
|
83
|
+
readonly TEXT: "text/plain";
|
|
190
84
|
};
|
|
191
|
-
HEADER: {
|
|
192
|
-
ACCEPT: "Accept";
|
|
193
|
-
ACCEPT_ENCODING: "Accept-Encoding";
|
|
194
|
-
ALLOW: {
|
|
195
|
-
HEADERS: "Access-Control-Allow-Headers";
|
|
196
|
-
METHODS: "Access-Control-Allow-Methods";
|
|
197
|
-
ORIGIN: "Access-Control-Allow-Origin";
|
|
85
|
+
readonly HEADER: {
|
|
86
|
+
readonly ACCEPT: "Accept";
|
|
87
|
+
readonly ACCEPT_ENCODING: "Accept-Encoding";
|
|
88
|
+
readonly ALLOW: {
|
|
89
|
+
readonly HEADERS: "Access-Control-Allow-Headers";
|
|
90
|
+
readonly METHODS: "Access-Control-Allow-Methods";
|
|
91
|
+
readonly ORIGIN: "Access-Control-Allow-Origin";
|
|
198
92
|
};
|
|
199
|
-
AMAZON: {
|
|
200
|
-
CF_ID: "X-Amz-Cf-Id";
|
|
201
|
-
CLOUDFRONT_COUNTRY: "CloudFront-Viewer-Country";
|
|
202
|
-
CLOUDFRONT_DESKTOP: "CloudFront-Is-Desktop-Viewer";
|
|
203
|
-
CLOUDFRONT_MOBILE: "CloudFront-Is-Mobile-Viewer";
|
|
204
|
-
CLOUDFRONT_PROTOCOL: "CloudFront-Forwarded-Proto";
|
|
205
|
-
CLOUDFRONT_SMARTTV: "CloudFront-Is-SmartTV-Viewer";
|
|
206
|
-
CLOUDFRONT_TABLET: "CloudFront-Is-Tablet-Viewer";
|
|
207
|
-
TRACE_ID: "X-Amzn-Trace-Id";
|
|
93
|
+
readonly AMAZON: {
|
|
94
|
+
readonly CF_ID: "X-Amz-Cf-Id";
|
|
95
|
+
readonly CLOUDFRONT_COUNTRY: "CloudFront-Viewer-Country";
|
|
96
|
+
readonly CLOUDFRONT_DESKTOP: "CloudFront-Is-Desktop-Viewer";
|
|
97
|
+
readonly CLOUDFRONT_MOBILE: "CloudFront-Is-Mobile-Viewer";
|
|
98
|
+
readonly CLOUDFRONT_PROTOCOL: "CloudFront-Forwarded-Proto";
|
|
99
|
+
readonly CLOUDFRONT_SMARTTV: "CloudFront-Is-SmartTV-Viewer";
|
|
100
|
+
readonly CLOUDFRONT_TABLET: "CloudFront-Is-Tablet-Viewer";
|
|
101
|
+
readonly TRACE_ID: "X-Amzn-Trace-Id";
|
|
208
102
|
};
|
|
209
|
-
AUTHORIZATION: "Authorization";
|
|
210
|
-
CACHE_CONTROL: "Cache-Control";
|
|
211
|
-
CONTENT_TYPE: "Content-Type";
|
|
212
|
-
COOKIE: {
|
|
213
|
-
REQUEST: "Cookie";
|
|
214
|
-
RESPONSE: "Set-Cookie";
|
|
103
|
+
readonly AUTHORIZATION: "Authorization";
|
|
104
|
+
readonly CACHE_CONTROL: "Cache-Control";
|
|
105
|
+
readonly CONTENT_TYPE: "Content-Type";
|
|
106
|
+
readonly COOKIE: {
|
|
107
|
+
readonly REQUEST: "Cookie";
|
|
108
|
+
readonly RESPONSE: "Set-Cookie";
|
|
215
109
|
};
|
|
216
|
-
DATADOG: {
|
|
217
|
-
SESSION_ID: "X-Session-Id";
|
|
110
|
+
readonly DATADOG: {
|
|
111
|
+
readonly SESSION_ID: "X-Session-Id";
|
|
218
112
|
};
|
|
219
|
-
FORWARDED: {
|
|
220
|
-
FOR: "X-Forwarded-For";
|
|
221
|
-
PORT: "X-Forwarded-Port";
|
|
222
|
-
PROTOCOL: "X-Forwarded-Proto";
|
|
113
|
+
readonly FORWARDED: {
|
|
114
|
+
readonly FOR: "X-Forwarded-For";
|
|
115
|
+
readonly PORT: "X-Forwarded-Port";
|
|
116
|
+
readonly PROTOCOL: "X-Forwarded-Proto";
|
|
223
117
|
};
|
|
224
|
-
HOST: "Host";
|
|
225
|
-
ORIGIN: "Origin";
|
|
226
|
-
POSTMAN: {
|
|
227
|
-
TOKEN: "Postman-Token";
|
|
118
|
+
readonly HOST: "Host";
|
|
119
|
+
readonly ORIGIN: "Origin";
|
|
120
|
+
readonly POSTMAN: {
|
|
121
|
+
readonly TOKEN: "Postman-Token";
|
|
228
122
|
};
|
|
229
|
-
POWERED_BY: "X-Powered-By";
|
|
230
|
-
PROJECT: {
|
|
231
|
-
ACCOUNT: "X-Project-Account";
|
|
232
|
-
CALLER: "X-Project-Caller";
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
123
|
+
readonly POWERED_BY: "X-Powered-By";
|
|
124
|
+
readonly PROJECT: {
|
|
125
|
+
readonly ACCOUNT: "X-Project-Account";
|
|
126
|
+
readonly CALLER: "X-Project-Caller";
|
|
127
|
+
readonly CHAOS: "X-Project-Chaos";
|
|
128
|
+
readonly ENVIRONMENT: "X-Project-Environment";
|
|
129
|
+
readonly KEY: "X-Project-Key";
|
|
130
|
+
readonly HANDLER: "X-Project-Handler";
|
|
131
|
+
readonly INVOCATION: "X-Project-Invocation";
|
|
132
|
+
readonly ROOT_INVOCATION: "X-Project-Root-Invocation";
|
|
133
|
+
readonly SECRET: "X-Project-Secret";
|
|
134
|
+
readonly SEED: "X-Project-Seed";
|
|
135
|
+
readonly SESSION: "X-Project-Session";
|
|
136
|
+
readonly VERSION: "X-Project-Version";
|
|
242
137
|
};
|
|
243
|
-
SIGNATURE: {
|
|
244
|
-
ED25519: "X-Signature-Ed25519";
|
|
245
|
-
TIMESTAMP: "X-Signature-Timestamp";
|
|
138
|
+
readonly SIGNATURE: {
|
|
139
|
+
readonly ED25519: "X-Signature-Ed25519";
|
|
140
|
+
readonly TIMESTAMP: "X-Signature-Timestamp";
|
|
246
141
|
};
|
|
247
|
-
USER_AGENT: "User-Agent";
|
|
248
|
-
VIA: "Via";
|
|
142
|
+
readonly USER_AGENT: "User-Agent";
|
|
143
|
+
readonly VIA: "Via";
|
|
249
144
|
};
|
|
250
|
-
METHOD: {
|
|
251
|
-
DELETE: "DELETE";
|
|
252
|
-
HEAD: "HEAD";
|
|
253
|
-
GET: "GET";
|
|
254
|
-
OPTIONS: "OPTIONS";
|
|
255
|
-
POST: "POST";
|
|
256
|
-
PUT: "PUT";
|
|
145
|
+
readonly METHOD: {
|
|
146
|
+
readonly DELETE: "DELETE";
|
|
147
|
+
readonly HEAD: "HEAD";
|
|
148
|
+
readonly GET: "GET";
|
|
149
|
+
readonly OPTIONS: "OPTIONS";
|
|
150
|
+
readonly POST: "POST";
|
|
151
|
+
readonly PUT: "PUT";
|
|
257
152
|
};
|
|
258
|
-
RESPONSE:
|
|
153
|
+
readonly RESPONSE: {};
|
|
259
154
|
};
|
|
260
155
|
export declare const JAYPIE: {
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
156
|
+
readonly ENV: {
|
|
157
|
+
readonly DATADOG_API_KEY: "DATADOG_API_KEY";
|
|
158
|
+
readonly DD_SITE: "DD_SITE";
|
|
159
|
+
readonly LOG_LEVEL: "LOG_LEVEL";
|
|
160
|
+
readonly MODULE_LOG_LEVEL: "MODULE_LOG_LEVEL";
|
|
161
|
+
readonly PROJECT_CHAOS: "PROJECT_CHAOS";
|
|
162
|
+
readonly PROJECT_ENV: "PROJECT_ENV";
|
|
163
|
+
readonly PROJECT_KEY: "PROJECT_KEY";
|
|
164
|
+
readonly PROJECT_SEED: "PROJECT_SEED";
|
|
165
|
+
readonly PROJECT_SERVICE: "PROJECT_SERVICE";
|
|
166
|
+
readonly PROJECT_SPONSOR: "PROJECT_SPONSOR";
|
|
167
|
+
readonly PROJECT_VERSION: "PROJECT_VERSION";
|
|
168
|
+
readonly SECRET_DATADOG_API_KEY: "SECRET_DATADOG_API_KEY";
|
|
169
|
+
};
|
|
170
|
+
readonly LIB: {
|
|
171
|
+
readonly AWS: "@jaypie/aws";
|
|
172
|
+
readonly CDK: "@jaypie/cdk";
|
|
173
|
+
readonly CONSTRUCTS: "@jaypie/constructs";
|
|
174
|
+
readonly CORE: "@jaypie/core";
|
|
175
|
+
readonly ERRORS: "@jaypie/errors";
|
|
176
|
+
readonly ESLINT: "@jaypie/eslint";
|
|
177
|
+
readonly EXPRESS: "@jaypie/express";
|
|
178
|
+
readonly FABRICATOR: "@jaypie/fabricator";
|
|
179
|
+
readonly JAYPIE: "jaypie";
|
|
180
|
+
readonly KIT: "@jaypie/kit";
|
|
181
|
+
readonly LAMBDA: "@jaypie/lambda";
|
|
182
|
+
readonly LOGGER: "@jaypie/logger";
|
|
183
|
+
readonly LLM: "@jaypie/llm";
|
|
184
|
+
readonly MATCHERS: "@jaypie/matchers";
|
|
185
|
+
readonly MCP: "@jaypie/mcp";
|
|
186
|
+
readonly MOCK: "@jaypie/mock";
|
|
187
|
+
readonly MONGOOSE: "@jaypie/mongoose";
|
|
188
|
+
readonly TESTKIT: "@jaypie/testkit";
|
|
189
|
+
readonly TEXTTRACT: "@jaypie/textract";
|
|
190
|
+
readonly TYPES: "@jaypie/types";
|
|
191
|
+
readonly WEBKIT: "@jaypie/webkit";
|
|
282
192
|
};
|
|
283
|
-
LAYER: {
|
|
284
|
-
EXPRESS: "express";
|
|
285
|
-
HANDLER: "handler";
|
|
286
|
-
JAYPIE: "jaypie";
|
|
287
|
-
LAMBDA: "lambda";
|
|
288
|
-
MODULE: "module";
|
|
289
|
-
NEXTJS: "nextjs";
|
|
193
|
+
readonly LAYER: {
|
|
194
|
+
readonly EXPRESS: "express";
|
|
195
|
+
readonly HANDLER: "handler";
|
|
196
|
+
readonly JAYPIE: "jaypie";
|
|
197
|
+
readonly LAMBDA: "lambda";
|
|
198
|
+
readonly MODULE: "module";
|
|
199
|
+
readonly NEXTJS: "nextjs";
|
|
290
200
|
};
|
|
291
|
-
LOGGER: {
|
|
292
|
-
DEFAULT: "default";
|
|
293
|
-
MODULE: "module";
|
|
201
|
+
readonly LOGGER: {
|
|
202
|
+
readonly DEFAULT: "default";
|
|
203
|
+
readonly MODULE: "module";
|
|
294
204
|
};
|
|
295
|
-
UNKNOWN: "unknown";
|
|
205
|
+
readonly UNKNOWN: "unknown";
|
|
296
206
|
};
|
|
297
207
|
export declare const PROJECT: {
|
|
298
|
-
SPONSOR: {
|
|
299
|
-
FINLAYSON: "finlaysonstudio";
|
|
300
|
-
JAYPIE: "jaypie";
|
|
301
|
-
KNOWDEV: "knowdev.studio";
|
|
208
|
+
readonly SPONSOR: {
|
|
209
|
+
readonly FINLAYSON: "finlaysonstudio";
|
|
210
|
+
readonly JAYPIE: "jaypie";
|
|
211
|
+
readonly KNOWDEV: "knowdev.studio";
|
|
302
212
|
};
|
|
303
213
|
};
|
|
304
|
-
export declare const VALIDATE: {
|
|
305
|
-
ANY: "*";
|
|
306
|
-
ARRAY: ArrayConstructor;
|
|
307
|
-
BOOLEAN: BooleanConstructor;
|
|
308
|
-
CLASS: "_CLASS";
|
|
309
|
-
FUNCTION: FunctionConstructor;
|
|
310
|
-
NUMBER: NumberConstructor;
|
|
311
|
-
NULL: null;
|
|
312
|
-
OBJECT: ObjectConstructor;
|
|
313
|
-
STRING: StringConstructor;
|
|
314
|
-
UNDEFINED: "_UNDEFINED";
|
|
315
|
-
};
|
|
@@ -1,5 +1,21 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
export declare const DATADOG: {
|
|
2
|
+
ENV: {
|
|
3
|
+
DATADOG_API_KEY: string;
|
|
4
|
+
DATADOG_API_KEY_ARN: string;
|
|
5
|
+
DD_API_KEY_SECRET_ARN: string;
|
|
6
|
+
DD_SITE: string;
|
|
7
|
+
SECRET_DATADOG_API_KEY: string;
|
|
8
|
+
};
|
|
9
|
+
METRIC: {
|
|
10
|
+
TYPE: {
|
|
11
|
+
UNKNOWN: number;
|
|
12
|
+
COUNT: number;
|
|
13
|
+
RATE: number;
|
|
14
|
+
GAUGE: number;
|
|
15
|
+
};
|
|
16
|
+
};
|
|
17
|
+
SITE: string;
|
|
18
|
+
};
|
|
3
19
|
export declare const hasDatadogEnv: import("vitest").Mock<(...args: any[]) => any>;
|
|
4
20
|
export declare const submitDistribution: import("vitest").Mock<(...args: any[]) => any>;
|
|
5
21
|
export declare const submitMetric: import("vitest").Mock<(...args: any[]) => any>;
|
|
@@ -1,23 +1,16 @@
|
|
|
1
|
-
import * as
|
|
2
|
-
import * as core from "@jaypie/core";
|
|
3
|
-
import * as datadog from "@jaypie/datadog";
|
|
4
|
-
import * as express from "@jaypie/express";
|
|
1
|
+
import * as errors from "@jaypie/errors";
|
|
5
2
|
import * as kit from "@jaypie/kit";
|
|
6
|
-
import * as lambda from "@jaypie/lambda";
|
|
7
|
-
import * as llm from "@jaypie/llm";
|
|
8
3
|
import * as logger from "@jaypie/logger";
|
|
9
|
-
import * as mongoose from "@jaypie/mongoose";
|
|
10
|
-
import * as textract from "@jaypie/textract";
|
|
11
4
|
export declare const original: {
|
|
12
|
-
aws: typeof aws;
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
express: typeof express;
|
|
5
|
+
aws: typeof import("@jaypie/aws");
|
|
6
|
+
datadog: typeof import("@jaypie/datadog");
|
|
7
|
+
errors: typeof errors;
|
|
8
|
+
express: typeof import("@jaypie/express");
|
|
16
9
|
kit: typeof kit;
|
|
17
|
-
lambda: typeof lambda;
|
|
18
|
-
llm: typeof llm;
|
|
10
|
+
lambda: typeof import("@jaypie/lambda");
|
|
11
|
+
llm: typeof import("@jaypie/llm");
|
|
19
12
|
logger: typeof logger;
|
|
20
|
-
mongoose: typeof mongoose;
|
|
21
|
-
textract: typeof textract;
|
|
13
|
+
mongoose: typeof import("@jaypie/mongoose");
|
|
14
|
+
textract: typeof import("@jaypie/textract");
|
|
22
15
|
};
|
|
23
16
|
export default original;
|
package/dist/mock/original.d.ts
CHANGED
|
@@ -1,23 +1,16 @@
|
|
|
1
|
-
import * as
|
|
2
|
-
import * as core from "@jaypie/core";
|
|
3
|
-
import * as datadog from "@jaypie/datadog";
|
|
4
|
-
import * as express from "@jaypie/express";
|
|
1
|
+
import * as errors from "@jaypie/errors";
|
|
5
2
|
import * as kit from "@jaypie/kit";
|
|
6
|
-
import * as lambda from "@jaypie/lambda";
|
|
7
|
-
import * as llm from "@jaypie/llm";
|
|
8
3
|
import * as logger from "@jaypie/logger";
|
|
9
|
-
import * as mongoose from "@jaypie/mongoose";
|
|
10
|
-
import * as textract from "@jaypie/textract";
|
|
11
4
|
export declare const original: {
|
|
12
|
-
aws: typeof aws;
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
express: typeof express;
|
|
5
|
+
aws: typeof import("@jaypie/aws");
|
|
6
|
+
datadog: typeof import("@jaypie/datadog");
|
|
7
|
+
errors: typeof errors;
|
|
8
|
+
express: typeof import("@jaypie/express");
|
|
16
9
|
kit: typeof kit;
|
|
17
|
-
lambda: typeof lambda;
|
|
18
|
-
llm: typeof llm;
|
|
10
|
+
lambda: typeof import("@jaypie/lambda");
|
|
11
|
+
llm: typeof import("@jaypie/llm");
|
|
19
12
|
logger: typeof logger;
|
|
20
|
-
mongoose: typeof mongoose;
|
|
21
|
-
textract: typeof textract;
|
|
13
|
+
mongoose: typeof import("@jaypie/mongoose");
|
|
14
|
+
textract: typeof import("@jaypie/textract");
|
|
22
15
|
};
|
|
23
16
|
export default original;
|
package/dist/mockLog.module.d.ts
CHANGED
package/package.json
CHANGED
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jaypie/testkit",
|
|
3
|
-
"version": "1.1
|
|
3
|
+
"version": "1.2.0-rc.1",
|
|
4
4
|
"repository": {
|
|
5
5
|
"type": "git",
|
|
6
6
|
"url": "https://github.com/finlaysonstudio/jaypie"
|
|
7
7
|
},
|
|
8
8
|
"license": "MIT",
|
|
9
9
|
"author": "Finlayson Studio",
|
|
10
|
+
"sideEffects": false,
|
|
10
11
|
"type": "module",
|
|
11
12
|
"exports": {
|
|
12
13
|
".": {
|
|
@@ -33,23 +34,12 @@
|
|
|
33
34
|
"typecheck": "tsc --noEmit"
|
|
34
35
|
},
|
|
35
36
|
"dependencies": {
|
|
36
|
-
"@jaypie/aws": "^1.1.21",
|
|
37
|
-
"@jaypie/core": "^1.1.11",
|
|
38
|
-
"@jaypie/datadog": "^1.1.2",
|
|
39
|
-
"@jaypie/express": "^1.1.11",
|
|
40
|
-
"@jaypie/kit": "^1.1.0",
|
|
41
|
-
"@jaypie/lambda": "^1.1.4",
|
|
42
|
-
"@jaypie/llm": "^1.1.21",
|
|
43
|
-
"@jaypie/logger": "^1.1.0",
|
|
44
|
-
"@jaypie/mongoose": "^1.1.1",
|
|
45
|
-
"@jaypie/textract": "^0.2.4",
|
|
46
|
-
"jaypie": "^1.1.71",
|
|
47
37
|
"jest-extended": "^4.0.2",
|
|
48
38
|
"jest-json-schema": "^6.1.0",
|
|
49
39
|
"uuid": "^11.0.5"
|
|
50
40
|
},
|
|
51
41
|
"devDependencies": {
|
|
52
|
-
"@jaypie/types": "
|
|
42
|
+
"@jaypie/types": "*",
|
|
53
43
|
"@rollup/plugin-commonjs": "^28.0.3",
|
|
54
44
|
"@rollup/plugin-json": "^6.1.0",
|
|
55
45
|
"@rollup/plugin-node-resolve": "^16.0.1",
|
|
@@ -64,8 +54,24 @@
|
|
|
64
54
|
"typescript": "^5.0.0",
|
|
65
55
|
"vitest": "^3.0.5"
|
|
66
56
|
},
|
|
57
|
+
"peerDependencies": {
|
|
58
|
+
"@jaypie/errors": "1.2.0-rc.1",
|
|
59
|
+
"@jaypie/kit": "1.2.0-rc.1",
|
|
60
|
+
"@jaypie/logger": "1.2.0-rc.1",
|
|
61
|
+
"vitest": ">=1.0.0"
|
|
62
|
+
},
|
|
63
|
+
"peerDependenciesMeta": {
|
|
64
|
+
"@jaypie/errors": {
|
|
65
|
+
"optional": true
|
|
66
|
+
},
|
|
67
|
+
"@jaypie/kit": {
|
|
68
|
+
"optional": true
|
|
69
|
+
},
|
|
70
|
+
"@jaypie/logger": {
|
|
71
|
+
"optional": true
|
|
72
|
+
}
|
|
73
|
+
},
|
|
67
74
|
"publishConfig": {
|
|
68
75
|
"access": "public"
|
|
69
|
-
}
|
|
70
|
-
"gitHead": "45fe048c6687a807ed52bbc0b25963f45450f9c9"
|
|
76
|
+
}
|
|
71
77
|
}
|