@absolutejs/voice 0.0.22-beta.570 → 0.0.22-beta.572

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.
@@ -1,31 +1,27 @@
1
- import { type TablesRelationalConfig } from "drizzle-orm";
2
- import { type PgDatabase, type PgQueryResultHKT } from "drizzle-orm/pg-core";
1
+ import { type PgAsyncDatabase } from "drizzle-orm/pg-core";
3
2
  export declare const voiceDocumentTable: (name: string) => import("drizzle-orm/pg-core").PgTableWithColumns<{
4
3
  name: string;
5
4
  schema: undefined;
6
5
  columns: {
7
- id: import("drizzle-orm/pg-core").PgColumn<{
8
- name: "id";
6
+ id: import("drizzle-orm/pg-core").PgBuildColumn<string, import("drizzle-orm/pg-core").SetIsPrimaryKey<import("drizzle-orm/pg-core").PgTextBuilder<[string, ...string[]]>>, {
7
+ name: string;
9
8
  tableName: string;
10
9
  dataType: "string";
11
- columnType: "PgText";
12
10
  data: string;
13
11
  driverParam: string;
14
12
  notNull: true;
15
13
  hasDefault: false;
16
- isPrimaryKey: true;
14
+ isPrimaryKey: false;
17
15
  isAutoincrement: false;
18
16
  hasRuntimeDefault: false;
19
- enumValues: [string, ...string[]];
20
- baseColumn: never;
17
+ enumValues: undefined;
21
18
  identity: undefined;
22
19
  generated: undefined;
23
- }, {}, {}>;
24
- payload: import("drizzle-orm/pg-core").PgColumn<{
25
- name: "payload";
20
+ }>;
21
+ payload: import("drizzle-orm/pg-core").PgBuildColumn<string, import("drizzle-orm/pg-core").SetNotNull<import("drizzle-orm/pg-core").PgJsonbBuilder>, {
22
+ name: string;
26
23
  tableName: string;
27
- dataType: "json";
28
- columnType: "PgJsonb";
24
+ dataType: "object json";
29
25
  data: unknown;
30
26
  driverParam: unknown;
31
27
  notNull: true;
@@ -34,15 +30,13 @@ export declare const voiceDocumentTable: (name: string) => import("drizzle-orm/p
34
30
  isAutoincrement: false;
35
31
  hasRuntimeDefault: false;
36
32
  enumValues: undefined;
37
- baseColumn: never;
38
33
  identity: undefined;
39
34
  generated: undefined;
40
- }, {}, {}>;
41
- sortAt: import("drizzle-orm/pg-core").PgColumn<{
42
- name: "sort_at";
35
+ }>;
36
+ sortAt: import("drizzle-orm/pg-core").PgBuildColumn<string, import("drizzle-orm/pg-core").SetNotNull<import("drizzle-orm/pg-core").PgBigInt53Builder>, {
37
+ name: string;
43
38
  tableName: string;
44
- dataType: "number";
45
- columnType: "PgBigInt53";
39
+ dataType: "number int53";
46
40
  data: number;
47
41
  driverParam: string | number;
48
42
  notNull: true;
@@ -51,20 +45,19 @@ export declare const voiceDocumentTable: (name: string) => import("drizzle-orm/p
51
45
  isAutoincrement: false;
52
46
  hasRuntimeDefault: false;
53
47
  enumValues: undefined;
54
- baseColumn: never;
55
48
  identity: undefined;
56
49
  generated: undefined;
57
- }, {}, {}>;
50
+ }>;
58
51
  };
59
52
  dialect: "pg";
60
53
  }>;
61
54
  export type VoiceDrizzleDocumentTable = ReturnType<typeof voiceDocumentTable>;
62
- export type VoiceDrizzleDatabase = PgDatabase<PgQueryResultHKT, Record<string, unknown>, TablesRelationalConfig>;
55
+ export type VoiceDrizzleDatabase = PgAsyncDatabase<any, any>;
63
56
  export type VoiceDrizzleStoreOptions = {
64
57
  db: VoiceDrizzleDatabase;
65
58
  };
66
- export declare const createVoiceDrizzleRecordStore: <T>(input: {
67
- db: VoiceDrizzleDatabase;
59
+ export declare const createVoiceDrizzleRecordStore: <T, DB extends VoiceDrizzleDatabase = VoiceDrizzleDatabase>(input: {
60
+ db: DB;
68
61
  decorate: (id: string, value: T) => T;
69
62
  getSortAt: (value: T) => number;
70
63
  table: VoiceDrizzleDocumentTable;
package/dist/index.js CHANGED
@@ -24973,11 +24973,52 @@ var createTwilioVoiceRoutes = (options) => {
24973
24973
  policy: webhookPolicy,
24974
24974
  provider: "twilio"
24975
24975
  }));
24976
- if (!setupPath) {
24976
+ const build = () => {
24977
+ if (!setupPath) {
24978
+ if (!smokePath) {
24979
+ return app;
24980
+ }
24981
+ return app.get(smokePath, async ({ query, request }) => {
24982
+ const report = await runTwilioVoiceSmokeTest({
24983
+ app,
24984
+ options,
24985
+ query,
24986
+ request,
24987
+ streamPath,
24988
+ twimlPath,
24989
+ webhookPath
24990
+ });
24991
+ if (query.format === "html") {
24992
+ return new Response(renderTwilioVoiceSmokeHTML(report, options.smoke?.title ?? "AbsoluteJS Twilio Voice Smoke Test"), {
24993
+ headers: {
24994
+ "content-type": "text/html; charset=utf-8"
24995
+ }
24996
+ });
24997
+ }
24998
+ return report;
24999
+ });
25000
+ }
25001
+ const withSetup = app.get(setupPath, async ({ query, request }) => {
25002
+ const status = await buildTwilioVoiceSetupStatus(options, {
25003
+ query,
25004
+ request,
25005
+ streamPath,
25006
+ twimlPath,
25007
+ webhookPath
25008
+ });
25009
+ if (query.format === "html") {
25010
+ return new Response(renderTwilioVoiceSetupHTML(status, options.setup?.title ?? "AbsoluteJS Twilio Voice Setup"), {
25011
+ headers: {
25012
+ "content-type": "text/html; charset=utf-8"
25013
+ }
25014
+ });
25015
+ }
25016
+ return status;
25017
+ });
24977
25018
  if (!smokePath) {
24978
- return app;
25019
+ return withSetup;
24979
25020
  }
24980
- return app.get(smokePath, async ({ query, request }) => {
25021
+ return withSetup.get(smokePath, async ({ query, request }) => {
24981
25022
  const report = await runTwilioVoiceSmokeTest({
24982
25023
  app,
24983
25024
  options,
@@ -24996,46 +25037,8 @@ var createTwilioVoiceRoutes = (options) => {
24996
25037
  }
24997
25038
  return report;
24998
25039
  });
24999
- }
25000
- const withSetup = app.get(setupPath, async ({ query, request }) => {
25001
- const status = await buildTwilioVoiceSetupStatus(options, {
25002
- query,
25003
- request,
25004
- streamPath,
25005
- twimlPath,
25006
- webhookPath
25007
- });
25008
- if (query.format === "html") {
25009
- return new Response(renderTwilioVoiceSetupHTML(status, options.setup?.title ?? "AbsoluteJS Twilio Voice Setup"), {
25010
- headers: {
25011
- "content-type": "text/html; charset=utf-8"
25012
- }
25013
- });
25014
- }
25015
- return status;
25016
- });
25017
- if (!smokePath) {
25018
- return withSetup;
25019
- }
25020
- return withSetup.get(smokePath, async ({ query, request }) => {
25021
- const report = await runTwilioVoiceSmokeTest({
25022
- app,
25023
- options,
25024
- query,
25025
- request,
25026
- streamPath,
25027
- twimlPath,
25028
- webhookPath
25029
- });
25030
- if (query.format === "html") {
25031
- return new Response(renderTwilioVoiceSmokeHTML(report, options.smoke?.title ?? "AbsoluteJS Twilio Voice Smoke Test"), {
25032
- headers: {
25033
- "content-type": "text/html; charset=utf-8"
25034
- }
25035
- });
25036
- }
25037
- return report;
25038
- });
25040
+ };
25041
+ return build();
25039
25042
  };
25040
25043
 
25041
25044
  // src/telephony/plivo.ts
@@ -246,84 +246,5 @@ export declare const transcodePCMToTwilioOutboundPayload: (chunk: Uint8Array, fo
246
246
  export declare const transcodeTwilioInboundPayloadToPCM16: (payload: string) => Uint8Array<ArrayBuffer>;
247
247
  export declare const createTwilioMediaStreamBridge: <TContext = unknown, TSession extends VoiceSessionRecord = VoiceSessionRecord, TResult = unknown>(socket: TwilioMediaStreamSocket, options: TwilioMediaStreamBridgeOptions<TContext, TSession, TResult>) => TwilioMediaStreamBridge;
248
248
  export declare const createTwilioVoiceResponse: (options: TwilioVoiceResponseOptions) => string;
249
- export declare const createTwilioVoiceRoutes: <TContext = unknown, TSession extends VoiceSessionRecord = VoiceSessionRecord, TResult = unknown>(options: TwilioVoiceRoutesOptions<TContext, TSession, TResult>) => Elysia<"", {
250
- decorator: {};
251
- store: {};
252
- derive: {};
253
- resolve: {};
254
- }, {
255
- typebox: {};
256
- error: {};
257
- }, {
258
- schema: {};
259
- standaloneSchema: {};
260
- macro: {};
261
- macroFn: {};
262
- parser: {};
263
- response: {};
264
- }, {
265
- [x: string]: {
266
- get: {
267
- body: unknown;
268
- params: {};
269
- query: unknown;
270
- headers: unknown;
271
- response: {
272
- 200: Response;
273
- };
274
- };
275
- };
276
- } & {
277
- [x: string]: {
278
- post: {
279
- body: unknown;
280
- params: {};
281
- query: unknown;
282
- headers: unknown;
283
- response: {
284
- 200: Response;
285
- };
286
- };
287
- };
288
- } & {
289
- [x: string]: {
290
- subscribe: {
291
- body: unknown;
292
- params: {};
293
- query: unknown;
294
- headers: unknown;
295
- response: {};
296
- };
297
- };
298
- } & {
299
- [x: string]: {
300
- post: {
301
- body: unknown;
302
- params: {};
303
- query: unknown;
304
- headers: unknown;
305
- response: {
306
- 200: Response | import("..").VoiceTelephonyWebhookDecision<TResult>;
307
- };
308
- };
309
- };
310
- }, {
311
- derive: {};
312
- resolve: {};
313
- schema: {};
314
- standaloneSchema: {};
315
- response: {};
316
- }, {
317
- derive: {};
318
- resolve: {};
319
- schema: {};
320
- standaloneSchema: {};
321
- response: {};
322
- } & {
323
- derive: {};
324
- resolve: {};
325
- schema: {};
326
- standaloneSchema: {};
327
- response: {};
328
- }>;
249
+ export declare const createTwilioVoiceRoutes: <TContext = unknown, TSession extends VoiceSessionRecord = VoiceSessionRecord, TResult = unknown>(options: TwilioVoiceRoutesOptions<TContext, TSession, TResult>) => Elysia;
329
250
  export {};
@@ -13602,11 +13602,52 @@ var createTwilioVoiceRoutes = (options) => {
13602
13602
  policy: webhookPolicy,
13603
13603
  provider: "twilio"
13604
13604
  }));
13605
- if (!setupPath) {
13605
+ const build = () => {
13606
+ if (!setupPath) {
13607
+ if (!smokePath) {
13608
+ return app;
13609
+ }
13610
+ return app.get(smokePath, async ({ query, request }) => {
13611
+ const report = await runTwilioVoiceSmokeTest({
13612
+ app,
13613
+ options,
13614
+ query,
13615
+ request,
13616
+ streamPath,
13617
+ twimlPath,
13618
+ webhookPath
13619
+ });
13620
+ if (query.format === "html") {
13621
+ return new Response(renderTwilioVoiceSmokeHTML(report, options.smoke?.title ?? "AbsoluteJS Twilio Voice Smoke Test"), {
13622
+ headers: {
13623
+ "content-type": "text/html; charset=utf-8"
13624
+ }
13625
+ });
13626
+ }
13627
+ return report;
13628
+ });
13629
+ }
13630
+ const withSetup = app.get(setupPath, async ({ query, request }) => {
13631
+ const status = await buildTwilioVoiceSetupStatus(options, {
13632
+ query,
13633
+ request,
13634
+ streamPath,
13635
+ twimlPath,
13636
+ webhookPath
13637
+ });
13638
+ if (query.format === "html") {
13639
+ return new Response(renderTwilioVoiceSetupHTML(status, options.setup?.title ?? "AbsoluteJS Twilio Voice Setup"), {
13640
+ headers: {
13641
+ "content-type": "text/html; charset=utf-8"
13642
+ }
13643
+ });
13644
+ }
13645
+ return status;
13646
+ });
13606
13647
  if (!smokePath) {
13607
- return app;
13648
+ return withSetup;
13608
13649
  }
13609
- return app.get(smokePath, async ({ query, request }) => {
13650
+ return withSetup.get(smokePath, async ({ query, request }) => {
13610
13651
  const report = await runTwilioVoiceSmokeTest({
13611
13652
  app,
13612
13653
  options,
@@ -13625,46 +13666,8 @@ var createTwilioVoiceRoutes = (options) => {
13625
13666
  }
13626
13667
  return report;
13627
13668
  });
13628
- }
13629
- const withSetup = app.get(setupPath, async ({ query, request }) => {
13630
- const status = await buildTwilioVoiceSetupStatus(options, {
13631
- query,
13632
- request,
13633
- streamPath,
13634
- twimlPath,
13635
- webhookPath
13636
- });
13637
- if (query.format === "html") {
13638
- return new Response(renderTwilioVoiceSetupHTML(status, options.setup?.title ?? "AbsoluteJS Twilio Voice Setup"), {
13639
- headers: {
13640
- "content-type": "text/html; charset=utf-8"
13641
- }
13642
- });
13643
- }
13644
- return status;
13645
- });
13646
- if (!smokePath) {
13647
- return withSetup;
13648
- }
13649
- return withSetup.get(smokePath, async ({ query, request }) => {
13650
- const report = await runTwilioVoiceSmokeTest({
13651
- app,
13652
- options,
13653
- query,
13654
- request,
13655
- streamPath,
13656
- twimlPath,
13657
- webhookPath
13658
- });
13659
- if (query.format === "html") {
13660
- return new Response(renderTwilioVoiceSmokeHTML(report, options.smoke?.title ?? "AbsoluteJS Twilio Voice Smoke Test"), {
13661
- headers: {
13662
- "content-type": "text/html; charset=utf-8"
13663
- }
13664
- });
13665
- }
13666
- return report;
13667
- });
13669
+ };
13670
+ return build();
13668
13671
  };
13669
13672
 
13670
13673
  // src/testing/telephony.ts