Send and receive SMS messages using your Android phone programmatically via a simple HTTP API
Update prettier version
Acho Arnoldc38e3a0cd568
diff --git a/web/components/FirebaseAuth.vue b/web/components/FirebaseAuth.vueindex 061c0b36..c53ea9f7 100644--- a/web/components/FirebaseAuth.vue+++ b/web/components/FirebaseAuth.vue@@ -46,7 +46,7 @@ export default class FirebaseAuth extends Vue {return {callbacks: {signInSuccessWithAuthResult: (- authResult: firebase.auth.UserCredential+ authResult: firebase.auth.UserCredential,) => {this.$store.dispatch('addNotification', {message: 'Login successfull!',@@ -66,7 +66,7 @@ export default class FirebaseAuth extends Vue {this.firebaseUIInitialized = trueconst container = this.$refs.authContainer as HTMLElementArray.from(- container.getElementsByClassName('firebaseui-idp-text-long')+ container.getElementsByClassName('firebaseui-idp-text-long'),).forEach((item: Element) => {item.textContent =item.textContent?.replace('Sign in with', 'Continue with') || nulldiff --git a/web/components/MessageThreadHeader.vue b/web/components/MessageThreadHeader.vueindex 1aa43cdf..125e8c96 100644--- a/web/components/MessageThreadHeader.vue+++ b/web/components/MessageThreadHeader.vue@@ -213,7 +213,7 @@ export default class MessageThreadHeader extends Vue {text: this.$options.filters?.phoneNumber(phone.phone_number),value: phone.phone_number,}- }+ },)}diff --git a/web/layouts/default.vue b/web/layouts/default.vueindex c72c2aad..0be46745 100644--- a/web/layouts/default.vue+++ b/web/layouts/default.vue@@ -40,11 +40,14 @@ export default class DefaultLayout extends Vue {mounted() {// this.startPoller()- setTimeout(() => {- if (this.poller) {- clearInterval(this.poller)- }- }, 60 * 1000 * 60)+ setTimeout(+ () => {+ if (this.poller) {+ clearInterval(this.poller)+ }+ },+ 60 * 1000 * 60,+ )}beforeDestroy(): void {@@ -62,7 +65,7 @@ export default class DefaultLayout extends Vue {setAuthHeader((await this.$fire.auth.currentUser?.getIdToken()) ?? '')promises.push(this.$store.dispatch('loadThreads'),- this.$store.dispatch('getHeartbeat')+ this.$store.dispatch('getHeartbeat'),)}@@ -74,8 +77,8 @@ export default class DefaultLayout extends Vue {promises.push(this.$store.dispatch('loadThreadMessages',- this.$store.getters.getThread.id- )+ this.$store.getters.getThread.id,+ ),)}await Promise.all(promises)diff --git a/web/package.json b/web/package.jsonindex 00fa2ff6..14b60187 100644--- a/web/package.json+++ b/web/package.json@@ -67,7 +67,7 @@"jest": "^27.4.4","lint-staged": "^13.2.2","postcss-html": "^1.5.0",- "prettier": "^2.8.8",+ "prettier": "3.0.0","stylelint": "^15.10.2","stylelint-config-prettier": "^9.0.5","stylelint-config-recommended-vue": "^1.5.0",diff --git a/web/pages/heartbeats/_id.vue b/web/pages/heartbeats/_id.vueindex 84d1f9d5..6a53816e 100644--- a/web/pages/heartbeats/_id.vue+++ b/web/pages/heartbeats/_id.vue@@ -115,7 +115,7 @@ export default {if (index < this.heartbeats.length - 1) {interval = this.getDiff(heartbeat.timestamp,- this.heartbeats[index + 1].timestamp+ this.heartbeats[index + 1].timestamp,)}const item = {@@ -148,7 +148,7 @@ export default {}const duration = intervalToDuration({start: new Date(- context.dataset.data[context.dataIndex + 1].x+ context.dataset.data[context.dataIndex + 1].x,),end: new Date(context.dataset.data[context.dataIndex].x),})diff --git a/web/pages/messages/index.vue b/web/pages/messages/index.vueindex cb6b752e..a1a2a154 100644--- a/web/pages/messages/index.vue+++ b/web/pages/messages/index.vue@@ -109,8 +109,8 @@ export default {errors.set('to',response.data.data.to.map((x) =>- x.replace('to field', 'phone number field')- )+ x.replace('to field', 'phone number field'),+ ),)}if (response.data.data.from) {diff --git a/web/pages/settings/index.vue b/web/pages/settings/index.vueindex d23a482a..9b439b5a 100644--- a/web/pages/settings/index.vue+++ b/web/pages/settings/index.vue@@ -738,7 +738,7 @@ export default Vue.extend({id: webhook.id,url: webhook.url,phone_numbers: webhook.phone_numbers.filter(- (x) => this.phoneNumbers.find((y) => y === x) !== undefined+ (x) => this.phoneNumbers.find((y) => y === x) !== undefined,),signing_key: webhook.signing_key,events: webhook.events,@@ -768,7 +768,7 @@ export default Vue.extend({url: '',signing_key: '',phone_numbers: this.$store.getters.getPhones.map(- (phone) => phone.phone_number+ (phone) => phone.phone_number,),events: ['message.phone.received',diff --git a/web/plugins/chart.ts b/web/plugins/chart.tsindex a5ad4a71..dcae6717 100644--- a/web/plugins/chart.ts+++ b/web/plugins/chart.ts@@ -26,7 +26,7 @@ ChartJS.register(CategoryScale,LinearScale,LineElement,- ArcElement+ ArcElement,)Vue.component('BarChart', {diff --git a/web/plugins/errors.ts b/web/plugins/errors.tsindex 813c6b63..437b641f 100644--- a/web/plugins/errors.ts+++ b/web/plugins/errors.ts@@ -21,7 +21,7 @@ const sanitize = (key: string, values: Array<string>): Array<string> => {.split(' char').join(' character').split(' field ')- .join(' ')+ .join(' '),)})}diff --git a/web/store/index.ts b/web/store/index.tsindex 6b76e45f..3b721115 100644--- a/web/store/index.ts+++ b/web/store/index.ts@@ -327,7 +327,7 @@ export const actions = {if (context.state.user && context.state.user.active_phone_id) {const phone = response.data.data.find(- (x: EntitiesPhone) => x.id === context.state.user?.active_phone_id+ (x: EntitiesPhone) => x.id === context.state.user?.active_phone_id,)if (phone) {context.commit('setOwner', phone.phone_number)@@ -351,7 +351,7 @@ export const actions = {async updatePhone(context: ActionContext<State, State>,- phone: EntitiesPhone+ phone: EntitiesPhone,) {await axios.put(`/v1/phones`, {@@ -359,7 +359,7 @@ export const actions = {sim: phone.sim,phone_number: phone.phone_number,message_expiration_seconds: parseInt(- phone.message_expiration_seconds.toString()+ phone.message_expiration_seconds.toString(),),max_send_attempts: parseInt(phone.max_send_attempts.toString()),messages_per_minute: parseInt(phone.messages_per_minute.toString()),@@ -379,7 +379,7 @@ export const actions = {async handleAxiosError(context: ActionContext<State, State>,- error: AxiosError+ error: AxiosError,) {const errorMessage =error.response?.data?.data[Object.keys(error.response?.data?.data)[0]][0]@@ -394,7 +394,7 @@ export const actions = {getHeartbeat(context: ActionContext<State, State>,- limit = 1+ limit = 1,): Promise<Array<Heartbeat>> {return new Promise<Array<Heartbeat>>((resolve, reject) => {axios@@ -430,7 +430,7 @@ export const actions = {async sendMessage(context: ActionContext<State, State>,- request: SendMessageRequest+ request: SendMessageRequest,) {try {const response = await axios.post('/v1/messages/send', request)@@ -455,7 +455,7 @@ export const actions = {addNotification(context: ActionContext<State, State>,- request: NotificationRequest+ request: NotificationRequest,) {context.commit('setNotification', request)},@@ -466,7 +466,7 @@ export const actions = {loadThreadMessages(context: ActionContext<State, State>,- threadId: string | null+ threadId: string | null,): Promise<Array<Message>> {context.commit('setThreadId', threadId)return new Promise<Array<Message>>((resolve, reject) => {@@ -494,7 +494,7 @@ export const actions = {async setAuthUser(context: ActionContext<State, State>,- user: AuthUser | null | undefined+ user: AuthUser | null | undefined,) {const userChanged = user?.id !== context.getters.getAuthUser?.id@@ -511,7 +511,7 @@ export const actions = {])const phone = context.getters.getPhones.find(- (x: EntitiesPhone) => x.id === context.getters.getUser.active_phone_id+ (x: EntitiesPhone) => x.id === context.getters.getUser.active_phone_id,)if (phone) {await context.dispatch('updateUser', {@@ -524,7 +524,7 @@ export const actions = {async onAuthStateChanged(context: ActionContext<State, State>,// @ts-ignore- { authUser }+ { authUser },) {if (authUser == null) {await Promise.all([@@ -544,7 +544,7 @@ export const actions = {async onIdTokenChanged(_: ActionContext<State, State>,// @ts-ignore- { authUser }+ { authUser },) {if (authUser == null) {setApiKey('')@@ -559,7 +559,7 @@ export const actions = {async updateUser(context: ActionContext<State, State>,- payload: { owner: string; timezone: string }+ payload: { owner: string; timezone: string },) {await context.commit('setOwner', payload.owner)@@ -579,7 +579,7 @@ export const actions = {async updateThread(context: ActionContext<State, State>,- payload: { threadId: string; isArchived: boolean }+ payload: { threadId: string; isArchived: boolean },) {await axios.put(`/v1/message-threads/${payload.threadId}`, {is_archived: payload.isArchived,@@ -632,7 +632,7 @@ export const actions = {createDiscord(context: ActionContext<State, State>,- payload: RequestsDiscordStore+ payload: RequestsDiscordStore,): Promise<EntitiesDiscord> {return new Promise<EntitiesDiscord>((resolve, reject) => {axios@@ -681,13 +681,13 @@ export const actions = {updateDiscordIntegration(context: ActionContext<State, State>,- payload: RequestsDiscordUpdate & { id: string }+ payload: RequestsDiscordUpdate & { id: string },) {return new Promise<EntitiesDiscord>((resolve, reject) => {axios.put<ResponsesDiscordResponse>(`/v1/discord-integrations/${payload.id}`,- payload+ payload,).then((response: AxiosResponse<ResponsesDiscordResponse>) => {resolve(response.data.data)@@ -708,7 +708,7 @@ export const actions = {deleteDiscordIntegration(context: ActionContext<State, State>,- payload: string+ payload: string,) {return new Promise<void>((resolve, reject) => {axios@@ -732,7 +732,7 @@ export const actions = {createWebhook(context: ActionContext<State, State>,- payload: RequestsWebhookStore+ payload: RequestsWebhookStore,) {return new Promise<EntitiesWebhook>((resolve, reject) => {axios@@ -780,7 +780,7 @@ export const actions = {updateWebhook(context: ActionContext<State, State>,- payload: RequestsWebhookUpdate & { id: string }+ payload: RequestsWebhookUpdate & { id: string },) {return new Promise<EntitiesWebhook>((resolve, reject) => {axiosdiff --git a/web/yarn.lock b/web/yarn.lockindex f8bf118b..6d047258 100644--- a/web/yarn.lock+++ b/web/yarn.lock@@ -11711,7 +11711,12 @@ prepend-http@^1.0.0:resolved "https://registry.yarnpkg.com/prepend-http/-/prepend-http-1.0.4.tgz#d4f4562b0ce3696e41ac52d0e002e57a635dc6dc"integrity sha512-PhmXi5XmoyKw1Un4E+opM2KcsJInDvKyuOumcjjw3waw86ZNjHwVUOOWLc4bCzLdcKNaWBH9e99sbWzDQsVaYg==-"prettier@^1.18.2 || ^2.0.0", prettier@^2.8.8:+ version "3.0.0"+ resolved "https://registry.yarnpkg.com/prettier/-/prettier-3.0.0.tgz#e7b19f691245a21d618c68bc54dc06122f6105ae"+ integrity sha512-zBf5eHpwHOGPC47h0zrPyNn+eAEIdEzfywMoYn2XPi0P44Zp0tSq64rq0xAREh4auw2cJZHo9QUob+NqCQky4g==++"prettier@^1.18.2 || ^2.0.0":version "2.8.8"resolved "https://registry.yarnpkg.com/prettier/-/prettier-2.8.8.tgz#e8c5d7e98a4305ffe3de2e1fc4aca1a71c28b1da"integrity sha512-tdN8qQGvNjw4CHbY+XXk0JgCXn9QiF21a55rBe5LJAU+kDyC4WQn4+awm2Xfk2lQMk5fKup9XgzTZtGkjBdP9Q==