@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.mjs
CHANGED
|
@@ -1108,7 +1108,11 @@ var init_PostgresDatabase = __esm({
|
|
|
1108
1108
|
* Create a PostgresDatabase from configuration
|
|
1109
1109
|
*/
|
|
1110
1110
|
static async create(config) {
|
|
1111
|
-
const { Pool } = await import(
|
|
1111
|
+
const { Pool } = await import(
|
|
1112
|
+
/* webpackIgnore: true */
|
|
1113
|
+
/* turbopackIgnore: true */
|
|
1114
|
+
"pg"
|
|
1115
|
+
);
|
|
1112
1116
|
const poolConfig = toPoolConfig(config);
|
|
1113
1117
|
const pool = new Pool(poolConfig);
|
|
1114
1118
|
const client = await pool.connect();
|
|
@@ -1745,10 +1749,18 @@ var init_RedisCache = __esm({
|
|
|
1745
1749
|
* Create a RedisCache from configuration
|
|
1746
1750
|
*/
|
|
1747
1751
|
static async create(config) {
|
|
1748
|
-
const { default: Redis2 } = await import(
|
|
1752
|
+
const { default: Redis2 } = await import(
|
|
1753
|
+
/* webpackIgnore: true */
|
|
1754
|
+
/* turbopackIgnore: true */
|
|
1755
|
+
"ioredis"
|
|
1756
|
+
);
|
|
1749
1757
|
let client;
|
|
1750
1758
|
if (config.cluster) {
|
|
1751
|
-
const { Cluster } = await import(
|
|
1759
|
+
const { Cluster } = await import(
|
|
1760
|
+
/* webpackIgnore: true */
|
|
1761
|
+
/* turbopackIgnore: true */
|
|
1762
|
+
"ioredis"
|
|
1763
|
+
);
|
|
1752
1764
|
client = new Cluster(config.cluster.nodes, {
|
|
1753
1765
|
scaleReads: config.cluster.options?.scaleReads ?? "master",
|
|
1754
1766
|
maxRedirections: config.cluster.options?.maxRedirections ?? 16,
|
|
@@ -1901,7 +1913,11 @@ var init_RedisCache = __esm({
|
|
|
1901
1913
|
}
|
|
1902
1914
|
async subscribe(channel, callback) {
|
|
1903
1915
|
if (!this.subscriberClient) {
|
|
1904
|
-
const { default: Redis2 } = await import(
|
|
1916
|
+
const { default: Redis2 } = await import(
|
|
1917
|
+
/* webpackIgnore: true */
|
|
1918
|
+
/* turbopackIgnore: true */
|
|
1919
|
+
"ioredis"
|
|
1920
|
+
);
|
|
1905
1921
|
const options = toIORedisOptions(this.config);
|
|
1906
1922
|
this.subscriberClient = typeof options === "string" ? new Redis2(options) : new Redis2(options);
|
|
1907
1923
|
this.subscriberClient.on("message", (ch, message) => {
|
|
@@ -2125,7 +2141,11 @@ var init_SupabaseStorage = __esm({
|
|
|
2125
2141
|
* Create a SupabaseStorage adapter from configuration
|
|
2126
2142
|
*/
|
|
2127
2143
|
static async create(config) {
|
|
2128
|
-
const { createClient } = await import(
|
|
2144
|
+
const { createClient } = await import(
|
|
2145
|
+
/* webpackIgnore: true */
|
|
2146
|
+
/* turbopackIgnore: true */
|
|
2147
|
+
"@supabase/supabase-js"
|
|
2148
|
+
);
|
|
2129
2149
|
const client = createClient(config.url, config.apiKey);
|
|
2130
2150
|
return new _SupabaseStorage(client, {
|
|
2131
2151
|
bucket: config.bucket,
|
|
@@ -2353,7 +2373,11 @@ var init_S3Storage = __esm({
|
|
|
2353
2373
|
} else {
|
|
2354
2374
|
body = data;
|
|
2355
2375
|
}
|
|
2356
|
-
const { PutObjectCommand: PutCmd } = await import(
|
|
2376
|
+
const { PutObjectCommand: PutCmd } = await import(
|
|
2377
|
+
/* webpackIgnore: true */
|
|
2378
|
+
/* turbopackIgnore: true */
|
|
2379
|
+
"@aws-sdk/client-s3"
|
|
2380
|
+
);
|
|
2357
2381
|
await this.client.send(
|
|
2358
2382
|
new PutCmd({
|
|
2359
2383
|
Bucket: this.bucket,
|
|
@@ -2368,7 +2392,11 @@ var init_S3Storage = __esm({
|
|
|
2368
2392
|
return { url };
|
|
2369
2393
|
}
|
|
2370
2394
|
async download(key) {
|
|
2371
|
-
const { GetObjectCommand: GetCmd } = await import(
|
|
2395
|
+
const { GetObjectCommand: GetCmd } = await import(
|
|
2396
|
+
/* webpackIgnore: true */
|
|
2397
|
+
/* turbopackIgnore: true */
|
|
2398
|
+
"@aws-sdk/client-s3"
|
|
2399
|
+
);
|
|
2372
2400
|
const response = await this.client.send(
|
|
2373
2401
|
new GetCmd({
|
|
2374
2402
|
Bucket: this.bucket,
|
|
@@ -2389,7 +2417,11 @@ var init_S3Storage = __esm({
|
|
|
2389
2417
|
return this.createSignedUrl(key, expiresIn);
|
|
2390
2418
|
}
|
|
2391
2419
|
async createSignedUrl(key, expiresIn = 3600) {
|
|
2392
|
-
const { GetObjectCommand: GetCmd } = await import(
|
|
2420
|
+
const { GetObjectCommand: GetCmd } = await import(
|
|
2421
|
+
/* webpackIgnore: true */
|
|
2422
|
+
/* turbopackIgnore: true */
|
|
2423
|
+
"@aws-sdk/client-s3"
|
|
2424
|
+
);
|
|
2393
2425
|
const command = new GetCmd({
|
|
2394
2426
|
Bucket: this.bucket,
|
|
2395
2427
|
Key: key
|
|
@@ -2397,7 +2429,11 @@ var init_S3Storage = __esm({
|
|
|
2397
2429
|
return this.signedUrlFn(this.client, command, { expiresIn });
|
|
2398
2430
|
}
|
|
2399
2431
|
async delete(key) {
|
|
2400
|
-
const { DeleteObjectCommand: DeleteCmd } = await import(
|
|
2432
|
+
const { DeleteObjectCommand: DeleteCmd } = await import(
|
|
2433
|
+
/* webpackIgnore: true */
|
|
2434
|
+
/* turbopackIgnore: true */
|
|
2435
|
+
"@aws-sdk/client-s3"
|
|
2436
|
+
);
|
|
2401
2437
|
await this.client.send(
|
|
2402
2438
|
new DeleteCmd({
|
|
2403
2439
|
Bucket: this.bucket,
|
|
@@ -2409,7 +2445,11 @@ var init_S3Storage = __esm({
|
|
|
2409
2445
|
if (keys.length === 0) {
|
|
2410
2446
|
return;
|
|
2411
2447
|
}
|
|
2412
|
-
const { DeleteObjectsCommand: DeleteManyCmd } = await import(
|
|
2448
|
+
const { DeleteObjectsCommand: DeleteManyCmd } = await import(
|
|
2449
|
+
/* webpackIgnore: true */
|
|
2450
|
+
/* turbopackIgnore: true */
|
|
2451
|
+
"@aws-sdk/client-s3"
|
|
2452
|
+
);
|
|
2413
2453
|
await this.client.send(
|
|
2414
2454
|
new DeleteManyCmd({
|
|
2415
2455
|
Bucket: this.bucket,
|
|
@@ -2420,7 +2460,11 @@ var init_S3Storage = __esm({
|
|
|
2420
2460
|
);
|
|
2421
2461
|
}
|
|
2422
2462
|
async list(prefix) {
|
|
2423
|
-
const { ListObjectsV2Command: ListCmd } = await import(
|
|
2463
|
+
const { ListObjectsV2Command: ListCmd } = await import(
|
|
2464
|
+
/* webpackIgnore: true */
|
|
2465
|
+
/* turbopackIgnore: true */
|
|
2466
|
+
"@aws-sdk/client-s3"
|
|
2467
|
+
);
|
|
2424
2468
|
const files = [];
|
|
2425
2469
|
let continuationToken;
|
|
2426
2470
|
do {
|
|
@@ -2447,7 +2491,11 @@ var init_S3Storage = __esm({
|
|
|
2447
2491
|
}
|
|
2448
2492
|
async exists(key) {
|
|
2449
2493
|
try {
|
|
2450
|
-
const { HeadObjectCommand: HeadCmd } = await import(
|
|
2494
|
+
const { HeadObjectCommand: HeadCmd } = await import(
|
|
2495
|
+
/* webpackIgnore: true */
|
|
2496
|
+
/* turbopackIgnore: true */
|
|
2497
|
+
"@aws-sdk/client-s3"
|
|
2498
|
+
);
|
|
2451
2499
|
await this.client.send(
|
|
2452
2500
|
new HeadCmd({
|
|
2453
2501
|
Bucket: this.bucket,
|
|
@@ -2461,7 +2509,11 @@ var init_S3Storage = __esm({
|
|
|
2461
2509
|
}
|
|
2462
2510
|
async getMetadata(key) {
|
|
2463
2511
|
try {
|
|
2464
|
-
const { HeadObjectCommand: HeadCmd } = await import(
|
|
2512
|
+
const { HeadObjectCommand: HeadCmd } = await import(
|
|
2513
|
+
/* webpackIgnore: true */
|
|
2514
|
+
/* turbopackIgnore: true */
|
|
2515
|
+
"@aws-sdk/client-s3"
|
|
2516
|
+
);
|
|
2465
2517
|
const response = await this.client.send(
|
|
2466
2518
|
new HeadCmd({
|
|
2467
2519
|
Bucket: this.bucket,
|
|
@@ -2481,7 +2533,11 @@ var init_S3Storage = __esm({
|
|
|
2481
2533
|
}
|
|
2482
2534
|
async healthCheck() {
|
|
2483
2535
|
try {
|
|
2484
|
-
const { ListObjectsV2Command: ListCmd } = await import(
|
|
2536
|
+
const { ListObjectsV2Command: ListCmd } = await import(
|
|
2537
|
+
/* webpackIgnore: true */
|
|
2538
|
+
/* turbopackIgnore: true */
|
|
2539
|
+
"@aws-sdk/client-s3"
|
|
2540
|
+
);
|
|
2485
2541
|
await this.client.send(
|
|
2486
2542
|
new ListCmd({
|
|
2487
2543
|
Bucket: this.bucket,
|
|
@@ -2550,7 +2606,11 @@ var init_SmtpEmail = __esm({
|
|
|
2550
2606
|
* Initialize the SMTP transporter
|
|
2551
2607
|
*/
|
|
2552
2608
|
async initialize() {
|
|
2553
|
-
const nodemailer = await import(
|
|
2609
|
+
const nodemailer = await import(
|
|
2610
|
+
/* webpackIgnore: true */
|
|
2611
|
+
/* turbopackIgnore: true */
|
|
2612
|
+
"nodemailer"
|
|
2613
|
+
);
|
|
2554
2614
|
const options = {
|
|
2555
2615
|
host: this.config.host,
|
|
2556
2616
|
port: this.config.port,
|
|
@@ -2782,7 +2842,11 @@ var init_BullMQQueue = __esm({
|
|
|
2782
2842
|
*/
|
|
2783
2843
|
async ensureInitialized() {
|
|
2784
2844
|
if (this.initialized) return;
|
|
2785
|
-
const { Queue } = await import(
|
|
2845
|
+
const { Queue } = await import(
|
|
2846
|
+
/* webpackIgnore: true */
|
|
2847
|
+
/* turbopackIgnore: true */
|
|
2848
|
+
"bullmq"
|
|
2849
|
+
);
|
|
2786
2850
|
const connection = this.getConnectionConfig();
|
|
2787
2851
|
this.queue = new Queue(this.config.queueName, {
|
|
2788
2852
|
connection,
|
|
@@ -2856,7 +2920,11 @@ var init_BullMQQueue = __esm({
|
|
|
2856
2920
|
});
|
|
2857
2921
|
}
|
|
2858
2922
|
async startWorker(handler, concurrency) {
|
|
2859
|
-
const { Worker } = await import(
|
|
2923
|
+
const { Worker } = await import(
|
|
2924
|
+
/* webpackIgnore: true */
|
|
2925
|
+
/* turbopackIgnore: true */
|
|
2926
|
+
"bullmq"
|
|
2927
|
+
);
|
|
2860
2928
|
const connection = this.getConnectionConfig();
|
|
2861
2929
|
const worker = new Worker(
|
|
2862
2930
|
this.config.queueName,
|
|
@@ -3199,11 +3267,31 @@ var init_OpenTelemetryTracing = __esm({
|
|
|
3199
3267
|
* Create an OpenTelemetry tracing instance
|
|
3200
3268
|
*/
|
|
3201
3269
|
static async create(config) {
|
|
3202
|
-
const api = await import(
|
|
3203
|
-
|
|
3204
|
-
|
|
3205
|
-
|
|
3206
|
-
|
|
3270
|
+
const api = await import(
|
|
3271
|
+
/* webpackIgnore: true */
|
|
3272
|
+
/* turbopackIgnore: true */
|
|
3273
|
+
"@opentelemetry/api"
|
|
3274
|
+
);
|
|
3275
|
+
const { NodeTracerProvider } = await import(
|
|
3276
|
+
/* webpackIgnore: true */
|
|
3277
|
+
/* turbopackIgnore: true */
|
|
3278
|
+
"@opentelemetry/sdk-trace-node"
|
|
3279
|
+
);
|
|
3280
|
+
const { Resource } = await import(
|
|
3281
|
+
/* webpackIgnore: true */
|
|
3282
|
+
/* turbopackIgnore: true */
|
|
3283
|
+
"@opentelemetry/resources"
|
|
3284
|
+
);
|
|
3285
|
+
const semconv = await import(
|
|
3286
|
+
/* webpackIgnore: true */
|
|
3287
|
+
/* turbopackIgnore: true */
|
|
3288
|
+
"@opentelemetry/semantic-conventions"
|
|
3289
|
+
);
|
|
3290
|
+
const { BatchSpanProcessor, ConsoleSpanExporter } = await import(
|
|
3291
|
+
/* webpackIgnore: true */
|
|
3292
|
+
/* turbopackIgnore: true */
|
|
3293
|
+
"@opentelemetry/sdk-trace-base"
|
|
3294
|
+
);
|
|
3207
3295
|
const ATTR_SERVICE_NAME = semconv.ATTR_SERVICE_NAME ?? semconv.SEMRESATTRS_SERVICE_NAME ?? "service.name";
|
|
3208
3296
|
const ATTR_SERVICE_VERSION = semconv.ATTR_SERVICE_VERSION ?? semconv.SEMRESATTRS_SERVICE_VERSION ?? "service.version";
|
|
3209
3297
|
const ATTR_DEPLOYMENT_ENVIRONMENT = semconv.ATTR_DEPLOYMENT_ENVIRONMENT_NAME ?? semconv.SEMRESATTRS_DEPLOYMENT_ENVIRONMENT ?? "deployment.environment";
|
|
@@ -3223,7 +3311,11 @@ var init_OpenTelemetryTracing = __esm({
|
|
|
3223
3311
|
let exporter;
|
|
3224
3312
|
switch (config.exporterType) {
|
|
3225
3313
|
case "otlp-grpc": {
|
|
3226
|
-
const { OTLPTraceExporter } = await import(
|
|
3314
|
+
const { OTLPTraceExporter } = await import(
|
|
3315
|
+
/* webpackIgnore: true */
|
|
3316
|
+
/* turbopackIgnore: true */
|
|
3317
|
+
"@opentelemetry/exporter-trace-otlp-grpc"
|
|
3318
|
+
);
|
|
3227
3319
|
exporter = new OTLPTraceExporter({
|
|
3228
3320
|
url: config.endpoint
|
|
3229
3321
|
});
|
|
@@ -3234,7 +3326,11 @@ var init_OpenTelemetryTracing = __esm({
|
|
|
3234
3326
|
break;
|
|
3235
3327
|
case "otlp-http":
|
|
3236
3328
|
default: {
|
|
3237
|
-
const { OTLPTraceExporter } = await import(
|
|
3329
|
+
const { OTLPTraceExporter } = await import(
|
|
3330
|
+
/* webpackIgnore: true */
|
|
3331
|
+
/* turbopackIgnore: true */
|
|
3332
|
+
"@opentelemetry/exporter-trace-otlp-http"
|
|
3333
|
+
);
|
|
3238
3334
|
exporter = new OTLPTraceExporter({
|
|
3239
3335
|
url: config.endpoint || "http://localhost:4318/v1/traces"
|
|
3240
3336
|
});
|
|
@@ -3550,7 +3646,11 @@ var init_OpenAIAdapter = __esm({
|
|
|
3550
3646
|
*/
|
|
3551
3647
|
async getClient() {
|
|
3552
3648
|
if (!this.client) {
|
|
3553
|
-
const { default: OpenAI } = await import(
|
|
3649
|
+
const { default: OpenAI } = await import(
|
|
3650
|
+
/* webpackIgnore: true */
|
|
3651
|
+
/* turbopackIgnore: true */
|
|
3652
|
+
"openai"
|
|
3653
|
+
);
|
|
3554
3654
|
this.client = new OpenAI({
|
|
3555
3655
|
apiKey: this.config.apiKey,
|
|
3556
3656
|
organization: this.config.organization,
|
|
@@ -4214,7 +4314,11 @@ var init_AnthropicAdapter = __esm({
|
|
|
4214
4314
|
*/
|
|
4215
4315
|
async getClient() {
|
|
4216
4316
|
if (!this.client) {
|
|
4217
|
-
const { default: Anthropic } = await import(
|
|
4317
|
+
const { default: Anthropic } = await import(
|
|
4318
|
+
/* webpackIgnore: true */
|
|
4319
|
+
/* turbopackIgnore: true */
|
|
4320
|
+
"@anthropic-ai/sdk"
|
|
4321
|
+
);
|
|
4218
4322
|
this.client = new Anthropic({
|
|
4219
4323
|
apiKey: this.config.apiKey,
|
|
4220
4324
|
baseURL: this.config.baseURL,
|
|
@@ -4924,7 +5028,11 @@ var init_GoogleAIAdapter = __esm({
|
|
|
4924
5028
|
*/
|
|
4925
5029
|
async getClient() {
|
|
4926
5030
|
if (!this.client) {
|
|
4927
|
-
const { GoogleGenerativeAI } = await import(
|
|
5031
|
+
const { GoogleGenerativeAI } = await import(
|
|
5032
|
+
/* webpackIgnore: true */
|
|
5033
|
+
/* turbopackIgnore: true */
|
|
5034
|
+
"@google/generative-ai"
|
|
5035
|
+
);
|
|
4928
5036
|
this.client = new GoogleGenerativeAI(this.config.apiKey);
|
|
4929
5037
|
}
|
|
4930
5038
|
return this.client;
|
|
@@ -5478,7 +5586,11 @@ var init_PineconeRAG = __esm({
|
|
|
5478
5586
|
*/
|
|
5479
5587
|
async getClient() {
|
|
5480
5588
|
if (!this.client) {
|
|
5481
|
-
const { Pinecone } = await import(
|
|
5589
|
+
const { Pinecone } = await import(
|
|
5590
|
+
/* webpackIgnore: true */
|
|
5591
|
+
/* turbopackIgnore: true */
|
|
5592
|
+
"@pinecone-database/pinecone"
|
|
5593
|
+
);
|
|
5482
5594
|
this.client = new Pinecone({
|
|
5483
5595
|
apiKey: this.config.apiKey
|
|
5484
5596
|
});
|
|
@@ -6199,7 +6311,11 @@ var init_WeaviateRAG = __esm({
|
|
|
6199
6311
|
*/
|
|
6200
6312
|
async getClient() {
|
|
6201
6313
|
if (!this.client) {
|
|
6202
|
-
const weaviate = await import(
|
|
6314
|
+
const weaviate = await import(
|
|
6315
|
+
/* webpackIgnore: true */
|
|
6316
|
+
/* turbopackIgnore: true */
|
|
6317
|
+
"weaviate-client"
|
|
6318
|
+
);
|
|
6203
6319
|
if (this.config.apiKey) {
|
|
6204
6320
|
this.client = await weaviate.connectToWeaviateCloud(this.config.host, {
|
|
6205
6321
|
authCredentials: new weaviate.ApiKey(this.config.apiKey),
|