Browse Source

add feature and improvement:

- update go now use go 1.21
- update base packages to latest
- remove message sync configuration limit
- add feature for update or delete message
- add feature to join or leave group
pull/61/head
Dimas Restu H 2 years ago
parent
commit
c6c184f43b
  1. 4
      .env.example
  2. 2
      Dockerfile
  3. 165
      docs/docs.go
  4. 165
      docs/swagger.json
  5. 112
      docs/swagger.yaml
  6. 41
      go.mod
  7. 111
      go.sum
  8. 6
      internal/route.go
  9. 14
      internal/whatsapp/types/request.go
  10. 155
      internal/whatsapp/whatsapp.go
  11. 152
      pkg/whatsapp/whatsapp.go

4
.env.example

@ -37,8 +37,8 @@ WHATSAPP_MEDIA_IMAGE_COMPRESSION=true
WHATSAPP_MEDIA_IMAGE_CONVERT_WEBP=true
# WHATSAPP_VERSION_MAJOR=2
# WHATSAPP_VERSION_MINOR=2353
# WHATSAPP_VERSION_PATCH=0
# WHATSAPP_VERSION_MINOR=2411
# WHATSAPP_VERSION_PATCH=2
# -----------------------------------
# 3rd Party Configuration

2
Dockerfile

@ -1,6 +1,6 @@
# Builder Image
# ---------------------------------------------------
FROM dimaskiddo/alpine:go-1.19 AS go-builder
FROM dimaskiddo/alpine:go-1.21 AS go-builder
WORKDIR /usr/src/app

165
docs/docs.go

@ -70,7 +70,7 @@ const docTemplate = `{
"application/json"
],
"tags": [
"WhatsApp Information"
"WhatsApp Group"
],
"summary": "Get Joined Groups Information",
"responses": {
@ -78,6 +78,64 @@ const docTemplate = `{
"description": "OK"
}
}
},
"post": {
"security": [
{
"BearerAuth": []
}
],
"description": "Joining to Group From Invitation Link from WhatsApp",
"produces": [
"application/json"
],
"tags": [
"WhatsApp Group"
],
"summary": "Join Group From Invitation Link",
"parameters": [
{
"type": "string",
"description": "Group Invitation Link",
"name": "link",
"in": "formData",
"required": true
}
],
"responses": {
"200": {
"description": "OK"
}
}
},
"delete": {
"security": [
{
"BearerAuth": []
}
],
"description": "Leaving Group By Group ID from WhatsApp",
"produces": [
"application/json"
],
"tags": [
"WhatsApp Group"
],
"summary": "Leave Group By Group ID",
"parameters": [
{
"type": "string",
"description": "Group ID",
"name": "gid",
"in": "formData",
"required": true
}
],
"responses": {
"200": {
"description": "OK"
}
}
}
},
"/login": {
@ -166,6 +224,93 @@ const docTemplate = `{
}
}
},
"/message": {
"post": {
"security": [
{
"BearerAuth": []
}
],
"description": "Update Message to Spesific WhatsApp Personal ID or Group ID",
"consumes": [
"multipart/form-data"
],
"produces": [
"application/json"
],
"tags": [
"WhatsApp Message"
],
"summary": "Update Message",
"parameters": [
{
"type": "string",
"description": "Destination WhatsApp Personal ID or Group ID",
"name": "msisdn",
"in": "formData",
"required": true
},
{
"type": "string",
"description": "Message ID",
"name": "messageid",
"in": "formData",
"required": true
},
{
"type": "string",
"description": "Text Message",
"name": "message",
"in": "formData",
"required": true
}
],
"responses": {
"200": {
"description": "OK"
}
}
},
"delete": {
"security": [
{
"BearerAuth": []
}
],
"description": "Delete Message to Spesific WhatsApp Personal ID or Group ID",
"consumes": [
"multipart/form-data"
],
"produces": [
"application/json"
],
"tags": [
"WhatsApp Message"
],
"summary": "Delete Message",
"parameters": [
{
"type": "string",
"description": "Destination WhatsApp Personal ID or Group ID",
"name": "msisdn",
"in": "formData",
"required": true
},
{
"type": "string",
"description": "Message ID",
"name": "messageid",
"in": "formData",
"required": true
}
],
"responses": {
"200": {
"description": "OK"
}
}
}
},
"/registered": {
"get": {
"security": [
@ -212,7 +357,7 @@ const docTemplate = `{
"application/json"
],
"tags": [
"WhatsApp Message"
"WhatsApp Send Message"
],
"summary": "Send Audio Message",
"parameters": [
@ -253,7 +398,7 @@ const docTemplate = `{
"application/json"
],
"tags": [
"WhatsApp Message"
"WhatsApp Send Message"
],
"summary": "Send Contact Message",
"parameters": [
@ -301,7 +446,7 @@ const docTemplate = `{
"application/json"
],
"tags": [
"WhatsApp Message"
"WhatsApp Send Message"
],
"summary": "Send Document Message",
"parameters": [
@ -342,7 +487,7 @@ const docTemplate = `{
"application/json"
],
"tags": [
"WhatsApp Message"
"WhatsApp Send Message"
],
"summary": "Send Image Message",
"parameters": [
@ -397,7 +542,7 @@ const docTemplate = `{
"application/json"
],
"tags": [
"WhatsApp Message"
"WhatsApp Send Message"
],
"summary": "Send Link Message",
"parameters": [
@ -444,7 +589,7 @@ const docTemplate = `{
"application/json"
],
"tags": [
"WhatsApp Message"
"WhatsApp Send Message"
],
"summary": "Send Location Message",
"parameters": [
@ -492,7 +637,7 @@ const docTemplate = `{
"application/json"
],
"tags": [
"WhatsApp Message"
"WhatsApp Send Message"
],
"summary": "Send Sticker Message",
"parameters": [
@ -533,7 +678,7 @@ const docTemplate = `{
"application/json"
],
"tags": [
"WhatsApp Message"
"WhatsApp Send Message"
],
"summary": "Send Text Message",
"parameters": [
@ -574,7 +719,7 @@ const docTemplate = `{
"application/json"
],
"tags": [
"WhatsApp Message"
"WhatsApp Send Message"
],
"summary": "Send Video Message",
"parameters": [

165
docs/swagger.json

@ -62,7 +62,7 @@
"application/json"
],
"tags": [
"WhatsApp Information"
"WhatsApp Group"
],
"summary": "Get Joined Groups Information",
"responses": {
@ -70,6 +70,64 @@
"description": "OK"
}
}
},
"post": {
"security": [
{
"BearerAuth": []
}
],
"description": "Joining to Group From Invitation Link from WhatsApp",
"produces": [
"application/json"
],
"tags": [
"WhatsApp Group"
],
"summary": "Join Group From Invitation Link",
"parameters": [
{
"type": "string",
"description": "Group Invitation Link",
"name": "link",
"in": "formData",
"required": true
}
],
"responses": {
"200": {
"description": "OK"
}
}
},
"delete": {
"security": [
{
"BearerAuth": []
}
],
"description": "Leaving Group By Group ID from WhatsApp",
"produces": [
"application/json"
],
"tags": [
"WhatsApp Group"
],
"summary": "Leave Group By Group ID",
"parameters": [
{
"type": "string",
"description": "Group ID",
"name": "gid",
"in": "formData",
"required": true
}
],
"responses": {
"200": {
"description": "OK"
}
}
}
},
"/login": {
@ -158,6 +216,93 @@
}
}
},
"/message": {
"post": {
"security": [
{
"BearerAuth": []
}
],
"description": "Update Message to Spesific WhatsApp Personal ID or Group ID",
"consumes": [
"multipart/form-data"
],
"produces": [
"application/json"
],
"tags": [
"WhatsApp Message"
],
"summary": "Update Message",
"parameters": [
{
"type": "string",
"description": "Destination WhatsApp Personal ID or Group ID",
"name": "msisdn",
"in": "formData",
"required": true
},
{
"type": "string",
"description": "Message ID",
"name": "messageid",
"in": "formData",
"required": true
},
{
"type": "string",
"description": "Text Message",
"name": "message",
"in": "formData",
"required": true
}
],
"responses": {
"200": {
"description": "OK"
}
}
},
"delete": {
"security": [
{
"BearerAuth": []
}
],
"description": "Delete Message to Spesific WhatsApp Personal ID or Group ID",
"consumes": [
"multipart/form-data"
],
"produces": [
"application/json"
],
"tags": [
"WhatsApp Message"
],
"summary": "Delete Message",
"parameters": [
{
"type": "string",
"description": "Destination WhatsApp Personal ID or Group ID",
"name": "msisdn",
"in": "formData",
"required": true
},
{
"type": "string",
"description": "Message ID",
"name": "messageid",
"in": "formData",
"required": true
}
],
"responses": {
"200": {
"description": "OK"
}
}
}
},
"/registered": {
"get": {
"security": [
@ -204,7 +349,7 @@
"application/json"
],
"tags": [
"WhatsApp Message"
"WhatsApp Send Message"
],
"summary": "Send Audio Message",
"parameters": [
@ -245,7 +390,7 @@
"application/json"
],
"tags": [
"WhatsApp Message"
"WhatsApp Send Message"
],
"summary": "Send Contact Message",
"parameters": [
@ -293,7 +438,7 @@
"application/json"
],
"tags": [
"WhatsApp Message"
"WhatsApp Send Message"
],
"summary": "Send Document Message",
"parameters": [
@ -334,7 +479,7 @@
"application/json"
],
"tags": [
"WhatsApp Message"
"WhatsApp Send Message"
],
"summary": "Send Image Message",
"parameters": [
@ -389,7 +534,7 @@
"application/json"
],
"tags": [
"WhatsApp Message"
"WhatsApp Send Message"
],
"summary": "Send Link Message",
"parameters": [
@ -436,7 +581,7 @@
"application/json"
],
"tags": [
"WhatsApp Message"
"WhatsApp Send Message"
],
"summary": "Send Location Message",
"parameters": [
@ -484,7 +629,7 @@
"application/json"
],
"tags": [
"WhatsApp Message"
"WhatsApp Send Message"
],
"summary": "Send Sticker Message",
"parameters": [
@ -525,7 +670,7 @@
"application/json"
],
"tags": [
"WhatsApp Message"
"WhatsApp Send Message"
],
"summary": "Send Text Message",
"parameters": [
@ -566,7 +711,7 @@
"application/json"
],
"tags": [
"WhatsApp Message"
"WhatsApp Send Message"
],
"summary": "Send Video Message",
"parameters": [

112
docs/swagger.yaml

@ -32,6 +32,24 @@ paths:
tags:
- Root
/group:
delete:
description: Leaving Group By Group ID from WhatsApp
parameters:
- description: Group ID
in: formData
name: gid
required: true
type: string
produces:
- application/json
responses:
"200":
description: OK
security:
- BearerAuth: []
summary: Leave Group By Group ID
tags:
- WhatsApp Group
get:
description: Get Joined Groups Information from WhatsApp
produces:
@ -43,7 +61,25 @@ paths:
- BearerAuth: []
summary: Get Joined Groups Information
tags:
- WhatsApp Information
- WhatsApp Group
post:
description: Joining to Group From Invitation Link from WhatsApp
parameters:
- description: Group Invitation Link
in: formData
name: link
required: true
type: string
produces:
- application/json
responses:
"200":
description: OK
security:
- BearerAuth: []
summary: Join Group From Invitation Link
tags:
- WhatsApp Group
/login:
post:
consumes:
@ -97,6 +133,62 @@ paths:
summary: Logout Device from WhatsApp Multi-Device
tags:
- WhatsApp Authentication
/message:
delete:
consumes:
- multipart/form-data
description: Delete Message to Spesific WhatsApp Personal ID or Group ID
parameters:
- description: Destination WhatsApp Personal ID or Group ID
in: formData
name: msisdn
required: true
type: string
- description: Message ID
in: formData
name: messageid
required: true
type: string
produces:
- application/json
responses:
"200":
description: OK
security:
- BearerAuth: []
summary: Delete Message
tags:
- WhatsApp Message
post:
consumes:
- multipart/form-data
description: Update Message to Spesific WhatsApp Personal ID or Group ID
parameters:
- description: Destination WhatsApp Personal ID or Group ID
in: formData
name: msisdn
required: true
type: string
- description: Message ID
in: formData
name: messageid
required: true
type: string
- description: Text Message
in: formData
name: message
required: true
type: string
produces:
- application/json
responses:
"200":
description: OK
security:
- BearerAuth: []
summary: Update Message
tags:
- WhatsApp Message
/registered:
get:
description: Check WhatsApp Personal ID is Registered
@ -141,7 +233,7 @@ paths:
- BearerAuth: []
summary: Send Audio Message
tags:
- WhatsApp Message
- WhatsApp Send Message
/send/contact:
post:
consumes:
@ -173,7 +265,7 @@ paths:
- BearerAuth: []
summary: Send Contact Message
tags:
- WhatsApp Message
- WhatsApp Send Message
/send/document:
post:
consumes:
@ -200,7 +292,7 @@ paths:
- BearerAuth: []
summary: Send Document Message
tags:
- WhatsApp Message
- WhatsApp Send Message
/send/image:
post:
consumes:
@ -236,7 +328,7 @@ paths:
- BearerAuth: []
summary: Send Image Message
tags:
- WhatsApp Message
- WhatsApp Send Message
/send/link:
post:
consumes:
@ -266,7 +358,7 @@ paths:
- BearerAuth: []
summary: Send Link Message
tags:
- WhatsApp Message
- WhatsApp Send Message
/send/location:
post:
consumes:
@ -298,7 +390,7 @@ paths:
- BearerAuth: []
summary: Send Location Message
tags:
- WhatsApp Message
- WhatsApp Send Message
/send/sticker:
post:
consumes:
@ -325,7 +417,7 @@ paths:
- BearerAuth: []
summary: Send Sticker Message
tags:
- WhatsApp Message
- WhatsApp Send Message
/send/text:
post:
consumes:
@ -351,7 +443,7 @@ paths:
- BearerAuth: []
summary: Send Text Message
tags:
- WhatsApp Message
- WhatsApp Send Message
/send/video:
post:
consumes:
@ -387,7 +479,7 @@ paths:
- BearerAuth: []
summary: Send Video Message
tags:
- WhatsApp Message
- WhatsApp Send Message
securityDefinitions:
BasicAuth:
type: basic

41
go.mod

@ -1,24 +1,24 @@
module github.com/dimaskiddo/go-whatsapp-multidevice-rest
go 1.19
go 1.21
require (
github.com/PuerkitoBio/goquery v1.8.1
github.com/PuerkitoBio/goquery v1.9.1
github.com/SporkHubr/echo-http-cache v0.0.0-20200706100054-1d7ae9f38029
github.com/go-playground/validator/v10 v10.16.0
github.com/go-playground/validator/v10 v10.19.0
github.com/golang-jwt/jwt v3.2.2+incompatible
github.com/joho/godotenv v1.5.1
github.com/labstack/echo/v4 v4.11.3
github.com/labstack/echo/v4 v4.11.4
github.com/lib/pq v1.10.9
github.com/nickalie/go-webpbin v0.0.0-20220110095747-f10016bf2dc1
github.com/robfig/cron/v3 v3.0.1
github.com/sirupsen/logrus v1.9.3
github.com/skip2/go-qrcode v0.0.0-20200617195104-da1b6568686e
github.com/sunshineplan/imgconv v1.1.8
github.com/sunshineplan/imgconv v1.1.9
github.com/swaggo/echo-swagger v1.4.1
github.com/swaggo/swag v1.16.2
go.mau.fi/whatsmeow v0.0.0-20231127175850-3c97433b4676
google.golang.org/protobuf v1.31.0
github.com/swaggo/swag v1.16.3
go.mau.fi/whatsmeow v0.0.0-20240316104858-18372a0653fa
google.golang.org/protobuf v1.33.0
modernc.org/sqlite v1.17.0
)
@ -27,11 +27,11 @@ require (
github.com/KyleBanks/depth v1.2.1 // indirect
github.com/PuerkitoBio/purell v1.1.1 // indirect
github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578 // indirect
github.com/andybalholm/cascadia v1.3.1 // indirect
github.com/andybalholm/cascadia v1.3.2 // indirect
github.com/disintegration/imaging v1.6.2 // indirect
github.com/dsnet/compress v0.0.1 // indirect
github.com/frankban/quicktest v1.14.6 // indirect
github.com/gabriel-vasile/mimetype v1.4.2 // indirect
github.com/gabriel-vasile/mimetype v1.4.3 // indirect
github.com/ghodss/yaml v1.0.0 // indirect
github.com/go-openapi/jsonpointer v0.19.5 // indirect
github.com/go-openapi/jsonreference v0.19.6 // indirect
@ -41,17 +41,17 @@ require (
github.com/go-playground/universal-translator v0.18.1 // indirect
github.com/golang/snappy v0.0.4 // indirect
github.com/google/go-cmp v0.5.9 // indirect
github.com/google/uuid v1.3.0 // indirect
github.com/google/uuid v1.6.0 // indirect
github.com/gorilla/websocket v1.5.0 // indirect
github.com/hhrutter/lzw v1.0.0 // indirect
github.com/hhrutter/tiff v1.0.1 // indirect
github.com/josharian/intern v1.0.0 // indirect
github.com/kballard/go-shellquote v0.0.0-20180428030007-95032a82bc51 // indirect
github.com/labstack/gommon v0.4.0 // indirect
github.com/leodido/go-urn v1.2.4 // indirect
github.com/labstack/gommon v0.4.2 // indirect
github.com/leodido/go-urn v1.4.0 // indirect
github.com/mailru/easyjson v0.7.7 // indirect
github.com/mattn/go-colorable v0.1.13 // indirect
github.com/mattn/go-isatty v0.0.19 // indirect
github.com/mattn/go-isatty v0.0.20 // indirect
github.com/mattn/go-runewidth v0.0.15 // indirect
github.com/mholt/archiver v3.1.1+incompatible // indirect
github.com/nickalie/go-binwrapper v0.0.0-20190114141239-525121d43c84 // indirect
@ -61,6 +61,7 @@ require (
github.com/pkg/errors v0.9.1 // indirect
github.com/remyoudompheng/bigfft v0.0.0-20200410134404-eec4a21b6bb0 // indirect
github.com/rivo/uniseg v0.4.4 // indirect
github.com/rs/zerolog v1.32.0 // indirect
github.com/sunshineplan/pdf v1.0.7 // indirect
github.com/swaggo/files/v2 v2.0.0 // indirect
github.com/ulikunitz/xz v0.5.10 // indirect
@ -68,14 +69,14 @@ require (
github.com/valyala/fasttemplate v1.2.2 // indirect
github.com/xi2/xz v0.0.0-20171230120015-48954b6210f8 // indirect
go.mau.fi/libsignal v0.1.0 // indirect
go.mau.fi/util v0.2.0 // indirect
golang.org/x/crypto v0.15.0 // indirect
golang.org/x/image v0.14.0 // indirect
go.mau.fi/util v0.4.1 // indirect
golang.org/x/crypto v0.21.0 // indirect
golang.org/x/image v0.15.0 // indirect
golang.org/x/mod v0.9.0 // indirect
golang.org/x/net v0.17.0 // indirect
golang.org/x/sys v0.14.0 // indirect
golang.org/x/net v0.21.0 // indirect
golang.org/x/sys v0.18.0 // indirect
golang.org/x/text v0.14.0 // indirect
golang.org/x/time v0.3.0 // indirect
golang.org/x/time v0.5.0 // indirect
golang.org/x/tools v0.7.0 // indirect
gopkg.in/yaml.v2 v2.4.0 // indirect
lukechampine.com/uint128 v1.1.1 // indirect

111
go.sum

@ -6,8 +6,8 @@ github.com/DataDog/sketches-go v0.0.0-20190923095040-43f19ad77ff7/go.mod h1:Q5Db
github.com/KyleBanks/depth v1.2.1 h1:5h8fQADFrWtarTdtDudMmGsC7GPbOAu6RVB3ffsVFHc=
github.com/KyleBanks/depth v1.2.1/go.mod h1:jzSb9d0L43HxTQfT+oSA1EEp2q+ne2uh6XgeJcm8brE=
github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAElWljhcU=
github.com/PuerkitoBio/goquery v1.8.1 h1:uQxhNlArOIdbrH1tr0UXwdVFgDcZDrZVdcpygAcwmWM=
github.com/PuerkitoBio/goquery v1.8.1/go.mod h1:Q8ICL1kNUJ2sXGoAhPGUdYDJvgQgHzJsnnd3H7Ho5jQ=
github.com/PuerkitoBio/goquery v1.9.1 h1:mTL6XjbJTZdpfL+Gwl5U2h1l9yEkJjhmlTeV9VPW7UI=
github.com/PuerkitoBio/goquery v1.9.1/go.mod h1:cW1n6TmIMDoORQU5IU/P1T3tGFunOeXEpGP2WHRwkbY=
github.com/PuerkitoBio/purell v1.1.1 h1:WEQqlqaGbrPkxLJWfBwQmfEAE1Z7ONdDLqrN38tNFfI=
github.com/PuerkitoBio/purell v1.1.1/go.mod h1:c11w/QuzBsJSee3cPx9rAFu61PvFxuPbtSwDGJws/X0=
github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578 h1:d+Bc7a5rLufV/sSk/8dngufqelfh6jnri85riMAaF/M=
@ -16,8 +16,8 @@ github.com/SporkHubr/echo-http-cache v0.0.0-20200706100054-1d7ae9f38029 h1:XjAr0
github.com/SporkHubr/echo-http-cache v0.0.0-20200706100054-1d7ae9f38029/go.mod h1:/JdnJQCTSrjBrEmR8UtcAwsCcFMAeq3c25NK9m21YOA=
github.com/VictoriaMetrics/fastcache v1.5.7/go.mod h1:ptDBkNMQI4RtmVo8VS/XwRY6RoTu1dAWCbrk+6WsEM8=
github.com/allegro/bigcache v1.2.1-0.20190218064605-e24eb225f156/go.mod h1:Cb/ax3seSYIx7SuZdm2G2xzfwmv3TPSk2ucNfQESPXM=
github.com/andybalholm/cascadia v1.3.1 h1:nhxRkql1kdYCc8Snf7D5/D3spOX+dBgjA6u8x004T2c=
github.com/andybalholm/cascadia v1.3.1/go.mod h1:R4bJ1UQfqADjvDa4P6HZHLh/3OxWWEqc0Sk8XGwHqvA=
github.com/andybalholm/cascadia v1.3.2 h1:3Xi6Dw5lHF15JtdcmAHD3i1+T8plmv7BQ/nsViSLyss=
github.com/andybalholm/cascadia v1.3.2/go.mod h1:7gtRlve5FxPPgIgX36uWBX58OdBsSS6lUvCFb+h7KvU=
github.com/benbjohnson/clock v1.0.0/go.mod h1:bGMdMPoPVvcYyt1gHDf4J2KE153Yf9BuiUKYMaxlTDM=
github.com/benbjohnson/clock v1.0.3/go.mod h1:bGMdMPoPVvcYyt1gHDf4J2KE153Yf9BuiUKYMaxlTDM=
github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU=
@ -25,6 +25,7 @@ github.com/cespare/xxhash v1.1.0/go.mod h1:XrSqR1VqqWfGrhpAt58auRo0WTKS1nRRg3ghf
github.com/cespare/xxhash/v2 v2.1.1/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs=
github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw=
github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc=
github.com/coreos/go-systemd/v22 v22.5.0/go.mod h1:Y58oyj3AT4RCenI/lSvhwexgC+NSVTIJ3seZv2GcEnc=
github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E=
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
@ -46,8 +47,8 @@ github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7
github.com/frankban/quicktest v1.14.6 h1:7Xjx+VpznH+oBnejlPUj8oUpdxnVs4f8XU8WnHkI4W8=
github.com/frankban/quicktest v1.14.6/go.mod h1:4ptaffx2x8+WTWXmUCuVU6aPUX1/Mz7zb5vbUoiM6w0=
github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo=
github.com/gabriel-vasile/mimetype v1.4.2 h1:w5qFW6JKBz9Y393Y4q372O9A7cUSequkh1Q7OhCmWKU=
github.com/gabriel-vasile/mimetype v1.4.2/go.mod h1:zApsH/mKG4w07erKIaJPFiX0Tsq9BFQgN3qGY5GnNgA=
github.com/gabriel-vasile/mimetype v1.4.3 h1:in2uUcidCuFcDKtdcBxlR0rJ1+fsokWf+uqxgUFjbI0=
github.com/gabriel-vasile/mimetype v1.4.3/go.mod h1:d8uq/6HKRL6CGdk+aubisF/M5GcPfT7nKyLpA0lbSSk=
github.com/ghodss/yaml v1.0.0 h1:wQHKEahhL6wmXdzwWG11gIVCkOv05bNOh+Rxn0yngAk=
github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04=
github.com/go-openapi/jsonpointer v0.19.3/go.mod h1:Pl9vOtqEWErmShwVjC8pYs9cog34VGT37dQOVbmoatg=
@ -65,11 +66,12 @@ github.com/go-playground/locales v0.14.1 h1:EWaQ/wswjilfKLTECiXz7Rh+3BjFhfDFKv/o
github.com/go-playground/locales v0.14.1/go.mod h1:hxrqLVvrK65+Rwrd5Fc6F2O76J/NuW9t0sjnWqG1slY=
github.com/go-playground/universal-translator v0.18.1 h1:Bcnm0ZwsGyWbCzImXv+pAJnYK9S473LQFuzCbDbfSFY=
github.com/go-playground/universal-translator v0.18.1/go.mod h1:xekY+UJKNuX9WP91TpwSH2VMlDf28Uj24BCp08ZFTUY=
github.com/go-playground/validator/v10 v10.16.0 h1:x+plE831WK4vaKHO/jpgUGsvLKIqRRkz6M78GuJAfGE=
github.com/go-playground/validator/v10 v10.16.0/go.mod h1:9iXMNT7sEkjXb0I+enO7QXmzG6QCsPWY4zveKFVRSyU=
github.com/go-playground/validator/v10 v10.19.0 h1:ol+5Fu+cSq9JD7SoSqe04GMI92cbn0+wvQ3bZ8b/AU4=
github.com/go-playground/validator/v10 v10.19.0/go.mod h1:dbuPbCMFw/DrkbEynArYaCwl3amGuJotoKCe95atGMM=
github.com/go-redis/cache/v8 v8.0.0-beta.11/go.mod h1:4wxD/neK+Uw+SteOR+AXtlyQYMBlI/D1u7UahfDCBAI=
github.com/go-redis/redis/v8 v8.0.0-beta.2/go.mod h1:o1M7JtsgfDYyv3o+gBn/jJ1LkqpnCrmil7PSppZGBak=
github.com/go-redis/redis/v8 v8.0.0-beta.5/go.mod h1:Mm9EH/5UMRx680UIryN6rd5XFn/L7zORPqLV+1D5thQ=
github.com/godbus/dbus/v5 v5.0.4/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA=
github.com/golang-jwt/jwt v3.2.2+incompatible h1:IfV12K8xAKAnZqdXVzCZ+TOjboZ2keLg81eXfW3O+oY=
github.com/golang-jwt/jwt v3.2.2+incompatible/go.mod h1:8pz2t5EyA70fFQQSrl6XZXzqecmYZeUEB8OUGHkxJ+I=
github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q=
@ -86,7 +88,6 @@ github.com/golang/protobuf v1.4.0-rc.4.0.20200313231945-b860323f09d0/go.mod h1:W
github.com/golang/protobuf v1.4.0/go.mod h1:jodUvKwWbYaEsadDk5Fwe5c77LiNKVO9IDvqG2KuDX0=
github.com/golang/protobuf v1.4.1/go.mod h1:U8fpvMrcmy5pZrNK1lt4xCsGvpyWQ/VVv6QDs8UjoX8=
github.com/golang/protobuf v1.4.2/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI=
github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk=
github.com/golang/snappy v0.0.1/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q=
github.com/golang/snappy v0.0.4 h1:yAGX7huGHXlcLOEtBnF4w7FQwA26wojNCwOYAEhLjQM=
github.com/golang/snappy v0.0.4/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q=
@ -96,12 +97,12 @@ github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMyw
github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
github.com/google/go-cmp v0.5.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
github.com/google/go-cmp v0.5.3/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38=
github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg=
github.com/google/uuid v1.3.0 h1:t6JiXgmwXMjEs8VusXIJk2BXHsn+wx8BZdTaoZ5fu7I=
github.com/google/uuid v1.3.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0=
github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
github.com/gorilla/websocket v1.5.0 h1:PPwGk2jz7EePpoHN/+ClbZu8SPxiqlu12wZP/3sWmnc=
github.com/gorilla/websocket v1.5.0/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE=
github.com/hhrutter/lzw v1.0.0 h1:laL89Llp86W3rRs83LvKbwYRx6INE8gDn0XNb1oXtm0=
@ -127,13 +128,13 @@ github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI=
github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY=
github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE=
github.com/labstack/echo/v4 v4.1.16/go.mod h1:awO+5TzAjvL8XpibdsfXxPgHr+orhtXZJZIQCVjogKI=
github.com/labstack/echo/v4 v4.11.3 h1:Upyu3olaqSHkCjs1EJJwQ3WId8b8b1hxbogyommKktM=
github.com/labstack/echo/v4 v4.11.3/go.mod h1:UcGuQ8V6ZNRmSweBIJkPvGfwCMIlFmiqrPqiEBfPYws=
github.com/labstack/echo/v4 v4.11.4 h1:vDZmA+qNeh1pd/cCkEicDMrjtrnMGQ1QFI9gWN1zGq8=
github.com/labstack/echo/v4 v4.11.4/go.mod h1:noh7EvLwqDsmh/X/HWKPUl1AjzJrhyptRyEbQJfxen8=
github.com/labstack/gommon v0.3.0/go.mod h1:MULnywXg0yavhxWKc+lOruYdAhDwPK9wf0OL7NoOu+k=
github.com/labstack/gommon v0.4.0 h1:y7cvthEAEbU0yHOf4axH8ZG2NH8knB9iNSoTO8dyIk8=
github.com/labstack/gommon v0.4.0/go.mod h1:uW6kP17uPlLJsD3ijUYn3/M5bAxtlZhMI6m3MFxTMTM=
github.com/leodido/go-urn v1.2.4 h1:XlAE/cm/ms7TE/VMVoduSpNBoyc2dOxHs5MZSwAN63Q=
github.com/leodido/go-urn v1.2.4/go.mod h1:7ZrI8mTSeBSHl/UaRyKQW1qZeMgak41ANeCNaVckg+4=
github.com/labstack/gommon v0.4.2 h1:F8qTUNXgG1+6WQmqoUWnz8WiEU60mXVVw0P4ht1WRA0=
github.com/labstack/gommon v0.4.2/go.mod h1:QlUFxVM+SNXhDL/Z7YhocGIBYOiwB0mXm1+1bAPHPyU=
github.com/leodido/go-urn v1.4.0 h1:WT9HwE9SGECu3lg4d/dIA+jxlljEa1/ffXKmRjqdmIQ=
github.com/leodido/go-urn v1.4.0/go.mod h1:bvxc+MVxLKB4z00jd1z+Dvzr47oO32F/QSNjSBOlFxI=
github.com/lib/pq v1.10.9 h1:YXG7RB+JIjhP29X+OtkiDnYaXQwpS4JEWq7dtCCRUEw=
github.com/lib/pq v1.10.9/go.mod h1:AlVN5x4E4T544tWzH6hKfbfQvm3HdbOxrmggDNAPY9o=
github.com/mailru/easyjson v0.0.0-20190614124828-94de47d64c63/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc=
@ -144,20 +145,19 @@ github.com/mailru/easyjson v0.7.7/go.mod h1:xzfreul335JAWq5oZzymOObrkdz5UnU4kGfJ
github.com/mattn/go-colorable v0.1.2/go.mod h1:U0ppj6V5qS13XJ6of8GYAs25YV2eR4EVcfRqFIhoBtE=
github.com/mattn/go-colorable v0.1.6/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc=
github.com/mattn/go-colorable v0.1.7/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc=
github.com/mattn/go-colorable v0.1.11/go.mod h1:u5H1YNBxpqRaxsYJYSkiCWKzEfiAb1Gb520KVy5xxl4=
github.com/mattn/go-colorable v0.1.13 h1:fFA4WZxdEF4tXPZVKMLwD8oUnCTTo08duU7wxecdEvA=
github.com/mattn/go-colorable v0.1.13/go.mod h1:7S9/ev0klgBDR4GtXTXX8a3vIGJpMovkB8vQcUbaXHg=
github.com/mattn/go-isatty v0.0.8/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s=
github.com/mattn/go-isatty v0.0.9/go.mod h1:YNRxwqDuOph6SZLI9vUUz6OYw3QyUt7WiY2yME+cCiQ=
github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU=
github.com/mattn/go-isatty v0.0.14/go.mod h1:7GGIvUiUoEMVVmxf/4nioHXj79iQHKdU27kJ6hsGG94=
github.com/mattn/go-isatty v0.0.16/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM=
github.com/mattn/go-isatty v0.0.19 h1:JITubQf0MOLdlGRuRq+jtsDlekdYPia9ZFsB8h/APPA=
github.com/mattn/go-isatty v0.0.19/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y=
github.com/mattn/go-isatty v0.0.20 h1:xfD0iDuEKnDkl03q4limB+vH+GxLEtL/jb4xVJSWWEY=
github.com/mattn/go-isatty v0.0.20/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y=
github.com/mattn/go-runewidth v0.0.15 h1:UNAjwbU9l54TA3KzvqLGxwWjHmMgBUVhBiTjelZgg3U=
github.com/mattn/go-runewidth v0.0.15/go.mod h1:Jdepj2loyihRzMpdS35Xk/zdY8IAYHsh153qUoGf23w=
github.com/mattn/go-sqlite3 v1.14.12/go.mod h1:NyWgC/yNuGj7Q9rpYnZvas74GogHl5/Z4A/KQRfk6bU=
github.com/mattn/go-sqlite3 v1.14.17 h1:mCRHCLDUBXgpKAqIKsaAaAsrAlbkeomtRFKXh2L6YIM=
github.com/mattn/go-sqlite3 v1.14.22 h1:2gZY6PC6kBnID23Tichd1K+Z0oS6nE/XwU+Vz/5o4kU=
github.com/mholt/archiver v3.1.1+incompatible h1:1dCVxuqs0dJseYEhi5pl7MYPH9zDa1wBi7mF09cbNkU=
github.com/mholt/archiver v3.1.1+incompatible/go.mod h1:Dh2dOXnSdiLxRiPoVfIr/fI1TwETms9B8CTWfeh7ROU=
github.com/mmcloughlin/avo v0.0.0-20200504053806-fa88270b07e4/go.mod h1:wqKykBG2QzQDJEzvRkcS8x6MiSJkF52hXZsXcjaB3ls=
@ -192,33 +192,31 @@ github.com/robfig/cron/v3 v3.0.1 h1:WdRxkvbJztn8LMz/QEvLN5sBU+xKpSqwwUO1Pjr4qDs=
github.com/robfig/cron/v3 v3.0.1/go.mod h1:eQICP3HwyT7UooqI/z+Ov+PtYAWygg1TEWWzGIFLtro=
github.com/rogpeppe/go-internal v1.9.0 h1:73kH8U+JUqXU8lRuOHeVHaa/SZPifC7BkcraZVejAe8=
github.com/rogpeppe/go-internal v1.9.0/go.mod h1:WtVeX8xhTBvf0smdhujwtBcq4Qrzq/fJaraNFVN+nFs=
github.com/rs/xid v1.5.0/go.mod h1:trrq9SKmegXys3aeAKXMUTdJsYXVwGY3RLcfgqegfbg=
github.com/rs/zerolog v1.32.0 h1:keLypqrlIjaFsbmJOBdB/qvyF8KEtCWHwobLp5l/mQ0=
github.com/rs/zerolog v1.32.0/go.mod h1:/7mN4D5sKwJLZQ2b/znpjC3/GQWY/xaDXUM0kKWRHss=
github.com/sirupsen/logrus v1.9.3 h1:dueUQJ1C2q9oE3F7wvmSGAaVtTmUizReu6fjN8uqzbQ=
github.com/sirupsen/logrus v1.9.3/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVsIT4qYEQ=
github.com/skip2/go-qrcode v0.0.0-20200617195104-da1b6568686e h1:MRM5ITcdelLK2j1vwZ3Je0FKVCfqOLp5zO6trqMLYs0=
github.com/skip2/go-qrcode v0.0.0-20200617195104-da1b6568686e/go.mod h1:XV66xRDqSt+GTGFMVlhk3ULuV0y9ZmzeVGR4mloJI3M=
github.com/spaolacci/murmur3 v0.0.0-20180118202830-f09979ecbc72/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA=
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw=
github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo=
github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI=
github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4=
github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA=
github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU=
github.com/stretchr/testify v1.8.2/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4=
github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk=
github.com/sunshineplan/imgconv v1.1.8 h1:NCZAL3NMjPyYey8MbBnKBN5lwEPvyth1LU1i5twNBe8=
github.com/sunshineplan/imgconv v1.1.8/go.mod h1:CJj80bxNk7EjSuw68AsmuMVP7e7k3PH3ZrLgWwk+xX8=
github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg=
github.com/sunshineplan/imgconv v1.1.9 h1:hpLJ0pmgjH7AR8d+/q0rIdlBal/A/GCDq0q72XBwIEU=
github.com/sunshineplan/imgconv v1.1.9/go.mod h1:y6Xmcs7f9EBrhi9LcAHo8GjiPmQvxHIKG64gPzGN7I4=
github.com/sunshineplan/pdf v1.0.7 h1:62xlc079jh4tGLDjiihyyhwVFkn0IsxLyDpHplbG9Ew=
github.com/sunshineplan/pdf v1.0.7/go.mod h1:QsEmZCWBE3uFK8PCrM0pua1WDWLNU77YusiDEcY56OQ=
github.com/swaggo/echo-swagger v1.4.1 h1:Yf0uPaJWp1uRtDloZALyLnvdBeoEL5Kc7DtnjzO/TUk=
github.com/swaggo/echo-swagger v1.4.1/go.mod h1:C8bSi+9yH2FLZsnhqMZLIZddpUxZdBYuNHbtaS1Hljc=
github.com/swaggo/files/v2 v2.0.0 h1:hmAt8Dkynw7Ssz46F6pn8ok6YmGZqHSVLZ+HQM7i0kw=
github.com/swaggo/files/v2 v2.0.0/go.mod h1:24kk2Y9NYEJ5lHuCra6iVwkMjIekMCaFq/0JQj66kyM=
github.com/swaggo/swag v1.16.2 h1:28Pp+8DkQoV+HLzLx8RGJZXNGKbFqnuvSbAAtoxiY04=
github.com/swaggo/swag v1.16.2/go.mod h1:6YzXnDcpr0767iOejs318CwYkCQqyGer6BizOg03f+E=
github.com/swaggo/swag v1.16.3 h1:PnCYjPCah8FK4I26l2F/KQ4yz3sILcVUN3cTlBFA9Pg=
github.com/swaggo/swag v1.16.3/go.mod h1:DImHIuOFXKpMFAQjcC7FG4m3Dg4+QuUgUzJmKjI/gRk=
github.com/ulikunitz/xz v0.5.6/go.mod h1:2bypXElzHzzJZwzH67Y6wb67pO62Rzfn7BSiF4ABRW8=
github.com/ulikunitz/xz v0.5.10 h1:t92gobL9l3HE202wg3rlk19F6X+JOxl9BBrCCMYEYd8=
github.com/ulikunitz/xz v0.5.10/go.mod h1:nbz6k7qbPmH4IRqmfOplQw/tblSgqTqBwxkY0oWt/14=
@ -227,7 +225,6 @@ github.com/valyala/bytebufferpool v1.0.0/go.mod h1:6bBcMArwyJ5K/AmCkWv1jt77kVWyC
github.com/valyala/fasttemplate v1.0.1/go.mod h1:UQGH1tvbgY+Nz5t2n7tXsz52dQxojPUpymEIMZ47gx8=
github.com/valyala/fasttemplate v1.1.0/go.mod h1:UQGH1tvbgY+Nz5t2n7tXsz52dQxojPUpymEIMZ47gx8=
github.com/valyala/fasttemplate v1.1.1/go.mod h1:UQGH1tvbgY+Nz5t2n7tXsz52dQxojPUpymEIMZ47gx8=
github.com/valyala/fasttemplate v1.2.1/go.mod h1:KHLXt3tVN2HBp8eijSv/kGJopbvo7S+qRAEEKiv+SiQ=
github.com/valyala/fasttemplate v1.2.2 h1:lxLXG0uE3Qnshl9QyaK6XJxMXlQZELvChBOCmQD0Loo=
github.com/valyala/fasttemplate v1.2.2/go.mod h1:KHLXt3tVN2HBp8eijSv/kGJopbvo7S+qRAEEKiv+SiQ=
github.com/vmihailenco/bufpool v0.1.11/go.mod h1:AFf/MOy3l2CFTKbxwt0mp2MwnqjNEs5H/UxrkA5jxTQ=
@ -242,10 +239,10 @@ github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9dec
github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY=
go.mau.fi/libsignal v0.1.0 h1:vAKI/nJ5tMhdzke4cTK1fb0idJzz1JuEIpmjprueC+c=
go.mau.fi/libsignal v0.1.0/go.mod h1:R8ovrTezxtUNzCQE5PH30StOQWWeBskBsWE55vMfY9I=
go.mau.fi/util v0.2.0 h1:AMGBEdg9Ya/smb/09dljo9wBwKr432EpfjDWF7aFQg0=
go.mau.fi/util v0.2.0/go.mod h1:AxuJUMCxpzgJ5eV9JbPWKRH8aAJJidxetNdUj7qcb84=
go.mau.fi/whatsmeow v0.0.0-20231127175850-3c97433b4676 h1:YaFOVOdFJCSSByUT6WSgh65ChcVEDZN4QD7OTwaMw+k=
go.mau.fi/whatsmeow v0.0.0-20231127175850-3c97433b4676/go.mod h1:5xTtHNaZpGni6z6aE1iEopjW7wNgsKcolZxZrOujK9M=
go.mau.fi/util v0.4.1 h1:3EC9KxIXo5+h869zDGf5OOZklRd/FjeVnimTwtm3owg=
go.mau.fi/util v0.4.1/go.mod h1:GjkTEBsehYZbSh2LlE6cWEn+6ZIZTGrTMM/5DMNlmFY=
go.mau.fi/whatsmeow v0.0.0-20240316104858-18372a0653fa h1:ifQivrTMLAAkBkIqdE/D56uAZyc7ziRdhUU59VfNPFg=
go.mau.fi/whatsmeow v0.0.0-20240316104858-18372a0653fa/go.mod h1:kNI5foyzqd77d5HaWc1Jico6/rxtZ/UE8nr80hIsbIk=
go.opentelemetry.io/otel v0.5.0/go.mod h1:jzBIgIzK43Iu1BpDAXwqOd6UPsSAk+ewVZ5ofSXw4Ek=
go.opentelemetry.io/otel v0.6.0/go.mod h1:jzBIgIzK43Iu1BpDAXwqOd6UPsSAk+ewVZ5ofSXw4Ek=
go.opentelemetry.io/otel v0.7.0/go.mod h1:aZMyHG5TqDOXEgH2tyLiXSUKly1jT3yqE9PmrzIeCdo=
@ -255,19 +252,20 @@ golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8U
golang.org/x/crypto v0.0.0-20200221231518-2aa609cf4a9d/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc=
golang.org/x/crypto v0.15.0 h1:frVn1TEaCEaZcn3Tmd7Y2b5KKPaZ+I32Q2OA3kYp5TA=
golang.org/x/crypto v0.15.0/go.mod h1:4ChreQoLWfG3xLDer1WdlH5NdlQ3+mwnQq1YTKY+72g=
golang.org/x/crypto v0.21.0 h1:X31++rzVUdKhX5sWmSOFZxx8UW/ldWx55cbf08iNAMA=
golang.org/x/crypto v0.21.0/go.mod h1:0BP7YvVV9gBbVKyeTG0Gyn+gZm94bibOW5BjDEYAOMs=
golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
golang.org/x/image v0.0.0-20191009234506-e7c1f5e7dbb8/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0=
golang.org/x/image v0.0.0-20210628002857-a66eb6448b8d/go.mod h1:023OzeP/+EPmXeapQh35lcL3II3LrY8Ic+EFFKVhULM=
golang.org/x/image v0.14.0 h1:tNgSxAFe3jC4uYqvZdTr84SZoM1KfwdC9SKIFrLjFn4=
golang.org/x/image v0.14.0/go.mod h1:HUYqC05R2ZcZ3ejNQsIHQDQiwWM4JBqmm6MKANTp4LE=
golang.org/x/image v0.15.0 h1:kOELfmgrmJlw4Cdb7g/QGuB3CvDrXbqEIww/pNtNBm8=
golang.org/x/image v0.15.0/go.mod h1:HUYqC05R2ZcZ3ejNQsIHQDQiwWM4JBqmm6MKANTp4LE=
golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE=
golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU=
golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc=
golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4=
golang.org/x/mod v0.8.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs=
golang.org/x/mod v0.9.0 h1:KENHtAZL2y3NLMYZeHY9DW8HW8V+kQyJsY/V9JlKvCs=
golang.org/x/mod v0.9.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs=
golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
@ -286,11 +284,11 @@ golang.org/x/net v0.0.0-20200625001655-4c5254603344/go.mod h1:/O7V0waA8r7cgGh81R
golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU=
golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg=
golang.org/x/net v0.0.0-20210421230115-4e50805a0758/go.mod h1:72T/g9IO56b78aLF+1Kcs5dz7/ng1VjMUvfKvpfy+jM=
golang.org/x/net v0.0.0-20210916014120-12bc252f5db8/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y=
golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c=
golang.org/x/net v0.7.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs=
golang.org/x/net v0.17.0 h1:pVaXccu2ozPjCXewfr1S7xza/zcXTity9cCdXQYSjIM=
golang.org/x/net v0.17.0/go.mod h1:NxSsAGuq816PNPmqtQdLE42eU2Fs7NoRIZrHJAlaCOE=
golang.org/x/net v0.6.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs=
golang.org/x/net v0.9.0/go.mod h1:d48xBJpPfHeWQsugry2m+kC02ZBRGRgulfHnEXEuWns=
golang.org/x/net v0.21.0 h1:AQyQV4dYCvJ7vGmJyKki9+PBdyvhkSd8EIx/qb0AYv4=
golang.org/x/net v0.21.0/go.mod h1:bIjVDfnllIU7BJ2DNgfnXvpSvtn8VRwhlsaeUTyUS44=
golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U=
golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
@ -300,6 +298,7 @@ golang.org/x/sync v0.0.0-20200625203802-6e8e738ad208/go.mod h1:RxMgew5VJxzue5/jJ
golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.1.0 h1:wsuoTGHzEhffawBOhz5CYhcrV4IdKZbEyZjBMuTp12o=
golang.org/x/sync v0.1.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
@ -315,34 +314,34 @@ golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7w
golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20201126233918-771906719818/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20210420072515-93ed5bcd2bfe/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20210902050250-f475640dd07b/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20210927094055-39ccf1dd6fa6/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20211007075335-d3039528d8ac/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20211103235746-7861aae1554b/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.14.0 h1:Vz7Qs629MkJkGyHxUlRHizWJRG2j8fbQKjELVSNhy7Q=
golang.org/x/sys v0.14.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
golang.org/x/sys v0.7.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.12.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.18.0 h1:DBdB3niSjOA/O0blCZBqDefyWNYveAYMNF1Wum0DYQ4=
golang.org/x/sys v0.18.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8=
golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k=
golang.org/x/term v0.7.0/go.mod h1:P32HKFT3hSsZrRxla30E9HqToFYAQPCMs/zFMBUFqPY=
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk=
golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ=
golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8=
golang.org/x/text v0.9.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8=
golang.org/x/text v0.14.0 h1:ScX5w1eTa3QqT8oi6+ziP7dTV1S2+ALU0bI+0zXKWiQ=
golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU=
golang.org/x/time v0.3.0 h1:rg5rLMjNzMS1RkNLzCG38eapWhnYLFYXDXj2gOlr8j4=
golang.org/x/time v0.3.0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
golang.org/x/time v0.5.0 h1:o7cqy6amK/52YcAKIPlM3a+Fpj35zvRj2TP+e1xFSfk=
golang.org/x/time v0.5.0/go.mod h1:3BpzKBy/shNhVucY/MWOyx10tF3SFh9QdLuxbVysPQM=
golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY=
@ -353,6 +352,7 @@ golang.org/x/tools v0.0.0-20200425043458-8463f397d07c/go.mod h1:EkVYQZoAsY45+roY
golang.org/x/tools v0.0.0-20200519015757-0d0afa43d58a/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE=
golang.org/x/tools v0.0.0-20201124115921-2c860bdd6e78/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA=
golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc=
golang.org/x/tools v0.6.0/go.mod h1:Xwgl3UAJ/d3gWutnCtw505GrjyAbvKui8lOU390QaIU=
golang.org/x/tools v0.7.0 h1:W4OVu8VVOaIO0yzWMNdepAulS7YfoS3Zabrm8DOXXU4=
golang.org/x/tools v0.7.0/go.mod h1:4pg6aUX35JBAogB10C9AtvVL+qowtN4pT3CGSQex14s=
golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
@ -383,9 +383,8 @@ google.golang.org/protobuf v1.22.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2
google.golang.org/protobuf v1.23.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU=
google.golang.org/protobuf v1.23.1-0.20200526195155-81db48ad09cc/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU=
google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c=
google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw=
google.golang.org/protobuf v1.31.0 h1:g0LDEJHgrBl9N9r17Ru3sqWhkIx2NB67okBHPwC7hs8=
google.golang.org/protobuf v1.31.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I=
google.golang.org/protobuf v1.33.0 h1:uNO2rsAINq/JlFpSdYEKIZ0uKD/R9cpdv0T+yoGwGmI=
google.golang.org/protobuf v1.33.0/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
@ -400,9 +399,7 @@ gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY=
gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ=
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
gopkg.in/yaml.v3 v3.0.0-20200615113413-eeeca48fe776/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
lukechampine.com/uint128 v1.1.1 h1:pnxCASz787iMf+02ssImqk6OLt+Z5QHMoZyUXR4z6JU=

6
internal/route.go

@ -48,7 +48,10 @@ func Routes(e *echo.Echo) {
e.POST(router.BaseURL+"/logout", ctlWhatsApp.Logout, middleware.JWTWithConfig(authJWTConfig))
e.GET(router.BaseURL+"/registered", ctlWhatsApp.Registered, middleware.JWTWithConfig(authJWTConfig))
e.GET(router.BaseURL+"/group", ctlWhatsApp.GetGroup, middleware.JWTWithConfig(authJWTConfig))
e.POST(router.BaseURL+"/group", ctlWhatsApp.JoinGroup, middleware.JWTWithConfig(authJWTConfig))
e.DELETE(router.BaseURL+"/group", ctlWhatsApp.LeaveGroup, middleware.JWTWithConfig(authJWTConfig))
e.POST(router.BaseURL+"/send/text", ctlWhatsApp.SendText, middleware.JWTWithConfig(authJWTConfig))
e.POST(router.BaseURL+"/send/location", ctlWhatsApp.SendLocation, middleware.JWTWithConfig(authJWTConfig))
@ -59,4 +62,7 @@ func Routes(e *echo.Echo) {
e.POST(router.BaseURL+"/send/audio", ctlWhatsApp.SendAudio, middleware.JWTWithConfig(authJWTConfig))
e.POST(router.BaseURL+"/send/video", ctlWhatsApp.SendVideo, middleware.JWTWithConfig(authJWTConfig))
e.POST(router.BaseURL+"/send/sticker", ctlWhatsApp.SendSticker, middleware.JWTWithConfig(authJWTConfig))
e.POST(router.BaseURL+"/message", ctlWhatsApp.MessageUpdate, middleware.JWTWithConfig(authJWTConfig))
e.DELETE(router.BaseURL+"/message", ctlWhatsApp.MessageDelete, middleware.JWTWithConfig(authJWTConfig))
}

14
internal/whatsapp/types/request.go

@ -27,3 +27,17 @@ type RequestSendLink struct {
Caption string
URL string
}
type RequestMessage struct {
RJID string
MSGID string
Message string
}
type RequestGroupJoin struct {
Link string
}
type RequestGroupLeave struct {
GID string
}

155
internal/whatsapp/whatsapp.go

@ -184,7 +184,7 @@ func Registered(c echo.Context) error {
// GetGroup
// @Summary Get Joined Groups Information
// @Description Get Joined Groups Information from WhatsApp
// @Tags WhatsApp Information
// @Tags WhatsApp Group
// @Produce json
// @Success 200
// @Security BearerAuth
@ -193,7 +193,7 @@ func GetGroup(c echo.Context) error {
var err error
jid := jwtPayload(c).JID
group, err := pkgWhatsApp.WhatsAppGetGroup(jid)
group, err := pkgWhatsApp.WhatsAppGroupGet(jid)
if err != nil {
return router.ResponseInternalError(c, err.Error())
}
@ -201,10 +201,66 @@ func GetGroup(c echo.Context) error {
return router.ResponseSuccessWithData(c, "Successfully List Joined Groups", group)
}
// JoinGroup
// @Summary Join Group From Invitation Link
// @Description Joining to Group From Invitation Link from WhatsApp
// @Tags WhatsApp Group
// @Produce json
// @Param link formData string true "Group Invitation Link"
// @Success 200
// @Security BearerAuth
// @Router /group [post]
func JoinGroup(c echo.Context) error {
var err error
jid := jwtPayload(c).JID
var reqGroupJoin typWhatsApp.RequestGroupJoin
reqGroupJoin.Link = strings.TrimSpace(c.FormValue("link"))
if len(reqGroupJoin.Link) == 0 {
return router.ResponseBadRequest(c, "Missing Form Value Link")
}
group, err := pkgWhatsApp.WhatsAppGroupJoin(jid, reqGroupJoin.Link)
if err != nil {
return router.ResponseInternalError(c, err.Error())
}
return router.ResponseSuccessWithData(c, "Successfully Joined Group From Invitation Link", group)
}
// LeaveGroup
// @Summary Leave Group By Group ID
// @Description Leaving Group By Group ID from WhatsApp
// @Tags WhatsApp Group
// @Produce json
// @Param gid formData string true "Group ID"
// @Success 200
// @Security BearerAuth
// @Router /group [delete]
func LeaveGroup(c echo.Context) error {
var err error
jid := jwtPayload(c).JID
var reqGroupLeave typWhatsApp.RequestGroupLeave
reqGroupLeave.GID = strings.TrimSpace(c.FormValue("gid"))
if len(reqGroupLeave.GID) == 0 {
return router.ResponseBadRequest(c, "Missing Form Value GID")
}
err = pkgWhatsApp.WhatsAppGroupLeave(jid, reqGroupLeave.GID)
if err != nil {
return router.ResponseInternalError(c, err.Error())
}
return router.ResponseSuccess(c, "Successfully Leave Group By Group ID")
}
// SendText
// @Summary Send Text Message
// @Description Send Text Message to Spesific WhatsApp Personal ID or Group ID
// @Tags WhatsApp Message
// @Tags WhatsApp Send Message
// @Accept multipart/form-data
// @Produce json
// @Param msisdn formData string true "Destination WhatsApp Personal ID or Group ID"
@ -240,7 +296,7 @@ func SendText(c echo.Context) error {
// SendLocation
// @Summary Send Location Message
// @Description Send Location Message to Spesific WhatsApp Personal ID or Group ID
// @Tags WhatsApp Message
// @Tags WhatsApp Send Message
// @Accept multipart/form-data
// @Produce json
// @Param msisdn formData string true "Destination WhatsApp Personal ID or Group ID"
@ -282,7 +338,7 @@ func SendLocation(c echo.Context) error {
// SendContact
// @Summary Send Contact Message
// @Description Send Contact Message to Spesific WhatsApp Personal ID or Group ID
// @Tags WhatsApp Message
// @Tags WhatsApp Send Message
// @Accept multipart/form-data
// @Produce json
// @Param msisdn formData string true "Destination WhatsApp Personal ID or Group ID"
@ -324,7 +380,7 @@ func SendContact(c echo.Context) error {
// SendLink
// @Summary Send Link Message
// @Description Send Link Message to Spesific WhatsApp Personal ID or Group ID
// @Tags WhatsApp Message
// @Tags WhatsApp Send Message
// @Accept multipart/form-data
// @Produce json
// @Param msisdn formData string true "Destination WhatsApp Personal ID or Group ID"
@ -362,7 +418,7 @@ func SendLink(c echo.Context) error {
// SendDocument
// @Summary Send Document Message
// @Description Send Document Message to Spesific WhatsApp Personal ID or Group ID
// @Tags WhatsApp Message
// @Tags WhatsApp Send Message
// @Accept multipart/form-data
// @Produce json
// @Param msisdn formData string true "Destination WhatsApp Personal ID or Group ID"
@ -377,7 +433,7 @@ func SendDocument(c echo.Context) error {
// SendImage
// @Summary Send Image Message
// @Description Send Image Message to Spesific WhatsApp Personal ID or Group ID
// @Tags WhatsApp Message
// @Tags WhatsApp Send Message
// @Accept multipart/form-data
// @Produce json
// @Param msisdn formData string true "Destination WhatsApp Personal ID or Group ID"
@ -394,7 +450,7 @@ func SendImage(c echo.Context) error {
// SendAudio
// @Summary Send Audio Message
// @Description Send Audio Message to Spesific WhatsApp Personal ID or Group ID
// @Tags WhatsApp Message
// @Tags WhatsApp Send Message
// @Accept multipart/form-data
// @Produce json
// @Param msisdn formData string true "Destination WhatsApp Personal ID or Group ID"
@ -409,7 +465,7 @@ func SendAudio(c echo.Context) error {
// SendVideo
// @Summary Send Video Message
// @Description Send Video Message to Spesific WhatsApp Personal ID or Group ID
// @Tags WhatsApp Message
// @Tags WhatsApp Send Message
// @Accept multipart/form-data
// @Produce json
// @Param msisdn formData string true "Destination WhatsApp Personal ID or Group ID"
@ -426,7 +482,7 @@ func SendVideo(c echo.Context) error {
// SendSticker
// @Summary Send Sticker Message
// @Description Send Sticker Message to Spesific WhatsApp Personal ID or Group ID
// @Tags WhatsApp Message
// @Tags WhatsApp Send Message
// @Accept multipart/form-data
// @Produce json
// @Param msisdn formData string true "Destination WhatsApp Personal ID or Group ID"
@ -540,3 +596,80 @@ func sendMedia(c echo.Context, mediaType string) error {
return router.ResponseSuccessWithData(c, "Successfully Send Media Message", resSendMessage)
}
// MessageUpdate
// @Summary Update Message
// @Description Update Message to Spesific WhatsApp Personal ID or Group ID
// @Tags WhatsApp Message
// @Accept multipart/form-data
// @Produce json
// @Param msisdn formData string true "Destination WhatsApp Personal ID or Group ID"
// @Param messageid formData string true "Message ID"
// @Param message formData string true "Text Message"
// @Success 200
// @Security BearerAuth
// @Router /message [post]
func MessageUpdate(c echo.Context) error {
var err error
jid := jwtPayload(c).JID
var reqMessageUpdate typWhatsApp.RequestMessage
reqMessageUpdate.RJID = strings.TrimSpace(c.FormValue("msisdn"))
reqMessageUpdate.MSGID = strings.TrimSpace(c.FormValue("messageid"))
reqMessageUpdate.Message = strings.TrimSpace(c.FormValue("message"))
if len(reqMessageUpdate.RJID) == 0 {
return router.ResponseBadRequest(c, "Missing Form Value MSISDN")
}
if len(reqMessageUpdate.MSGID) == 0 {
return router.ResponseBadRequest(c, "Missing Form Value MessageID")
}
if len(reqMessageUpdate.Message) == 0 {
return router.ResponseBadRequest(c, "Missing Form Value Message")
}
var resSendMessage typWhatsApp.ResponseSendMessage
resSendMessage.MsgID, err = pkgWhatsApp.WhatsAppMessageUpdate(c.Request().Context(), jid, reqMessageUpdate.RJID, reqMessageUpdate.MSGID, reqMessageUpdate.Message)
if err != nil {
return router.ResponseInternalError(c, err.Error())
}
return router.ResponseSuccessWithData(c, "Successfully Update Message", resSendMessage)
}
// MessageDelete
// @Summary Delete Message
// @Description Delete Message to Spesific WhatsApp Personal ID or Group ID
// @Tags WhatsApp Message
// @Accept multipart/form-data
// @Produce json
// @Param msisdn formData string true "Destination WhatsApp Personal ID or Group ID"
// @Param messageid formData string true "Message ID"
// @Success 200
// @Security BearerAuth
// @Router /message [delete]
func MessageDelete(c echo.Context) error {
var err error
jid := jwtPayload(c).JID
var reqMessageUpdate typWhatsApp.RequestMessage
reqMessageUpdate.RJID = strings.TrimSpace(c.FormValue("msisdn"))
reqMessageUpdate.MSGID = strings.TrimSpace(c.FormValue("messageid"))
if len(reqMessageUpdate.RJID) == 0 {
return router.ResponseBadRequest(c, "Missing Form Value MSISDN")
}
if len(reqMessageUpdate.MSGID) == 0 {
return router.ResponseBadRequest(c, "Missing Form Value MessageID")
}
err = pkgWhatsApp.WhatsAppMessageDelete(c.Request().Context(), jid, reqMessageUpdate.RJID, reqMessageUpdate.MSGID)
if err != nil {
return router.ResponseInternalError(c, err.Error())
}
return router.ResponseSuccess(c, "Successfully Delete Message")
}

152
pkg/whatsapp/whatsapp.go

@ -72,11 +72,6 @@ func WhatsAppInitClient(device *store.Device, jid string) {
store.DeviceProps.Os = proto.String(WhatsAppGetUserOS())
store.DeviceProps.PlatformType = WhatsAppGetUserAgent("chrome").Enum()
store.DeviceProps.RequireFullSync = proto.Bool(false)
store.DeviceProps.HistorySyncConfig = &waproto.DeviceProps_HistorySyncConfig{
FullSyncDaysLimit: proto.Uint32(1),
FullSyncSizeMbLimit: proto.Uint32(10),
StorageQuotaMb: proto.Uint32(10),
}
// Set Client Versions
version.Major, err = env.GetEnvInt("WHATSAPP_VERSION_MAJOR")
@ -442,7 +437,7 @@ func WhatsAppSendText(ctx context.Context, jid string, rjid string, message stri
// Compose WhatsApp Proto
msgExtra := whatsmeow.SendRequestExtra{
ID: whatsmeow.GenerateMessageID(),
ID: WhatsAppClient[jid].GenerateMessageID(),
}
msgContent := &waproto.Message{
Conversation: proto.String(message),
@ -490,7 +485,7 @@ func WhatsAppSendLocation(ctx context.Context, jid string, rjid string, latitude
// Compose WhatsApp Proto
msgExtra := whatsmeow.SendRequestExtra{
ID: whatsmeow.GenerateMessageID(),
ID: WhatsAppClient[jid].GenerateMessageID(),
}
msgContent := &waproto.Message{
LocationMessage: &waproto.LocationMessage{
@ -547,7 +542,7 @@ func WhatsAppSendDocument(ctx context.Context, jid string, rjid string, fileByte
// Compose WhatsApp Proto
msgExtra := whatsmeow.SendRequestExtra{
ID: whatsmeow.GenerateMessageID(),
ID: WhatsAppClient[jid].GenerateMessageID(),
}
msgContent := &waproto.Message{
DocumentMessage: &waproto.DocumentMessage{
@ -684,7 +679,7 @@ func WhatsAppSendImage(ctx context.Context, jid string, rjid string, imageBytes
// Compose WhatsApp Proto
msgExtra := whatsmeow.SendRequestExtra{
ID: whatsmeow.GenerateMessageID(),
ID: WhatsAppClient[jid].GenerateMessageID(),
}
msgContent := &waproto.Message{
ImageMessage: &waproto.ImageMessage{
@ -748,7 +743,7 @@ func WhatsAppSendAudio(ctx context.Context, jid string, rjid string, audioBytes
// Compose WhatsApp Proto
msgExtra := whatsmeow.SendRequestExtra{
ID: whatsmeow.GenerateMessageID(),
ID: WhatsAppClient[jid].GenerateMessageID(),
}
msgContent := &waproto.Message{
AudioMessage: &waproto.AudioMessage{
@ -810,7 +805,7 @@ func WhatsAppSendVideo(ctx context.Context, jid string, rjid string, videoBytes
// Compose WhatsApp Proto
msgExtra := whatsmeow.SendRequestExtra{
ID: whatsmeow.GenerateMessageID(),
ID: WhatsAppClient[jid].GenerateMessageID(),
}
msgContent := &waproto.Message{
VideoMessage: &waproto.VideoMessage{
@ -868,7 +863,7 @@ func WhatsAppSendContact(ctx context.Context, jid string, rjid string, contactNa
// Compose WhatsApp Proto
msgExtra := whatsmeow.SendRequestExtra{
ID: whatsmeow.GenerateMessageID(),
ID: WhatsAppClient[jid].GenerateMessageID(),
}
msgVCard := fmt.Sprintf("BEGIN:VCARD\nVERSION:3.0\nN:;%v;;;\nFN:%v\nTEL;type=CELL;waid=%v:+%v\nEND:VCARD",
contactName, contactName, contactNumber, contactNumber)
@ -947,7 +942,7 @@ func WhatsAppSendLink(ctx context.Context, jid string, rjid string, linkCaption
// Compose WhatsApp Proto
msgExtra := whatsmeow.SendRequestExtra{
ID: whatsmeow.GenerateMessageID(),
ID: WhatsAppClient[jid].GenerateMessageID(),
}
msgText := linkURL
@ -1028,7 +1023,7 @@ func WhatsAppSendSticker(ctx context.Context, jid string, rjid string, stickerBy
// Compose WhatsApp Proto
msgExtra := whatsmeow.SendRequestExtra{
ID: whatsmeow.GenerateMessageID(),
ID: WhatsAppClient[jid].GenerateMessageID(),
}
msgContent := &waproto.Message{
StickerMessage: &waproto.StickerMessage{
@ -1055,7 +1050,92 @@ func WhatsAppSendSticker(ctx context.Context, jid string, rjid string, stickerBy
return "", errors.New("WhatsApp Client is not Valid")
}
func WhatsAppGetGroup(jid string) ([]types.GroupInfo, error) {
func WhatsAppMessageUpdate(ctx context.Context, jid string, rjid string, msgid string, message string) (string, error) {
if WhatsAppClient[jid] != nil {
var err error
// Make Sure WhatsApp Client is OK
err = WhatsAppIsClientOK(jid)
if err != nil {
return "", err
}
// Compose New Remote JID
remoteJID := WhatsAppComposeJID(rjid)
if remoteJID.Server != types.GroupServer {
// Validate JID if Remote JID is not Gorup JID
if WhatsAppGetJID(jid, remoteJID.String()).IsEmpty() {
return "", errors.New("WhatsApp Personal ID is Not Registered")
}
}
// Set Chat Presence
WhatsAppPresence(jid, true)
WhatsAppComposeStatus(jid, remoteJID, true, false)
defer func() {
WhatsAppComposeStatus(jid, remoteJID, false, false)
WhatsAppPresence(jid, false)
}()
// Compose WhatsApp Proto
msgContent := &waproto.Message{
Conversation: proto.String(message),
}
// Send WhatsApp Message Proto in Edit Mode
_, err = WhatsAppClient[jid].SendMessage(ctx, remoteJID, WhatsAppClient[jid].BuildEdit(remoteJID, msgid, msgContent))
if err != nil {
return "", err
}
return msgid, nil
}
// Return Error WhatsApp Client is not Valid
return "", errors.New("WhatsApp Client is not Valid")
}
func WhatsAppMessageDelete(ctx context.Context, jid string, rjid string, msgid string) error {
if WhatsAppClient[jid] != nil {
var err error
// Make Sure WhatsApp Client is OK
err = WhatsAppIsClientOK(jid)
if err != nil {
return err
}
// Compose New Remote JID
remoteJID := WhatsAppComposeJID(rjid)
if remoteJID.Server != types.GroupServer {
// Validate JID if Remote JID is not Gorup JID
if WhatsAppGetJID(jid, remoteJID.String()).IsEmpty() {
return errors.New("WhatsApp Personal ID is Not Registered")
}
}
// Set Chat Presence
WhatsAppPresence(jid, true)
WhatsAppComposeStatus(jid, remoteJID, true, false)
defer func() {
WhatsAppComposeStatus(jid, remoteJID, false, false)
WhatsAppPresence(jid, false)
}()
// Send WhatsApp Message Proto in Revoke Mode
_, err = WhatsAppClient[jid].SendMessage(ctx, remoteJID, WhatsAppClient[jid].BuildRevoke(remoteJID, types.EmptyJID, msgid))
if err != nil {
return err
}
return nil
}
// Return Error WhatsApp Client is not Valid
return errors.New("WhatsApp Client is not Valid")
}
func WhatsAppGroupGet(jid string) ([]types.GroupInfo, error) {
if WhatsAppClient[jid] != nil {
var err error
@ -1084,3 +1164,45 @@ func WhatsAppGetGroup(jid string) ([]types.GroupInfo, error) {
// Return Error WhatsApp Client is not Valid
return nil, errors.New("WhatsApp Client is not Valid")
}
func WhatsAppGroupJoin(jid string, link string) (string, error) {
if WhatsAppClient[jid] != nil {
var err error
// Make Sure WhatsApp Client is OK
err = WhatsAppIsClientOK(jid)
if err != nil {
return "", err
}
// Join Group By Invitation Link
gid, err := WhatsAppClient[jid].JoinGroupWithLink(link)
if err != nil {
return "", err
}
// Return Joined Group ID
return gid.String(), nil
}
// Return Error WhatsApp Client is not Valid
return "", errors.New("WhatsApp Client is not Valid")
}
func WhatsAppGroupLeave(jid string, gid string) error {
if WhatsAppClient[jid] != nil {
var err error
// Make Sure WhatsApp Client is OK
err = WhatsAppIsClientOK(jid)
if err != nil {
return err
}
// Leave Group By Group ID
return WhatsAppClient[jid].LeaveGroup(WhatsAppComposeJID(gid))
}
// Return Error WhatsApp Client is not Valid
return errors.New("WhatsApp Client is not Valid")
}
Loading…
Cancel
Save