@absolutejs/voice 0.0.22-beta.110 → 0.0.22-beta.112
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/campaign.d.ts +37 -0
- package/dist/index.d.ts +3 -3
- package/dist/index.js +113 -0
- package/dist/postgresStore.d.ts +3 -0
- package/dist/sqliteStore.d.ts +3 -0
- package/package.json +1 -1
package/dist/campaign.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { Elysia } from 'elysia';
|
|
2
|
+
import type { VoiceRedisTaskLeaseCoordinator } from './queue';
|
|
2
3
|
export type VoiceCampaignStatus = 'canceled' | 'completed' | 'draft' | 'paused' | 'running';
|
|
3
4
|
export type VoiceCampaignRecipientStatus = 'canceled' | 'completed' | 'failed' | 'pending' | 'queued';
|
|
4
5
|
export type VoiceCampaignAttemptStatus = 'canceled' | 'failed' | 'queued' | 'running' | 'succeeded';
|
|
@@ -157,9 +158,45 @@ export type VoiceCampaignRoutesOptions = VoiceCampaignRuntimeOptions & {
|
|
|
157
158
|
path?: string;
|
|
158
159
|
title?: string;
|
|
159
160
|
};
|
|
161
|
+
export type VoiceCampaignWorkerOptions = {
|
|
162
|
+
campaignIds?: string[];
|
|
163
|
+
leaseMs?: number;
|
|
164
|
+
leases: VoiceRedisTaskLeaseCoordinator;
|
|
165
|
+
maxCampaigns?: number;
|
|
166
|
+
runtime?: VoiceCampaignRuntime;
|
|
167
|
+
statuses?: VoiceCampaignStatus[];
|
|
168
|
+
store?: VoiceCampaignStore;
|
|
169
|
+
workerId: string;
|
|
170
|
+
};
|
|
171
|
+
export type VoiceCampaignWorkerResult = {
|
|
172
|
+
attempted: number;
|
|
173
|
+
campaigns: number;
|
|
174
|
+
errors: Array<{
|
|
175
|
+
campaignId: string;
|
|
176
|
+
error: string;
|
|
177
|
+
}>;
|
|
178
|
+
skipped: number;
|
|
179
|
+
started: VoiceCampaignAttempt[];
|
|
180
|
+
};
|
|
181
|
+
export type VoiceCampaignWorker = {
|
|
182
|
+
drain: () => Promise<VoiceCampaignWorkerResult>;
|
|
183
|
+
};
|
|
184
|
+
export type VoiceCampaignWorkerLoopOptions = {
|
|
185
|
+
onError?: (error: unknown) => void | Promise<void>;
|
|
186
|
+
pollIntervalMs?: number;
|
|
187
|
+
worker: VoiceCampaignWorker;
|
|
188
|
+
};
|
|
189
|
+
export type VoiceCampaignWorkerLoop = {
|
|
190
|
+
isRunning: () => boolean;
|
|
191
|
+
start: () => void;
|
|
192
|
+
stop: () => void;
|
|
193
|
+
tick: () => Promise<VoiceCampaignWorkerResult>;
|
|
194
|
+
};
|
|
160
195
|
export declare const createVoiceMemoryCampaignStore: () => VoiceCampaignStore;
|
|
161
196
|
export declare const summarizeVoiceCampaigns: (records: VoiceCampaignRecord[]) => VoiceCampaignSummary;
|
|
162
197
|
export declare const createVoiceCampaign: (options: VoiceCampaignRuntimeOptions) => VoiceCampaignRuntime;
|
|
198
|
+
export declare const createVoiceCampaignWorker: (options: VoiceCampaignWorkerOptions) => VoiceCampaignWorker;
|
|
199
|
+
export declare const createVoiceCampaignWorkerLoop: (options: VoiceCampaignWorkerLoopOptions) => VoiceCampaignWorkerLoop;
|
|
163
200
|
export declare const runVoiceCampaignProof: (options?: VoiceCampaignProofOptions) => Promise<VoiceCampaignProofReport>;
|
|
164
201
|
export declare const renderVoiceCampaignsHTML: (records: VoiceCampaignRecord[], options?: {
|
|
165
202
|
title?: string;
|
package/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export { voice } from './plugin';
|
|
2
2
|
export { createVoiceAppKit, createVoiceAppKitRoutes, summarizeVoiceAppKitStatus } from './appKit';
|
|
3
|
-
export { createVoiceCampaign, createVoiceCampaignRoutes, createVoiceMemoryCampaignStore, renderVoiceCampaignsHTML, runVoiceCampaignProof, summarizeVoiceCampaigns } from './campaign';
|
|
3
|
+
export { createVoiceCampaign, createVoiceCampaignRoutes, createVoiceCampaignWorker, createVoiceCampaignWorkerLoop, createVoiceMemoryCampaignStore, renderVoiceCampaignsHTML, runVoiceCampaignProof, summarizeVoiceCampaigns } from './campaign';
|
|
4
4
|
export { createVoiceAssistant, createVoiceExperiment, summarizeVoiceAssistantRuns } from './assistant';
|
|
5
5
|
export { createVoiceAssistantHealthHTMLHandler, createVoiceAssistantHealthJSONHandler, createVoiceAssistantHealthRoutes, renderVoiceAssistantHealthHTML, summarizeVoiceAssistantHealth } from './assistantHealth';
|
|
6
6
|
export { createVoiceBargeInRoutes, renderVoiceBargeInHTML, summarizeVoiceBargeIn } from './bargeInRoutes';
|
|
@@ -31,8 +31,8 @@ export { createVoiceResilienceRoutes, createVoiceRoutingDecisionSummary, listVoi
|
|
|
31
31
|
export { createVoiceSTTProviderRouter, createVoiceTTSProviderRouter } from './providerAdapters';
|
|
32
32
|
export { buildVoiceTraceReplay, createVoiceMemoryTraceSinkDeliveryStore, createVoiceTraceHTTPSink, createVoiceMemoryTraceEventStore, createVoiceTraceSinkDeliveryId, createVoiceTraceSinkDeliveryRecord, createVoiceTraceSinkStore, createVoiceTraceEvent, createVoiceTraceEventId, deliverVoiceTraceEventsToSinks, evaluateVoiceTrace, exportVoiceTrace, filterVoiceTraceEvents, pruneVoiceTraceEvents, redactVoiceTraceEvent, redactVoiceTraceEvents, redactVoiceTraceText, renderVoiceTraceHTML, renderVoiceTraceMarkdown, resolveVoiceTraceRedactionOptions, selectVoiceTraceEventsForPrune, summarizeVoiceTrace } from './trace';
|
|
33
33
|
export { createVoiceTraceTimelineRoutes, renderVoiceTraceTimelineHTML, renderVoiceTraceTimelineSessionHTML, summarizeVoiceTraceTimeline } from './traceTimeline';
|
|
34
|
-
export { createVoiceSQLiteExternalObjectMapStore, createVoiceSQLiteIntegrationEventStore, createVoiceSQLiteReviewStore, createVoiceSQLiteRuntimeStorage, createVoiceSQLiteSessionStore, createVoiceSQLiteTaskStore, createVoiceSQLiteTelephonyWebhookIdempotencyStore, createVoiceSQLiteTraceSinkDeliveryStore, createVoiceSQLiteTraceEventStore } from './sqliteStore';
|
|
35
|
-
export { createVoicePostgresExternalObjectMapStore, createVoicePostgresIntegrationEventStore, createVoicePostgresReviewStore, createVoicePostgresRuntimeStorage, createVoicePostgresSessionStore, createVoicePostgresTaskStore, createVoicePostgresTelephonyWebhookIdempotencyStore, createVoicePostgresTraceSinkDeliveryStore, createVoicePostgresTraceEventStore } from './postgresStore';
|
|
34
|
+
export { createVoiceSQLiteCampaignStore, createVoiceSQLiteExternalObjectMapStore, createVoiceSQLiteIntegrationEventStore, createVoiceSQLiteReviewStore, createVoiceSQLiteRuntimeStorage, createVoiceSQLiteSessionStore, createVoiceSQLiteTaskStore, createVoiceSQLiteTelephonyWebhookIdempotencyStore, createVoiceSQLiteTraceSinkDeliveryStore, createVoiceSQLiteTraceEventStore } from './sqliteStore';
|
|
35
|
+
export { createVoicePostgresCampaignStore, createVoicePostgresExternalObjectMapStore, createVoicePostgresIntegrationEventStore, createVoicePostgresReviewStore, createVoicePostgresRuntimeStorage, createVoicePostgresSessionStore, createVoicePostgresTaskStore, createVoicePostgresTelephonyWebhookIdempotencyStore, createVoicePostgresTraceSinkDeliveryStore, createVoicePostgresTraceEventStore } from './postgresStore';
|
|
36
36
|
export { createVoiceS3ReviewStore } from './s3Store';
|
|
37
37
|
export { createVoiceMemoryStore } from './memoryStore';
|
|
38
38
|
export { createVoiceCRMActivitySink, createVoiceHelpdeskTicketSink, createVoiceIntegrationHTTPSink, createVoiceHubSpotTaskSink, createVoiceHubSpotTaskSyncSinks, createVoiceHubSpotTaskUpdateSink, createVoiceLinearIssueSink, createVoiceLinearIssueSyncSinks, createVoiceLinearIssueUpdateSink, createVoiceZendeskTicketSink, createVoiceZendeskTicketSyncSinks, createVoiceZendeskTicketUpdateSink, deliverVoiceIntegrationEventToSinks } from './opsSinks';
|
package/dist/index.js
CHANGED
|
@@ -10794,6 +10794,90 @@ var createVoiceCampaign = (options) => {
|
|
|
10794
10794
|
}
|
|
10795
10795
|
};
|
|
10796
10796
|
};
|
|
10797
|
+
var getCampaignLeaseTaskId = (campaignId) => `voice-campaign:${campaignId}`;
|
|
10798
|
+
var createVoiceCampaignWorker = (options) => {
|
|
10799
|
+
const leaseMs = Math.max(1, options.leaseMs ?? 30000);
|
|
10800
|
+
const runtime = options.runtime ?? createVoiceCampaign({
|
|
10801
|
+
store: options.store ?? createVoiceMemoryCampaignStore()
|
|
10802
|
+
});
|
|
10803
|
+
const statuses = options.statuses ?? ["running"];
|
|
10804
|
+
const campaignIds = new Set(options.campaignIds);
|
|
10805
|
+
const maxCampaigns = Math.max(1, options.maxCampaigns ?? Number.MAX_SAFE_INTEGER);
|
|
10806
|
+
return {
|
|
10807
|
+
drain: async () => {
|
|
10808
|
+
const result = {
|
|
10809
|
+
attempted: 0,
|
|
10810
|
+
campaigns: 0,
|
|
10811
|
+
errors: [],
|
|
10812
|
+
skipped: 0,
|
|
10813
|
+
started: []
|
|
10814
|
+
};
|
|
10815
|
+
const campaigns = [...await runtime.list()].filter((record) => (campaignIds.size === 0 || campaignIds.has(record.campaign.id)) && statuses.includes(record.campaign.status)).sort((left, right) => left.campaign.createdAt - right.campaign.createdAt).slice(0, maxCampaigns);
|
|
10816
|
+
for (const record of campaigns) {
|
|
10817
|
+
const campaignId = record.campaign.id;
|
|
10818
|
+
const taskId = getCampaignLeaseTaskId(campaignId);
|
|
10819
|
+
const claimed = await options.leases.claim({
|
|
10820
|
+
leaseMs,
|
|
10821
|
+
taskId,
|
|
10822
|
+
workerId: options.workerId
|
|
10823
|
+
});
|
|
10824
|
+
if (!claimed) {
|
|
10825
|
+
result.skipped += 1;
|
|
10826
|
+
continue;
|
|
10827
|
+
}
|
|
10828
|
+
try {
|
|
10829
|
+
const tick = await runtime.tick(campaignId);
|
|
10830
|
+
result.campaigns += 1;
|
|
10831
|
+
result.attempted += tick.attempted;
|
|
10832
|
+
result.started.push(...tick.started);
|
|
10833
|
+
result.errors.push(...tick.errors.map((error) => ({
|
|
10834
|
+
campaignId,
|
|
10835
|
+
error: error.error
|
|
10836
|
+
})));
|
|
10837
|
+
} catch (error) {
|
|
10838
|
+
result.errors.push({
|
|
10839
|
+
campaignId,
|
|
10840
|
+
error: error instanceof Error ? error.message : String(error)
|
|
10841
|
+
});
|
|
10842
|
+
} finally {
|
|
10843
|
+
await options.leases.release({
|
|
10844
|
+
taskId,
|
|
10845
|
+
workerId: options.workerId
|
|
10846
|
+
});
|
|
10847
|
+
}
|
|
10848
|
+
}
|
|
10849
|
+
return result;
|
|
10850
|
+
}
|
|
10851
|
+
};
|
|
10852
|
+
};
|
|
10853
|
+
var createVoiceCampaignWorkerLoop = (options) => {
|
|
10854
|
+
const pollIntervalMs = Math.max(1, options.pollIntervalMs ?? 1000);
|
|
10855
|
+
let timer;
|
|
10856
|
+
let running = false;
|
|
10857
|
+
const tick = async () => options.worker.drain();
|
|
10858
|
+
return {
|
|
10859
|
+
isRunning: () => running,
|
|
10860
|
+
start: () => {
|
|
10861
|
+
if (timer) {
|
|
10862
|
+
return;
|
|
10863
|
+
}
|
|
10864
|
+
running = true;
|
|
10865
|
+
timer = setInterval(() => {
|
|
10866
|
+
tick().catch((error) => {
|
|
10867
|
+
options.onError?.(error);
|
|
10868
|
+
});
|
|
10869
|
+
}, pollIntervalMs);
|
|
10870
|
+
},
|
|
10871
|
+
stop: () => {
|
|
10872
|
+
if (timer) {
|
|
10873
|
+
clearInterval(timer);
|
|
10874
|
+
timer = undefined;
|
|
10875
|
+
}
|
|
10876
|
+
running = false;
|
|
10877
|
+
},
|
|
10878
|
+
tick
|
|
10879
|
+
};
|
|
10880
|
+
};
|
|
10797
10881
|
var defaultProofRecipients = () => [
|
|
10798
10882
|
{
|
|
10799
10883
|
id: "campaign-proof-recipient-1",
|
|
@@ -16571,6 +16655,12 @@ var createSQLiteTelephonyWebhookIdempotencyStoreWithDatabase = (database, tableN
|
|
|
16571
16655
|
getSortAt: (value) => value.updatedAt,
|
|
16572
16656
|
tableName
|
|
16573
16657
|
});
|
|
16658
|
+
var createSQLiteCampaignStoreWithDatabase = (database, tableName) => createSQLiteRecordStore({
|
|
16659
|
+
database,
|
|
16660
|
+
decorate: (_id, value) => value,
|
|
16661
|
+
getSortAt: (value) => value.campaign.createdAt,
|
|
16662
|
+
tableName
|
|
16663
|
+
});
|
|
16574
16664
|
var createVoiceSQLiteSessionStore = (options) => createSQLiteSessionStoreWithDatabase(openVoiceSQLiteDatabase(options.path), resolveTableName({
|
|
16575
16665
|
fallback: "sessions",
|
|
16576
16666
|
options
|
|
@@ -16603,9 +16693,17 @@ var createVoiceSQLiteTelephonyWebhookIdempotencyStore = (options) => createSQLit
|
|
|
16603
16693
|
fallback: "telephony_webhook_idempotency",
|
|
16604
16694
|
options
|
|
16605
16695
|
}));
|
|
16696
|
+
var createVoiceSQLiteCampaignStore = (options) => createSQLiteCampaignStoreWithDatabase(openVoiceSQLiteDatabase(options.path), resolveTableName({
|
|
16697
|
+
fallback: "campaigns",
|
|
16698
|
+
options
|
|
16699
|
+
}));
|
|
16606
16700
|
var createVoiceSQLiteRuntimeStorage = (options) => {
|
|
16607
16701
|
const database = openVoiceSQLiteDatabase(options.path);
|
|
16608
16702
|
return {
|
|
16703
|
+
campaigns: createSQLiteCampaignStoreWithDatabase(database, resolveTableName({
|
|
16704
|
+
fallback: "campaigns",
|
|
16705
|
+
options
|
|
16706
|
+
})),
|
|
16609
16707
|
events: createSQLiteEventStoreWithDatabase(database, resolveTableName({
|
|
16610
16708
|
fallback: "events",
|
|
16611
16709
|
options
|
|
@@ -16827,6 +16925,15 @@ var createPostgresTelephonyWebhookIdempotencyStoreWithClient = (client, options)
|
|
|
16827
16925
|
}),
|
|
16828
16926
|
sql: client
|
|
16829
16927
|
});
|
|
16928
|
+
var createPostgresCampaignStoreWithClient = (client, options) => createPostgresRecordStore({
|
|
16929
|
+
decorate: (_id, value) => value,
|
|
16930
|
+
getSortAt: (value) => value.campaign.createdAt,
|
|
16931
|
+
qualifiedTableName: resolveQualifiedTableName({
|
|
16932
|
+
fallback: "campaigns",
|
|
16933
|
+
options
|
|
16934
|
+
}),
|
|
16935
|
+
sql: client
|
|
16936
|
+
});
|
|
16830
16937
|
var createVoicePostgresSessionStore = (options) => createPostgresSessionStoreWithClient(createVoicePostgresClient(options), options);
|
|
16831
16938
|
var createVoicePostgresReviewStore = (options) => createPostgresReviewStoreWithClient(createVoicePostgresClient(options), options);
|
|
16832
16939
|
var createVoicePostgresTaskStore = (options) => createPostgresTaskStoreWithClient(createVoicePostgresClient(options), options);
|
|
@@ -16835,9 +16942,11 @@ var createVoicePostgresExternalObjectMapStore = (options) => createPostgresExter
|
|
|
16835
16942
|
var createVoicePostgresTraceEventStore = (options) => createPostgresTraceEventStoreWithClient(createVoicePostgresClient(options), options);
|
|
16836
16943
|
var createVoicePostgresTraceSinkDeliveryStore = (options) => createPostgresTraceSinkDeliveryStoreWithClient(createVoicePostgresClient(options), options);
|
|
16837
16944
|
var createVoicePostgresTelephonyWebhookIdempotencyStore = (options) => createPostgresTelephonyWebhookIdempotencyStoreWithClient(createVoicePostgresClient(options), options);
|
|
16945
|
+
var createVoicePostgresCampaignStore = (options) => createPostgresCampaignStoreWithClient(createVoicePostgresClient(options), options);
|
|
16838
16946
|
var createVoicePostgresRuntimeStorage = (options) => {
|
|
16839
16947
|
const client = createVoicePostgresClient(options);
|
|
16840
16948
|
return {
|
|
16949
|
+
campaigns: createPostgresCampaignStoreWithClient(client, options),
|
|
16841
16950
|
events: createPostgresEventStoreWithClient(client, options),
|
|
16842
16951
|
externalObjects: createPostgresExternalObjectMapStoreWithClient(client, options),
|
|
16843
16952
|
reviews: createPostgresReviewStoreWithClient(client, options),
|
|
@@ -19018,6 +19127,7 @@ export {
|
|
|
19018
19127
|
createVoiceSQLiteReviewStore,
|
|
19019
19128
|
createVoiceSQLiteIntegrationEventStore,
|
|
19020
19129
|
createVoiceSQLiteExternalObjectMapStore,
|
|
19130
|
+
createVoiceSQLiteCampaignStore,
|
|
19021
19131
|
createVoiceS3ReviewStore,
|
|
19022
19132
|
createVoiceRoutingDecisionSummary,
|
|
19023
19133
|
createVoiceReviewSavedEvent,
|
|
@@ -19043,6 +19153,7 @@ export {
|
|
|
19043
19153
|
createVoicePostgresReviewStore,
|
|
19044
19154
|
createVoicePostgresIntegrationEventStore,
|
|
19045
19155
|
createVoicePostgresExternalObjectMapStore,
|
|
19156
|
+
createVoicePostgresCampaignStore,
|
|
19046
19157
|
createVoicePhoneAgent,
|
|
19047
19158
|
createVoiceOutcomeContractRoutes,
|
|
19048
19159
|
createVoiceOutcomeContractJSONHandler,
|
|
@@ -19096,6 +19207,8 @@ export {
|
|
|
19096
19207
|
createVoiceExperiment,
|
|
19097
19208
|
createVoiceEvalRoutes,
|
|
19098
19209
|
createVoiceDiagnosticsRoutes,
|
|
19210
|
+
createVoiceCampaignWorkerLoop,
|
|
19211
|
+
createVoiceCampaignWorker,
|
|
19099
19212
|
createVoiceCampaignRoutes,
|
|
19100
19213
|
createVoiceCampaign,
|
|
19101
19214
|
createVoiceCallReviewRecorder,
|
package/dist/postgresStore.d.ts
CHANGED
|
@@ -2,6 +2,7 @@ import { type StoredVoiceTraceEvent, type VoiceTraceSinkDeliveryRecord, type Voi
|
|
|
2
2
|
import type { StoredVoiceIntegrationEvent, StoredVoiceExternalObjectMap, StoredVoiceOpsTask, VoiceExternalObjectMapStore, VoiceIntegrationEventStore, VoiceOpsTaskStore } from './ops';
|
|
3
3
|
import type { StoredVoiceCallReviewArtifact, VoiceCallReviewStore } from './testing/review';
|
|
4
4
|
import type { VoiceTelephonyWebhookIdempotencyStore } from './telephonyOutcome';
|
|
5
|
+
import type { VoiceCampaignStore } from './campaign';
|
|
5
6
|
import type { VoiceSessionRecord, VoiceSessionStore } from './types';
|
|
6
7
|
export type VoicePostgresClient = {
|
|
7
8
|
unsafe: <TRow extends Record<string, unknown> = Record<string, unknown>>(query: string, parameters?: unknown[]) => Promise<TRow[]>;
|
|
@@ -14,6 +15,7 @@ export type VoicePostgresStoreOptions = {
|
|
|
14
15
|
tablePrefix?: string;
|
|
15
16
|
};
|
|
16
17
|
export type VoicePostgresRuntimeStorage<TSession extends VoiceSessionRecord = VoiceSessionRecord, TReview extends StoredVoiceCallReviewArtifact = StoredVoiceCallReviewArtifact, TTask extends StoredVoiceOpsTask = StoredVoiceOpsTask, TEvent extends StoredVoiceIntegrationEvent = StoredVoiceIntegrationEvent, TMapping extends StoredVoiceExternalObjectMap = StoredVoiceExternalObjectMap, TTrace extends StoredVoiceTraceEvent = StoredVoiceTraceEvent, TTraceDelivery extends VoiceTraceSinkDeliveryRecord = VoiceTraceSinkDeliveryRecord> = {
|
|
18
|
+
campaigns: VoiceCampaignStore;
|
|
17
19
|
events: VoiceIntegrationEventStore<TEvent>;
|
|
18
20
|
externalObjects: VoiceExternalObjectMapStore<TMapping>;
|
|
19
21
|
reviews: VoiceCallReviewStore<TReview>;
|
|
@@ -30,4 +32,5 @@ export declare const createVoicePostgresExternalObjectMapStore: <TMapping extend
|
|
|
30
32
|
export declare const createVoicePostgresTraceEventStore: <TEvent extends StoredVoiceTraceEvent = StoredVoiceTraceEvent>(options: VoicePostgresStoreOptions) => VoiceTraceEventStore<TEvent>;
|
|
31
33
|
export declare const createVoicePostgresTraceSinkDeliveryStore: <TDelivery extends VoiceTraceSinkDeliveryRecord = VoiceTraceSinkDeliveryRecord>(options: VoicePostgresStoreOptions) => VoiceTraceSinkDeliveryStore<TDelivery>;
|
|
32
34
|
export declare const createVoicePostgresTelephonyWebhookIdempotencyStore: <TResult = unknown>(options: VoicePostgresStoreOptions) => VoiceTelephonyWebhookIdempotencyStore<TResult>;
|
|
35
|
+
export declare const createVoicePostgresCampaignStore: (options: VoicePostgresStoreOptions) => VoiceCampaignStore;
|
|
33
36
|
export declare const createVoicePostgresRuntimeStorage: <TSession extends VoiceSessionRecord = VoiceSessionRecord, TReview extends StoredVoiceCallReviewArtifact = StoredVoiceCallReviewArtifact, TTask extends StoredVoiceOpsTask = StoredVoiceOpsTask, TEvent extends StoredVoiceIntegrationEvent = StoredVoiceIntegrationEvent, TMapping extends StoredVoiceExternalObjectMap = StoredVoiceExternalObjectMap, TTrace extends StoredVoiceTraceEvent = StoredVoiceTraceEvent, TTraceDelivery extends VoiceTraceSinkDeliveryRecord = VoiceTraceSinkDeliveryRecord>(options: VoicePostgresStoreOptions) => VoicePostgresRuntimeStorage<TSession, TReview, TTask, TEvent, TMapping, TTrace, TTraceDelivery>;
|
package/dist/sqliteStore.d.ts
CHANGED
|
@@ -2,6 +2,7 @@ import { type StoredVoiceTraceEvent, type VoiceTraceSinkDeliveryRecord, type Voi
|
|
|
2
2
|
import type { StoredVoiceIntegrationEvent, StoredVoiceExternalObjectMap, StoredVoiceOpsTask, VoiceExternalObjectMapStore, VoiceIntegrationEventStore, VoiceOpsTaskStore } from './ops';
|
|
3
3
|
import type { StoredVoiceCallReviewArtifact, VoiceCallReviewStore } from './testing/review';
|
|
4
4
|
import type { VoiceTelephonyWebhookIdempotencyStore } from './telephonyOutcome';
|
|
5
|
+
import type { VoiceCampaignStore } from './campaign';
|
|
5
6
|
import type { VoiceSessionRecord, VoiceSessionStore } from './types';
|
|
6
7
|
export type VoiceSQLiteStoreOptions = {
|
|
7
8
|
path: string;
|
|
@@ -9,6 +10,7 @@ export type VoiceSQLiteStoreOptions = {
|
|
|
9
10
|
tablePrefix?: string;
|
|
10
11
|
};
|
|
11
12
|
export type VoiceSQLiteRuntimeStorage<TSession extends VoiceSessionRecord = VoiceSessionRecord, TReview extends StoredVoiceCallReviewArtifact = StoredVoiceCallReviewArtifact, TTask extends StoredVoiceOpsTask = StoredVoiceOpsTask, TEvent extends StoredVoiceIntegrationEvent = StoredVoiceIntegrationEvent, TMapping extends StoredVoiceExternalObjectMap = StoredVoiceExternalObjectMap, TTrace extends StoredVoiceTraceEvent = StoredVoiceTraceEvent, TTraceDelivery extends VoiceTraceSinkDeliveryRecord = VoiceTraceSinkDeliveryRecord> = {
|
|
13
|
+
campaigns: VoiceCampaignStore;
|
|
12
14
|
events: VoiceIntegrationEventStore<TEvent>;
|
|
13
15
|
externalObjects: VoiceExternalObjectMapStore<TMapping>;
|
|
14
16
|
reviews: VoiceCallReviewStore<TReview>;
|
|
@@ -25,4 +27,5 @@ export declare const createVoiceSQLiteExternalObjectMapStore: <TMapping extends
|
|
|
25
27
|
export declare const createVoiceSQLiteTraceEventStore: <TEvent extends StoredVoiceTraceEvent = StoredVoiceTraceEvent>(options: VoiceSQLiteStoreOptions) => VoiceTraceEventStore<TEvent>;
|
|
26
28
|
export declare const createVoiceSQLiteTraceSinkDeliveryStore: <TDelivery extends VoiceTraceSinkDeliveryRecord = VoiceTraceSinkDeliveryRecord>(options: VoiceSQLiteStoreOptions) => VoiceTraceSinkDeliveryStore<TDelivery>;
|
|
27
29
|
export declare const createVoiceSQLiteTelephonyWebhookIdempotencyStore: <TResult = unknown>(options: VoiceSQLiteStoreOptions) => VoiceTelephonyWebhookIdempotencyStore<TResult>;
|
|
30
|
+
export declare const createVoiceSQLiteCampaignStore: (options: VoiceSQLiteStoreOptions) => VoiceCampaignStore;
|
|
28
31
|
export declare const createVoiceSQLiteRuntimeStorage: <TSession extends VoiceSessionRecord = VoiceSessionRecord, TReview extends StoredVoiceCallReviewArtifact = StoredVoiceCallReviewArtifact, TTask extends StoredVoiceOpsTask = StoredVoiceOpsTask, TEvent extends StoredVoiceIntegrationEvent = StoredVoiceIntegrationEvent, TMapping extends StoredVoiceExternalObjectMap = StoredVoiceExternalObjectMap, TTrace extends StoredVoiceTraceEvent = StoredVoiceTraceEvent, TTraceDelivery extends VoiceTraceSinkDeliveryRecord = VoiceTraceSinkDeliveryRecord>(options: VoiceSQLiteStoreOptions) => VoiceSQLiteRuntimeStorage<TSession, TReview, TTask, TEvent, TMapping, TTrace, TTraceDelivery>;
|