Skip to content
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
99 changes: 99 additions & 0 deletions .changeset/stale-islands-see.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,99 @@
---
'@openfn/language-puntosolidario-rd': minor
'@openfn/language-googlehealthcare': minor
'@openfn/language-azure-storage': minor
'@openfn/language-googlesheets': minor
'@openfn/language-browserless': minor
'@openfn/language-fhir-ndr-et': minor
'@openfn/language-googledrive': minor
'@openfn/language-khanacademy': minor
'@openfn/language-kobotoolbox': minor
'@openfn/language-medicmobile': minor
'@openfn/language-resourcemap': minor
'@openfn/language-motherduck': minor
'@openfn/language-postgresql': minor
'@openfn/language-salesforce': minor
'@openfn/language-sunbird-rc': minor
'@openfn/language-ghana-bdr': minor
'@openfn/language-ghana-nia': minor
'@openfn/language-lamisplus': minor
'@openfn/language-mailchimp': minor
'@openfn/language-openboxes': minor
'@openfn/language-satusehat': minor
'@openfn/language-siuben-rd': minor
'@openfn/language-surveycto': minor
'@openfn/language-telerivet': minor
'@openfn/language-wigal-sms': minor
'@openfn/language-bigquery': minor
'@openfn/language-commcare': minor
'@openfn/language-dynamics': minor
'@openfn/language-facebook': minor
'@openfn/language-mtn-momo': minor
'@openfn/language-opencrvs': minor
'@openfn/language-openelis': minor
'@openfn/language-openimis': minor
'@openfn/language-openlmis': minor
'@openfn/language-pdfshift': minor
'@openfn/language-rapidpro': minor
'@openfn/language-whatsapp': minor
'@openfn/language-beyonic': minor
'@openfn/language-cartodb': minor
'@openfn/language-chatgpt': minor
'@openfn/language-erpnext': minor
'@openfn/language-fhir-fr': minor
'@openfn/language-ibipimo': minor
'@openfn/language-mailgun': minor
'@openfn/language-memento': minor
'@openfn/language-mojatax': minor
'@openfn/language-mongodb': minor
'@openfn/language-monnify': minor
'@openfn/language-msgraph': minor
'@openfn/language-msupply': minor
'@openfn/language-openhim': minor
'@openfn/language-openmrs': minor
'@openfn/language-openspp': minor
'@openfn/language-pesapal': minor
'@openfn/language-primero': minor
'@openfn/language-progres': minor
'@openfn/language-senaite': minor
'@openfn/language-arcgis': minor
'@openfn/language-aws-s3': minor
'@openfn/language-claude': minor
'@openfn/language-godata': minor
'@openfn/language-hubtel': minor
'@openfn/language-inform': minor
'@openfn/language-intuit': minor
'@openfn/language-maximo': minor
'@openfn/language-openfn': minor
'@openfn/language-stripe': minor
'@openfn/language-twilio': minor
'@openfn/language-vtiger': minor
'@openfn/language-asana': minor
'@openfn/language-dhis2': minor
'@openfn/language-divoc': minor
'@openfn/language-gmail': minor
'@openfn/language-ihris': minor
'@openfn/language-magpi': minor
'@openfn/language-minio': minor
'@openfn/language-mogli': minor
'@openfn/language-mpesa': minor
'@openfn/language-mssql': minor
'@openfn/language-mysql': minor
'@openfn/language-nexmo': minor
'@openfn/language-redis': minor
'@openfn/language-dagu': minor
'@openfn/language-fhir': minor
'@openfn/language-hive': minor
'@openfn/language-http': minor
'@openfn/language-odoo': minor
'@openfn/language-ping': minor
'@openfn/language-sftp': minor
'@openfn/language-varo': minor
'@openfn/language-zata': minor
'@openfn/language-zoho': minor
'@openfn/language-cht': minor
'@openfn/language-ocl': minor
'@openfn/language-odk': minor
---

export `log` function from common
49 changes: 49 additions & 0 deletions packages/arcgis/ast.json
Original file line number Diff line number Diff line change
Expand Up @@ -747,6 +747,55 @@
},
"valid": false
},
{
"name": "log",
"params": [
"args"
],
"docs": {
"description": "Outputs a message, like calling `console.log`. Use this at the top level of your job code, but not inside callbacks.",
"tags": [
{
"title": "public",
"description": null,
"type": null
},
{
"title": "function",
"description": null,
"name": null
},
{
"title": "example",
"description": "log('Patient List::', $.patients);",
"caption": "Log values from state"
},
{
"title": "example",
"description": "fn((state) => {\n console.log(state.data);\n return state;\n})",
"caption": "Use console.log inside a callback or fn block"
},
{
"title": "param",
"description": "A value or message to display in the logs",
"type": {
"type": "NameExpression",
"name": "any"
},
"name": "args"
},
{
"title": "returns",
"description": null,
"type": {
"type": "NameExpression",
"name": "Operation"
}
}
]
},
"valid": true
},
{
"name": "as",
"params": [
Expand Down
1 change: 1 addition & 0 deletions packages/arcgis/src/Adaptor.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ export {
fnIf,
group,
lastReferenceValue,
log,
map,
merge,
scrubEmojis,
Expand Down
49 changes: 49 additions & 0 deletions packages/asana/ast.json
Original file line number Diff line number Diff line change
Expand Up @@ -1227,6 +1227,55 @@
},
"valid": false
},
{
"name": "log",
"params": [
"args"
],
"docs": {
"description": "Outputs a message, like calling `console.log`. Use this at the top level of your job code, but not inside callbacks.",
"tags": [
{
"title": "public",
"description": null,
"type": null
},
{
"title": "function",
"description": null,
"name": null
},
{
"title": "example",
"description": "log('Patient List::', $.patients);",
"caption": "Log values from state"
},
{
"title": "example",
"description": "fn((state) => {\n console.log(state.data);\n return state;\n})",
"caption": "Use console.log inside a callback or fn block"
},
{
"title": "param",
"description": "A value or message to display in the logs",
"type": {
"type": "NameExpression",
"name": "any"
},
"name": "args"
},
{
"title": "returns",
"description": null,
"type": {
"type": "NameExpression",
"name": "Operation"
}
}
]
},
"valid": true
},
{
"name": "as",
"params": [
Expand Down
31 changes: 16 additions & 15 deletions packages/asana/src/Adaptor.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,13 +50,13 @@ export function getTask(taskGid, params, callback) {
const [resolvedTaskGid, resolvedParams] = expandReferences(
state,
taskGid,
params
params,
);
const response = await util.request(
state,
`tasks/${resolvedTaskGid}`,
{ query: resolvedParams },
callback
callback,
);
return util.prepareNextState(state, response);
};
Expand Down Expand Up @@ -87,14 +87,14 @@ export function getTasks(projectGid, params, callback) {
const [resolvedProjectGid, resolvedParams] = expandReferences(
state,
projectGid,
params
params,
);

const results = await util.requestWithPagination(
state,
`projects/${resolvedProjectGid}/tasks`,
{ query: resolvedParams },
callback
callback,
);
console.log(`Fetched ${results.length} tasks`);
return composeNextState(state, results);
Expand All @@ -121,14 +121,14 @@ export function updateTask(taskGid, data, callback) {
const [resolvedTaskGid, resolvedData] = expandReferences(
state,
taskGid,
data
data,
);

const response = await util.request(
state,
`tasks/${resolvedTaskGid}`,
{ body: { data: resolvedData }, method: 'PUT' },
callback
callback,
);
return util.prepareNextState(state, response);
};
Expand Down Expand Up @@ -157,7 +157,7 @@ export function createTask(params, callback) {
state,
'tasks',
{ body: { data: resolvedParams }, method: 'POST' },
callback
callback,
);
return util.prepareNextState(state, response);
};
Expand Down Expand Up @@ -189,7 +189,7 @@ export function upsertTask(projectGid, params, callback) {
const [resolvedProjectGid, { externalId, data }] = expandReferences(
state,
projectGid,
params
params,
);

return util
Expand All @@ -198,7 +198,7 @@ export function upsertTask(projectGid, params, callback) {
})
.then(next => {
const matchingTask = next.find(
task => task[externalId] === data[externalId]
task => task[externalId] === data[externalId],
);
if (matchingTask) {
console.log('Matching task found. Performing update.');
Expand Down Expand Up @@ -247,7 +247,7 @@ export function searchTask(task, query = {}, options = {}) {
state,
task,
query,
options
options,
);
const { workspaceGid = state.configuration.workspaceGid } = resolvedOptions;
const { resource_subtype = 'default_task', ...restQuery } = resolvedQuery;
Expand All @@ -263,7 +263,7 @@ export function searchTask(task, query = {}, options = {}) {
text: resolvedTask,
...restQuery,
},
}
},
);

return util.prepareNextState(state, response);
Expand Down Expand Up @@ -322,7 +322,7 @@ export function createTaskStory(taskGid, params, callback) {
query: { opt_fields, opt_pretty },
method: 'POST',
},
callback
callback,
);
return util.prepareNextState(state, response);
};
Expand Down Expand Up @@ -362,7 +362,7 @@ export function request(path, params = {}, callback) {
const [resolvedPath, resolvedParams] = expandReferences(
state,
path,
params
params,
);

const { body, query, method } = resolvedParams;
Expand All @@ -371,7 +371,7 @@ export function request(path, params = {}, callback) {
state,
resolvedPath,
{ method, body, query },
callback
callback,
);

return util.prepareNextState(state, response);
Expand All @@ -380,6 +380,7 @@ export function request(path, params = {}, callback) {

export {
alterState,
as,
combine,
cursor,
dataPath,
Expand All @@ -391,7 +392,7 @@ export {
fn,
fnIf,
lastReferenceValue,
log,
merge,
sourceValue,
as,
} from '@openfn/language-common';
Loading
Loading