Skip to content

Commit 762dc60

Browse files
authored
New Components - highergov (#14066)
* highergov init * [Components] highergov #14050 Sources - New Pusuit Added (Instant) * pnpm update * some adjusts
1 parent 491fb31 commit 762dc60

File tree

5 files changed

+129
-8
lines changed

5 files changed

+129
-8
lines changed
+35-5
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,41 @@
1+
import { axios } from "@pipedream/platform";
2+
13
export default {
24
type: "app",
35
app: "highergov",
4-
propDefinitions: {},
56
methods: {
6-
// this.$auth contains connected account data
7-
authKeys() {
8-
console.log(Object.keys(this.$auth));
7+
_baseUrl() {
8+
return "https://www.highergov.com/zapier";
9+
},
10+
_headers() {
11+
return {
12+
"Content-Type": "application/json",
13+
"Accept": "application/json",
14+
"X-API-KEY": this.$auth.api_key,
15+
};
16+
},
17+
_makeRequest({
18+
$ = this, path, ...opts
19+
}) {
20+
return axios($, {
21+
url: this._baseUrl() + path,
22+
headers: this._headers(),
23+
...opts,
24+
});
25+
},
26+
subscribeWebhook(opts = {}) {
27+
return this._makeRequest({
28+
method: "POST",
29+
path: "/pipeline/subscribe/",
30+
...opts,
31+
});
32+
},
33+
unsubscribeWebhook(opts = {}) {
34+
return this._makeRequest({
35+
method: "POST",
36+
path: "/pipeline/unsubscribe/",
37+
...opts,
38+
});
939
},
1040
},
11-
};
41+
};

components/highergov/package.json

+5-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@pipedream/highergov",
3-
"version": "0.0.1",
3+
"version": "0.1.0",
44
"description": "Pipedream HigherGov Components",
55
"main": "highergov.app.mjs",
66
"keywords": [
@@ -11,5 +11,8 @@
1111
"author": "Pipedream <[email protected]> (https://pipedream.com/)",
1212
"publishConfig": {
1313
"access": "public"
14+
},
15+
"dependencies": {
16+
"@pipedream/platform": "^3.0.1"
1417
}
15-
}
18+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
import highergov from "../../highergov.app.mjs";
2+
import sampleEmit from "./test-event.mjs";
3+
4+
export default {
5+
key: "highergov-new-pursuit-added-instant",
6+
name: "New Pursuit Added (Instant)",
7+
description: "Emit new event when a pursuit is added to the pipeline.",
8+
version: "0.0.1",
9+
type: "source",
10+
dedupe: "unique",
11+
props: {
12+
highergov,
13+
http: {
14+
type: "$.interface.http",
15+
customResponse: true,
16+
},
17+
db: "$.service.db",
18+
},
19+
hooks: {
20+
async activate() {
21+
await this.highergov.subscribeWebhook({
22+
data: {
23+
target_url: this.http.endpoint,
24+
},
25+
});
26+
},
27+
async deactivate() {
28+
await this.highergov.unsubscribeWebhook();
29+
},
30+
},
31+
async run({ body }) {
32+
this.$emit(body, {
33+
id: body.opp_key,
34+
summary: `New pursuit added: ${body.title}`,
35+
ts: Date.parse(body.current_datetime),
36+
});
37+
},
38+
sampleEmit,
39+
};
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
export default {
2+
"title": "string",
3+
"description_text": "string",
4+
"source_id": "string",
5+
"source_id_version": "string",
6+
"captured_date": "string",
7+
"posted_date": "string",
8+
"due_date": "string",
9+
"agency": {
10+
"agency_key": "string",
11+
"agency_name": "string",
12+
"agency_abbreviation": "string",
13+
"agency_type": "string",
14+
"path": "string"
15+
},
16+
"naics_code": {
17+
"naics_code": "string"
18+
},
19+
"psc_code": {
20+
"psc_code": "string"
21+
},
22+
"primary_contact_email": {
23+
"contact_title": "string",
24+
"contact_name": "string",
25+
"contact_first_name": "string",
26+
"contact_last_name": "string",
27+
"contact_email": "string",
28+
"contact_phone": "string"
29+
},
30+
"secondary_contact_email": {
31+
"contact_title": "string",
32+
"contact_name": "string",
33+
"contact_first_name": "string",
34+
"contact_last_name": "string",
35+
"contact_email": "string",
36+
"contact_phone": "string"
37+
},
38+
"set_aside": "string",
39+
"opp_key": "string",
40+
"version_key": "string",
41+
"source_type": "string",
42+
"unweighted_value": "string",
43+
"current_datetime": "string",
44+
"user_email": "string",
45+
"path": "string"
46+
}

pnpm-lock.yaml

+4-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)