@automagik/omni 2.260422.9 → 2.260422.13
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/db/drizzle/0030_twilio_whatsapp_channel.sql +9 -0
- package/db/drizzle/meta/0013_snapshot.json +6926 -0
- package/db/drizzle/meta/0014_snapshot.json +6938 -0
- package/db/drizzle/meta/_journal.json +7 -0
- package/dist/commands/chats.d.ts.map +1 -1
- package/dist/commands/instances.d.ts.map +1 -1
- package/dist/index.js +163 -112
- package/dist/server/index.js +359 -164
- package/package.json +9 -9
package/dist/server/index.js
CHANGED
|
@@ -21726,7 +21726,8 @@ var init_common = __esm(() => {
|
|
|
21726
21726
|
"discord",
|
|
21727
21727
|
"slack",
|
|
21728
21728
|
"telegram",
|
|
21729
|
-
"gupshup"
|
|
21729
|
+
"gupshup",
|
|
21730
|
+
"twilio-whatsapp"
|
|
21730
21731
|
]);
|
|
21731
21732
|
ContentTypeSchema = exports_external.enum([
|
|
21732
21733
|
"text",
|
|
@@ -22196,6 +22197,13 @@ var init_instance = __esm(() => {
|
|
|
22196
22197
|
slackAppToken: exports_external.string().nullable(),
|
|
22197
22198
|
slackSigningSecret: exports_external.string().nullable(),
|
|
22198
22199
|
telegramBotToken: exports_external.string().nullable(),
|
|
22200
|
+
twilioAccountSid: exports_external.string().nullable().optional(),
|
|
22201
|
+
twilioAuthToken: exports_external.string().nullable().optional(),
|
|
22202
|
+
twilioFrom: exports_external.string().nullable().optional(),
|
|
22203
|
+
twilioMessagingServiceSid: exports_external.string().nullable().optional(),
|
|
22204
|
+
twilioStatusCallbackUrl: exports_external.string().nullable().optional(),
|
|
22205
|
+
twilioWebhookUrl: exports_external.string().nullable().optional(),
|
|
22206
|
+
twilioValidateSignature: exports_external.boolean().optional(),
|
|
22199
22207
|
agentId: exports_external.string().uuid().nullable().optional(),
|
|
22200
22208
|
agentTimeout: exports_external.number().int().positive(),
|
|
22201
22209
|
agentStreamMode: exports_external.boolean(),
|
|
@@ -22454,6 +22462,7 @@ var init_channel = __esm(() => {
|
|
|
22454
22462
|
"telegram",
|
|
22455
22463
|
"a2a",
|
|
22456
22464
|
"gupshup",
|
|
22465
|
+
"twilio-whatsapp",
|
|
22457
22466
|
"internal"
|
|
22458
22467
|
];
|
|
22459
22468
|
CONTENT_TYPES = [
|
|
@@ -28707,10 +28716,14 @@ function createMessagingWindowProbe(options = {}) {
|
|
|
28707
28716
|
var MESSAGING_WINDOW_MS, CHANNELS_WITH_MESSAGING_WINDOW, CHANNELS_WITH_TYPING_INDICATOR;
|
|
28708
28717
|
var init_capabilities2 = __esm(() => {
|
|
28709
28718
|
MESSAGING_WINDOW_MS = 24 * 60 * 60 * 1000;
|
|
28710
|
-
CHANNELS_WITH_MESSAGING_WINDOW = new Set([
|
|
28719
|
+
CHANNELS_WITH_MESSAGING_WINDOW = new Set([
|
|
28720
|
+
"whatsapp-cloud",
|
|
28721
|
+
"twilio-whatsapp"
|
|
28722
|
+
]);
|
|
28711
28723
|
CHANNELS_WITH_TYPING_INDICATOR = new Set([
|
|
28712
28724
|
"whatsapp-baileys",
|
|
28713
28725
|
"whatsapp-cloud",
|
|
28726
|
+
"twilio-whatsapp",
|
|
28714
28727
|
"discord",
|
|
28715
28728
|
"slack",
|
|
28716
28729
|
"telegram"
|
|
@@ -224451,7 +224464,7 @@ var init_sentry_scrub = __esm(() => {
|
|
|
224451
224464
|
var require_package8 = __commonJS((exports, module) => {
|
|
224452
224465
|
module.exports = {
|
|
224453
224466
|
name: "@omni/api",
|
|
224454
|
-
version: "2.260422.
|
|
224467
|
+
version: "2.260422.13",
|
|
224455
224468
|
type: "module",
|
|
224456
224469
|
exports: {
|
|
224457
224470
|
".": {
|
|
@@ -224565,7 +224578,7 @@ var init_instrument2 = __esm(() => {
|
|
|
224565
224578
|
}
|
|
224566
224579
|
});
|
|
224567
224580
|
|
|
224568
|
-
// ../../node_modules/.bun/drizzle-orm@0.38.4+
|
|
224581
|
+
// ../../node_modules/.bun/drizzle-orm@0.38.4+9cdbbb2a2ed4af97/node_modules/drizzle-orm/entity.js
|
|
224569
224582
|
function is(value, type) {
|
|
224570
224583
|
if (!value || typeof value !== "object") {
|
|
224571
224584
|
return false;
|
|
@@ -224593,7 +224606,7 @@ var init_entity = __esm(() => {
|
|
|
224593
224606
|
hasOwnEntityKind = Symbol.for("drizzle:hasOwnEntityKind");
|
|
224594
224607
|
});
|
|
224595
224608
|
|
|
224596
|
-
// ../../node_modules/.bun/drizzle-orm@0.38.4+
|
|
224609
|
+
// ../../node_modules/.bun/drizzle-orm@0.38.4+9cdbbb2a2ed4af97/node_modules/drizzle-orm/column.js
|
|
224597
224610
|
var Column;
|
|
224598
224611
|
var init_column = __esm(() => {
|
|
224599
224612
|
init_entity();
|
|
@@ -224647,7 +224660,7 @@ var init_column = __esm(() => {
|
|
|
224647
224660
|
};
|
|
224648
224661
|
});
|
|
224649
224662
|
|
|
224650
|
-
// ../../node_modules/.bun/drizzle-orm@0.38.4+
|
|
224663
|
+
// ../../node_modules/.bun/drizzle-orm@0.38.4+9cdbbb2a2ed4af97/node_modules/drizzle-orm/column-builder.js
|
|
224651
224664
|
var ColumnBuilder;
|
|
224652
224665
|
var init_column_builder = __esm(() => {
|
|
224653
224666
|
init_entity();
|
|
@@ -224707,13 +224720,13 @@ var init_column_builder = __esm(() => {
|
|
|
224707
224720
|
};
|
|
224708
224721
|
});
|
|
224709
224722
|
|
|
224710
|
-
// ../../node_modules/.bun/drizzle-orm@0.38.4+
|
|
224723
|
+
// ../../node_modules/.bun/drizzle-orm@0.38.4+9cdbbb2a2ed4af97/node_modules/drizzle-orm/table.utils.js
|
|
224711
224724
|
var TableName;
|
|
224712
224725
|
var init_table_utils = __esm(() => {
|
|
224713
224726
|
TableName = Symbol.for("drizzle:Name");
|
|
224714
224727
|
});
|
|
224715
224728
|
|
|
224716
|
-
// ../../node_modules/.bun/drizzle-orm@0.38.4+
|
|
224729
|
+
// ../../node_modules/.bun/drizzle-orm@0.38.4+9cdbbb2a2ed4af97/node_modules/drizzle-orm/pg-core/foreign-keys.js
|
|
224717
224730
|
var ForeignKeyBuilder, ForeignKey;
|
|
224718
224731
|
var init_foreign_keys = __esm(() => {
|
|
224719
224732
|
init_entity();
|
|
@@ -224771,13 +224784,13 @@ var init_foreign_keys = __esm(() => {
|
|
|
224771
224784
|
};
|
|
224772
224785
|
});
|
|
224773
224786
|
|
|
224774
|
-
// ../../node_modules/.bun/drizzle-orm@0.38.4+
|
|
224787
|
+
// ../../node_modules/.bun/drizzle-orm@0.38.4+9cdbbb2a2ed4af97/node_modules/drizzle-orm/tracing-utils.js
|
|
224775
224788
|
function iife(fn, ...args) {
|
|
224776
224789
|
return fn(...args);
|
|
224777
224790
|
}
|
|
224778
224791
|
var init_tracing_utils = () => {};
|
|
224779
224792
|
|
|
224780
|
-
// ../../node_modules/.bun/drizzle-orm@0.38.4+
|
|
224793
|
+
// ../../node_modules/.bun/drizzle-orm@0.38.4+9cdbbb2a2ed4af97/node_modules/drizzle-orm/pg-core/unique-constraint.js
|
|
224781
224794
|
function uniqueKeyName(table, columns) {
|
|
224782
224795
|
return `${table[TableName]}_${columns.join("_")}_unique`;
|
|
224783
224796
|
}
|
|
@@ -224785,7 +224798,7 @@ var init_unique_constraint = __esm(() => {
|
|
|
224785
224798
|
init_table_utils();
|
|
224786
224799
|
});
|
|
224787
224800
|
|
|
224788
|
-
// ../../node_modules/.bun/drizzle-orm@0.38.4+
|
|
224801
|
+
// ../../node_modules/.bun/drizzle-orm@0.38.4+9cdbbb2a2ed4af97/node_modules/drizzle-orm/pg-core/utils/array.js
|
|
224789
224802
|
function parsePgArrayValue(arrayString, startFrom, inQuotes) {
|
|
224790
224803
|
for (let i = startFrom;i < arrayString.length; i++) {
|
|
224791
224804
|
const char = arrayString[i];
|
|
@@ -224862,7 +224875,7 @@ function makePgArray(array) {
|
|
|
224862
224875
|
}
|
|
224863
224876
|
var init_array = () => {};
|
|
224864
224877
|
|
|
224865
|
-
// ../../node_modules/.bun/drizzle-orm@0.38.4+
|
|
224878
|
+
// ../../node_modules/.bun/drizzle-orm@0.38.4+9cdbbb2a2ed4af97/node_modules/drizzle-orm/pg-core/columns/common.js
|
|
224866
224879
|
var PgColumnBuilder, PgColumn, ExtraConfigColumn, IndexedColumn, PgArrayBuilder, PgArray;
|
|
224867
224880
|
var init_common3 = __esm(() => {
|
|
224868
224881
|
init_column_builder();
|
|
@@ -225015,7 +225028,7 @@ var init_common3 = __esm(() => {
|
|
|
225015
225028
|
};
|
|
225016
225029
|
});
|
|
225017
225030
|
|
|
225018
|
-
// ../../node_modules/.bun/drizzle-orm@0.38.4+
|
|
225031
|
+
// ../../node_modules/.bun/drizzle-orm@0.38.4+9cdbbb2a2ed4af97/node_modules/drizzle-orm/pg-core/columns/enum.js
|
|
225019
225032
|
function isPgEnum(obj) {
|
|
225020
225033
|
return !!obj && typeof obj === "function" && isPgEnumSym in obj && obj[isPgEnumSym] === true;
|
|
225021
225034
|
}
|
|
@@ -225038,7 +225051,7 @@ var init_enum = __esm(() => {
|
|
|
225038
225051
|
};
|
|
225039
225052
|
});
|
|
225040
225053
|
|
|
225041
|
-
// ../../node_modules/.bun/drizzle-orm@0.38.4+
|
|
225054
|
+
// ../../node_modules/.bun/drizzle-orm@0.38.4+9cdbbb2a2ed4af97/node_modules/drizzle-orm/subquery.js
|
|
225042
225055
|
var Subquery, WithSubquery;
|
|
225043
225056
|
var init_subquery = __esm(() => {
|
|
225044
225057
|
init_entity();
|
|
@@ -225059,11 +225072,11 @@ var init_subquery = __esm(() => {
|
|
|
225059
225072
|
};
|
|
225060
225073
|
});
|
|
225061
225074
|
|
|
225062
|
-
// ../../node_modules/.bun/drizzle-orm@0.38.4+
|
|
225075
|
+
// ../../node_modules/.bun/drizzle-orm@0.38.4+9cdbbb2a2ed4af97/node_modules/drizzle-orm/version.js
|
|
225063
225076
|
var version2 = "0.38.4";
|
|
225064
225077
|
var init_version2 = () => {};
|
|
225065
225078
|
|
|
225066
|
-
// ../../node_modules/.bun/drizzle-orm@0.38.4+
|
|
225079
|
+
// ../../node_modules/.bun/drizzle-orm@0.38.4+9cdbbb2a2ed4af97/node_modules/drizzle-orm/tracing.js
|
|
225067
225080
|
var otel, rawTracer, tracer;
|
|
225068
225081
|
var init_tracing4 = __esm(() => {
|
|
225069
225082
|
init_tracing_utils();
|
|
@@ -225093,13 +225106,13 @@ var init_tracing4 = __esm(() => {
|
|
|
225093
225106
|
};
|
|
225094
225107
|
});
|
|
225095
225108
|
|
|
225096
|
-
// ../../node_modules/.bun/drizzle-orm@0.38.4+
|
|
225109
|
+
// ../../node_modules/.bun/drizzle-orm@0.38.4+9cdbbb2a2ed4af97/node_modules/drizzle-orm/view-common.js
|
|
225097
225110
|
var ViewBaseConfig;
|
|
225098
225111
|
var init_view_common = __esm(() => {
|
|
225099
225112
|
ViewBaseConfig = Symbol.for("drizzle:ViewBaseConfig");
|
|
225100
225113
|
});
|
|
225101
225114
|
|
|
225102
|
-
// ../../node_modules/.bun/drizzle-orm@0.38.4+
|
|
225115
|
+
// ../../node_modules/.bun/drizzle-orm@0.38.4+9cdbbb2a2ed4af97/node_modules/drizzle-orm/table.js
|
|
225103
225116
|
function getTableName(table) {
|
|
225104
225117
|
return table[TableName];
|
|
225105
225118
|
}
|
|
@@ -225147,7 +225160,7 @@ var init_table = __esm(() => {
|
|
|
225147
225160
|
};
|
|
225148
225161
|
});
|
|
225149
225162
|
|
|
225150
|
-
// ../../node_modules/.bun/drizzle-orm@0.38.4+
|
|
225163
|
+
// ../../node_modules/.bun/drizzle-orm@0.38.4+9cdbbb2a2ed4af97/node_modules/drizzle-orm/sql/sql.js
|
|
225151
225164
|
function isSQLWrapper(value) {
|
|
225152
225165
|
return value !== null && value !== undefined && typeof value.getSQL === "function";
|
|
225153
225166
|
}
|
|
@@ -225524,7 +225537,7 @@ var init_sql = __esm(() => {
|
|
|
225524
225537
|
};
|
|
225525
225538
|
});
|
|
225526
225539
|
|
|
225527
|
-
// ../../node_modules/.bun/drizzle-orm@0.38.4+
|
|
225540
|
+
// ../../node_modules/.bun/drizzle-orm@0.38.4+9cdbbb2a2ed4af97/node_modules/drizzle-orm/alias.js
|
|
225528
225541
|
function aliasedTable(table, tableAlias) {
|
|
225529
225542
|
return new Proxy(table, new TableAliasProxyHandler(tableAlias, false));
|
|
225530
225543
|
}
|
|
@@ -225610,7 +225623,7 @@ var init_alias = __esm(() => {
|
|
|
225610
225623
|
};
|
|
225611
225624
|
});
|
|
225612
225625
|
|
|
225613
|
-
// ../../node_modules/.bun/drizzle-orm@0.38.4+
|
|
225626
|
+
// ../../node_modules/.bun/drizzle-orm@0.38.4+9cdbbb2a2ed4af97/node_modules/drizzle-orm/errors.js
|
|
225614
225627
|
var DrizzleError, TransactionRollbackError;
|
|
225615
225628
|
var init_errors4 = __esm(() => {
|
|
225616
225629
|
init_entity();
|
|
@@ -225630,7 +225643,7 @@ var init_errors4 = __esm(() => {
|
|
|
225630
225643
|
};
|
|
225631
225644
|
});
|
|
225632
225645
|
|
|
225633
|
-
// ../../node_modules/.bun/drizzle-orm@0.38.4+
|
|
225646
|
+
// ../../node_modules/.bun/drizzle-orm@0.38.4+9cdbbb2a2ed4af97/node_modules/drizzle-orm/sql/expressions/conditions.js
|
|
225634
225647
|
function bindIfParam(value, column) {
|
|
225635
225648
|
if (isDriverValueEncoder(column) && !isSQLWrapper(value) && !is(value, Param) && !is(value, Placeholder) && !is(value, Column) && !is(value, Table) && !is(value, View)) {
|
|
225636
225649
|
return new Param(value, column);
|
|
@@ -225736,7 +225749,7 @@ var init_conditions2 = __esm(() => {
|
|
|
225736
225749
|
init_sql();
|
|
225737
225750
|
});
|
|
225738
225751
|
|
|
225739
|
-
// ../../node_modules/.bun/drizzle-orm@0.38.4+
|
|
225752
|
+
// ../../node_modules/.bun/drizzle-orm@0.38.4+9cdbbb2a2ed4af97/node_modules/drizzle-orm/sql/expressions/select.js
|
|
225740
225753
|
function asc(column) {
|
|
225741
225754
|
return sql`${column} asc`;
|
|
225742
225755
|
}
|
|
@@ -225747,18 +225760,18 @@ var init_select = __esm(() => {
|
|
|
225747
225760
|
init_sql();
|
|
225748
225761
|
});
|
|
225749
225762
|
|
|
225750
|
-
// ../../node_modules/.bun/drizzle-orm@0.38.4+
|
|
225763
|
+
// ../../node_modules/.bun/drizzle-orm@0.38.4+9cdbbb2a2ed4af97/node_modules/drizzle-orm/sql/expressions/index.js
|
|
225751
225764
|
var init_expressions = __esm(() => {
|
|
225752
225765
|
init_conditions2();
|
|
225753
225766
|
init_select();
|
|
225754
225767
|
});
|
|
225755
225768
|
|
|
225756
|
-
// ../../node_modules/.bun/drizzle-orm@0.38.4+
|
|
225769
|
+
// ../../node_modules/.bun/drizzle-orm@0.38.4+9cdbbb2a2ed4af97/node_modules/drizzle-orm/expressions.js
|
|
225757
225770
|
var init_expressions2 = __esm(() => {
|
|
225758
225771
|
init_expressions();
|
|
225759
225772
|
});
|
|
225760
225773
|
|
|
225761
|
-
// ../../node_modules/.bun/drizzle-orm@0.38.4+
|
|
225774
|
+
// ../../node_modules/.bun/drizzle-orm@0.38.4+9cdbbb2a2ed4af97/node_modules/drizzle-orm/logger.js
|
|
225762
225775
|
var ConsoleLogWriter, DefaultLogger, NoopLogger;
|
|
225763
225776
|
var init_logger3 = __esm(() => {
|
|
225764
225777
|
init_entity();
|
|
@@ -225792,7 +225805,7 @@ var init_logger3 = __esm(() => {
|
|
|
225792
225805
|
};
|
|
225793
225806
|
});
|
|
225794
225807
|
|
|
225795
|
-
// ../../node_modules/.bun/drizzle-orm@0.38.4+
|
|
225808
|
+
// ../../node_modules/.bun/drizzle-orm@0.38.4+9cdbbb2a2ed4af97/node_modules/drizzle-orm/query-promise.js
|
|
225796
225809
|
var QueryPromise;
|
|
225797
225810
|
var init_query_promise = __esm(() => {
|
|
225798
225811
|
init_entity();
|
|
@@ -225817,7 +225830,7 @@ var init_query_promise = __esm(() => {
|
|
|
225817
225830
|
};
|
|
225818
225831
|
});
|
|
225819
225832
|
|
|
225820
|
-
// ../../node_modules/.bun/drizzle-orm@0.38.4+
|
|
225833
|
+
// ../../node_modules/.bun/drizzle-orm@0.38.4+9cdbbb2a2ed4af97/node_modules/drizzle-orm/utils.js
|
|
225821
225834
|
function mapResultRow(columns, row, joinsNotNullableMap) {
|
|
225822
225835
|
const nullifyMap = {};
|
|
225823
225836
|
const result = columns.reduce((result2, { path, field }, columnIndex) => {
|
|
@@ -225976,7 +225989,7 @@ var init_utils10 = __esm(() => {
|
|
|
225976
225989
|
init_view_common();
|
|
225977
225990
|
});
|
|
225978
225991
|
|
|
225979
|
-
// ../../node_modules/.bun/drizzle-orm@0.38.4+
|
|
225992
|
+
// ../../node_modules/.bun/drizzle-orm@0.38.4+9cdbbb2a2ed4af97/node_modules/drizzle-orm/pg-core/columns/int.common.js
|
|
225980
225993
|
var PgIntColumnBaseBuilder;
|
|
225981
225994
|
var init_int_common = __esm(() => {
|
|
225982
225995
|
init_entity();
|
|
@@ -226020,7 +226033,7 @@ var init_int_common = __esm(() => {
|
|
|
226020
226033
|
};
|
|
226021
226034
|
});
|
|
226022
226035
|
|
|
226023
|
-
// ../../node_modules/.bun/drizzle-orm@0.38.4+
|
|
226036
|
+
// ../../node_modules/.bun/drizzle-orm@0.38.4+9cdbbb2a2ed4af97/node_modules/drizzle-orm/pg-core/columns/bigint.js
|
|
226024
226037
|
function bigint(a3, b2) {
|
|
226025
226038
|
const { name, config: config4 } = getColumnNameAndConfig(a3, b2);
|
|
226026
226039
|
if (config4.mode === "number") {
|
|
@@ -226075,7 +226088,7 @@ var init_bigint = __esm(() => {
|
|
|
226075
226088
|
};
|
|
226076
226089
|
});
|
|
226077
226090
|
|
|
226078
|
-
// ../../node_modules/.bun/drizzle-orm@0.38.4+
|
|
226091
|
+
// ../../node_modules/.bun/drizzle-orm@0.38.4+9cdbbb2a2ed4af97/node_modules/drizzle-orm/pg-core/columns/bigserial.js
|
|
226079
226092
|
function bigserial(a3, b2) {
|
|
226080
226093
|
const { name, config: config4 } = getColumnNameAndConfig(a3, b2);
|
|
226081
226094
|
if (config4.mode === "number") {
|
|
@@ -226132,7 +226145,7 @@ var init_bigserial = __esm(() => {
|
|
|
226132
226145
|
};
|
|
226133
226146
|
});
|
|
226134
226147
|
|
|
226135
|
-
// ../../node_modules/.bun/drizzle-orm@0.38.4+
|
|
226148
|
+
// ../../node_modules/.bun/drizzle-orm@0.38.4+9cdbbb2a2ed4af97/node_modules/drizzle-orm/pg-core/columns/boolean.js
|
|
226136
226149
|
function boolean(name) {
|
|
226137
226150
|
return new PgBooleanBuilder(name ?? "");
|
|
226138
226151
|
}
|
|
@@ -226157,7 +226170,7 @@ var init_boolean = __esm(() => {
|
|
|
226157
226170
|
};
|
|
226158
226171
|
});
|
|
226159
226172
|
|
|
226160
|
-
// ../../node_modules/.bun/drizzle-orm@0.38.4+
|
|
226173
|
+
// ../../node_modules/.bun/drizzle-orm@0.38.4+9cdbbb2a2ed4af97/node_modules/drizzle-orm/pg-core/columns/char.js
|
|
226161
226174
|
function char(a3, b2 = {}) {
|
|
226162
226175
|
const { name, config: config4 } = getColumnNameAndConfig(a3, b2);
|
|
226163
226176
|
return new PgCharBuilder(name, config4);
|
|
@@ -226188,7 +226201,7 @@ var init_char = __esm(() => {
|
|
|
226188
226201
|
};
|
|
226189
226202
|
});
|
|
226190
226203
|
|
|
226191
|
-
// ../../node_modules/.bun/drizzle-orm@0.38.4+
|
|
226204
|
+
// ../../node_modules/.bun/drizzle-orm@0.38.4+9cdbbb2a2ed4af97/node_modules/drizzle-orm/pg-core/columns/cidr.js
|
|
226192
226205
|
function cidr(name) {
|
|
226193
226206
|
return new PgCidrBuilder(name ?? "");
|
|
226194
226207
|
}
|
|
@@ -226213,7 +226226,7 @@ var init_cidr = __esm(() => {
|
|
|
226213
226226
|
};
|
|
226214
226227
|
});
|
|
226215
226228
|
|
|
226216
|
-
// ../../node_modules/.bun/drizzle-orm@0.38.4+
|
|
226229
|
+
// ../../node_modules/.bun/drizzle-orm@0.38.4+9cdbbb2a2ed4af97/node_modules/drizzle-orm/pg-core/columns/custom.js
|
|
226217
226230
|
function customType(customTypeParams) {
|
|
226218
226231
|
return (a3, b2) => {
|
|
226219
226232
|
const { name, config: config4 } = getColumnNameAndConfig(a3, b2);
|
|
@@ -226259,7 +226272,7 @@ var init_custom = __esm(() => {
|
|
|
226259
226272
|
};
|
|
226260
226273
|
});
|
|
226261
226274
|
|
|
226262
|
-
// ../../node_modules/.bun/drizzle-orm@0.38.4+
|
|
226275
|
+
// ../../node_modules/.bun/drizzle-orm@0.38.4+9cdbbb2a2ed4af97/node_modules/drizzle-orm/pg-core/columns/date.common.js
|
|
226263
226276
|
var PgDateColumnBaseBuilder;
|
|
226264
226277
|
var init_date_common = __esm(() => {
|
|
226265
226278
|
init_entity();
|
|
@@ -226273,7 +226286,7 @@ var init_date_common = __esm(() => {
|
|
|
226273
226286
|
};
|
|
226274
226287
|
});
|
|
226275
226288
|
|
|
226276
|
-
// ../../node_modules/.bun/drizzle-orm@0.38.4+
|
|
226289
|
+
// ../../node_modules/.bun/drizzle-orm@0.38.4+9cdbbb2a2ed4af97/node_modules/drizzle-orm/pg-core/columns/date.js
|
|
226277
226290
|
function date(a3, b2) {
|
|
226278
226291
|
const { name, config: config4 } = getColumnNameAndConfig(a3, b2);
|
|
226279
226292
|
if (config4?.mode === "date") {
|
|
@@ -226325,7 +226338,7 @@ var init_date = __esm(() => {
|
|
|
226325
226338
|
};
|
|
226326
226339
|
});
|
|
226327
226340
|
|
|
226328
|
-
// ../../node_modules/.bun/drizzle-orm@0.38.4+
|
|
226341
|
+
// ../../node_modules/.bun/drizzle-orm@0.38.4+9cdbbb2a2ed4af97/node_modules/drizzle-orm/pg-core/columns/double-precision.js
|
|
226329
226342
|
function doublePrecision(name) {
|
|
226330
226343
|
return new PgDoublePrecisionBuilder(name ?? "");
|
|
226331
226344
|
}
|
|
@@ -226356,7 +226369,7 @@ var init_double_precision = __esm(() => {
|
|
|
226356
226369
|
};
|
|
226357
226370
|
});
|
|
226358
226371
|
|
|
226359
|
-
// ../../node_modules/.bun/drizzle-orm@0.38.4+
|
|
226372
|
+
// ../../node_modules/.bun/drizzle-orm@0.38.4+9cdbbb2a2ed4af97/node_modules/drizzle-orm/pg-core/columns/inet.js
|
|
226360
226373
|
function inet(name) {
|
|
226361
226374
|
return new PgInetBuilder(name ?? "");
|
|
226362
226375
|
}
|
|
@@ -226381,7 +226394,7 @@ var init_inet = __esm(() => {
|
|
|
226381
226394
|
};
|
|
226382
226395
|
});
|
|
226383
226396
|
|
|
226384
|
-
// ../../node_modules/.bun/drizzle-orm@0.38.4+
|
|
226397
|
+
// ../../node_modules/.bun/drizzle-orm@0.38.4+9cdbbb2a2ed4af97/node_modules/drizzle-orm/pg-core/columns/integer.js
|
|
226385
226398
|
function integer(name) {
|
|
226386
226399
|
return new PgIntegerBuilder(name ?? "");
|
|
226387
226400
|
}
|
|
@@ -226413,7 +226426,7 @@ var init_integer = __esm(() => {
|
|
|
226413
226426
|
};
|
|
226414
226427
|
});
|
|
226415
226428
|
|
|
226416
|
-
// ../../node_modules/.bun/drizzle-orm@0.38.4+
|
|
226429
|
+
// ../../node_modules/.bun/drizzle-orm@0.38.4+9cdbbb2a2ed4af97/node_modules/drizzle-orm/pg-core/columns/interval.js
|
|
226417
226430
|
function interval(a3, b2 = {}) {
|
|
226418
226431
|
const { name, config: config4 } = getColumnNameAndConfig(a3, b2);
|
|
226419
226432
|
return new PgIntervalBuilder(name, config4);
|
|
@@ -226445,7 +226458,7 @@ var init_interval = __esm(() => {
|
|
|
226445
226458
|
};
|
|
226446
226459
|
});
|
|
226447
226460
|
|
|
226448
|
-
// ../../node_modules/.bun/drizzle-orm@0.38.4+
|
|
226461
|
+
// ../../node_modules/.bun/drizzle-orm@0.38.4+9cdbbb2a2ed4af97/node_modules/drizzle-orm/pg-core/columns/json.js
|
|
226449
226462
|
function json(name) {
|
|
226450
226463
|
return new PgJsonBuilder(name ?? "");
|
|
226451
226464
|
}
|
|
@@ -226486,7 +226499,7 @@ var init_json = __esm(() => {
|
|
|
226486
226499
|
};
|
|
226487
226500
|
});
|
|
226488
226501
|
|
|
226489
|
-
// ../../node_modules/.bun/drizzle-orm@0.38.4+
|
|
226502
|
+
// ../../node_modules/.bun/drizzle-orm@0.38.4+9cdbbb2a2ed4af97/node_modules/drizzle-orm/pg-core/columns/jsonb.js
|
|
226490
226503
|
function jsonb(name) {
|
|
226491
226504
|
return new PgJsonbBuilder(name ?? "");
|
|
226492
226505
|
}
|
|
@@ -226527,7 +226540,7 @@ var init_jsonb = __esm(() => {
|
|
|
226527
226540
|
};
|
|
226528
226541
|
});
|
|
226529
226542
|
|
|
226530
|
-
// ../../node_modules/.bun/drizzle-orm@0.38.4+
|
|
226543
|
+
// ../../node_modules/.bun/drizzle-orm@0.38.4+9cdbbb2a2ed4af97/node_modules/drizzle-orm/pg-core/columns/line.js
|
|
226531
226544
|
function line(a3, b2) {
|
|
226532
226545
|
const { name, config: config4 } = getColumnNameAndConfig(a3, b2);
|
|
226533
226546
|
if (!config4?.mode || config4.mode === "tuple") {
|
|
@@ -226586,7 +226599,7 @@ var init_line = __esm(() => {
|
|
|
226586
226599
|
};
|
|
226587
226600
|
});
|
|
226588
226601
|
|
|
226589
|
-
// ../../node_modules/.bun/drizzle-orm@0.38.4+
|
|
226602
|
+
// ../../node_modules/.bun/drizzle-orm@0.38.4+9cdbbb2a2ed4af97/node_modules/drizzle-orm/pg-core/columns/macaddr.js
|
|
226590
226603
|
function macaddr(name) {
|
|
226591
226604
|
return new PgMacaddrBuilder(name ?? "");
|
|
226592
226605
|
}
|
|
@@ -226611,7 +226624,7 @@ var init_macaddr = __esm(() => {
|
|
|
226611
226624
|
};
|
|
226612
226625
|
});
|
|
226613
226626
|
|
|
226614
|
-
// ../../node_modules/.bun/drizzle-orm@0.38.4+
|
|
226627
|
+
// ../../node_modules/.bun/drizzle-orm@0.38.4+9cdbbb2a2ed4af97/node_modules/drizzle-orm/pg-core/columns/macaddr8.js
|
|
226615
226628
|
function macaddr8(name) {
|
|
226616
226629
|
return new PgMacaddr8Builder(name ?? "");
|
|
226617
226630
|
}
|
|
@@ -226636,7 +226649,7 @@ var init_macaddr8 = __esm(() => {
|
|
|
226636
226649
|
};
|
|
226637
226650
|
});
|
|
226638
226651
|
|
|
226639
|
-
// ../../node_modules/.bun/drizzle-orm@0.38.4+
|
|
226652
|
+
// ../../node_modules/.bun/drizzle-orm@0.38.4+9cdbbb2a2ed4af97/node_modules/drizzle-orm/pg-core/columns/numeric.js
|
|
226640
226653
|
function numeric(a3, b2) {
|
|
226641
226654
|
const { name, config: config4 } = getColumnNameAndConfig(a3, b2);
|
|
226642
226655
|
return new PgNumericBuilder(name, config4?.precision, config4?.scale);
|
|
@@ -226678,7 +226691,7 @@ var init_numeric = __esm(() => {
|
|
|
226678
226691
|
};
|
|
226679
226692
|
});
|
|
226680
226693
|
|
|
226681
|
-
// ../../node_modules/.bun/drizzle-orm@0.38.4+
|
|
226694
|
+
// ../../node_modules/.bun/drizzle-orm@0.38.4+9cdbbb2a2ed4af97/node_modules/drizzle-orm/pg-core/columns/point.js
|
|
226682
226695
|
function point(a3, b2) {
|
|
226683
226696
|
const { name, config: config4 } = getColumnNameAndConfig(a3, b2);
|
|
226684
226697
|
if (!config4?.mode || config4.mode === "tuple") {
|
|
@@ -226743,7 +226756,7 @@ var init_point = __esm(() => {
|
|
|
226743
226756
|
};
|
|
226744
226757
|
});
|
|
226745
226758
|
|
|
226746
|
-
// ../../node_modules/.bun/drizzle-orm@0.38.4+
|
|
226759
|
+
// ../../node_modules/.bun/drizzle-orm@0.38.4+9cdbbb2a2ed4af97/node_modules/drizzle-orm/pg-core/columns/postgis_extension/utils.js
|
|
226747
226760
|
function hexToBytes(hex) {
|
|
226748
226761
|
const bytes2 = [];
|
|
226749
226762
|
for (let c = 0;c < hex.length; c += 2) {
|
|
@@ -226783,7 +226796,7 @@ function parseEWKB(hex) {
|
|
|
226783
226796
|
}
|
|
226784
226797
|
var init_utils11 = () => {};
|
|
226785
226798
|
|
|
226786
|
-
// ../../node_modules/.bun/drizzle-orm@0.38.4+
|
|
226799
|
+
// ../../node_modules/.bun/drizzle-orm@0.38.4+9cdbbb2a2ed4af97/node_modules/drizzle-orm/pg-core/columns/postgis_extension/geometry.js
|
|
226787
226800
|
function geometry(a3, b2) {
|
|
226788
226801
|
const { name, config: config4 } = getColumnNameAndConfig(a3, b2);
|
|
226789
226802
|
if (!config4?.mode || config4.mode === "tuple") {
|
|
@@ -226842,7 +226855,7 @@ var init_geometry = __esm(() => {
|
|
|
226842
226855
|
};
|
|
226843
226856
|
});
|
|
226844
226857
|
|
|
226845
|
-
// ../../node_modules/.bun/drizzle-orm@0.38.4+
|
|
226858
|
+
// ../../node_modules/.bun/drizzle-orm@0.38.4+9cdbbb2a2ed4af97/node_modules/drizzle-orm/pg-core/columns/real.js
|
|
226846
226859
|
function real(name) {
|
|
226847
226860
|
return new PgRealBuilder(name ?? "");
|
|
226848
226861
|
}
|
|
@@ -226877,7 +226890,7 @@ var init_real = __esm(() => {
|
|
|
226877
226890
|
};
|
|
226878
226891
|
});
|
|
226879
226892
|
|
|
226880
|
-
// ../../node_modules/.bun/drizzle-orm@0.38.4+
|
|
226893
|
+
// ../../node_modules/.bun/drizzle-orm@0.38.4+9cdbbb2a2ed4af97/node_modules/drizzle-orm/pg-core/columns/serial.js
|
|
226881
226894
|
function serial(name) {
|
|
226882
226895
|
return new PgSerialBuilder(name ?? "");
|
|
226883
226896
|
}
|
|
@@ -226904,7 +226917,7 @@ var init_serial = __esm(() => {
|
|
|
226904
226917
|
};
|
|
226905
226918
|
});
|
|
226906
226919
|
|
|
226907
|
-
// ../../node_modules/.bun/drizzle-orm@0.38.4+
|
|
226920
|
+
// ../../node_modules/.bun/drizzle-orm@0.38.4+9cdbbb2a2ed4af97/node_modules/drizzle-orm/pg-core/columns/smallint.js
|
|
226908
226921
|
function smallint(name) {
|
|
226909
226922
|
return new PgSmallIntBuilder(name ?? "");
|
|
226910
226923
|
}
|
|
@@ -226936,7 +226949,7 @@ var init_smallint = __esm(() => {
|
|
|
226936
226949
|
};
|
|
226937
226950
|
});
|
|
226938
226951
|
|
|
226939
|
-
// ../../node_modules/.bun/drizzle-orm@0.38.4+
|
|
226952
|
+
// ../../node_modules/.bun/drizzle-orm@0.38.4+9cdbbb2a2ed4af97/node_modules/drizzle-orm/pg-core/columns/smallserial.js
|
|
226940
226953
|
function smallserial(name) {
|
|
226941
226954
|
return new PgSmallSerialBuilder(name ?? "");
|
|
226942
226955
|
}
|
|
@@ -226963,7 +226976,7 @@ var init_smallserial = __esm(() => {
|
|
|
226963
226976
|
};
|
|
226964
226977
|
});
|
|
226965
226978
|
|
|
226966
|
-
// ../../node_modules/.bun/drizzle-orm@0.38.4+
|
|
226979
|
+
// ../../node_modules/.bun/drizzle-orm@0.38.4+9cdbbb2a2ed4af97/node_modules/drizzle-orm/pg-core/columns/text.js
|
|
226967
226980
|
function text(a3, b2 = {}) {
|
|
226968
226981
|
const { name, config: config4 } = getColumnNameAndConfig(a3, b2);
|
|
226969
226982
|
return new PgTextBuilder(name, config4);
|
|
@@ -226992,7 +227005,7 @@ var init_text = __esm(() => {
|
|
|
226992
227005
|
};
|
|
226993
227006
|
});
|
|
226994
227007
|
|
|
226995
|
-
// ../../node_modules/.bun/drizzle-orm@0.38.4+
|
|
227008
|
+
// ../../node_modules/.bun/drizzle-orm@0.38.4+9cdbbb2a2ed4af97/node_modules/drizzle-orm/pg-core/columns/time.js
|
|
226996
227009
|
function time(a3, b2 = {}) {
|
|
226997
227010
|
const { name, config: config4 } = getColumnNameAndConfig(a3, b2);
|
|
226998
227011
|
return new PgTimeBuilder(name, config4.withTimezone ?? false, config4.precision);
|
|
@@ -227032,7 +227045,7 @@ var init_time2 = __esm(() => {
|
|
|
227032
227045
|
};
|
|
227033
227046
|
});
|
|
227034
227047
|
|
|
227035
|
-
// ../../node_modules/.bun/drizzle-orm@0.38.4+
|
|
227048
|
+
// ../../node_modules/.bun/drizzle-orm@0.38.4+9cdbbb2a2ed4af97/node_modules/drizzle-orm/pg-core/columns/timestamp.js
|
|
227036
227049
|
function timestamp(a3, b2 = {}) {
|
|
227037
227050
|
const { name, config: config4 } = getColumnNameAndConfig(a3, b2);
|
|
227038
227051
|
if (config4?.mode === "string") {
|
|
@@ -227104,7 +227117,7 @@ var init_timestamp = __esm(() => {
|
|
|
227104
227117
|
};
|
|
227105
227118
|
});
|
|
227106
227119
|
|
|
227107
|
-
// ../../node_modules/.bun/drizzle-orm@0.38.4+
|
|
227120
|
+
// ../../node_modules/.bun/drizzle-orm@0.38.4+9cdbbb2a2ed4af97/node_modules/drizzle-orm/pg-core/columns/uuid.js
|
|
227108
227121
|
function uuid(name) {
|
|
227109
227122
|
return new PgUUIDBuilder(name ?? "");
|
|
227110
227123
|
}
|
|
@@ -227133,7 +227146,7 @@ var init_uuid = __esm(() => {
|
|
|
227133
227146
|
};
|
|
227134
227147
|
});
|
|
227135
227148
|
|
|
227136
|
-
// ../../node_modules/.bun/drizzle-orm@0.38.4+
|
|
227149
|
+
// ../../node_modules/.bun/drizzle-orm@0.38.4+9cdbbb2a2ed4af97/node_modules/drizzle-orm/pg-core/columns/varchar.js
|
|
227137
227150
|
function varchar(a3, b2 = {}) {
|
|
227138
227151
|
const { name, config: config4 } = getColumnNameAndConfig(a3, b2);
|
|
227139
227152
|
return new PgVarcharBuilder(name, config4);
|
|
@@ -227164,7 +227177,7 @@ var init_varchar = __esm(() => {
|
|
|
227164
227177
|
};
|
|
227165
227178
|
});
|
|
227166
227179
|
|
|
227167
|
-
// ../../node_modules/.bun/drizzle-orm@0.38.4+
|
|
227180
|
+
// ../../node_modules/.bun/drizzle-orm@0.38.4+9cdbbb2a2ed4af97/node_modules/drizzle-orm/pg-core/columns/vector_extension/bit.js
|
|
227168
227181
|
function bit(a3, b2) {
|
|
227169
227182
|
const { name, config: config4 } = getColumnNameAndConfig(a3, b2);
|
|
227170
227183
|
return new PgBinaryVectorBuilder(name, config4);
|
|
@@ -227193,7 +227206,7 @@ var init_bit = __esm(() => {
|
|
|
227193
227206
|
};
|
|
227194
227207
|
});
|
|
227195
227208
|
|
|
227196
|
-
// ../../node_modules/.bun/drizzle-orm@0.38.4+
|
|
227209
|
+
// ../../node_modules/.bun/drizzle-orm@0.38.4+9cdbbb2a2ed4af97/node_modules/drizzle-orm/pg-core/columns/vector_extension/halfvec.js
|
|
227197
227210
|
function halfvec(a3, b2) {
|
|
227198
227211
|
const { name, config: config4 } = getColumnNameAndConfig(a3, b2);
|
|
227199
227212
|
return new PgHalfVectorBuilder(name, config4);
|
|
@@ -227228,7 +227241,7 @@ var init_halfvec = __esm(() => {
|
|
|
227228
227241
|
};
|
|
227229
227242
|
});
|
|
227230
227243
|
|
|
227231
|
-
// ../../node_modules/.bun/drizzle-orm@0.38.4+
|
|
227244
|
+
// ../../node_modules/.bun/drizzle-orm@0.38.4+9cdbbb2a2ed4af97/node_modules/drizzle-orm/pg-core/columns/vector_extension/sparsevec.js
|
|
227232
227245
|
function sparsevec(a3, b2) {
|
|
227233
227246
|
const { name, config: config4 } = getColumnNameAndConfig(a3, b2);
|
|
227234
227247
|
return new PgSparseVectorBuilder(name, config4);
|
|
@@ -227257,7 +227270,7 @@ var init_sparsevec = __esm(() => {
|
|
|
227257
227270
|
};
|
|
227258
227271
|
});
|
|
227259
227272
|
|
|
227260
|
-
// ../../node_modules/.bun/drizzle-orm@0.38.4+
|
|
227273
|
+
// ../../node_modules/.bun/drizzle-orm@0.38.4+9cdbbb2a2ed4af97/node_modules/drizzle-orm/pg-core/columns/vector_extension/vector.js
|
|
227261
227274
|
function vector(a3, b2) {
|
|
227262
227275
|
const { name, config: config4 } = getColumnNameAndConfig(a3, b2);
|
|
227263
227276
|
return new PgVectorBuilder(name, config4);
|
|
@@ -227292,7 +227305,7 @@ var init_vector = __esm(() => {
|
|
|
227292
227305
|
};
|
|
227293
227306
|
});
|
|
227294
227307
|
|
|
227295
|
-
// ../../node_modules/.bun/drizzle-orm@0.38.4+
|
|
227308
|
+
// ../../node_modules/.bun/drizzle-orm@0.38.4+9cdbbb2a2ed4af97/node_modules/drizzle-orm/pg-core/columns/all.js
|
|
227296
227309
|
function getPgColumnBuilders() {
|
|
227297
227310
|
return {
|
|
227298
227311
|
bigint,
|
|
@@ -227364,7 +227377,7 @@ var init_all = __esm(() => {
|
|
|
227364
227377
|
init_vector();
|
|
227365
227378
|
});
|
|
227366
227379
|
|
|
227367
|
-
// ../../node_modules/.bun/drizzle-orm@0.38.4+
|
|
227380
|
+
// ../../node_modules/.bun/drizzle-orm@0.38.4+9cdbbb2a2ed4af97/node_modules/drizzle-orm/pg-core/table.js
|
|
227368
227381
|
function pgTableWithSchema(name, columns, extraConfig, schema, baseName = name) {
|
|
227369
227382
|
const rawTable = new PgTable(name, schema, baseName);
|
|
227370
227383
|
const parsedColumns = typeof columns === "function" ? columns(getPgColumnBuilders()) : columns;
|
|
@@ -227415,7 +227428,7 @@ var init_table2 = __esm(() => {
|
|
|
227415
227428
|
};
|
|
227416
227429
|
});
|
|
227417
227430
|
|
|
227418
|
-
// ../../node_modules/.bun/drizzle-orm@0.38.4+
|
|
227431
|
+
// ../../node_modules/.bun/drizzle-orm@0.38.4+9cdbbb2a2ed4af97/node_modules/drizzle-orm/pg-core/primary-keys.js
|
|
227419
227432
|
function primaryKey(...config4) {
|
|
227420
227433
|
if (config4[0].columns) {
|
|
227421
227434
|
return new PrimaryKeyBuilder(config4[0].columns, config4[0].name);
|
|
@@ -227453,7 +227466,7 @@ var init_primary_keys = __esm(() => {
|
|
|
227453
227466
|
};
|
|
227454
227467
|
});
|
|
227455
227468
|
|
|
227456
|
-
// ../../node_modules/.bun/drizzle-orm@0.38.4+
|
|
227469
|
+
// ../../node_modules/.bun/drizzle-orm@0.38.4+9cdbbb2a2ed4af97/node_modules/drizzle-orm/relations.js
|
|
227457
227470
|
function getOperators() {
|
|
227458
227471
|
return {
|
|
227459
227472
|
and: and2,
|
|
@@ -227685,7 +227698,7 @@ var init_relations = __esm(() => {
|
|
|
227685
227698
|
};
|
|
227686
227699
|
});
|
|
227687
227700
|
|
|
227688
|
-
// ../../node_modules/.bun/drizzle-orm@0.38.4+
|
|
227701
|
+
// ../../node_modules/.bun/drizzle-orm@0.38.4+9cdbbb2a2ed4af97/node_modules/drizzle-orm/sql/functions/aggregate.js
|
|
227689
227702
|
function count2(expression) {
|
|
227690
227703
|
return sql`count(${expression || sql.raw("*")})`.mapWith(Number);
|
|
227691
227704
|
}
|
|
@@ -227693,23 +227706,23 @@ var init_aggregate = __esm(() => {
|
|
|
227693
227706
|
init_sql();
|
|
227694
227707
|
});
|
|
227695
227708
|
|
|
227696
|
-
// ../../node_modules/.bun/drizzle-orm@0.38.4+
|
|
227709
|
+
// ../../node_modules/.bun/drizzle-orm@0.38.4+9cdbbb2a2ed4af97/node_modules/drizzle-orm/sql/functions/vector.js
|
|
227697
227710
|
var init_vector2 = () => {};
|
|
227698
227711
|
|
|
227699
|
-
// ../../node_modules/.bun/drizzle-orm@0.38.4+
|
|
227712
|
+
// ../../node_modules/.bun/drizzle-orm@0.38.4+9cdbbb2a2ed4af97/node_modules/drizzle-orm/sql/functions/index.js
|
|
227700
227713
|
var init_functions2 = __esm(() => {
|
|
227701
227714
|
init_aggregate();
|
|
227702
227715
|
init_vector2();
|
|
227703
227716
|
});
|
|
227704
227717
|
|
|
227705
|
-
// ../../node_modules/.bun/drizzle-orm@0.38.4+
|
|
227718
|
+
// ../../node_modules/.bun/drizzle-orm@0.38.4+9cdbbb2a2ed4af97/node_modules/drizzle-orm/sql/index.js
|
|
227706
227719
|
var init_sql2 = __esm(() => {
|
|
227707
227720
|
init_expressions();
|
|
227708
227721
|
init_functions2();
|
|
227709
227722
|
init_sql();
|
|
227710
227723
|
});
|
|
227711
227724
|
|
|
227712
|
-
// ../../node_modules/.bun/drizzle-orm@0.38.4+
|
|
227725
|
+
// ../../node_modules/.bun/drizzle-orm@0.38.4+9cdbbb2a2ed4af97/node_modules/drizzle-orm/index.js
|
|
227713
227726
|
var init_drizzle_orm = __esm(() => {
|
|
227714
227727
|
init_alias();
|
|
227715
227728
|
init_column_builder();
|
|
@@ -227727,10 +227740,10 @@ var init_drizzle_orm = __esm(() => {
|
|
|
227727
227740
|
init_view_common();
|
|
227728
227741
|
});
|
|
227729
227742
|
|
|
227730
|
-
// ../../node_modules/.bun/drizzle-orm@0.38.4+
|
|
227743
|
+
// ../../node_modules/.bun/drizzle-orm@0.38.4+9cdbbb2a2ed4af97/node_modules/drizzle-orm/pg-core/alias.js
|
|
227731
227744
|
var init_alias2 = () => {};
|
|
227732
227745
|
|
|
227733
|
-
// ../../node_modules/.bun/drizzle-orm@0.38.4+
|
|
227746
|
+
// ../../node_modules/.bun/drizzle-orm@0.38.4+9cdbbb2a2ed4af97/node_modules/drizzle-orm/pg-core/checks.js
|
|
227734
227747
|
function check(name, value) {
|
|
227735
227748
|
return new CheckBuilder(name, value);
|
|
227736
227749
|
}
|
|
@@ -227760,7 +227773,7 @@ var init_checks = __esm(() => {
|
|
|
227760
227773
|
};
|
|
227761
227774
|
});
|
|
227762
227775
|
|
|
227763
|
-
// ../../node_modules/.bun/drizzle-orm@0.38.4+
|
|
227776
|
+
// ../../node_modules/.bun/drizzle-orm@0.38.4+9cdbbb2a2ed4af97/node_modules/drizzle-orm/pg-core/columns/index.js
|
|
227764
227777
|
var init_columns = __esm(() => {
|
|
227765
227778
|
init_bigint();
|
|
227766
227779
|
init_bigserial();
|
|
@@ -227799,7 +227812,7 @@ var init_columns = __esm(() => {
|
|
|
227799
227812
|
init_vector();
|
|
227800
227813
|
});
|
|
227801
227814
|
|
|
227802
|
-
// ../../node_modules/.bun/drizzle-orm@0.38.4+
|
|
227815
|
+
// ../../node_modules/.bun/drizzle-orm@0.38.4+9cdbbb2a2ed4af97/node_modules/drizzle-orm/pg-core/query-builders/delete.js
|
|
227803
227816
|
var PgDeleteBase;
|
|
227804
227817
|
var init_delete = __esm(() => {
|
|
227805
227818
|
init_entity();
|
|
@@ -227855,7 +227868,7 @@ var init_delete = __esm(() => {
|
|
|
227855
227868
|
};
|
|
227856
227869
|
});
|
|
227857
227870
|
|
|
227858
|
-
// ../../node_modules/.bun/drizzle-orm@0.38.4+
|
|
227871
|
+
// ../../node_modules/.bun/drizzle-orm@0.38.4+9cdbbb2a2ed4af97/node_modules/drizzle-orm/casing.js
|
|
227859
227872
|
function toSnakeCase(input) {
|
|
227860
227873
|
const words = input.replace(/['\u2019]/g, "").match(/[\da-z]+|[A-Z]+(?![a-z])|[A-Z][\da-z]+/g) ?? [];
|
|
227861
227874
|
return words.map((word) => word.toLowerCase()).join("_");
|
|
@@ -227912,7 +227925,7 @@ var init_casing = __esm(() => {
|
|
|
227912
227925
|
};
|
|
227913
227926
|
});
|
|
227914
227927
|
|
|
227915
|
-
// ../../node_modules/.bun/drizzle-orm@0.38.4+
|
|
227928
|
+
// ../../node_modules/.bun/drizzle-orm@0.38.4+9cdbbb2a2ed4af97/node_modules/drizzle-orm/pg-core/view-base.js
|
|
227916
227929
|
var PgViewBase;
|
|
227917
227930
|
var init_view_base = __esm(() => {
|
|
227918
227931
|
init_entity();
|
|
@@ -227922,7 +227935,7 @@ var init_view_base = __esm(() => {
|
|
|
227922
227935
|
};
|
|
227923
227936
|
});
|
|
227924
227937
|
|
|
227925
|
-
// ../../node_modules/.bun/drizzle-orm@0.38.4+
|
|
227938
|
+
// ../../node_modules/.bun/drizzle-orm@0.38.4+9cdbbb2a2ed4af97/node_modules/drizzle-orm/pg-core/dialect.js
|
|
227926
227939
|
var PgDialect;
|
|
227927
227940
|
var init_dialect = __esm(() => {
|
|
227928
227941
|
init_alias();
|
|
@@ -228497,7 +228510,7 @@ var init_dialect = __esm(() => {
|
|
|
228497
228510
|
};
|
|
228498
228511
|
});
|
|
228499
228512
|
|
|
228500
|
-
// ../../node_modules/.bun/drizzle-orm@0.38.4+
|
|
228513
|
+
// ../../node_modules/.bun/drizzle-orm@0.38.4+9cdbbb2a2ed4af97/node_modules/drizzle-orm/selection-proxy.js
|
|
228501
228514
|
var SelectionProxyHandler;
|
|
228502
228515
|
var init_selection_proxy = __esm(() => {
|
|
228503
228516
|
init_alias();
|
|
@@ -228558,7 +228571,7 @@ var init_selection_proxy = __esm(() => {
|
|
|
228558
228571
|
};
|
|
228559
228572
|
});
|
|
228560
228573
|
|
|
228561
|
-
// ../../node_modules/.bun/drizzle-orm@0.38.4+
|
|
228574
|
+
// ../../node_modules/.bun/drizzle-orm@0.38.4+9cdbbb2a2ed4af97/node_modules/drizzle-orm/query-builders/query-builder.js
|
|
228562
228575
|
var TypedQueryBuilder;
|
|
228563
228576
|
var init_query_builder = __esm(() => {
|
|
228564
228577
|
init_entity();
|
|
@@ -228570,7 +228583,7 @@ var init_query_builder = __esm(() => {
|
|
|
228570
228583
|
};
|
|
228571
228584
|
});
|
|
228572
228585
|
|
|
228573
|
-
// ../../node_modules/.bun/drizzle-orm@0.38.4+
|
|
228586
|
+
// ../../node_modules/.bun/drizzle-orm@0.38.4+9cdbbb2a2ed4af97/node_modules/drizzle-orm/pg-core/query-builders/select.js
|
|
228574
228587
|
function createSetOperator(type, isAll) {
|
|
228575
228588
|
return (leftSelect, rightSelect, ...restSelects) => {
|
|
228576
228589
|
const setOperators = [rightSelect, ...restSelects].map((select2) => ({
|
|
@@ -228870,7 +228883,7 @@ var init_select2 = __esm(() => {
|
|
|
228870
228883
|
exceptAll = createSetOperator("except", true);
|
|
228871
228884
|
});
|
|
228872
228885
|
|
|
228873
|
-
// ../../node_modules/.bun/drizzle-orm@0.38.4+
|
|
228886
|
+
// ../../node_modules/.bun/drizzle-orm@0.38.4+9cdbbb2a2ed4af97/node_modules/drizzle-orm/pg-core/query-builders/query-builder.js
|
|
228874
228887
|
var QueryBuilder;
|
|
228875
228888
|
var init_query_builder2 = __esm(() => {
|
|
228876
228889
|
init_entity();
|
|
@@ -228957,7 +228970,7 @@ var init_query_builder2 = __esm(() => {
|
|
|
228957
228970
|
};
|
|
228958
228971
|
});
|
|
228959
228972
|
|
|
228960
|
-
// ../../node_modules/.bun/drizzle-orm@0.38.4+
|
|
228973
|
+
// ../../node_modules/.bun/drizzle-orm@0.38.4+9cdbbb2a2ed4af97/node_modules/drizzle-orm/pg-core/query-builders/insert.js
|
|
228961
228974
|
var PgInsertBuilder, PgInsertBase;
|
|
228962
228975
|
var init_insert = __esm(() => {
|
|
228963
228976
|
init_entity();
|
|
@@ -229077,7 +229090,7 @@ var init_insert = __esm(() => {
|
|
|
229077
229090
|
};
|
|
229078
229091
|
});
|
|
229079
229092
|
|
|
229080
|
-
// ../../node_modules/.bun/drizzle-orm@0.38.4+
|
|
229093
|
+
// ../../node_modules/.bun/drizzle-orm@0.38.4+9cdbbb2a2ed4af97/node_modules/drizzle-orm/pg-core/query-builders/refresh-materialized-view.js
|
|
229081
229094
|
var PgRefreshMaterializedView;
|
|
229082
229095
|
var init_refresh_materialized_view = __esm(() => {
|
|
229083
229096
|
init_entity();
|
|
@@ -229134,7 +229147,7 @@ var init_refresh_materialized_view = __esm(() => {
|
|
|
229134
229147
|
};
|
|
229135
229148
|
});
|
|
229136
229149
|
|
|
229137
|
-
// ../../node_modules/.bun/drizzle-orm@0.38.4+
|
|
229150
|
+
// ../../node_modules/.bun/drizzle-orm@0.38.4+9cdbbb2a2ed4af97/node_modules/drizzle-orm/pg-core/query-builders/update.js
|
|
229138
229151
|
var PgUpdateBuilder, PgUpdateBase;
|
|
229139
229152
|
var init_update = __esm(() => {
|
|
229140
229153
|
init_entity();
|
|
@@ -229286,7 +229299,7 @@ var init_update = __esm(() => {
|
|
|
229286
229299
|
};
|
|
229287
229300
|
});
|
|
229288
229301
|
|
|
229289
|
-
// ../../node_modules/.bun/drizzle-orm@0.38.4+
|
|
229302
|
+
// ../../node_modules/.bun/drizzle-orm@0.38.4+9cdbbb2a2ed4af97/node_modules/drizzle-orm/pg-core/query-builders/index.js
|
|
229290
229303
|
var init_query_builders = __esm(() => {
|
|
229291
229304
|
init_delete();
|
|
229292
229305
|
init_insert();
|
|
@@ -229296,7 +229309,7 @@ var init_query_builders = __esm(() => {
|
|
|
229296
229309
|
init_update();
|
|
229297
229310
|
});
|
|
229298
229311
|
|
|
229299
|
-
// ../../node_modules/.bun/drizzle-orm@0.38.4+
|
|
229312
|
+
// ../../node_modules/.bun/drizzle-orm@0.38.4+9cdbbb2a2ed4af97/node_modules/drizzle-orm/pg-core/query-builders/count.js
|
|
229300
229313
|
var PgCountBuilder;
|
|
229301
229314
|
var init_count = __esm(() => {
|
|
229302
229315
|
init_entity();
|
|
@@ -229342,7 +229355,7 @@ var init_count = __esm(() => {
|
|
|
229342
229355
|
};
|
|
229343
229356
|
});
|
|
229344
229357
|
|
|
229345
|
-
// ../../node_modules/.bun/drizzle-orm@0.38.4+
|
|
229358
|
+
// ../../node_modules/.bun/drizzle-orm@0.38.4+9cdbbb2a2ed4af97/node_modules/drizzle-orm/pg-core/query-builders/query.js
|
|
229346
229359
|
var RelationalQueryBuilder, PgRelationalQuery;
|
|
229347
229360
|
var init_query = __esm(() => {
|
|
229348
229361
|
init_entity();
|
|
@@ -229431,7 +229444,7 @@ var init_query = __esm(() => {
|
|
|
229431
229444
|
};
|
|
229432
229445
|
});
|
|
229433
229446
|
|
|
229434
|
-
// ../../node_modules/.bun/drizzle-orm@0.38.4+
|
|
229447
|
+
// ../../node_modules/.bun/drizzle-orm@0.38.4+9cdbbb2a2ed4af97/node_modules/drizzle-orm/pg-core/query-builders/raw.js
|
|
229435
229448
|
var PgRaw;
|
|
229436
229449
|
var init_raw = __esm(() => {
|
|
229437
229450
|
init_entity();
|
|
@@ -229463,7 +229476,7 @@ var init_raw = __esm(() => {
|
|
|
229463
229476
|
};
|
|
229464
229477
|
});
|
|
229465
229478
|
|
|
229466
|
-
// ../../node_modules/.bun/drizzle-orm@0.38.4+
|
|
229479
|
+
// ../../node_modules/.bun/drizzle-orm@0.38.4+9cdbbb2a2ed4af97/node_modules/drizzle-orm/pg-core/db.js
|
|
229467
229480
|
var PgDatabase;
|
|
229468
229481
|
var init_db = __esm(() => {
|
|
229469
229482
|
init_entity();
|
|
@@ -229600,7 +229613,7 @@ var init_db = __esm(() => {
|
|
|
229600
229613
|
};
|
|
229601
229614
|
});
|
|
229602
229615
|
|
|
229603
|
-
// ../../node_modules/.bun/drizzle-orm@0.38.4+
|
|
229616
|
+
// ../../node_modules/.bun/drizzle-orm@0.38.4+9cdbbb2a2ed4af97/node_modules/drizzle-orm/pg-core/indexes.js
|
|
229604
229617
|
function index(name) {
|
|
229605
229618
|
return new IndexBuilderOn(false, name);
|
|
229606
229619
|
}
|
|
@@ -229689,31 +229702,31 @@ var init_indexes = __esm(() => {
|
|
|
229689
229702
|
};
|
|
229690
229703
|
});
|
|
229691
229704
|
|
|
229692
|
-
// ../../node_modules/.bun/drizzle-orm@0.38.4+
|
|
229705
|
+
// ../../node_modules/.bun/drizzle-orm@0.38.4+9cdbbb2a2ed4af97/node_modules/drizzle-orm/pg-core/policies.js
|
|
229693
229706
|
var init_policies = () => {};
|
|
229694
229707
|
|
|
229695
|
-
// ../../node_modules/.bun/drizzle-orm@0.38.4+
|
|
229708
|
+
// ../../node_modules/.bun/drizzle-orm@0.38.4+9cdbbb2a2ed4af97/node_modules/drizzle-orm/pg-core/roles.js
|
|
229696
229709
|
var init_roles = () => {};
|
|
229697
229710
|
|
|
229698
|
-
// ../../node_modules/.bun/drizzle-orm@0.38.4+
|
|
229711
|
+
// ../../node_modules/.bun/drizzle-orm@0.38.4+9cdbbb2a2ed4af97/node_modules/drizzle-orm/pg-core/sequence.js
|
|
229699
229712
|
var init_sequence = () => {};
|
|
229700
229713
|
|
|
229701
|
-
// ../../node_modules/.bun/drizzle-orm@0.38.4+
|
|
229714
|
+
// ../../node_modules/.bun/drizzle-orm@0.38.4+9cdbbb2a2ed4af97/node_modules/drizzle-orm/pg-core/view-common.js
|
|
229702
229715
|
var PgViewConfig;
|
|
229703
229716
|
var init_view_common2 = __esm(() => {
|
|
229704
229717
|
PgViewConfig = Symbol.for("drizzle:PgViewConfig");
|
|
229705
229718
|
});
|
|
229706
229719
|
|
|
229707
|
-
// ../../node_modules/.bun/drizzle-orm@0.38.4+
|
|
229720
|
+
// ../../node_modules/.bun/drizzle-orm@0.38.4+9cdbbb2a2ed4af97/node_modules/drizzle-orm/pg-core/view.js
|
|
229708
229721
|
var PgMaterializedViewConfig;
|
|
229709
229722
|
var init_view = __esm(() => {
|
|
229710
229723
|
PgMaterializedViewConfig = Symbol.for("drizzle:PgMaterializedViewConfig");
|
|
229711
229724
|
});
|
|
229712
229725
|
|
|
229713
|
-
// ../../node_modules/.bun/drizzle-orm@0.38.4+
|
|
229726
|
+
// ../../node_modules/.bun/drizzle-orm@0.38.4+9cdbbb2a2ed4af97/node_modules/drizzle-orm/pg-core/schema.js
|
|
229714
229727
|
var init_schema = () => {};
|
|
229715
229728
|
|
|
229716
|
-
// ../../node_modules/.bun/drizzle-orm@0.38.4+
|
|
229729
|
+
// ../../node_modules/.bun/drizzle-orm@0.38.4+9cdbbb2a2ed4af97/node_modules/drizzle-orm/pg-core/session.js
|
|
229717
229730
|
var PgPreparedQuery, PgSession, PgTransaction;
|
|
229718
229731
|
var init_session3 = __esm(() => {
|
|
229719
229732
|
init_entity();
|
|
@@ -229789,15 +229802,15 @@ var init_session3 = __esm(() => {
|
|
|
229789
229802
|
};
|
|
229790
229803
|
});
|
|
229791
229804
|
|
|
229792
|
-
// ../../node_modules/.bun/drizzle-orm@0.38.4+
|
|
229805
|
+
// ../../node_modules/.bun/drizzle-orm@0.38.4+9cdbbb2a2ed4af97/node_modules/drizzle-orm/pg-core/utils.js
|
|
229793
229806
|
var init_utils12 = () => {};
|
|
229794
229807
|
|
|
229795
|
-
// ../../node_modules/.bun/drizzle-orm@0.38.4+
|
|
229808
|
+
// ../../node_modules/.bun/drizzle-orm@0.38.4+9cdbbb2a2ed4af97/node_modules/drizzle-orm/pg-core/utils/index.js
|
|
229796
229809
|
var init_utils13 = __esm(() => {
|
|
229797
229810
|
init_array();
|
|
229798
229811
|
});
|
|
229799
229812
|
|
|
229800
|
-
// ../../node_modules/.bun/drizzle-orm@0.38.4+
|
|
229813
|
+
// ../../node_modules/.bun/drizzle-orm@0.38.4+9cdbbb2a2ed4af97/node_modules/drizzle-orm/pg-core/index.js
|
|
229801
229814
|
var init_pg_core = __esm(() => {
|
|
229802
229815
|
init_alias2();
|
|
229803
229816
|
init_checks();
|
|
@@ -229933,6 +229946,7 @@ var init_schema2 = __esm(() => {
|
|
|
229933
229946
|
"telegram",
|
|
229934
229947
|
"a2a",
|
|
229935
229948
|
"gupshup",
|
|
229949
|
+
"twilio-whatsapp",
|
|
229936
229950
|
"internal"
|
|
229937
229951
|
];
|
|
229938
229952
|
agentTypes = ["agent", "team", "workflow"];
|
|
@@ -230190,6 +230204,13 @@ var init_schema2 = __esm(() => {
|
|
|
230190
230204
|
gupshupAuthToken: text("gupshup_auth_token"),
|
|
230191
230205
|
gupshupEventId: varchar("gupshup_event_id", { length: 255 }),
|
|
230192
230206
|
webhookVerifyToken: text("webhook_verify_token"),
|
|
230207
|
+
twilioAccountSid: varchar("twilio_account_sid", { length: 34 }),
|
|
230208
|
+
twilioAuthToken: text("twilio_auth_token"),
|
|
230209
|
+
twilioFrom: varchar("twilio_from", { length: 64 }),
|
|
230210
|
+
twilioMessagingServiceSid: varchar("twilio_messaging_service_sid", { length: 34 }),
|
|
230211
|
+
twilioStatusCallbackUrl: text("twilio_status_callback_url"),
|
|
230212
|
+
twilioWebhookUrl: text("twilio_webhook_url"),
|
|
230213
|
+
twilioValidateSignature: boolean("twilio_validate_signature").notNull().default(true),
|
|
230193
230214
|
agentId: uuid("agent_id").references(() => agents.id, { onDelete: "set null" }),
|
|
230194
230215
|
agentTimeout: integer("agent_timeout").notNull().default(60),
|
|
230195
230216
|
agentStreamMode: boolean("agent_stream_mode").notNull().default(false),
|
|
@@ -233204,7 +233225,7 @@ var init_src4 = __esm(() => {
|
|
|
233204
233225
|
src_default5 = Postgres;
|
|
233205
233226
|
});
|
|
233206
233227
|
|
|
233207
|
-
// ../../node_modules/.bun/drizzle-orm@0.38.4+
|
|
233228
|
+
// ../../node_modules/.bun/drizzle-orm@0.38.4+9cdbbb2a2ed4af97/node_modules/drizzle-orm/postgres-js/session.js
|
|
233208
233229
|
var PostgresJsPreparedQuery, PostgresJsSession, PostgresJsTransaction;
|
|
233209
233230
|
var init_session4 = __esm(() => {
|
|
233210
233231
|
init_entity();
|
|
@@ -233320,7 +233341,7 @@ var init_session4 = __esm(() => {
|
|
|
233320
233341
|
};
|
|
233321
233342
|
});
|
|
233322
233343
|
|
|
233323
|
-
// ../../node_modules/.bun/drizzle-orm@0.38.4+
|
|
233344
|
+
// ../../node_modules/.bun/drizzle-orm@0.38.4+9cdbbb2a2ed4af97/node_modules/drizzle-orm/postgres-js/driver.js
|
|
233324
233345
|
function construct(client, config4 = {}) {
|
|
233325
233346
|
const transparentParser = (val) => val;
|
|
233326
233347
|
for (const type of ["1184", "1082", "1083", "1114"]) {
|
|
@@ -233395,7 +233416,7 @@ var init_driver = __esm(() => {
|
|
|
233395
233416
|
})(drizzle || (drizzle = {}));
|
|
233396
233417
|
});
|
|
233397
233418
|
|
|
233398
|
-
// ../../node_modules/.bun/drizzle-orm@0.38.4+
|
|
233419
|
+
// ../../node_modules/.bun/drizzle-orm@0.38.4+9cdbbb2a2ed4af97/node_modules/drizzle-orm/postgres-js/index.js
|
|
233399
233420
|
var init_postgres_js = __esm(() => {
|
|
233400
233421
|
init_driver();
|
|
233401
233422
|
init_session4();
|
|
@@ -233437,7 +233458,7 @@ var init_client5 = __esm(() => {
|
|
|
233437
233458
|
init_schema2();
|
|
233438
233459
|
});
|
|
233439
233460
|
|
|
233440
|
-
// ../../node_modules/.bun/drizzle-orm@0.38.4+
|
|
233461
|
+
// ../../node_modules/.bun/drizzle-orm@0.38.4+9cdbbb2a2ed4af97/node_modules/drizzle-orm/migrator.js
|
|
233441
233462
|
import crypto4 from "crypto";
|
|
233442
233463
|
import fs7 from "fs";
|
|
233443
233464
|
function readMigrationFiles(config4) {
|
|
@@ -233470,7 +233491,7 @@ function readMigrationFiles(config4) {
|
|
|
233470
233491
|
}
|
|
233471
233492
|
var init_migrator = () => {};
|
|
233472
233493
|
|
|
233473
|
-
// ../../node_modules/.bun/drizzle-orm@0.38.4+
|
|
233494
|
+
// ../../node_modules/.bun/drizzle-orm@0.38.4+9cdbbb2a2ed4af97/node_modules/drizzle-orm/postgres-js/migrator.js
|
|
233474
233495
|
async function migrate(db2, config4) {
|
|
233475
233496
|
const migrations = readMigrationFiles(config4);
|
|
233476
233497
|
await db2.dialect.migrate(migrations, db2.session, config4);
|
|
@@ -283000,7 +283021,7 @@ function whatsappChatType(chatId) {
|
|
|
283000
283021
|
return "dm";
|
|
283001
283022
|
}
|
|
283002
283023
|
function determineChatType(chatId, channel4, rawPayload) {
|
|
283003
|
-
if (channel4 === "whatsapp" || channel4 === "whatsapp-baileys" || channel4 === "whatsapp-cloud") {
|
|
283024
|
+
if (channel4 === "whatsapp" || channel4 === "whatsapp-baileys" || channel4 === "whatsapp-cloud" || channel4 === "twilio-whatsapp") {
|
|
283004
283025
|
return whatsappChatType(chatId);
|
|
283005
283026
|
}
|
|
283006
283027
|
if (channel4 === "telegram") {
|
|
@@ -285348,6 +285369,7 @@ var init_agent_dispatcher = __esm(() => {
|
|
|
285348
285369
|
discord: 2000,
|
|
285349
285370
|
"whatsapp-baileys": 65536,
|
|
285350
285371
|
"whatsapp-cloud": 65536,
|
|
285372
|
+
"twilio-whatsapp": 1600,
|
|
285351
285373
|
slack: 40000,
|
|
285352
285374
|
telegram: 4096
|
|
285353
285375
|
};
|
|
@@ -293053,6 +293075,12 @@ var init_access3 = __esm(() => {
|
|
|
293053
293075
|
platformUserId: exports_external.string().describe("Platform user ID to check"),
|
|
293054
293076
|
channel: exports_external.string().describe("Channel type")
|
|
293055
293077
|
});
|
|
293078
|
+
accessRoutes.get("/", zValidator("query", listQuerySchema), async (c) => {
|
|
293079
|
+
const { instanceId, type } = c.req.valid("query");
|
|
293080
|
+
const services = c.get("services");
|
|
293081
|
+
const rules = await services.access.list({ instanceId, type });
|
|
293082
|
+
return c.json({ items: rules });
|
|
293083
|
+
});
|
|
293056
293084
|
accessRoutes.get("/rules", zValidator("query", listQuerySchema), async (c) => {
|
|
293057
293085
|
const { instanceId, type } = c.req.valid("query");
|
|
293058
293086
|
const services = c.get("services");
|
|
@@ -294946,6 +294974,14 @@ var init_event_ops3 = __esm(() => {
|
|
|
294946
294974
|
skipProcessed: exports_external.boolean().optional(),
|
|
294947
294975
|
dryRun: exports_external.boolean().optional()
|
|
294948
294976
|
});
|
|
294977
|
+
eventOpsRoutes.get("/", (c) => {
|
|
294978
|
+
return c.json({
|
|
294979
|
+
error: {
|
|
294980
|
+
code: "NOT_FOUND",
|
|
294981
|
+
message: "event-ops has no list endpoint. Use /v2/event-ops/metrics, /v2/event-ops/replay, or POST /v2/event-ops/scheduled."
|
|
294982
|
+
}
|
|
294983
|
+
}, 404);
|
|
294984
|
+
});
|
|
294949
294985
|
eventOpsRoutes.get("/metrics", async (c) => {
|
|
294950
294986
|
const services = c.get("services");
|
|
294951
294987
|
const metrics2 = await services.eventOps.getMetrics();
|
|
@@ -296591,15 +296627,17 @@ function shouldApplyDefaultReplyFilter(args) {
|
|
|
296591
296627
|
return true;
|
|
296592
296628
|
}
|
|
296593
296629
|
function resolveChannelToken(data) {
|
|
296594
|
-
if (data.token && !data.telegramBotToken && !data.discordBotToken && !data.slackBotToken) {
|
|
296630
|
+
if (data.token && !data.telegramBotToken && !data.discordBotToken && !data.slackBotToken && !data.twilioAuthToken) {
|
|
296595
296631
|
if (data.channel === "telegram")
|
|
296596
296632
|
data.telegramBotToken = data.token;
|
|
296597
296633
|
else if (data.channel === "discord")
|
|
296598
296634
|
data.discordBotToken = data.token;
|
|
296599
296635
|
else if (data.channel === "slack")
|
|
296600
296636
|
data.slackBotToken = data.token;
|
|
296637
|
+
else if (data.channel === "twilio-whatsapp")
|
|
296638
|
+
data.twilioAuthToken = data.token;
|
|
296601
296639
|
}
|
|
296602
|
-
return data.token ?? data.telegramBotToken ?? data.discordBotToken ?? data.slackBotToken ?? undefined;
|
|
296640
|
+
return data.token ?? data.telegramBotToken ?? data.discordBotToken ?? data.slackBotToken ?? data.twilioAuthToken ?? undefined;
|
|
296603
296641
|
}
|
|
296604
296642
|
function persistedTokenForChannel(instance4) {
|
|
296605
296643
|
switch (instance4.channel) {
|
|
@@ -296609,6 +296647,8 @@ function persistedTokenForChannel(instance4) {
|
|
|
296609
296647
|
return instance4.discordBotToken ?? undefined;
|
|
296610
296648
|
case "slack":
|
|
296611
296649
|
return instance4.slackBotToken ?? undefined;
|
|
296650
|
+
case "twilio-whatsapp":
|
|
296651
|
+
return instance4.twilioAuthToken ?? undefined;
|
|
296612
296652
|
default:
|
|
296613
296653
|
return;
|
|
296614
296654
|
}
|
|
@@ -296656,28 +296696,58 @@ function channelTokenField(channel4) {
|
|
|
296656
296696
|
return;
|
|
296657
296697
|
}
|
|
296658
296698
|
}
|
|
296659
|
-
function
|
|
296660
|
-
|
|
296661
|
-
|
|
296662
|
-
|
|
296699
|
+
function applyTelegramConnectionOptions(options, input) {
|
|
296700
|
+
options.telegramReactionLevel = input.telegramReactionLevel;
|
|
296701
|
+
}
|
|
296702
|
+
function applySlackConnectionOptions(options, input) {
|
|
296703
|
+
if (input.token)
|
|
296704
|
+
options.botToken = input.token;
|
|
296705
|
+
if (input.slackAppToken)
|
|
296706
|
+
options.appToken = input.slackAppToken;
|
|
296707
|
+
if (input.slackSigningSecret)
|
|
296708
|
+
options.signingSecret = input.slackSigningSecret;
|
|
296709
|
+
}
|
|
296710
|
+
function applyGupshupConnectionOptions(options, input) {
|
|
296711
|
+
if (input.gupshupCallbackUrl)
|
|
296712
|
+
options.gupshupCallbackUrl = input.gupshupCallbackUrl;
|
|
296713
|
+
if (input.gupshupAuthToken)
|
|
296714
|
+
options.gupshupAuthToken = input.gupshupAuthToken;
|
|
296715
|
+
if (input.gupshupEventId)
|
|
296716
|
+
options.gupshupEventId = input.gupshupEventId;
|
|
296717
|
+
if (input.webhookVerifyToken)
|
|
296718
|
+
options.webhookVerifyToken = input.webhookVerifyToken;
|
|
296719
|
+
}
|
|
296720
|
+
function applyTwilioWhatsAppConnectionOptions(options, input) {
|
|
296721
|
+
if (input.twilioAccountSid)
|
|
296722
|
+
options.twilioAccountSid = input.twilioAccountSid;
|
|
296723
|
+
if (input.twilioAuthToken)
|
|
296724
|
+
options.twilioAuthToken = input.twilioAuthToken;
|
|
296725
|
+
if (input.twilioFrom)
|
|
296726
|
+
options.twilioFrom = input.twilioFrom;
|
|
296727
|
+
if (input.twilioMessagingServiceSid)
|
|
296728
|
+
options.twilioMessagingServiceSid = input.twilioMessagingServiceSid;
|
|
296729
|
+
if (input.twilioStatusCallbackUrl)
|
|
296730
|
+
options.twilioStatusCallbackUrl = input.twilioStatusCallbackUrl;
|
|
296731
|
+
if (input.twilioWebhookUrl)
|
|
296732
|
+
options.twilioWebhookUrl = input.twilioWebhookUrl;
|
|
296733
|
+
if (input.twilioValidateSignature !== undefined && input.twilioValidateSignature !== null) {
|
|
296734
|
+
options.twilioValidateSignature = input.twilioValidateSignature;
|
|
296663
296735
|
}
|
|
296664
|
-
|
|
296665
|
-
|
|
296666
|
-
|
|
296667
|
-
|
|
296668
|
-
options
|
|
296669
|
-
|
|
296670
|
-
|
|
296671
|
-
|
|
296672
|
-
|
|
296673
|
-
|
|
296674
|
-
options
|
|
296675
|
-
|
|
296676
|
-
|
|
296677
|
-
|
|
296678
|
-
|
|
296679
|
-
if (input.webhookVerifyToken)
|
|
296680
|
-
options.webhookVerifyToken = input.webhookVerifyToken;
|
|
296736
|
+
}
|
|
296737
|
+
function applyChannelSpecificConnectionOptions(options, input) {
|
|
296738
|
+
switch (input.channel) {
|
|
296739
|
+
case "telegram":
|
|
296740
|
+
applyTelegramConnectionOptions(options, input);
|
|
296741
|
+
return;
|
|
296742
|
+
case "slack":
|
|
296743
|
+
applySlackConnectionOptions(options, input);
|
|
296744
|
+
return;
|
|
296745
|
+
case "gupshup":
|
|
296746
|
+
applyGupshupConnectionOptions(options, input);
|
|
296747
|
+
return;
|
|
296748
|
+
case "twilio-whatsapp":
|
|
296749
|
+
applyTwilioWhatsAppConnectionOptions(options, input);
|
|
296750
|
+
return;
|
|
296681
296751
|
}
|
|
296682
296752
|
}
|
|
296683
296753
|
function buildInstanceConnectionOptions(input) {
|
|
@@ -296732,6 +296802,12 @@ function buildTokenPersistUpdates(channel4, body) {
|
|
|
296732
296802
|
if (body.slackSigningSecret)
|
|
296733
296803
|
updates.slackSigningSecret = body.slackSigningSecret;
|
|
296734
296804
|
}
|
|
296805
|
+
if (channel4 === "twilio-whatsapp") {
|
|
296806
|
+
if (body.twilioAuthToken)
|
|
296807
|
+
updates.twilioAuthToken = body.twilioAuthToken;
|
|
296808
|
+
else if (body.token)
|
|
296809
|
+
updates.twilioAuthToken = body.token;
|
|
296810
|
+
}
|
|
296735
296811
|
return updates;
|
|
296736
296812
|
}
|
|
296737
296813
|
async function handleAgentKeyProvisioning(services, instanceId, newAgentId, oldAgentId) {
|
|
@@ -296780,6 +296856,60 @@ async function handleAgentKeyProvisioning(services, instanceId, newAgentId, oldA
|
|
|
296780
296856
|
}
|
|
296781
296857
|
}
|
|
296782
296858
|
}
|
|
296859
|
+
function buildConnectConnectionOptions(instance4, body, forceNewQr) {
|
|
296860
|
+
const connectToken = body.token ?? persistedTokenForChannel(instance4);
|
|
296861
|
+
return buildInstanceConnectionOptions({
|
|
296862
|
+
channel: instance4.channel,
|
|
296863
|
+
forceNewQr,
|
|
296864
|
+
token: connectToken,
|
|
296865
|
+
telegramReactionLevel: instance4.telegramReactionLevel,
|
|
296866
|
+
slackAppToken: body.slackAppToken ?? instance4.slackAppToken,
|
|
296867
|
+
slackSigningSecret: body.slackSigningSecret ?? instance4.slackSigningSecret,
|
|
296868
|
+
whatsapp: body.whatsapp,
|
|
296869
|
+
gupshupCallbackUrl: instance4.gupshupCallbackUrl,
|
|
296870
|
+
gupshupAuthToken: instance4.gupshupAuthToken,
|
|
296871
|
+
gupshupEventId: instance4.gupshupEventId,
|
|
296872
|
+
webhookVerifyToken: instance4.webhookVerifyToken,
|
|
296873
|
+
twilioAccountSid: body.twilioAccountSid ?? instance4.twilioAccountSid,
|
|
296874
|
+
twilioAuthToken: body.twilioAuthToken ?? body.token ?? instance4.twilioAuthToken,
|
|
296875
|
+
twilioFrom: body.twilioFrom ?? instance4.twilioFrom,
|
|
296876
|
+
twilioMessagingServiceSid: body.twilioMessagingServiceSid ?? instance4.twilioMessagingServiceSid,
|
|
296877
|
+
twilioStatusCallbackUrl: body.twilioStatusCallbackUrl ?? instance4.twilioStatusCallbackUrl,
|
|
296878
|
+
twilioWebhookUrl: body.twilioWebhookUrl ?? instance4.twilioWebhookUrl,
|
|
296879
|
+
twilioValidateSignature: body.twilioValidateSignature ?? instance4.twilioValidateSignature
|
|
296880
|
+
});
|
|
296881
|
+
}
|
|
296882
|
+
function hydrateConnectionOptionsForInstance(plugin6, instance4, options) {
|
|
296883
|
+
if ("loadGuildConfigs" in plugin6 && instance4.guildConfigOverrides) {
|
|
296884
|
+
plugin6.loadGuildConfigs(instance4.id, instance4.guildConfigOverrides);
|
|
296885
|
+
}
|
|
296886
|
+
if (instance4.discordPresence) {
|
|
296887
|
+
options.presence = instance4.discordPresence;
|
|
296888
|
+
}
|
|
296889
|
+
if (instance4.channel === "whatsapp-baileys" && instance4.markOnlineOnConnect != null) {
|
|
296890
|
+
options.whatsapp = {
|
|
296891
|
+
...options.whatsapp,
|
|
296892
|
+
markOnlineOnConnect: instance4.markOnlineOnConnect
|
|
296893
|
+
};
|
|
296894
|
+
}
|
|
296895
|
+
}
|
|
296896
|
+
function buildConnectPersistUpdates(instance4, body) {
|
|
296897
|
+
const updates = {
|
|
296898
|
+
isActive: true,
|
|
296899
|
+
...buildTokenPersistUpdates(instance4.channel, body)
|
|
296900
|
+
};
|
|
296901
|
+
if (instance4.channel !== "twilio-whatsapp")
|
|
296902
|
+
return updates;
|
|
296903
|
+
return {
|
|
296904
|
+
...updates,
|
|
296905
|
+
twilioAccountSid: body.twilioAccountSid ?? instance4.twilioAccountSid,
|
|
296906
|
+
twilioFrom: body.twilioFrom ?? instance4.twilioFrom,
|
|
296907
|
+
twilioMessagingServiceSid: body.twilioMessagingServiceSid ?? instance4.twilioMessagingServiceSid,
|
|
296908
|
+
twilioStatusCallbackUrl: body.twilioStatusCallbackUrl ?? instance4.twilioStatusCallbackUrl,
|
|
296909
|
+
twilioWebhookUrl: body.twilioWebhookUrl ?? instance4.twilioWebhookUrl,
|
|
296910
|
+
twilioValidateSignature: body.twilioValidateSignature ?? instance4.twilioValidateSignature
|
|
296911
|
+
};
|
|
296912
|
+
}
|
|
296783
296913
|
async function validateMessageSyncPreconditions(services, instanceId, channel4, type, chatJids) {
|
|
296784
296914
|
if (chatJids?.length && !channel4.startsWith("whatsapp")) {
|
|
296785
296915
|
return {
|
|
@@ -296926,6 +297056,13 @@ var init_instances3 = __esm(() => {
|
|
|
296926
297056
|
gupshupAuthToken: exports_external.string().optional().nullable().describe("Gupshup Custom Integration auth token"),
|
|
296927
297057
|
gupshupEventId: exports_external.string().optional().nullable().describe("Gupshup event ID (default: nx_omni_agent_reply)"),
|
|
296928
297058
|
webhookVerifyToken: exports_external.string().optional().nullable().describe("Gupshup webhook verify token"),
|
|
297059
|
+
twilioAccountSid: exports_external.string().optional().nullable().describe("Twilio Account SID"),
|
|
297060
|
+
twilioAuthToken: exports_external.string().optional().nullable().describe("Twilio Auth Token"),
|
|
297061
|
+
twilioFrom: exports_external.string().optional().nullable().describe("Twilio WhatsApp sender address (whatsapp:+E164)"),
|
|
297062
|
+
twilioMessagingServiceSid: exports_external.string().optional().nullable().describe("Twilio Messaging Service SID"),
|
|
297063
|
+
twilioStatusCallbackUrl: exports_external.string().optional().nullable().describe("Twilio outbound status callback URL"),
|
|
297064
|
+
twilioWebhookUrl: exports_external.string().optional().nullable().describe("Public Twilio inbound webhook URL for signature validation"),
|
|
297065
|
+
twilioValidateSignature: exports_external.boolean().default(true).describe("Validate X-Twilio-Signature on webhooks"),
|
|
296929
297066
|
readReceipts: exports_external.enum(["on", "off", "exclude-self"]).default("on").describe("Read receipt mode: on (default), off, or exclude-self (skip receipts for the instance own number)"),
|
|
296930
297067
|
groupHistorySize: exports_external.number().int().min(0).max(200).default(50).describe("Number of context messages to include when dispatching to agent. Groups use the full value; DMs are capped at 20. (0 = disabled, max 200)"),
|
|
296931
297068
|
markOnlineOnConnect: exports_external.boolean().default(true).describe("Mark the instance as online when connecting to WhatsApp (default: true). Set to false to preserve phone push notifications."),
|
|
@@ -296947,6 +297084,12 @@ var init_instances3 = __esm(() => {
|
|
|
296947
297084
|
gupshupAuthToken: exports_external.string().nullable().optional(),
|
|
296948
297085
|
gupshupEventId: exports_external.string().nullable().optional(),
|
|
296949
297086
|
webhookVerifyToken: exports_external.string().nullable().optional(),
|
|
297087
|
+
twilioAccountSid: exports_external.string().nullable().optional(),
|
|
297088
|
+
twilioAuthToken: exports_external.string().nullable().optional(),
|
|
297089
|
+
twilioFrom: exports_external.string().nullable().optional(),
|
|
297090
|
+
twilioMessagingServiceSid: exports_external.string().nullable().optional(),
|
|
297091
|
+
twilioStatusCallbackUrl: exports_external.string().nullable().optional(),
|
|
297092
|
+
twilioWebhookUrl: exports_external.string().nullable().optional(),
|
|
296950
297093
|
readReceipts: exports_external.enum(["on", "off", "exclude-self"]).optional(),
|
|
296951
297094
|
markOnlineOnConnect: exports_external.boolean().optional(),
|
|
296952
297095
|
groupHistorySize: exports_external.number().int().min(0).max(200).optional(),
|
|
@@ -296957,7 +297100,8 @@ var init_instances3 = __esm(() => {
|
|
|
296957
297100
|
messageSplitDelayMode: exports_external.enum(["disabled", "fixed", "randomized"]).optional(),
|
|
296958
297101
|
messageSplitDelayFixedMs: exports_external.number().int().min(0).optional(),
|
|
296959
297102
|
messageSplitDelayMinMs: exports_external.number().int().min(0).optional(),
|
|
296960
|
-
messageSplitDelayMaxMs: exports_external.number().int().min(0).optional()
|
|
297103
|
+
messageSplitDelayMaxMs: exports_external.number().int().min(0).optional(),
|
|
297104
|
+
twilioValidateSignature: exports_external.boolean().optional()
|
|
296961
297105
|
});
|
|
296962
297106
|
DEFAULT_AGENT_REPLY_FILTER = {
|
|
296963
297107
|
mode: "all",
|
|
@@ -296970,7 +297114,8 @@ var init_instances3 = __esm(() => {
|
|
|
296970
297114
|
"slackAppToken",
|
|
296971
297115
|
"slackSigningSecret",
|
|
296972
297116
|
"gupshupAuthToken",
|
|
296973
|
-
"webhookVerifyToken"
|
|
297117
|
+
"webhookVerifyToken",
|
|
297118
|
+
"twilioAuthToken"
|
|
296974
297119
|
];
|
|
296975
297120
|
instancesRoutes.get("/", zValidator("query", listQuerySchema11), async (c) => {
|
|
296976
297121
|
const { channel: channel4, status, limit: limit2, cursor } = c.req.valid("query");
|
|
@@ -297005,6 +297150,12 @@ var init_instances3 = __esm(() => {
|
|
|
297005
297150
|
description: "Official WhatsApp Business API",
|
|
297006
297151
|
loaded: false
|
|
297007
297152
|
},
|
|
297153
|
+
{
|
|
297154
|
+
id: "twilio-whatsapp",
|
|
297155
|
+
name: "Twilio WhatsApp",
|
|
297156
|
+
description: "WhatsApp via Twilio Programmable Messaging",
|
|
297157
|
+
loaded: false
|
|
297158
|
+
},
|
|
297008
297159
|
{ id: "discord", name: "Discord", description: "Discord bot integration", loaded: false },
|
|
297009
297160
|
{ id: "slack", name: "Slack", description: "Slack bot integration", loaded: false },
|
|
297010
297161
|
{ id: "telegram", name: "Telegram", description: "Telegram bot integration", loaded: false }
|
|
@@ -297049,7 +297200,14 @@ var init_instances3 = __esm(() => {
|
|
|
297049
297200
|
gupshupCallbackUrl: instance4.gupshupCallbackUrl,
|
|
297050
297201
|
gupshupAuthToken: instance4.gupshupAuthToken,
|
|
297051
297202
|
gupshupEventId: instance4.gupshupEventId,
|
|
297052
|
-
webhookVerifyToken: instance4.webhookVerifyToken
|
|
297203
|
+
webhookVerifyToken: instance4.webhookVerifyToken,
|
|
297204
|
+
twilioAccountSid: instance4.twilioAccountSid,
|
|
297205
|
+
twilioAuthToken: instance4.twilioAuthToken,
|
|
297206
|
+
twilioFrom: instance4.twilioFrom,
|
|
297207
|
+
twilioMessagingServiceSid: instance4.twilioMessagingServiceSid,
|
|
297208
|
+
twilioStatusCallbackUrl: instance4.twilioStatusCallbackUrl,
|
|
297209
|
+
twilioWebhookUrl: instance4.twilioWebhookUrl,
|
|
297210
|
+
twilioValidateSignature: instance4.twilioValidateSignature
|
|
297053
297211
|
});
|
|
297054
297212
|
const createPlugin = getPluginFromRegistry(channelRegistry2, data.channel);
|
|
297055
297213
|
if (createPlugin && "loadGuildConfigs" in createPlugin && instance4.guildConfigOverrides) {
|
|
@@ -297220,6 +297378,13 @@ var init_instances3 = __esm(() => {
|
|
|
297220
297378
|
slackSigningSecret: exports_external.string().optional().describe("Slack signing secret"),
|
|
297221
297379
|
forceNewQr: exports_external.boolean().optional().describe("Force new QR code for WhatsApp (re-authentication)"),
|
|
297222
297380
|
gupshupCallbackUrl: exports_external.string().optional().describe("Gupshup webhook callback URL (persisted for reconnection)"),
|
|
297381
|
+
twilioAccountSid: exports_external.string().optional().describe("Twilio Account SID"),
|
|
297382
|
+
twilioAuthToken: exports_external.string().optional().describe("Twilio Auth Token"),
|
|
297383
|
+
twilioFrom: exports_external.string().optional().describe("Twilio WhatsApp sender address (whatsapp:+E164)"),
|
|
297384
|
+
twilioMessagingServiceSid: exports_external.string().optional().describe("Twilio Messaging Service SID"),
|
|
297385
|
+
twilioStatusCallbackUrl: exports_external.string().optional().describe("Twilio outbound status callback URL"),
|
|
297386
|
+
twilioWebhookUrl: exports_external.string().optional().describe("Public Twilio inbound webhook URL for signature validation"),
|
|
297387
|
+
twilioValidateSignature: exports_external.boolean().optional().describe("Validate X-Twilio-Signature on webhooks"),
|
|
297223
297388
|
whatsapp: exports_external.object({
|
|
297224
297389
|
syncFullHistory: exports_external.boolean().optional().describe("Sync full message history on connect (default: true)")
|
|
297225
297390
|
}).optional().describe("WhatsApp-specific connection options")
|
|
@@ -297231,20 +297396,7 @@ var init_instances3 = __esm(() => {
|
|
|
297231
297396
|
const services = c.get("services");
|
|
297232
297397
|
const channelRegistry2 = c.get("channelRegistry");
|
|
297233
297398
|
const instance4 = await services.instances.getById(id);
|
|
297234
|
-
const
|
|
297235
|
-
const connectionOptions = buildInstanceConnectionOptions({
|
|
297236
|
-
channel: instance4.channel,
|
|
297237
|
-
forceNewQr,
|
|
297238
|
-
token: connectToken,
|
|
297239
|
-
telegramReactionLevel: instance4.telegramReactionLevel,
|
|
297240
|
-
slackAppToken: body.slackAppToken ?? instance4.slackAppToken,
|
|
297241
|
-
slackSigningSecret: body.slackSigningSecret ?? instance4.slackSigningSecret,
|
|
297242
|
-
whatsapp: body.whatsapp,
|
|
297243
|
-
gupshupCallbackUrl: instance4.gupshupCallbackUrl,
|
|
297244
|
-
gupshupAuthToken: instance4.gupshupAuthToken,
|
|
297245
|
-
gupshupEventId: instance4.gupshupEventId,
|
|
297246
|
-
webhookVerifyToken: instance4.webhookVerifyToken
|
|
297247
|
-
});
|
|
297399
|
+
const connectionOptions = buildConnectConnectionOptions(instance4, body, forceNewQr);
|
|
297248
297400
|
if (!channelRegistry2) {
|
|
297249
297401
|
return c.json({ error: { code: "NO_REGISTRY", message: "Channel registry not available" } }, 503);
|
|
297250
297402
|
}
|
|
@@ -297252,18 +297404,7 @@ var init_instances3 = __esm(() => {
|
|
|
297252
297404
|
if (!plugin6) {
|
|
297253
297405
|
return c.json({ error: { code: "PLUGIN_NOT_FOUND", message: `No plugin for channel: ${instance4.channel}` } }, 400);
|
|
297254
297406
|
}
|
|
297255
|
-
|
|
297256
|
-
plugin6.loadGuildConfigs(id, instance4.guildConfigOverrides);
|
|
297257
|
-
}
|
|
297258
|
-
if (instance4.discordPresence) {
|
|
297259
|
-
connectionOptions.presence = instance4.discordPresence;
|
|
297260
|
-
}
|
|
297261
|
-
if (instance4.channel === "whatsapp-baileys" && instance4.markOnlineOnConnect != null) {
|
|
297262
|
-
connectionOptions.whatsapp = {
|
|
297263
|
-
...connectionOptions.whatsapp,
|
|
297264
|
-
markOnlineOnConnect: instance4.markOnlineOnConnect
|
|
297265
|
-
};
|
|
297266
|
-
}
|
|
297407
|
+
hydrateConnectionOptionsForInstance(plugin6, instance4, connectionOptions);
|
|
297267
297408
|
const errorMessage = await connectInstanceWithPlugin(plugin6, id, connectionOptions);
|
|
297268
297409
|
if (errorMessage) {
|
|
297269
297410
|
return c.json({
|
|
@@ -297273,10 +297414,7 @@ var init_instances3 = __esm(() => {
|
|
|
297273
297414
|
}
|
|
297274
297415
|
}, 500);
|
|
297275
297416
|
}
|
|
297276
|
-
const updated = await services.instances.update(id,
|
|
297277
|
-
isActive: true,
|
|
297278
|
-
...buildTokenPersistUpdates(instance4.channel, body)
|
|
297279
|
-
});
|
|
297417
|
+
const updated = await services.instances.update(id, buildConnectPersistUpdates(instance4, body));
|
|
297280
297418
|
return c.json({
|
|
297281
297419
|
data: {
|
|
297282
297420
|
instanceId: updated.id,
|
|
@@ -297333,6 +297471,15 @@ var init_instances3 = __esm(() => {
|
|
|
297333
297471
|
if (instance4.channel === "slack") {
|
|
297334
297472
|
applySlackConnectOptions(restartOptions, instance4);
|
|
297335
297473
|
}
|
|
297474
|
+
if (instance4.channel === "twilio-whatsapp") {
|
|
297475
|
+
restartOptions.twilioAccountSid = instance4.twilioAccountSid;
|
|
297476
|
+
restartOptions.twilioAuthToken = instance4.twilioAuthToken;
|
|
297477
|
+
restartOptions.twilioFrom = instance4.twilioFrom;
|
|
297478
|
+
restartOptions.twilioMessagingServiceSid = instance4.twilioMessagingServiceSid;
|
|
297479
|
+
restartOptions.twilioStatusCallbackUrl = instance4.twilioStatusCallbackUrl;
|
|
297480
|
+
restartOptions.twilioWebhookUrl = instance4.twilioWebhookUrl;
|
|
297481
|
+
restartOptions.twilioValidateSignature = instance4.twilioValidateSignature;
|
|
297482
|
+
}
|
|
297336
297483
|
if (instance4.channel === "whatsapp-baileys" && instance4.markOnlineOnConnect != null) {
|
|
297337
297484
|
restartOptions.whatsapp = {
|
|
297338
297485
|
...restartOptions.whatsapp,
|
|
@@ -301369,6 +301516,21 @@ var init_persons3 = __esm(() => {
|
|
|
301369
301516
|
});
|
|
301370
301517
|
});
|
|
301371
301518
|
|
|
301519
|
+
// ../api/src/routes/v2/processed-events.ts
|
|
301520
|
+
var processedEventsRoutes;
|
|
301521
|
+
var init_processed_events = __esm(() => {
|
|
301522
|
+
init_dist2();
|
|
301523
|
+
processedEventsRoutes = new Hono2;
|
|
301524
|
+
processedEventsRoutes.get("/", (c) => {
|
|
301525
|
+
return c.json({
|
|
301526
|
+
error: {
|
|
301527
|
+
code: "NOT_FOUND",
|
|
301528
|
+
message: "processed-events endpoints are not yet implemented. Tracking issue #411."
|
|
301529
|
+
}
|
|
301530
|
+
}, 404);
|
|
301531
|
+
});
|
|
301532
|
+
});
|
|
301533
|
+
|
|
301372
301534
|
// ../api/src/routes/v2/providers.ts
|
|
301373
301535
|
function maskSchemaConfig(config4) {
|
|
301374
301536
|
if (!config4)
|
|
@@ -302102,6 +302264,7 @@ var init_v2 = __esm(() => {
|
|
|
302102
302264
|
init_metrics3();
|
|
302103
302265
|
init_payloads2();
|
|
302104
302266
|
init_persons3();
|
|
302267
|
+
init_processed_events();
|
|
302105
302268
|
init_providers4();
|
|
302106
302269
|
init_settings3();
|
|
302107
302270
|
init_turns2();
|
|
@@ -302123,6 +302286,7 @@ var init_v2 = __esm(() => {
|
|
|
302123
302286
|
v2Routes.route("/providers", providersRoutes);
|
|
302124
302287
|
v2Routes.route("/dead-letters", deadLettersRoutes);
|
|
302125
302288
|
v2Routes.route("/event-ops", eventOpsRoutes);
|
|
302289
|
+
v2Routes.route("/processed-events", processedEventsRoutes);
|
|
302126
302290
|
v2Routes.route("/metrics", metricsRoutes);
|
|
302127
302291
|
v2Routes.route("/conversations", conversationsRoutes);
|
|
302128
302292
|
v2Routes.route("/chats", chatsRoutes);
|
|
@@ -302257,6 +302421,17 @@ function createApp(db2, eventBus = null, channelRegistry2 = null) {
|
|
|
302257
302421
|
}
|
|
302258
302422
|
return plugin6.handleWebhook(c.req.raw);
|
|
302259
302423
|
});
|
|
302424
|
+
app.post("/api/v2/channels/twilio-whatsapp/:instanceId/webhook", async (c) => {
|
|
302425
|
+
const channelRegistry3 = c.get("channelRegistry");
|
|
302426
|
+
if (!channelRegistry3) {
|
|
302427
|
+
return c.json({ error: { code: "NO_REGISTRY", message: "Channel registry not available" } }, 503);
|
|
302428
|
+
}
|
|
302429
|
+
const plugin6 = channelRegistry3.get("twilio-whatsapp");
|
|
302430
|
+
if (!plugin6?.handleWebhook) {
|
|
302431
|
+
return c.json({ error: { code: "PLUGIN_NOT_FOUND", message: "Twilio WhatsApp plugin not loaded" } }, 503);
|
|
302432
|
+
}
|
|
302433
|
+
return plugin6.handleWebhook(c.req.raw);
|
|
302434
|
+
});
|
|
302260
302435
|
const protectedApp = new Hono2;
|
|
302261
302436
|
protectedApp.use("*", authMiddleware);
|
|
302262
302437
|
protectedApp.use("*", scopeEnforcerMiddleware);
|
|
@@ -303936,6 +304111,9 @@ function buildInstanceConnectOptions(instance4) {
|
|
|
303936
304111
|
if (instance4.channel === "gupshup") {
|
|
303937
304112
|
applyGupshupOptions(options, instance4);
|
|
303938
304113
|
}
|
|
304114
|
+
if (instance4.channel === "twilio-whatsapp") {
|
|
304115
|
+
applyTwilioWhatsAppOptions(options, instance4);
|
|
304116
|
+
}
|
|
303939
304117
|
return options;
|
|
303940
304118
|
}
|
|
303941
304119
|
function applyGupshupOptions(options, instance4) {
|
|
@@ -303954,6 +304132,23 @@ function applyGupshupOptions(options, instance4) {
|
|
|
303954
304132
|
if (instance4.webhookVerifyToken)
|
|
303955
304133
|
options.webhookVerifyToken = instance4.webhookVerifyToken;
|
|
303956
304134
|
}
|
|
304135
|
+
function applyTwilioWhatsAppOptions(options, instance4) {
|
|
304136
|
+
if (instance4.twilioAccountSid)
|
|
304137
|
+
options.twilioAccountSid = instance4.twilioAccountSid;
|
|
304138
|
+
if (instance4.twilioAuthToken)
|
|
304139
|
+
options.twilioAuthToken = instance4.twilioAuthToken;
|
|
304140
|
+
if (instance4.twilioFrom)
|
|
304141
|
+
options.twilioFrom = instance4.twilioFrom;
|
|
304142
|
+
if (instance4.twilioMessagingServiceSid)
|
|
304143
|
+
options.twilioMessagingServiceSid = instance4.twilioMessagingServiceSid;
|
|
304144
|
+
if (instance4.twilioStatusCallbackUrl)
|
|
304145
|
+
options.twilioStatusCallbackUrl = instance4.twilioStatusCallbackUrl;
|
|
304146
|
+
if (instance4.twilioWebhookUrl)
|
|
304147
|
+
options.twilioWebhookUrl = instance4.twilioWebhookUrl;
|
|
304148
|
+
if (instance4.twilioValidateSignature !== undefined && instance4.twilioValidateSignature !== null) {
|
|
304149
|
+
options.twilioValidateSignature = instance4.twilioValidateSignature;
|
|
304150
|
+
}
|
|
304151
|
+
}
|
|
303957
304152
|
async function connectInstance(instance4, registry5) {
|
|
303958
304153
|
const plugin6 = registry5.get(instance4.channel);
|
|
303959
304154
|
if (!plugin6) {
|