Skip to content

[Components] momentum_ams #17276 #17507

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Jul 16, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 26 additions & 0 deletions components/momentum_ams/actions/get-client/get-client.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
import app from "../../momentum_ams.app.mjs";

export default {
key: "momentum_ams-get-client",
name: "Get Client",
description: "Get data for the client with the specified ID. [See the documentation](https://support.momentumamp.com/nowcerts-rest-api-search-insureds)",
version: "0.0.1",
type: "action",
props: {
app,
id: {
propDefinition: [
app,
"id",
],
},
},
async run({ $ }) {
const response = await this.app.getClient({
$,
id: this.id,
});
$.export("$summary", "Successfully retrieved the client with ID: " + this.id);
return response;
},
};
63 changes: 63 additions & 0 deletions components/momentum_ams/actions/insert-note/insert-note.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
import app from "../../momentum_ams.app.mjs";

export default {
key: "momentum_ams-insert-note",
name: "Insert Note",
description: "Insert note . [See the documentation](https://docs.google.com/document/d/11Xk7TviRujq806pLK8pQTcdzDF2ClmPvkfnVmdh1bGc/edit?tab=t.0)",
version: "0.0.1",
type: "action",
props: {
app,
id: {
propDefinition: [
app,
"id",
],
},
subject: {
propDefinition: [
app,
"subject",
],
},
creatorName: {
propDefinition: [
app,
"creatorName",
],
},
type: {
propDefinition: [
app,
"type",
],
},
isStickyNote: {
propDefinition: [
app,
"isStickyNote",
],
},
hide: {
propDefinition: [
app,
"hide",
],
},
},
async run({ $ }) {
const response = await this.app.insertNote({
$,
data: {
insured_database_id: this.id,
subject: this.subject,
creator_name: this.creatorName,
type: this.type,
is_sticky_note: this.isStickyNote,
hide: this.hide,
},
});
$.export("$summary", "Successfully inserted note with subject: " + this.subject);
return response;
},
};
99 changes: 95 additions & 4 deletions components/momentum_ams/momentum_ams.app.mjs
Original file line number Diff line number Diff line change
@@ -1,11 +1,102 @@
import { axios } from "@pipedream/platform";

export default {
type: "app",
app: "momentum_ams",
propDefinitions: {},
propDefinitions: {
subject: {
type: "string",
label: "Subject",
description: "The subject or title for the note",
},
creatorName: {
type: "string",
label: "Creator Name",
description: "The name of the user creating the note",
optional: true,
},
type: {
type: "string",
label: "Type",
description: "A category to classify the note",
optional: true,
},
isStickyNote: {
type: "boolean",
label: "Is Sticky Note",
description: "Set to true to make this note a sticky note for higher visibility",
optional: true,
},
hide: {
type: "boolean",
label: "Hide",
description: "Set to true to archive or hide the note from the default view",
optional: true,
},
id: {
type: "string",
label: "Client ID",
description: "The ID of the client",
async options({ page }) {
const response = await this.getClients({
params: {
"$top": 10,
"$skip": page * 10,
"$orderby": "id",
},
});
return response.value.map(({
id, commercialName,
}) => ({
value: id,
label: commercialName,
}));
},
},
},
methods: {
// this.$auth contains connected account data
authKeys() {
console.log(Object.keys(this.$auth));
_baseUrl() {
return "https://api.nowcerts.com/api";
},
async _makeRequest(opts = {}) {
const {
$ = this,
path,
headers,
...otherOpts
} = opts;
return axios($, {
...otherOpts,
url: this._baseUrl() + path,
headers: {
Authorization: `Bearer ${this.$auth.oauth_access_token}`,
...headers,
},
});
},

async insertNote(args = {}) {
return this._makeRequest({
path: "/Zapier/InsertNote",
method: "post",
...args,
});
},

async getClient({
id, ...args
}) {
return this._makeRequest({
path: `/InsuredList(${id})`,
...args,
});
},

async getClients(args = {}) {
return this._makeRequest({
path: "/InsuredDetailList",
...args,
});
},
},
};
7 changes: 5 additions & 2 deletions components/momentum_ams/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@pipedream/momentum_ams",
"version": "0.0.1",
"version": "0.1.0",
"description": "Pipedream Momentum AMS Components",
"main": "momentum_ams.app.mjs",
"keywords": [
Expand All @@ -11,5 +11,8 @@
"author": "Pipedream <[email protected]> (https://pipedream.com/)",
"publishConfig": {
"access": "public"
},
"dependencies": {
"@pipedream/platform": "^3.1.0"
}
}
}
21 changes: 10 additions & 11 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading