@digisglobal/omnivox-sdk 0.6.1 → 0.7.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.
package/dist/index.d.cts CHANGED
@@ -580,49 +580,95 @@ interface ContactsModuleOptions extends TokenProvider {
580
580
  /** Base URL of the Omnivox API (e.g. "https://api.omnivox.io"). */
581
581
  baseUrl: string;
582
582
  }
583
- /** Identity shape for creating a contact. */
583
+ /** Channel discriminator for a contact identity (wire enum). */
584
+ type ContactChannel = 'WHATSAPP' | 'EMAIL';
585
+ /**
586
+ * Identity shape for creating / adding a contact identity (request body).
587
+ * Matches the API Zod contract: `{ channelType, rawIdentifier }`.
588
+ */
584
589
  interface ContactIdentityInput {
585
- channel: string;
590
+ channelType: ContactChannel;
591
+ rawIdentifier: string;
592
+ }
593
+ /** Custom-field value on a create/patch request — referenced by field NAME. */
594
+ interface ContactFieldValueInput {
595
+ fieldName: string;
586
596
  value: string;
587
- [key: string]: unknown;
588
597
  }
589
598
  /** Input for creating a contact. */
590
599
  interface CreateContactInput {
591
600
  displayName: string;
592
- identities: ContactIdentityInput[];
593
- [key: string]: unknown;
601
+ /** Single identity (the API accepts `identity` or `identities[]`). */
602
+ identity?: ContactIdentityInput;
603
+ identities?: ContactIdentityInput[];
604
+ /** Tag NAMES from the catalog (unknown names → 422). Full set on create. */
605
+ tags?: string[];
606
+ /** Field values by NAME (unknown names → 422). */
607
+ fieldValues?: ContactFieldValueInput[];
594
608
  }
595
- /** Input for patching a contact. */
609
+ /**
610
+ * Input for patching a contact. The PATCH endpoint is strict — only these
611
+ * keys are accepted. `tags`/`fieldValues`, when present, are full-replacement.
612
+ */
596
613
  interface PatchContactInput {
597
614
  displayName?: string;
598
615
  isActive?: boolean;
599
- [key: string]: unknown;
616
+ tags?: string[];
617
+ fieldValues?: ContactFieldValueInput[];
600
618
  }
601
619
  /** Input for adding an identity to a contact. */
602
- interface AddIdentityInput {
603
- channel: string;
604
- value: string;
605
- [key: string]: unknown;
606
- }
607
- /** Contact identity resource shape. */
620
+ type AddIdentityInput = ContactIdentityInput;
621
+ /** Contact identity resource shape (response). */
608
622
  interface ContactIdentity {
609
623
  id: string;
610
- channel: string;
624
+ channelType: ContactChannel;
625
+ rawIdentifier: string;
626
+ normalizedIdentifier?: string;
627
+ }
628
+ /** A tag reference from the tenant catalog (response). */
629
+ interface ContactTag {
630
+ id: string;
631
+ name: string;
632
+ }
633
+ /** A custom-field definition from the catalog (response). */
634
+ interface ContactFieldDefinition {
635
+ id: string;
636
+ name: string;
637
+ type: string;
638
+ }
639
+ /**
640
+ * A custom-field value on contact detail (response). `fieldName` is a future
641
+ * enrichment (DEP-13) — until it lands, join `fieldId` against `metadata().fields`.
642
+ */
643
+ interface ContactFieldValue {
644
+ fieldId: string;
611
645
  value: string;
612
- [key: string]: unknown;
646
+ fieldName?: string;
613
647
  }
614
- /** Contact resource shape returned by the API. */
648
+ /** A conversation summary embedded on contact detail (response). */
649
+ interface ContactConversationSummary {
650
+ id: string;
651
+ contactIdentityId: string;
652
+ status: string;
653
+ lastInboundAt: string | null;
654
+ createdAt: string;
655
+ updatedAt: string;
656
+ }
657
+ /** Contact resource shape returned by the API (list + detail). */
615
658
  interface ContactItem {
616
659
  id: string;
617
660
  displayName: string;
661
+ isActive?: boolean;
662
+ createdAt?: string;
618
663
  identities?: ContactIdentity[];
619
- [key: string]: unknown;
664
+ tags?: ContactTag[];
665
+ fieldValues?: ContactFieldValue[];
666
+ conversations?: ContactConversationSummary[];
620
667
  }
621
668
  /** Contacts metadata (tag catalog and custom-field definitions). */
622
669
  interface ContactsMetadata {
623
- tags: unknown[];
624
- customFields: unknown[];
625
- [key: string]: unknown;
670
+ tags: ContactTag[];
671
+ fields: ContactFieldDefinition[];
626
672
  }
627
673
  /** Paginated list response. */
628
674
  interface PagedList$2<T> {
@@ -1588,4 +1634,4 @@ declare function createWhatsAppBusinessAccountsModule(options: WhatsAppBusinessA
1588
1634
  /** Return type of createWhatsAppBusinessAccountsModule. */
1589
1635
  type WhatsAppBusinessAccountsModule = ReturnType<typeof createWhatsAppBusinessAccountsModule>;
1590
1636
 
1591
- export { type AddIdentityInput, type AgentItem, type AgentsModule, type AgentsModuleOptions, type ApiKeyItem, type AssignInput, type AttachmentUploadResult, type AttachmentUrlResult, type AttachmentsModule, type AttachmentsModuleOptions, type AuthMeAgent, type AuthMeModule, type AuthMeModuleOptions, type AuthMeResponse, type AuthMeTenant, type AuthorDraftInput, type BasicEmailChannelConfig, type BasicEmailChannelSecret, type CannedResponseItem, type CannedResponseListOpts, type CannedResponseSearchOpts, type CannedResponsesModule, type CannedResponsesModuleOptions, type Channel, type ChannelListItem, type ChannelStatus, type ChannelType, type ChannelsModule, type ChannelsModuleOptions, type ContactIdentity, type ContactIdentityInput, type ContactItem, type ContactSearchOpts, type ContactsMetadata, type ContactsModule, type ContactsModuleOptions, type ConversationItem, type ConversationListOpts, type ConversationsModule, type ConversationsModuleOptions, type CreateAgentInput, type CreateApiKeyInput, type CreateApiKeyResponse, type CreateCannedResponseInput, type CreateChannelBody, type CreateContactInput, type CreateEmailChannelBody, type CreateEmailTemplateInput, type CreateWhatsAppChannelBody, type CredentialsMode, type EmailChannelConfig, type EmailChannelSecret, type EmailImapConfig, type EmailSmtpConfig, type EmailTemplateItem, type EmailTemplateListOpts, type ImportApprovedResult, type LobbyEntry, type LobbyListOpts, type MessageItem, type MessageListOpts, type MessageReadUpdatePayload, type MessageStatusPayload, type MessagesModule, type MessagesModuleOptions, type OAuth2CertificateEmailChannelSecret, type OAuth2ClientSecretEmailChannelSecret, type OAuth2EmailChannelConfig, type OAuth2EmailChannelSecret, type OmnivoxClient, type OmnivoxClientOptions, OmnivoxRequestError, type PageOpts, type PageParams, type PagedResponse, type ParticipantPayload, type PatchContactInput, type PatchEmailTemplateInput, type PickupInput, type ReopenOrCreateInput, type RevokeApiKeyResponse, type SendMessageInput, type SendTemplateInput, type SubmitResult, type TemplatesModule, type TemplatesModuleOptions, type TenantsModule, type TenantsModuleOptions, type TokenProvider, type TypingIndicatorPayload, type UpdateCannedResponseInput, type UpdateChannelBody, type UpdateStatusInput, type UpdateWhatsAppTemplateInput, type WhatsAppBusinessAccountItem, type WhatsAppBusinessAccountsModule, type WhatsAppBusinessAccountsModuleOptions, type WhatsAppChannelConfig, type WhatsAppRecoveryOption, type WhatsAppTemplateHistoryEvent, type WhatsAppTemplateItem, type WsAuth, type WsClient, type WsClientInstance, type WsClientOptions, type WsConnectionState, type WsEventPayloads, buildPageParams, createAgentsModule, createApiKeyTokenProvider, createAttachmentsModule, createAuthMeModule, createCannedResponsesModule, createChannelsModule, createContactsModule, createConversationsModule, createMessagesModule, createOmnivoxClient, createSessionTokenProvider, createTemplatesModule, createTenantsModule, createWhatsAppBusinessAccountsModule, createWsClient, iteratePages };
1637
+ export { type AddIdentityInput, type AgentItem, type AgentsModule, type AgentsModuleOptions, type ApiKeyItem, type AssignInput, type AttachmentUploadResult, type AttachmentUrlResult, type AttachmentsModule, type AttachmentsModuleOptions, type AuthMeAgent, type AuthMeModule, type AuthMeModuleOptions, type AuthMeResponse, type AuthMeTenant, type AuthorDraftInput, type BasicEmailChannelConfig, type BasicEmailChannelSecret, type CannedResponseItem, type CannedResponseListOpts, type CannedResponseSearchOpts, type CannedResponsesModule, type CannedResponsesModuleOptions, type Channel, type ChannelListItem, type ChannelStatus, type ChannelType, type ChannelsModule, type ChannelsModuleOptions, type ContactChannel, type ContactConversationSummary, type ContactFieldDefinition, type ContactFieldValue, type ContactFieldValueInput, type ContactIdentity, type ContactIdentityInput, type ContactItem, type ContactSearchOpts, type ContactTag, type ContactsMetadata, type ContactsModule, type ContactsModuleOptions, type ConversationItem, type ConversationListOpts, type ConversationsModule, type ConversationsModuleOptions, type CreateAgentInput, type CreateApiKeyInput, type CreateApiKeyResponse, type CreateCannedResponseInput, type CreateChannelBody, type CreateContactInput, type CreateEmailChannelBody, type CreateEmailTemplateInput, type CreateWhatsAppChannelBody, type CredentialsMode, type EmailChannelConfig, type EmailChannelSecret, type EmailImapConfig, type EmailSmtpConfig, type EmailTemplateItem, type EmailTemplateListOpts, type ImportApprovedResult, type LobbyEntry, type LobbyListOpts, type MessageItem, type MessageListOpts, type MessageReadUpdatePayload, type MessageStatusPayload, type MessagesModule, type MessagesModuleOptions, type OAuth2CertificateEmailChannelSecret, type OAuth2ClientSecretEmailChannelSecret, type OAuth2EmailChannelConfig, type OAuth2EmailChannelSecret, type OmnivoxClient, type OmnivoxClientOptions, OmnivoxRequestError, type PageOpts, type PageParams, type PagedResponse, type ParticipantPayload, type PatchContactInput, type PatchEmailTemplateInput, type PickupInput, type ReopenOrCreateInput, type RevokeApiKeyResponse, type SendMessageInput, type SendTemplateInput, type SubmitResult, type TemplatesModule, type TemplatesModuleOptions, type TenantsModule, type TenantsModuleOptions, type TokenProvider, type TypingIndicatorPayload, type UpdateCannedResponseInput, type UpdateChannelBody, type UpdateStatusInput, type UpdateWhatsAppTemplateInput, type WhatsAppBusinessAccountItem, type WhatsAppBusinessAccountsModule, type WhatsAppBusinessAccountsModuleOptions, type WhatsAppChannelConfig, type WhatsAppRecoveryOption, type WhatsAppTemplateHistoryEvent, type WhatsAppTemplateItem, type WsAuth, type WsClient, type WsClientInstance, type WsClientOptions, type WsConnectionState, type WsEventPayloads, buildPageParams, createAgentsModule, createApiKeyTokenProvider, createAttachmentsModule, createAuthMeModule, createCannedResponsesModule, createChannelsModule, createContactsModule, createConversationsModule, createMessagesModule, createOmnivoxClient, createSessionTokenProvider, createTemplatesModule, createTenantsModule, createWhatsAppBusinessAccountsModule, createWsClient, iteratePages };
package/dist/index.d.ts CHANGED
@@ -580,49 +580,95 @@ interface ContactsModuleOptions extends TokenProvider {
580
580
  /** Base URL of the Omnivox API (e.g. "https://api.omnivox.io"). */
581
581
  baseUrl: string;
582
582
  }
583
- /** Identity shape for creating a contact. */
583
+ /** Channel discriminator for a contact identity (wire enum). */
584
+ type ContactChannel = 'WHATSAPP' | 'EMAIL';
585
+ /**
586
+ * Identity shape for creating / adding a contact identity (request body).
587
+ * Matches the API Zod contract: `{ channelType, rawIdentifier }`.
588
+ */
584
589
  interface ContactIdentityInput {
585
- channel: string;
590
+ channelType: ContactChannel;
591
+ rawIdentifier: string;
592
+ }
593
+ /** Custom-field value on a create/patch request — referenced by field NAME. */
594
+ interface ContactFieldValueInput {
595
+ fieldName: string;
586
596
  value: string;
587
- [key: string]: unknown;
588
597
  }
589
598
  /** Input for creating a contact. */
590
599
  interface CreateContactInput {
591
600
  displayName: string;
592
- identities: ContactIdentityInput[];
593
- [key: string]: unknown;
601
+ /** Single identity (the API accepts `identity` or `identities[]`). */
602
+ identity?: ContactIdentityInput;
603
+ identities?: ContactIdentityInput[];
604
+ /** Tag NAMES from the catalog (unknown names → 422). Full set on create. */
605
+ tags?: string[];
606
+ /** Field values by NAME (unknown names → 422). */
607
+ fieldValues?: ContactFieldValueInput[];
594
608
  }
595
- /** Input for patching a contact. */
609
+ /**
610
+ * Input for patching a contact. The PATCH endpoint is strict — only these
611
+ * keys are accepted. `tags`/`fieldValues`, when present, are full-replacement.
612
+ */
596
613
  interface PatchContactInput {
597
614
  displayName?: string;
598
615
  isActive?: boolean;
599
- [key: string]: unknown;
616
+ tags?: string[];
617
+ fieldValues?: ContactFieldValueInput[];
600
618
  }
601
619
  /** Input for adding an identity to a contact. */
602
- interface AddIdentityInput {
603
- channel: string;
604
- value: string;
605
- [key: string]: unknown;
606
- }
607
- /** Contact identity resource shape. */
620
+ type AddIdentityInput = ContactIdentityInput;
621
+ /** Contact identity resource shape (response). */
608
622
  interface ContactIdentity {
609
623
  id: string;
610
- channel: string;
624
+ channelType: ContactChannel;
625
+ rawIdentifier: string;
626
+ normalizedIdentifier?: string;
627
+ }
628
+ /** A tag reference from the tenant catalog (response). */
629
+ interface ContactTag {
630
+ id: string;
631
+ name: string;
632
+ }
633
+ /** A custom-field definition from the catalog (response). */
634
+ interface ContactFieldDefinition {
635
+ id: string;
636
+ name: string;
637
+ type: string;
638
+ }
639
+ /**
640
+ * A custom-field value on contact detail (response). `fieldName` is a future
641
+ * enrichment (DEP-13) — until it lands, join `fieldId` against `metadata().fields`.
642
+ */
643
+ interface ContactFieldValue {
644
+ fieldId: string;
611
645
  value: string;
612
- [key: string]: unknown;
646
+ fieldName?: string;
613
647
  }
614
- /** Contact resource shape returned by the API. */
648
+ /** A conversation summary embedded on contact detail (response). */
649
+ interface ContactConversationSummary {
650
+ id: string;
651
+ contactIdentityId: string;
652
+ status: string;
653
+ lastInboundAt: string | null;
654
+ createdAt: string;
655
+ updatedAt: string;
656
+ }
657
+ /** Contact resource shape returned by the API (list + detail). */
615
658
  interface ContactItem {
616
659
  id: string;
617
660
  displayName: string;
661
+ isActive?: boolean;
662
+ createdAt?: string;
618
663
  identities?: ContactIdentity[];
619
- [key: string]: unknown;
664
+ tags?: ContactTag[];
665
+ fieldValues?: ContactFieldValue[];
666
+ conversations?: ContactConversationSummary[];
620
667
  }
621
668
  /** Contacts metadata (tag catalog and custom-field definitions). */
622
669
  interface ContactsMetadata {
623
- tags: unknown[];
624
- customFields: unknown[];
625
- [key: string]: unknown;
670
+ tags: ContactTag[];
671
+ fields: ContactFieldDefinition[];
626
672
  }
627
673
  /** Paginated list response. */
628
674
  interface PagedList$2<T> {
@@ -1588,4 +1634,4 @@ declare function createWhatsAppBusinessAccountsModule(options: WhatsAppBusinessA
1588
1634
  /** Return type of createWhatsAppBusinessAccountsModule. */
1589
1635
  type WhatsAppBusinessAccountsModule = ReturnType<typeof createWhatsAppBusinessAccountsModule>;
1590
1636
 
1591
- export { type AddIdentityInput, type AgentItem, type AgentsModule, type AgentsModuleOptions, type ApiKeyItem, type AssignInput, type AttachmentUploadResult, type AttachmentUrlResult, type AttachmentsModule, type AttachmentsModuleOptions, type AuthMeAgent, type AuthMeModule, type AuthMeModuleOptions, type AuthMeResponse, type AuthMeTenant, type AuthorDraftInput, type BasicEmailChannelConfig, type BasicEmailChannelSecret, type CannedResponseItem, type CannedResponseListOpts, type CannedResponseSearchOpts, type CannedResponsesModule, type CannedResponsesModuleOptions, type Channel, type ChannelListItem, type ChannelStatus, type ChannelType, type ChannelsModule, type ChannelsModuleOptions, type ContactIdentity, type ContactIdentityInput, type ContactItem, type ContactSearchOpts, type ContactsMetadata, type ContactsModule, type ContactsModuleOptions, type ConversationItem, type ConversationListOpts, type ConversationsModule, type ConversationsModuleOptions, type CreateAgentInput, type CreateApiKeyInput, type CreateApiKeyResponse, type CreateCannedResponseInput, type CreateChannelBody, type CreateContactInput, type CreateEmailChannelBody, type CreateEmailTemplateInput, type CreateWhatsAppChannelBody, type CredentialsMode, type EmailChannelConfig, type EmailChannelSecret, type EmailImapConfig, type EmailSmtpConfig, type EmailTemplateItem, type EmailTemplateListOpts, type ImportApprovedResult, type LobbyEntry, type LobbyListOpts, type MessageItem, type MessageListOpts, type MessageReadUpdatePayload, type MessageStatusPayload, type MessagesModule, type MessagesModuleOptions, type OAuth2CertificateEmailChannelSecret, type OAuth2ClientSecretEmailChannelSecret, type OAuth2EmailChannelConfig, type OAuth2EmailChannelSecret, type OmnivoxClient, type OmnivoxClientOptions, OmnivoxRequestError, type PageOpts, type PageParams, type PagedResponse, type ParticipantPayload, type PatchContactInput, type PatchEmailTemplateInput, type PickupInput, type ReopenOrCreateInput, type RevokeApiKeyResponse, type SendMessageInput, type SendTemplateInput, type SubmitResult, type TemplatesModule, type TemplatesModuleOptions, type TenantsModule, type TenantsModuleOptions, type TokenProvider, type TypingIndicatorPayload, type UpdateCannedResponseInput, type UpdateChannelBody, type UpdateStatusInput, type UpdateWhatsAppTemplateInput, type WhatsAppBusinessAccountItem, type WhatsAppBusinessAccountsModule, type WhatsAppBusinessAccountsModuleOptions, type WhatsAppChannelConfig, type WhatsAppRecoveryOption, type WhatsAppTemplateHistoryEvent, type WhatsAppTemplateItem, type WsAuth, type WsClient, type WsClientInstance, type WsClientOptions, type WsConnectionState, type WsEventPayloads, buildPageParams, createAgentsModule, createApiKeyTokenProvider, createAttachmentsModule, createAuthMeModule, createCannedResponsesModule, createChannelsModule, createContactsModule, createConversationsModule, createMessagesModule, createOmnivoxClient, createSessionTokenProvider, createTemplatesModule, createTenantsModule, createWhatsAppBusinessAccountsModule, createWsClient, iteratePages };
1637
+ export { type AddIdentityInput, type AgentItem, type AgentsModule, type AgentsModuleOptions, type ApiKeyItem, type AssignInput, type AttachmentUploadResult, type AttachmentUrlResult, type AttachmentsModule, type AttachmentsModuleOptions, type AuthMeAgent, type AuthMeModule, type AuthMeModuleOptions, type AuthMeResponse, type AuthMeTenant, type AuthorDraftInput, type BasicEmailChannelConfig, type BasicEmailChannelSecret, type CannedResponseItem, type CannedResponseListOpts, type CannedResponseSearchOpts, type CannedResponsesModule, type CannedResponsesModuleOptions, type Channel, type ChannelListItem, type ChannelStatus, type ChannelType, type ChannelsModule, type ChannelsModuleOptions, type ContactChannel, type ContactConversationSummary, type ContactFieldDefinition, type ContactFieldValue, type ContactFieldValueInput, type ContactIdentity, type ContactIdentityInput, type ContactItem, type ContactSearchOpts, type ContactTag, type ContactsMetadata, type ContactsModule, type ContactsModuleOptions, type ConversationItem, type ConversationListOpts, type ConversationsModule, type ConversationsModuleOptions, type CreateAgentInput, type CreateApiKeyInput, type CreateApiKeyResponse, type CreateCannedResponseInput, type CreateChannelBody, type CreateContactInput, type CreateEmailChannelBody, type CreateEmailTemplateInput, type CreateWhatsAppChannelBody, type CredentialsMode, type EmailChannelConfig, type EmailChannelSecret, type EmailImapConfig, type EmailSmtpConfig, type EmailTemplateItem, type EmailTemplateListOpts, type ImportApprovedResult, type LobbyEntry, type LobbyListOpts, type MessageItem, type MessageListOpts, type MessageReadUpdatePayload, type MessageStatusPayload, type MessagesModule, type MessagesModuleOptions, type OAuth2CertificateEmailChannelSecret, type OAuth2ClientSecretEmailChannelSecret, type OAuth2EmailChannelConfig, type OAuth2EmailChannelSecret, type OmnivoxClient, type OmnivoxClientOptions, OmnivoxRequestError, type PageOpts, type PageParams, type PagedResponse, type ParticipantPayload, type PatchContactInput, type PatchEmailTemplateInput, type PickupInput, type ReopenOrCreateInput, type RevokeApiKeyResponse, type SendMessageInput, type SendTemplateInput, type SubmitResult, type TemplatesModule, type TemplatesModuleOptions, type TenantsModule, type TenantsModuleOptions, type TokenProvider, type TypingIndicatorPayload, type UpdateCannedResponseInput, type UpdateChannelBody, type UpdateStatusInput, type UpdateWhatsAppTemplateInput, type WhatsAppBusinessAccountItem, type WhatsAppBusinessAccountsModule, type WhatsAppBusinessAccountsModuleOptions, type WhatsAppChannelConfig, type WhatsAppRecoveryOption, type WhatsAppTemplateHistoryEvent, type WhatsAppTemplateItem, type WsAuth, type WsClient, type WsClientInstance, type WsClientOptions, type WsConnectionState, type WsEventPayloads, buildPageParams, createAgentsModule, createApiKeyTokenProvider, createAttachmentsModule, createAuthMeModule, createCannedResponsesModule, createChannelsModule, createContactsModule, createConversationsModule, createMessagesModule, createOmnivoxClient, createSessionTokenProvider, createTemplatesModule, createTenantsModule, createWhatsAppBusinessAccountsModule, createWsClient, iteratePages };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@digisglobal/omnivox-sdk",
3
- "version": "0.6.1",
3
+ "version": "0.7.0",
4
4
  "type": "module",
5
5
  "types": "./dist/index.d.ts",
6
6
  "exports": {