-
+
- Name: {{ verified_name }} +
- JID: {{ jid }} +
- Name: {{ verified_name }}
- JID: {{ jid }}
-
-
- Name: {{ verified_name }} -
- JID: {{ jid }} -
diff --git a/docs/openapi.yaml b/docs/openapi.yaml index cdcd0ed..8aa44d6 100644 --- a/docs/openapi.yaml +++ b/docs/openapi.yaml @@ -1,7 +1,7 @@ openapi: "3.0.0" info: title: WhatsApp API MultiDevice - version: 5.1.0 + version: 5.1.2 description: This API is used for sending whatsapp via API servers: - url: http://localhost:3000 @@ -153,6 +153,38 @@ paths: application/json: schema: $ref: '#/components/schemas/ErrorInternalServer' + /user/check: + get: + operationId: userCheck + tags: + - user + summary: Check user is on whatsapp + parameters: + - name: phone + in: query + schema: + type: string + example: '6289685028129@s.whatsapp.net' + description: Phone number with country code + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/UserCheckResponse' + '400': + description: Bad Request + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorBadRequest' + '500': + description: Internal Server Error + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorInternalServer' /user/avatar: get: operationId: userAvatar @@ -1229,6 +1261,10 @@ paths: $ref: '#/components/schemas/ErrorInternalServer' components: + securitySchemes: + basicAuth: # <-- arbitrary name for the security scheme + type: http + scheme: basic schemas: CreateGroupResponse: type: object @@ -1370,6 +1406,34 @@ components: AD: type: boolean example: true + UserCheckResponse: + type: object + required: + - code + - message + - results + properties: + code: + type: string + example: SUCCESS + message: + type: string + example: Success + results: + type: object + properties: + is_in_whatsapp: + type: boolean + example: true + jid: + type: string + example: 554887954@s.whatsapp.net + verified_name: + type: string + example: Aldino Kemal + query: + type: string + example: 5549887954@s.whatsapp.net UserAvatarResponse: type: object properties: @@ -1768,4 +1832,6 @@ components: example: 0 AddRequest: type: string - example: null \ No newline at end of file + example: null +security: + - basicAuth: [] \ No newline at end of file diff --git a/readme.md b/readme.md index 7ead8a4..f344742 100644 --- a/readme.md +++ b/readme.md @@ -205,7 +205,7 @@ You can fork or edit this source code ! | Reaction Message |  | | Edit Message |  | | User Info |  | -| Check User |  | +| Check User |  | | User Avatar |  | | My Privacy |  | | My Group |  | diff --git a/src/config/settings.go b/src/config/settings.go index 4de0fd3..bf49b5a 100644 --- a/src/config/settings.go +++ b/src/config/settings.go @@ -5,7 +5,7 @@ import ( ) var ( - AppVersion = "v5.1.0" + AppVersion = "v5.1.2" AppPort = "3000" AppDebug = false AppOs = "AldinoKemal" diff --git a/src/go.sum b/src/go.sum index 99b6be9..7805d49 100644 --- a/src/go.sum +++ b/src/go.sum @@ -79,7 +79,6 @@ github.com/skip2/go-qrcode v0.0.0-20200617195104-da1b6568686e h1:MRM5ITcdelLK2j1 github.com/skip2/go-qrcode v0.0.0-20200617195104-da1b6568686e/go.mod h1:XV66xRDqSt+GTGFMVlhk3ULuV0y9ZmzeVGR4mloJI3M= github.com/spf13/cobra v1.8.1 h1:e5/vxKd/rZsfSJMUX1agtjeTDf+qv1/JdBF8gg5k9ZM= github.com/spf13/cobra v1.8.1/go.mod h1:wHxEcudfqmLYa8iTfL+OuZPbBZkmvliBWKIezN3kD9Y= -github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA= github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= github.com/spf13/pflag v1.0.6 h1:jFzHGLGAlb3ruxLB8MhbI6A8+AQX/2eW4qeyNZXNp2o= github.com/spf13/pflag v1.0.6/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= @@ -101,10 +100,6 @@ go.mau.fi/libsignal v0.1.1 h1:m/0PGBh4QKP/I1MQ44ti4C0fMbLMuHb95cmDw01FIpI= go.mau.fi/libsignal v0.1.1/go.mod h1:QLs89F/OA3ThdSL2Wz2p+o+fi8uuQUz0e1BRa6ExdBw= go.mau.fi/util v0.8.4 h1:mVKlJcXWfVo8ZW3f4vqtjGpqtZqJvX4ETekxawt2vnQ= go.mau.fi/util v0.8.4/go.mod h1:MOfGTs1CBuK6ERTcSL4lb5YU7/ujz09eOPVEDckuazY= -go.mau.fi/whatsmeow v0.0.0-20250104105216-918c879fcd19 h1:uVS+Zct5fF8rSXV9lfs87zoXdge0JXTzVGNkjmZ61UU= -go.mau.fi/whatsmeow v0.0.0-20250104105216-918c879fcd19/go.mod h1:TLzm2XkwgufONEmiVAsFny+9uBqyEZnUoPrQAfMyuSU= -go.mau.fi/whatsmeow v0.0.0-20250130221717-faf72d668860 h1:jQhAJJGC42rwZ562nz6V9SXBCVz+QhORusd0r9cxiww= -go.mau.fi/whatsmeow v0.0.0-20250130221717-faf72d668860/go.mod h1:PG1x7fBW66I9q/e8a9mU2qF9M94+kK32MceMWgxBoiw= go.mau.fi/whatsmeow v0.0.0-20250204095649-a75587ab11d7 h1:eLT0TKTpSeNcszoyasSylaxFCNU82XCP72DjbInFpzg= go.mau.fi/whatsmeow v0.0.0-20250204095649-a75587ab11d7/go.mod h1:PG1x7fBW66I9q/e8a9mU2qF9M94+kK32MceMWgxBoiw= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= @@ -116,8 +111,6 @@ golang.org/x/crypto v0.31.0/go.mod h1:kDsLvtWBEx7MV9tJOj9bnXsPbxwJQ6csT/x4KIN4Ss golang.org/x/crypto v0.32.0 h1:euUpcYgM8WcP71gNpTqQCn6rC2t6ULUPiOzfWaXVVfc= golang.org/x/crypto v0.32.0/go.mod h1:ZnnJkOaASj8g0AjIduWNlq2NRxL0PlBrbKVyZ6V/Ugc= golang.org/x/image v0.0.0-20191009234506-e7c1f5e7dbb8/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= -golang.org/x/image v0.23.0 h1:HseQ7c2OpPKTPVzNjG5fwJsOTCiiwS4QdsYi5XU6H68= -golang.org/x/image v0.23.0/go.mod h1:wJJBTdLfCCf3tiHa1fNxpZmUI4mmoZvwMCPP0ddoNKY= golang.org/x/image v0.24.0 h1:AN7zRgVsbvmTfNyqIbbOraYL8mSwcKncEj8ofjgzcMQ= golang.org/x/image v0.24.0/go.mod h1:4b/ITuLfqYq1hqZcjofwctIhi7sZh2WaCjvsBNjjya8= golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= @@ -157,8 +150,6 @@ golang.org/x/sys v0.12.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.17.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/sys v0.20.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/sys v0.28.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= -golang.org/x/sys v0.29.0 h1:TPYlXGxvx1MGTn2GiZDhnjPA9wZzZeGKHHmKhHYvgaU= -golang.org/x/sys v0.29.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/sys v0.30.0 h1:QjkSwP/36a20jFYWkSue1YwXzLmsV5Gfq7Eiy72C1uc= golang.org/x/sys v0.30.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/telemetry v0.0.0-20240228155512-f48c80bd79b2/go.mod h1:TeRTkGYfJXctD9OcfyVLyj2J3IxLnKwHJR8f4D8a3YE= @@ -186,8 +177,6 @@ golang.org/x/tools v0.6.0/go.mod h1:Xwgl3UAJ/d3gWutnCtw505GrjyAbvKui8lOU390QaIU= golang.org/x/tools v0.13.0/go.mod h1:HvlwmtVNQAhOuCjW7xxvovg8wbNq7LwfXh/k7wXUl58= golang.org/x/tools v0.21.1-0.20240508182429-e35e4ccd0d2d/go.mod h1:aiJjzUbINMkxbQROHiO6hDPo2LHcIPhhQsa9DLh0yGk= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -google.golang.org/protobuf v1.36.3 h1:82DV7MYdb8anAVi3qge1wSnMDrnKK7ebr+I0hHRN1BU= -google.golang.org/protobuf v1.36.3/go.mod h1:9fA7Ob0pmnwhb644+1+CVWFRbNajQ6iRojtC/QF5bRE= google.golang.org/protobuf v1.36.4 h1:6A3ZDJHn/eNqc1i+IdefRzy/9PokBTPvcqMySR7NNIM= google.golang.org/protobuf v1.36.4/go.mod h1:9fA7Ob0pmnwhb644+1+CVWFRbNajQ6iRojtC/QF5bRE= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= diff --git a/src/views/assets/app.css b/src/views/assets/app.css index f9ce165..e858708 100644 --- a/src/views/assets/app.css +++ b/src/views/assets/app.css @@ -83,6 +83,8 @@ body { to { transform: rotate(360deg); } } + + .main-header .ui.header { position: relative; z-index: 2; @@ -268,6 +270,11 @@ body { padding: 1.5em !important; } +.ui.modal > .close { + top: 0.5rem; + right: 0.5rem; +} + .ui.modal > .actions { border-radius: 0 0 20px 20px !important; background-color: rgba(248, 248, 248, 0.8) !important; diff --git a/src/views/components/AccountUserCheck.js b/src/views/components/AccountUserCheck.js index 5c3f7b8..d46a587 100644 --- a/src/views/components/AccountUserCheck.js +++ b/src/views/components/AccountUserCheck.js @@ -1,10 +1,5 @@ -import FormCheckUserRecipient from "./generic/FormCheckUserRecipient.js"; - export default { name: 'AccountUserCheck', - components: { - FormCheckUserRecipient - }, data() { return { type: window.TYPEUSER, @@ -26,14 +21,28 @@ export default { } }, methods: { - async openModal() { - this.handleReset(); - $('#modalUserCheck').modal('show'); + openModal() { + $('#modalUserCheck').modal({ + onApprove: function () { + return false; + } + }).modal('show'); + }, + isValidForm() { + if (!this.phone.trim()) { + return false; + } + + return true; }, async handleSubmit() { + if (!this.isValidForm() || this.loading) { + return; + } + try { - await this.submitApi(); - showSuccessInfo("Info fetched") + const response = await this.submitApi(); + showSuccessInfo(response); } catch (err) { showErrorInfo(err) } @@ -71,8 +80,9 @@ export default { } }, template: ` -