-
Notifications
You must be signed in to change notification settings - Fork 5.4k
Add Term ID support to create QBO Invoice #17146
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
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
test |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
import { atlasProps, jobProps } from "../../common/atlas-props.mjs"; | ||
import { atlasMixin } from "../../common/atlas-base.mjs"; | ||
|
||
export default { | ||
key: "atlas-get-all-jobs", | ||
name: "Get All Job Listings", | ||
description: "Retrieve all job listings from ATLAS", | ||
version: "0.0.15", | ||
type: "action", | ||
props: { | ||
...atlasProps, | ||
...jobProps, | ||
}, | ||
...atlasMixin, | ||
async run({ $ }) { | ||
try { | ||
// Validate authentication configuration | ||
this.validateAuth(); | ||
|
||
// Create ATLAS client | ||
const atlas = this.createAtlasClient(); | ||
|
||
// Prepare parameters | ||
const params = this.cleanParams({ | ||
limit: this.limit, | ||
offset: this.offset, | ||
status: this.status, | ||
}); | ||
|
||
// Make API request | ||
const response = await atlas.getJobs(params); | ||
|
||
// Process response | ||
const jobs = response.data || response; | ||
const jobCount = Array.isArray(jobs) ? jobs.length : 0; | ||
|
||
const authMethod = this.apiKey ? "API Key" : "Username/Password"; | ||
$.export("$summary", `Successfully retrieved ${jobCount} job listing(s) using ${authMethod}`); | ||
|
||
return { | ||
success: true, | ||
count: jobCount, | ||
jobs: jobs, | ||
params: params, | ||
authMethod: authMethod, | ||
}; | ||
|
||
} catch (error) { | ||
this.handleAtlasError(error, "Get jobs"); | ||
} | ||
}, | ||
}; |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
import { atlasProps, candidateProps } from "../../common/atlas-props.mjs"; | ||
import { atlasMixin } from "../../common/atlas-base.mjs"; | ||
|
||
export default { | ||
key: "atlas-get-candidates", | ||
name: "Get All Candidates", | ||
description: "Retrieve all candidates from ATLAS", | ||
version: "0.0.1", | ||
type: "action", | ||
props: { | ||
...atlasProps, | ||
...candidateProps, | ||
}, | ||
...atlasMixin, | ||
async run({ $ }) { | ||
try { | ||
// Validate authentication configuration | ||
this.validateAuth(); | ||
|
||
const atlas = this.createAtlasClient(); | ||
|
||
const params = this.cleanParams({ | ||
limit: this.limit, | ||
stage: this.stage, | ||
}); | ||
|
||
const response = await atlas.getCandidates(params); | ||
|
||
const candidates = response.data || response; | ||
const candidateCount = Array.isArray(candidates) ? candidates.length : 0; | ||
|
||
const authMethod = this.apiKey ? "API Key" : "Username/Password"; | ||
$.export("$summary", `Successfully retrieved ${candidateCount} candidate(s) using ${authMethod}`); | ||
|
||
return { | ||
success: true, | ||
count: candidateCount, | ||
candidates: candidates, | ||
params: params, | ||
authMethod: authMethod, | ||
}; | ||
|
||
} catch (error) { | ||
this.handleAtlasError(error, "Get candidates"); | ||
} | ||
}, | ||
}; |
Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
@@ -0,0 +1,109 @@ | ||||||||||||||||||||||||||||||||
import { axios } from "@pipedream/platform"; | ||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||
export default { | ||||||||||||||||||||||||||||||||
type: "app", | ||||||||||||||||||||||||||||||||
app: "atlas", | ||||||||||||||||||||||||||||||||
propDefinitions: { | ||||||||||||||||||||||||||||||||
apiKey: { | ||||||||||||||||||||||||||||||||
type: "string", | ||||||||||||||||||||||||||||||||
label: "API Key", | ||||||||||||||||||||||||||||||||
description: "Your ATLAS API key from the dashboard", | ||||||||||||||||||||||||||||||||
secret: true, | ||||||||||||||||||||||||||||||||
}, | ||||||||||||||||||||||||||||||||
baseUrl: { | ||||||||||||||||||||||||||||||||
type: "string", | ||||||||||||||||||||||||||||||||
label: "Base URL", | ||||||||||||||||||||||||||||||||
description: "ATLAS API base URL default: https://public-apis-prod.workland.com/api", | ||||||||||||||||||||||||||||||||
default: "https://public-apis-prod.workland.com/api", | ||||||||||||||||||||||||||||||||
optional: true, | ||||||||||||||||||||||||||||||||
}, | ||||||||||||||||||||||||||||||||
}, | ||||||||||||||||||||||||||||||||
methods: { | ||||||||||||||||||||||||||||||||
/** | ||||||||||||||||||||||||||||||||
* Get the authentication headers for API requests | ||||||||||||||||||||||||||||||||
* @returns {Object} Headers object with authorization | ||||||||||||||||||||||||||||||||
*/ | ||||||||||||||||||||||||||||||||
_getHeaders() { | ||||||||||||||||||||||||||||||||
return { | ||||||||||||||||||||||||||||||||
"Authorization": `${this.$auth.api_key}`, | ||||||||||||||||||||||||||||||||
"Content-Type": "application/json", | ||||||||||||||||||||||||||||||||
"Accept": "application/json", | ||||||||||||||||||||||||||||||||
}; | ||||||||||||||||||||||||||||||||
}, | ||||||||||||||||||||||||||||||||
Comment on lines
+26
to
+32
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Auth property names don’t match prop definitions
-return {
- "Authorization": `${this.$auth.api_key}`,
+return {
+ "Authorization": `${this.$auth.apiKey}`, Apply the same camelCase change wherever 📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents
|
||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||
/** | ||||||||||||||||||||||||||||||||
* Make authenticated API request | ||||||||||||||||||||||||||||||||
* @param {Object} opts - Request options | ||||||||||||||||||||||||||||||||
* @param {string} opts.url - API endpoint URL | ||||||||||||||||||||||||||||||||
* @param {string} [opts.method=GET] - HTTP method | ||||||||||||||||||||||||||||||||
* @param {Object} [opts.data] - Request body data | ||||||||||||||||||||||||||||||||
* @param {Object} [opts.params] - Query parameters | ||||||||||||||||||||||||||||||||
* @returns {Promise} API response | ||||||||||||||||||||||||||||||||
*/ | ||||||||||||||||||||||||||||||||
async _makeRequest({ | ||||||||||||||||||||||||||||||||
url, | ||||||||||||||||||||||||||||||||
method = "GET", | ||||||||||||||||||||||||||||||||
data, | ||||||||||||||||||||||||||||||||
params, | ||||||||||||||||||||||||||||||||
...opts | ||||||||||||||||||||||||||||||||
}) { | ||||||||||||||||||||||||||||||||
const config = { | ||||||||||||||||||||||||||||||||
method, | ||||||||||||||||||||||||||||||||
url: url.startsWith("http") ? url : `${this.$auth.base_url}${url}`, | ||||||||||||||||||||||||||||||||
headers: this._getHeaders(), | ||||||||||||||||||||||||||||||||
data, | ||||||||||||||||||||||||||||||||
params, | ||||||||||||||||||||||||||||||||
...opts, | ||||||||||||||||||||||||||||||||
Comment on lines
+50
to
+56
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🛠️ Refactor suggestion Base URL resolution will fail
-url: url.startsWith("http") ? url : `${this.$auth.base_url}${url}`,
+url: url.startsWith("http") ? url : `${this.$auth.baseUrl}${url}`, 📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents
|
||||||||||||||||||||||||||||||||
}; | ||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||
return axios(this, config); | ||||||||||||||||||||||||||||||||
}, | ||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||
/** | ||||||||||||||||||||||||||||||||
* Get all job listings from ATLAS | ||||||||||||||||||||||||||||||||
* @param {Object} params - Query parameters | ||||||||||||||||||||||||||||||||
* @returns {Promise} Job listings response | ||||||||||||||||||||||||||||||||
*/ | ||||||||||||||||||||||||||||||||
async getJobs(params = {}) { | ||||||||||||||||||||||||||||||||
return this._makeRequest({ | ||||||||||||||||||||||||||||||||
url: "/v3/jobs", | ||||||||||||||||||||||||||||||||
params, | ||||||||||||||||||||||||||||||||
}); | ||||||||||||||||||||||||||||||||
}, | ||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||
/** | ||||||||||||||||||||||||||||||||
* Get all candidates from ATLAS | ||||||||||||||||||||||||||||||||
* @param {Object} params - Query parameters | ||||||||||||||||||||||||||||||||
* @returns {Promise} Candidates response | ||||||||||||||||||||||||||||||||
*/ | ||||||||||||||||||||||||||||||||
async getCandidates(params = {}) { | ||||||||||||||||||||||||||||||||
return this._makeRequest({ | ||||||||||||||||||||||||||||||||
url: "/v3/candidates", | ||||||||||||||||||||||||||||||||
params, | ||||||||||||||||||||||||||||||||
}); | ||||||||||||||||||||||||||||||||
}, | ||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||
/** | ||||||||||||||||||||||||||||||||
* Get reports from ATLAS | ||||||||||||||||||||||||||||||||
* @param {Object} params - Query parameters | ||||||||||||||||||||||||||||||||
* @returns {Promise} Reports response | ||||||||||||||||||||||||||||||||
*/ | ||||||||||||||||||||||||||||||||
async getReports(params = {}) { | ||||||||||||||||||||||||||||||||
return this._makeRequest({ | ||||||||||||||||||||||||||||||||
url: "/v3/reports", | ||||||||||||||||||||||||||||||||
params, | ||||||||||||||||||||||||||||||||
}); | ||||||||||||||||||||||||||||||||
}, | ||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||
/** | ||||||||||||||||||||||||||||||||
* Test API connection | ||||||||||||||||||||||||||||||||
* @returns {Promise} Connection test response | ||||||||||||||||||||||||||||||||
*/ | ||||||||||||||||||||||||||||||||
async testConnection() { | ||||||||||||||||||||||||||||||||
return this._makeRequest({ | ||||||||||||||||||||||||||||||||
url: "/v3/jobs", | ||||||||||||||||||||||||||||||||
params: { limit: 1 }, | ||||||||||||||||||||||||||||||||
}); | ||||||||||||||||||||||||||||||||
}, | ||||||||||||||||||||||||||||||||
}, | ||||||||||||||||||||||||||||||||
}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🛠️ Refactor suggestion
Action name promises “All” jobs but only issues a single paged request
With
limit
,offset
passed once, the caller still has to page manually. Either:atlas.getAllPages()
to aggregate all jobs, or🤖 Prompt for AI Agents