-
Notifications
You must be signed in to change notification settings - Fork 5.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* new components * pnpm-lock.yaml * fix key
- Loading branch information
1 parent
fd6abb7
commit a48cf80
Showing
10 changed files
with
290 additions
and
72 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
import seven from "../../seven.app.mjs"; | ||
|
||
export default { | ||
key: "seven-lookup-cnam", | ||
name: "Lookup CNAM", | ||
description: "Look up caller name information via Seven. [See the documentation](https://docs.seven.io/en/rest-api/endpoints/lookup#cnam)", | ||
version: "0.0.1", | ||
type: "action", | ||
props: { | ||
seven, | ||
number: { | ||
propDefinition: [ | ||
seven, | ||
"number", | ||
], | ||
}, | ||
}, | ||
async run({ $ }) { | ||
const response = await this.seven.lookupCnam({ | ||
$, | ||
params: { | ||
number: this.number, | ||
}, | ||
}); | ||
if (response.success) { | ||
$.export("$summary", `Successfully looked up caller information for number: ${this.number}`); | ||
} | ||
return response; | ||
}, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
import seven from "../../seven.app.mjs"; | ||
|
||
export default { | ||
key: "seven-lookup-format", | ||
name: "Lookup Format", | ||
description: "Look up phone number formatting via Seven. [See the documentation](https://docs.seven.io/en/rest-api/endpoints/lookup#format)", | ||
version: "0.0.1", | ||
type: "action", | ||
props: { | ||
seven, | ||
number: { | ||
propDefinition: [ | ||
seven, | ||
"number", | ||
], | ||
}, | ||
}, | ||
async run({ $ }) { | ||
const response = await this.seven.lookupFormat({ | ||
$, | ||
params: { | ||
number: this.number, | ||
}, | ||
}); | ||
if (response.success) { | ||
$.export("$summary", `Successfully looked up phone number formatting for number: ${this.number}`); | ||
} | ||
return response; | ||
}, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
import seven from "../../seven.app.mjs"; | ||
|
||
export default { | ||
key: "seven-lookup-hlr", | ||
name: "Lookup HLR", | ||
description: "Look up home location register information via Seven. [See the documentation](https://docs.seven.io/en/rest-api/endpoints/lookup#hlr)", | ||
version: "0.0.1", | ||
type: "action", | ||
props: { | ||
seven, | ||
number: { | ||
propDefinition: [ | ||
seven, | ||
"number", | ||
], | ||
}, | ||
}, | ||
async run({ $ }) { | ||
const response = await this.seven.lookupHlr({ | ||
$, | ||
params: { | ||
number: this.number, | ||
}, | ||
}); | ||
if (response.success) { | ||
$.export("$summary", `Successfully looked up location register information for number: ${this.number}`); | ||
} | ||
return response; | ||
}, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
import seven from "../../seven.app.mjs"; | ||
|
||
export default { | ||
key: "seven-make-tts-call", | ||
name: "Make TTS Call", | ||
description: "Make a text-to-speech call via Seven. [See the documentation](https://docs.seven.io/en/rest-api/endpoints/voice#send-voice-call)", | ||
version: "0.0.1", | ||
type: "action", | ||
props: { | ||
seven, | ||
to: { | ||
propDefinition: [ | ||
seven, | ||
"to", | ||
], | ||
}, | ||
text: { | ||
type: "string", | ||
label: "Text", | ||
description: "Text message to be read out", | ||
}, | ||
}, | ||
async run({ $ }) { | ||
const response = await this.seven.sendTtsCall({ | ||
$, | ||
data: { | ||
to: this.to, | ||
text: this.text, | ||
}, | ||
}); | ||
$.export("$summary", `Successfully sent TTS call to number: ${this.to}`); | ||
return response; | ||
}, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
import seven from "../../seven.app.mjs"; | ||
|
||
export default { | ||
key: "seven-send-sms", | ||
name: "Send SMS", | ||
description: "Send SMS via Seven. [See the documentation](https://docs.seven.io/en/rest-api/endpoints/sms#send-sms)", | ||
version: "0.0.1", | ||
type: "action", | ||
props: { | ||
seven, | ||
to: { | ||
propDefinition: [ | ||
seven, | ||
"to", | ||
], | ||
}, | ||
text: { | ||
type: "string", | ||
label: "Text", | ||
description: "SMS message to send", | ||
}, | ||
}, | ||
async run({ $ }) { | ||
const response = await this.seven.sendSms({ | ||
$, | ||
data: { | ||
to: this.to, | ||
text: this.text, | ||
}, | ||
}); | ||
$.export("$summary", `Successfully sent SMS message to number: ${this.to}`); | ||
return response; | ||
}, | ||
}; |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,18 @@ | ||
{ | ||
"name": "@pipedream/seven", | ||
"version": "0.0.1", | ||
"version": "0.1.0", | ||
"description": "Pipedream Seven Components", | ||
"main": "dist/app/seven.app.mjs", | ||
"main": "seven.app.mjs", | ||
"keywords": [ | ||
"pipedream", | ||
"seven" | ||
], | ||
"files": ["dist"], | ||
"homepage": "https://pipedream.com/apps/seven", | ||
"author": "Pipedream <[email protected]> (https://pipedream.com/)", | ||
"publishConfig": { | ||
"access": "public" | ||
}, | ||
"dependencies": { | ||
"@pipedream/platform": "^3.0.1" | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
import { axios } from "@pipedream/platform"; | ||
|
||
export default { | ||
type: "app", | ||
app: "seven", | ||
propDefinitions: { | ||
number: { | ||
type: "string", | ||
label: "Number", | ||
description: "The phone number to look up. (e.g. `49176123456789`)", | ||
}, | ||
to: { | ||
type: "string", | ||
label: "To", | ||
description: "The destination phone number. Accepts all common formats like `0049171123456789`, `49171123456789`, `+49171123456789`", | ||
}, | ||
}, | ||
methods: { | ||
_baseUrl() { | ||
return "https://gateway.seven.io/api"; | ||
}, | ||
_headers() { | ||
return { | ||
Authorization: `Bearer ${this.$auth.oauth_access_token}`, | ||
}; | ||
}, | ||
_makeRequest({ | ||
$ = this, | ||
path, | ||
...args | ||
}) { | ||
return axios($, { | ||
url: `${this._baseUrl()}${path}`, | ||
headers: this._headers(), | ||
...args, | ||
}); | ||
}, | ||
lookupCnam(opts = {}) { | ||
return this._makeRequest({ | ||
path: "/lookup/cnam", | ||
...opts, | ||
}); | ||
}, | ||
lookupFormat(opts = {}) { | ||
return this._makeRequest({ | ||
path: "/lookup/format", | ||
...opts, | ||
}); | ||
}, | ||
lookupHlr(opts = {}) { | ||
return this._makeRequest({ | ||
path: "/lookup/hlr", | ||
...opts, | ||
}); | ||
}, | ||
sendSms(opts = {}) { | ||
return this._makeRequest({ | ||
method: "POST", | ||
path: "/sms", | ||
...opts, | ||
}); | ||
}, | ||
sendTtsCall(opts = {}) { | ||
return this._makeRequest({ | ||
method: "POST", | ||
path: "/voice", | ||
...opts, | ||
}); | ||
}, | ||
}, | ||
}; |
Oops, something went wrong.