Skip to content

Commit 0fc6efe

Browse files
committed
update specs
1 parent fd2cddd commit 0fc6efe

5 files changed

Lines changed: 120 additions & 68 deletions

File tree

api/docs/docs.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3661,7 +3661,6 @@ const docTemplate = `{
36613661
"id",
36623662
"max_send_attempts",
36633663
"message_expiration_seconds",
3664-
"message_send_schedule_id",
36653664
"messages_per_minute",
36663665
"phone_number",
36673666
"sim",

api/docs/swagger.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3362,7 +3362,6 @@
33623362
"id",
33633363
"max_send_attempts",
33643364
"message_expiration_seconds",
3365-
"message_send_schedule_id",
33663365
"messages_per_minute",
33673366
"phone_number",
33683367
"sim",

api/docs/swagger.yaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -362,7 +362,6 @@ definitions:
362362
- id
363363
- max_send_attempts
364364
- message_expiration_seconds
365-
- message_send_schedule_id
366365
- messages_per_minute
367366
- phone_number
368367
- sim

api/pkg/entities/phone.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ type Phone struct {
1414
PhoneNumber string `json:"phone_number" example:"+18005550199"`
1515
MessagesPerMinute uint `json:"messages_per_minute" example:"1"`
1616
SIM SIM `json:"sim" gorm:"default:SIM1"`
17-
MessageSendScheduleID *uuid.UUID `json:"message_send_schedule_id" gorm:"type:uuid" example:"32343a19-da5e-4b1b-a767-3298a73703cb"`
17+
MessageSendScheduleID *uuid.UUID `json:"message_send_schedule_id" gorm:"type:uuid" example:"32343a19-da5e-4b1b-a767-3298a73703cb" validate:"optional"`
1818

1919
// MaxSendAttempts determines how many times to retry sending an SMS message
2020
MaxSendAttempts uint `json:"max_send_attempts" example:"2"`

web/models/api.ts

Lines changed: 119 additions & 64 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
/* eslint-disable */
2+
/* tslint:disable */
13
// @ts-nocheck
24
/*
35
* ---------------------------------------------------------------
@@ -8,6 +10,25 @@
810
* ---------------------------------------------------------------
911
*/
1012

13+
export enum EntitiesSubscriptionName {
14+
SubscriptionNameFree = 'free',
15+
SubscriptionNameProMonthly = 'pro-monthly',
16+
SubscriptionNameProYearly = 'pro-yearly',
17+
SubscriptionNameUltraMonthly = 'ultra-monthly',
18+
SubscriptionNameUltraYearly = 'ultra-yearly',
19+
SubscriptionNameProLifetime = 'pro-lifetime',
20+
SubscriptionName20KMonthly = '20k-monthly',
21+
SubscriptionName100KMonthly = '100k-monthly',
22+
SubscriptionName50KMonthly = '50k-monthly',
23+
SubscriptionName200KMonthly = '200k-monthly',
24+
SubscriptionName20KYearly = '20k-yearly',
25+
}
26+
27+
export enum EntitiesSIM {
28+
SIM1 = 'SIM1',
29+
SIM2 = 'SIM2',
30+
}
31+
1132
export interface EntitiesBillingUsage {
1233
/** @example "2022-06-05T14:26:02.302718+03:00" */
1334
created_at: string
@@ -62,6 +83,8 @@ export interface EntitiesHeartbeat {
6283
}
6384

6485
export interface EntitiesMessage {
86+
/** @example ["https://example.com/image.jpg","https://example.com/video.mp4"] */
87+
attachments: string[]
6588
/** @example "+18005550100" */
6689
contact: string
6790
/** @example "This is a sample text message" */
@@ -114,7 +137,7 @@ export interface EntitiesMessage {
114137
* * DEFAULT: used the default communication SIM card
115138
* @example "DEFAULT"
116139
*/
117-
sim: string
140+
sim: EntitiesSIM
118141
/** @example "pending" */
119142
status: string
120143
/** @example "mobile-terminated" */
@@ -125,6 +148,31 @@ export interface EntitiesMessage {
125148
user_id: string
126149
}
127150

151+
export interface EntitiesMessageSendSchedule {
152+
/** @example "2022-06-05T14:26:02.302718+03:00" */
153+
created_at: string
154+
/** @example "32343a19-da5e-4b1b-a767-3298a73703cb" */
155+
id: string
156+
/** @example "Business Hours" */
157+
name: string
158+
/** @example "Europe/Tallinn" */
159+
timezone: string
160+
/** @example "2022-06-05T14:26:10.303278+03:00" */
161+
updated_at: string
162+
/** @example "WB7DRDWrJZRGbYrv2CKGkqbzvqdC" */
163+
user_id: string
164+
windows: EntitiesMessageSendScheduleWindow[]
165+
}
166+
167+
export interface EntitiesMessageSendScheduleWindow {
168+
/** @example 1 */
169+
day_of_week: number
170+
/** @example 1020 */
171+
end_minute: number
172+
/** @example 540 */
173+
start_minute: number
174+
}
175+
128176
export interface EntitiesMessageThread {
129177
/** @example "indigo" */
130178
color: string
@@ -166,16 +214,15 @@ export interface EntitiesPhone {
166214
max_send_attempts: number
167215
/** MessageExpirationSeconds is the duration in seconds after sending a message when it is considered to be expired. */
168216
message_expiration_seconds: number
217+
/** @example "32343a19-da5e-4b1b-a767-3298a73703cb" */
218+
message_send_schedule_id?: string
169219
/** @example 1 */
170220
messages_per_minute: number
171221
/** @example "This phone cannot receive calls. Please send an SMS instead." */
172222
missed_call_auto_reply?: string
173223
/** @example "+18005550199" */
174224
phone_number: string
175-
/** @example "32343a19-da5e-4b1b-a767-3298a73703cb" */
176-
schedule_id?: string | null
177-
/** SIM card that received the message */
178-
sim: string
225+
sim: EntitiesSIM
179226
/** @example "2022-06-05T14:26:10.303278+03:00" */
180227
updated_at: string
181228
/** @example "WB7DRDWrJZRGbYrv2CKGkqbzvqdC" */
@@ -227,7 +274,7 @@ export interface EntitiesUser {
227274
/** @example "8f9c71b8-b84e-4417-8408-a62274f65a08" */
228275
subscription_id: string
229276
/** @example "free" */
230-
subscription_name: string
277+
subscription_name: EntitiesSubscriptionName
231278
/** @example "2022-06-05T14:26:02.302718+03:00" */
232279
subscription_renews_at?: string
233280
/** @example "on_trial" */
@@ -257,62 +304,6 @@ export interface EntitiesWebhook {
257304
user_id: string
258305
}
259306

260-
export interface EntitiesSendScheduleWindow {
261-
/** @example 1 */
262-
day_of_week: number
263-
/** @example 1020 */
264-
end_minute: number
265-
/** @example 540 */
266-
start_minute: number
267-
}
268-
269-
export interface EntitiesSendSchedule {
270-
/** @example true */
271-
is_active: boolean
272-
/** @example "2022-06-05T14:26:02.302718+03:00" */
273-
created_at: string
274-
/** @example "32343a19-da5e-4b1b-a767-3298a73703cb" */
275-
id: string
276-
/** @example "Business Hours" */
277-
name: string
278-
/** @example "Africa/Accra" */
279-
timezone: string
280-
/** @example "2022-06-05T14:26:10.303278+03:00" */
281-
updated_at: string
282-
/** @example "WB7DRDWrJZRGbYrv2CKGkqbzvqdC" */
283-
user_id: string
284-
windows: EntitiesSendScheduleWindow[]
285-
}
286-
287-
export interface RequestsSendScheduleWindow {
288-
day_of_week: number
289-
end_minute: number
290-
start_minute: number
291-
}
292-
293-
export interface RequestsSendScheduleStore {
294-
is_active: boolean
295-
name: string
296-
timezone: string
297-
windows: RequestsSendScheduleWindow[]
298-
}
299-
300-
export interface ResponsesSendScheduleResponse {
301-
data: EntitiesSendSchedule
302-
/** @example "Request handled successfully" */
303-
message: string
304-
/** @example "success" */
305-
status: string
306-
}
307-
308-
export interface ResponsesSendSchedulesResponse {
309-
data: EntitiesSendSchedule[]
310-
/** @example "Request handled successfully" */
311-
message: string
312-
/** @example "success" */
313-
status: string
314-
}
315-
316307
export interface RequestsDiscordStore {
317308
incoming_channel_id: string
318309
name: string
@@ -330,14 +321,34 @@ export interface RequestsHeartbeatStore {
330321
phone_numbers: string[]
331322
}
332323

324+
export interface RequestsMessageAttachment {
325+
/**
326+
* Content is the base64-encoded attachment data
327+
* @example "base64data..."
328+
*/
329+
content: string
330+
/**
331+
* ContentType is the MIME type of the attachment
332+
* @example "image/jpeg"
333+
*/
334+
content_type: string
335+
/**
336+
* Name is the original filename of the attachment
337+
* @example "photo.jpg"
338+
*/
339+
name: string
340+
}
341+
333342
export interface RequestsMessageBulkSend {
343+
/** Attachments are optional. When you provide a list of attachments, the message will be sent out as an MMS */
344+
attachments?: string[]
334345
/** @example "This is a sample text message" */
335346
content: string
336347
/**
337348
* Encrypted is used to determine if the content is end-to-end encrypted. Make sure to set the encryption key on the httpSMS mobile app
338349
* @example false
339350
*/
340-
encrypted: boolean
351+
encrypted?: boolean
341352
/** @example "+18005550199" */
342353
from: string
343354
/**
@@ -379,6 +390,8 @@ export interface RequestsMessageEvent {
379390
}
380391

381392
export interface RequestsMessageReceive {
393+
/** Attachments is the list of MMS attachments received with the message */
394+
attachments?: RequestsMessageAttachment[]
382395
/** @example "This is a sample text message received on a phone" */
383396
content: string
384397
/**
@@ -392,7 +405,7 @@ export interface RequestsMessageReceive {
392405
* SIM card that received the message
393406
* @example "SIM1"
394407
*/
395-
sim: string
408+
sim: EntitiesSIM
396409
/**
397410
* Timestamp is the time when the event was emitted, Please send the timestamp in UTC with as much precision as possible
398411
* @example "2022-06-05T14:26:09.527976+03:00"
@@ -403,6 +416,11 @@ export interface RequestsMessageReceive {
403416
}
404417

405418
export interface RequestsMessageSend {
419+
/**
420+
* Attachments are optional. When you provide a list of attachments, the message will be sent out as an MMS
421+
* @example ["https://example.com/image.jpg","https://example.com/video.mp4"]
422+
*/
423+
attachments?: string[]
406424
/** @example "This is a sample text message" */
407425
content: string
408426
/**
@@ -426,6 +444,18 @@ export interface RequestsMessageSend {
426444
to: string
427445
}
428446

447+
export interface RequestsMessageSendScheduleStore {
448+
name: string
449+
timezone: string
450+
windows: RequestsMessageSendScheduleWindow[]
451+
}
452+
453+
export interface RequestsMessageSendScheduleWindow {
454+
day_of_week: number
455+
end_minute: number
456+
start_minute: number
457+
}
458+
429459
export interface RequestsMessageThreadUpdate {
430460
/** @example true */
431461
is_archived: boolean
@@ -461,6 +491,8 @@ export interface RequestsPhoneUpsert {
461491
* @example 12345
462492
*/
463493
message_expiration_seconds: number
494+
/** @example "32343a19-da5e-4b1b-a767-3298a73703cb" */
495+
message_send_schedule_id?: string
464496
/** @example 1 */
465497
messages_per_minute: number
466498
/** @example "e.g. This phone cannot receive calls. Please send an SMS instead." */
@@ -597,6 +629,22 @@ export interface ResponsesMessageResponse {
597629
status: string
598630
}
599631

632+
export interface ResponsesMessageSendScheduleResponse {
633+
data: EntitiesMessageSendSchedule
634+
/** @example "Request handled successfully" */
635+
message: string
636+
/** @example "success" */
637+
status: string
638+
}
639+
640+
export interface ResponsesMessageSendSchedulesResponse {
641+
data: EntitiesMessageSendSchedule[]
642+
/** @example "Request handled successfully" */
643+
message: string
644+
/** @example "success" */
645+
status: string
646+
}
647+
600648
export interface ResponsesMessageThreadsResponse {
601649
data: EntitiesMessageThread[]
602650
/** @example "Request handled successfully" */
@@ -635,6 +683,13 @@ export interface ResponsesOkString {
635683
status: string
636684
}
637685

686+
export interface ResponsesPaymentRequired {
687+
/** @example "You have reached the maximum number of allowed resources. Please upgrade your plan." */
688+
message: string
689+
/** @example "error" */
690+
status: string
691+
}
692+
638693
export interface ResponsesPhoneAPIKeyResponse {
639694
data: EntitiesPhoneAPIKey
640695
/** @example "Request handled successfully" */

0 commit comments

Comments
 (0)