@digilogiclabs/platform-core 1.17.0 → 1.17.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/auth.d.mts +27 -0
- package/dist/auth.d.ts +27 -0
- package/dist/auth.js +45 -14
- package/dist/auth.js.map +1 -1
- package/dist/auth.mjs +45 -14
- package/dist/auth.mjs.map +1 -1
- package/dist/index.js +145 -29
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +145 -29
- package/dist/index.mjs.map +1 -1
- package/dist/migrate.js +5 -1
- package/dist/migrate.js.map +1 -1
- package/package.json +11 -11
package/dist/index.js
CHANGED
|
@@ -1124,7 +1124,11 @@ var init_PostgresDatabase = __esm({
|
|
|
1124
1124
|
* Create a PostgresDatabase from configuration
|
|
1125
1125
|
*/
|
|
1126
1126
|
static async create(config) {
|
|
1127
|
-
const { Pool } = await import(
|
|
1127
|
+
const { Pool } = await import(
|
|
1128
|
+
/* webpackIgnore: true */
|
|
1129
|
+
/* turbopackIgnore: true */
|
|
1130
|
+
"pg"
|
|
1131
|
+
);
|
|
1128
1132
|
const poolConfig = toPoolConfig(config);
|
|
1129
1133
|
const pool = new Pool(poolConfig);
|
|
1130
1134
|
const client = await pool.connect();
|
|
@@ -1761,10 +1765,18 @@ var init_RedisCache = __esm({
|
|
|
1761
1765
|
* Create a RedisCache from configuration
|
|
1762
1766
|
*/
|
|
1763
1767
|
static async create(config) {
|
|
1764
|
-
const { default: Redis2 } = await import(
|
|
1768
|
+
const { default: Redis2 } = await import(
|
|
1769
|
+
/* webpackIgnore: true */
|
|
1770
|
+
/* turbopackIgnore: true */
|
|
1771
|
+
"ioredis"
|
|
1772
|
+
);
|
|
1765
1773
|
let client;
|
|
1766
1774
|
if (config.cluster) {
|
|
1767
|
-
const { Cluster } = await import(
|
|
1775
|
+
const { Cluster } = await import(
|
|
1776
|
+
/* webpackIgnore: true */
|
|
1777
|
+
/* turbopackIgnore: true */
|
|
1778
|
+
"ioredis"
|
|
1779
|
+
);
|
|
1768
1780
|
client = new Cluster(config.cluster.nodes, {
|
|
1769
1781
|
scaleReads: config.cluster.options?.scaleReads ?? "master",
|
|
1770
1782
|
maxRedirections: config.cluster.options?.maxRedirections ?? 16,
|
|
@@ -1917,7 +1929,11 @@ var init_RedisCache = __esm({
|
|
|
1917
1929
|
}
|
|
1918
1930
|
async subscribe(channel, callback) {
|
|
1919
1931
|
if (!this.subscriberClient) {
|
|
1920
|
-
const { default: Redis2 } = await import(
|
|
1932
|
+
const { default: Redis2 } = await import(
|
|
1933
|
+
/* webpackIgnore: true */
|
|
1934
|
+
/* turbopackIgnore: true */
|
|
1935
|
+
"ioredis"
|
|
1936
|
+
);
|
|
1921
1937
|
const options = toIORedisOptions(this.config);
|
|
1922
1938
|
this.subscriberClient = typeof options === "string" ? new Redis2(options) : new Redis2(options);
|
|
1923
1939
|
this.subscriberClient.on("message", (ch, message) => {
|
|
@@ -2141,7 +2157,11 @@ var init_SupabaseStorage = __esm({
|
|
|
2141
2157
|
* Create a SupabaseStorage adapter from configuration
|
|
2142
2158
|
*/
|
|
2143
2159
|
static async create(config) {
|
|
2144
|
-
const { createClient } = await import(
|
|
2160
|
+
const { createClient } = await import(
|
|
2161
|
+
/* webpackIgnore: true */
|
|
2162
|
+
/* turbopackIgnore: true */
|
|
2163
|
+
"@supabase/supabase-js"
|
|
2164
|
+
);
|
|
2145
2165
|
const client = createClient(config.url, config.apiKey);
|
|
2146
2166
|
return new _SupabaseStorage(client, {
|
|
2147
2167
|
bucket: config.bucket,
|
|
@@ -2369,7 +2389,11 @@ var init_S3Storage = __esm({
|
|
|
2369
2389
|
} else {
|
|
2370
2390
|
body = data;
|
|
2371
2391
|
}
|
|
2372
|
-
const { PutObjectCommand: PutCmd } = await import(
|
|
2392
|
+
const { PutObjectCommand: PutCmd } = await import(
|
|
2393
|
+
/* webpackIgnore: true */
|
|
2394
|
+
/* turbopackIgnore: true */
|
|
2395
|
+
"@aws-sdk/client-s3"
|
|
2396
|
+
);
|
|
2373
2397
|
await this.client.send(
|
|
2374
2398
|
new PutCmd({
|
|
2375
2399
|
Bucket: this.bucket,
|
|
@@ -2384,7 +2408,11 @@ var init_S3Storage = __esm({
|
|
|
2384
2408
|
return { url };
|
|
2385
2409
|
}
|
|
2386
2410
|
async download(key) {
|
|
2387
|
-
const { GetObjectCommand: GetCmd } = await import(
|
|
2411
|
+
const { GetObjectCommand: GetCmd } = await import(
|
|
2412
|
+
/* webpackIgnore: true */
|
|
2413
|
+
/* turbopackIgnore: true */
|
|
2414
|
+
"@aws-sdk/client-s3"
|
|
2415
|
+
);
|
|
2388
2416
|
const response = await this.client.send(
|
|
2389
2417
|
new GetCmd({
|
|
2390
2418
|
Bucket: this.bucket,
|
|
@@ -2405,7 +2433,11 @@ var init_S3Storage = __esm({
|
|
|
2405
2433
|
return this.createSignedUrl(key, expiresIn);
|
|
2406
2434
|
}
|
|
2407
2435
|
async createSignedUrl(key, expiresIn = 3600) {
|
|
2408
|
-
const { GetObjectCommand: GetCmd } = await import(
|
|
2436
|
+
const { GetObjectCommand: GetCmd } = await import(
|
|
2437
|
+
/* webpackIgnore: true */
|
|
2438
|
+
/* turbopackIgnore: true */
|
|
2439
|
+
"@aws-sdk/client-s3"
|
|
2440
|
+
);
|
|
2409
2441
|
const command = new GetCmd({
|
|
2410
2442
|
Bucket: this.bucket,
|
|
2411
2443
|
Key: key
|
|
@@ -2413,7 +2445,11 @@ var init_S3Storage = __esm({
|
|
|
2413
2445
|
return this.signedUrlFn(this.client, command, { expiresIn });
|
|
2414
2446
|
}
|
|
2415
2447
|
async delete(key) {
|
|
2416
|
-
const { DeleteObjectCommand: DeleteCmd } = await import(
|
|
2448
|
+
const { DeleteObjectCommand: DeleteCmd } = await import(
|
|
2449
|
+
/* webpackIgnore: true */
|
|
2450
|
+
/* turbopackIgnore: true */
|
|
2451
|
+
"@aws-sdk/client-s3"
|
|
2452
|
+
);
|
|
2417
2453
|
await this.client.send(
|
|
2418
2454
|
new DeleteCmd({
|
|
2419
2455
|
Bucket: this.bucket,
|
|
@@ -2425,7 +2461,11 @@ var init_S3Storage = __esm({
|
|
|
2425
2461
|
if (keys.length === 0) {
|
|
2426
2462
|
return;
|
|
2427
2463
|
}
|
|
2428
|
-
const { DeleteObjectsCommand: DeleteManyCmd } = await import(
|
|
2464
|
+
const { DeleteObjectsCommand: DeleteManyCmd } = await import(
|
|
2465
|
+
/* webpackIgnore: true */
|
|
2466
|
+
/* turbopackIgnore: true */
|
|
2467
|
+
"@aws-sdk/client-s3"
|
|
2468
|
+
);
|
|
2429
2469
|
await this.client.send(
|
|
2430
2470
|
new DeleteManyCmd({
|
|
2431
2471
|
Bucket: this.bucket,
|
|
@@ -2436,7 +2476,11 @@ var init_S3Storage = __esm({
|
|
|
2436
2476
|
);
|
|
2437
2477
|
}
|
|
2438
2478
|
async list(prefix) {
|
|
2439
|
-
const { ListObjectsV2Command: ListCmd } = await import(
|
|
2479
|
+
const { ListObjectsV2Command: ListCmd } = await import(
|
|
2480
|
+
/* webpackIgnore: true */
|
|
2481
|
+
/* turbopackIgnore: true */
|
|
2482
|
+
"@aws-sdk/client-s3"
|
|
2483
|
+
);
|
|
2440
2484
|
const files = [];
|
|
2441
2485
|
let continuationToken;
|
|
2442
2486
|
do {
|
|
@@ -2463,7 +2507,11 @@ var init_S3Storage = __esm({
|
|
|
2463
2507
|
}
|
|
2464
2508
|
async exists(key) {
|
|
2465
2509
|
try {
|
|
2466
|
-
const { HeadObjectCommand: HeadCmd } = await import(
|
|
2510
|
+
const { HeadObjectCommand: HeadCmd } = await import(
|
|
2511
|
+
/* webpackIgnore: true */
|
|
2512
|
+
/* turbopackIgnore: true */
|
|
2513
|
+
"@aws-sdk/client-s3"
|
|
2514
|
+
);
|
|
2467
2515
|
await this.client.send(
|
|
2468
2516
|
new HeadCmd({
|
|
2469
2517
|
Bucket: this.bucket,
|
|
@@ -2477,7 +2525,11 @@ var init_S3Storage = __esm({
|
|
|
2477
2525
|
}
|
|
2478
2526
|
async getMetadata(key) {
|
|
2479
2527
|
try {
|
|
2480
|
-
const { HeadObjectCommand: HeadCmd } = await import(
|
|
2528
|
+
const { HeadObjectCommand: HeadCmd } = await import(
|
|
2529
|
+
/* webpackIgnore: true */
|
|
2530
|
+
/* turbopackIgnore: true */
|
|
2531
|
+
"@aws-sdk/client-s3"
|
|
2532
|
+
);
|
|
2481
2533
|
const response = await this.client.send(
|
|
2482
2534
|
new HeadCmd({
|
|
2483
2535
|
Bucket: this.bucket,
|
|
@@ -2497,7 +2549,11 @@ var init_S3Storage = __esm({
|
|
|
2497
2549
|
}
|
|
2498
2550
|
async healthCheck() {
|
|
2499
2551
|
try {
|
|
2500
|
-
const { ListObjectsV2Command: ListCmd } = await import(
|
|
2552
|
+
const { ListObjectsV2Command: ListCmd } = await import(
|
|
2553
|
+
/* webpackIgnore: true */
|
|
2554
|
+
/* turbopackIgnore: true */
|
|
2555
|
+
"@aws-sdk/client-s3"
|
|
2556
|
+
);
|
|
2501
2557
|
await this.client.send(
|
|
2502
2558
|
new ListCmd({
|
|
2503
2559
|
Bucket: this.bucket,
|
|
@@ -2566,7 +2622,11 @@ var init_SmtpEmail = __esm({
|
|
|
2566
2622
|
* Initialize the SMTP transporter
|
|
2567
2623
|
*/
|
|
2568
2624
|
async initialize() {
|
|
2569
|
-
const nodemailer = await import(
|
|
2625
|
+
const nodemailer = await import(
|
|
2626
|
+
/* webpackIgnore: true */
|
|
2627
|
+
/* turbopackIgnore: true */
|
|
2628
|
+
"nodemailer"
|
|
2629
|
+
);
|
|
2570
2630
|
const options = {
|
|
2571
2631
|
host: this.config.host,
|
|
2572
2632
|
port: this.config.port,
|
|
@@ -2798,7 +2858,11 @@ var init_BullMQQueue = __esm({
|
|
|
2798
2858
|
*/
|
|
2799
2859
|
async ensureInitialized() {
|
|
2800
2860
|
if (this.initialized) return;
|
|
2801
|
-
const { Queue } = await import(
|
|
2861
|
+
const { Queue } = await import(
|
|
2862
|
+
/* webpackIgnore: true */
|
|
2863
|
+
/* turbopackIgnore: true */
|
|
2864
|
+
"bullmq"
|
|
2865
|
+
);
|
|
2802
2866
|
const connection = this.getConnectionConfig();
|
|
2803
2867
|
this.queue = new Queue(this.config.queueName, {
|
|
2804
2868
|
connection,
|
|
@@ -2872,7 +2936,11 @@ var init_BullMQQueue = __esm({
|
|
|
2872
2936
|
});
|
|
2873
2937
|
}
|
|
2874
2938
|
async startWorker(handler, concurrency) {
|
|
2875
|
-
const { Worker } = await import(
|
|
2939
|
+
const { Worker } = await import(
|
|
2940
|
+
/* webpackIgnore: true */
|
|
2941
|
+
/* turbopackIgnore: true */
|
|
2942
|
+
"bullmq"
|
|
2943
|
+
);
|
|
2876
2944
|
const connection = this.getConnectionConfig();
|
|
2877
2945
|
const worker = new Worker(
|
|
2878
2946
|
this.config.queueName,
|
|
@@ -3215,11 +3283,31 @@ var init_OpenTelemetryTracing = __esm({
|
|
|
3215
3283
|
* Create an OpenTelemetry tracing instance
|
|
3216
3284
|
*/
|
|
3217
3285
|
static async create(config) {
|
|
3218
|
-
const api = await import(
|
|
3219
|
-
|
|
3220
|
-
|
|
3221
|
-
|
|
3222
|
-
|
|
3286
|
+
const api = await import(
|
|
3287
|
+
/* webpackIgnore: true */
|
|
3288
|
+
/* turbopackIgnore: true */
|
|
3289
|
+
"@opentelemetry/api"
|
|
3290
|
+
);
|
|
3291
|
+
const { NodeTracerProvider } = await import(
|
|
3292
|
+
/* webpackIgnore: true */
|
|
3293
|
+
/* turbopackIgnore: true */
|
|
3294
|
+
"@opentelemetry/sdk-trace-node"
|
|
3295
|
+
);
|
|
3296
|
+
const { Resource } = await import(
|
|
3297
|
+
/* webpackIgnore: true */
|
|
3298
|
+
/* turbopackIgnore: true */
|
|
3299
|
+
"@opentelemetry/resources"
|
|
3300
|
+
);
|
|
3301
|
+
const semconv = await import(
|
|
3302
|
+
/* webpackIgnore: true */
|
|
3303
|
+
/* turbopackIgnore: true */
|
|
3304
|
+
"@opentelemetry/semantic-conventions"
|
|
3305
|
+
);
|
|
3306
|
+
const { BatchSpanProcessor, ConsoleSpanExporter } = await import(
|
|
3307
|
+
/* webpackIgnore: true */
|
|
3308
|
+
/* turbopackIgnore: true */
|
|
3309
|
+
"@opentelemetry/sdk-trace-base"
|
|
3310
|
+
);
|
|
3223
3311
|
const ATTR_SERVICE_NAME = semconv.ATTR_SERVICE_NAME ?? semconv.SEMRESATTRS_SERVICE_NAME ?? "service.name";
|
|
3224
3312
|
const ATTR_SERVICE_VERSION = semconv.ATTR_SERVICE_VERSION ?? semconv.SEMRESATTRS_SERVICE_VERSION ?? "service.version";
|
|
3225
3313
|
const ATTR_DEPLOYMENT_ENVIRONMENT = semconv.ATTR_DEPLOYMENT_ENVIRONMENT_NAME ?? semconv.SEMRESATTRS_DEPLOYMENT_ENVIRONMENT ?? "deployment.environment";
|
|
@@ -3239,7 +3327,11 @@ var init_OpenTelemetryTracing = __esm({
|
|
|
3239
3327
|
let exporter;
|
|
3240
3328
|
switch (config.exporterType) {
|
|
3241
3329
|
case "otlp-grpc": {
|
|
3242
|
-
const { OTLPTraceExporter } = await import(
|
|
3330
|
+
const { OTLPTraceExporter } = await import(
|
|
3331
|
+
/* webpackIgnore: true */
|
|
3332
|
+
/* turbopackIgnore: true */
|
|
3333
|
+
"@opentelemetry/exporter-trace-otlp-grpc"
|
|
3334
|
+
);
|
|
3243
3335
|
exporter = new OTLPTraceExporter({
|
|
3244
3336
|
url: config.endpoint
|
|
3245
3337
|
});
|
|
@@ -3250,7 +3342,11 @@ var init_OpenTelemetryTracing = __esm({
|
|
|
3250
3342
|
break;
|
|
3251
3343
|
case "otlp-http":
|
|
3252
3344
|
default: {
|
|
3253
|
-
const { OTLPTraceExporter } = await import(
|
|
3345
|
+
const { OTLPTraceExporter } = await import(
|
|
3346
|
+
/* webpackIgnore: true */
|
|
3347
|
+
/* turbopackIgnore: true */
|
|
3348
|
+
"@opentelemetry/exporter-trace-otlp-http"
|
|
3349
|
+
);
|
|
3254
3350
|
exporter = new OTLPTraceExporter({
|
|
3255
3351
|
url: config.endpoint || "http://localhost:4318/v1/traces"
|
|
3256
3352
|
});
|
|
@@ -3566,7 +3662,11 @@ var init_OpenAIAdapter = __esm({
|
|
|
3566
3662
|
*/
|
|
3567
3663
|
async getClient() {
|
|
3568
3664
|
if (!this.client) {
|
|
3569
|
-
const { default: OpenAI } = await import(
|
|
3665
|
+
const { default: OpenAI } = await import(
|
|
3666
|
+
/* webpackIgnore: true */
|
|
3667
|
+
/* turbopackIgnore: true */
|
|
3668
|
+
"openai"
|
|
3669
|
+
);
|
|
3570
3670
|
this.client = new OpenAI({
|
|
3571
3671
|
apiKey: this.config.apiKey,
|
|
3572
3672
|
organization: this.config.organization,
|
|
@@ -4230,7 +4330,11 @@ var init_AnthropicAdapter = __esm({
|
|
|
4230
4330
|
*/
|
|
4231
4331
|
async getClient() {
|
|
4232
4332
|
if (!this.client) {
|
|
4233
|
-
const { default: Anthropic } = await import(
|
|
4333
|
+
const { default: Anthropic } = await import(
|
|
4334
|
+
/* webpackIgnore: true */
|
|
4335
|
+
/* turbopackIgnore: true */
|
|
4336
|
+
"@anthropic-ai/sdk"
|
|
4337
|
+
);
|
|
4234
4338
|
this.client = new Anthropic({
|
|
4235
4339
|
apiKey: this.config.apiKey,
|
|
4236
4340
|
baseURL: this.config.baseURL,
|
|
@@ -4940,7 +5044,11 @@ var init_GoogleAIAdapter = __esm({
|
|
|
4940
5044
|
*/
|
|
4941
5045
|
async getClient() {
|
|
4942
5046
|
if (!this.client) {
|
|
4943
|
-
const { GoogleGenerativeAI } = await import(
|
|
5047
|
+
const { GoogleGenerativeAI } = await import(
|
|
5048
|
+
/* webpackIgnore: true */
|
|
5049
|
+
/* turbopackIgnore: true */
|
|
5050
|
+
"@google/generative-ai"
|
|
5051
|
+
);
|
|
4944
5052
|
this.client = new GoogleGenerativeAI(this.config.apiKey);
|
|
4945
5053
|
}
|
|
4946
5054
|
return this.client;
|
|
@@ -5494,7 +5602,11 @@ var init_PineconeRAG = __esm({
|
|
|
5494
5602
|
*/
|
|
5495
5603
|
async getClient() {
|
|
5496
5604
|
if (!this.client) {
|
|
5497
|
-
const { Pinecone } = await import(
|
|
5605
|
+
const { Pinecone } = await import(
|
|
5606
|
+
/* webpackIgnore: true */
|
|
5607
|
+
/* turbopackIgnore: true */
|
|
5608
|
+
"@pinecone-database/pinecone"
|
|
5609
|
+
);
|
|
5498
5610
|
this.client = new Pinecone({
|
|
5499
5611
|
apiKey: this.config.apiKey
|
|
5500
5612
|
});
|
|
@@ -6215,7 +6327,11 @@ var init_WeaviateRAG = __esm({
|
|
|
6215
6327
|
*/
|
|
6216
6328
|
async getClient() {
|
|
6217
6329
|
if (!this.client) {
|
|
6218
|
-
const weaviate = await import(
|
|
6330
|
+
const weaviate = await import(
|
|
6331
|
+
/* webpackIgnore: true */
|
|
6332
|
+
/* turbopackIgnore: true */
|
|
6333
|
+
"weaviate-client"
|
|
6334
|
+
);
|
|
6219
6335
|
if (this.config.apiKey) {
|
|
6220
6336
|
this.client = await weaviate.connectToWeaviateCloud(this.config.host, {
|
|
6221
6337
|
authCredentials: new weaviate.ApiKey(this.config.apiKey),
|