wiil-core-js 0.0.82
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/LICENSE +21 -0
- package/README.md +174 -0
- package/dist/core/account/index.d.ts +7 -0
- package/dist/core/account/index.js +23 -0
- package/dist/core/account/organization.schema.d.ts +118 -0
- package/dist/core/account/organization.schema.js +91 -0
- package/dist/core/account/project.schema.d.ts +121 -0
- package/dist/core/account/project.schema.js +102 -0
- package/dist/core/account/supported-business-verticals.d.ts +8 -0
- package/dist/core/account/supported-business-verticals.js +23 -0
- package/dist/core/assistant-setups/assistant-setup-result.schema.d.ts +115 -0
- package/dist/core/assistant-setups/assistant-setup-result.schema.js +17 -0
- package/dist/core/assistant-setups/base-assistant-setup.schema.d.ts +61 -0
- package/dist/core/assistant-setups/base-assistant-setup.schema.js +29 -0
- package/dist/core/assistant-setups/index.d.ts +4 -0
- package/dist/core/assistant-setups/index.js +21 -0
- package/dist/core/assistant-setups/phone-assistant-setup.schema.d.ts +63 -0
- package/dist/core/assistant-setups/phone-assistant-setup.schema.js +14 -0
- package/dist/core/assistant-setups/web-assitant-setup.schema.d.ts +56 -0
- package/dist/core/assistant-setups/web-assitant-setup.schema.js +17 -0
- package/dist/core/base.schema.d.ts +34 -0
- package/dist/core/base.schema.js +36 -0
- package/dist/core/business-mgt/appointment-additional-info.schema.d.ts +63 -0
- package/dist/core/business-mgt/appointment-additional-info.schema.js +53 -0
- package/dist/core/business-mgt/appointment-field-config.schema.d.ts +251 -0
- package/dist/core/business-mgt/appointment-field-config.schema.js +49 -0
- package/dist/core/business-mgt/bookings.shared.schema.d.ts +47 -0
- package/dist/core/business-mgt/bookings.shared.schema.js +60 -0
- package/dist/core/business-mgt/business-location.schema.d.ts +327 -0
- package/dist/core/business-mgt/business-location.schema.js +176 -0
- package/dist/core/business-mgt/customer-management/customer-group.schema.d.ts +87 -0
- package/dist/core/business-mgt/customer-management/customer-group.schema.js +53 -0
- package/dist/core/business-mgt/customer-management/customer.schema.d.ts +156 -0
- package/dist/core/business-mgt/customer-management/customer.schema.js +93 -0
- package/dist/core/business-mgt/customer-management/index.d.ts +7 -0
- package/dist/core/business-mgt/customer-management/index.js +23 -0
- package/dist/core/business-mgt/customer-management/shipping-address.schema.d.ts +112 -0
- package/dist/core/business-mgt/customer-management/shipping-address.schema.js +79 -0
- package/dist/core/business-mgt/customer.schema.d.ts +111 -0
- package/dist/core/business-mgt/customer.schema.js +73 -0
- package/dist/core/business-mgt/discount-rule.schema.d.ts +183 -0
- package/dist/core/business-mgt/discount-rule.schema.js +108 -0
- package/dist/core/business-mgt/index.d.ts +16 -0
- package/dist/core/business-mgt/index.js +38 -0
- package/dist/core/business-mgt/menu-config.schema.d.ts +165 -0
- package/dist/core/business-mgt/menu-config.schema.js +86 -0
- package/dist/core/business-mgt/menu-management/index.d.ts +11 -0
- package/dist/core/business-mgt/menu-management/index.js +27 -0
- package/dist/core/business-mgt/menu-management/menu-catalog.schema.d.ts +386 -0
- package/dist/core/business-mgt/menu-management/menu-catalog.schema.js +58 -0
- package/dist/core/business-mgt/menu-management/menu-config.schema.d.ts +301 -0
- package/dist/core/business-mgt/menu-management/menu-config.schema.js +169 -0
- package/dist/core/business-mgt/menu-management/menu-item-variant.schema.d.ts +143 -0
- package/dist/core/business-mgt/menu-management/menu-item-variant.schema.js +86 -0
- package/dist/core/business-mgt/menu-management/menu-pricing-rule.schema.d.ts +239 -0
- package/dist/core/business-mgt/menu-management/menu-pricing-rule.schema.js +117 -0
- package/dist/core/business-mgt/menu-management/menu-set.schema.d.ts +420 -0
- package/dist/core/business-mgt/menu-management/menu-set.schema.js +283 -0
- package/dist/core/business-mgt/menu-management/menu.order.schema.d.ts +654 -0
- package/dist/core/business-mgt/menu-management/menu.order.schema.js +204 -0
- package/dist/core/business-mgt/menu-management/modifier.schema.d.ts +585 -0
- package/dist/core/business-mgt/menu-management/modifier.schema.js +341 -0
- package/dist/core/business-mgt/menu.order.schema.d.ts +335 -0
- package/dist/core/business-mgt/menu.order.schema.js +149 -0
- package/dist/core/business-mgt/order.schema.d.ts +222 -0
- package/dist/core/business-mgt/order.schema.js +205 -0
- package/dist/core/business-mgt/pricing-rule.shared.schema.d.ts +56 -0
- package/dist/core/business-mgt/pricing-rule.shared.schema.js +68 -0
- package/dist/core/business-mgt/product-config.schema.d.ts +177 -0
- package/dist/core/business-mgt/product-config.schema.js +106 -0
- package/dist/core/business-mgt/product-management/index.d.ts +12 -0
- package/dist/core/business-mgt/product-management/index.js +28 -0
- package/dist/core/business-mgt/product-management/product-axis-binding.schema.d.ts +54 -0
- package/dist/core/business-mgt/product-management/product-axis-binding.schema.js +54 -0
- package/dist/core/business-mgt/product-management/product-config.schema.d.ts +1042 -0
- package/dist/core/business-mgt/product-management/product-config.schema.js +392 -0
- package/dist/core/business-mgt/product-management/product-display.schema.d.ts +548 -0
- package/dist/core/business-mgt/product-management/product-display.schema.js +80 -0
- package/dist/core/business-mgt/product-management/product-order.schema.d.ts +493 -0
- package/dist/core/business-mgt/product-management/product-order.schema.js +158 -0
- package/dist/core/business-mgt/product-management/product-pricing-rule.schema.d.ts +167 -0
- package/dist/core/business-mgt/product-management/product-pricing-rule.schema.js +68 -0
- package/dist/core/business-mgt/product-management/product-set.schema.d.ts +488 -0
- package/dist/core/business-mgt/product-management/product-set.schema.js +273 -0
- package/dist/core/business-mgt/product-management/product-variant-axis.schema.d.ts +156 -0
- package/dist/core/business-mgt/product-management/product-variant-axis.schema.js +98 -0
- package/dist/core/business-mgt/product-management/product-variant.schema.d.ts +219 -0
- package/dist/core/business-mgt/product-management/product-variant.schema.js +130 -0
- package/dist/core/business-mgt/product-order.schema.d.ts +326 -0
- package/dist/core/business-mgt/product-order.schema.js +153 -0
- package/dist/core/business-mgt/property-config.schema.d.ts +621 -0
- package/dist/core/business-mgt/property-config.schema.js +224 -0
- package/dist/core/business-mgt/property-inquiry.schema.d.ts +222 -0
- package/dist/core/business-mgt/property-inquiry.schema.js +112 -0
- package/dist/core/business-mgt/property-management/index.d.ts +6 -0
- package/dist/core/business-mgt/property-management/index.js +22 -0
- package/dist/core/business-mgt/property-management/property-config.schema.d.ts +1306 -0
- package/dist/core/business-mgt/property-management/property-config.schema.js +367 -0
- package/dist/core/business-mgt/property-management/property-inquiry.schema.d.ts +254 -0
- package/dist/core/business-mgt/property-management/property-inquiry.schema.js +131 -0
- package/dist/core/business-mgt/reservation-mgt/assignment/index.d.ts +3 -0
- package/dist/core/business-mgt/reservation-mgt/assignment/index.js +19 -0
- package/dist/core/business-mgt/reservation-mgt/assignment/reservation-rental-assignment.schema.d.ts +139 -0
- package/dist/core/business-mgt/reservation-mgt/assignment/reservation-rental-assignment.schema.js +90 -0
- package/dist/core/business-mgt/reservation-mgt/assignment/reservation-room-assignment.schema.d.ts +104 -0
- package/dist/core/business-mgt/reservation-mgt/assignment/reservation-room-assignment.schema.js +70 -0
- package/dist/core/business-mgt/reservation-mgt/assignment/reservation-table-assignment.schema.d.ts +104 -0
- package/dist/core/business-mgt/reservation-mgt/assignment/reservation-table-assignment.schema.js +72 -0
- package/dist/core/business-mgt/reservation-mgt/index.d.ts +14 -0
- package/dist/core/business-mgt/reservation-mgt/index.js +31 -0
- package/dist/core/business-mgt/reservation-mgt/reservation-floor-plan-definition.schema.d.ts +180 -0
- package/dist/core/business-mgt/reservation-mgt/reservation-floor-plan-definition.schema.js +75 -0
- package/dist/core/business-mgt/reservation-mgt/reservation-maintenance-block.schema.d.ts +91 -0
- package/dist/core/business-mgt/reservation-mgt/reservation-maintenance-block.schema.js +57 -0
- package/dist/core/business-mgt/reservation-mgt/reservation-rental.schema.d.ts +334 -0
- package/dist/core/business-mgt/reservation-mgt/reservation-rental.schema.js +179 -0
- package/dist/core/business-mgt/reservation-mgt/reservation-room.schema.d.ts +195 -0
- package/dist/core/business-mgt/reservation-mgt/reservation-room.schema.js +106 -0
- package/dist/core/business-mgt/reservation-mgt/reservation-section.schema.d.ts +402 -0
- package/dist/core/business-mgt/reservation-mgt/reservation-section.schema.js +198 -0
- package/dist/core/business-mgt/reservation-mgt/reservation-settings.schema.d.ts +229 -0
- package/dist/core/business-mgt/reservation-mgt/reservation-settings.schema.js +127 -0
- package/dist/core/business-mgt/reservation-mgt/reservation-slot-query.schema.d.ts +382 -0
- package/dist/core/business-mgt/reservation-mgt/reservation-slot-query.schema.js +322 -0
- package/dist/core/business-mgt/reservation-mgt/reservation-table-layout.schema.d.ts +123 -0
- package/dist/core/business-mgt/reservation-mgt/reservation-table-layout.schema.js +83 -0
- package/dist/core/business-mgt/reservation-mgt/reservation-table.schema.d.ts +167 -0
- package/dist/core/business-mgt/reservation-mgt/reservation-table.schema.js +84 -0
- package/dist/core/business-mgt/reservation-mgt/reservation.schema.d.ts +0 -0
- package/dist/core/business-mgt/reservation-mgt/reservation.schema.js +153 -0
- package/dist/core/business-mgt/reservation-mgt/resource/index.d.ts +4 -0
- package/dist/core/business-mgt/reservation-mgt/resource/index.js +20 -0
- package/dist/core/business-mgt/reservation-mgt/resource/reservation-resource-category.schema.d.ts +157 -0
- package/dist/core/business-mgt/reservation-mgt/resource/reservation-resource-category.schema.js +76 -0
- package/dist/core/business-mgt/reservation-mgt/resource/reservation-resource-instance.schema.d.ts +137 -0
- package/dist/core/business-mgt/reservation-mgt/resource/reservation-resource-instance.schema.js +94 -0
- package/dist/core/business-mgt/reservation-mgt/resource/reservation-resource.schema.d.ts +713 -0
- package/dist/core/business-mgt/reservation-mgt/resource/reservation-resource.schema.js +363 -0
- package/dist/core/business-mgt/reservation-mgt/resource/resource-versioning.schema.d.ts +151 -0
- package/dist/core/business-mgt/reservation-mgt/resource/resource-versioning.schema.js +147 -0
- package/dist/core/business-mgt/reservation-resource.schema.d.ts +154 -0
- package/dist/core/business-mgt/reservation-resource.schema.js +100 -0
- package/dist/core/business-mgt/reservation.schema.d.ts +119 -0
- package/dist/core/business-mgt/reservation.schema.js +89 -0
- package/dist/core/business-mgt/service-appointment.schema.d.ts +105 -0
- package/dist/core/business-mgt/service-appointment.schema.js +69 -0
- package/dist/core/business-mgt/service-config.schema.d.ts +453 -0
- package/dist/core/business-mgt/service-config.schema.js +102 -0
- package/dist/core/business-mgt/service-management/appointment-additional-info.schema.d.ts +110 -0
- package/dist/core/business-mgt/service-management/appointment-additional-info.schema.js +78 -0
- package/dist/core/business-mgt/service-management/appointment-field-config.schema.d.ts +304 -0
- package/dist/core/business-mgt/service-management/appointment-field-config.schema.js +75 -0
- package/dist/core/business-mgt/service-management/business-service-config.schema.d.ts +1226 -0
- package/dist/core/business-mgt/service-management/business-service-config.schema.js +317 -0
- package/dist/core/business-mgt/service-management/index.d.ts +13 -0
- package/dist/core/business-mgt/service-management/index.js +29 -0
- package/dist/core/business-mgt/service-management/service-appointment.schema.d.ts +531 -0
- package/dist/core/business-mgt/service-management/service-appointment.schema.js +116 -0
- package/dist/core/business-mgt/service-management/service-person.schema.d.ts +122 -0
- package/dist/core/business-mgt/service-management/service-person.schema.js +66 -0
- package/dist/core/business-mgt/service-management/service-pricing-rule.schema.d.ts +221 -0
- package/dist/core/business-mgt/service-management/service-pricing-rule.schema.js +118 -0
- package/dist/core/business-mgt/service-management/service-provider.schema.d.ts +90 -0
- package/dist/core/business-mgt/service-management/service-provider.schema.js +54 -0
- package/dist/core/business-mgt/service-management/service-slot-query.schema.d.ts +90 -0
- package/dist/core/business-mgt/service-management/service-slot-query.schema.js +113 -0
- package/dist/core/business-mgt/service-management/service-time-off.schema.d.ts +121 -0
- package/dist/core/business-mgt/service-management/service-time-off.schema.js +95 -0
- package/dist/core/business-mgt/service-person.schema.d.ts +43 -0
- package/dist/core/business-mgt/service-person.schema.js +38 -0
- package/dist/core/business-mgt/tax-rule.schema.d.ts +161 -0
- package/dist/core/business-mgt/tax-rule.schema.js +90 -0
- package/dist/core/conversation/conversation-config.schema.d.ts +644 -0
- package/dist/core/conversation/conversation-config.schema.js +351 -0
- package/dist/core/conversation/conversation-message.schema.d.ts +307 -0
- package/dist/core/conversation/conversation-message.schema.js +275 -0
- package/dist/core/conversation/index.d.ts +12 -0
- package/dist/core/conversation/index.js +28 -0
- package/dist/core/conversation/outbound-call.schema.d.ts +209 -0
- package/dist/core/conversation/outbound-call.schema.js +116 -0
- package/dist/core/conversation/outbound-email.schema.d.ts +338 -0
- package/dist/core/conversation/outbound-email.schema.js +150 -0
- package/dist/core/conversation/outbound-sms.schema.d.ts +163 -0
- package/dist/core/conversation/outbound-sms.schema.js +85 -0
- package/dist/core/conversation/outbound-template.schema.d.ts +375 -0
- package/dist/core/conversation/outbound-template.schema.js +160 -0
- package/dist/core/conversation/translation-config.schema.d.ts +92 -0
- package/dist/core/conversation/translation-config.schema.js +88 -0
- package/dist/core/conversation/translation-conversation.schema.d.ts +469 -0
- package/dist/core/conversation/translation-conversation.schema.js +175 -0
- package/dist/core/index.d.ts +12 -0
- package/dist/core/index.js +30 -0
- package/dist/core/service-configuration/agent-config.schema.d.ts +236 -0
- package/dist/core/service-configuration/agent-config.schema.js +152 -0
- package/dist/core/service-configuration/base-agent-setup.d.ts +147 -0
- package/dist/core/service-configuration/base-agent-setup.js +123 -0
- package/dist/core/service-configuration/call-transfer-config.schema.d.ts +60 -0
- package/dist/core/service-configuration/call-transfer-config.schema.js +53 -0
- package/dist/core/service-configuration/deployment-config.schema.d.ts +522 -0
- package/dist/core/service-configuration/deployment-config.schema.js +271 -0
- package/dist/core/service-configuration/dynamic_setup/base-agent-setup.d.ts +130 -0
- package/dist/core/service-configuration/dynamic_setup/base-agent-setup.js +110 -0
- package/dist/core/service-configuration/dynamic_setup/index.d.ts +10 -0
- package/dist/core/service-configuration/dynamic_setup/index.js +26 -0
- package/dist/core/service-configuration/dynamic_setup/phone-agent-setup.d.ts +111 -0
- package/dist/core/service-configuration/dynamic_setup/phone-agent-setup.js +56 -0
- package/dist/core/service-configuration/dynamic_setup/web-agent-setup.d.ts +113 -0
- package/dist/core/service-configuration/dynamic_setup/web-agent-setup.js +55 -0
- package/dist/core/service-configuration/index.d.ts +17 -0
- package/dist/core/service-configuration/index.js +33 -0
- package/dist/core/service-configuration/instruction-config.schema.d.ts +183 -0
- package/dist/core/service-configuration/instruction-config.schema.js +139 -0
- package/dist/core/service-configuration/interaction-channels.schema.d.ts +469 -0
- package/dist/core/service-configuration/interaction-channels.schema.js +390 -0
- package/dist/core/service-configuration/knowledge.schema.d.ts +107 -0
- package/dist/core/service-configuration/knowledge.schema.js +106 -0
- package/dist/core/service-configuration/phone-config.schema.d.ts +206 -0
- package/dist/core/service-configuration/phone-config.schema.js +121 -0
- package/dist/core/service-configuration/phone-number.schema.d.ts +236 -0
- package/dist/core/service-configuration/phone-number.schema.js +211 -0
- package/dist/core/service-configuration/provisioning-config.d.ts +429 -0
- package/dist/core/service-configuration/provisioning-config.js +307 -0
- package/dist/core/service-configuration/support-llm.d.ts +95 -0
- package/dist/core/service-configuration/support-llm.js +76 -0
- package/dist/core/service-configuration/voice-language.schema.d.ts +200 -0
- package/dist/core/service-configuration/voice-language.schema.js +166 -0
- package/dist/core/type-definitions/account-definitions.d.ts +82 -0
- package/dist/core/type-definitions/account-definitions.js +88 -0
- package/dist/core/type-definitions/business-definitions.d.ts +394 -0
- package/dist/core/type-definitions/business-definitions.js +447 -0
- package/dist/core/type-definitions/conversation.type.definition.d.ts +223 -0
- package/dist/core/type-definitions/conversation.type.definition.js +236 -0
- package/dist/core/type-definitions/display-order.d.ts +154 -0
- package/dist/core/type-definitions/display-order.js +154 -0
- package/dist/core/type-definitions/dynamic-fields/field-definition.schema.d.ts +165 -0
- package/dist/core/type-definitions/dynamic-fields/field-definition.schema.js +97 -0
- package/dist/core/type-definitions/dynamic-fields/field-types.d.ts +49 -0
- package/dist/core/type-definitions/dynamic-fields/field-types.js +104 -0
- package/dist/core/type-definitions/dynamic-fields/index.d.ts +9 -0
- package/dist/core/type-definitions/dynamic-fields/index.js +25 -0
- package/dist/core/type-definitions/index.d.ts +10 -0
- package/dist/core/type-definitions/index.js +26 -0
- package/dist/core/type-definitions/knowledge-definitions.d.ts +30 -0
- package/dist/core/type-definitions/knowledge-definitions.js +37 -0
- package/dist/core/type-definitions/service-config.definitions.d.ts +112 -0
- package/dist/core/type-definitions/service-config.definitions.js +135 -0
- package/dist/core/validators/channel-validation.d.ts +19 -0
- package/dist/core/validators/channel-validation.js +40 -0
- package/dist/core/validators/index.d.ts +5 -0
- package/dist/core/validators/index.js +21 -0
- package/dist/index.d.ts +6 -0
- package/dist/index.js +24 -0
- package/dist/request/index.d.ts +5 -0
- package/dist/request/index.js +21 -0
- package/dist/request/models/index.d.ts +6 -0
- package/dist/request/models/index.js +22 -0
- package/dist/request/models/paginated-quest.schema.d.ts +33 -0
- package/dist/request/models/paginated-quest.schema.js +35 -0
- package/dist/request/models/paginated-result.schema.d.ts +124 -0
- package/dist/request/models/paginated-result.schema.js +94 -0
- package/package.json +43 -0
|
@@ -0,0 +1,206 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { PhoneStatus, ProviderType } from "../type-definitions";
|
|
3
|
+
/**
|
|
4
|
+
* @fileoverview Phone configuration schema definitions for telephony management.
|
|
5
|
+
*
|
|
6
|
+
* Phone Configurations manage telephony resources including phone numbers from various providers
|
|
7
|
+
* (SignalWire, Twilio). They track provider information, channel associations, and operational status.
|
|
8
|
+
* Referenced by Phone Channel configurations for call and SMS deployments.
|
|
9
|
+
*
|
|
10
|
+
* @module service-configuration/phone-config
|
|
11
|
+
*/
|
|
12
|
+
/**
|
|
13
|
+
* Zod schema for Phone Configuration validation.
|
|
14
|
+
*
|
|
15
|
+
* Manages a phone number resource from a telephony provider, tracking its configuration, status,
|
|
16
|
+
* and associations with deployment channels. A single phone number can support both voice calls
|
|
17
|
+
* and SMS through separate channel associations.
|
|
18
|
+
*
|
|
19
|
+
* @remarks
|
|
20
|
+
* **Architecture Context:**
|
|
21
|
+
* - **Referenced By**: PhoneChannelConfig (via phoneConfigurationId)
|
|
22
|
+
* - **Purpose**: Manages telephony resources and provider integration
|
|
23
|
+
* - **Dual Channel Support**: One phone number can have both voice and SMS channels
|
|
24
|
+
* - **Providers**: SignalWire, Twilio, and other SIP/VoIP providers
|
|
25
|
+
*
|
|
26
|
+
* **Phone Number Lifecycle:**
|
|
27
|
+
* - **PENDING**: Purchase initiated, awaiting provisioning
|
|
28
|
+
* - **ACTIVE**: Operational and ready for deployments
|
|
29
|
+
* - **INACTIVE**: Purchased but not yet activated
|
|
30
|
+
* - **SUSPENDED**: Temporarily disabled
|
|
31
|
+
* - **RELEASED**: Disconnected and returned to provider
|
|
32
|
+
*
|
|
33
|
+
* @typedef {Object} PhoneConfigurationProperties
|
|
34
|
+
* @property {string} id - Unique identifier for the phone configuration
|
|
35
|
+
* @property {string} phoneNumber - Phone number, short code, or alphanumeric sender ID
|
|
36
|
+
* @property {string} providerPhoneNumberId - Unique identifier from the telephony provider's system for this phone number
|
|
37
|
+
* @property {string} phoneRequestId - Reference ID for the original phone number request or setup configuration
|
|
38
|
+
* @property {string | null} friendlyName - Human-readable display name for administrative interfaces
|
|
39
|
+
* @property {string | null} [regionId] - Region identifier where this number is registered (provider-specific)
|
|
40
|
+
* @property {number | null} [monthlyPrice] - Monthly recurring cost for maintaining this phone number
|
|
41
|
+
* @property {string | null} [regionOrCountryName] - Human-readable region or country name
|
|
42
|
+
* @property {string} [countryCode] - ISO 3166-1 alpha-2 country code (e.g., 'US', 'GB', 'CA')
|
|
43
|
+
* @property {ProviderType} providerType - Telephony service provider (SIGNALWIRE, TWILIO, etc.) (default: SIGNALWIRE)
|
|
44
|
+
* @property {boolean} isImported - Whether this number was imported from external system (default: false)
|
|
45
|
+
* @property {PhoneStatus} status - Current operational status (PENDING, ACTIVE, INACTIVE, SUSPENDED, RELEASED) (default: INACTIVE)
|
|
46
|
+
* @property {boolean} isPorted - Whether this number was ported from another provider (default: false)
|
|
47
|
+
* @property {boolean | null} [markedForRelease] - Whether marked for disconnection (default: false)
|
|
48
|
+
* @property {Record<string, any>} [metadata] - Additional provider-specific metadata
|
|
49
|
+
* @property {string | null} [voiceChannelId] - ID of the voice/call deployment channel using this number
|
|
50
|
+
* @property {string | null} [smsChannelId] - ID of the SMS deployment channel using this number
|
|
51
|
+
* @property {DeploymentChannelInfo | null} [voiceChannel] - Populated voice channel configuration and deployment
|
|
52
|
+
* @property {DeploymentChannelInfo | null} [smsChannel] - Populated SMS channel configuration and deployment
|
|
53
|
+
* @property {boolean} isUSSMSPermitted - Whether US SMS messaging is permitted (compliance flag) (default: false)
|
|
54
|
+
* @property {number} [createdAt] - Unix timestamp (milliseconds) when created
|
|
55
|
+
* @property {number} [updatedAt] - Unix timestamp (milliseconds) when last updated
|
|
56
|
+
*
|
|
57
|
+
* @example
|
|
58
|
+
* ```typescript
|
|
59
|
+
* const phoneConfig: PhoneConfiguration = {
|
|
60
|
+
* id: '123*',
|
|
61
|
+
* phoneNumber: '+12125551234',
|
|
62
|
+
* providerPhoneNumberId: 'PN123abc*',
|
|
63
|
+
* phoneRequestId: 'REQ456*',
|
|
64
|
+
* friendlyName: 'Customer Support Line',
|
|
65
|
+
* regionId: 'us-ny',
|
|
66
|
+
* monthlyPrice: 1.00,
|
|
67
|
+
* regionOrCountryName: 'New York, United States',
|
|
68
|
+
* countryCode: 'US',
|
|
69
|
+
* providerType: ProviderType.SIGNALWIRE,
|
|
70
|
+
* status: PhoneStatus.ACTIVE,
|
|
71
|
+
* isImported: false,
|
|
72
|
+
* isPorted: false,
|
|
73
|
+
* isUSSMSPermitted: true,
|
|
74
|
+
* createdAt: Date.now(),
|
|
75
|
+
* updatedAt: Date.now()
|
|
76
|
+
* };
|
|
77
|
+
* ```
|
|
78
|
+
*/
|
|
79
|
+
export declare const PhoneConfigurationSchema: z.ZodObject<{
|
|
80
|
+
id: z.ZodString;
|
|
81
|
+
createdAt: z.ZodOptional<z.ZodNumber>;
|
|
82
|
+
updatedAt: z.ZodOptional<z.ZodNumber>;
|
|
83
|
+
phoneNumber: z.ZodString;
|
|
84
|
+
providerPhoneNumberId: z.ZodString;
|
|
85
|
+
phoneRequestId: z.ZodString;
|
|
86
|
+
friendlyName: z.ZodNullable<z.ZodString>;
|
|
87
|
+
regionId: z.ZodNullable<z.ZodOptional<z.ZodString>>;
|
|
88
|
+
monthlyPrice: z.ZodNullable<z.ZodOptional<z.ZodNumber>>;
|
|
89
|
+
regionOrCountryName: z.ZodNullable<z.ZodOptional<z.ZodString>>;
|
|
90
|
+
countryCode: z.ZodOptional<z.ZodString>;
|
|
91
|
+
providerType: z.ZodDefault<z.ZodEnum<typeof ProviderType>>;
|
|
92
|
+
isImported: z.ZodDefault<z.ZodBoolean>;
|
|
93
|
+
status: z.ZodDefault<z.ZodEnum<typeof PhoneStatus>>;
|
|
94
|
+
isPorted: z.ZodDefault<z.ZodBoolean>;
|
|
95
|
+
markedForRelease: z.ZodDefault<z.ZodOptional<z.ZodNullable<z.ZodBoolean>>>;
|
|
96
|
+
metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
|
|
97
|
+
voiceChannelId: z.ZodNullable<z.ZodOptional<z.ZodString>>;
|
|
98
|
+
smsChannelId: z.ZodNullable<z.ZodOptional<z.ZodString>>;
|
|
99
|
+
voiceChannel: z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
100
|
+
id: z.ZodString;
|
|
101
|
+
deploymentType: z.ZodEnum<typeof import("../type-definitions").DeploymentType>;
|
|
102
|
+
channelName: z.ZodOptional<z.ZodString>;
|
|
103
|
+
recordingEnabled: z.ZodDefault<z.ZodBoolean>;
|
|
104
|
+
channelIdentifier: z.ZodString;
|
|
105
|
+
configuration: z.ZodUnion<readonly [z.ZodObject<{
|
|
106
|
+
phoneConfigurationId: z.ZodString;
|
|
107
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
108
|
+
communicationType: z.ZodDefault<z.ZodEnum<typeof import("../type-definitions").OttCommunicationType>>;
|
|
109
|
+
widgetConfiguration: z.ZodOptional<z.ZodObject<{
|
|
110
|
+
position: z.ZodDefault<z.ZodEnum<{
|
|
111
|
+
left: "left";
|
|
112
|
+
right: "right";
|
|
113
|
+
}>>;
|
|
114
|
+
customTheme: z.ZodDefault<z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>>;
|
|
115
|
+
}, z.core.$strip>>;
|
|
116
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
117
|
+
packageName: z.ZodDefault<z.ZodString>;
|
|
118
|
+
platform: z.ZodDefault<z.ZodEnum<typeof import("../type-definitions").MobilePlatform>>;
|
|
119
|
+
}, z.core.$strip>]>;
|
|
120
|
+
deployment: z.ZodNullable<z.ZodObject<{
|
|
121
|
+
id: z.ZodString;
|
|
122
|
+
projectId: z.ZodString;
|
|
123
|
+
deploymentChannelId: z.ZodString;
|
|
124
|
+
deploymentName: z.ZodOptional<z.ZodString>;
|
|
125
|
+
agentConfigurationId: z.ZodString;
|
|
126
|
+
instructionConfigurationId: z.ZodString;
|
|
127
|
+
provisioningConfigChainId: z.ZodNullable<z.ZodOptional<z.ZodString>>;
|
|
128
|
+
provisioningType: z.ZodNullable<z.ZodOptional<z.ZodEnum<typeof import("../type-definitions").DeploymentProvisioningType>>>;
|
|
129
|
+
deploymentStatus: z.ZodEnum<typeof import("../type-definitions").DeploymentStatus>;
|
|
130
|
+
isActive: z.ZodDefault<z.ZodBoolean>;
|
|
131
|
+
project: z.ZodNullable<z.ZodOptional<z.ZodAny>>;
|
|
132
|
+
agent: z.ZodNullable<z.ZodOptional<z.ZodAny>>;
|
|
133
|
+
instruction: z.ZodNullable<z.ZodOptional<z.ZodAny>>;
|
|
134
|
+
createdAt: z.ZodNumber;
|
|
135
|
+
}, z.core.$strip>>;
|
|
136
|
+
}, z.core.$strip>>>;
|
|
137
|
+
smsChannel: z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
138
|
+
id: z.ZodString;
|
|
139
|
+
deploymentType: z.ZodEnum<typeof import("../type-definitions").DeploymentType>;
|
|
140
|
+
channelName: z.ZodOptional<z.ZodString>;
|
|
141
|
+
recordingEnabled: z.ZodDefault<z.ZodBoolean>;
|
|
142
|
+
channelIdentifier: z.ZodString;
|
|
143
|
+
configuration: z.ZodUnion<readonly [z.ZodObject<{
|
|
144
|
+
phoneConfigurationId: z.ZodString;
|
|
145
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
146
|
+
communicationType: z.ZodDefault<z.ZodEnum<typeof import("../type-definitions").OttCommunicationType>>;
|
|
147
|
+
widgetConfiguration: z.ZodOptional<z.ZodObject<{
|
|
148
|
+
position: z.ZodDefault<z.ZodEnum<{
|
|
149
|
+
left: "left";
|
|
150
|
+
right: "right";
|
|
151
|
+
}>>;
|
|
152
|
+
customTheme: z.ZodDefault<z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>>;
|
|
153
|
+
}, z.core.$strip>>;
|
|
154
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
155
|
+
packageName: z.ZodDefault<z.ZodString>;
|
|
156
|
+
platform: z.ZodDefault<z.ZodEnum<typeof import("../type-definitions").MobilePlatform>>;
|
|
157
|
+
}, z.core.$strip>]>;
|
|
158
|
+
deployment: z.ZodNullable<z.ZodObject<{
|
|
159
|
+
id: z.ZodString;
|
|
160
|
+
projectId: z.ZodString;
|
|
161
|
+
deploymentChannelId: z.ZodString;
|
|
162
|
+
deploymentName: z.ZodOptional<z.ZodString>;
|
|
163
|
+
agentConfigurationId: z.ZodString;
|
|
164
|
+
instructionConfigurationId: z.ZodString;
|
|
165
|
+
provisioningConfigChainId: z.ZodNullable<z.ZodOptional<z.ZodString>>;
|
|
166
|
+
provisioningType: z.ZodNullable<z.ZodOptional<z.ZodEnum<typeof import("../type-definitions").DeploymentProvisioningType>>>;
|
|
167
|
+
deploymentStatus: z.ZodEnum<typeof import("../type-definitions").DeploymentStatus>;
|
|
168
|
+
isActive: z.ZodDefault<z.ZodBoolean>;
|
|
169
|
+
project: z.ZodNullable<z.ZodOptional<z.ZodAny>>;
|
|
170
|
+
agent: z.ZodNullable<z.ZodOptional<z.ZodAny>>;
|
|
171
|
+
instruction: z.ZodNullable<z.ZodOptional<z.ZodAny>>;
|
|
172
|
+
createdAt: z.ZodNumber;
|
|
173
|
+
}, z.core.$strip>>;
|
|
174
|
+
}, z.core.$strip>>>;
|
|
175
|
+
isUSSMSPermitted: z.ZodDefault<z.ZodBoolean>;
|
|
176
|
+
}, z.core.$strip>;
|
|
177
|
+
/**
|
|
178
|
+
* Type definition for Phone Configuration.
|
|
179
|
+
*
|
|
180
|
+
* Represents a complete phone configuration including all metadata,
|
|
181
|
+
* provider information, and channel associations.
|
|
182
|
+
*/
|
|
183
|
+
export type PhoneConfiguration = z.infer<typeof PhoneConfigurationSchema>;
|
|
184
|
+
/**
|
|
185
|
+
* Zod schema for updating an existing phone configuration.
|
|
186
|
+
*
|
|
187
|
+
* Only allows updating the friendly name and requires the id to identify the configuration.
|
|
188
|
+
*
|
|
189
|
+
* @example
|
|
190
|
+
* ```typescript
|
|
191
|
+
* const updatePayload: UpdatePhoneConfiguration = {
|
|
192
|
+
* id: '123*',
|
|
193
|
+
* friendlyName: 'Updated Support Line Name'
|
|
194
|
+
* };
|
|
195
|
+
* ```
|
|
196
|
+
*/
|
|
197
|
+
export declare const UpdatePhoneConfigurationSchema: z.ZodObject<{
|
|
198
|
+
id: z.ZodString;
|
|
199
|
+
friendlyName: z.ZodNullable<z.ZodString>;
|
|
200
|
+
}, z.core.$strip>;
|
|
201
|
+
/**
|
|
202
|
+
* Type definition for updating an existing phone configuration.
|
|
203
|
+
*
|
|
204
|
+
* Represents a partial update payload with required id field.
|
|
205
|
+
*/
|
|
206
|
+
export type UpdatePhoneConfiguration = z.infer<typeof UpdatePhoneConfigurationSchema>;
|
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.UpdatePhoneConfigurationSchema = exports.PhoneConfigurationSchema = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const base_schema_1 = require("../base.schema");
|
|
6
|
+
const interaction_channels_schema_1 = require("./interaction-channels.schema");
|
|
7
|
+
const type_definitions_1 = require("../type-definitions");
|
|
8
|
+
/**
|
|
9
|
+
* @fileoverview Phone configuration schema definitions for telephony management.
|
|
10
|
+
*
|
|
11
|
+
* Phone Configurations manage telephony resources including phone numbers from various providers
|
|
12
|
+
* (SignalWire, Twilio). They track provider information, channel associations, and operational status.
|
|
13
|
+
* Referenced by Phone Channel configurations for call and SMS deployments.
|
|
14
|
+
*
|
|
15
|
+
* @module service-configuration/phone-config
|
|
16
|
+
*/
|
|
17
|
+
/**
|
|
18
|
+
* Zod schema for Phone Configuration validation.
|
|
19
|
+
*
|
|
20
|
+
* Manages a phone number resource from a telephony provider, tracking its configuration, status,
|
|
21
|
+
* and associations with deployment channels. A single phone number can support both voice calls
|
|
22
|
+
* and SMS through separate channel associations.
|
|
23
|
+
*
|
|
24
|
+
* @remarks
|
|
25
|
+
* **Architecture Context:**
|
|
26
|
+
* - **Referenced By**: PhoneChannelConfig (via phoneConfigurationId)
|
|
27
|
+
* - **Purpose**: Manages telephony resources and provider integration
|
|
28
|
+
* - **Dual Channel Support**: One phone number can have both voice and SMS channels
|
|
29
|
+
* - **Providers**: SignalWire, Twilio, and other SIP/VoIP providers
|
|
30
|
+
*
|
|
31
|
+
* **Phone Number Lifecycle:**
|
|
32
|
+
* - **PENDING**: Purchase initiated, awaiting provisioning
|
|
33
|
+
* - **ACTIVE**: Operational and ready for deployments
|
|
34
|
+
* - **INACTIVE**: Purchased but not yet activated
|
|
35
|
+
* - **SUSPENDED**: Temporarily disabled
|
|
36
|
+
* - **RELEASED**: Disconnected and returned to provider
|
|
37
|
+
*
|
|
38
|
+
* @typedef {Object} PhoneConfigurationProperties
|
|
39
|
+
* @property {string} id - Unique identifier for the phone configuration
|
|
40
|
+
* @property {string} phoneNumber - Phone number, short code, or alphanumeric sender ID
|
|
41
|
+
* @property {string} providerPhoneNumberId - Unique identifier from the telephony provider's system for this phone number
|
|
42
|
+
* @property {string} phoneRequestId - Reference ID for the original phone number request or setup configuration
|
|
43
|
+
* @property {string | null} friendlyName - Human-readable display name for administrative interfaces
|
|
44
|
+
* @property {string | null} [regionId] - Region identifier where this number is registered (provider-specific)
|
|
45
|
+
* @property {number | null} [monthlyPrice] - Monthly recurring cost for maintaining this phone number
|
|
46
|
+
* @property {string | null} [regionOrCountryName] - Human-readable region or country name
|
|
47
|
+
* @property {string} [countryCode] - ISO 3166-1 alpha-2 country code (e.g., 'US', 'GB', 'CA')
|
|
48
|
+
* @property {ProviderType} providerType - Telephony service provider (SIGNALWIRE, TWILIO, etc.) (default: SIGNALWIRE)
|
|
49
|
+
* @property {boolean} isImported - Whether this number was imported from external system (default: false)
|
|
50
|
+
* @property {PhoneStatus} status - Current operational status (PENDING, ACTIVE, INACTIVE, SUSPENDED, RELEASED) (default: INACTIVE)
|
|
51
|
+
* @property {boolean} isPorted - Whether this number was ported from another provider (default: false)
|
|
52
|
+
* @property {boolean | null} [markedForRelease] - Whether marked for disconnection (default: false)
|
|
53
|
+
* @property {Record<string, any>} [metadata] - Additional provider-specific metadata
|
|
54
|
+
* @property {string | null} [voiceChannelId] - ID of the voice/call deployment channel using this number
|
|
55
|
+
* @property {string | null} [smsChannelId] - ID of the SMS deployment channel using this number
|
|
56
|
+
* @property {DeploymentChannelInfo | null} [voiceChannel] - Populated voice channel configuration and deployment
|
|
57
|
+
* @property {DeploymentChannelInfo | null} [smsChannel] - Populated SMS channel configuration and deployment
|
|
58
|
+
* @property {boolean} isUSSMSPermitted - Whether US SMS messaging is permitted (compliance flag) (default: false)
|
|
59
|
+
* @property {number} [createdAt] - Unix timestamp (milliseconds) when created
|
|
60
|
+
* @property {number} [updatedAt] - Unix timestamp (milliseconds) when last updated
|
|
61
|
+
*
|
|
62
|
+
* @example
|
|
63
|
+
* ```typescript
|
|
64
|
+
* const phoneConfig: PhoneConfiguration = {
|
|
65
|
+
* id: '123*',
|
|
66
|
+
* phoneNumber: '+12125551234',
|
|
67
|
+
* providerPhoneNumberId: 'PN123abc*',
|
|
68
|
+
* phoneRequestId: 'REQ456*',
|
|
69
|
+
* friendlyName: 'Customer Support Line',
|
|
70
|
+
* regionId: 'us-ny',
|
|
71
|
+
* monthlyPrice: 1.00,
|
|
72
|
+
* regionOrCountryName: 'New York, United States',
|
|
73
|
+
* countryCode: 'US',
|
|
74
|
+
* providerType: ProviderType.SIGNALWIRE,
|
|
75
|
+
* status: PhoneStatus.ACTIVE,
|
|
76
|
+
* isImported: false,
|
|
77
|
+
* isPorted: false,
|
|
78
|
+
* isUSSMSPermitted: true,
|
|
79
|
+
* createdAt: Date.now(),
|
|
80
|
+
* updatedAt: Date.now()
|
|
81
|
+
* };
|
|
82
|
+
* ```
|
|
83
|
+
*/
|
|
84
|
+
exports.PhoneConfigurationSchema = base_schema_1.BaseModelSchema.safeExtend({
|
|
85
|
+
phoneNumber: zod_1.z.string().min(1).describe("Phone number, short code, or alphanumeric sender ID"),
|
|
86
|
+
providerPhoneNumberId: zod_1.z.string().describe("Unique identifier for this phone number from the telephony provider's system (provider-specific format)"),
|
|
87
|
+
phoneRequestId: zod_1.z.string().describe("Reference ID for the original phone number request or setup configuration"),
|
|
88
|
+
friendlyName: zod_1.z.string().nullable().describe("Human-readable display name for this phone number used in administrative interfaces (e.g., 'Customer Support Line', 'Sales Main Number')"),
|
|
89
|
+
regionId: zod_1.z.string().optional().nullable().describe("Region identifier where this phone number is registered (provider-specific, e.g., 'us-ny' for New York)"),
|
|
90
|
+
monthlyPrice: zod_1.z.number().optional().nullable().describe("Monthly recurring cost for maintaining this phone number in USD or provider currency"),
|
|
91
|
+
regionOrCountryName: zod_1.z.string().optional().nullable().describe("Human-readable name of the region or country where this number is registered (e.g., 'New York, United States', 'London, United Kingdom')"),
|
|
92
|
+
countryCode: zod_1.z.string().optional().describe("ISO 3166-1 alpha-2 country code where the phone number is registered (e.g., 'US', 'GB', 'CA')"),
|
|
93
|
+
providerType: zod_1.z.enum(type_definitions_1.ProviderType).default(type_definitions_1.ProviderType.SIGNALWIRE).describe("Telephony service provider managing this phone number (SIGNALWIRE, TWILIO, VONAGE, etc.)"),
|
|
94
|
+
isImported: zod_1.z.boolean().default(false).describe("Flag indicating if this phone number was imported from an external system rather than purchased through the platform"),
|
|
95
|
+
status: zod_1.z.enum(type_definitions_1.PhoneStatus).default(type_definitions_1.PhoneStatus.INACTIVE).describe("Current operational status (PENDING: provisioning, ACTIVE: operational, INACTIVE: purchased but not activated, SUSPENDED: temporarily disabled, RELEASED: disconnected)"),
|
|
96
|
+
isPorted: zod_1.z.boolean().default(false).describe("Flag indicating if this phone number was ported from another telephony provider (true) or purchased new (false)"),
|
|
97
|
+
markedForRelease: zod_1.z.boolean().nullable().optional().default(false).describe("Flag indicating if this phone number is marked for release/disconnection in the next billing cycle"),
|
|
98
|
+
metadata: zod_1.z.record(zod_1.z.string(), zod_1.z.any()).optional().describe("Additional provider-specific metadata, configuration details, or custom attributes for this phone number"),
|
|
99
|
+
voiceChannelId: zod_1.z.string().optional().nullable().describe("ID of the voice/call deployment channel associated with this phone number (null if not used for voice)"),
|
|
100
|
+
smsChannelId: zod_1.z.string().optional().nullable().describe("ID of the SMS deployment channel associated with this phone number (null if not used for SMS)"),
|
|
101
|
+
voiceChannel: interaction_channels_schema_1.DeploymentChannelWithDeploymentSchema.nullable().optional().describe("Populated voice deployment channel configuration including deployment details (null if not loaded or not used for voice)"),
|
|
102
|
+
smsChannel: interaction_channels_schema_1.DeploymentChannelWithDeploymentSchema.nullable().optional().describe("Populated SMS deployment channel configuration including deployment details (null if not loaded or not used for SMS)"),
|
|
103
|
+
isUSSMSPermitted: zod_1.z.boolean().default(false).describe("Compliance flag indicating if US SMS messaging is permitted for this phone number (required for A2P 10DLC registration)"),
|
|
104
|
+
});
|
|
105
|
+
/**
|
|
106
|
+
* Zod schema for updating an existing phone configuration.
|
|
107
|
+
*
|
|
108
|
+
* Only allows updating the friendly name and requires the id to identify the configuration.
|
|
109
|
+
*
|
|
110
|
+
* @example
|
|
111
|
+
* ```typescript
|
|
112
|
+
* const updatePayload: UpdatePhoneConfiguration = {
|
|
113
|
+
* id: '123*',
|
|
114
|
+
* friendlyName: 'Updated Support Line Name'
|
|
115
|
+
* };
|
|
116
|
+
* ```
|
|
117
|
+
*/
|
|
118
|
+
exports.UpdatePhoneConfigurationSchema = zod_1.z.object({
|
|
119
|
+
id: zod_1.z.string(),
|
|
120
|
+
friendlyName: zod_1.z.string().nullable(),
|
|
121
|
+
});
|
|
@@ -0,0 +1,236 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { PhoneNumberType, PhonePurchaseStatus } from "../type-definitions/service-config.definitions";
|
|
3
|
+
/**
|
|
4
|
+
* @fileoverview Phone number configuration and purchase schema definitions.
|
|
5
|
+
*
|
|
6
|
+
* Phone number schemas manage the complete lifecycle of phone number acquisition from telephony providers:
|
|
7
|
+
* discovery of available inventory, purchase transactions, and provisioning into Phone Configurations.
|
|
8
|
+
* Supports multiple providers (SignalWire, Twilio) with provider-specific extensions.
|
|
9
|
+
*
|
|
10
|
+
* @module service-configuration/phone-number
|
|
11
|
+
*/
|
|
12
|
+
/**
|
|
13
|
+
* Zod schema for base phone number information.
|
|
14
|
+
*
|
|
15
|
+
* Common properties shared across all phone number providers.
|
|
16
|
+
*
|
|
17
|
+
* @typedef {Object} BasePhoneNumberInfoProperties
|
|
18
|
+
* @property {string} friendlyName - Human-readable name for the phone number
|
|
19
|
+
* @property {string} phoneNumber - The phone number in E.164 format
|
|
20
|
+
* @property {string | null} [lata] - Local Access and Transport Area code
|
|
21
|
+
* @property {string} [rateCenter] - Rate center for the phone number
|
|
22
|
+
* @property {string} [region] - Geographic region
|
|
23
|
+
* @property {string} [postalCode] - Postal/ZIP code for the phone number
|
|
24
|
+
* @property {string} countryCode - ISO country code
|
|
25
|
+
* @property {Object} capabilities - Phone number capabilities
|
|
26
|
+
* @property {boolean} capabilities.voice - Supports voice calls
|
|
27
|
+
* @property {boolean} capabilities.SMS - Supports SMS messaging
|
|
28
|
+
* @property {boolean} capabilities.MMS - Supports MMS messaging
|
|
29
|
+
* @property {boolean} beta - Whether this is a beta number
|
|
30
|
+
* @property {PhoneNumberType} numberType - Type of phone number (local, toll-free, etc.)
|
|
31
|
+
*
|
|
32
|
+
* @example
|
|
33
|
+
* ```typescript
|
|
34
|
+
* const phoneInfo: BasePhoneNumberInfo = {
|
|
35
|
+
* friendlyName: 'Customer Support Line',
|
|
36
|
+
* phoneNumber: '+12125551234',
|
|
37
|
+
* countryCode: 'US',
|
|
38
|
+
* capabilities: { voice: true, SMS: true, MMS: false },
|
|
39
|
+
* beta: false,
|
|
40
|
+
* numberType: PhoneNumberType.LOCAL
|
|
41
|
+
* };
|
|
42
|
+
* ```
|
|
43
|
+
*/
|
|
44
|
+
export declare const BasePhoneNumberInfoSchema: z.ZodObject<{
|
|
45
|
+
friendlyName: z.ZodString;
|
|
46
|
+
phoneNumber: z.ZodString;
|
|
47
|
+
lata: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
48
|
+
rateCenter: z.ZodOptional<z.ZodString>;
|
|
49
|
+
region: z.ZodOptional<z.ZodString>;
|
|
50
|
+
postalCode: z.ZodOptional<z.ZodString>;
|
|
51
|
+
countryCode: z.ZodString;
|
|
52
|
+
capabilities: z.ZodObject<{
|
|
53
|
+
voice: z.ZodBoolean;
|
|
54
|
+
SMS: z.ZodBoolean;
|
|
55
|
+
MMS: z.ZodBoolean;
|
|
56
|
+
}, z.core.$strip>;
|
|
57
|
+
beta: z.ZodBoolean;
|
|
58
|
+
numberType: z.ZodEnum<typeof PhoneNumberType>;
|
|
59
|
+
}, z.core.$strip>;
|
|
60
|
+
/**
|
|
61
|
+
* Type definition for base phone number information.
|
|
62
|
+
*/
|
|
63
|
+
export type BasePhoneNumberInfo = z.infer<typeof BasePhoneNumberInfoSchema>;
|
|
64
|
+
/**
|
|
65
|
+
* Zod schema for phone provider response.
|
|
66
|
+
*
|
|
67
|
+
* Response from phone number provider API calls.
|
|
68
|
+
*
|
|
69
|
+
* @example
|
|
70
|
+
* ```typescript
|
|
71
|
+
* const response: PhoneProviderResponse = {
|
|
72
|
+
* success: true,
|
|
73
|
+
* status: 200,
|
|
74
|
+
* data: { availableNumbers: [...] }
|
|
75
|
+
* };
|
|
76
|
+
* ```
|
|
77
|
+
*/
|
|
78
|
+
export declare const PhoneProviderResponseSchema: z.ZodObject<{
|
|
79
|
+
success: z.ZodBoolean;
|
|
80
|
+
status: z.ZodOptional<z.ZodNumber>;
|
|
81
|
+
data: z.ZodUnknown;
|
|
82
|
+
}, z.core.$strip>;
|
|
83
|
+
/**
|
|
84
|
+
* Type definition for phone provider response.
|
|
85
|
+
*/
|
|
86
|
+
export type PhoneProviderResponse = z.infer<typeof PhoneProviderResponseSchema>;
|
|
87
|
+
/**
|
|
88
|
+
* Zod schema for phone number purchase transaction.
|
|
89
|
+
*
|
|
90
|
+
* Represents a phone number purchase request and its lifecycle through the purchase process.
|
|
91
|
+
*
|
|
92
|
+
* @typedef {Object} PhoneNumberPurchaseProperties
|
|
93
|
+
* @property {string} id - Unique identifier for the purchase transaction
|
|
94
|
+
* @property {string} friendlyName - Human-readable name for the purchased number
|
|
95
|
+
* @property {string} phoneNumber - The phone number being purchased
|
|
96
|
+
* @property {ProviderType} providerType - Provider from which the number is being purchased
|
|
97
|
+
* @property {string} countryCode - ISO country code for the phone number (e.g., 'US', 'GB', 'CA')
|
|
98
|
+
* @property {number} amount - Purchase amount (must be positive)
|
|
99
|
+
* @property {string} currency - Currency code (3 characters, default: "USD")
|
|
100
|
+
* @property {PhonePurchaseStatus} status - Current status of the purchase (default: PENDING)
|
|
101
|
+
* @property {PhoneNumberType} numberType - Type of phone number (default: LOCAL)
|
|
102
|
+
* @property {string | null} [statusDetails] - Additional details about the current status
|
|
103
|
+
* @property {number | null} [completedAt] - Timestamp when purchase was completed
|
|
104
|
+
* @property {Record<string, any> | null} [metadata] - Additional metadata for the purchase
|
|
105
|
+
* @property {number} [createdAt] - Timestamp when created
|
|
106
|
+
* @property {number} [updatedAt] - Timestamp when last updated
|
|
107
|
+
*
|
|
108
|
+
* @example
|
|
109
|
+
* ```typescript
|
|
110
|
+
* const purchase: PhoneNumberPurchase = {
|
|
111
|
+
* id: '32422DEGER56',
|
|
112
|
+
* friendlyName: 'Main Support Line',
|
|
113
|
+
* phoneNumber: '+12125551234',
|
|
114
|
+
* countryCode: 'US',
|
|
115
|
+
* chargedCredits: 1500,
|
|
116
|
+
* status: PhonePurchaseStatus.COMPLETED,
|
|
117
|
+
* numberType: PhoneNumberType.LOCAL,
|
|
118
|
+
* completedAt: Date.now(),
|
|
119
|
+
* createdAt: Date.now(),
|
|
120
|
+
* updatedAt: Date.now()
|
|
121
|
+
* };
|
|
122
|
+
* ```
|
|
123
|
+
*/
|
|
124
|
+
export declare const PhoneNumberPurchaseSchema: z.ZodObject<{
|
|
125
|
+
id: z.ZodString;
|
|
126
|
+
createdAt: z.ZodOptional<z.ZodNumber>;
|
|
127
|
+
updatedAt: z.ZodOptional<z.ZodNumber>;
|
|
128
|
+
friendlyName: z.ZodString;
|
|
129
|
+
phoneNumber: z.ZodString;
|
|
130
|
+
countryCode: z.ZodString;
|
|
131
|
+
chargedCredits: z.ZodNumber;
|
|
132
|
+
status: z.ZodDefault<z.ZodEnum<typeof PhonePurchaseStatus>>;
|
|
133
|
+
numberType: z.ZodDefault<z.ZodEnum<typeof PhoneNumberType>>;
|
|
134
|
+
statusDetails: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
135
|
+
completedAt: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
136
|
+
metadata: z.ZodOptional<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodAny>>>;
|
|
137
|
+
}, z.core.$strip>;
|
|
138
|
+
/**
|
|
139
|
+
* Type definition for phone number purchase.
|
|
140
|
+
*/
|
|
141
|
+
export type PhoneNumberPurchase = z.infer<typeof PhoneNumberPurchaseSchema>;
|
|
142
|
+
/**
|
|
143
|
+
* Zod schema for creating a new phone number purchase.
|
|
144
|
+
*
|
|
145
|
+
* Omits auto-generated and transaction-specific fields.
|
|
146
|
+
*
|
|
147
|
+
* @remarks
|
|
148
|
+
* Use this schema when initiating a new phone number purchase.
|
|
149
|
+
*
|
|
150
|
+
* @example
|
|
151
|
+
* ```typescript
|
|
152
|
+
* const newPurchase: CreatePhoneNumberPurchase = {
|
|
153
|
+
* friendlyName: 'New Support Line',
|
|
154
|
+
* phoneNumber: '+12125551234',
|
|
155
|
+
* countryCode: 'US',
|
|
156
|
+
* providerType: ProviderType.TWILIO,
|
|
157
|
+
* phoneNumberInfo: { ... },
|
|
158
|
+
* numberType: PhoneNumberType.LOCAL
|
|
159
|
+
* };
|
|
160
|
+
* ```
|
|
161
|
+
*/
|
|
162
|
+
export declare const CreatePhoneNumberPurchaseSchema: z.ZodObject<{
|
|
163
|
+
phoneNumber: z.ZodString;
|
|
164
|
+
friendlyName: z.ZodString;
|
|
165
|
+
countryCode: z.ZodString;
|
|
166
|
+
numberType: z.ZodDefault<z.ZodEnum<typeof PhoneNumberType>>;
|
|
167
|
+
}, z.core.$strip>;
|
|
168
|
+
/**
|
|
169
|
+
* Type definition for creating a phone number purchase.
|
|
170
|
+
*/
|
|
171
|
+
export type CreatePhoneNumberPurchase = z.infer<typeof CreatePhoneNumberPurchaseSchema>;
|
|
172
|
+
export declare const BusinessPhoneNumberPurchaseRequestSchema: z.ZodObject<{
|
|
173
|
+
phoneNumber: z.ZodString;
|
|
174
|
+
friendlyName: z.ZodOptional<z.ZodString>;
|
|
175
|
+
}, z.core.$strip>;
|
|
176
|
+
export type BusinessPhoneNumberPurchaseRequest = z.infer<typeof BusinessPhoneNumberPurchaseRequestSchema>;
|
|
177
|
+
/**
|
|
178
|
+
* Legacy schema export for backwards compatibility.
|
|
179
|
+
* @deprecated Use CreatePhoneNumberPurchaseSchema instead.
|
|
180
|
+
*/
|
|
181
|
+
export declare const PhoneNumberPurchaseRequestSchema: z.ZodObject<{
|
|
182
|
+
phoneNumber: z.ZodString;
|
|
183
|
+
friendlyName: z.ZodString;
|
|
184
|
+
countryCode: z.ZodString;
|
|
185
|
+
numberType: z.ZodDefault<z.ZodEnum<typeof PhoneNumberType>>;
|
|
186
|
+
}, z.core.$strip>;
|
|
187
|
+
/**
|
|
188
|
+
* Legacy type export for backwards compatibility.
|
|
189
|
+
* @deprecated Use CreatePhoneNumberPurchase instead.
|
|
190
|
+
*/
|
|
191
|
+
export type PhoneNumberPurchaseRequest = CreatePhoneNumberPurchase;
|
|
192
|
+
/**
|
|
193
|
+
* Zod schema for phone number pricing information.
|
|
194
|
+
*
|
|
195
|
+
* Represents pricing details for phone numbers from various providers.
|
|
196
|
+
*
|
|
197
|
+
* @typedef {Object} PhoneNumberPricingProperties
|
|
198
|
+
* @property {PhoneNumberType} number_type - Type of phone number
|
|
199
|
+
* @property {string} country - Full country name
|
|
200
|
+
* @property {string} countryCode - ISO country code
|
|
201
|
+
* @property {Array} phoneNumberPrices - Array of pricing tiers
|
|
202
|
+
* @property {number} price - Final price for the number
|
|
203
|
+
* @property {string} priceUnit - Unit of pricing (e.g., "per month")
|
|
204
|
+
* @property {string} currency - Currency code (3 characters, default: "USD")
|
|
205
|
+
*
|
|
206
|
+
* @example
|
|
207
|
+
* ```typescript
|
|
208
|
+
* const pricing: PhoneNumberPricing = {
|
|
209
|
+
* number_type: PhoneNumberType.LOCAL,
|
|
210
|
+
* country: 'United States',
|
|
211
|
+
* countryCode: 'US',
|
|
212
|
+
* phoneNumberPrices: [
|
|
213
|
+
* { base_price: '1.00', current_price: '1.00' }
|
|
214
|
+
* ],
|
|
215
|
+
* price: 1.00,
|
|
216
|
+
* priceUnit: 'per month',
|
|
217
|
+
* currency: 'USD'
|
|
218
|
+
* };
|
|
219
|
+
* ```
|
|
220
|
+
*/
|
|
221
|
+
export declare const PhoneNumberPricingSchema: z.ZodObject<{
|
|
222
|
+
number_type: z.ZodEnum<typeof PhoneNumberType>;
|
|
223
|
+
country: z.ZodString;
|
|
224
|
+
countryCode: z.ZodString;
|
|
225
|
+
phoneNumberPrices: z.ZodArray<z.ZodObject<{
|
|
226
|
+
base_price: z.ZodString;
|
|
227
|
+
current_price: z.ZodString;
|
|
228
|
+
}, z.core.$strip>>;
|
|
229
|
+
price: z.ZodNumber;
|
|
230
|
+
priceUnit: z.ZodString;
|
|
231
|
+
currency: z.ZodDefault<z.ZodString>;
|
|
232
|
+
}, z.core.$strip>;
|
|
233
|
+
/**
|
|
234
|
+
* Type definition for phone number pricing.
|
|
235
|
+
*/
|
|
236
|
+
export type PhoneNumberPricing = z.infer<typeof PhoneNumberPricingSchema>;
|