nixflex 0.5.0 → 0.6.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/CHANGELOG.md +4 -0
- package/dist/index.cjs +34 -1
- package/dist/index.d.cts +71 -1
- package/dist/index.d.ts +71 -1
- package/dist/index.js +34 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,7 @@
|
|
|
1
|
+
## 0.6.0
|
|
2
|
+
- New: `client.callers` - caller context on one of your numbers: `get()`, `set()` (omitted fields kept, null removes), `delete()` (erases yours and the engine's), `import()` (up to 1,000 rows, validated before any write). One record per (your number, caller number). Docs: https://docs.nixflex.com/concepts/caller-context
|
|
3
|
+
- New: `incall_sms_enabled` on agent create/update/get - texting during a call and automatic booking-confirmation texts. Default false for new agents. Docs: https://docs.nixflex.com/actions/in-call-sms
|
|
4
|
+
- Fix: User-Agent now reports the real SDK version (was stuck at 0.1.0).
|
|
1
5
|
## 0.5.0
|
|
2
6
|
|
|
3
7
|
- New: `client.llm` - bring your own OpenAI-compatible model (set() verifies with a real completion + tool-calling probe, key write-only). Calls it serves bill at -0.015/min.
|
package/dist/index.cjs
CHANGED
|
@@ -117,7 +117,7 @@ function errorFromResponse(status, body, requestId, retryAfterSeconds) {
|
|
|
117
117
|
// src/client.ts
|
|
118
118
|
var DEFAULT_BASE_URL = "https://api.nixflex.com";
|
|
119
119
|
var DEFAULT_TIMEOUT_MS = 3e4;
|
|
120
|
-
var SDK_VERSION = "0.
|
|
120
|
+
var SDK_VERSION = "0.6.0";
|
|
121
121
|
var HttpClient = class {
|
|
122
122
|
apiKey;
|
|
123
123
|
baseUrl;
|
|
@@ -559,6 +559,36 @@ var Webhooks = class {
|
|
|
559
559
|
}
|
|
560
560
|
};
|
|
561
561
|
|
|
562
|
+
// src/resources/callers.ts
|
|
563
|
+
function enc2(phoneNumber) {
|
|
564
|
+
return encodeURIComponent(phoneNumber);
|
|
565
|
+
}
|
|
566
|
+
var Callers = class {
|
|
567
|
+
constructor(http) {
|
|
568
|
+
this.http = http;
|
|
569
|
+
}
|
|
570
|
+
http;
|
|
571
|
+
/** What the agent knows about this caller on this number - your fields plus
|
|
572
|
+
* what the engine learned. 404 caller_not_found when there is no record. */
|
|
573
|
+
get(phoneNumber, callerNumber, opts) {
|
|
574
|
+
return this.http.request("GET", `/phone-numbers/${enc2(phoneNumber)}/callers/${enc2(callerNumber)}`, void 0, void 0, opts);
|
|
575
|
+
}
|
|
576
|
+
/** Set the caller's details. A field left out keeps its value; null removes it.
|
|
577
|
+
* last_call / open_item are engine-only and are rejected (engine_only_field). */
|
|
578
|
+
set(phoneNumber, callerNumber, params, opts) {
|
|
579
|
+
return this.http.request("PUT", `/phone-numbers/${enc2(phoneNumber)}/callers/${enc2(callerNumber)}`, params, void 0, opts);
|
|
580
|
+
}
|
|
581
|
+
/** Erase the whole record for this caller on this number - yours and the engine's. */
|
|
582
|
+
delete(phoneNumber, callerNumber, opts) {
|
|
583
|
+
return this.http.request("DELETE", `/phone-numbers/${enc2(phoneNumber)}/callers/${enc2(callerNumber)}`, void 0, void 0, opts);
|
|
584
|
+
}
|
|
585
|
+
/** Up to 1,000 rows in one request. Every row is validated before any is
|
|
586
|
+
* written. Split larger lists into several calls. */
|
|
587
|
+
import(phoneNumber, callers, opts) {
|
|
588
|
+
return this.http.request("POST", `/phone-numbers/${enc2(phoneNumber)}/callers/import`, { callers }, void 0, opts);
|
|
589
|
+
}
|
|
590
|
+
};
|
|
591
|
+
|
|
562
592
|
// src/index.ts
|
|
563
593
|
var Nixflex = class {
|
|
564
594
|
/** AI agents - create, list, get, update, delete. */
|
|
@@ -583,6 +613,8 @@ var Nixflex = class {
|
|
|
583
613
|
llm;
|
|
584
614
|
/** Your own TTS (elevenlabs/cartesia, verified with a real synthesis). */
|
|
585
615
|
tts;
|
|
616
|
+
/** Caller context - what the agent knows about each caller on one of your numbers. */
|
|
617
|
+
callers;
|
|
586
618
|
constructor(options) {
|
|
587
619
|
const http = new HttpClient(options);
|
|
588
620
|
this.agents = new Agents(http);
|
|
@@ -596,6 +628,7 @@ var Nixflex = class {
|
|
|
596
628
|
this.storage = new Storage(http);
|
|
597
629
|
this.llm = new Llm(http);
|
|
598
630
|
this.tts = new Tts(http);
|
|
631
|
+
this.callers = new Callers(http);
|
|
599
632
|
}
|
|
600
633
|
/** Create a brand-new API key (unauthenticated signup endpoint - most
|
|
601
634
|
* developers use the dashboard instead). The key_secret is shown ONCE.
|
package/dist/index.d.cts
CHANGED
|
@@ -129,6 +129,9 @@ interface Agent {
|
|
|
129
129
|
greet_by_name?: boolean;
|
|
130
130
|
fallback_message: string;
|
|
131
131
|
post_call_sms_enabled?: boolean;
|
|
132
|
+
/** Texting during a call + automatic booking-confirmation texts. Default false for
|
|
133
|
+
* new agents; agents created before this setting existed were switched on. */
|
|
134
|
+
incall_sms_enabled?: boolean;
|
|
132
135
|
post_call_sms_template?: string | null;
|
|
133
136
|
voicemail_leave_enabled?: boolean;
|
|
134
137
|
voicemail_message?: string | null;
|
|
@@ -805,6 +808,71 @@ declare class Webhooks {
|
|
|
805
808
|
delete(phoneNumber: string, slot?: 1 | 2, opts?: RequestOptions): Promise<WebhookConfigResponse>;
|
|
806
809
|
}
|
|
807
810
|
|
|
811
|
+
/** The six fields a developer may set. Omitted = kept; null = removed. */
|
|
812
|
+
interface CallerContextSetParams {
|
|
813
|
+
/** Full name - first and last. */
|
|
814
|
+
name?: string | null;
|
|
815
|
+
email?: string | null;
|
|
816
|
+
/** A contact number other than the one they call from. */
|
|
817
|
+
phone?: string | null;
|
|
818
|
+
/** Free text - city, area or postal code. */
|
|
819
|
+
location?: string | null;
|
|
820
|
+
/** An account, order or booking reference the caller uses. */
|
|
821
|
+
reference_id?: string | null;
|
|
822
|
+
/** A short preference, e.g. "prefers morning appointments". */
|
|
823
|
+
preference?: string | null;
|
|
824
|
+
}
|
|
825
|
+
/** The record as returned. Only fields with a value are present. */
|
|
826
|
+
interface CallerContextFields {
|
|
827
|
+
name?: string;
|
|
828
|
+
email?: string;
|
|
829
|
+
phone?: string;
|
|
830
|
+
location?: string;
|
|
831
|
+
reference_id?: string;
|
|
832
|
+
preference?: string;
|
|
833
|
+
/** Engine-written: what the caller wanted on their last call - never what happened. */
|
|
834
|
+
last_call?: string;
|
|
835
|
+
/** Engine-written: something still pending for the caller. */
|
|
836
|
+
open_item?: string;
|
|
837
|
+
}
|
|
838
|
+
interface CallerContext {
|
|
839
|
+
phone_number: string;
|
|
840
|
+
caller_number: string;
|
|
841
|
+
context: CallerContextFields;
|
|
842
|
+
}
|
|
843
|
+
interface CallerContextResponse {
|
|
844
|
+
caller: CallerContext;
|
|
845
|
+
}
|
|
846
|
+
interface CallerContextDeleteResponse {
|
|
847
|
+
phone_number: string;
|
|
848
|
+
caller_number: string;
|
|
849
|
+
deleted: true;
|
|
850
|
+
}
|
|
851
|
+
interface CallerImportRow extends CallerContextSetParams {
|
|
852
|
+
/** The caller's number in E.164 form. */
|
|
853
|
+
caller_number: string;
|
|
854
|
+
}
|
|
855
|
+
interface CallerImportResponse {
|
|
856
|
+
phone_number: string;
|
|
857
|
+
imported: number;
|
|
858
|
+
}
|
|
859
|
+
|
|
860
|
+
declare class Callers {
|
|
861
|
+
private readonly http;
|
|
862
|
+
constructor(http: HttpClient);
|
|
863
|
+
/** What the agent knows about this caller on this number - your fields plus
|
|
864
|
+
* what the engine learned. 404 caller_not_found when there is no record. */
|
|
865
|
+
get(phoneNumber: string, callerNumber: string, opts?: RequestOptions): Promise<CallerContextResponse>;
|
|
866
|
+
/** Set the caller's details. A field left out keeps its value; null removes it.
|
|
867
|
+
* last_call / open_item are engine-only and are rejected (engine_only_field). */
|
|
868
|
+
set(phoneNumber: string, callerNumber: string, params: CallerContextSetParams, opts?: RequestOptions): Promise<CallerContextResponse>;
|
|
869
|
+
/** Erase the whole record for this caller on this number - yours and the engine's. */
|
|
870
|
+
delete(phoneNumber: string, callerNumber: string, opts?: RequestOptions): Promise<CallerContextDeleteResponse>;
|
|
871
|
+
/** Up to 1,000 rows in one request. Every row is validated before any is
|
|
872
|
+
* written. Split larger lists into several calls. */
|
|
873
|
+
import(phoneNumber: string, callers: CallerImportRow[], opts?: RequestOptions): Promise<CallerImportResponse>;
|
|
874
|
+
}
|
|
875
|
+
|
|
808
876
|
interface NixflexAPIErrorBody {
|
|
809
877
|
error: {
|
|
810
878
|
type: string;
|
|
@@ -884,6 +952,8 @@ declare class Nixflex {
|
|
|
884
952
|
readonly llm: Llm;
|
|
885
953
|
/** Your own TTS (elevenlabs/cartesia, verified with a real synthesis). */
|
|
886
954
|
readonly tts: Tts;
|
|
955
|
+
/** Caller context - what the agent knows about each caller on one of your numbers. */
|
|
956
|
+
readonly callers: Callers;
|
|
887
957
|
constructor(options: NixflexClientOptions);
|
|
888
958
|
/** Create a brand-new API key (unauthenticated signup endpoint - most
|
|
889
959
|
* developers use the dashboard instead). The key_secret is shown ONCE.
|
|
@@ -894,4 +964,4 @@ declare class Nixflex {
|
|
|
894
964
|
}, baseUrl?: string): Promise<KeyCreateResponse>;
|
|
895
965
|
}
|
|
896
966
|
|
|
897
|
-
export { type Agent, type AgentCreateParams, type AgentDeleteResponse, type AgentUpdateParams, type BatchCampaignParams, type BatchCreateResponse, type BatchInvalidEntry, type BatchLaunchResponse, type BatchRecipient, type Call, type CallDeleteAllResponse, type CallDeleteResponse, type CallDirection, type CallerSentiment, type KeyCreateResponse, type KeyRotateResponse, type ListParams, type LlmConfig, type LlmDeleteResponse, type LlmSetParams, type LlmSetResponse, type MonitorToggleResponse, Nixflex, type NixflexAPIErrorBody, NixflexAuthenticationError, type NixflexClientOptions, NixflexConnectionError, NixflexError, NixflexInvalidRequestError, NixflexNotFoundError, NixflexPaymentRequiredError, NixflexRateLimitError, NixflexServerError, type OutboundCallParams, type OutboundCallResponse, type PhoneNumber, type PhoneNumberDeleteResponse, type PhoneNumberImportParams, type PhoneNumberListResponse, type PhoneNumberUpdateParams, type RequestOptions, type ResponseLength, type SmsCampaign, type SmsCampaignCreateParams, type SmsCampaignDeleteResponse, type SmsCampaignLaunchResponse, type SmsCampaignListResponse, type SmsCampaignRecipient, type SmsCampaignStatus, type SmsSendParams, type SmsSendResponse, type StorageConfig, type StorageDeleteResponse, type StorageSetParams, type StorageSetResponse, type TransferType, type TtsConfig, type TtsDeleteResponse, type TtsProvider, type TtsSetParams, type TtsSetResponse, type Usage, type VerifyOptions, type WebCallsToggleResponse, type WebhookConfigResponse, type Weekday, Nixflex as default, errorFromResponse, verifyWebhookSignature };
|
|
967
|
+
export { type Agent, type AgentCreateParams, type AgentDeleteResponse, type AgentUpdateParams, type BatchCampaignParams, type BatchCreateResponse, type BatchInvalidEntry, type BatchLaunchResponse, type BatchRecipient, type Call, type CallDeleteAllResponse, type CallDeleteResponse, type CallDirection, type CallerContext, type CallerContextDeleteResponse, type CallerContextFields, type CallerContextResponse, type CallerContextSetParams, type CallerImportResponse, type CallerImportRow, type CallerSentiment, type KeyCreateResponse, type KeyRotateResponse, type ListParams, type LlmConfig, type LlmDeleteResponse, type LlmSetParams, type LlmSetResponse, type MonitorToggleResponse, Nixflex, type NixflexAPIErrorBody, NixflexAuthenticationError, type NixflexClientOptions, NixflexConnectionError, NixflexError, NixflexInvalidRequestError, NixflexNotFoundError, NixflexPaymentRequiredError, NixflexRateLimitError, NixflexServerError, type OutboundCallParams, type OutboundCallResponse, type PhoneNumber, type PhoneNumberDeleteResponse, type PhoneNumberImportParams, type PhoneNumberListResponse, type PhoneNumberUpdateParams, type RequestOptions, type ResponseLength, type SmsCampaign, type SmsCampaignCreateParams, type SmsCampaignDeleteResponse, type SmsCampaignLaunchResponse, type SmsCampaignListResponse, type SmsCampaignRecipient, type SmsCampaignStatus, type SmsSendParams, type SmsSendResponse, type StorageConfig, type StorageDeleteResponse, type StorageSetParams, type StorageSetResponse, type TransferType, type TtsConfig, type TtsDeleteResponse, type TtsProvider, type TtsSetParams, type TtsSetResponse, type Usage, type VerifyOptions, type WebCallsToggleResponse, type WebhookConfigResponse, type Weekday, Nixflex as default, errorFromResponse, verifyWebhookSignature };
|
package/dist/index.d.ts
CHANGED
|
@@ -129,6 +129,9 @@ interface Agent {
|
|
|
129
129
|
greet_by_name?: boolean;
|
|
130
130
|
fallback_message: string;
|
|
131
131
|
post_call_sms_enabled?: boolean;
|
|
132
|
+
/** Texting during a call + automatic booking-confirmation texts. Default false for
|
|
133
|
+
* new agents; agents created before this setting existed were switched on. */
|
|
134
|
+
incall_sms_enabled?: boolean;
|
|
132
135
|
post_call_sms_template?: string | null;
|
|
133
136
|
voicemail_leave_enabled?: boolean;
|
|
134
137
|
voicemail_message?: string | null;
|
|
@@ -805,6 +808,71 @@ declare class Webhooks {
|
|
|
805
808
|
delete(phoneNumber: string, slot?: 1 | 2, opts?: RequestOptions): Promise<WebhookConfigResponse>;
|
|
806
809
|
}
|
|
807
810
|
|
|
811
|
+
/** The six fields a developer may set. Omitted = kept; null = removed. */
|
|
812
|
+
interface CallerContextSetParams {
|
|
813
|
+
/** Full name - first and last. */
|
|
814
|
+
name?: string | null;
|
|
815
|
+
email?: string | null;
|
|
816
|
+
/** A contact number other than the one they call from. */
|
|
817
|
+
phone?: string | null;
|
|
818
|
+
/** Free text - city, area or postal code. */
|
|
819
|
+
location?: string | null;
|
|
820
|
+
/** An account, order or booking reference the caller uses. */
|
|
821
|
+
reference_id?: string | null;
|
|
822
|
+
/** A short preference, e.g. "prefers morning appointments". */
|
|
823
|
+
preference?: string | null;
|
|
824
|
+
}
|
|
825
|
+
/** The record as returned. Only fields with a value are present. */
|
|
826
|
+
interface CallerContextFields {
|
|
827
|
+
name?: string;
|
|
828
|
+
email?: string;
|
|
829
|
+
phone?: string;
|
|
830
|
+
location?: string;
|
|
831
|
+
reference_id?: string;
|
|
832
|
+
preference?: string;
|
|
833
|
+
/** Engine-written: what the caller wanted on their last call - never what happened. */
|
|
834
|
+
last_call?: string;
|
|
835
|
+
/** Engine-written: something still pending for the caller. */
|
|
836
|
+
open_item?: string;
|
|
837
|
+
}
|
|
838
|
+
interface CallerContext {
|
|
839
|
+
phone_number: string;
|
|
840
|
+
caller_number: string;
|
|
841
|
+
context: CallerContextFields;
|
|
842
|
+
}
|
|
843
|
+
interface CallerContextResponse {
|
|
844
|
+
caller: CallerContext;
|
|
845
|
+
}
|
|
846
|
+
interface CallerContextDeleteResponse {
|
|
847
|
+
phone_number: string;
|
|
848
|
+
caller_number: string;
|
|
849
|
+
deleted: true;
|
|
850
|
+
}
|
|
851
|
+
interface CallerImportRow extends CallerContextSetParams {
|
|
852
|
+
/** The caller's number in E.164 form. */
|
|
853
|
+
caller_number: string;
|
|
854
|
+
}
|
|
855
|
+
interface CallerImportResponse {
|
|
856
|
+
phone_number: string;
|
|
857
|
+
imported: number;
|
|
858
|
+
}
|
|
859
|
+
|
|
860
|
+
declare class Callers {
|
|
861
|
+
private readonly http;
|
|
862
|
+
constructor(http: HttpClient);
|
|
863
|
+
/** What the agent knows about this caller on this number - your fields plus
|
|
864
|
+
* what the engine learned. 404 caller_not_found when there is no record. */
|
|
865
|
+
get(phoneNumber: string, callerNumber: string, opts?: RequestOptions): Promise<CallerContextResponse>;
|
|
866
|
+
/** Set the caller's details. A field left out keeps its value; null removes it.
|
|
867
|
+
* last_call / open_item are engine-only and are rejected (engine_only_field). */
|
|
868
|
+
set(phoneNumber: string, callerNumber: string, params: CallerContextSetParams, opts?: RequestOptions): Promise<CallerContextResponse>;
|
|
869
|
+
/** Erase the whole record for this caller on this number - yours and the engine's. */
|
|
870
|
+
delete(phoneNumber: string, callerNumber: string, opts?: RequestOptions): Promise<CallerContextDeleteResponse>;
|
|
871
|
+
/** Up to 1,000 rows in one request. Every row is validated before any is
|
|
872
|
+
* written. Split larger lists into several calls. */
|
|
873
|
+
import(phoneNumber: string, callers: CallerImportRow[], opts?: RequestOptions): Promise<CallerImportResponse>;
|
|
874
|
+
}
|
|
875
|
+
|
|
808
876
|
interface NixflexAPIErrorBody {
|
|
809
877
|
error: {
|
|
810
878
|
type: string;
|
|
@@ -884,6 +952,8 @@ declare class Nixflex {
|
|
|
884
952
|
readonly llm: Llm;
|
|
885
953
|
/** Your own TTS (elevenlabs/cartesia, verified with a real synthesis). */
|
|
886
954
|
readonly tts: Tts;
|
|
955
|
+
/** Caller context - what the agent knows about each caller on one of your numbers. */
|
|
956
|
+
readonly callers: Callers;
|
|
887
957
|
constructor(options: NixflexClientOptions);
|
|
888
958
|
/** Create a brand-new API key (unauthenticated signup endpoint - most
|
|
889
959
|
* developers use the dashboard instead). The key_secret is shown ONCE.
|
|
@@ -894,4 +964,4 @@ declare class Nixflex {
|
|
|
894
964
|
}, baseUrl?: string): Promise<KeyCreateResponse>;
|
|
895
965
|
}
|
|
896
966
|
|
|
897
|
-
export { type Agent, type AgentCreateParams, type AgentDeleteResponse, type AgentUpdateParams, type BatchCampaignParams, type BatchCreateResponse, type BatchInvalidEntry, type BatchLaunchResponse, type BatchRecipient, type Call, type CallDeleteAllResponse, type CallDeleteResponse, type CallDirection, type CallerSentiment, type KeyCreateResponse, type KeyRotateResponse, type ListParams, type LlmConfig, type LlmDeleteResponse, type LlmSetParams, type LlmSetResponse, type MonitorToggleResponse, Nixflex, type NixflexAPIErrorBody, NixflexAuthenticationError, type NixflexClientOptions, NixflexConnectionError, NixflexError, NixflexInvalidRequestError, NixflexNotFoundError, NixflexPaymentRequiredError, NixflexRateLimitError, NixflexServerError, type OutboundCallParams, type OutboundCallResponse, type PhoneNumber, type PhoneNumberDeleteResponse, type PhoneNumberImportParams, type PhoneNumberListResponse, type PhoneNumberUpdateParams, type RequestOptions, type ResponseLength, type SmsCampaign, type SmsCampaignCreateParams, type SmsCampaignDeleteResponse, type SmsCampaignLaunchResponse, type SmsCampaignListResponse, type SmsCampaignRecipient, type SmsCampaignStatus, type SmsSendParams, type SmsSendResponse, type StorageConfig, type StorageDeleteResponse, type StorageSetParams, type StorageSetResponse, type TransferType, type TtsConfig, type TtsDeleteResponse, type TtsProvider, type TtsSetParams, type TtsSetResponse, type Usage, type VerifyOptions, type WebCallsToggleResponse, type WebhookConfigResponse, type Weekday, Nixflex as default, errorFromResponse, verifyWebhookSignature };
|
|
967
|
+
export { type Agent, type AgentCreateParams, type AgentDeleteResponse, type AgentUpdateParams, type BatchCampaignParams, type BatchCreateResponse, type BatchInvalidEntry, type BatchLaunchResponse, type BatchRecipient, type Call, type CallDeleteAllResponse, type CallDeleteResponse, type CallDirection, type CallerContext, type CallerContextDeleteResponse, type CallerContextFields, type CallerContextResponse, type CallerContextSetParams, type CallerImportResponse, type CallerImportRow, type CallerSentiment, type KeyCreateResponse, type KeyRotateResponse, type ListParams, type LlmConfig, type LlmDeleteResponse, type LlmSetParams, type LlmSetResponse, type MonitorToggleResponse, Nixflex, type NixflexAPIErrorBody, NixflexAuthenticationError, type NixflexClientOptions, NixflexConnectionError, NixflexError, NixflexInvalidRequestError, NixflexNotFoundError, NixflexPaymentRequiredError, NixflexRateLimitError, NixflexServerError, type OutboundCallParams, type OutboundCallResponse, type PhoneNumber, type PhoneNumberDeleteResponse, type PhoneNumberImportParams, type PhoneNumberListResponse, type PhoneNumberUpdateParams, type RequestOptions, type ResponseLength, type SmsCampaign, type SmsCampaignCreateParams, type SmsCampaignDeleteResponse, type SmsCampaignLaunchResponse, type SmsCampaignListResponse, type SmsCampaignRecipient, type SmsCampaignStatus, type SmsSendParams, type SmsSendResponse, type StorageConfig, type StorageDeleteResponse, type StorageSetParams, type StorageSetResponse, type TransferType, type TtsConfig, type TtsDeleteResponse, type TtsProvider, type TtsSetParams, type TtsSetResponse, type Usage, type VerifyOptions, type WebCallsToggleResponse, type WebhookConfigResponse, type Weekday, Nixflex as default, errorFromResponse, verifyWebhookSignature };
|
package/dist/index.js
CHANGED
|
@@ -81,7 +81,7 @@ function errorFromResponse(status, body, requestId, retryAfterSeconds) {
|
|
|
81
81
|
// src/client.ts
|
|
82
82
|
var DEFAULT_BASE_URL = "https://api.nixflex.com";
|
|
83
83
|
var DEFAULT_TIMEOUT_MS = 3e4;
|
|
84
|
-
var SDK_VERSION = "0.
|
|
84
|
+
var SDK_VERSION = "0.6.0";
|
|
85
85
|
var HttpClient = class {
|
|
86
86
|
apiKey;
|
|
87
87
|
baseUrl;
|
|
@@ -523,6 +523,36 @@ var Webhooks = class {
|
|
|
523
523
|
}
|
|
524
524
|
};
|
|
525
525
|
|
|
526
|
+
// src/resources/callers.ts
|
|
527
|
+
function enc2(phoneNumber) {
|
|
528
|
+
return encodeURIComponent(phoneNumber);
|
|
529
|
+
}
|
|
530
|
+
var Callers = class {
|
|
531
|
+
constructor(http) {
|
|
532
|
+
this.http = http;
|
|
533
|
+
}
|
|
534
|
+
http;
|
|
535
|
+
/** What the agent knows about this caller on this number - your fields plus
|
|
536
|
+
* what the engine learned. 404 caller_not_found when there is no record. */
|
|
537
|
+
get(phoneNumber, callerNumber, opts) {
|
|
538
|
+
return this.http.request("GET", `/phone-numbers/${enc2(phoneNumber)}/callers/${enc2(callerNumber)}`, void 0, void 0, opts);
|
|
539
|
+
}
|
|
540
|
+
/** Set the caller's details. A field left out keeps its value; null removes it.
|
|
541
|
+
* last_call / open_item are engine-only and are rejected (engine_only_field). */
|
|
542
|
+
set(phoneNumber, callerNumber, params, opts) {
|
|
543
|
+
return this.http.request("PUT", `/phone-numbers/${enc2(phoneNumber)}/callers/${enc2(callerNumber)}`, params, void 0, opts);
|
|
544
|
+
}
|
|
545
|
+
/** Erase the whole record for this caller on this number - yours and the engine's. */
|
|
546
|
+
delete(phoneNumber, callerNumber, opts) {
|
|
547
|
+
return this.http.request("DELETE", `/phone-numbers/${enc2(phoneNumber)}/callers/${enc2(callerNumber)}`, void 0, void 0, opts);
|
|
548
|
+
}
|
|
549
|
+
/** Up to 1,000 rows in one request. Every row is validated before any is
|
|
550
|
+
* written. Split larger lists into several calls. */
|
|
551
|
+
import(phoneNumber, callers, opts) {
|
|
552
|
+
return this.http.request("POST", `/phone-numbers/${enc2(phoneNumber)}/callers/import`, { callers }, void 0, opts);
|
|
553
|
+
}
|
|
554
|
+
};
|
|
555
|
+
|
|
526
556
|
// src/index.ts
|
|
527
557
|
var Nixflex = class {
|
|
528
558
|
/** AI agents - create, list, get, update, delete. */
|
|
@@ -547,6 +577,8 @@ var Nixflex = class {
|
|
|
547
577
|
llm;
|
|
548
578
|
/** Your own TTS (elevenlabs/cartesia, verified with a real synthesis). */
|
|
549
579
|
tts;
|
|
580
|
+
/** Caller context - what the agent knows about each caller on one of your numbers. */
|
|
581
|
+
callers;
|
|
550
582
|
constructor(options) {
|
|
551
583
|
const http = new HttpClient(options);
|
|
552
584
|
this.agents = new Agents(http);
|
|
@@ -560,6 +592,7 @@ var Nixflex = class {
|
|
|
560
592
|
this.storage = new Storage(http);
|
|
561
593
|
this.llm = new Llm(http);
|
|
562
594
|
this.tts = new Tts(http);
|
|
595
|
+
this.callers = new Callers(http);
|
|
563
596
|
}
|
|
564
597
|
/** Create a brand-new API key (unauthenticated signup endpoint - most
|
|
565
598
|
* developers use the dashboard instead). The key_secret is shown ONCE.
|