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
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
6 changes: 6 additions & 0 deletions packages/arcgis/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# @openfn/language-arcgis

## 1.1.0

### Minor Changes

- bf26881: export `log` function from common

## 1.0.8

### Patch Changes
Expand Down
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
2 changes: 1 addition & 1 deletion packages/arcgis/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@openfn/language-arcgis",
"version": "1.0.8",
"version": "1.1.0",
"description": "OpenFn arcgis adaptor",
"type": "module",
"exports": {
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
7 changes: 7 additions & 0 deletions packages/asana/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# @openfn/language-asana

## 5.1.0

### Minor Changes

- 71115af: export `combine` function from common
- bf26881: export `log` function from common

## 5.0.13

### Patch Changes
Expand Down
92 changes: 92 additions & 0 deletions packages/asana/ast.json
Original file line number Diff line number Diff line change
Expand Up @@ -944,6 +944,49 @@
},
"valid": true
},
{
"name": "combine",
"params": [
"operations"
],
"docs": {
"description": "Combines two operations into one",
"tags": [
{
"title": "public",
"description": null,
"type": null
},
{
"title": "function",
"description": null,
"name": null
},
{
"title": "example",
"description": "combine(\n create('foo'),\n delete('bar')\n)"
},
{
"title": "param",
"description": "Operations to be performed.",
"type": {
"type": "NameExpression",
"name": "Operations"
},
"name": "operations"
},
{
"title": "returns",
"description": null,
"type": {
"type": "NameExpression",
"name": "Operation"
}
}
]
},
"valid": true
},
{
"name": "field",
"params": [
Expand Down Expand Up @@ -1184,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
2 changes: 1 addition & 1 deletion packages/asana/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@openfn/language-asana",
"version": "5.0.13",
"version": "5.1.0",
"label": "Asana",
"description": "OpenFn adaptor for accessing objects in Asana",
"homepage": "https://docs.openfn.org",
Expand Down
32 changes: 17 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,8 @@ export function request(path, params = {}, callback) {

export {
alterState,
as,
combine,
cursor,
dataPath,
dataValue,
Expand All @@ -390,7 +392,7 @@ export {
fn,
fnIf,
lastReferenceValue,
log,
merge,
sourceValue,
as,
} from '@openfn/language-common';
6 changes: 6 additions & 0 deletions packages/aws-s3/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# @openfn/language-aws-s3

## 1.1.0

### Minor Changes

- bf26881: export `log` function from common

## 1.0.3

### Patch Changes
Expand Down
Loading
Loading