@fayz-ai/plugin-conversations 0.22.3 → 0.22.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +14 -1
- package/dist/index.js.map +1 -1
- package/dist/migrations/index.d.ts +1 -0
- package/dist/migrations/index.d.ts.map +1 -1
- package/package.json +4 -4
package/dist/index.js
CHANGED
|
@@ -5282,6 +5282,18 @@ CREATE INDEX IF NOT EXISTS plg_conversation_messages_midia_sem_arquivo
|
|
|
5282
5282
|
WHERE media_path IS NULL
|
|
5283
5283
|
AND message_type IN ('image', 'video', 'audio', 'document', 'sticker');
|
|
5284
5284
|
`;
|
|
5285
|
+
var MIGRATION_014_CLAIMING_TARGETS_IS_SERVER_ONLY = `-- 014_claiming_targets_is_server_only.sql
|
|
5286
|
+
--
|
|
5287
|
+
-- 003 revoked \`conversations_claim_targets\` from PUBLIC and anon but not from
|
|
5288
|
+
-- \`authenticated\`, which the pool's default privileges grant on every new
|
|
5289
|
+
-- function in public. Live, any signed-in user of any tenant could claim (and
|
|
5290
|
+
-- so burn) another tenant's campaign targets by uuid \u2014 SECURITY DEFINER, no
|
|
5291
|
+
-- caller check. The only caller is the conversations-provider edge function,
|
|
5292
|
+
-- which uses the service-role key.
|
|
5293
|
+
|
|
5294
|
+
REVOKE ALL ON FUNCTION public.conversations_claim_targets(uuid, integer) FROM PUBLIC, anon, authenticated;
|
|
5295
|
+
GRANT EXECUTE ON FUNCTION public.conversations_claim_targets(uuid, integer) TO service_role;
|
|
5296
|
+
`;
|
|
5285
5297
|
var MIGRATIONS = [
|
|
5286
5298
|
{ id: "000_baseline", sql: MIGRATION_000_BASELINE },
|
|
5287
5299
|
{ id: "001_a_caixa_sabe_quem_falou_por_ultimo", sql: MIGRATION_001_A_CAIXA_SABE_QUEM_FALOU_POR_ULTIMO },
|
|
@@ -5296,7 +5308,8 @@ var MIGRATIONS = [
|
|
|
5296
5308
|
{ id: "010_a_chegada_e_anunciada_por_conta", sql: MIGRATION_010_A_CHEGADA_E_ANUNCIADA_POR_CONTA },
|
|
5297
5309
|
{ id: "011_o_anuncio_e_uma_campainha_nao_um_recado", sql: MIGRATION_011_O_ANUNCIO_E_UMA_CAMPAINHA_NAO_UM_RECADO },
|
|
5298
5310
|
{ id: "012_a_rich_message_keeps_its_shape", sql: MIGRATION_012_A_RICH_MESSAGE_KEEPS_ITS_SHAPE },
|
|
5299
|
-
{ id: "013_a_midia_fica_conosco", sql: MIGRATION_013_A_MIDIA_FICA_CONOSCO }
|
|
5311
|
+
{ id: "013_a_midia_fica_conosco", sql: MIGRATION_013_A_MIDIA_FICA_CONOSCO },
|
|
5312
|
+
{ id: "014_claiming_targets_is_server_only", sql: MIGRATION_014_CLAIMING_TARGETS_IS_SERVER_ONLY }
|
|
5300
5313
|
];
|
|
5301
5314
|
function client3() {
|
|
5302
5315
|
const c = getSupabaseClientOptional();
|