@rkitwork/whatsapp-ramukjar-cloud-sdk 1.1.0 → 1.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/helpers.d.ts +12 -16
- package/dist/helpers.js +36 -9
- package/package.json +1 -1
- package/src/helpers.ts +43 -9
package/dist/helpers.d.ts
CHANGED
|
@@ -1,39 +1,35 @@
|
|
|
1
|
+
import { TextMessage } from './payloads';
|
|
1
2
|
export declare const WhatsApp: {
|
|
2
|
-
text
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
body: string;
|
|
6
|
-
};
|
|
7
|
-
};
|
|
8
|
-
image: (link: string, caption?: string) => {
|
|
9
|
-
type: string;
|
|
3
|
+
text(body: string): TextMessage;
|
|
4
|
+
image(link: string, caption?: string): {
|
|
5
|
+
type: "image";
|
|
10
6
|
image: {
|
|
11
7
|
link: string;
|
|
12
8
|
caption: string | undefined;
|
|
13
9
|
};
|
|
14
10
|
};
|
|
15
|
-
video
|
|
16
|
-
type:
|
|
11
|
+
video(link: string, caption?: string): {
|
|
12
|
+
type: "video";
|
|
17
13
|
video: {
|
|
18
14
|
link: string;
|
|
19
15
|
caption: string | undefined;
|
|
20
16
|
};
|
|
21
17
|
};
|
|
22
|
-
audio
|
|
23
|
-
type:
|
|
18
|
+
audio(link: string): {
|
|
19
|
+
type: "audio";
|
|
24
20
|
audio: {
|
|
25
21
|
link: string;
|
|
26
22
|
};
|
|
27
23
|
};
|
|
28
|
-
document
|
|
29
|
-
type:
|
|
24
|
+
document(link: string, filename?: string): {
|
|
25
|
+
type: "document";
|
|
30
26
|
document: {
|
|
31
27
|
link: string;
|
|
32
28
|
filename: string | undefined;
|
|
33
29
|
};
|
|
34
30
|
};
|
|
35
|
-
location
|
|
36
|
-
type:
|
|
31
|
+
location(lat: number, lng: number, name?: string): {
|
|
32
|
+
type: "location";
|
|
37
33
|
location: {
|
|
38
34
|
latitude: number;
|
|
39
35
|
longitude: number;
|
package/dist/helpers.js
CHANGED
|
@@ -2,13 +2,40 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.WhatsApp = void 0;
|
|
4
4
|
exports.WhatsApp = {
|
|
5
|
-
text
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
5
|
+
text(body) {
|
|
6
|
+
return {
|
|
7
|
+
type: 'text',
|
|
8
|
+
text: { body },
|
|
9
|
+
};
|
|
10
|
+
},
|
|
11
|
+
image(link, caption) {
|
|
12
|
+
return {
|
|
13
|
+
type: 'image',
|
|
14
|
+
image: { link, caption },
|
|
15
|
+
};
|
|
16
|
+
},
|
|
17
|
+
video(link, caption) {
|
|
18
|
+
return {
|
|
19
|
+
type: 'video',
|
|
20
|
+
video: { link, caption },
|
|
21
|
+
};
|
|
22
|
+
},
|
|
23
|
+
audio(link) {
|
|
24
|
+
return {
|
|
25
|
+
type: 'audio',
|
|
26
|
+
audio: { link },
|
|
27
|
+
};
|
|
28
|
+
},
|
|
29
|
+
document(link, filename) {
|
|
30
|
+
return {
|
|
31
|
+
type: 'document',
|
|
32
|
+
document: { link, filename },
|
|
33
|
+
};
|
|
34
|
+
},
|
|
35
|
+
location(lat, lng, name) {
|
|
36
|
+
return {
|
|
37
|
+
type: 'location',
|
|
38
|
+
location: { latitude: lat, longitude: lng, name },
|
|
39
|
+
};
|
|
40
|
+
},
|
|
14
41
|
};
|
package/package.json
CHANGED
package/src/helpers.ts
CHANGED
|
@@ -1,11 +1,45 @@
|
|
|
1
|
+
import { TextMessage } from './payloads';
|
|
2
|
+
|
|
1
3
|
export const WhatsApp = {
|
|
2
|
-
text
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
4
|
+
text(body: string): TextMessage {
|
|
5
|
+
return {
|
|
6
|
+
type: 'text',
|
|
7
|
+
text: { body },
|
|
8
|
+
};
|
|
9
|
+
},
|
|
10
|
+
|
|
11
|
+
image(link: string, caption?: string) {
|
|
12
|
+
return {
|
|
13
|
+
type: 'image' as const,
|
|
14
|
+
image: { link, caption },
|
|
15
|
+
};
|
|
16
|
+
},
|
|
17
|
+
|
|
18
|
+
video(link: string, caption?: string) {
|
|
19
|
+
return {
|
|
20
|
+
type: 'video' as const,
|
|
21
|
+
video: { link, caption },
|
|
22
|
+
};
|
|
23
|
+
},
|
|
24
|
+
|
|
25
|
+
audio(link: string) {
|
|
26
|
+
return {
|
|
27
|
+
type: 'audio' as const,
|
|
28
|
+
audio: { link },
|
|
29
|
+
};
|
|
30
|
+
},
|
|
31
|
+
|
|
32
|
+
document(link: string, filename?: string) {
|
|
33
|
+
return {
|
|
34
|
+
type: 'document' as const,
|
|
35
|
+
document: { link, filename },
|
|
36
|
+
};
|
|
37
|
+
},
|
|
38
|
+
|
|
39
|
+
location(lat: number, lng: number, name?: string) {
|
|
40
|
+
return {
|
|
41
|
+
type: 'location' as const,
|
|
42
|
+
location: { latitude: lat, longitude: lng, name },
|
|
43
|
+
};
|
|
44
|
+
},
|
|
11
45
|
};
|