jaypie 1.1.77 → 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/cjs/aws.d.ts +11 -0
- package/dist/cjs/datadog.d.ts +8 -0
- package/dist/cjs/error.constant.d.ts +64 -0
- package/dist/cjs/express.d.ts +15 -0
- package/dist/cjs/index.cjs +440 -55
- package/dist/cjs/index.cjs.map +1 -1
- package/dist/cjs/index.d.ts +14 -7
- package/dist/cjs/kit.d.ts +5 -0
- package/dist/cjs/lambda.d.ts +4 -0
- package/dist/cjs/llm.d.ts +12 -0
- package/dist/cjs/loadPackage.d.ts +1 -0
- package/dist/cjs/mongoose.d.ts +7 -0
- package/dist/esm/aws.d.ts +11 -0
- package/dist/esm/datadog.d.ts +8 -0
- package/dist/esm/error.constant.d.ts +64 -0
- package/dist/esm/express.d.ts +15 -0
- package/dist/esm/index.d.ts +14 -7
- package/dist/esm/index.js +368 -7
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/kit.d.ts +5 -0
- package/dist/esm/lambda.d.ts +4 -0
- package/dist/esm/llm.d.ts +12 -0
- package/dist/esm/loadPackage.d.ts +1 -0
- package/dist/esm/mongoose.d.ts +7 -0
- package/package.json +20 -11
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type * as AwsTypes from "@jaypie/aws";
|
|
2
|
+
type AwsModule = typeof AwsTypes;
|
|
3
|
+
export declare function getEnvSecret(...args: Parameters<AwsModule["getEnvSecret"]>): ReturnType<AwsModule["getEnvSecret"]>;
|
|
4
|
+
export declare function getMessages(...args: Parameters<AwsModule["getMessages"]>): ReturnType<AwsModule["getMessages"]>;
|
|
5
|
+
export declare function getSecret(...args: Parameters<AwsModule["getSecret"]>): ReturnType<AwsModule["getSecret"]>;
|
|
6
|
+
export declare function getSingletonMessage(...args: Parameters<AwsModule["getSingletonMessage"]>): ReturnType<AwsModule["getSingletonMessage"]>;
|
|
7
|
+
export declare function getTextractJob(...args: Parameters<AwsModule["getTextractJob"]>): ReturnType<AwsModule["getTextractJob"]>;
|
|
8
|
+
export declare function sendBatchMessages(...args: Parameters<AwsModule["sendBatchMessages"]>): ReturnType<AwsModule["sendBatchMessages"]>;
|
|
9
|
+
export declare function sendMessage(...args: Parameters<AwsModule["sendMessage"]>): ReturnType<AwsModule["sendMessage"]>;
|
|
10
|
+
export declare function sendTextractJob(...args: Parameters<AwsModule["sendTextractJob"]>): ReturnType<AwsModule["sendTextractJob"]>;
|
|
11
|
+
export {};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type * as DatadogTypes from "@jaypie/datadog";
|
|
2
|
+
type DatadogModule = typeof DatadogTypes;
|
|
3
|
+
export declare const DATADOG: DatadogModule["DATADOG"];
|
|
4
|
+
export declare function hasDatadogEnv(...args: Parameters<DatadogModule["hasDatadogEnv"]>): ReturnType<DatadogModule["hasDatadogEnv"]>;
|
|
5
|
+
export declare function submitDistribution(...args: Parameters<DatadogModule["submitDistribution"]>): ReturnType<DatadogModule["submitDistribution"]>;
|
|
6
|
+
export declare function submitMetric(...args: Parameters<DatadogModule["submitMetric"]>): ReturnType<DatadogModule["submitMetric"]>;
|
|
7
|
+
export declare function submitMetricSet(...args: Parameters<DatadogModule["submitMetricSet"]>): ReturnType<DatadogModule["submitMetricSet"]>;
|
|
8
|
+
export {};
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
export declare const ERROR: {
|
|
2
|
+
readonly MESSAGE: {
|
|
3
|
+
readonly BAD_GATEWAY: "An unexpected error occurred on an upstream resource";
|
|
4
|
+
readonly BAD_REQUEST: "The request was not properly formatted";
|
|
5
|
+
readonly CONFIGURATION_ERROR: "The application responding to the request encountered a configuration error";
|
|
6
|
+
readonly CORS_ERROR: "The requesting origin is not authorized to this resource";
|
|
7
|
+
readonly FORBIDDEN: "Access to this resource is not authorized";
|
|
8
|
+
readonly GATEWAY_TIMEOUT: "The connection timed out waiting for an upstream resource";
|
|
9
|
+
readonly GONE: "The requested resource is no longer available";
|
|
10
|
+
readonly ILLOGICAL: "The application encountered an illogical condition while processing the request";
|
|
11
|
+
readonly INTERNAL_ERROR: "An unexpected error occurred and the request was unable to complete";
|
|
12
|
+
readonly METHOD_NOT_ALLOWED: "The requested method is not allowed";
|
|
13
|
+
readonly NOT_FOUND: "The requested resource was not found";
|
|
14
|
+
readonly NOT_IMPLEMENTED: "The request was understood but the resource is not implemented";
|
|
15
|
+
readonly REJECTED: "The request was rejected prior to processing";
|
|
16
|
+
readonly TEAPOT: "This resource is a teapot incapable of processing the request";
|
|
17
|
+
readonly TOO_MANY_REQUESTS: "The requesting origin exceeded the request limit";
|
|
18
|
+
readonly UNAUTHORIZED: "The request did not include valid authentication credentials";
|
|
19
|
+
readonly UNAVAILABLE: "The requested resource is temporarily unavailable";
|
|
20
|
+
readonly UNHANDLED: "An unhandled error occurred and the request was unable to complete";
|
|
21
|
+
readonly UNREACHABLE_CODE: "The application encountered an unreachable condition while processing the request";
|
|
22
|
+
};
|
|
23
|
+
readonly TITLE: {
|
|
24
|
+
readonly BAD_GATEWAY: "Bad Gateway";
|
|
25
|
+
readonly BAD_REQUEST: "Bad Request";
|
|
26
|
+
readonly CONFIGURATION_ERROR: "Internal Configuration Error";
|
|
27
|
+
readonly CORS_ERROR: "Unauthorized Origin";
|
|
28
|
+
readonly FORBIDDEN: "Forbidden";
|
|
29
|
+
readonly GATEWAY_TIMEOUT: "Gateway Timeout";
|
|
30
|
+
readonly GONE: "Gone";
|
|
31
|
+
readonly INTERNAL_ERROR: "Internal Application Error";
|
|
32
|
+
readonly METHOD_NOT_ALLOWED: "Method Not Allowed";
|
|
33
|
+
readonly NOT_FOUND: "Not Found";
|
|
34
|
+
readonly NOT_IMPLEMENTED: "Not Implemented";
|
|
35
|
+
readonly REJECTED: "Request Rejected";
|
|
36
|
+
readonly TEAPOT: "Teapot";
|
|
37
|
+
readonly TOO_MANY_REQUESTS: "Too Many Requests";
|
|
38
|
+
readonly UNAUTHORIZED: "Service Unauthorized";
|
|
39
|
+
readonly UNAVAILABLE: "Service Unavailable";
|
|
40
|
+
};
|
|
41
|
+
readonly TYPE: {
|
|
42
|
+
readonly BAD_GATEWAY: "BAD_GATEWAY";
|
|
43
|
+
readonly BAD_REQUEST: "BAD_REQUEST";
|
|
44
|
+
readonly CONFIGURATION_ERROR: "CONFIGURATION_ERROR";
|
|
45
|
+
readonly CORS_ERROR: "CORS_ERROR";
|
|
46
|
+
readonly FORBIDDEN: "FORBIDDEN";
|
|
47
|
+
readonly GATEWAY_TIMEOUT: "GATEWAY_TIMEOUT";
|
|
48
|
+
readonly GONE: "GONE";
|
|
49
|
+
readonly ILLOGICAL: "ILLOGICAL";
|
|
50
|
+
readonly INTERNAL_ERROR: "INTERNAL_ERROR";
|
|
51
|
+
readonly METHOD_NOT_ALLOWED: "METHOD_NOT_ALLOWED";
|
|
52
|
+
readonly MULTI_ERROR: "MULTI_ERROR";
|
|
53
|
+
readonly NOT_FOUND: "NOT_FOUND";
|
|
54
|
+
readonly NOT_IMPLEMENTED: "NOT_IMPLEMENTED";
|
|
55
|
+
readonly REJECTED: "REJECTED";
|
|
56
|
+
readonly TEAPOT: "TEAPOT";
|
|
57
|
+
readonly TOO_MANY_REQUESTS: "TOO_MANY_REQUESTS";
|
|
58
|
+
readonly UNAUTHORIZED: "UNAUTHORIZED";
|
|
59
|
+
readonly UNAVAILABLE: "UNAVAILABLE";
|
|
60
|
+
readonly UNHANDLED: "UNHANDLED";
|
|
61
|
+
readonly UNKNOWN_TYPE: "UNKNOWN_TYPE";
|
|
62
|
+
readonly UNREACHABLE_CODE: "UNREACHABLE_CODE";
|
|
63
|
+
};
|
|
64
|
+
};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type * as ExpressTypes from "@jaypie/express";
|
|
2
|
+
type ExpressModule = typeof ExpressTypes;
|
|
3
|
+
export type { CorsConfig, ExpressHandlerLocals, ExpressHandlerOptions, JaypieHandlerSetup, JaypieHandlerTeardown, JaypieHandlerValidate, } from "@jaypie/express";
|
|
4
|
+
export declare const EXPRESS: ExpressModule["EXPRESS"];
|
|
5
|
+
export declare function cors(...args: Parameters<ExpressModule["cors"]>): ReturnType<ExpressModule["cors"]>;
|
|
6
|
+
export declare function expressHandler(...args: Parameters<ExpressModule["expressHandler"]>): ReturnType<ExpressModule["expressHandler"]>;
|
|
7
|
+
export declare function expressHttpCodeHandler(...args: Parameters<ExpressModule["expressHttpCodeHandler"]>): ReturnType<ExpressModule["expressHttpCodeHandler"]>;
|
|
8
|
+
export declare const badRequestRoute: ExpressModule["badRequestRoute"];
|
|
9
|
+
export declare const echoRoute: ExpressModule["echoRoute"];
|
|
10
|
+
export declare const forbiddenRoute: ExpressModule["forbiddenRoute"];
|
|
11
|
+
export declare const goneRoute: ExpressModule["goneRoute"];
|
|
12
|
+
export declare const methodNotAllowedRoute: ExpressModule["methodNotAllowedRoute"];
|
|
13
|
+
export declare const noContentRoute: ExpressModule["noContentRoute"];
|
|
14
|
+
export declare const notFoundRoute: ExpressModule["notFoundRoute"];
|
|
15
|
+
export declare const notImplementedRoute: ExpressModule["notImplementedRoute"];
|
package/dist/cjs/index.cjs
CHANGED
|
@@ -1,62 +1,447 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
var aws = require('@jaypie/aws');
|
|
5
|
-
var datadog = require('@jaypie/datadog');
|
|
6
|
-
var express = require('@jaypie/express');
|
|
7
|
-
var lambda = require('@jaypie/lambda');
|
|
8
|
-
var llm = require('@jaypie/llm');
|
|
3
|
+
var errors = require('@jaypie/errors');
|
|
9
4
|
var kit = require('@jaypie/kit');
|
|
10
|
-
var
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
5
|
+
var logger = require('@jaypie/logger');
|
|
6
|
+
var uuid = require('uuid');
|
|
7
|
+
var module$1 = require('module');
|
|
8
|
+
|
|
9
|
+
var _documentCurrentScript = typeof document !== 'undefined' ? document.currentScript : null;
|
|
10
|
+
// ERROR constant - mirror from @jaypie/errors types
|
|
11
|
+
const ERROR = {
|
|
12
|
+
MESSAGE: {
|
|
13
|
+
BAD_GATEWAY: "An unexpected error occurred on an upstream resource",
|
|
14
|
+
BAD_REQUEST: "The request was not properly formatted",
|
|
15
|
+
CONFIGURATION_ERROR: "The application responding to the request encountered a configuration error",
|
|
16
|
+
CORS_ERROR: "The requesting origin is not authorized to this resource",
|
|
17
|
+
FORBIDDEN: "Access to this resource is not authorized",
|
|
18
|
+
GATEWAY_TIMEOUT: "The connection timed out waiting for an upstream resource",
|
|
19
|
+
GONE: "The requested resource is no longer available",
|
|
20
|
+
ILLOGICAL: "The application encountered an illogical condition while processing the request",
|
|
21
|
+
INTERNAL_ERROR: "An unexpected error occurred and the request was unable to complete",
|
|
22
|
+
METHOD_NOT_ALLOWED: "The requested method is not allowed",
|
|
23
|
+
NOT_FOUND: "The requested resource was not found",
|
|
24
|
+
NOT_IMPLEMENTED: "The request was understood but the resource is not implemented",
|
|
25
|
+
REJECTED: "The request was rejected prior to processing",
|
|
26
|
+
TEAPOT: "This resource is a teapot incapable of processing the request",
|
|
27
|
+
TOO_MANY_REQUESTS: "The requesting origin exceeded the request limit",
|
|
28
|
+
UNAUTHORIZED: "The request did not include valid authentication credentials",
|
|
29
|
+
UNAVAILABLE: "The requested resource is temporarily unavailable",
|
|
30
|
+
UNHANDLED: "An unhandled error occurred and the request was unable to complete",
|
|
31
|
+
UNREACHABLE_CODE: "The application encountered an unreachable condition while processing the request",
|
|
32
|
+
},
|
|
33
|
+
TITLE: {
|
|
34
|
+
BAD_GATEWAY: "Bad Gateway",
|
|
35
|
+
BAD_REQUEST: "Bad Request",
|
|
36
|
+
CONFIGURATION_ERROR: "Internal Configuration Error",
|
|
37
|
+
CORS_ERROR: "Unauthorized Origin",
|
|
38
|
+
FORBIDDEN: "Forbidden",
|
|
39
|
+
GATEWAY_TIMEOUT: "Gateway Timeout",
|
|
40
|
+
GONE: "Gone",
|
|
41
|
+
INTERNAL_ERROR: "Internal Application Error",
|
|
42
|
+
METHOD_NOT_ALLOWED: "Method Not Allowed",
|
|
43
|
+
NOT_FOUND: "Not Found",
|
|
44
|
+
NOT_IMPLEMENTED: "Not Implemented",
|
|
45
|
+
REJECTED: "Request Rejected",
|
|
46
|
+
TEAPOT: "Teapot",
|
|
47
|
+
TOO_MANY_REQUESTS: "Too Many Requests",
|
|
48
|
+
UNAUTHORIZED: "Service Unauthorized",
|
|
49
|
+
UNAVAILABLE: "Service Unavailable",
|
|
50
|
+
},
|
|
51
|
+
TYPE: {
|
|
52
|
+
BAD_GATEWAY: "BAD_GATEWAY",
|
|
53
|
+
BAD_REQUEST: "BAD_REQUEST",
|
|
54
|
+
CONFIGURATION_ERROR: "CONFIGURATION_ERROR",
|
|
55
|
+
CORS_ERROR: "CORS_ERROR",
|
|
56
|
+
FORBIDDEN: "FORBIDDEN",
|
|
57
|
+
GATEWAY_TIMEOUT: "GATEWAY_TIMEOUT",
|
|
58
|
+
GONE: "GONE",
|
|
59
|
+
ILLOGICAL: "ILLOGICAL",
|
|
60
|
+
INTERNAL_ERROR: "INTERNAL_ERROR",
|
|
61
|
+
METHOD_NOT_ALLOWED: "METHOD_NOT_ALLOWED",
|
|
62
|
+
MULTI_ERROR: "MULTI_ERROR",
|
|
63
|
+
NOT_FOUND: "NOT_FOUND",
|
|
64
|
+
NOT_IMPLEMENTED: "NOT_IMPLEMENTED",
|
|
65
|
+
REJECTED: "REJECTED",
|
|
66
|
+
TEAPOT: "TEAPOT",
|
|
67
|
+
TOO_MANY_REQUESTS: "TOO_MANY_REQUESTS",
|
|
68
|
+
UNAUTHORIZED: "UNAUTHORIZED",
|
|
69
|
+
UNAVAILABLE: "UNAVAILABLE",
|
|
70
|
+
UNHANDLED: "UNHANDLED",
|
|
71
|
+
UNKNOWN_TYPE: "UNKNOWN_TYPE",
|
|
72
|
+
UNREACHABLE_CODE: "UNREACHABLE_CODE",
|
|
73
|
+
},
|
|
74
|
+
};
|
|
75
|
+
|
|
76
|
+
// Using createRequire for synchronous package loading - required for lazy loading pattern
|
|
77
|
+
const require$1 = module$1.createRequire((typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('index.cjs', document.baseURI).href)));
|
|
78
|
+
const packageCache = new Map();
|
|
79
|
+
function loadPackage(packageName) {
|
|
80
|
+
if (packageCache.has(packageName)) {
|
|
81
|
+
return packageCache.get(packageName);
|
|
82
|
+
}
|
|
83
|
+
try {
|
|
84
|
+
// eslint-disable-next-line no-restricted-syntax
|
|
85
|
+
const pkg = require$1(packageName);
|
|
86
|
+
packageCache.set(packageName, pkg);
|
|
87
|
+
return pkg;
|
|
88
|
+
}
|
|
89
|
+
catch (error) {
|
|
90
|
+
const resolveAttempt = safeResolve(packageName);
|
|
91
|
+
const err = error;
|
|
92
|
+
// eslint-disable-next-line no-console
|
|
93
|
+
console.error(`[jaypie] loadPackage failed for "${packageName}"`, {
|
|
94
|
+
importMetaUrl: (typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('index.cjs', document.baseURI).href)),
|
|
95
|
+
resolveAttempt,
|
|
96
|
+
errorCode: err.code,
|
|
97
|
+
errorMessage: err.message,
|
|
98
|
+
});
|
|
99
|
+
throw new errors.ConfigurationError(`${packageName} is required but not installed. Run: npm install ${packageName}`);
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
function safeResolve(packageName) {
|
|
103
|
+
try {
|
|
104
|
+
return require$1.resolve(packageName);
|
|
105
|
+
}
|
|
106
|
+
catch {
|
|
107
|
+
return null;
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
function getEnvSecret(...args) {
|
|
112
|
+
return loadPackage("@jaypie/aws").getEnvSecret(...args);
|
|
113
|
+
}
|
|
114
|
+
function getMessages(...args) {
|
|
115
|
+
return loadPackage("@jaypie/aws").getMessages(...args);
|
|
116
|
+
}
|
|
117
|
+
function getSecret(...args) {
|
|
118
|
+
return loadPackage("@jaypie/aws").getSecret(...args);
|
|
119
|
+
}
|
|
120
|
+
function getSingletonMessage(...args) {
|
|
121
|
+
return loadPackage("@jaypie/aws").getSingletonMessage(...args);
|
|
122
|
+
}
|
|
123
|
+
function getTextractJob(...args) {
|
|
124
|
+
return loadPackage("@jaypie/aws").getTextractJob(...args);
|
|
125
|
+
}
|
|
126
|
+
function sendBatchMessages(...args) {
|
|
127
|
+
return loadPackage("@jaypie/aws").sendBatchMessages(...args);
|
|
128
|
+
}
|
|
129
|
+
function sendMessage(...args) {
|
|
130
|
+
return loadPackage("@jaypie/aws").sendMessage(...args);
|
|
131
|
+
}
|
|
132
|
+
function sendTextractJob(...args) {
|
|
133
|
+
return loadPackage("@jaypie/aws").sendTextractJob(...args);
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
// Re-export constant via getter to lazy load
|
|
137
|
+
const DATADOG = new Proxy({}, {
|
|
138
|
+
get(_, prop) {
|
|
139
|
+
return loadPackage("@jaypie/datadog").DATADOG[prop];
|
|
140
|
+
},
|
|
141
|
+
});
|
|
142
|
+
function hasDatadogEnv(...args) {
|
|
143
|
+
return loadPackage("@jaypie/datadog").hasDatadogEnv(...args);
|
|
144
|
+
}
|
|
145
|
+
function submitDistribution(...args) {
|
|
146
|
+
return loadPackage("@jaypie/datadog").submitDistribution(...args);
|
|
147
|
+
}
|
|
148
|
+
function submitMetric(...args) {
|
|
149
|
+
return loadPackage("@jaypie/datadog").submitMetric(...args);
|
|
150
|
+
}
|
|
151
|
+
function submitMetricSet(...args) {
|
|
152
|
+
return loadPackage("@jaypie/datadog").submitMetricSet(...args);
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
// Re-export constant via getter to lazy load
|
|
156
|
+
const EXPRESS = new Proxy({}, {
|
|
157
|
+
get(_, prop) {
|
|
158
|
+
return loadPackage("@jaypie/express").EXPRESS[prop];
|
|
159
|
+
},
|
|
160
|
+
});
|
|
161
|
+
function cors(...args) {
|
|
162
|
+
return loadPackage("@jaypie/express").cors(...args);
|
|
163
|
+
}
|
|
164
|
+
function expressHandler(...args) {
|
|
165
|
+
return loadPackage("@jaypie/express").expressHandler(...args);
|
|
166
|
+
}
|
|
167
|
+
function expressHttpCodeHandler(...args) {
|
|
168
|
+
return loadPackage("@jaypie/express").expressHttpCodeHandler(...args);
|
|
169
|
+
}
|
|
170
|
+
// Route exports - these are pre-created handlers, so we use getters
|
|
171
|
+
const badRequestRoute = new Proxy((() => { }), {
|
|
172
|
+
apply(_, thisArg, args) {
|
|
173
|
+
return Reflect.apply(loadPackage("@jaypie/express").badRequestRoute, thisArg, args);
|
|
174
|
+
},
|
|
175
|
+
get(_, prop) {
|
|
176
|
+
const route = loadPackage("@jaypie/express")
|
|
177
|
+
.badRequestRoute;
|
|
178
|
+
return route[prop];
|
|
179
|
+
},
|
|
180
|
+
});
|
|
181
|
+
const echoRoute = new Proxy((() => { }), {
|
|
182
|
+
apply(_, thisArg, args) {
|
|
183
|
+
return Reflect.apply(loadPackage("@jaypie/express").echoRoute, thisArg, args);
|
|
184
|
+
},
|
|
185
|
+
get(_, prop) {
|
|
186
|
+
const route = loadPackage("@jaypie/express")
|
|
187
|
+
.echoRoute;
|
|
188
|
+
return route[prop];
|
|
189
|
+
},
|
|
190
|
+
});
|
|
191
|
+
const forbiddenRoute = new Proxy((() => { }), {
|
|
192
|
+
apply(_, thisArg, args) {
|
|
193
|
+
return Reflect.apply(loadPackage("@jaypie/express").forbiddenRoute, thisArg, args);
|
|
194
|
+
},
|
|
195
|
+
get(_, prop) {
|
|
196
|
+
const route = loadPackage("@jaypie/express")
|
|
197
|
+
.forbiddenRoute;
|
|
198
|
+
return route[prop];
|
|
199
|
+
},
|
|
200
|
+
});
|
|
201
|
+
const goneRoute = new Proxy((() => { }), {
|
|
202
|
+
apply(_, thisArg, args) {
|
|
203
|
+
return Reflect.apply(loadPackage("@jaypie/express").goneRoute, thisArg, args);
|
|
204
|
+
},
|
|
205
|
+
get(_, prop) {
|
|
206
|
+
const route = loadPackage("@jaypie/express")
|
|
207
|
+
.goneRoute;
|
|
208
|
+
return route[prop];
|
|
209
|
+
},
|
|
210
|
+
});
|
|
211
|
+
const methodNotAllowedRoute = new Proxy((() => { }), {
|
|
212
|
+
apply(_, thisArg, args) {
|
|
213
|
+
return Reflect.apply(loadPackage("@jaypie/express").methodNotAllowedRoute, thisArg, args);
|
|
214
|
+
},
|
|
215
|
+
get(_, prop) {
|
|
216
|
+
const route = loadPackage("@jaypie/express")
|
|
217
|
+
.methodNotAllowedRoute;
|
|
218
|
+
return route[prop];
|
|
219
|
+
},
|
|
220
|
+
});
|
|
221
|
+
const noContentRoute = new Proxy((() => { }), {
|
|
222
|
+
apply(_, thisArg, args) {
|
|
223
|
+
return Reflect.apply(loadPackage("@jaypie/express").noContentRoute, thisArg, args);
|
|
224
|
+
},
|
|
225
|
+
get(_, prop) {
|
|
226
|
+
const route = loadPackage("@jaypie/express")
|
|
227
|
+
.noContentRoute;
|
|
228
|
+
return route[prop];
|
|
229
|
+
},
|
|
230
|
+
});
|
|
231
|
+
const notFoundRoute = new Proxy((() => { }), {
|
|
232
|
+
apply(_, thisArg, args) {
|
|
233
|
+
return Reflect.apply(loadPackage("@jaypie/express").notFoundRoute, thisArg, args);
|
|
234
|
+
},
|
|
235
|
+
get(_, prop) {
|
|
236
|
+
const route = loadPackage("@jaypie/express")
|
|
237
|
+
.notFoundRoute;
|
|
238
|
+
return route[prop];
|
|
239
|
+
},
|
|
240
|
+
});
|
|
241
|
+
const notImplementedRoute = new Proxy((() => { }), {
|
|
242
|
+
apply(_, thisArg, args) {
|
|
243
|
+
return Reflect.apply(loadPackage("@jaypie/express").notImplementedRoute, thisArg, args);
|
|
244
|
+
},
|
|
245
|
+
get(_, prop) {
|
|
246
|
+
const route = loadPackage("@jaypie/express")
|
|
247
|
+
.notImplementedRoute;
|
|
248
|
+
return route[prop];
|
|
249
|
+
},
|
|
250
|
+
});
|
|
251
|
+
|
|
252
|
+
function lambdaHandler(...args) {
|
|
253
|
+
return loadPackage("@jaypie/lambda").lambdaHandler(...args);
|
|
254
|
+
}
|
|
255
|
+
|
|
256
|
+
// Re-export enums via getters
|
|
257
|
+
const LlmMessageRole = new Proxy({}, {
|
|
258
|
+
get(_, prop) {
|
|
259
|
+
return loadPackage("@jaypie/llm").LlmMessageRole[prop];
|
|
260
|
+
},
|
|
261
|
+
});
|
|
262
|
+
const LlmMessageType = new Proxy({}, {
|
|
263
|
+
get(_, prop) {
|
|
264
|
+
return loadPackage("@jaypie/llm").LlmMessageType[prop];
|
|
265
|
+
},
|
|
266
|
+
});
|
|
267
|
+
// Re-export LLM constants namespace via getter
|
|
268
|
+
const LLM = new Proxy({}, {
|
|
269
|
+
get(_, prop) {
|
|
270
|
+
return loadPackage("@jaypie/llm").LLM[prop];
|
|
271
|
+
},
|
|
272
|
+
});
|
|
273
|
+
// Llm class wrapper
|
|
274
|
+
const Llm = new Proxy(function () { }, {
|
|
275
|
+
construct(_, args) {
|
|
276
|
+
const LlmClass = loadPackage("@jaypie/llm").Llm;
|
|
277
|
+
return new LlmClass(...args);
|
|
278
|
+
},
|
|
279
|
+
get(_, prop) {
|
|
280
|
+
const LlmClass = loadPackage("@jaypie/llm")
|
|
281
|
+
.Llm;
|
|
282
|
+
return LlmClass[prop];
|
|
283
|
+
},
|
|
284
|
+
});
|
|
285
|
+
// Toolkit exports
|
|
286
|
+
const JaypieToolkit = new Proxy(function () { }, {
|
|
287
|
+
construct(_, args) {
|
|
288
|
+
const ToolkitClass = loadPackage("@jaypie/llm").JaypieToolkit;
|
|
289
|
+
return new ToolkitClass(...args);
|
|
290
|
+
},
|
|
291
|
+
get(_, prop) {
|
|
292
|
+
const ToolkitClass = loadPackage("@jaypie/llm")
|
|
293
|
+
.JaypieToolkit;
|
|
294
|
+
return ToolkitClass[prop];
|
|
295
|
+
},
|
|
296
|
+
});
|
|
297
|
+
const Toolkit = new Proxy(function () { }, {
|
|
298
|
+
construct(_, args) {
|
|
299
|
+
const ToolkitClass = loadPackage("@jaypie/llm").Toolkit;
|
|
300
|
+
return new ToolkitClass(...args);
|
|
301
|
+
},
|
|
302
|
+
get(_, prop) {
|
|
303
|
+
const ToolkitClass = loadPackage("@jaypie/llm")
|
|
304
|
+
.Toolkit;
|
|
305
|
+
return ToolkitClass[prop];
|
|
306
|
+
},
|
|
307
|
+
});
|
|
308
|
+
// toolkit and tools are objects/instances
|
|
309
|
+
const toolkit = new Proxy({}, {
|
|
310
|
+
get(_, prop) {
|
|
311
|
+
const toolkitObj = loadPackage("@jaypie/llm")
|
|
312
|
+
.toolkit;
|
|
313
|
+
return toolkitObj[prop];
|
|
314
|
+
},
|
|
315
|
+
});
|
|
316
|
+
const tools = new Proxy({}, {
|
|
317
|
+
get(_, prop) {
|
|
318
|
+
const toolsObj = loadPackage("@jaypie/llm")
|
|
319
|
+
.tools;
|
|
320
|
+
return toolsObj[prop];
|
|
321
|
+
},
|
|
322
|
+
});
|
|
323
|
+
// Provider exports
|
|
324
|
+
const GeminiProvider = new Proxy(function () { }, {
|
|
325
|
+
construct(_, args) {
|
|
326
|
+
const ProviderClass = loadPackage("@jaypie/llm").GeminiProvider;
|
|
327
|
+
return new ProviderClass(...args);
|
|
328
|
+
},
|
|
329
|
+
get(_, prop) {
|
|
330
|
+
const ProviderClass = loadPackage("@jaypie/llm")
|
|
331
|
+
.GeminiProvider;
|
|
332
|
+
return ProviderClass[prop];
|
|
333
|
+
},
|
|
334
|
+
});
|
|
335
|
+
const OpenRouterProvider = new Proxy(function () { }, {
|
|
336
|
+
construct(_, args) {
|
|
337
|
+
const ProviderClass = loadPackage("@jaypie/llm").OpenRouterProvider;
|
|
338
|
+
return new ProviderClass(...args);
|
|
339
|
+
},
|
|
340
|
+
get(_, prop) {
|
|
341
|
+
const ProviderClass = loadPackage("@jaypie/llm")
|
|
342
|
+
.OpenRouterProvider;
|
|
343
|
+
return ProviderClass[prop];
|
|
344
|
+
},
|
|
345
|
+
});
|
|
346
|
+
|
|
347
|
+
function connect(...args) {
|
|
348
|
+
return loadPackage("@jaypie/mongoose").connect(...args);
|
|
349
|
+
}
|
|
350
|
+
function connectFromSecretEnv(...args) {
|
|
351
|
+
return loadPackage("@jaypie/mongoose").connectFromSecretEnv(...args);
|
|
352
|
+
}
|
|
353
|
+
function disconnect() {
|
|
354
|
+
return loadPackage("@jaypie/mongoose").disconnect();
|
|
355
|
+
}
|
|
356
|
+
// Re-export mongoose via getter to lazy load
|
|
357
|
+
const mongoose = new Proxy({}, {
|
|
358
|
+
get(_, prop) {
|
|
359
|
+
const mongoosePkg = loadPackage("@jaypie/mongoose")
|
|
360
|
+
.mongoose;
|
|
361
|
+
return mongoosePkg[prop];
|
|
362
|
+
},
|
|
363
|
+
apply(_, thisArg, args) {
|
|
364
|
+
const mongoosePkg = loadPackage("@jaypie/mongoose")
|
|
365
|
+
.mongoose;
|
|
366
|
+
return Reflect.apply(mongoosePkg, thisArg, args);
|
|
367
|
+
},
|
|
368
|
+
});
|
|
369
|
+
|
|
370
|
+
Object.defineProperty(exports, "MultiError", {
|
|
371
|
+
enumerable: true,
|
|
372
|
+
get: function () { return errors.InternalError; }
|
|
373
|
+
});
|
|
374
|
+
Object.defineProperty(exports, "ProjectError", {
|
|
375
|
+
enumerable: true,
|
|
376
|
+
get: function () { return errors.InternalError; }
|
|
377
|
+
});
|
|
378
|
+
Object.defineProperty(exports, "ProjectMultiError", {
|
|
379
|
+
enumerable: true,
|
|
380
|
+
get: function () { return errors.InternalError; }
|
|
381
|
+
});
|
|
382
|
+
Object.defineProperty(exports, "errorFromStatusCode", {
|
|
383
|
+
enumerable: true,
|
|
384
|
+
get: function () { return errors.jaypieErrorFromStatus; }
|
|
385
|
+
});
|
|
386
|
+
Object.defineProperty(exports, "log", {
|
|
387
|
+
enumerable: true,
|
|
388
|
+
get: function () { return logger.log; }
|
|
389
|
+
});
|
|
390
|
+
Object.defineProperty(exports, "uuid", {
|
|
391
|
+
enumerable: true,
|
|
392
|
+
get: function () { return uuid.v4; }
|
|
393
|
+
});
|
|
394
|
+
exports.DATADOG = DATADOG;
|
|
395
|
+
exports.ERROR = ERROR;
|
|
396
|
+
exports.EXPRESS = EXPRESS;
|
|
397
|
+
exports.GeminiProvider = GeminiProvider;
|
|
398
|
+
exports.JaypieToolkit = JaypieToolkit;
|
|
399
|
+
exports.LLM = LLM;
|
|
400
|
+
exports.Llm = Llm;
|
|
401
|
+
exports.LlmMessageRole = LlmMessageRole;
|
|
402
|
+
exports.LlmMessageType = LlmMessageType;
|
|
403
|
+
exports.OpenRouterProvider = OpenRouterProvider;
|
|
404
|
+
exports.Toolkit = Toolkit;
|
|
405
|
+
exports.badRequestRoute = badRequestRoute;
|
|
406
|
+
exports.connect = connect;
|
|
407
|
+
exports.connectFromSecretEnv = connectFromSecretEnv;
|
|
408
|
+
exports.cors = cors;
|
|
409
|
+
exports.disconnect = disconnect;
|
|
410
|
+
exports.echoRoute = echoRoute;
|
|
411
|
+
exports.expressHandler = expressHandler;
|
|
412
|
+
exports.expressHttpCodeHandler = expressHttpCodeHandler;
|
|
413
|
+
exports.forbiddenRoute = forbiddenRoute;
|
|
414
|
+
exports.getEnvSecret = getEnvSecret;
|
|
415
|
+
exports.getMessages = getMessages;
|
|
416
|
+
exports.getSecret = getSecret;
|
|
417
|
+
exports.getSingletonMessage = getSingletonMessage;
|
|
418
|
+
exports.getTextractJob = getTextractJob;
|
|
419
|
+
exports.goneRoute = goneRoute;
|
|
420
|
+
exports.hasDatadogEnv = hasDatadogEnv;
|
|
421
|
+
exports.lambdaHandler = lambdaHandler;
|
|
422
|
+
exports.methodNotAllowedRoute = methodNotAllowedRoute;
|
|
423
|
+
exports.mongoose = mongoose;
|
|
424
|
+
exports.noContentRoute = noContentRoute;
|
|
425
|
+
exports.notFoundRoute = notFoundRoute;
|
|
426
|
+
exports.notImplementedRoute = notImplementedRoute;
|
|
427
|
+
exports.sendBatchMessages = sendBatchMessages;
|
|
428
|
+
exports.sendMessage = sendMessage;
|
|
429
|
+
exports.sendTextractJob = sendTextractJob;
|
|
430
|
+
exports.submitDistribution = submitDistribution;
|
|
431
|
+
exports.submitMetric = submitMetric;
|
|
432
|
+
exports.submitMetricSet = submitMetricSet;
|
|
433
|
+
exports.toolkit = toolkit;
|
|
434
|
+
exports.tools = tools;
|
|
435
|
+
Object.keys(errors).forEach(function (k) {
|
|
436
|
+
if (k !== 'default' && !Object.prototype.hasOwnProperty.call(exports, k)) Object.defineProperty(exports, k, {
|
|
437
|
+
enumerable: true,
|
|
438
|
+
get: function () { return errors[k]; }
|
|
439
|
+
});
|
|
49
440
|
});
|
|
50
441
|
Object.keys(kit).forEach(function (k) {
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
});
|
|
56
|
-
Object.keys(mongoose).forEach(function (k) {
|
|
57
|
-
if (k !== 'default' && !Object.prototype.hasOwnProperty.call(exports, k)) Object.defineProperty(exports, k, {
|
|
58
|
-
enumerable: true,
|
|
59
|
-
get: function () { return mongoose[k]; }
|
|
60
|
-
});
|
|
442
|
+
if (k !== 'default' && !Object.prototype.hasOwnProperty.call(exports, k)) Object.defineProperty(exports, k, {
|
|
443
|
+
enumerable: true,
|
|
444
|
+
get: function () { return kit[k]; }
|
|
445
|
+
});
|
|
61
446
|
});
|
|
62
447
|
//# sourceMappingURL=index.cjs.map
|