@sippet-ai/sdk-js 0.0.1 → 0.0.3
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/README.md +1 -1
- package/dist/ash_rpc.d.ts +28 -41
- package/dist/ash_rpc.js +1 -2
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/public.d.ts +1 -1
- package/dist/realtime.d.ts +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -110,7 +110,7 @@ const result = await client.listCalls({
|
|
|
110
110
|
|
|
111
111
|
## Realtime events
|
|
112
112
|
|
|
113
|
-
Realtime helpers are built on
|
|
113
|
+
Realtime helpers are built on WebSocket channels. The SDK exposes a helper
|
|
114
114
|
for the `events` channel used by Sippet AI.
|
|
115
115
|
|
|
116
116
|
```ts
|
package/dist/ash_rpc.d.ts
CHANGED
|
@@ -145,7 +145,7 @@ export type SipUserAttributesOnlySchema = {
|
|
|
145
145
|
};
|
|
146
146
|
export type CallResourceSchema = {
|
|
147
147
|
__type: "Resource";
|
|
148
|
-
__primitiveFields: "id" | "direction" | "fromNumber" | "toNumber" | "sipUsername" | "status" | "callUuid" | "startedAt" | "endedAt" | "durationSeconds";
|
|
148
|
+
__primitiveFields: "id" | "direction" | "fromNumber" | "toNumber" | "sipUsername" | "status" | "callUuid" | "callSource" | "startedAt" | "endedAt" | "durationSeconds" | "conversationId";
|
|
149
149
|
id: UUID;
|
|
150
150
|
direction: "inbound" | "outbound";
|
|
151
151
|
fromNumber: string;
|
|
@@ -153,13 +153,15 @@ export type CallResourceSchema = {
|
|
|
153
153
|
sipUsername: string | null;
|
|
154
154
|
status: "initiated" | "ringing" | "answered" | "completed" | "failed" | "busy" | "no_answer" | null;
|
|
155
155
|
callUuid: string;
|
|
156
|
+
callSource: string;
|
|
156
157
|
startedAt: UtcDateTimeUsec | null;
|
|
157
158
|
endedAt: UtcDateTimeUsec | null;
|
|
158
159
|
durationSeconds: number | null;
|
|
160
|
+
conversationId: UUID | null;
|
|
159
161
|
};
|
|
160
162
|
export type CallAttributesOnlySchema = {
|
|
161
163
|
__type: "Resource";
|
|
162
|
-
__primitiveFields: "id" | "direction" | "fromNumber" | "toNumber" | "sipUsername" | "status" | "callUuid" | "startedAt" | "endedAt" | "durationSeconds";
|
|
164
|
+
__primitiveFields: "id" | "direction" | "fromNumber" | "toNumber" | "sipUsername" | "status" | "callUuid" | "callSource" | "startedAt" | "endedAt" | "durationSeconds" | "conversationId";
|
|
163
165
|
id: UUID;
|
|
164
166
|
direction: "inbound" | "outbound";
|
|
165
167
|
fromNumber: string;
|
|
@@ -167,9 +169,11 @@ export type CallAttributesOnlySchema = {
|
|
|
167
169
|
sipUsername: string | null;
|
|
168
170
|
status: "initiated" | "ringing" | "answered" | "completed" | "failed" | "busy" | "no_answer" | null;
|
|
169
171
|
callUuid: string;
|
|
172
|
+
callSource: string;
|
|
170
173
|
startedAt: UtcDateTimeUsec | null;
|
|
171
174
|
endedAt: UtcDateTimeUsec | null;
|
|
172
175
|
durationSeconds: number | null;
|
|
176
|
+
conversationId: UUID | null;
|
|
173
177
|
};
|
|
174
178
|
export type CallParticipantResourceSchema = {
|
|
175
179
|
__type: "Resource";
|
|
@@ -597,6 +601,11 @@ export type CallFilterInput = {
|
|
|
597
601
|
notEq?: string;
|
|
598
602
|
in?: Array<string>;
|
|
599
603
|
};
|
|
604
|
+
callSource?: {
|
|
605
|
+
eq?: string;
|
|
606
|
+
notEq?: string;
|
|
607
|
+
in?: Array<string>;
|
|
608
|
+
};
|
|
600
609
|
startedAt?: {
|
|
601
610
|
eq?: UtcDateTimeUsec;
|
|
602
611
|
notEq?: UtcDateTimeUsec;
|
|
@@ -624,6 +633,11 @@ export type CallFilterInput = {
|
|
|
624
633
|
lessThanOrEqual?: number;
|
|
625
634
|
in?: Array<number>;
|
|
626
635
|
};
|
|
636
|
+
conversationId?: {
|
|
637
|
+
eq?: UUID;
|
|
638
|
+
notEq?: UUID;
|
|
639
|
+
in?: Array<UUID>;
|
|
640
|
+
};
|
|
627
641
|
};
|
|
628
642
|
export type CallParticipantFilterInput = {
|
|
629
643
|
and?: Array<CallParticipantFilterInput>;
|
|
@@ -1540,51 +1554,22 @@ export declare function validateIssueOperatorSipAccess(config: {
|
|
|
1540
1554
|
customFetch?: (input: RequestInfo | URL, init?: RequestInit) => Promise<Response>;
|
|
1541
1555
|
}): Promise<ValidationResult>;
|
|
1542
1556
|
export type ListCallsFields = UnifiedFieldSelection<CallResourceSchema>[];
|
|
1543
|
-
export type InferListCallsResult<Fields extends ListCallsFields
|
|
1544
|
-
|
|
1545
|
-
hasMore: boolean;
|
|
1546
|
-
limit: number;
|
|
1547
|
-
offset: number;
|
|
1548
|
-
count?: number | null;
|
|
1549
|
-
type: "offset";
|
|
1550
|
-
}, {
|
|
1551
|
-
results: Array<InferResult<CallResourceSchema, Fields>>;
|
|
1552
|
-
hasMore: boolean;
|
|
1553
|
-
limit: number;
|
|
1554
|
-
after: string | null;
|
|
1555
|
-
before: string | null;
|
|
1556
|
-
previousPage: string;
|
|
1557
|
-
nextPage: string;
|
|
1558
|
-
count?: number | null;
|
|
1559
|
-
type: "keyset";
|
|
1560
|
-
}>;
|
|
1561
|
-
export type ListCallsConfig = {
|
|
1562
|
-
fields: ListCallsFields;
|
|
1563
|
-
filter?: CallFilterInput;
|
|
1564
|
-
sort?: string;
|
|
1565
|
-
page?: ({
|
|
1566
|
-
limit?: number;
|
|
1567
|
-
offset?: number;
|
|
1568
|
-
count?: boolean;
|
|
1569
|
-
} | {
|
|
1570
|
-
limit?: number;
|
|
1571
|
-
after?: string;
|
|
1572
|
-
before?: string;
|
|
1573
|
-
});
|
|
1574
|
-
headers?: Record<string, string>;
|
|
1575
|
-
fetchOptions?: RequestInit;
|
|
1576
|
-
customFetch?: (input: RequestInfo | URL, init?: RequestInit) => Promise<Response>;
|
|
1577
|
-
};
|
|
1578
|
-
export type ListCallsResult<Fields extends ListCallsFields, Page extends ListCallsConfig["page"] = undefined> = {
|
|
1557
|
+
export type InferListCallsResult<Fields extends ListCallsFields> = Array<InferResult<CallResourceSchema, Fields>>;
|
|
1558
|
+
export type ListCallsResult<Fields extends ListCallsFields> = {
|
|
1579
1559
|
success: true;
|
|
1580
|
-
data: InferListCallsResult<Fields
|
|
1560
|
+
data: InferListCallsResult<Fields>;
|
|
1581
1561
|
} | {
|
|
1582
1562
|
success: false;
|
|
1583
1563
|
errors: AshRpcError[];
|
|
1584
1564
|
};
|
|
1585
|
-
export declare function listCalls<Fields extends ListCallsFields
|
|
1565
|
+
export declare function listCalls<Fields extends ListCallsFields>(config: {
|
|
1586
1566
|
fields: Fields;
|
|
1587
|
-
|
|
1567
|
+
filter?: CallFilterInput;
|
|
1568
|
+
sort?: string;
|
|
1569
|
+
headers?: Record<string, string>;
|
|
1570
|
+
fetchOptions?: RequestInit;
|
|
1571
|
+
customFetch?: (input: RequestInfo | URL, init?: RequestInit) => Promise<Response>;
|
|
1572
|
+
}): Promise<ListCallsResult<Fields>>;
|
|
1588
1573
|
export declare function validateListCalls(config: {
|
|
1589
1574
|
headers?: Record<string, string>;
|
|
1590
1575
|
fetchOptions?: RequestInit;
|
|
@@ -1596,7 +1581,9 @@ export type CreateCallInput = {
|
|
|
1596
1581
|
toNumber: string;
|
|
1597
1582
|
sipUsername?: string | null;
|
|
1598
1583
|
callUuid: string;
|
|
1584
|
+
callSource?: string;
|
|
1599
1585
|
status?: "initiated" | "ringing" | "answered" | "completed" | "failed" | "busy" | "no_answer" | null;
|
|
1586
|
+
conversationId?: UUID | null;
|
|
1600
1587
|
startedAt?: UtcDateTimeUsec | null;
|
|
1601
1588
|
};
|
|
1602
1589
|
export type CreateCallFields = UnifiedFieldSelection<CallResourceSchema>[];
|
package/dist/ash_rpc.js
CHANGED
|
@@ -238,8 +238,7 @@ export async function listCalls(config) {
|
|
|
238
238
|
action: "list_calls",
|
|
239
239
|
...(config.fields !== undefined && { fields: config.fields }),
|
|
240
240
|
...(config.filter && { filter: config.filter }),
|
|
241
|
-
...(config.sort && { sort: config.sort })
|
|
242
|
-
...(config.page && { page: config.page })
|
|
241
|
+
...(config.sort && { sort: config.sort })
|
|
243
242
|
};
|
|
244
243
|
return executeActionRpcRequest(payload, config);
|
|
245
244
|
}
|
package/dist/index.d.ts
CHANGED
package/dist/index.js
CHANGED
package/dist/public.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
export { acceptCallQueueEntry, acceptTeamInvitation, bargeCall, buildCSRFHeaders, callCodec, createCall, createContact, deleteContact, endCall, getCallQueueEntry, getPhoenixCSRFToken, issueOperatorSipAccess, issueSipAccess, listAiAgents, listCallParticipants, listCallQueueEntries, listCallTranscripts, listCalls, listContacts, listGateways, listOperatorStatusEvents, listOperatorStatuses, listPhoneNumbers, listQueues, logout, resumeAiCall, revokeSipAccess, setOperatorStatus, signInWithPassword, startOutboundCall, updateContact, validateAcceptCallQueueEntry, validateAcceptTeamInvitation, validateBargeCall, validateCallCodec, validateCreateCall, validateCreateContact, validateDeleteContact, validateEndCall, validateGetCallQueueEntry, validateIssueOperatorSipAccess, validateIssueSipAccess, validateListAiAgents, validateListCallParticipants, validateListCallQueueEntries, validateListCallTranscripts, validateListCalls, validateListContacts, validateListGateways, validateListOperatorStatusEvents, validateListOperatorStatuses, validateListPhoneNumbers, validateListQueues, validateLogout, validateResumeAiCall, validateRevokeSipAccess, validateSetOperatorStatus, validateSignInWithPassword, validateStartOutboundCall, validateUpdateContact, validateWhoAmI, whoAmI } from "./ash_rpc";
|
|
2
|
-
export type { AcceptCallQueueEntryFields, AcceptCallQueueEntryInput, AcceptCallQueueEntryResult, AcceptTeamInvitationInput, AcceptTeamInvitationResult, ActionConfig, BargeCallInput, BargeCallResult, CallCodecInput, CallCodecResult, CreateCallFields, CreateCallInput, CreateCallResult, CreateContactFields, CreateContactInput, CreateContactResult, DeleteContactResult, EndCallInput, EndCallResult, GetCallQueueEntryFields, GetCallQueueEntryInput, GetCallQueueEntryResult, InferAcceptCallQueueEntryResult, InferAcceptTeamInvitationResult, InferBargeCallResult, InferCallCodecResult, InferCreateCallResult, InferCreateContactResult, InferEndCallResult, InferGetCallQueueEntryResult, InferIssueOperatorSipAccessResult, InferIssueSipAccessResult, InferListAiAgentsResult, InferListCallParticipantsResult, InferListCallQueueEntriesResult, InferListCallTranscriptsResult, InferListCallsResult, InferListContactsResult, InferListGatewaysResult, InferListOperatorStatusEventsResult, InferListOperatorStatusesResult, InferListPhoneNumbersResult, InferListQueuesResult, InferLogoutResult, InferResumeAiCallResult, InferRevokeSipAccessResult, InferSetOperatorStatusResult, InferSignInWithPasswordResult, InferStartOutboundCallResult, InferUpdateContactResult, InferWhoAmIResult, IssueOperatorSipAccessResult, IssueSipAccessInput, IssueSipAccessResult, ListAiAgentsFields, ListAiAgentsResult, ListCallParticipantsFields, ListCallParticipantsResult, ListCallQueueEntriesFields, ListCallQueueEntriesResult, ListCallTranscriptsFields, ListCallTranscriptsResult, ListCallsFields, ListCallsResult, ListContactsFields, ListContactsResult, ListGatewaysFields, ListGatewaysResult, ListOperatorStatusEventsFields, ListOperatorStatusEventsResult, ListOperatorStatusesFields, ListOperatorStatusesResult, ListPhoneNumbersFields, ListPhoneNumbersResult, ListQueuesFields, ListQueuesResult, LogoutResult, ResumeAiCallInput, ResumeAiCallResult, RevokeSipAccessInput, RevokeSipAccessResult, SetOperatorStatusFields, SetOperatorStatusInput, SetOperatorStatusResult, SignInWithPasswordFields, SignInWithPasswordInput, SignInWithPasswordMetadata, SignInWithPasswordResult, StartOutboundCallInput, StartOutboundCallResult, UpdateContactFields, UpdateContactInput, UpdateContactResult, ValidationConfig, ValidationResult, WhoAmIFields, WhoAmIResult } from "./ash_rpc";
|
|
2
|
+
export type { AcceptCallQueueEntryFields, AcceptCallQueueEntryInput, AcceptCallQueueEntryResult, AcceptTeamInvitationInput, AcceptTeamInvitationResult, ActionConfig, BargeCallInput, BargeCallResult, CallCodecInput, CallCodecResult, CreateCallFields, CreateCallInput, CreateCallResult, CreateContactFields, CreateContactInput, CreateContactResult, DeleteContactResult, EndCallInput, EndCallResult, GetCallQueueEntryFields, GetCallQueueEntryInput, GetCallQueueEntryResult, InferAcceptCallQueueEntryResult, InferAcceptTeamInvitationResult, InferBargeCallResult, InferCallCodecResult, InferCreateCallResult, InferCreateContactResult, InferEndCallResult, InferGetCallQueueEntryResult, InferIssueOperatorSipAccessResult, InferIssueSipAccessResult, InferListAiAgentsResult, InferListCallParticipantsResult, InferListCallQueueEntriesResult, InferListCallTranscriptsResult, InferListCallsResult, InferListContactsResult, InferListGatewaysResult, InferListOperatorStatusEventsResult, InferListOperatorStatusesResult, InferListPhoneNumbersResult, InferListQueuesResult, InferLogoutResult, InferResumeAiCallResult, InferRevokeSipAccessResult, InferSetOperatorStatusResult, InferSignInWithPasswordResult, InferStartOutboundCallResult, InferUpdateContactResult, InferWhoAmIResult, IssueOperatorSipAccessResult, IssueSipAccessInput, IssueSipAccessResult, ListAiAgentsFields, ListAiAgentsResult, ListCallParticipantsFields, ListCallParticipantsResult, ListCallQueueEntriesFields, ListCallQueueEntriesResult, ListCallTranscriptsFields, ListCallTranscriptsResult, ListCallsFields, ListCallsResult, ListContactsFields, ListContactsResult, ListGatewaysFields, ListGatewaysResult, ListOperatorStatusEventsFields, ListOperatorStatusEventsResult, ListOperatorStatusesFields, ListOperatorStatusesResult, ListPhoneNumbersFields, ListPhoneNumbersResult, ListQueuesFields, ListQueuesResult, LogoutResult, ResumeAiCallInput, ResumeAiCallResult, RevokeSipAccessInput, RevokeSipAccessResult, SetOperatorStatusFields, SetOperatorStatusInput, SetOperatorStatusResult, SignInWithPasswordFields, SignInWithPasswordInput, SignInWithPasswordMetadata, SignInWithPasswordResult, StartOutboundCallInput, StartOutboundCallResult, SuccessDataFunc, UpdateContactFields, UpdateContactInput, UpdateContactResult, ValidationConfig, ValidationResult, WhoAmIFields, WhoAmIResult } from "./ash_rpc";
|
|
3
3
|
export * from "./realtime";
|
package/dist/realtime.d.ts
CHANGED
|
@@ -7,7 +7,7 @@ export type InitSocketOptions = {
|
|
|
7
7
|
socketOptions?: SocketOptions;
|
|
8
8
|
};
|
|
9
9
|
export type EventsChannel = Channel;
|
|
10
|
-
export type EventsChannelEvent = 'incoming_call' | 'call_answered' | 'call_ended' | 'operator_status_change' | 'call_queue_entry_updated' | 'call_queue_entry_deleted' | 'call_participant_joined' | 'call_participant_left' | 'call_transcript_delta' | 'call_transcript_completed';
|
|
10
|
+
export type EventsChannelEvent = 'incoming_call' | 'call_answered' | 'call_ended' | 'operator_status_change' | 'call_queue_entry_updated' | 'call_queue_entry_deleted' | 'call_participant_joined' | 'call_participant_left' | 'call_transcript_delta' | 'call_transcript_completed' | 'call_ai_audit_event' | 'call_ai_usage';
|
|
11
11
|
export declare let socket: Socket | null;
|
|
12
12
|
export declare function initSocket({ publishableKey, baseUrl, socketOptions, }: InitSocketOptions): Socket;
|
|
13
13
|
export declare function getSocket(): Socket;
|