@pipedream/pidj 0.0.1 → 0.1.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/README.md
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
# Overview
|
|
2
|
+
|
|
3
|
+
The Pidj API allows users to manage and automate SMS communication directly through their platform. Integrating Pidj with Pipedream offers a powerful way to streamline communications, synchronize data across apps, and trigger SMS actions based on specific conditions. With Pipedream, you can effortlessly connect Pidj to other apps, creating sophisticated, multi-step workflows that react in real-time to events across your software stack.
|
|
4
|
+
|
|
5
|
+
# Example Use Cases
|
|
6
|
+
|
|
7
|
+
- **Customer Support Ticket Alert**: Trigger an SMS alert via Pidj whenever a high-priority support ticket is created in Zendesk. The workflow listens for new Zendesk tickets, filters for priority level, and sends an SMS to the assigned support agent, ensuring immediate attention.
|
|
8
|
+
|
|
9
|
+
- **E-commerce Order Confirmation**: Send an order confirmation SMS through Pidj when a customer completes a purchase on Shopify. This workflow activates on a new Shopify order event, extracts customer details, and sends a personalized SMS confirmation, enhancing the customer experience.
|
|
10
|
+
|
|
11
|
+
- **Appointment Reminder System**: Automatically send appointment reminders to clients a day before their scheduled time, using Pidj to dispatch the messages. This workflow can be triggered by calendar events from Google Calendar, fetching appointment details and sending timely SMS reminders to minimize no-shows.
|
|
@@ -0,0 +1,172 @@
|
|
|
1
|
+
import { TIMEZONE_OPTIONS } from "../../common/constants.mjs";
|
|
2
|
+
import pidj from "../../pidj.app.mjs";
|
|
3
|
+
|
|
4
|
+
export default {
|
|
5
|
+
key: "pidj-create-contact",
|
|
6
|
+
name: "Create Contact",
|
|
7
|
+
description: "Initiates a process to add a new contact to your Pidj account. [See the documentation](https://pidj.co/wp-content/uploads/2023/06/Pidj-API-Technical-Document-v3-1.pdf).",
|
|
8
|
+
version: "0.0.1",
|
|
9
|
+
type: "action",
|
|
10
|
+
props: {
|
|
11
|
+
pidj,
|
|
12
|
+
phoneNumber: {
|
|
13
|
+
type: "string",
|
|
14
|
+
label: "Phone Number",
|
|
15
|
+
description: "Phone number for the contact. This must be in E.164 format. **e.g., +18885552222**",
|
|
16
|
+
},
|
|
17
|
+
emailAddress: {
|
|
18
|
+
type: "string",
|
|
19
|
+
label: "Email Address",
|
|
20
|
+
description: "The contact's email address.",
|
|
21
|
+
optional: true,
|
|
22
|
+
},
|
|
23
|
+
firstName: {
|
|
24
|
+
type: "string",
|
|
25
|
+
label: "First Name",
|
|
26
|
+
description: "The contact's first name.",
|
|
27
|
+
optional: true,
|
|
28
|
+
},
|
|
29
|
+
lastName: {
|
|
30
|
+
type: "string",
|
|
31
|
+
label: "Last Name",
|
|
32
|
+
description: "The contact's last name.",
|
|
33
|
+
optional: true,
|
|
34
|
+
},
|
|
35
|
+
businessName: {
|
|
36
|
+
type: "string",
|
|
37
|
+
label: "Business Name",
|
|
38
|
+
description: "The contact's business name.",
|
|
39
|
+
optional: true,
|
|
40
|
+
},
|
|
41
|
+
displayName: {
|
|
42
|
+
type: "string",
|
|
43
|
+
label: "Display Name",
|
|
44
|
+
description: "The contact's display name, if present, and different from first and last name.",
|
|
45
|
+
optional: true,
|
|
46
|
+
},
|
|
47
|
+
groupId: {
|
|
48
|
+
propDefinition: [
|
|
49
|
+
pidj,
|
|
50
|
+
"groupId",
|
|
51
|
+
],
|
|
52
|
+
optional: true,
|
|
53
|
+
},
|
|
54
|
+
timezone: {
|
|
55
|
+
type: "string",
|
|
56
|
+
label: "Timezone",
|
|
57
|
+
description: "Timezone identifier for the contact. If omitted, this will default to the account value.",
|
|
58
|
+
options: TIMEZONE_OPTIONS,
|
|
59
|
+
optional: true,
|
|
60
|
+
},
|
|
61
|
+
externalId: {
|
|
62
|
+
type: "string",
|
|
63
|
+
label: "External Id",
|
|
64
|
+
description: "The external ID of the contact from your own system. This may be used in any enabled integrations to cross-identify the contact record.",
|
|
65
|
+
optional: true,
|
|
66
|
+
},
|
|
67
|
+
homeAddressStreet1: {
|
|
68
|
+
type: "string",
|
|
69
|
+
label: "Home Street 1",
|
|
70
|
+
description: "The home street address 1.",
|
|
71
|
+
optional: true,
|
|
72
|
+
},
|
|
73
|
+
homeAddressStreet2: {
|
|
74
|
+
type: "string",
|
|
75
|
+
label: "Home Street 2",
|
|
76
|
+
description: "The home street address 2.",
|
|
77
|
+
optional: true,
|
|
78
|
+
},
|
|
79
|
+
homeAddressCity: {
|
|
80
|
+
type: "string",
|
|
81
|
+
label: "Home City",
|
|
82
|
+
description: "The home city address.",
|
|
83
|
+
optional: true,
|
|
84
|
+
},
|
|
85
|
+
homeAddressState: {
|
|
86
|
+
type: "string",
|
|
87
|
+
label: "Home State",
|
|
88
|
+
description: "The home state address. Must be the standard 2 character abbreviation (**ANSI2-letter** or **USPS**). Any other values will be discarded. [See further information](https://en.wikipedia.org/wiki/List_of_U.S._state_abbreviations).",
|
|
89
|
+
optional: true,
|
|
90
|
+
},
|
|
91
|
+
homeAddressPostal: {
|
|
92
|
+
type: "string",
|
|
93
|
+
label: "Home Postal",
|
|
94
|
+
description: "Valid 5 or 10 digit zipcode (US addresses). British, Canadian, and Australian postal codes also supported.",
|
|
95
|
+
optional: true,
|
|
96
|
+
},
|
|
97
|
+
homeAddressCountry: {
|
|
98
|
+
type: "string",
|
|
99
|
+
label: "Home Country",
|
|
100
|
+
description: "Must be either **ISO 3166-1 alpha-2** or **ISO 3166-1 alpha-3**. Any other values will be discarded. [See further information](https://en.wikipedia.org/wiki/ISO_3166-1).",
|
|
101
|
+
optional: true,
|
|
102
|
+
},
|
|
103
|
+
businessAddressStreet1: {
|
|
104
|
+
type: "string",
|
|
105
|
+
label: "Business Street 1",
|
|
106
|
+
description: "The business street address 1.",
|
|
107
|
+
optional: true,
|
|
108
|
+
},
|
|
109
|
+
businessAddressStreet2: {
|
|
110
|
+
type: "string",
|
|
111
|
+
label: "Business Street 2",
|
|
112
|
+
description: "The business street address 2.",
|
|
113
|
+
optional: true,
|
|
114
|
+
},
|
|
115
|
+
businessAddressCity: {
|
|
116
|
+
type: "string",
|
|
117
|
+
label: "Business City",
|
|
118
|
+
description: "The business city address.",
|
|
119
|
+
optional: true,
|
|
120
|
+
},
|
|
121
|
+
businessAddressState: {
|
|
122
|
+
type: "string",
|
|
123
|
+
label: "Business State",
|
|
124
|
+
description: "The business state address. Must be the standard 2 character abbreviation (**ANSI2-letter** or **USPS**). Any other values will be discarded. [See further information](https://en.wikipedia.org/wiki/List_of_U.S._state_abbreviations).",
|
|
125
|
+
optional: true,
|
|
126
|
+
},
|
|
127
|
+
businessAddressPostal: {
|
|
128
|
+
type: "string",
|
|
129
|
+
label: "Business Postal",
|
|
130
|
+
description: "Valid 5 or 10 digit zipcode (US addresses). British, Canadian, and Australian postal codes also supported.",
|
|
131
|
+
optional: true,
|
|
132
|
+
},
|
|
133
|
+
businessAddressCountry: {
|
|
134
|
+
type: "string",
|
|
135
|
+
label: "Business Country",
|
|
136
|
+
description: "Must be either **ISO 3166-1 alpha-2** or **ISO 3166-1 alpha-3**. Any other values will be discarded. [See further information](https://en.wikipedia.org/wiki/ISO_3166-1).",
|
|
137
|
+
optional: true,
|
|
138
|
+
},
|
|
139
|
+
},
|
|
140
|
+
async run({ $ }) {
|
|
141
|
+
const response = await this.pidj.addContact({
|
|
142
|
+
$,
|
|
143
|
+
data: {
|
|
144
|
+
phone_number: this.phoneNumber,
|
|
145
|
+
email_address: this.emailAddress,
|
|
146
|
+
first_name: this.firstName,
|
|
147
|
+
last_name: this.lastName,
|
|
148
|
+
business_name: this.businessName,
|
|
149
|
+
display_name: this.displayName,
|
|
150
|
+
group: this.groupId,
|
|
151
|
+
timezone: this.timezone,
|
|
152
|
+
external_id: this.externalId,
|
|
153
|
+
addresses: {
|
|
154
|
+
home_street_1: this.homeAddressStreet1,
|
|
155
|
+
home_street_2: this.homeAddressStreet2,
|
|
156
|
+
home_city: this.homeAddressCity,
|
|
157
|
+
home_state: this.homeAddressState,
|
|
158
|
+
home_postal: this.homeAddressPostal,
|
|
159
|
+
home_country: this.homeAddressCountry,
|
|
160
|
+
business_street_1: this.businessAddressStreet1,
|
|
161
|
+
business_street_2: this.businessAddressStreet2,
|
|
162
|
+
business_city: this.businessAddressCity,
|
|
163
|
+
business_state: this.businessAddressState,
|
|
164
|
+
business_postal: this.businessAddressPostal,
|
|
165
|
+
business_country: this.businessAddressCountry,
|
|
166
|
+
},
|
|
167
|
+
},
|
|
168
|
+
});
|
|
169
|
+
$.export("$summary", `Successfully added a new contact with Id: ${response.id}`);
|
|
170
|
+
return response;
|
|
171
|
+
},
|
|
172
|
+
};
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { ConfigurationError } from "@pipedream/platform";
|
|
2
|
+
import pidj from "../../pidj.app.mjs";
|
|
3
|
+
|
|
4
|
+
export default {
|
|
5
|
+
key: "pidj-initiate-survey",
|
|
6
|
+
name: "Initiate Survey",
|
|
7
|
+
description: "Triggers a pre-configured text survey to a specific contact. Requires the contact's information and the survey ID. [See the documentation](https://pidj.co/wp-content/uploads/2023/06/Pidj-API-Technical-Document-v3-1.pdf).",
|
|
8
|
+
version: "0.0.1",
|
|
9
|
+
type: "action",
|
|
10
|
+
props: {
|
|
11
|
+
pidj,
|
|
12
|
+
surveyId: {
|
|
13
|
+
propDefinition: [
|
|
14
|
+
pidj,
|
|
15
|
+
"surveyId",
|
|
16
|
+
],
|
|
17
|
+
},
|
|
18
|
+
contactId: {
|
|
19
|
+
propDefinition: [
|
|
20
|
+
pidj,
|
|
21
|
+
"contactId",
|
|
22
|
+
],
|
|
23
|
+
},
|
|
24
|
+
fromNumber: {
|
|
25
|
+
propDefinition: [
|
|
26
|
+
pidj,
|
|
27
|
+
"fromNumber",
|
|
28
|
+
],
|
|
29
|
+
optional: true,
|
|
30
|
+
},
|
|
31
|
+
groupId: {
|
|
32
|
+
propDefinition: [
|
|
33
|
+
pidj,
|
|
34
|
+
"groupId",
|
|
35
|
+
],
|
|
36
|
+
optional: true,
|
|
37
|
+
},
|
|
38
|
+
},
|
|
39
|
+
async run({ $ }) {
|
|
40
|
+
if ((!this.fromNumber && !this.groupId) || (this.fromNumber && this.groupId)) {
|
|
41
|
+
throw new ConfigurationError("You must provide either From Number or Group Id.");
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
const response = await this.pidj.triggerSurvey({
|
|
45
|
+
$,
|
|
46
|
+
data: {
|
|
47
|
+
survey_id: this.surveyId,
|
|
48
|
+
contact_id: this.contactId,
|
|
49
|
+
from_number: this.fromNumber,
|
|
50
|
+
group_id: this.groupId,
|
|
51
|
+
},
|
|
52
|
+
});
|
|
53
|
+
|
|
54
|
+
$.export("$summary", `Successfully initiated survey for contact ${this.contactId}`);
|
|
55
|
+
return response;
|
|
56
|
+
},
|
|
57
|
+
};
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { ConfigurationError } from "@pipedream/platform";
|
|
2
|
+
import pidj from "../../pidj.app.mjs";
|
|
3
|
+
|
|
4
|
+
export default {
|
|
5
|
+
key: "pidj-send-message",
|
|
6
|
+
name: "Send Message",
|
|
7
|
+
description: "Sends a text message to a specified phone number from your pidj account. [See the documentation](https://pidj.co/wp-content/uploads/2023/06/Pidj-API-Technical-Document-v3-1.pdf).",
|
|
8
|
+
version: "0.0.1",
|
|
9
|
+
type: "action",
|
|
10
|
+
props: {
|
|
11
|
+
pidj,
|
|
12
|
+
groupId: {
|
|
13
|
+
propDefinition: [
|
|
14
|
+
pidj,
|
|
15
|
+
"groupId",
|
|
16
|
+
],
|
|
17
|
+
},
|
|
18
|
+
toNumber: {
|
|
19
|
+
propDefinition: [
|
|
20
|
+
pidj,
|
|
21
|
+
"toNumber",
|
|
22
|
+
],
|
|
23
|
+
},
|
|
24
|
+
textBody: {
|
|
25
|
+
type: "string",
|
|
26
|
+
label: "Text Body",
|
|
27
|
+
description: "The text to send. Message lengths greater than 1,600 characters will be truncated. Messages with emoji and special characters may have a smaller limit due to encoding requirements. [See Pidj FAQ for details](https://pidjco.gopidj.com/faq).",
|
|
28
|
+
},
|
|
29
|
+
},
|
|
30
|
+
async run({ $ }) {
|
|
31
|
+
const response = await this.pidj.sendMessage({
|
|
32
|
+
$,
|
|
33
|
+
data: {
|
|
34
|
+
group_id: this.groupId,
|
|
35
|
+
to_number: this.toNumber,
|
|
36
|
+
text_body: this.textBody,
|
|
37
|
+
},
|
|
38
|
+
});
|
|
39
|
+
if (response.status != "success") throw new ConfigurationError(response.message);
|
|
40
|
+
|
|
41
|
+
$.export("$summary", `Message successfully sent to ${this.toNumber}`);
|
|
42
|
+
return response;
|
|
43
|
+
},
|
|
44
|
+
};
|
|
@@ -0,0 +1,599 @@
|
|
|
1
|
+
export const TIMEZONE_OPTIONS = [
|
|
2
|
+
"Africa/Abidjan",
|
|
3
|
+
"Africa/Accra",
|
|
4
|
+
"Africa/Addis_Ababa",
|
|
5
|
+
"Africa/Algiers",
|
|
6
|
+
"Africa/Asmara",
|
|
7
|
+
"Africa/Asmera",
|
|
8
|
+
"Africa/Bamako",
|
|
9
|
+
"Africa/Bangui",
|
|
10
|
+
"Africa/Banjul",
|
|
11
|
+
"Africa/Bissau",
|
|
12
|
+
"Africa/Blantyre",
|
|
13
|
+
"Africa/Brazzaville",
|
|
14
|
+
"Africa/Bujumbura",
|
|
15
|
+
"Africa/Cairo",
|
|
16
|
+
"Africa/Casablanca",
|
|
17
|
+
"Africa/Ceuta",
|
|
18
|
+
"Africa/Conakry",
|
|
19
|
+
"Africa/Dakar",
|
|
20
|
+
"Africa/Dar_es_Salaam",
|
|
21
|
+
"Africa/Djibouti",
|
|
22
|
+
"Africa/Douala",
|
|
23
|
+
"Africa/El_Aaiun",
|
|
24
|
+
"Africa/Freetown",
|
|
25
|
+
"Africa/Gaborone",
|
|
26
|
+
"Africa/Harare",
|
|
27
|
+
"Africa/Johannesburg",
|
|
28
|
+
"Africa/Juba",
|
|
29
|
+
"Africa/Kampala",
|
|
30
|
+
"Africa/Khartoum",
|
|
31
|
+
"Africa/Kigali",
|
|
32
|
+
"Africa/Kinshasa",
|
|
33
|
+
"Africa/Lagos",
|
|
34
|
+
"Africa/Libreville",
|
|
35
|
+
"Africa/Lome",
|
|
36
|
+
"Africa/Luanda",
|
|
37
|
+
"Africa/Lubumbashi",
|
|
38
|
+
"Africa/Lusaka",
|
|
39
|
+
"Africa/Malabo",
|
|
40
|
+
"Africa/Maputo",
|
|
41
|
+
"Africa/Maseru",
|
|
42
|
+
"Africa/Mbabane",
|
|
43
|
+
"Africa/Mogadishu",
|
|
44
|
+
"Africa/Monrovia",
|
|
45
|
+
"Africa/Nairobi",
|
|
46
|
+
"Africa/Ndjamena",
|
|
47
|
+
"Africa/Niamey",
|
|
48
|
+
"Africa/Nouakchott",
|
|
49
|
+
"Africa/Ouagadougou",
|
|
50
|
+
"Africa/Porto-Novo",
|
|
51
|
+
"Africa/Sao_Tome",
|
|
52
|
+
"Africa/Timbuktu",
|
|
53
|
+
"Africa/Tripoli",
|
|
54
|
+
"Africa/Tunis",
|
|
55
|
+
"Africa/Windhoek",
|
|
56
|
+
"America/Adak",
|
|
57
|
+
"America/Anchorage",
|
|
58
|
+
"America/Anguilla",
|
|
59
|
+
"America/Antigua",
|
|
60
|
+
"America/Araguaina",
|
|
61
|
+
"America/Argentina/Buenos_Aires",
|
|
62
|
+
"America/Argentina/Catamarca",
|
|
63
|
+
"America/Argentina/ComodRivadavia",
|
|
64
|
+
"America/Argentina/Cordoba",
|
|
65
|
+
"America/Argentina/Jujuy",
|
|
66
|
+
"America/Argentina/La_Rioja",
|
|
67
|
+
"America/Argentina/Mendoza",
|
|
68
|
+
"America/Argentina/Rio_Gallegos",
|
|
69
|
+
"America/Argentina/Salta",
|
|
70
|
+
"America/Argentina/San_Juan",
|
|
71
|
+
"America/Argentina/San_Luis",
|
|
72
|
+
"America/Argentina/Tucuman",
|
|
73
|
+
"America/Argentina/Ushuaia",
|
|
74
|
+
"America/Aruba",
|
|
75
|
+
"America/Asuncion",
|
|
76
|
+
"America/Atikokan",
|
|
77
|
+
"America/Atka",
|
|
78
|
+
"America/Bahia",
|
|
79
|
+
"America/Bahia_Banderas",
|
|
80
|
+
"America/Barbados",
|
|
81
|
+
"America/Belem",
|
|
82
|
+
"America/Belize",
|
|
83
|
+
"America/Blanc-Sablon",
|
|
84
|
+
"America/Boa_Vista",
|
|
85
|
+
"America/Bogota",
|
|
86
|
+
"America/Boise",
|
|
87
|
+
"America/Buenos_Aires",
|
|
88
|
+
"America/Cambridge_Bay",
|
|
89
|
+
"America/Campo_Grande",
|
|
90
|
+
"America/Cancun",
|
|
91
|
+
"America/Caracas",
|
|
92
|
+
"America/Catamarca",
|
|
93
|
+
"America/Cayenne",
|
|
94
|
+
"America/Cayman",
|
|
95
|
+
"America/Chicago",
|
|
96
|
+
"America/Chihuahua",
|
|
97
|
+
"America/Ciudad_Juarez",
|
|
98
|
+
"America/Coral_Harbour",
|
|
99
|
+
"America/Cordoba",
|
|
100
|
+
"America/Costa_Rica",
|
|
101
|
+
"America/Creston",
|
|
102
|
+
"America/Cuiaba",
|
|
103
|
+
"America/Curacao",
|
|
104
|
+
"America/Danmarkshavn",
|
|
105
|
+
"America/Dawson",
|
|
106
|
+
"America/Dawson_Creek",
|
|
107
|
+
"America/Denver",
|
|
108
|
+
"America/Detroit",
|
|
109
|
+
"America/Dominica",
|
|
110
|
+
"America/Edmonton",
|
|
111
|
+
"America/Eirunepe",
|
|
112
|
+
"America/El_Salvador",
|
|
113
|
+
"America/Ensenada",
|
|
114
|
+
"America/Fort_Nelson",
|
|
115
|
+
"America/Fort_Wayne",
|
|
116
|
+
"America/Fortaleza",
|
|
117
|
+
"America/Glace_Bay",
|
|
118
|
+
"America/Godthab",
|
|
119
|
+
"America/Goose_Bay",
|
|
120
|
+
"America/Grand_Turk",
|
|
121
|
+
"America/Grenada",
|
|
122
|
+
"America/Guadeloupe",
|
|
123
|
+
"America/Guatemala",
|
|
124
|
+
"America/Guayaquil",
|
|
125
|
+
"America/Guyana",
|
|
126
|
+
"America/Halifax",
|
|
127
|
+
"America/Havana",
|
|
128
|
+
"America/Hermosillo",
|
|
129
|
+
"America/Indiana/Indianapolis",
|
|
130
|
+
"America/Indiana/Knox",
|
|
131
|
+
"America/Indiana/Marengo",
|
|
132
|
+
"America/Indiana/Petersburg",
|
|
133
|
+
"America/Indiana/Tell_City",
|
|
134
|
+
"America/Indiana/Vevay",
|
|
135
|
+
"America/Indiana/Vincennes",
|
|
136
|
+
"America/Indiana/Winamac",
|
|
137
|
+
"America/Indianapolis",
|
|
138
|
+
"America/Inuvik",
|
|
139
|
+
"America/Iqaluit",
|
|
140
|
+
"America/Jamaica",
|
|
141
|
+
"America/Jujuy",
|
|
142
|
+
"America/Juneau",
|
|
143
|
+
"America/Kentucky/Louisville",
|
|
144
|
+
"America/Kentucky/Monticello",
|
|
145
|
+
"America/Knox_IN",
|
|
146
|
+
"America/Kralendijk",
|
|
147
|
+
"America/La_Paz",
|
|
148
|
+
"America/Lima",
|
|
149
|
+
"America/Los_Angeles",
|
|
150
|
+
"America/Louisville",
|
|
151
|
+
"America/Lower_Princes",
|
|
152
|
+
"America/Maceio",
|
|
153
|
+
"America/Managua",
|
|
154
|
+
"America/Manaus",
|
|
155
|
+
"America/Marigot",
|
|
156
|
+
"America/Martinique",
|
|
157
|
+
"America/Matamoros",
|
|
158
|
+
"America/Mazatlan",
|
|
159
|
+
"America/Mendoza",
|
|
160
|
+
"America/Menominee",
|
|
161
|
+
"America/Merida",
|
|
162
|
+
"America/Metlakatla",
|
|
163
|
+
"America/Mexico_City",
|
|
164
|
+
"America/Miquelon",
|
|
165
|
+
"America/Moncton",
|
|
166
|
+
"America/Monterrey",
|
|
167
|
+
"America/Montevideo",
|
|
168
|
+
"America/Montreal",
|
|
169
|
+
"America/Montserrat",
|
|
170
|
+
"America/Nassau",
|
|
171
|
+
"America/New_York",
|
|
172
|
+
"America/Nipigon",
|
|
173
|
+
"America/Nome",
|
|
174
|
+
"America/Noronha",
|
|
175
|
+
"America/North_Dakota/Beulah",
|
|
176
|
+
"America/North_Dakota/Center",
|
|
177
|
+
"America/North_Dakota/New_Salem",
|
|
178
|
+
"America/Nuuk",
|
|
179
|
+
"America/Ojinaga",
|
|
180
|
+
"America/Panama",
|
|
181
|
+
"America/Pangnirtung",
|
|
182
|
+
"America/Paramaribo",
|
|
183
|
+
"America/Phoenix",
|
|
184
|
+
"America/Port-au-Prince",
|
|
185
|
+
"America/Port_of_Spain",
|
|
186
|
+
"America/Porto_Acre",
|
|
187
|
+
"America/Porto_Velho",
|
|
188
|
+
"America/Puerto_Rico",
|
|
189
|
+
"America/Punta_Arenas",
|
|
190
|
+
"America/Rainy_River",
|
|
191
|
+
"America/Rankin_Inlet",
|
|
192
|
+
"America/Recife",
|
|
193
|
+
"America/Regina",
|
|
194
|
+
"America/Resolute",
|
|
195
|
+
"America/Rio_Branco",
|
|
196
|
+
"America/Rosario",
|
|
197
|
+
"America/Santa_Isabel",
|
|
198
|
+
"America/Santarem",
|
|
199
|
+
"America/Santiago",
|
|
200
|
+
"America/Santo_Domingo",
|
|
201
|
+
"America/Sao_Paulo",
|
|
202
|
+
"America/Scoresbysund",
|
|
203
|
+
"America/Shiprock",
|
|
204
|
+
"America/Sitka",
|
|
205
|
+
"America/St_Barthelemy",
|
|
206
|
+
"America/St_Johns",
|
|
207
|
+
"America/St_Kitts",
|
|
208
|
+
"America/St_Lucia",
|
|
209
|
+
"America/St_Thomas",
|
|
210
|
+
"America/St_Vincent",
|
|
211
|
+
"America/Swift_Current",
|
|
212
|
+
"America/Tegucigalpa",
|
|
213
|
+
"America/Thule",
|
|
214
|
+
"America/Thunder_Bay",
|
|
215
|
+
"America/Tijuana",
|
|
216
|
+
"America/Toronto",
|
|
217
|
+
"America/Tortola",
|
|
218
|
+
"America/Vancouver",
|
|
219
|
+
"America/Virgin",
|
|
220
|
+
"America/Whitehorse",
|
|
221
|
+
"America/Winnipeg",
|
|
222
|
+
"America/Yakutat",
|
|
223
|
+
"America/Yellowknife",
|
|
224
|
+
"Antarctica/Casey",
|
|
225
|
+
"Antarctica/Davis",
|
|
226
|
+
"Antarctica/DumontDUrville",
|
|
227
|
+
"Antarctica/Macquarie",
|
|
228
|
+
"Antarctica/Mawson",
|
|
229
|
+
"Antarctica/McMurdo",
|
|
230
|
+
"Antarctica/Palmer",
|
|
231
|
+
"Antarctica/Rothera",
|
|
232
|
+
"Antarctica/South_Pole",
|
|
233
|
+
"Antarctica/Syowa",
|
|
234
|
+
"Antarctica/Troll",
|
|
235
|
+
"Antarctica/Vostok",
|
|
236
|
+
"Arctic/Longyearbyen",
|
|
237
|
+
"Asia/Aden",
|
|
238
|
+
"Asia/Almaty",
|
|
239
|
+
"Asia/Amman",
|
|
240
|
+
"Asia/Anadyr",
|
|
241
|
+
"Asia/Aqtau",
|
|
242
|
+
"Asia/Aqtobe",
|
|
243
|
+
"Asia/Ashgabat",
|
|
244
|
+
"Asia/Ashkhabad",
|
|
245
|
+
"Asia/Atyrau",
|
|
246
|
+
"Asia/Baghdad",
|
|
247
|
+
"Asia/Bahrain",
|
|
248
|
+
"Asia/Baku",
|
|
249
|
+
"Asia/Bangkok",
|
|
250
|
+
"Asia/Barnaul",
|
|
251
|
+
"Asia/Beirut",
|
|
252
|
+
"Asia/Bishkek",
|
|
253
|
+
"Asia/Brunei",
|
|
254
|
+
"Asia/Calcutta",
|
|
255
|
+
"Asia/Chita",
|
|
256
|
+
"Asia/Choibalsan",
|
|
257
|
+
"Asia/Chongqing",
|
|
258
|
+
"Asia/Chungking",
|
|
259
|
+
"Asia/Colombo",
|
|
260
|
+
"Asia/Dacca",
|
|
261
|
+
"Asia/Damascus",
|
|
262
|
+
"Asia/Dhaka",
|
|
263
|
+
"Asia/Dili",
|
|
264
|
+
"Asia/Dubai",
|
|
265
|
+
"Asia/Dushanbe",
|
|
266
|
+
"Asia/Famagusta",
|
|
267
|
+
"Asia/Gaza",
|
|
268
|
+
"Asia/Harbin",
|
|
269
|
+
"Asia/Hebron",
|
|
270
|
+
"Asia/Ho_Chi_Minh",
|
|
271
|
+
"Asia/Hong_Kong",
|
|
272
|
+
"Asia/Hovd",
|
|
273
|
+
"Asia/Irkutsk",
|
|
274
|
+
"Asia/Istanbul",
|
|
275
|
+
"Asia/Jakarta",
|
|
276
|
+
"Asia/Jayapura",
|
|
277
|
+
"Asia/Jerusalem",
|
|
278
|
+
"Asia/Kabul",
|
|
279
|
+
"Asia/Kamchatka",
|
|
280
|
+
"Asia/Karachi",
|
|
281
|
+
"Asia/Kashgar",
|
|
282
|
+
"Asia/Kathmandu",
|
|
283
|
+
"Asia/Katmandu",
|
|
284
|
+
"Asia/Khandyga",
|
|
285
|
+
"Asia/Kolkata",
|
|
286
|
+
"Asia/Krasnoyarsk",
|
|
287
|
+
"Asia/Kuala_Lumpur",
|
|
288
|
+
"Asia/Kuching",
|
|
289
|
+
"Asia/Kuwait",
|
|
290
|
+
"Asia/Macao",
|
|
291
|
+
"Asia/Macau",
|
|
292
|
+
"Asia/Magadan",
|
|
293
|
+
"Asia/Makassar",
|
|
294
|
+
"Asia/Manila",
|
|
295
|
+
"Asia/Muscat",
|
|
296
|
+
"Asia/Nicosia",
|
|
297
|
+
"Asia/Novokuznetsk",
|
|
298
|
+
"Asia/Novosibirsk",
|
|
299
|
+
"Asia/Omsk",
|
|
300
|
+
"Asia/Oral",
|
|
301
|
+
"Asia/Phnom_Penh",
|
|
302
|
+
"Asia/Pontianak",
|
|
303
|
+
"Asia/Pyongyang",
|
|
304
|
+
"Asia/Qatar",
|
|
305
|
+
"Asia/Qostanay",
|
|
306
|
+
"Asia/Qyzylorda",
|
|
307
|
+
"Asia/Rangoon",
|
|
308
|
+
"Asia/Riyadh",
|
|
309
|
+
"Asia/Saigon",
|
|
310
|
+
"Asia/Sakhalin",
|
|
311
|
+
"Asia/Samarkand",
|
|
312
|
+
"Asia/Seoul",
|
|
313
|
+
"Asia/Shanghai",
|
|
314
|
+
"Asia/Singapore",
|
|
315
|
+
"Asia/Srednekolymsk",
|
|
316
|
+
"Asia/Taipei",
|
|
317
|
+
"Asia/Tashkent",
|
|
318
|
+
"Asia/Tbilisi",
|
|
319
|
+
"Asia/Tehran",
|
|
320
|
+
"Asia/Tel_Aviv",
|
|
321
|
+
"Asia/Thimbu",
|
|
322
|
+
"Asia/Thimphu",
|
|
323
|
+
"Asia/Tokyo",
|
|
324
|
+
"Asia/Tomsk",
|
|
325
|
+
"Asia/Ujung_Pandang",
|
|
326
|
+
"Asia/Ulaanbaatar",
|
|
327
|
+
"Asia/Ulan_Bator",
|
|
328
|
+
"Asia/Urumqi",
|
|
329
|
+
"Asia/Ust-Nera",
|
|
330
|
+
"Asia/Vientiane",
|
|
331
|
+
"Asia/Vladivostok",
|
|
332
|
+
"Asia/Yakutsk",
|
|
333
|
+
"Asia/Yangon",
|
|
334
|
+
"Asia/Yekaterinburg",
|
|
335
|
+
"Asia/Yerevan",
|
|
336
|
+
"Atlantic/Azores",
|
|
337
|
+
"Atlantic/Bermuda",
|
|
338
|
+
"Atlantic/Canary",
|
|
339
|
+
"Atlantic/Cape_Verde",
|
|
340
|
+
"Atlantic/Faeroe",
|
|
341
|
+
"Atlantic/Faroe",
|
|
342
|
+
"Atlantic/Jan_Mayen",
|
|
343
|
+
"Atlantic/Madeira",
|
|
344
|
+
"Atlantic/Reykjavik",
|
|
345
|
+
"Atlantic/South_Georgia",
|
|
346
|
+
"Atlantic/St_Helena",
|
|
347
|
+
"Atlantic/Stanley",
|
|
348
|
+
"Australia/ACT",
|
|
349
|
+
"Australia/Adelaide",
|
|
350
|
+
"Australia/Brisbane",
|
|
351
|
+
"Australia/Broken_Hill",
|
|
352
|
+
"Australia/Canberra",
|
|
353
|
+
"Australia/Currie",
|
|
354
|
+
"Australia/Darwin",
|
|
355
|
+
"Australia/Eucla",
|
|
356
|
+
"Australia/Hobart",
|
|
357
|
+
"Australia/LHI",
|
|
358
|
+
"Australia/Lindeman",
|
|
359
|
+
"Australia/Lord_Howe",
|
|
360
|
+
"Australia/Melbourne",
|
|
361
|
+
"Australia/North",
|
|
362
|
+
"Australia/NSW",
|
|
363
|
+
"Australia/Perth",
|
|
364
|
+
"Australia/Queensland",
|
|
365
|
+
"Australia/South",
|
|
366
|
+
"Australia/Sydney",
|
|
367
|
+
"Australia/Tasmania",
|
|
368
|
+
"Australia/Victoria",
|
|
369
|
+
"Australia/West",
|
|
370
|
+
"Australia/Yancowinna",
|
|
371
|
+
"Brazil/Acre",
|
|
372
|
+
"Brazil/DeNoronha",
|
|
373
|
+
"Brazil/East",
|
|
374
|
+
"Brazil/West",
|
|
375
|
+
"Canada/Atlantic",
|
|
376
|
+
"Canada/Central",
|
|
377
|
+
"Canada/Eastern",
|
|
378
|
+
"Canada/Mountain",
|
|
379
|
+
"Canada/Newfoundland",
|
|
380
|
+
"Canada/Pacific",
|
|
381
|
+
"Canada/Saskatchewan",
|
|
382
|
+
"Canada/Yukon",
|
|
383
|
+
"CET",
|
|
384
|
+
"Chile/Continental",
|
|
385
|
+
"Chile/EasterIsland",
|
|
386
|
+
"CST6CDT",
|
|
387
|
+
"Cuba",
|
|
388
|
+
"EET",
|
|
389
|
+
"Egypt",
|
|
390
|
+
"Eire",
|
|
391
|
+
"EST",
|
|
392
|
+
"EST5EDT",
|
|
393
|
+
"Etc/GMT",
|
|
394
|
+
"Etc/GMT+0",
|
|
395
|
+
"Etc/GMT+1",
|
|
396
|
+
"Etc/GMT+10",
|
|
397
|
+
"Etc/GMT+11",
|
|
398
|
+
"Etc/GMT+12",
|
|
399
|
+
"Etc/GMT+2",
|
|
400
|
+
"Etc/GMT+3",
|
|
401
|
+
"Etc/GMT+4",
|
|
402
|
+
"Etc/GMT+5",
|
|
403
|
+
"Etc/GMT+6",
|
|
404
|
+
"Etc/GMT+7",
|
|
405
|
+
"Etc/GMT+8",
|
|
406
|
+
"Etc/GMT+9",
|
|
407
|
+
"Etc/GMT-0",
|
|
408
|
+
"Etc/GMT-1",
|
|
409
|
+
"Etc/GMT-10",
|
|
410
|
+
"Etc/GMT-11",
|
|
411
|
+
"Etc/GMT-12",
|
|
412
|
+
"Etc/GMT-13",
|
|
413
|
+
"Etc/GMT-14",
|
|
414
|
+
"Etc/GMT-2",
|
|
415
|
+
"Etc/GMT-3",
|
|
416
|
+
"Etc/GMT-4",
|
|
417
|
+
"Etc/GMT-5",
|
|
418
|
+
"Etc/GMT-6",
|
|
419
|
+
"Etc/GMT-7",
|
|
420
|
+
"Etc/GMT-8",
|
|
421
|
+
"Etc/GMT-9",
|
|
422
|
+
"Etc/GMT0",
|
|
423
|
+
"Etc/Greenwich",
|
|
424
|
+
"Etc/UCT",
|
|
425
|
+
"Etc/Universal",
|
|
426
|
+
"Etc/UTC",
|
|
427
|
+
"Etc/Zulu",
|
|
428
|
+
"Europe/Amsterdam",
|
|
429
|
+
"Europe/Andorra",
|
|
430
|
+
"Europe/Astrakhan",
|
|
431
|
+
"Europe/Athens",
|
|
432
|
+
"Europe/Belfast",
|
|
433
|
+
"Europe/Belgrade",
|
|
434
|
+
"Europe/Berlin",
|
|
435
|
+
"Europe/Bratislava",
|
|
436
|
+
"Europe/Brussels",
|
|
437
|
+
"Europe/Bucharest",
|
|
438
|
+
"Europe/Budapest",
|
|
439
|
+
"Europe/Busingen",
|
|
440
|
+
"Europe/Chisinau",
|
|
441
|
+
"Europe/Copenhagen",
|
|
442
|
+
"Europe/Dublin",
|
|
443
|
+
"Europe/Gibraltar",
|
|
444
|
+
"Europe/Guernsey",
|
|
445
|
+
"Europe/Helsinki",
|
|
446
|
+
"Europe/Isle_of_Man",
|
|
447
|
+
"Europe/Istanbul",
|
|
448
|
+
"Europe/Jersey",
|
|
449
|
+
"Europe/Kaliningrad",
|
|
450
|
+
"Europe/Kiev",
|
|
451
|
+
"Europe/Kirov",
|
|
452
|
+
"Europe/Kyiv",
|
|
453
|
+
"Europe/Lisbon",
|
|
454
|
+
"Europe/Ljubljana",
|
|
455
|
+
"Europe/London",
|
|
456
|
+
"Europe/Luxembourg",
|
|
457
|
+
"Europe/Madrid",
|
|
458
|
+
"Europe/Malta",
|
|
459
|
+
"Europe/Mariehamn",
|
|
460
|
+
"Europe/Minsk",
|
|
461
|
+
"Europe/Monaco",
|
|
462
|
+
"Europe/Moscow",
|
|
463
|
+
"Europe/Nicosia",
|
|
464
|
+
"Europe/Oslo",
|
|
465
|
+
"Europe/Paris",
|
|
466
|
+
"Europe/Podgorica",
|
|
467
|
+
"Europe/Prague",
|
|
468
|
+
"Europe/Riga",
|
|
469
|
+
"Europe/Rome",
|
|
470
|
+
"Europe/Samara",
|
|
471
|
+
"Europe/San_Marino",
|
|
472
|
+
"Europe/Sarajevo",
|
|
473
|
+
"Europe/Saratov",
|
|
474
|
+
"Europe/Simferopol",
|
|
475
|
+
"Europe/Skopje",
|
|
476
|
+
"Europe/Sofia",
|
|
477
|
+
"Europe/Stockholm",
|
|
478
|
+
"Europe/Tallinn",
|
|
479
|
+
"Europe/Tirane",
|
|
480
|
+
"Europe/Tiraspol",
|
|
481
|
+
"Europe/Ulyanovsk",
|
|
482
|
+
"Europe/Uzhgorod",
|
|
483
|
+
"Europe/Vaduz",
|
|
484
|
+
"Europe/Vatican",
|
|
485
|
+
"Europe/Vienna",
|
|
486
|
+
"Europe/Vilnius",
|
|
487
|
+
"Europe/Volgograd",
|
|
488
|
+
"Europe/Warsaw",
|
|
489
|
+
"Europe/Zagreb",
|
|
490
|
+
"Europe/Zaporozhye",
|
|
491
|
+
"Europe/Zurich",
|
|
492
|
+
"Factory",
|
|
493
|
+
"GB",
|
|
494
|
+
"GB-Eire",
|
|
495
|
+
"GMT",
|
|
496
|
+
"GMT+0",
|
|
497
|
+
"GMT-0",
|
|
498
|
+
"GMT0",
|
|
499
|
+
"Greenwich",
|
|
500
|
+
"Hongkong",
|
|
501
|
+
"HST",
|
|
502
|
+
"Iceland",
|
|
503
|
+
"Indian/Antananarivo",
|
|
504
|
+
"Indian/Chagos",
|
|
505
|
+
"Indian/Christmas",
|
|
506
|
+
"Indian/Cocos",
|
|
507
|
+
"Indian/Comoro",
|
|
508
|
+
"Indian/Kerguelen",
|
|
509
|
+
"Indian/Mahe",
|
|
510
|
+
"Indian/Maldives",
|
|
511
|
+
"Indian/Mauritius",
|
|
512
|
+
"Indian/Mayotte",
|
|
513
|
+
"Indian/Reunion",
|
|
514
|
+
"Iran",
|
|
515
|
+
"Israel",
|
|
516
|
+
"Jamaica",
|
|
517
|
+
"Japan",
|
|
518
|
+
"Kwajalein",
|
|
519
|
+
"Libya",
|
|
520
|
+
"MET",
|
|
521
|
+
"Mexico/BajaNorte",
|
|
522
|
+
"Mexico/BajaSur",
|
|
523
|
+
"Mexico/General",
|
|
524
|
+
"MST",
|
|
525
|
+
"MST7MDT",
|
|
526
|
+
"Navajo",
|
|
527
|
+
"NZ",
|
|
528
|
+
"NZ-CHAT",
|
|
529
|
+
"Pacific/Apia",
|
|
530
|
+
"Pacific/Auckland",
|
|
531
|
+
"Pacific/Bougainville",
|
|
532
|
+
"Pacific/Chatham",
|
|
533
|
+
"Pacific/Chuuk",
|
|
534
|
+
"Pacific/Easter",
|
|
535
|
+
"Pacific/Efate",
|
|
536
|
+
"Pacific/Enderbury",
|
|
537
|
+
"Pacific/Fakaofo",
|
|
538
|
+
"Pacific/Fiji",
|
|
539
|
+
"Pacific/Funafuti",
|
|
540
|
+
"Pacific/Galapagos",
|
|
541
|
+
"Pacific/Gambier",
|
|
542
|
+
"Pacific/Guadalcanal",
|
|
543
|
+
"Pacific/Guam",
|
|
544
|
+
"Pacific/Honolulu",
|
|
545
|
+
"Pacific/Johnston",
|
|
546
|
+
"Pacific/Kanton",
|
|
547
|
+
"Pacific/Kiritimati",
|
|
548
|
+
"Pacific/Kosrae",
|
|
549
|
+
"Pacific/Kwajalein",
|
|
550
|
+
"Pacific/Majuro",
|
|
551
|
+
"Pacific/Marquesas",
|
|
552
|
+
"Pacific/Midway",
|
|
553
|
+
"Pacific/Nauru",
|
|
554
|
+
"Pacific/Niue",
|
|
555
|
+
"Pacific/Norfolk",
|
|
556
|
+
"Pacific/Noumea",
|
|
557
|
+
"Pacific/Pago_Pago",
|
|
558
|
+
"Pacific/Palau",
|
|
559
|
+
"Pacific/Pitcairn",
|
|
560
|
+
"Pacific/Pohnpei",
|
|
561
|
+
"Pacific/Ponape",
|
|
562
|
+
"Pacific/Port_Moresby",
|
|
563
|
+
"Pacific/Rarotonga",
|
|
564
|
+
"Pacific/Saipan",
|
|
565
|
+
"Pacific/Samoa",
|
|
566
|
+
"Pacific/Tahiti",
|
|
567
|
+
"Pacific/Tarawa",
|
|
568
|
+
"Pacific/Tongatapu",
|
|
569
|
+
"Pacific/Truk",
|
|
570
|
+
"Pacific/Wake",
|
|
571
|
+
"Pacific/Wallis",
|
|
572
|
+
"Pacific/Yap",
|
|
573
|
+
"Poland",
|
|
574
|
+
"Portugal",
|
|
575
|
+
"PRC",
|
|
576
|
+
"PST8PDT",
|
|
577
|
+
"ROC",
|
|
578
|
+
"ROK",
|
|
579
|
+
"Singapore",
|
|
580
|
+
"Turkey",
|
|
581
|
+
"UCT",
|
|
582
|
+
"Universal",
|
|
583
|
+
"US/Alaska",
|
|
584
|
+
"US/Aleutian",
|
|
585
|
+
"US/Arizona",
|
|
586
|
+
"US/Central",
|
|
587
|
+
"US/East-Indiana",
|
|
588
|
+
"US/Eastern",
|
|
589
|
+
"US/Hawaii",
|
|
590
|
+
"US/Indiana-Starke",
|
|
591
|
+
"US/Michigan",
|
|
592
|
+
"US/Mountain",
|
|
593
|
+
"US/Pacific",
|
|
594
|
+
"US/Samoa",
|
|
595
|
+
"UTC",
|
|
596
|
+
"W-SU",
|
|
597
|
+
"WET",
|
|
598
|
+
"Zulu",
|
|
599
|
+
];
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pipedream/pidj",
|
|
3
|
-
"version": "0.0
|
|
3
|
+
"version": "0.1.0",
|
|
4
4
|
"description": "Pipedream Pidj Components",
|
|
5
5
|
"main": "pidj.app.mjs",
|
|
6
6
|
"keywords": [
|
|
@@ -11,5 +11,8 @@
|
|
|
11
11
|
"author": "Pipedream <support@pipedream.com> (https://pipedream.com/)",
|
|
12
12
|
"publishConfig": {
|
|
13
13
|
"access": "public"
|
|
14
|
+
},
|
|
15
|
+
"dependencies": {
|
|
16
|
+
"@pipedream/platform": "^3.0.0"
|
|
14
17
|
}
|
|
15
18
|
}
|
package/pidj.app.mjs
CHANGED
|
@@ -1,11 +1,125 @@
|
|
|
1
|
+
import { axios } from "@pipedream/platform";
|
|
2
|
+
|
|
1
3
|
export default {
|
|
2
4
|
type: "app",
|
|
3
5
|
app: "pidj",
|
|
4
|
-
propDefinitions: {
|
|
6
|
+
propDefinitions: {
|
|
7
|
+
contactId: {
|
|
8
|
+
type: "string",
|
|
9
|
+
label: "Contact ID",
|
|
10
|
+
description: "The ID of the contact.",
|
|
11
|
+
async options() {
|
|
12
|
+
const { contacts } = await this.listContacts();
|
|
13
|
+
|
|
14
|
+
return contacts.map(({
|
|
15
|
+
id: value, first_name, last_name, display_name, phone_number,
|
|
16
|
+
}) => ({
|
|
17
|
+
label: (first_name && last_name)
|
|
18
|
+
? `${first_name} ${last_name}`
|
|
19
|
+
: `${display_name || phone_number}`,
|
|
20
|
+
value,
|
|
21
|
+
}));
|
|
22
|
+
},
|
|
23
|
+
},
|
|
24
|
+
groupId: {
|
|
25
|
+
type: "string",
|
|
26
|
+
label: "Group Id",
|
|
27
|
+
description: "The Id of the group.",
|
|
28
|
+
async options() {
|
|
29
|
+
const { groups } = await this.listGroups();
|
|
30
|
+
|
|
31
|
+
return groups.map(({
|
|
32
|
+
group_id: value, name: label,
|
|
33
|
+
}) => ({
|
|
34
|
+
label,
|
|
35
|
+
value,
|
|
36
|
+
}));
|
|
37
|
+
},
|
|
38
|
+
optional: true,
|
|
39
|
+
},
|
|
40
|
+
surveyId: {
|
|
41
|
+
type: "string",
|
|
42
|
+
label: "Survey ID",
|
|
43
|
+
description: "The ID of the survey to be triggered.",
|
|
44
|
+
async options() {
|
|
45
|
+
const { surveys } = await this.listSurveys();
|
|
46
|
+
|
|
47
|
+
return surveys.map(({
|
|
48
|
+
survey_id: value, name: label,
|
|
49
|
+
}) => ({
|
|
50
|
+
label,
|
|
51
|
+
value,
|
|
52
|
+
}));
|
|
53
|
+
},
|
|
54
|
+
},
|
|
55
|
+
fromNumber: {
|
|
56
|
+
type: "string",
|
|
57
|
+
label: "From Number",
|
|
58
|
+
description: "Phone number to send from; this will determine which group the message sends from, and must be an active number from one of your groups. This must be in E.164 format, e.g., +18885552222",
|
|
59
|
+
},
|
|
60
|
+
toNumber: {
|
|
61
|
+
type: "string",
|
|
62
|
+
label: "To Number",
|
|
63
|
+
description: "Phone number to send to. This must be in E.164 format, e.g., +18885553333.",
|
|
64
|
+
},
|
|
65
|
+
},
|
|
5
66
|
methods: {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
67
|
+
_baseUrl() {
|
|
68
|
+
return "https://api.gopidj.com/api/2020";
|
|
69
|
+
},
|
|
70
|
+
_auth() {
|
|
71
|
+
return {
|
|
72
|
+
username: `${this.$auth.account_key}`,
|
|
73
|
+
password: `${this.$auth.token}`,
|
|
74
|
+
};
|
|
75
|
+
},
|
|
76
|
+
_makeRequest({
|
|
77
|
+
$ = this, path, ...opts
|
|
78
|
+
}) {
|
|
79
|
+
return axios($, {
|
|
80
|
+
url: this._baseUrl() + path,
|
|
81
|
+
auth: this._auth(),
|
|
82
|
+
headers: {
|
|
83
|
+
"Content-Type": "application/x-www-form-urlencoded",
|
|
84
|
+
},
|
|
85
|
+
...opts,
|
|
86
|
+
});
|
|
87
|
+
},
|
|
88
|
+
addContact(opts = {}) {
|
|
89
|
+
return this._makeRequest({
|
|
90
|
+
method: "POST",
|
|
91
|
+
path: "/contact",
|
|
92
|
+
...opts,
|
|
93
|
+
});
|
|
94
|
+
},
|
|
95
|
+
listGroups() {
|
|
96
|
+
return this._makeRequest({
|
|
97
|
+
path: "/groups",
|
|
98
|
+
});
|
|
99
|
+
},
|
|
100
|
+
listSurveys() {
|
|
101
|
+
return this._makeRequest({
|
|
102
|
+
path: "/surveys",
|
|
103
|
+
});
|
|
104
|
+
},
|
|
105
|
+
listContacts() {
|
|
106
|
+
return this._makeRequest({
|
|
107
|
+
path: "/contacts",
|
|
108
|
+
});
|
|
109
|
+
},
|
|
110
|
+
triggerSurvey(opts = {}) {
|
|
111
|
+
return this._makeRequest({
|
|
112
|
+
method: "POST",
|
|
113
|
+
path: "/survey/initiate",
|
|
114
|
+
...opts,
|
|
115
|
+
});
|
|
116
|
+
},
|
|
117
|
+
sendMessage(opts = {}) {
|
|
118
|
+
return this._makeRequest({
|
|
119
|
+
method: "POST",
|
|
120
|
+
path: "/send",
|
|
121
|
+
...opts,
|
|
122
|
+
});
|
|
9
123
|
},
|
|
10
124
|
},
|
|
11
|
-
};
|
|
125
|
+
};
|