@fayz-ai/plugin-crm 0.31.9 → 0.31.12

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 +1 @@
1
- {"version":3,"file":"SurveyCollectDialog.d.ts","sourceRoot":"","sources":["../../src/components/SurveyCollectDialog.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AAQzB,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAA;AAClD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,eAAe,CAAA;AACpD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,UAAU,CAAA;AAsBtC,wBAAgB,mBAAmB,CAAC,EAAE,MAAM,EAAE,QAAQ,EAAE,aAAa,EAAE,OAAO,EAAE,OAAO,EAAE,EAAE;IACzF,MAAM,EAAE,MAAM,CAAA;IACd,QAAQ,EAAE,eAAe,CAAA;IACzB,aAAa,CAAC,EAAE,YAAY,CAAA;IAC5B,OAAO,EAAE,MAAM,IAAI,CAAA;IACnB,OAAO,EAAE,MAAM,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAA;CACpC,qBAmIA"}
1
+ {"version":3,"file":"SurveyCollectDialog.d.ts","sourceRoot":"","sources":["../../src/components/SurveyCollectDialog.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AAQzB,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAA;AAClD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,eAAe,CAAA;AACpD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,UAAU,CAAA;AAsBtC,wBAAgB,mBAAmB,CAAC,EAAE,MAAM,EAAE,QAAQ,EAAE,aAAa,EAAE,OAAO,EAAE,OAAO,EAAE,EAAE;IACzF,MAAM,EAAE,MAAM,CAAA;IACd,QAAQ,EAAE,eAAe,CAAA;IACzB,aAAa,CAAC,EAAE,YAAY,CAAA;IAC5B,OAAO,EAAE,MAAM,IAAI,CAAA;IACnB,OAAO,EAAE,MAAM,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAA;CACpC,qBAkIA"}
@@ -1 +1 @@
1
- {"version":3,"file":"SurveyEditorDialog.d.ts","sourceRoot":"","sources":["../../src/components/SurveyEditorDialog.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AAMzB,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,eAAe,CAAA;AACpD,OAAO,KAAK,EAAE,MAAM,EAA4D,MAAM,UAAU,CAAA;AA8BhG,wBAAgB,kBAAkB,CAAC,EAAE,MAAM,EAAE,QAAQ,EAAE,mBAAmB,EAAE,OAAO,EAAE,OAAO,EAAE,EAAE;IAC9F,8BAA8B;IAC9B,MAAM,EAAE,MAAM,GAAG,IAAI,CAAA;IACrB,QAAQ,EAAE,eAAe,CAAA;IACzB,+DAA+D;IAC/D,mBAAmB,CAAC,EAAE,GAAG,CAAC,MAAM,CAAC,CAAA;IACjC,OAAO,EAAE,MAAM,IAAI,CAAA;IACnB,OAAO,EAAE,MAAM,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAA;CACpC,qBA0OA"}
1
+ {"version":3,"file":"SurveyEditorDialog.d.ts","sourceRoot":"","sources":["../../src/components/SurveyEditorDialog.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AAMzB,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,eAAe,CAAA;AACpD,OAAO,KAAK,EAAE,MAAM,EAA4D,MAAM,UAAU,CAAA;AA8BhG,wBAAgB,kBAAkB,CAAC,EAAE,MAAM,EAAE,QAAQ,EAAE,mBAAmB,EAAE,OAAO,EAAE,OAAO,EAAE,EAAE;IAC9F,8BAA8B;IAC9B,MAAM,EAAE,MAAM,GAAG,IAAI,CAAA;IACrB,QAAQ,EAAE,eAAe,CAAA;IACzB,+DAA+D;IAC/D,mBAAmB,CAAC,EAAE,GAAG,CAAC,MAAM,CAAC,CAAA;IACjC,OAAO,EAAE,MAAM,IAAI,CAAA;IACnB,OAAO,EAAE,MAAM,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAA;CACpC,qBAyOA"}
package/dist/index.js CHANGED
@@ -10461,8 +10461,7 @@ function SurveyEditorDialog({ survey, provider, answeredQuestionIds, onClose, on
10461
10461
  ] }),
10462
10462
  error && /* @__PURE__ */ jsx("p", { className: "text-xs text-destructive", children: error })
10463
10463
  ] }) }),
10464
- /* @__PURE__ */ jsxs(ModalFooter, { className: "border-t px-5 py-3", children: [
10465
- blocked && /* @__PURE__ */ jsx("span", { className: "mr-auto text-[11px] text-muted-foreground", children: blocked }),
10464
+ /* @__PURE__ */ jsxs(ModalFooter, { variant: "bar", start: blocked && /* @__PURE__ */ jsx("span", { className: "text-[11px] text-muted-foreground", children: blocked }), children: [
10466
10465
  /* @__PURE__ */ jsx(Button, { variant: "outline", size: "sm", onClick: onClose, children: "Cancelar" }),
10467
10466
  /* @__PURE__ */ jsxs(Button, { size: "sm", onClick: () => void save(), disabled: saving || !!blocked, children: [
10468
10467
  saving ? /* @__PURE__ */ jsx(Loader2, { className: "h-3.5 w-3.5 animate-spin" }) : null,
@@ -10560,8 +10559,7 @@ function SurveyCollectDialog({ survey, provider, contactLookup, onClose, onSaved
10560
10559
  ] }, q.id)),
10561
10560
  error && /* @__PURE__ */ jsx("p", { className: "text-xs text-destructive", children: error })
10562
10561
  ] }) }),
10563
- /* @__PURE__ */ jsx(ModalFooter, { className: "border-t px-5 py-3", children: done ? /* @__PURE__ */ jsx(Button, { size: "sm", onClick: onClose, children: "Fechar" }) : /* @__PURE__ */ jsxs(Fragment, { children: [
10564
- blocked && /* @__PURE__ */ jsx("span", { className: "mr-auto text-[11px] text-muted-foreground", children: blocked }),
10562
+ /* @__PURE__ */ jsx(ModalFooter, { variant: "bar", start: !done && blocked && /* @__PURE__ */ jsx("span", { className: "text-[11px] text-muted-foreground", children: blocked }), children: done ? /* @__PURE__ */ jsx(Button, { size: "sm", onClick: onClose, children: "Fechar" }) : /* @__PURE__ */ jsxs(Fragment, { children: [
10565
10563
  /* @__PURE__ */ jsx(Button, { variant: "outline", size: "sm", onClick: onClose, children: "Cancelar" }),
10566
10564
  /* @__PURE__ */ jsxs(Button, { size: "sm", onClick: () => void submit(), disabled: saving || !!blocked, children: [
10567
10565
  saving ? /* @__PURE__ */ jsx(Loader2, { className: "h-3.5 w-3.5 animate-spin" }) : null,
@@ -29894,6 +29892,21 @@ var MIGRATION_058_O_CARD_DIZ_O_NOME_DO_GRUPO = `-- 058 \u2014 The card says the
29894
29892
  -- onto the deal row and that refusal still holds \u2014 this is derived, in a view,
29895
29893
  -- where a wrong answer costs a re-read and not a migration.
29896
29894
 
29895
+ -- Replay guard. 062 widened v_deals in turn (it appended \`unit_id\`, and its
29896
+ -- body already carries everything below). Re-running this narrower list over
29897
+ -- that shape fails with \xABcannot drop columns from view\xBB \u2014 which is what a pool
29898
+ -- that took 062 before this file hits. Once the view carries \`unit_id\` it is
29899
+ -- left as 062 made it. The grants below are idempotent.
29900
+ DO $guard$
29901
+ BEGIN
29902
+ IF EXISTS (SELECT 1 FROM pg_attribute
29903
+ WHERE attrelid = to_regclass('public.v_deals')
29904
+ AND attname = 'unit_id' AND NOT attisdropped) THEN
29905
+ RAISE NOTICE 'crm 058: v_deals already has the 062 shape; left as it is';
29906
+ RETURN;
29907
+ END IF;
29908
+
29909
+ EXECUTE $view$
29897
29910
  CREATE OR REPLACE VIEW public.v_deals WITH (security_invoker = true) AS
29898
29911
  SELECT d.id,
29899
29912
  d.tenant_id,
@@ -29958,7 +29971,9 @@ CREATE OR REPLACE VIEW public.v_deals WITH (security_invoker = true) AS
29958
29971
  AND m.tenant_id = d.tenant_id
29959
29972
  AND g.is_active
29960
29973
  ORDER BY m.created_at, m.id
29961
- LIMIT 1) grp ON true;
29974
+ LIMIT 1) grp ON true
29975
+ $view$;
29976
+ END $guard$;
29962
29977
 
29963
29978
  GRANT SELECT ON public.v_deals TO authenticated;
29964
29979
  GRANT SELECT ON public.v_deals TO service_role;
@@ -29991,6 +30006,20 @@ var MIGRATION_059_A_EMPRESA_MOSTRA_O_INSTAGRAM_QUE_ELA_GUARDA = `-- 059 \u2014 T
29991
30006
  -- \`v_crm_companies\` is left in place: it costs nothing, and anything still
29992
30007
  -- pointing at it keeps working rather than breaking on deploy order.
29993
30008
 
30009
+ -- Replay guard. 062 widened this view in turn (it added \`unit_id\`) \u2014 the very
30010
+ -- move this header warns about, one file later. On a replay this narrower list
30011
+ -- would hit \xABcannot drop columns from view\xBB, so once the view carries
30012
+ -- \`unit_id\` it is left as 062 made it. The grants below are idempotent.
30013
+ DO $guard$
30014
+ BEGIN
30015
+ IF EXISTS (SELECT 1 FROM pg_attribute
30016
+ WHERE attrelid = to_regclass('public.v_crm_companies_enriched')
30017
+ AND attname = 'unit_id' AND NOT attisdropped) THEN
30018
+ RAISE NOTICE 'crm 059: v_crm_companies_enriched already has the 062 shape; left as it is';
30019
+ RETURN;
30020
+ END IF;
30021
+
30022
+ EXECUTE $view$
29994
30023
  CREATE OR REPLACE VIEW public.v_crm_companies_enriched WITH (security_invoker = true) AS
29995
30024
  SELECT c.id,
29996
30025
  c.tenant_id,
@@ -30035,7 +30064,9 @@ SELECT c.id,
30035
30064
  WHERE dl.company_id = c.id) d ON true
30036
30065
  LEFT JOIN LATERAL ( SELECT count(*)::integer AS group_size
30037
30066
  FROM plg_crm_companies s
30038
- WHERE s.tenant_id = c.tenant_id AND s.document_root = c.document_root) g ON true;
30067
+ WHERE s.tenant_id = c.tenant_id AND s.document_root = c.document_root) g ON true
30068
+ $view$;
30069
+ END $guard$;
30039
30070
 
30040
30071
  GRANT SELECT ON public.v_crm_companies_enriched TO authenticated;
30041
30072
  GRANT SELECT ON public.v_crm_companies_enriched TO service_role;