@hiver/connector-agent 4.22.8 → 4.22.10-mondayEmailLog-beta.0

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.
Files changed (72) hide show
  1. package/features/connector-cards/api/index.d.ts +1 -1
  2. package/features/connector-cards/api/index.d.ts.map +1 -1
  3. package/features/connector-cards/components/card-list/Card.d.ts.map +1 -1
  4. package/features/connector-cards/store/slice.d.ts +2 -0
  5. package/features/connector-cards/store/slice.d.ts.map +1 -1
  6. package/features/email-logger/api/getPerTaskLogStatus.d.ts +20 -0
  7. package/features/email-logger/api/getPerTaskLogStatus.d.ts.map +1 -0
  8. package/features/email-logger/api/getSearch.d.ts +8 -0
  9. package/features/email-logger/api/getSearch.d.ts.map +1 -1
  10. package/features/email-logger/api/postLog.d.ts +5 -0
  11. package/features/email-logger/api/postLog.d.ts.map +1 -1
  12. package/features/email-logger/api/taskLogToggle.d.ts +27 -0
  13. package/features/email-logger/api/taskLogToggle.d.ts.map +1 -0
  14. package/features/email-logger/api/validateEntity.d.ts +11 -0
  15. package/features/email-logger/api/validateEntity.d.ts.map +1 -1
  16. package/features/email-logger/components/log-action/index.d.ts.map +1 -1
  17. package/features/email-logger/components/log-action/tooltip.d.ts +3 -1
  18. package/features/email-logger/components/log-action/tooltip.d.ts.map +1 -1
  19. package/features/email-logger/components/log-email-switch/index.d.ts +3 -0
  20. package/features/email-logger/components/log-email-switch/index.d.ts.map +1 -0
  21. package/features/email-logger/components/log-tooltip/index.d.ts +3 -1
  22. package/features/email-logger/components/log-tooltip/index.d.ts.map +1 -1
  23. package/features/email-logger/components/log-tooltip/styles.d.ts +1 -0
  24. package/features/email-logger/components/log-tooltip/styles.d.ts.map +1 -1
  25. package/features/email-logger/components/select-entity/components/entity-option/index.d.ts.map +1 -1
  26. package/features/email-logger/components/select-entity/components/feedback/index.d.ts +4 -1
  27. package/features/email-logger/components/select-entity/components/feedback/index.d.ts.map +1 -1
  28. package/features/email-logger/components/select-entity/components/monday-task-popover/index.d.ts +7 -0
  29. package/features/email-logger/components/select-entity/components/monday-task-popover/index.d.ts.map +1 -0
  30. package/features/email-logger/components/select-entity/index.d.ts +6 -1
  31. package/features/email-logger/components/select-entity/index.d.ts.map +1 -1
  32. package/features/email-logger/components/sync-tooltip/index.d.ts +2 -0
  33. package/features/email-logger/components/sync-tooltip/index.d.ts.map +1 -0
  34. package/features/email-logger/constants/index.d.ts +8 -0
  35. package/features/email-logger/constants/index.d.ts.map +1 -1
  36. package/features/email-logger/context/contexts.d.ts +6 -0
  37. package/features/email-logger/context/contexts.d.ts.map +1 -1
  38. package/features/email-logger/context/index.d.ts +1 -1
  39. package/features/email-logger/context/index.d.ts.map +1 -1
  40. package/features/email-logger/index.d.ts.map +1 -1
  41. package/features/email-logger/omni/OmniSyncPanel.d.ts.map +1 -1
  42. package/features/email-logger/omni/components/EntityRow.d.ts.map +1 -1
  43. package/features/email-logger/omni/components/LogEmailPill.d.ts +6 -1
  44. package/features/email-logger/omni/components/LogEmailPill.d.ts.map +1 -1
  45. package/features/email-logger/types/api.d.ts +8 -0
  46. package/features/email-logger/types/api.d.ts.map +1 -1
  47. package/features/email-logger/types/index.d.ts +9 -1
  48. package/features/email-logger/types/index.d.ts.map +1 -1
  49. package/features/email-logger/utils/perTask.d.ts +39 -0
  50. package/features/email-logger/utils/perTask.d.ts.map +1 -0
  51. package/features/global-search/api/getSearchResults.d.ts +4 -0
  52. package/features/global-search/api/getSearchResults.d.ts.map +1 -1
  53. package/features/write-form/api/getEmailLoggingState.d.ts +12 -0
  54. package/features/write-form/api/getEmailLoggingState.d.ts.map +1 -0
  55. package/features/write-form/components/log-emails-toggle/index.d.ts +9 -0
  56. package/features/write-form/components/log-emails-toggle/index.d.ts.map +1 -0
  57. package/features/write-form/components/map-form-defaults/index.d.ts +3 -1
  58. package/features/write-form/components/map-form-defaults/index.d.ts.map +1 -1
  59. package/features/write-form/components/write-form/index.d.ts.map +1 -1
  60. package/features/write-form/utils/logEmails.d.ts +42 -0
  61. package/features/write-form/utils/logEmails.d.ts.map +1 -0
  62. package/hooks/useMappedSmId.d.ts +31 -0
  63. package/hooks/useMappedSmId.d.ts.map +1 -0
  64. package/index.es.js +10188 -9361
  65. package/index.umd.js +858 -439
  66. package/main-dev.d.ts.map +1 -1
  67. package/package.json +1 -1
  68. package/testing/dev/MondayEmailLogHarness.d.ts +5 -0
  69. package/testing/dev/MondayEmailLogHarness.d.ts.map +1 -0
  70. package/testing/mocks/handlers/monday-email-log.d.ts +58 -0
  71. package/testing/mocks/handlers/monday-email-log.d.ts.map +1 -0
  72. package/testing/mocks/handlers.d.ts.map +1 -1
@@ -0,0 +1,42 @@
1
+ import { IFormConfig } from '@connector/ui';
2
+ import { FormStateValues, FormArgValue } from '../../../types/form';
3
+ /**
4
+ * The monday.com create/edit task forms declare the `logEmailsAsComments`
5
+ * checkbox in the template (custom-integration-template-library monday.json).
6
+ * Every behaviour here keys off the field's presence, so other forms are
7
+ * untouched. Constants and copy live in @connector/ui (shared with admin).
8
+ */
9
+ export { LOG_EMAILS_FIELD_NAME, LOG_EMAILS_ROW_TITLE, LOG_EMAILS_ROW_DESCRIPTION, LOG_EMAILS_BLOCKED_MESSAGE, getLogEmailsBlockedMessage, hasLogEmailsField } from '@connector/ui';
10
+ type FieldLike = {
11
+ name: string;
12
+ type?: string;
13
+ };
14
+ /**
15
+ * PRD R9: the app (other than this form's connector) that already logs email in
16
+ * the workspace, read from GET email_log_status. When the conversation is not
17
+ * bound to a connector, that endpoint falls back to the first enabled connector
18
+ * with email logging on, which is exactly the "other app". Returns null when
19
+ * nothing blocks.
20
+ */
21
+ export declare const getOtherAppLoggingName: (status: unknown, currentConnectorId?: string | null) => string | null;
22
+ /**
23
+ * The current logging state of an already-linked task, so the Edit form opens
24
+ * with the toggle reflecting it. Undefined when the task is not enrolled.
25
+ */
26
+ export declare const getLinkedTaskLogState: (status: unknown, externalResourceId?: string | null) => boolean | undefined;
27
+ /**
28
+ * The monday.com toggle is not rendered by the generic form: it is drawn as
29
+ * the design's "Log email as a comment" row at the bottom of the form (see
30
+ * components/log-emails-toggle). Returns the input unchanged when the form has
31
+ * no such field, so CRM forms keep the exact same configs.
32
+ */
33
+ export declare const withoutLogEmailsField: <T extends IFormConfig>(configs: T[]) => T[];
34
+ /**
35
+ * Ensures the toggle reaches the backend as a real boolean under
36
+ * `logEmailsAsComments`, which custom-integrations reads from the submitted
37
+ * args. The template does not list it in `interfaceDetails.args`, so the
38
+ * generic serializer would otherwise drop it. Forced to false while another
39
+ * app's logging blocks it (R9). No-op for forms without the field.
40
+ */
41
+ export declare const withLogEmailsArg: (args: Record<string, FormArgValue>, values: FormStateValues, fields: FieldLike[] | undefined, blocked: boolean) => Record<string, FormArgValue>;
42
+ //# sourceMappingURL=logEmails.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"logEmails.d.ts","sourceRoot":"","sources":["../../../../src/features/write-form/utils/logEmails.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAkB,WAAW,EAAE,MAAM,eAAe,CAAC;AACjE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AACpD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAIjD;;;;;GAKG;AACH,OAAO,EACL,qBAAqB,EACrB,oBAAoB,EACpB,0BAA0B,EAC1B,0BAA0B,EAC1B,0BAA0B,EAC1B,iBAAiB,EAClB,MAAM,eAAe,CAAC;AAEvB,KAAK,SAAS,GAAG;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,IAAI,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC;AAEjD;;;;;;GAMG;AACH,eAAO,MAAM,sBAAsB,WAAY,OAAO,uBAAuB,MAAM,GAAG,IAAI,KAAG,MAAM,GAAG,IAMrG,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,qBAAqB,WAAY,OAAO,uBAAuB,MAAM,GAAG,IAAI,KAAG,OAAO,GAAG,SAMrG,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,qBAAqB,GAAI,CAAC,SAAS,WAAW,WAAW,CAAC,EAAE,KAAG,CAAC,EAS5E,CAAC;AAEF;;;;;;GAMG;AACH,eAAO,MAAM,gBAAgB,SACrB,MAAM,CAAC,MAAM,EAAE,YAAY,CAAC,UAC1B,eAAe,UACf,SAAS,EAAE,GAAG,SAAS,WACtB,OAAO,KACf,MAAM,CAAC,MAAM,EAAE,YAAY,CAG7B,CAAC"}
@@ -0,0 +1,31 @@
1
+ /**
2
+ * The shared inbox to resolve an agency install's sub-account against.
3
+ *
4
+ * Returns a value only when the conversation belongs to exactly one inbox. The
5
+ * sub-account mapping is per inbox, so with several there is no single right
6
+ * answer, and picking one arbitrarily would confine the search to a client
7
+ * business the conversation may have nothing to do with. Undefined falls back
8
+ * to searching every sub-account — the behaviour before mapping existed, and
9
+ * wrong-but-slow beats confidently-wrong.
10
+ *
11
+ * Shared rather than inlined per call site: the card render and the
12
+ * entity-validation calls have to agree, or a record gets validated against one
13
+ * sub-account and rendered from another.
14
+ */
15
+ export declare const useMappedSmId: () => string | undefined;
16
+ /**
17
+ * Every shared inbox the conversation is in, as strings.
18
+ *
19
+ * Agency installs apply the sub-account mapping as the union of these. Sending
20
+ * only the single-inbox case (useMappedSmId) left a conversation in two inboxes
21
+ * with no inbox at all, and the server then searched every sub-account the
22
+ * install holds — showing, and letting an agent sync to, a contact from a client
23
+ * business none of the inboxes is mapped to.
24
+ */
25
+ export declare const useConversationSmIds: () => string[];
26
+ /**
27
+ * Appends the inboxes as the query parameters the backend reads: `smId` for the
28
+ * single-inbox case, and `inbox_ids` for every inbox the conversation is in.
29
+ */
30
+ export declare const withSmId: (url: string, smId?: string, smIds?: string[]) => string;
31
+ //# sourceMappingURL=useMappedSmId.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useMappedSmId.d.ts","sourceRoot":"","sources":["../../src/hooks/useMappedSmId.ts"],"names":[],"mappings":"AAkBA;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,aAAa,QAAO,MAAM,GAAG,SAGzC,CAAC;AAEF;;;;;;;;GAQG;AACH,eAAO,MAAM,oBAAoB,QAAO,MAAM,EAG7C,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,QAAQ,QAAS,MAAM,SAAS,MAAM,UAAS,MAAM,EAAE,WAMnE,CAAC"}