@nomalism-com/types 0.46.33 → 0.46.34

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.cjs CHANGED
@@ -472,6 +472,7 @@ var IBrokerTopic = /* @__PURE__ */ ((IBrokerTopic2) => {
472
472
  IBrokerTopic2["tickets_change"] = "tickets_change";
473
473
  IBrokerTopic2["push_notification"] = "push_notification";
474
474
  IBrokerTopic2["portal_subscriber_events"] = "portal_subscriber_events";
475
+ IBrokerTopic2["portal_document_events"] = "portal_document_events";
475
476
  IBrokerTopic2["sidemenu_highlight_changed"] = "sidemenu_highlight_changed";
476
477
  IBrokerTopic2["proposta_sheets_import_status"] = "proposta_sheets_import_status";
477
478
  IBrokerTopic2["user_send_email_password"] = "user_send_email_password";
package/dist/index.js CHANGED
@@ -472,6 +472,7 @@ var IBrokerTopic = /* @__PURE__ */ ((IBrokerTopic2) => {
472
472
  IBrokerTopic2["tickets_change"] = "tickets_change";
473
473
  IBrokerTopic2["push_notification"] = "push_notification";
474
474
  IBrokerTopic2["portal_subscriber_events"] = "portal_subscriber_events";
475
+ IBrokerTopic2["portal_document_events"] = "portal_document_events";
475
476
  IBrokerTopic2["sidemenu_highlight_changed"] = "sidemenu_highlight_changed";
476
477
  IBrokerTopic2["proposta_sheets_import_status"] = "proposta_sheets_import_status";
477
478
  IBrokerTopic2["user_send_email_password"] = "user_send_email_password";
@@ -1,6 +1,7 @@
1
1
  import type { IChatBalloon } from '../../stock/chat/interfaces';
2
2
  import type { ILastTicketCalledTodayByChannel, IRemainingTodayTickets } from '../../tickets/tickets/interfaces';
3
3
  import type { IPublicDocument, IPublicFindBySubscriberId, ITags } from '../../ui/portal/interface';
4
+ import type { IFindByOwnerIdItemWithVersions } from '../../supply/externalDocumentHeader/interface';
4
5
  export declare const Route = "ws";
5
6
  export interface IEvent {
6
7
  type: string;
@@ -73,6 +74,20 @@ export interface IPropostaSheetsImportStatus extends IEvent {
73
74
  error: string | null;
74
75
  }
75
76
  export type PropostaSheetsSocketEvent = IPropostaSheetsImportStatus | IPing | IPong;
77
+ /**
78
+ * Emitted whenever an external/certified document tied to a dossier is
79
+ * created (post-create effects finished), retried, or voided. The payload
80
+ * carries the full `IFindByOwnerIdItemWithVersions` row so the client can
81
+ * upsert it straight into the `ExternalDocumentHeaderFindByOwnerId` cache
82
+ * keyed by `owner_id` (the dossier / start_document_header_id), matching on
83
+ * `item.document_header_id` to decide between insert and replace.
84
+ */
85
+ export interface IExternalDocumentUpserted extends IEvent {
86
+ type: 'external_document.upserted';
87
+ owner_id: string;
88
+ item: IFindByOwnerIdItemWithVersions;
89
+ }
90
+ export type SupplyDocumentSocketEvent = IExternalDocumentUpserted | IPing | IPong;
76
91
  export interface IPushNotificationEvent extends IEvent {
77
92
  type: 'push_notification';
78
93
  counts: Record<string, number>;
@@ -11,7 +11,7 @@ import type { ProjectInfo } from './entities/integration';
11
11
  import type { IAttachment } from '../modules/supply/externalDocumentHeader/interface';
12
12
  import type { Persona } from './entities/user';
13
13
  import type { ITranslateRequest } from '../modules/stock/chat/interfaces';
14
- import type { ChatSocketEvent, TicketsSocketEvent } from '../modules/view/webSocket/interfaces';
14
+ import type { ChatSocketEvent, TicketsSocketEvent, SupplyDocumentSocketEvent } from '../modules/view/webSocket/interfaces';
15
15
  import type { SystemModuleEnum } from '../modules/user/systemModule/interface';
16
16
  export { messages };
17
17
  type CreatedAt = 'created_at';
@@ -145,6 +145,7 @@ export declare enum IBrokerTopic {
145
145
  tickets_change = "tickets_change",
146
146
  push_notification = "push_notification",
147
147
  portal_subscriber_events = "portal_subscriber_events",
148
+ portal_document_events = "portal_document_events",
148
149
  sidemenu_highlight_changed = "sidemenu_highlight_changed",
149
150
  proposta_sheets_import_status = "proposta_sheets_import_status",
150
151
  user_send_email_password = "user_send_email_password",
@@ -413,6 +414,10 @@ export type IBrokerTopicPayload = {
413
414
  target_subscriber_ids: string[];
414
415
  event: ChatSocketEvent;
415
416
  };
417
+ [IBrokerTopic.portal_document_events]: {
418
+ owner_id: string;
419
+ event: SupplyDocumentSocketEvent;
420
+ };
416
421
  [IBrokerTopic.sms_sender_select_lines]: {
417
422
  data: ISmsSenderSelectLinesData;
418
423
  };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@nomalism-com/types",
3
3
  "description": "A nomalism package with all necessary types and validations for developing APIs",
4
- "version": "0.46.33",
4
+ "version": "0.46.34",
5
5
  "author": "Nomalism <it.nomalism@gmail.com> (https://nomalism.com/)",
6
6
  "license": "UNLICENSED",
7
7
  "type": "module",