@awarevue/api-types 1.0.96 → 1.0.98

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.
@@ -104,141 +104,75 @@ export interface IntercomHangUpCommand {
104
104
  };
105
105
  }
106
106
  export type IntercomTerminalCommand = IntercomConnectCommand | IntercomDisconnectCommand | IntercomDialCommand | IntercomCancelCallCommand | IntercomAnswerCallCommand | IntercomHangUpCommand;
107
- export interface IntercomTerminalStateDto {
107
+ export declare const sCallState: z.ZodEnum<["connecting", "connected", "ringing", "terminated"]>;
108
+ export declare const sIntercomTerminalState: z.ZodObject<{
109
+ callState: z.ZodNullable<z.ZodEnum<["connecting", "connected", "ringing", "terminated"]>>;
110
+ connected: z.ZodBoolean;
111
+ callId: z.ZodNullable<z.ZodString>;
112
+ peer: z.ZodNullable<z.ZodString>;
113
+ }, "strip", z.ZodTypeAny, {
108
114
  connected: boolean;
109
- clientId: number | null;
110
115
  callId: string | null;
111
- userAgentId: string | null;
112
- offerSdp: string | null;
113
- answerSdp: string | null;
114
- callState: 'idle' | 'ringing' | 'active';
115
- }
116
- export declare const sIntercomCallEvent: z.ZodObject<{
117
- kind: z.ZodLiteral<"intercom-call">;
118
- userId: z.ZodOptional<z.ZodString>;
119
- personId: z.ZodOptional<z.ZodString>;
120
- callId: z.ZodString;
121
- offerSdp: z.ZodString;
122
- }, "strip", z.ZodTypeAny, {
123
- kind: "intercom-call";
124
- callId: string;
125
- offerSdp: string;
126
- personId?: string | undefined;
127
- userId?: string | undefined;
128
- }, {
129
- kind: "intercom-call";
130
- callId: string;
131
- offerSdp: string;
132
- personId?: string | undefined;
133
- userId?: string | undefined;
134
- }>;
135
- export declare const sIntercomCallCancelledEvent: z.ZodObject<{
136
- kind: z.ZodLiteral<"intercom-call-cancelled">;
137
- userId: z.ZodOptional<z.ZodString>;
138
- callId: z.ZodString;
139
- }, "strip", z.ZodTypeAny, {
140
- kind: "intercom-call-cancelled";
141
- callId: string;
142
- userId?: string | undefined;
116
+ peer: string | null;
117
+ callState: "connected" | "connecting" | "ringing" | "terminated" | null;
143
118
  }, {
144
- kind: "intercom-call-cancelled";
145
- callId: string;
146
- userId?: string | undefined;
119
+ connected: boolean;
120
+ callId: string | null;
121
+ peer: string | null;
122
+ callState: "connected" | "connecting" | "ringing" | "terminated" | null;
147
123
  }>;
148
- export declare const sIntercomCallAnsweredEvent: z.ZodObject<{
149
- kind: z.ZodLiteral<"intercom-call-answered">;
124
+ export type IntercomTerminalStateDto = z.infer<typeof sIntercomTerminalState>;
125
+ export declare const sCallStateChanged: z.ZodObject<{
126
+ kind: z.ZodLiteral<"call-state-changed">;
150
127
  userId: z.ZodOptional<z.ZodString>;
151
- userAgentId: z.ZodString;
152
128
  callId: z.ZodString;
153
- answerSdp: z.ZodString;
129
+ state: z.ZodEnum<["connecting", "connected", "ringing", "terminated"]>;
130
+ peer: z.ZodOptional<z.ZodString>;
131
+ sipAccount: z.ZodOptional<z.ZodString>;
132
+ sipCallId: z.ZodOptional<z.ZodString>;
154
133
  }, "strip", z.ZodTypeAny, {
155
- kind: "intercom-call-answered";
134
+ state: "connected" | "connecting" | "ringing" | "terminated";
135
+ kind: "call-state-changed";
156
136
  callId: string;
157
- userAgentId: string;
158
- answerSdp: string;
159
137
  userId?: string | undefined;
138
+ peer?: string | undefined;
139
+ sipAccount?: string | undefined;
140
+ sipCallId?: string | undefined;
160
141
  }, {
161
- kind: "intercom-call-answered";
142
+ state: "connected" | "connecting" | "ringing" | "terminated";
143
+ kind: "call-state-changed";
162
144
  callId: string;
163
- userAgentId: string;
164
- answerSdp: string;
165
145
  userId?: string | undefined;
166
- }>;
167
- export declare const sIntercomCallEndedEvent: z.ZodObject<{
168
- kind: z.ZodLiteral<"intercom-call-ended">;
169
- callId: z.ZodString;
170
- }, "strip", z.ZodTypeAny, {
171
- kind: "intercom-call-ended";
172
- callId: string;
173
- }, {
174
- kind: "intercom-call-ended";
175
- callId: string;
146
+ peer?: string | undefined;
147
+ sipAccount?: string | undefined;
148
+ sipCallId?: string | undefined;
176
149
  }>;
177
150
  export declare const intercomTerminalEventSchemaByKind: {
178
- 'intercom-call': z.ZodObject<{
179
- kind: z.ZodLiteral<"intercom-call">;
180
- userId: z.ZodOptional<z.ZodString>;
181
- personId: z.ZodOptional<z.ZodString>;
182
- callId: z.ZodString;
183
- offerSdp: z.ZodString;
184
- }, "strip", z.ZodTypeAny, {
185
- kind: "intercom-call";
186
- callId: string;
187
- offerSdp: string;
188
- personId?: string | undefined;
189
- userId?: string | undefined;
190
- }, {
191
- kind: "intercom-call";
192
- callId: string;
193
- offerSdp: string;
194
- personId?: string | undefined;
195
- userId?: string | undefined;
196
- }>;
197
- 'intercom-call-cancelled': z.ZodObject<{
198
- kind: z.ZodLiteral<"intercom-call-cancelled">;
199
- userId: z.ZodOptional<z.ZodString>;
200
- callId: z.ZodString;
201
- }, "strip", z.ZodTypeAny, {
202
- kind: "intercom-call-cancelled";
203
- callId: string;
204
- userId?: string | undefined;
205
- }, {
206
- kind: "intercom-call-cancelled";
207
- callId: string;
208
- userId?: string | undefined;
209
- }>;
210
- 'intercom-call-answered': z.ZodObject<{
211
- kind: z.ZodLiteral<"intercom-call-answered">;
151
+ 'call-state-changed': z.ZodObject<{
152
+ kind: z.ZodLiteral<"call-state-changed">;
212
153
  userId: z.ZodOptional<z.ZodString>;
213
- userAgentId: z.ZodString;
214
154
  callId: z.ZodString;
215
- answerSdp: z.ZodString;
155
+ state: z.ZodEnum<["connecting", "connected", "ringing", "terminated"]>;
156
+ peer: z.ZodOptional<z.ZodString>;
157
+ sipAccount: z.ZodOptional<z.ZodString>;
158
+ sipCallId: z.ZodOptional<z.ZodString>;
216
159
  }, "strip", z.ZodTypeAny, {
217
- kind: "intercom-call-answered";
160
+ state: "connected" | "connecting" | "ringing" | "terminated";
161
+ kind: "call-state-changed";
218
162
  callId: string;
219
- userAgentId: string;
220
- answerSdp: string;
221
163
  userId?: string | undefined;
164
+ peer?: string | undefined;
165
+ sipAccount?: string | undefined;
166
+ sipCallId?: string | undefined;
222
167
  }, {
223
- kind: "intercom-call-answered";
168
+ state: "connected" | "connecting" | "ringing" | "terminated";
169
+ kind: "call-state-changed";
224
170
  callId: string;
225
- userAgentId: string;
226
- answerSdp: string;
227
171
  userId?: string | undefined;
228
- }>;
229
- 'intercom-call-ended': z.ZodObject<{
230
- kind: z.ZodLiteral<"intercom-call-ended">;
231
- callId: z.ZodString;
232
- }, "strip", z.ZodTypeAny, {
233
- kind: "intercom-call-ended";
234
- callId: string;
235
- }, {
236
- kind: "intercom-call-ended";
237
- callId: string;
172
+ peer?: string | undefined;
173
+ sipAccount?: string | undefined;
174
+ sipCallId?: string | undefined;
238
175
  }>;
239
176
  };
240
- export type IntercomCallEvent = z.infer<typeof sIntercomCallEvent>;
241
- export type IntercomCallCancelledEvent = z.infer<typeof sIntercomCallCancelledEvent>;
242
- export type IntercomCallAnsweredEvent = z.infer<typeof sIntercomCallAnsweredEvent>;
243
- export type IntercomCallEndedEvent = z.infer<typeof sIntercomCallEndedEvent>;
244
- export type IntercomTerminalEvent = IntercomCallEvent | IntercomCallCancelledEvent | IntercomCallAnsweredEvent | IntercomCallEndedEvent;
177
+ export type CallStateChangedEvent = z.infer<typeof sCallStateChanged>;
178
+ export type IntercomTerminalEvent = CallStateChangedEvent;
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.intercomTerminalEventSchemaByKind = exports.sIntercomCallEndedEvent = exports.sIntercomCallAnsweredEvent = exports.sIntercomCallCancelledEvent = exports.sIntercomCallEvent = exports.sAddIntercomTerminal = exports.sIntercomTerminalSpecs = exports.INTERCOM_TERMINAL = void 0;
3
+ exports.intercomTerminalEventSchemaByKind = exports.sCallStateChanged = exports.sIntercomTerminalState = exports.sCallState = exports.sAddIntercomTerminal = exports.sIntercomTerminalSpecs = exports.INTERCOM_TERMINAL = void 0;
4
4
  const zod_1 = require("zod");
5
5
  exports.INTERCOM_TERMINAL = 'intercom-terminal';
6
6
  // SPECS
@@ -16,33 +16,61 @@ exports.sAddIntercomTerminal = zod_1.z.object({
16
16
  foreignRef: zod_1.z.string(),
17
17
  specs: exports.sIntercomTerminalSpecs,
18
18
  });
19
- // EVENTS
20
- exports.sIntercomCallEvent = zod_1.z.object({
21
- kind: zod_1.z.literal('intercom-call'),
22
- userId: zod_1.z.string().optional(),
23
- personId: zod_1.z.string().optional(),
24
- callId: zod_1.z.string().nonempty(),
25
- offerSdp: zod_1.z.string().nonempty(),
19
+ // STATE
20
+ exports.sCallState = zod_1.z.enum([
21
+ 'connecting',
22
+ 'connected',
23
+ 'ringing',
24
+ 'terminated',
25
+ ]);
26
+ exports.sIntercomTerminalState = zod_1.z.object({
27
+ callState: exports.sCallState.nullable(),
28
+ connected: zod_1.z.boolean(),
29
+ callId: zod_1.z.string().nullable(),
30
+ peer: zod_1.z.string().nullable(),
26
31
  });
27
- exports.sIntercomCallCancelledEvent = zod_1.z.object({
28
- kind: zod_1.z.literal('intercom-call-cancelled'),
29
- userId: zod_1.z.string().optional(),
30
- callId: zod_1.z.string().nonempty(),
31
- });
32
- exports.sIntercomCallAnsweredEvent = zod_1.z.object({
33
- kind: zod_1.z.literal('intercom-call-answered'),
32
+ // export interface IntercomTerminalStateDto {
33
+ // connected: boolean;
34
+ // clientId: number | null;
35
+ // callId: string | null;
36
+ // userAgentId: string | null;
37
+ // offerSdp: string | null;
38
+ // answerSdp: string | null;
39
+ // callState: 'idle' | 'ringing' | 'active';
40
+ // }
41
+ // EVENTS
42
+ exports.sCallStateChanged = zod_1.z.object({
43
+ kind: zod_1.z.literal('call-state-changed'),
34
44
  userId: zod_1.z.string().optional(),
35
- userAgentId: zod_1.z.string().nonempty(),
36
- callId: zod_1.z.string().nonempty(),
37
- answerSdp: zod_1.z.string().nonempty(),
38
- });
39
- exports.sIntercomCallEndedEvent = zod_1.z.object({
40
- kind: zod_1.z.literal('intercom-call-ended'),
41
45
  callId: zod_1.z.string().nonempty(),
46
+ state: exports.sCallState,
47
+ peer: zod_1.z.string().optional(),
48
+ sipAccount: zod_1.z.string().optional(),
49
+ sipCallId: zod_1.z.string().optional(),
42
50
  });
51
+ // export const sIntercomCallEvent = z.object({
52
+ // kind: z.literal('intercom-call'),
53
+ // userId: z.string().optional(),
54
+ // personId: z.string().optional(),
55
+ // callId: z.string().nonempty(),
56
+ // offerSdp: z.string().nonempty(),
57
+ // });
58
+ // export const sIntercomCallCancelledEvent = z.object({
59
+ // kind: z.literal('intercom-call-cancelled'),
60
+ // userId: z.string().optional(),
61
+ // callId: z.string().nonempty(),
62
+ // });
63
+ // export const sIntercomCallAnsweredEvent = z.object({
64
+ // kind: z.literal('intercom-call-answered'),
65
+ // userId: z.string().optional(),
66
+ // userAgentId: z.string().nonempty(),
67
+ // callId: z.string().nonempty(),
68
+ // answerSdp: z.string().nonempty(),
69
+ // });
70
+ // export const sIntercomCallEndedEvent = z.object({
71
+ // kind: z.literal('intercom-call-ended'),
72
+ // callId: z.string().nonempty(),
73
+ // });
43
74
  exports.intercomTerminalEventSchemaByKind = {
44
- 'intercom-call': exports.sIntercomCallEvent,
45
- 'intercom-call-cancelled': exports.sIntercomCallCancelledEvent,
46
- 'intercom-call-answered': exports.sIntercomCallAnsweredEvent,
47
- 'intercom-call-ended': exports.sIntercomCallEndedEvent,
75
+ 'call-state-changed': exports.sCallStateChanged,
48
76
  };
@@ -131,66 +131,30 @@ export declare const eventSchemaByKind: {
131
131
  kind: "io-board-input-changed";
132
132
  inputName: string;
133
133
  }>;
134
- 'intercom-call': z.ZodObject<{
135
- kind: z.ZodLiteral<"intercom-call">;
136
- userId: z.ZodOptional<z.ZodString>;
137
- personId: z.ZodOptional<z.ZodString>;
138
- callId: z.ZodString;
139
- offerSdp: z.ZodString;
140
- }, "strip", z.ZodTypeAny, {
141
- kind: "intercom-call";
142
- callId: string;
143
- offerSdp: string;
144
- personId?: string | undefined;
145
- userId?: string | undefined;
146
- }, {
147
- kind: "intercom-call";
148
- callId: string;
149
- offerSdp: string;
150
- personId?: string | undefined;
151
- userId?: string | undefined;
152
- }>;
153
- 'intercom-call-cancelled': z.ZodObject<{
154
- kind: z.ZodLiteral<"intercom-call-cancelled">;
134
+ 'call-state-changed': z.ZodObject<{
135
+ kind: z.ZodLiteral<"call-state-changed">;
155
136
  userId: z.ZodOptional<z.ZodString>;
156
137
  callId: z.ZodString;
138
+ state: z.ZodEnum<["connecting", "connected", "ringing", "terminated"]>;
139
+ peer: z.ZodOptional<z.ZodString>;
140
+ sipAccount: z.ZodOptional<z.ZodString>;
141
+ sipCallId: z.ZodOptional<z.ZodString>;
157
142
  }, "strip", z.ZodTypeAny, {
158
- kind: "intercom-call-cancelled";
143
+ state: "connected" | "connecting" | "ringing" | "terminated";
144
+ kind: "call-state-changed";
159
145
  callId: string;
160
146
  userId?: string | undefined;
147
+ peer?: string | undefined;
148
+ sipAccount?: string | undefined;
149
+ sipCallId?: string | undefined;
161
150
  }, {
162
- kind: "intercom-call-cancelled";
151
+ state: "connected" | "connecting" | "ringing" | "terminated";
152
+ kind: "call-state-changed";
163
153
  callId: string;
164
154
  userId?: string | undefined;
165
- }>;
166
- 'intercom-call-answered': z.ZodObject<{
167
- kind: z.ZodLiteral<"intercom-call-answered">;
168
- userId: z.ZodOptional<z.ZodString>;
169
- userAgentId: z.ZodString;
170
- callId: z.ZodString;
171
- answerSdp: z.ZodString;
172
- }, "strip", z.ZodTypeAny, {
173
- kind: "intercom-call-answered";
174
- callId: string;
175
- userAgentId: string;
176
- answerSdp: string;
177
- userId?: string | undefined;
178
- }, {
179
- kind: "intercom-call-answered";
180
- callId: string;
181
- userAgentId: string;
182
- answerSdp: string;
183
- userId?: string | undefined;
184
- }>;
185
- 'intercom-call-ended': z.ZodObject<{
186
- kind: z.ZodLiteral<"intercom-call-ended">;
187
- callId: z.ZodString;
188
- }, "strip", z.ZodTypeAny, {
189
- kind: "intercom-call-ended";
190
- callId: string;
191
- }, {
192
- kind: "intercom-call-ended";
193
- callId: string;
155
+ peer?: string | undefined;
156
+ sipAccount?: string | undefined;
157
+ sipCallId?: string | undefined;
194
158
  }>;
195
159
  'door-access': z.ZodObject<{
196
160
  kind: z.ZodLiteral<"door-access">;
@@ -41,10 +41,7 @@ exports.eventKindLabels = {
41
41
  'panic-button-pressed': 'Panic Button Pressed',
42
42
  'device-connected': 'Device Connected',
43
43
  'device-disconnected': 'Device Disconnected',
44
- 'intercom-call': 'Intercom Call',
45
- 'intercom-call-answered': 'Intercom Call Answered',
46
- 'intercom-call-ended': 'Intercom Call Ended',
47
- 'intercom-call-cancelled': 'Intercom Call Cancelled',
44
+ 'call-state-changed': 'Call State Changed',
48
45
  'object-created': 'Object Created',
49
46
  'object-updated': 'Object Updated',
50
47
  'object-deleted': 'Object Deleted',
package/dist/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@awarevue/api-types",
3
- "version": "1.0.96",
3
+ "version": "1.0.98",
4
4
  "description": "Common types between backend, agent(s) and frontend(s)",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@awarevue/api-types",
3
- "version": "1.0.96",
3
+ "version": "1.0.98",
4
4
  "description": "Common types between backend, agent(s) and frontend(s)",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",