diff --git a/packages/arcgis/CHANGELOG.md b/packages/arcgis/CHANGELOG.md index 2427463b06..860ad77337 100644 --- a/packages/arcgis/CHANGELOG.md +++ b/packages/arcgis/CHANGELOG.md @@ -1,5 +1,11 @@ # @openfn/language-arcgis +## 1.1.0 + +### Minor Changes + +- bf26881: export `log` function from common + ## 1.0.8 ### Patch Changes diff --git a/packages/arcgis/ast.json b/packages/arcgis/ast.json index 61b1598158..e4878da674 100644 --- a/packages/arcgis/ast.json +++ b/packages/arcgis/ast.json @@ -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": [ diff --git a/packages/arcgis/package.json b/packages/arcgis/package.json index 82a543702a..ed12e04a18 100644 --- a/packages/arcgis/package.json +++ b/packages/arcgis/package.json @@ -1,6 +1,6 @@ { "name": "@openfn/language-arcgis", - "version": "1.0.8", + "version": "1.1.0", "description": "OpenFn arcgis adaptor", "type": "module", "exports": { diff --git a/packages/arcgis/src/Adaptor.js b/packages/arcgis/src/Adaptor.js index a24d139643..30bdfec611 100644 --- a/packages/arcgis/src/Adaptor.js +++ b/packages/arcgis/src/Adaptor.js @@ -21,6 +21,7 @@ export { fnIf, group, lastReferenceValue, + log, map, merge, scrubEmojis, diff --git a/packages/asana/CHANGELOG.md b/packages/asana/CHANGELOG.md index 40ddfc879e..daea534d1a 100644 --- a/packages/asana/CHANGELOG.md +++ b/packages/asana/CHANGELOG.md @@ -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 diff --git a/packages/asana/ast.json b/packages/asana/ast.json index 38c345b01f..3a425196ae 100644 --- a/packages/asana/ast.json +++ b/packages/asana/ast.json @@ -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": [ @@ -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": [ diff --git a/packages/asana/package.json b/packages/asana/package.json index c43e31b082..6975697380 100644 --- a/packages/asana/package.json +++ b/packages/asana/package.json @@ -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", diff --git a/packages/asana/src/Adaptor.js b/packages/asana/src/Adaptor.js index db0a11ed18..42a136da48 100644 --- a/packages/asana/src/Adaptor.js +++ b/packages/asana/src/Adaptor.js @@ -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); }; @@ -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); @@ -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); }; @@ -157,7 +157,7 @@ export function createTask(params, callback) { state, 'tasks', { body: { data: resolvedParams }, method: 'POST' }, - callback + callback, ); return util.prepareNextState(state, response); }; @@ -189,7 +189,7 @@ export function upsertTask(projectGid, params, callback) { const [resolvedProjectGid, { externalId, data }] = expandReferences( state, projectGid, - params + params, ); return util @@ -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.'); @@ -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; @@ -263,7 +263,7 @@ export function searchTask(task, query = {}, options = {}) { text: resolvedTask, ...restQuery, }, - } + }, ); return util.prepareNextState(state, response); @@ -322,7 +322,7 @@ export function createTaskStory(taskGid, params, callback) { query: { opt_fields, opt_pretty }, method: 'POST', }, - callback + callback, ); return util.prepareNextState(state, response); }; @@ -362,7 +362,7 @@ export function request(path, params = {}, callback) { const [resolvedPath, resolvedParams] = expandReferences( state, path, - params + params, ); const { body, query, method } = resolvedParams; @@ -371,7 +371,7 @@ export function request(path, params = {}, callback) { state, resolvedPath, { method, body, query }, - callback + callback, ); return util.prepareNextState(state, response); @@ -380,6 +380,8 @@ export function request(path, params = {}, callback) { export { alterState, + as, + combine, cursor, dataPath, dataValue, @@ -390,7 +392,7 @@ export { fn, fnIf, lastReferenceValue, + log, merge, sourceValue, - as, } from '@openfn/language-common'; diff --git a/packages/aws-s3/CHANGELOG.md b/packages/aws-s3/CHANGELOG.md index ec50d8f260..64acf9bec5 100644 --- a/packages/aws-s3/CHANGELOG.md +++ b/packages/aws-s3/CHANGELOG.md @@ -1,5 +1,11 @@ # @openfn/language-aws-s3 +## 1.1.0 + +### Minor Changes + +- bf26881: export `log` function from common + ## 1.0.3 ### Patch Changes diff --git a/packages/aws-s3/ast.json b/packages/aws-s3/ast.json index 1e11141797..914d695bbb 100644 --- a/packages/aws-s3/ast.json +++ b/packages/aws-s3/ast.json @@ -870,6 +870,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": [ diff --git a/packages/aws-s3/package.json b/packages/aws-s3/package.json index 242e85d3a1..88e7267f9f 100644 --- a/packages/aws-s3/package.json +++ b/packages/aws-s3/package.json @@ -1,6 +1,6 @@ { "name": "@openfn/language-aws-s3", - "version": "1.0.3", + "version": "1.1.0", "description": "OpenFn aws-s3 adaptor", "type": "module", "exports": { diff --git a/packages/aws-s3/src/Adaptor.js b/packages/aws-s3/src/Adaptor.js index 4d84e59136..e686171840 100644 --- a/packages/aws-s3/src/Adaptor.js +++ b/packages/aws-s3/src/Adaptor.js @@ -137,6 +137,7 @@ export { fnIf, group, lastReferenceValue, + log, map, merge, scrubEmojis, diff --git a/packages/azure-storage/CHANGELOG.md b/packages/azure-storage/CHANGELOG.md index 002755dc2e..cd7946b2f0 100644 --- a/packages/azure-storage/CHANGELOG.md +++ b/packages/azure-storage/CHANGELOG.md @@ -1,5 +1,12 @@ # @openfn/language-azure-storage +## 3.1.0 + +### Minor Changes + +- 71115af: export `combine` function from common +- bf26881: export `log` function from common + ## 3.0.11 ### Patch Changes diff --git a/packages/azure-storage/ast.json b/packages/azure-storage/ast.json index ca1db0b9ae..cb8adcb4bb 100644 --- a/packages/azure-storage/ast.json +++ b/packages/azure-storage/ast.json @@ -560,6 +560,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": [ @@ -713,6 +756,55 @@ ] }, "valid": true + }, + { + "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 } ] } \ No newline at end of file diff --git a/packages/azure-storage/package.json b/packages/azure-storage/package.json index 81a075f8af..7e9abcef6c 100644 --- a/packages/azure-storage/package.json +++ b/packages/azure-storage/package.json @@ -1,7 +1,7 @@ { "name": "@openfn/language-azure-storage", "label": "Azure Storage", - "version": "3.0.11", + "version": "3.1.0", "description": "OpenFn adaptor for Azure Storage", "type": "module", "exports": { diff --git a/packages/azure-storage/src/Adaptor.js b/packages/azure-storage/src/Adaptor.js index abff2f29d9..f8260f17cb 100644 --- a/packages/azure-storage/src/Adaptor.js +++ b/packages/azure-storage/src/Adaptor.js @@ -232,6 +232,7 @@ export function getBlobProperties(blobName, options = {}) { } export { + combine, dataPath, dataValue, dateFns, @@ -241,6 +242,7 @@ export { fn, fnIf, lastReferenceValue, + log, merge, sourceValue, } from '@openfn/language-common'; diff --git a/packages/beyonic/CHANGELOG.md b/packages/beyonic/CHANGELOG.md index 6c8d09b336..20cd0be653 100644 --- a/packages/beyonic/CHANGELOG.md +++ b/packages/beyonic/CHANGELOG.md @@ -1,5 +1,12 @@ # @openfn/language-beyonic +## 0.4.0 + +### Minor Changes + +- 71115af: export `combine` function from common +- bf26881: export `log` function from common + ## 0.3.30 ### Patch Changes diff --git a/packages/beyonic/ast.json b/packages/beyonic/ast.json index 76c2fff051..0a0432b94a 100644 --- a/packages/beyonic/ast.json +++ b/packages/beyonic/ast.json @@ -403,6 +403,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": [ @@ -556,6 +599,55 @@ ] }, "valid": true + }, + { + "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 } ] } \ No newline at end of file diff --git a/packages/beyonic/package.json b/packages/beyonic/package.json index 4754d5346e..1b971a124a 100644 --- a/packages/beyonic/package.json +++ b/packages/beyonic/package.json @@ -1,7 +1,7 @@ { "name": "@openfn/language-beyonic", "label": "Beyonic", - "version": "0.3.30", + "version": "0.4.0", "description": "OpenFn adaptor for Beyonic", "homepage": "https://docs.openfn.org", "repository": { diff --git a/packages/beyonic/src/Adaptor.js b/packages/beyonic/src/Adaptor.js index 3432005877..bb836f4477 100644 --- a/packages/beyonic/src/Adaptor.js +++ b/packages/beyonic/src/Adaptor.js @@ -103,13 +103,15 @@ export function createCollectionRequest(data) { } export { - fn, - fnIf, - field, - fields, - sourceValue, - merge, + combine, dataPath, dataValue, + field, + fields, + fn, + fnIf, lastReferenceValue, + log, + merge, + sourceValue, } from '@openfn/language-common'; diff --git a/packages/bigquery/CHANGELOG.md b/packages/bigquery/CHANGELOG.md index 992cfdc55a..6730aaa063 100644 --- a/packages/bigquery/CHANGELOG.md +++ b/packages/bigquery/CHANGELOG.md @@ -1,5 +1,11 @@ # @openfn/language-bigquery +## 4.1.0 + +### Minor Changes + +- bf26881: export `log` function from common + ## 4.0.15 ### Patch Changes diff --git a/packages/bigquery/ast.json b/packages/bigquery/ast.json index bb6d8eeb8f..07ad18d2f7 100644 --- a/packages/bigquery/ast.json +++ b/packages/bigquery/ast.json @@ -698,6 +698,55 @@ ] }, "valid": true + }, + { + "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 } ] } \ No newline at end of file diff --git a/packages/bigquery/package.json b/packages/bigquery/package.json index 567d11b78f..b8a162333c 100644 --- a/packages/bigquery/package.json +++ b/packages/bigquery/package.json @@ -1,7 +1,7 @@ { "name": "@openfn/language-bigquery", "label": "BigQuery", - "version": "4.0.15", + "version": "4.1.0", "description": "A Google BigQuery language package for use with Open Function", "main": "dist/index.cjs", "scripts": { diff --git a/packages/bigquery/src/Adaptor.js b/packages/bigquery/src/Adaptor.js index 3da27059d8..0249d968ac 100644 --- a/packages/bigquery/src/Adaptor.js +++ b/packages/bigquery/src/Adaptor.js @@ -116,17 +116,18 @@ export function load( } export { - fn, - fnIf, alterState, - dataPath, combine, + dataPath, dataValue, each, field, fields, + fn, + fnIf, lastReferenceValue, + log, merge, - sourceValue, parseCsv, + sourceValue, } from '@openfn/language-common'; diff --git a/packages/browserless/CHANGELOG.md b/packages/browserless/CHANGELOG.md index e41af18061..7e4ec59be3 100644 --- a/packages/browserless/CHANGELOG.md +++ b/packages/browserless/CHANGELOG.md @@ -1,5 +1,11 @@ # @openfn/language-browserless +## 1.1.0 + +### Minor Changes + +- bf26881: export `log` function from common + ## 1.0.5 ### Patch Changes diff --git a/packages/browserless/ast.json b/packages/browserless/ast.json index 858bbb13f8..8ec58e0471 100644 --- a/packages/browserless/ast.json +++ b/packages/browserless/ast.json @@ -853,6 +853,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": [ diff --git a/packages/browserless/package.json b/packages/browserless/package.json index 1c7274cb95..740be7bd3f 100644 --- a/packages/browserless/package.json +++ b/packages/browserless/package.json @@ -1,6 +1,6 @@ { "name": "@openfn/language-browserless", - "version": "1.0.5", + "version": "1.1.0", "description": "OpenFn browserless adaptor", "type": "module", "exports": { diff --git a/packages/browserless/src/Adaptor.js b/packages/browserless/src/Adaptor.js index 7d0e5e61fd..e98a1f909f 100644 --- a/packages/browserless/src/Adaptor.js +++ b/packages/browserless/src/Adaptor.js @@ -52,6 +52,7 @@ export { fnIf, group, lastReferenceValue, + log, map, merge, scrubEmojis, diff --git a/packages/cartodb/CHANGELOG.md b/packages/cartodb/CHANGELOG.md index 23ff4f0da7..cc1bee58fc 100644 --- a/packages/cartodb/CHANGELOG.md +++ b/packages/cartodb/CHANGELOG.md @@ -1,5 +1,12 @@ # @openfn/language-cartodb +## 0.5.0 + +### Minor Changes + +- 71115af: export `combine` function from common +- bf26881: export `log` function from common + ## 0.4.31 ### Patch Changes diff --git a/packages/cartodb/ast.json b/packages/cartodb/ast.json index f45920c2fd..954e1cc491 100644 --- a/packages/cartodb/ast.json +++ b/packages/cartodb/ast.json @@ -433,6 +433,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": [ @@ -586,6 +629,55 @@ ] }, "valid": true + }, + { + "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 } ] } \ No newline at end of file diff --git a/packages/cartodb/package.json b/packages/cartodb/package.json index c3744732fe..6a3eec9145 100644 --- a/packages/cartodb/package.json +++ b/packages/cartodb/package.json @@ -1,7 +1,7 @@ { "name": "@openfn/language-cartodb", "label": "CartoDB", - "version": "0.4.31", + "version": "0.5.0", "description": "cartodb Language Pack for OpenFn", "main": "dist/index.cjs", "scripts": { diff --git a/packages/cartodb/src/Adaptor.js b/packages/cartodb/src/Adaptor.js index 53ffcc1d2d..858004fe6b 100644 --- a/packages/cartodb/src/Adaptor.js +++ b/packages/cartodb/src/Adaptor.js @@ -91,14 +91,16 @@ export function addRow(table, rowData) { } export { - fn, - fnIf, - field, - fields, - sourceValue, - each, - merge, + combine, dataPath, dataValue, + each, + field, + fields, + fn, + fnIf, lastReferenceValue, + log, + merge, + sourceValue, } from '@openfn/language-common'; diff --git a/packages/chatgpt/CHANGELOG.md b/packages/chatgpt/CHANGELOG.md index f8daa64934..ba8f6f732e 100644 --- a/packages/chatgpt/CHANGELOG.md +++ b/packages/chatgpt/CHANGELOG.md @@ -1,5 +1,12 @@ # @openfn/language-chatgpt +## 2.1.0 + +### Minor Changes + +- 71115af: export `combine` function from common +- bf26881: export `log` function from common + ## 2.0.12 ### Patch Changes diff --git a/packages/chatgpt/ast.json b/packages/chatgpt/ast.json index e8ca3d2aaa..a4a99f6d92 100644 --- a/packages/chatgpt/ast.json +++ b/packages/chatgpt/ast.json @@ -388,6 +388,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": [ @@ -627,6 +670,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 } ] } \ No newline at end of file diff --git a/packages/chatgpt/package.json b/packages/chatgpt/package.json index c00cec32c7..4f2b94ebe3 100644 --- a/packages/chatgpt/package.json +++ b/packages/chatgpt/package.json @@ -1,7 +1,7 @@ { "name": "@openfn/language-chatgpt", "label": "ChatGPT", - "version": "2.0.12", + "version": "2.1.0", "description": "OpenFn adaptor for ChatGPT", "type": "module", "exports": { diff --git a/packages/chatgpt/src/Adaptor.js b/packages/chatgpt/src/Adaptor.js index dbf227ac6c..d8aa64648d 100644 --- a/packages/chatgpt/src/Adaptor.js +++ b/packages/chatgpt/src/Adaptor.js @@ -57,7 +57,7 @@ export function execute(...operations) { return state => { return commonExecute( createClient, - ...operations + ...operations, )({ ...initialState, ...state, @@ -80,7 +80,7 @@ export function prompt(message, opts) { const [resolvedMessage, resolvedOpts] = expandReferences( state, message, - opts + opts, ); const payload = { @@ -124,7 +124,7 @@ export function deepResearch(message, opts) { const [resolvedMessage, resolvedOpts] = expandReferences( state, message, - opts + opts, ); const payload = { @@ -143,15 +143,17 @@ export function deepResearch(message, opts) { } export { + combine, + cursor, dataPath, dataValue, dateFns, - cursor, each, field, fields, fn, lastReferenceValue, + log, merge, sourceValue, } from '@openfn/language-common'; diff --git a/packages/cht/CHANGELOG.md b/packages/cht/CHANGELOG.md index 7737ce14ae..690b5b92e8 100644 --- a/packages/cht/CHANGELOG.md +++ b/packages/cht/CHANGELOG.md @@ -1,5 +1,12 @@ # @openfn/language-cht +## 1.2.0 + +### Minor Changes + +- 71115af: export `combine` function from common +- bf26881: export `log` function from common + ## 1.1.13 ### Patch Changes diff --git a/packages/cht/ast.json b/packages/cht/ast.json index 65cc77553e..40b02ac4f3 100644 --- a/packages/cht/ast.json +++ b/packages/cht/ast.json @@ -600,6 +600,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": [ @@ -840,6 +883,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": [ diff --git a/packages/cht/package.json b/packages/cht/package.json index 6a3252c20a..01b3d65817 100644 --- a/packages/cht/package.json +++ b/packages/cht/package.json @@ -1,7 +1,7 @@ { "name": "@openfn/language-cht", "label": "Community Health Toolkit (CHT)", - "version": "1.1.13", + "version": "1.2.0", "description": "OpenFn adaptor for Community Health Toolkit (CHT)", "type": "module", "exports": { diff --git a/packages/cht/src/Adaptor.js b/packages/cht/src/Adaptor.js index 90fd63d001..854e2b6839 100644 --- a/packages/cht/src/Adaptor.js +++ b/packages/cht/src/Adaptor.js @@ -111,7 +111,7 @@ export function request(method, path, body, options = {}, callback = s => s) { { data: resolvedData, ...resolvedoptions, - } + }, ); return util.prepareNextState(state, response, callback); @@ -119,16 +119,18 @@ export function request(method, path, body, options = {}, callback = s => s) { } export { + as, + combine, + cursor, dataPath, dataValue, dateFns, - cursor, each, field, fields, fn, lastReferenceValue, + log, merge, sourceValue, - as } from '@openfn/language-common'; diff --git a/packages/claude/CHANGELOG.md b/packages/claude/CHANGELOG.md index 48cb49b112..8f74053923 100644 --- a/packages/claude/CHANGELOG.md +++ b/packages/claude/CHANGELOG.md @@ -1,5 +1,12 @@ # @openfn/language-claude +## 1.1.0 + +### Minor Changes + +- 71115af: export `combine` function from common +- bf26881: export `log` function from common + ## 1.0.24 ### Patch Changes diff --git a/packages/claude/ast.json b/packages/claude/ast.json index a87332a065..e6bcc73805 100644 --- a/packages/claude/ast.json +++ b/packages/claude/ast.json @@ -335,6 +335,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": [ @@ -574,6 +617,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 } ] } \ No newline at end of file diff --git a/packages/claude/package.json b/packages/claude/package.json index 0c833db2b3..7d051e196b 100644 --- a/packages/claude/package.json +++ b/packages/claude/package.json @@ -1,7 +1,7 @@ { "name": "@openfn/language-claude", "label": "Claude", - "version": "1.0.24", + "version": "1.1.0", "description": "OpenFn adaptor for Claude", "type": "module", "exports": { diff --git a/packages/claude/src/Adaptor.js b/packages/claude/src/Adaptor.js index e3b9804c55..1003c1edbe 100644 --- a/packages/claude/src/Adaptor.js +++ b/packages/claude/src/Adaptor.js @@ -47,7 +47,7 @@ export function execute(...operations) { return state => { return commonExecute( createClient, - ...operations + ...operations, )({ ...initialState, ...state, @@ -74,7 +74,7 @@ export function prompt(message, opts) { const [resolvedMessage, resolvedOpts] = expandReferences( state, message, - opts + opts, ); const payload = { @@ -90,15 +90,17 @@ export function prompt(message, opts) { } export { + combine, + cursor, dataPath, dataValue, dateFns, - cursor, each, field, fields, fn, lastReferenceValue, + log, merge, sourceValue, } from '@openfn/language-common'; diff --git a/packages/commcare/CHANGELOG.md b/packages/commcare/CHANGELOG.md index c125a0a45b..52db25ef5d 100644 --- a/packages/commcare/CHANGELOG.md +++ b/packages/commcare/CHANGELOG.md @@ -1,5 +1,11 @@ # @openfn/language-commcare +## 4.1.0 + +### Minor Changes + +- bf26881: export `log` function from common + ## 4.0.14 ### Patch Changes diff --git a/packages/commcare/ast.json b/packages/commcare/ast.json index fa290a7ae0..da0de4b0db 100644 --- a/packages/commcare/ast.json +++ b/packages/commcare/ast.json @@ -1196,6 +1196,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": [ diff --git a/packages/commcare/package.json b/packages/commcare/package.json index 0bb5ec5a8a..4e85fc0708 100644 --- a/packages/commcare/package.json +++ b/packages/commcare/package.json @@ -1,7 +1,7 @@ { "name": "@openfn/language-commcare", "label": "CommCare", - "version": "4.0.14", + "version": "4.1.0", "description": "OpenFn adaptor for CommCare (Dimagi)", "homepage": "https://docs.openfn.org", "repository": { diff --git a/packages/commcare/src/Adaptor.js b/packages/commcare/src/Adaptor.js index 38f2e0aee7..b1a0475b09 100644 --- a/packages/commcare/src/Adaptor.js +++ b/packages/commcare/src/Adaptor.js @@ -463,6 +463,7 @@ export { fn, fnIf, lastReferenceValue, + log, map, merge, sourceValue, diff --git a/packages/dagu/CHANGELOG.md b/packages/dagu/CHANGELOG.md index 44c934bbd8..fbf876f7af 100644 --- a/packages/dagu/CHANGELOG.md +++ b/packages/dagu/CHANGELOG.md @@ -1,5 +1,11 @@ # @openfn/language-dagu +## 1.3.0 + +### Minor Changes + +- bf26881: export `log` function from common + ## 1.2.2 ### Patch Changes diff --git a/packages/dagu/ast.json b/packages/dagu/ast.json index acfe2034bd..52231c8930 100644 --- a/packages/dagu/ast.json +++ b/packages/dagu/ast.json @@ -956,6 +956,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": [ diff --git a/packages/dagu/package.json b/packages/dagu/package.json index ea128010c3..8df5a4662b 100644 --- a/packages/dagu/package.json +++ b/packages/dagu/package.json @@ -1,6 +1,6 @@ { "name": "@openfn/language-dagu", - "version": "1.2.2", + "version": "1.3.0", "description": "OpenFn dagu adaptor", "type": "module", "exports": { diff --git a/packages/dagu/src/Adaptor.js b/packages/dagu/src/Adaptor.js index 3c9e2360f0..4fbb937d10 100644 --- a/packages/dagu/src/Adaptor.js +++ b/packages/dagu/src/Adaptor.js @@ -102,6 +102,7 @@ export { fnIf, group, lastReferenceValue, + log, map, merge, scrubEmojis, diff --git a/packages/dhis2/CHANGELOG.md b/packages/dhis2/CHANGELOG.md index 9c601597fb..01e93d0cfa 100644 --- a/packages/dhis2/CHANGELOG.md +++ b/packages/dhis2/CHANGELOG.md @@ -1,5 +1,12 @@ # @openfn/language-dhis2 +## 8.1.0 + +### Minor Changes + +- 71115af: export `combine` function from common +- bf26881: export `log` function from common + ## 8.0.13 ### Patch Changes diff --git a/packages/dhis2/ast.json b/packages/dhis2/ast.json index cddd18cd69..844a6ee6db 100644 --- a/packages/dhis2/ast.json +++ b/packages/dhis2/ast.json @@ -834,6 +834,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": [ @@ -1151,6 +1194,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": [ diff --git a/packages/dhis2/package.json b/packages/dhis2/package.json index b86ceb59c0..e0d13d6240 100644 --- a/packages/dhis2/package.json +++ b/packages/dhis2/package.json @@ -1,7 +1,7 @@ { "name": "@openfn/language-dhis2", "label": "DHIS2", - "version": "8.0.13", + "version": "8.1.0", "description": "OpenFn adaptor for DHIS2", "homepage": "https://docs.openfn.org", "repository": { diff --git a/packages/dhis2/src/Adaptor.js b/packages/dhis2/src/Adaptor.js index 5903672d71..66a1de2ceb 100644 --- a/packages/dhis2/src/Adaptor.js +++ b/packages/dhis2/src/Adaptor.js @@ -651,6 +651,7 @@ function callNewTracker( export { alterState, as, + combine, cursor, dataPath, dataValue, @@ -662,6 +663,7 @@ export { fnIf, group, lastReferenceValue, + log, map, merge, sourceValue, diff --git a/packages/divoc/CHANGELOG.md b/packages/divoc/CHANGELOG.md index 7323fdb209..49857fe221 100644 --- a/packages/divoc/CHANGELOG.md +++ b/packages/divoc/CHANGELOG.md @@ -1,5 +1,12 @@ # @openfn/language-divoc +## 0.2.0 + +### Minor Changes + +- 71115af: export `combine` function from common +- bf26881: export `log` function from common + ## 0.1.19 ### Patch Changes diff --git a/packages/divoc/ast.json b/packages/divoc/ast.json index a80459e6e9..03a5d0224b 100644 --- a/packages/divoc/ast.json +++ b/packages/divoc/ast.json @@ -330,6 +330,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": [ @@ -569,6 +612,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 } ] } \ No newline at end of file diff --git a/packages/divoc/package.json b/packages/divoc/package.json index 590f66a816..9d0a04ef5d 100644 --- a/packages/divoc/package.json +++ b/packages/divoc/package.json @@ -1,7 +1,7 @@ { "name": "@openfn/language-divoc", "label": "Divoc", - "version": "0.1.19", + "version": "0.2.0", "description": "OpenFn adaptor for DIVOC", "type": "module", "exports": { diff --git a/packages/divoc/src/Adaptor.js b/packages/divoc/src/Adaptor.js index 9f8b53768c..c63f69cead 100644 --- a/packages/divoc/src/Adaptor.js +++ b/packages/divoc/src/Adaptor.js @@ -2,7 +2,6 @@ import { execute as commonExecute } from '@openfn/language-common'; import { expandReferences } from '@openfn/language-common/util'; import * as util from './Utils.js'; - /** * State object * @typedef {Object} DivocHttpState @@ -18,7 +17,7 @@ import * as util from './Utils.js'; * @private * @example * execute(certifyVaccination({}))(state) - * @param {Operations} operations + * @param {Operations} operations * @returns {operation} */ export function execute(...operations) { @@ -28,11 +27,10 @@ export function execute(...operations) { }; return state => { - return commonExecute(...operations)({...initialState,...state}) - } + return commonExecute(...operations)({ ...initialState, ...state }); + }; } - /** * Certify a vaccination * @public @@ -89,33 +87,36 @@ export function execute(...operations) { */ export function certifyVaccination(data) { return async state => { - const [resolvedData] = expandReferences(state, data); const { baseUrl } = state.configuration; const options = { method: 'POST', data: resolvedData, - } - + }; + + const response = await util.request( + { ...state.configuration }, + '/v1/certify', + options, + ); - const response = await util.request({...state.configuration}, '/v1/certify', options); - return util.prepareNextState(state, response); - } + }; } - export { + combine, + cursor, dataPath, dataValue, dateFns, - cursor, each, field, fields, fn, lastReferenceValue, + log, merge, sourceValue, } from '@openfn/language-common'; diff --git a/packages/dynamics/CHANGELOG.md b/packages/dynamics/CHANGELOG.md index f941a19b5b..8dde34babc 100644 --- a/packages/dynamics/CHANGELOG.md +++ b/packages/dynamics/CHANGELOG.md @@ -1,5 +1,12 @@ # @openfn/language-dynamics +## 0.6.0 + +### Minor Changes + +- 71115af: export `combine` function from common +- bf26881: export `log` function from common + ## 0.5.32 ### Patch Changes diff --git a/packages/dynamics/ast.json b/packages/dynamics/ast.json index 6ec6be8c78..29f5e3a6ff 100644 --- a/packages/dynamics/ast.json +++ b/packages/dynamics/ast.json @@ -334,6 +334,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": [ @@ -487,6 +530,55 @@ ] }, "valid": true + }, + { + "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 } ] } \ No newline at end of file diff --git a/packages/dynamics/package.json b/packages/dynamics/package.json index b2efd34d04..1232d9b8df 100644 --- a/packages/dynamics/package.json +++ b/packages/dynamics/package.json @@ -1,7 +1,7 @@ { "name": "@openfn/language-dynamics", "label": "Dynamics", - "version": "0.5.32", + "version": "0.6.0", "description": "OpenFn adaptor for Microsoft Dynamics", "main": "dist/index.cjs", "scripts": { diff --git a/packages/dynamics/src/Adaptor.js b/packages/dynamics/src/Adaptor.js index ae93b3e68f..a3dc8337db 100644 --- a/packages/dynamics/src/Adaptor.js +++ b/packages/dynamics/src/Adaptor.js @@ -73,7 +73,7 @@ export function createEntity(params) { console.log('Create entity succeeded.'); resolve(response); } - } + }, ); }).then(data => { const nextState = { @@ -148,7 +148,7 @@ export function query(params) { console.log(JSON.parse(body)); resolve(response); } - } + }, ); }).then(data => { const nextState = { @@ -201,7 +201,7 @@ export function updateEntity(params) { console.log('Update succeeded.'); resolve(response); } - } + }, ); }).then(data => { const nextState = { @@ -252,7 +252,7 @@ export function deleteEntity(params) { console.log('Delete succeeded.'); resolve(response); } - } + }, ); }).then(data => { const nextState = { @@ -265,15 +265,17 @@ export function deleteEntity(params) { } export { + alterState, + combine, + dataPath, + dataValue, + each, field, fields, - sourceValue, - alterState, fn, fnIf, - each, - merge, - dataPath, - dataValue, lastReferenceValue, + log, + merge, + sourceValue, } from '@openfn/language-common'; diff --git a/packages/erpnext/CHANGELOG.md b/packages/erpnext/CHANGELOG.md index 44619b3bef..c34cba47f0 100644 --- a/packages/erpnext/CHANGELOG.md +++ b/packages/erpnext/CHANGELOG.md @@ -1,5 +1,12 @@ # @openfn/language-erpnext +## 1.1.0 + +### Minor Changes + +- 71115af: export `combine` function from common +- bf26881: export `log` function from common + ## 1.0.7 ### Patch Changes diff --git a/packages/erpnext/ast.json b/packages/erpnext/ast.json index 58910f743c..e32684b11f 100644 --- a/packages/erpnext/ast.json +++ b/packages/erpnext/ast.json @@ -758,6 +758,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": [ @@ -911,6 +954,55 @@ ] }, "valid": true + }, + { + "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 } ] } \ No newline at end of file diff --git a/packages/erpnext/package.json b/packages/erpnext/package.json index 1a575ac625..227dc83f6f 100644 --- a/packages/erpnext/package.json +++ b/packages/erpnext/package.json @@ -1,7 +1,7 @@ { "name": "@openfn/language-erpnext", "label": "ERPNext", - "version": "1.0.7", + "version": "1.1.0", "description": "OpenFn ERPNext adaptor", "type": "module", "exports": { diff --git a/packages/erpnext/src/Adaptor.js b/packages/erpnext/src/Adaptor.js index bc06638320..b2f826e962 100644 --- a/packages/erpnext/src/Adaptor.js +++ b/packages/erpnext/src/Adaptor.js @@ -363,6 +363,7 @@ export function getCount(doctype, filters = {}) { } export { + combine, dataPath, dataValue, dateFns, @@ -372,6 +373,7 @@ export { fn, fnIf, lastReferenceValue, + log, merge, sourceValue, } from '@openfn/language-common'; diff --git a/packages/facebook/CHANGELOG.md b/packages/facebook/CHANGELOG.md index 72c6602294..28d3b5dd00 100644 --- a/packages/facebook/CHANGELOG.md +++ b/packages/facebook/CHANGELOG.md @@ -1,5 +1,12 @@ # @openfn/language-facebook +## 0.5.0 + +### Minor Changes + +- 71115af: export `combine` function from common +- bf26881: export `log` function from common + ## 0.4.30 ### Patch Changes diff --git a/packages/facebook/ast.json b/packages/facebook/ast.json index 1e71988024..6fe8e32383 100644 --- a/packages/facebook/ast.json +++ b/packages/facebook/ast.json @@ -378,6 +378,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": [ @@ -531,6 +574,55 @@ ] }, "valid": true + }, + { + "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 } ] } \ No newline at end of file diff --git a/packages/facebook/package.json b/packages/facebook/package.json index 8cae1553a3..e376e28b3e 100644 --- a/packages/facebook/package.json +++ b/packages/facebook/package.json @@ -1,7 +1,7 @@ { "name": "@openfn/language-facebook", "label": "Facebook", - "version": "0.4.30", + "version": "0.5.0", "description": "An Language Package for Facebook Messenger API", "main": "dist/index.cjs", "scripts": { diff --git a/packages/facebook/src/Adaptor.js b/packages/facebook/src/Adaptor.js index 8c8c2ffb67..cb70378320 100644 --- a/packages/facebook/src/Adaptor.js +++ b/packages/facebook/src/Adaptor.js @@ -93,7 +93,7 @@ export function postMessage(params) { console.log('Post Message succeeded.'); resolve(body); } - } + }, ); }).then(response => { const nextState = composeNextState(state, response); @@ -103,15 +103,17 @@ export function postMessage(params) { } export { + alterState, + combine, + dataPath, + dataValue, + each, field, fields, - sourceValue, fn, fnIf, - alterState, - each, - merge, - dataPath, - dataValue, lastReferenceValue, + log, + merge, + sourceValue, } from '@openfn/language-common'; diff --git a/packages/fhir-fr/CHANGELOG.md b/packages/fhir-fr/CHANGELOG.md index a8f3a70593..77853a68e1 100644 --- a/packages/fhir-fr/CHANGELOG.md +++ b/packages/fhir-fr/CHANGELOG.md @@ -1,5 +1,12 @@ # @openfn/language-fhir-fr +## 1.1.0 + +### Minor Changes + +- 71115af: export `combine` function from common +- bf26881: export `log` function from common + ## 1.0.26 ### Patch Changes diff --git a/packages/fhir-fr/ast.json b/packages/fhir-fr/ast.json index 2d53401325..70624756ac 100644 --- a/packages/fhir-fr/ast.json +++ b/packages/fhir-fr/ast.json @@ -281,6 +281,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": [ @@ -520,6 +563,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 } ] } \ No newline at end of file diff --git a/packages/fhir-fr/package.json b/packages/fhir-fr/package.json index 8d33107bc7..828db21d07 100644 --- a/packages/fhir-fr/package.json +++ b/packages/fhir-fr/package.json @@ -1,7 +1,7 @@ { "name": "@openfn/language-fhir-fr", "label": "FHIR-FR", - "version": "1.0.26", + "version": "1.1.0", "description": "OpenFn fhir-fr adaptor", "scripts": { "build": "pnpm clean && build-adaptor fhir-fr src ast docs", diff --git a/packages/fhir-fr/src/Adaptor.js b/packages/fhir-fr/src/Adaptor.js index c38100563c..f71a7d3e8c 100644 --- a/packages/fhir-fr/src/Adaptor.js +++ b/packages/fhir-fr/src/Adaptor.js @@ -5,15 +5,17 @@ import * as util from './Utils'; // Can we auto-generate any thing here? export { + combine, + cursor, dataPath, dataValue, dateFns, - cursor, each, field, fields, fn, lastReferenceValue, + log, merge, sourceValue, } from '@openfn/language-common'; diff --git a/packages/fhir-ndr-et/CHANGELOG.md b/packages/fhir-ndr-et/CHANGELOG.md index b85a0ce9ea..0473b1e0d5 100644 --- a/packages/fhir-ndr-et/CHANGELOG.md +++ b/packages/fhir-ndr-et/CHANGELOG.md @@ -1,5 +1,18 @@ # @openfn/language-fhir-ndr-et +## 0.2.0 + +### Minor Changes + +- 71115af: export `combine` function from common +- bf26881: export `log` function from common + +### Patch Changes + +- Updated dependencies [71115af] +- Updated dependencies [bf26881] + - @openfn/language-fhir@5.1.0 + ## 0.1.29 ### Patch Changes diff --git a/packages/fhir-ndr-et/ast.json b/packages/fhir-ndr-et/ast.json index e7daa32d02..2add3ee3af 100644 --- a/packages/fhir-ndr-et/ast.json +++ b/packages/fhir-ndr-et/ast.json @@ -355,6 +355,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": [ @@ -594,6 +637,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 } ] } \ No newline at end of file diff --git a/packages/fhir-ndr-et/package.json b/packages/fhir-ndr-et/package.json index f05c93dbff..903e8343d4 100644 --- a/packages/fhir-ndr-et/package.json +++ b/packages/fhir-ndr-et/package.json @@ -1,7 +1,7 @@ { "name": "@openfn/language-fhir-ndr-et", "label": "FHIR NDR Ehtiopia", - "version": "0.1.29", + "version": "0.2.0", "description": "OpenFn fhir adaptor for NDR HIV in Ehtiopia", "type": "module", "exports": { diff --git a/packages/fhir-ndr-et/src/Adaptor.js b/packages/fhir-ndr-et/src/Adaptor.js index f14beed6ab..6245fbe11e 100644 --- a/packages/fhir-ndr-et/src/Adaptor.js +++ b/packages/fhir-ndr-et/src/Adaptor.js @@ -54,21 +54,23 @@ export const create = (resourceType, resource, params, callback = s => s) => { state.configuration, 'POST', resolvedResourceType, - opts + opts, ); return util.prepareNextState(state, response, callback); }; }; export { + combine, + cursor, dataPath, dataValue, - cursor, each, field, fields, fn, lastReferenceValue, + log, merge, sourceValue, } from '@openfn/language-common'; diff --git a/packages/fhir/CHANGELOG.md b/packages/fhir/CHANGELOG.md index 9629c4dabb..c88c496bcd 100644 --- a/packages/fhir/CHANGELOG.md +++ b/packages/fhir/CHANGELOG.md @@ -1,5 +1,12 @@ # @openfn/language-fhir +## 5.1.0 + +### Minor Changes + +- 71115af: export `combine` function from common +- bf26881: export `log` function from common + ## 5.0.18 ### Patch Changes diff --git a/packages/fhir/ast.json b/packages/fhir/ast.json index 452840346a..d13aa71c5c 100644 --- a/packages/fhir/ast.json +++ b/packages/fhir/ast.json @@ -698,6 +698,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": [ @@ -851,6 +894,55 @@ ] }, "valid": true + }, + { + "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 } ] } \ No newline at end of file diff --git a/packages/fhir/package.json b/packages/fhir/package.json index db2cbebaa7..1f51d30fd1 100644 --- a/packages/fhir/package.json +++ b/packages/fhir/package.json @@ -1,7 +1,7 @@ { "name": "@openfn/language-fhir", "label": "FHIR", - "version": "5.0.18", + "version": "5.1.0", "description": "A FHIR adaptor for OpenFn", "main": "dist/index.cjs", "scripts": { diff --git a/packages/fhir/src/Adaptor.js b/packages/fhir/src/Adaptor.js index 148db0e218..fb416960b5 100644 --- a/packages/fhir/src/Adaptor.js +++ b/packages/fhir/src/Adaptor.js @@ -268,6 +268,7 @@ export function getClaim(claimId, params, callback = s => s) { export { alterState, + combine, dataPath, dataValue, dateFns, @@ -277,6 +278,7 @@ export { fn, fnIf, lastReferenceValue, + log, merge, sourceValue, } from '@openfn/language-common'; diff --git a/packages/ghana-bdr/CHANGELOG.md b/packages/ghana-bdr/CHANGELOG.md index 548bdf1fc9..1d866df4b9 100644 --- a/packages/ghana-bdr/CHANGELOG.md +++ b/packages/ghana-bdr/CHANGELOG.md @@ -1,5 +1,12 @@ # @openfn/language-ghana-bdr +## 0.2.0 + +### Minor Changes + +- 71115af: export `combine` function from common +- bf26881: export `log` function from common + ## 0.1.22 ### Patch Changes diff --git a/packages/ghana-bdr/ast.json b/packages/ghana-bdr/ast.json index 58cc81820c..554534ffac 100644 --- a/packages/ghana-bdr/ast.json +++ b/packages/ghana-bdr/ast.json @@ -496,6 +496,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": [ @@ -735,6 +778,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 } ] } \ No newline at end of file diff --git a/packages/ghana-bdr/package.json b/packages/ghana-bdr/package.json index 155653ee82..d3e1c79e3f 100644 --- a/packages/ghana-bdr/package.json +++ b/packages/ghana-bdr/package.json @@ -1,7 +1,7 @@ { "name": "@openfn/language-ghana-bdr", "label": "Ghana BDR", - "version": "0.1.22", + "version": "0.2.0", "description": "OpenFn adaptor for Ghana birth-death registry (BDR)", "type": "module", "exports": { diff --git a/packages/ghana-bdr/src/Adaptor.js b/packages/ghana-bdr/src/Adaptor.js index 7539d8d8d6..e3123ca9ec 100644 --- a/packages/ghana-bdr/src/Adaptor.js +++ b/packages/ghana-bdr/src/Adaptor.js @@ -88,16 +88,18 @@ export function sendBirthNotification(data) { } export { - fn, - fnIf, - each, - merge, - field, - fields, + combine, cursor, - dateFns, dataPath, dataValue, - sourceValue, + dateFns, + each, + field, + fields, + fn, + fnIf, lastReferenceValue, + log, + merge, + sourceValue, } from '@openfn/language-common'; diff --git a/packages/ghana-nia/CHANGELOG.md b/packages/ghana-nia/CHANGELOG.md index 705cdacd32..206057ae5f 100644 --- a/packages/ghana-nia/CHANGELOG.md +++ b/packages/ghana-nia/CHANGELOG.md @@ -1,5 +1,12 @@ # @openfn/language-ghana-nia +## 0.2.0 + +### Minor Changes + +- 71115af: export `combine` function from common +- bf26881: export `log` function from common + ## 0.1.22 ### Patch Changes diff --git a/packages/ghana-nia/ast.json b/packages/ghana-nia/ast.json index 304f6e9471..4d7ccd63b0 100644 --- a/packages/ghana-nia/ast.json +++ b/packages/ghana-nia/ast.json @@ -496,6 +496,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": [ @@ -735,6 +778,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 } ] } \ No newline at end of file diff --git a/packages/ghana-nia/package.json b/packages/ghana-nia/package.json index c4c634afb3..428820cf25 100644 --- a/packages/ghana-nia/package.json +++ b/packages/ghana-nia/package.json @@ -1,7 +1,7 @@ { "name": "@openfn/language-ghana-nia", "label": "Ghana NIA", - "version": "0.1.22", + "version": "0.2.0", "description": "OpenFn ghana-nia adaptor", "type": "module", "exports": { diff --git a/packages/ghana-nia/src/Adaptor.js b/packages/ghana-nia/src/Adaptor.js index 89328f3659..9e80a4c909 100644 --- a/packages/ghana-nia/src/Adaptor.js +++ b/packages/ghana-nia/src/Adaptor.js @@ -105,16 +105,18 @@ export function registerChild(data) { } export { - fn, - fnIf, - each, - merge, - field, - fields, + combine, cursor, - dateFns, dataPath, dataValue, - sourceValue, + dateFns, + each, + field, + fields, + fn, + fnIf, lastReferenceValue, + log, + merge, + sourceValue, } from '@openfn/language-common'; diff --git a/packages/gmail/CHANGELOG.md b/packages/gmail/CHANGELOG.md index 1def0e0b77..f9165aabd7 100644 --- a/packages/gmail/CHANGELOG.md +++ b/packages/gmail/CHANGELOG.md @@ -1,5 +1,11 @@ # @openfn/language-gmail +## 2.1.0 + +### Minor Changes + +- bf26881: export `log` function from common + ## 2.0.15 ### Patch Changes diff --git a/packages/gmail/ast.json b/packages/gmail/ast.json index ee592b3fc5..441452541f 100644 --- a/packages/gmail/ast.json +++ b/packages/gmail/ast.json @@ -739,6 +739,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 } ] } \ No newline at end of file diff --git a/packages/gmail/package.json b/packages/gmail/package.json index c8deeb40e6..64d750e68a 100644 --- a/packages/gmail/package.json +++ b/packages/gmail/package.json @@ -1,7 +1,7 @@ { "name": "@openfn/language-gmail", "label": "Gmail", - "version": "2.0.15", + "version": "2.1.0", "badge": "Community", "description": "OpenFn gmail adaptor", "type": "module", diff --git a/packages/gmail/src/Adaptor.js b/packages/gmail/src/Adaptor.js index 179482b145..2520579af5 100644 --- a/packages/gmail/src/Adaptor.js +++ b/packages/gmail/src/Adaptor.js @@ -240,6 +240,7 @@ export { fn, fnIf, lastReferenceValue, + log, merge, sourceValue, } from '@openfn/language-common'; diff --git a/packages/godata/CHANGELOG.md b/packages/godata/CHANGELOG.md index ed4f7b4cae..b03f39ace0 100644 --- a/packages/godata/CHANGELOG.md +++ b/packages/godata/CHANGELOG.md @@ -1,5 +1,12 @@ # @openfn/language-godata +## 3.6.0 + +### Minor Changes + +- 71115af: export `combine` function from common +- bf26881: export `log` function from common + ## 3.5.18 ### Patch Changes diff --git a/packages/godata/ast.json b/packages/godata/ast.json index 421385cb82..db20167128 100644 --- a/packages/godata/ast.json +++ b/packages/godata/ast.json @@ -1180,6 +1180,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": [ @@ -1333,6 +1376,55 @@ ] }, "valid": true + }, + { + "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 } ] } \ No newline at end of file diff --git a/packages/godata/package.json b/packages/godata/package.json index ca5c7c32a6..f108e9b358 100644 --- a/packages/godata/package.json +++ b/packages/godata/package.json @@ -1,7 +1,7 @@ { "name": "@openfn/language-godata", "label": "GoData", - "version": "3.5.18", + "version": "3.6.0", "description": "An OpenFn adaptor for use with the WHO's GoData API", "main": "dist/index.cjs", "scripts": { diff --git a/packages/godata/src/Adaptor.js b/packages/godata/src/Adaptor.js index 6d016f60ba..08b33692b0 100644 --- a/packages/godata/src/Adaptor.js +++ b/packages/godata/src/Adaptor.js @@ -26,7 +26,7 @@ export function execute(...operations) { return state => { return commonExecute( login, - ...operations + ...operations, /* logout */ )({ ...initialState, ...state }).catch(e => { console.error(e); @@ -324,7 +324,7 @@ export function upsertOutbreak(outbreak, callback) { const { apiUrl, access_token } = state.configuration; const [resolvedOutbreak] = expandReferences(state, outbreak); - const {externalId, data} = resolvedOutbreak; + const { externalId, data } = resolvedOutbreak; const filter = JSON.stringify({ where: { id: externalId } }); @@ -668,7 +668,7 @@ export function upsertLocation(externalId, goDataLocation, callback) { if (response.data.length > 1) { console.log( response.data.length, - 'locations found; aborting upsert.' + 'locations found; aborting upsert.', ); return response; } else if (response.data.length === 1) { @@ -827,7 +827,7 @@ export function upsertReferenceData(externalId, goDataReferenceData, callback) { if (response.data.length > 1) { console.log( response.data.length, - 'reference data found; aborting upsert.' + 'reference data found; aborting upsert.', ); return response; } else if (response.data.length === 1) { @@ -883,15 +883,17 @@ export { axios }; // What functions do you want from the common adaptor? export { - fn, - fnIf, alterState, + combine, dataPath, dataValue, each, field, fields, + fn, + fnIf, lastReferenceValue, + log, merge, sourceValue, } from '@openfn/language-common'; diff --git a/packages/googledrive/CHANGELOG.md b/packages/googledrive/CHANGELOG.md index ee59f55baf..e62f73c08e 100644 --- a/packages/googledrive/CHANGELOG.md +++ b/packages/googledrive/CHANGELOG.md @@ -1,5 +1,11 @@ # @openfn/language-googledrive +## 3.1.0 + +### Minor Changes + +- bf26881: export `log` function from common + ## 3.0.6 ### Patch Changes diff --git a/packages/googledrive/ast.json b/packages/googledrive/ast.json index 61e96e2cfb..59f1646532 100644 --- a/packages/googledrive/ast.json +++ b/packages/googledrive/ast.json @@ -1040,6 +1040,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": [ diff --git a/packages/googledrive/package.json b/packages/googledrive/package.json index 30fb1a4ac3..6587fe1002 100644 --- a/packages/googledrive/package.json +++ b/packages/googledrive/package.json @@ -1,7 +1,7 @@ { "name": "@openfn/language-googledrive", "label": "Google Drive", - "version": "3.0.6", + "version": "3.1.0", "description": "OpenFn Google Drive adaptor", "type": "module", "exports": { diff --git a/packages/googledrive/src/Adaptor.js b/packages/googledrive/src/Adaptor.js index 233840ad33..19a326aad8 100644 --- a/packages/googledrive/src/Adaptor.js +++ b/packages/googledrive/src/Adaptor.js @@ -238,23 +238,24 @@ export function update(fileId, content) { } export { + alterState, + arrayToString, as, - fn, - fnIf, - util, - each, - field, - merge, chunk, - fields, - cursor, combine, - dateFns, - parseCsv, + cursor, dataPath, dataValue, - alterState, - sourceValue, - arrayToString, + dateFns, + each, + field, + fields, + fn, + fnIf, lastReferenceValue, + log, + merge, + parseCsv, + sourceValue, + util, } from '@openfn/language-common'; diff --git a/packages/googlehealthcare/CHANGELOG.md b/packages/googlehealthcare/CHANGELOG.md index b2530d16c4..67c674d4f4 100644 --- a/packages/googlehealthcare/CHANGELOG.md +++ b/packages/googlehealthcare/CHANGELOG.md @@ -1,5 +1,12 @@ # @openfn/language-googlehealthcare +## 1.2.0 + +### Minor Changes + +- 71115af: export `combine` function from common +- bf26881: export `log` function from common + ## 1.1.17 ### Patch Changes diff --git a/packages/googlehealthcare/ast.json b/packages/googlehealthcare/ast.json index d05d36c990..f27791bac5 100644 --- a/packages/googlehealthcare/ast.json +++ b/packages/googlehealthcare/ast.json @@ -438,6 +438,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": [ @@ -591,6 +634,55 @@ ] }, "valid": true + }, + { + "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 } ] } \ No newline at end of file diff --git a/packages/googlehealthcare/package.json b/packages/googlehealthcare/package.json index 758c0d787e..9c9fbd9580 100644 --- a/packages/googlehealthcare/package.json +++ b/packages/googlehealthcare/package.json @@ -1,7 +1,7 @@ { "name": "@openfn/language-googlehealthcare", "label": "Google Health Care", - "version": "1.1.17", + "version": "1.2.0", "description": "A Google Health Care language package for use with Open Function", "type": "module", "exports": { diff --git a/packages/googlehealthcare/src/Adaptor.js b/packages/googlehealthcare/src/Adaptor.js index ba327a739d..ddb34e9758 100644 --- a/packages/googlehealthcare/src/Adaptor.js +++ b/packages/googlehealthcare/src/Adaptor.js @@ -148,6 +148,7 @@ export function createFhirResource(fhirStore, resource, callback) { export { request } from './Utils.js'; export { + combine, dataPath, dataValue, dateFns, @@ -157,6 +158,7 @@ export { fn, fnIf, lastReferenceValue, + log, merge, sourceValue, } from '@openfn/language-common'; diff --git a/packages/googlesheets/CHANGELOG.md b/packages/googlesheets/CHANGELOG.md index e2872e830d..eb9c51eb52 100644 --- a/packages/googlesheets/CHANGELOG.md +++ b/packages/googlesheets/CHANGELOG.md @@ -1,5 +1,11 @@ # @openfn/language-googlesheets +## 4.1.0 + +### Minor Changes + +- bf26881: export `log` function from common + ## 4.0.13 ### Patch Changes diff --git a/packages/googlesheets/ast.json b/packages/googlesheets/ast.json index 9d269ab4d1..26ba70e92b 100644 --- a/packages/googlesheets/ast.json +++ b/packages/googlesheets/ast.json @@ -870,6 +870,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 } ] } \ No newline at end of file diff --git a/packages/googlesheets/package.json b/packages/googlesheets/package.json index affb0ac587..cb842cf489 100644 --- a/packages/googlesheets/package.json +++ b/packages/googlesheets/package.json @@ -1,7 +1,7 @@ { "name": "@openfn/language-googlesheets", "label": "Google Sheets", - "version": "4.0.13", + "version": "4.1.0", "description": "A Google Sheets Language Pack for OpenFn", "homepage": "https://docs.openfn.org", "repository": { diff --git a/packages/googlesheets/src/Adaptor.js b/packages/googlesheets/src/Adaptor.js index 9a17e0cb4f..5efe55924f 100644 --- a/packages/googlesheets/src/Adaptor.js +++ b/packages/googlesheets/src/Adaptor.js @@ -245,6 +245,7 @@ export { fn, fnIf, lastReferenceValue, + log, merge, sourceValue, } from '@openfn/language-common'; diff --git a/packages/hive/CHANGELOG.md b/packages/hive/CHANGELOG.md index 37c8331773..cbf2e10e8b 100644 --- a/packages/hive/CHANGELOG.md +++ b/packages/hive/CHANGELOG.md @@ -1,5 +1,12 @@ # @openfn/language-hive +## 0.4.0 + +### Minor Changes + +- 71115af: export `combine` function from common +- bf26881: export `log` function from common + ## 0.3.29 ### Patch Changes diff --git a/packages/hive/ast.json b/packages/hive/ast.json index 6dfc670315..485aab203e 100644 --- a/packages/hive/ast.json +++ b/packages/hive/ast.json @@ -399,6 +399,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": [ @@ -626,6 +669,55 @@ ] }, "valid": true + }, + { + "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 } ] } \ No newline at end of file diff --git a/packages/hive/package.json b/packages/hive/package.json index 63f5c1bfd6..82dd559357 100644 --- a/packages/hive/package.json +++ b/packages/hive/package.json @@ -1,7 +1,7 @@ { "name": "@openfn/language-hive", "label": "Apache HIVE", - "version": "0.3.29", + "version": "0.4.0", "description": "An Apache HIVE adaptor for OpenFn", "type": "module", "exports": { diff --git a/packages/hive/src/Adaptor.js b/packages/hive/src/Adaptor.js index 1e9d4a18f4..3762a0f3bf 100644 --- a/packages/hive/src/Adaptor.js +++ b/packages/hive/src/Adaptor.js @@ -123,6 +123,7 @@ async function execSql(statement, options) { } export { + combine, dataPath, dataValue, dateFns, @@ -131,8 +132,9 @@ export { fields, fn, fnIf, - parseCsv, lastReferenceValue, + log, merge, + parseCsv, sourceValue, } from '@openfn/language-common'; diff --git a/packages/http/CHANGELOG.md b/packages/http/CHANGELOG.md index b2c49d90e1..654a0fc91c 100644 --- a/packages/http/CHANGELOG.md +++ b/packages/http/CHANGELOG.md @@ -1,5 +1,11 @@ # @openfn/language-http +## 7.3.0 + +### Minor Changes + +- bf26881: export `log` function from common + ## 7.2.11 ### Patch Changes diff --git a/packages/http/ast.json b/packages/http/ast.json index 31ea46e893..c383e78b5c 100644 --- a/packages/http/ast.json +++ b/packages/http/ast.json @@ -1556,6 +1556,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": [ diff --git a/packages/http/package.json b/packages/http/package.json index aa13fb582c..19f2fdd2a9 100644 --- a/packages/http/package.json +++ b/packages/http/package.json @@ -1,7 +1,7 @@ { "name": "@openfn/language-http", "label": "HTTP", - "version": "7.2.11", + "version": "7.3.0", "description": "An HTTP request language package for use with Open Function", "homepage": "https://docs.openfn.org", "repository": { diff --git a/packages/http/src/Adaptor.js b/packages/http/src/Adaptor.js index 6555886c4e..1806f55e8c 100644 --- a/packages/http/src/Adaptor.js +++ b/packages/http/src/Adaptor.js @@ -209,6 +209,7 @@ export { group, humanProper, lastReferenceValue, + log, map, merge, parseCsv, diff --git a/packages/hubtel/CHANGELOG.md b/packages/hubtel/CHANGELOG.md index 4293d377f1..ae2844a169 100644 --- a/packages/hubtel/CHANGELOG.md +++ b/packages/hubtel/CHANGELOG.md @@ -1,5 +1,12 @@ # @openfn/language-hubtel +## 1.1.0 + +### Minor Changes + +- 71115af: export `combine` function from common +- bf26881: export `log` function from common + ## 1.0.21 ### Patch Changes diff --git a/packages/hubtel/ast.json b/packages/hubtel/ast.json index a18cb6104e..2dd276f8d5 100644 --- a/packages/hubtel/ast.json +++ b/packages/hubtel/ast.json @@ -416,6 +416,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": [ @@ -655,6 +698,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 } ] } \ No newline at end of file diff --git a/packages/hubtel/package.json b/packages/hubtel/package.json index 9674507c23..ef38e44fd0 100644 --- a/packages/hubtel/package.json +++ b/packages/hubtel/package.json @@ -1,7 +1,7 @@ { "name": "@openfn/language-hubtel", "label": "Hubtel", - "version": "1.0.21", + "version": "1.1.0", "description": "OpenFn adaptor for Hubtel", "type": "module", "exports": { diff --git a/packages/hubtel/src/Adaptor.js b/packages/hubtel/src/Adaptor.js index 932f1a7d0a..02b4291ac7 100644 --- a/packages/hubtel/src/Adaptor.js +++ b/packages/hubtel/src/Adaptor.js @@ -45,7 +45,7 @@ export function request(method, path, body, options = {}) { { body: resolvedData, ...resolvedoptions, - } + }, ); return util.prepareNextState(state, response); @@ -76,15 +76,17 @@ export function request(method, path, body, options = {}) { */ export { + combine, + cursor, dataPath, dataValue, dateFns, - cursor, each, field, fields, fn, lastReferenceValue, + log, merge, sourceValue, } from '@openfn/language-common'; diff --git a/packages/ibipimo/CHANGELOG.md b/packages/ibipimo/CHANGELOG.md index 6a7de63cd0..39207f908f 100644 --- a/packages/ibipimo/CHANGELOG.md +++ b/packages/ibipimo/CHANGELOG.md @@ -1,5 +1,11 @@ # @openfn/language-ibipimo +## 1.1.0 + +### Minor Changes + +- bf26881: export `log` function from common + ## 1.0.6 ### Patch Changes diff --git a/packages/ibipimo/ast.json b/packages/ibipimo/ast.json index 8847e155ff..a1952b77e9 100644 --- a/packages/ibipimo/ast.json +++ b/packages/ibipimo/ast.json @@ -1151,6 +1151,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": [ diff --git a/packages/ibipimo/package.json b/packages/ibipimo/package.json index 1d02f9a9ab..a265b18d88 100644 --- a/packages/ibipimo/package.json +++ b/packages/ibipimo/package.json @@ -1,6 +1,6 @@ { "name": "@openfn/language-ibipimo", - "version": "1.0.6", + "version": "1.1.0", "description": "OpenFn ibipimo adaptor", "type": "module", "exports": { diff --git a/packages/ibipimo/src/Adaptor.js b/packages/ibipimo/src/Adaptor.js index 2418e59953..0577e98f6d 100644 --- a/packages/ibipimo/src/Adaptor.js +++ b/packages/ibipimo/src/Adaptor.js @@ -243,6 +243,7 @@ export { fnIf, group, lastReferenceValue, + log, map, merge, scrubEmojis, diff --git a/packages/ihris/CHANGELOG.md b/packages/ihris/CHANGELOG.md index 1fa7585975..1d14c750ab 100644 --- a/packages/ihris/CHANGELOG.md +++ b/packages/ihris/CHANGELOG.md @@ -1,5 +1,11 @@ # @openfn/language-ihris +## 1.2.0 + +### Minor Changes + +- bf26881: export `log` function from common + ## 1.1.2 ### Patch Changes diff --git a/packages/ihris/ast.json b/packages/ihris/ast.json index 61b1598158..e4878da674 100644 --- a/packages/ihris/ast.json +++ b/packages/ihris/ast.json @@ -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": [ diff --git a/packages/ihris/package.json b/packages/ihris/package.json index 9e849c4c44..31506c8e5b 100644 --- a/packages/ihris/package.json +++ b/packages/ihris/package.json @@ -1,6 +1,6 @@ { "name": "@openfn/language-ihris", - "version": "1.1.2", + "version": "1.2.0", "description": "OpenFn adaptor for iHRIS ", "type": "module", "exports": { diff --git a/packages/ihris/src/Adaptor.js b/packages/ihris/src/Adaptor.js index 0c98c69fc5..10a0e79789 100644 --- a/packages/ihris/src/Adaptor.js +++ b/packages/ihris/src/Adaptor.js @@ -14,6 +14,7 @@ export { fnIf, group, lastReferenceValue, + log, map, merge, scrubEmojis, diff --git a/packages/inform/CHANGELOG.md b/packages/inform/CHANGELOG.md index 777467a987..fd7c34a99b 100644 --- a/packages/inform/CHANGELOG.md +++ b/packages/inform/CHANGELOG.md @@ -1,5 +1,11 @@ # @openfn/language-inform +## 1.3.0 + +### Minor Changes + +- bf26881: export `log` function from common + ## 1.2.6 ### Patch Changes diff --git a/packages/inform/ast.json b/packages/inform/ast.json index e6c0b7858b..f0b5c46747 100644 --- a/packages/inform/ast.json +++ b/packages/inform/ast.json @@ -1103,6 +1103,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": [ diff --git a/packages/inform/package.json b/packages/inform/package.json index 513459806c..2ba0d05747 100644 --- a/packages/inform/package.json +++ b/packages/inform/package.json @@ -1,6 +1,6 @@ { "name": "@openfn/language-inform", - "version": "1.2.6", + "version": "1.3.0", "description": "OpenFn inform adaptor for UNICEF InForm platform operations", "type": "module", "exports": { diff --git a/packages/inform/src/Adaptor.js b/packages/inform/src/Adaptor.js index 1d2406788c..961bc49519 100644 --- a/packages/inform/src/Adaptor.js +++ b/packages/inform/src/Adaptor.js @@ -235,6 +235,7 @@ export function downloadAttachment(attachmentId, options = {}) { } export { + as, combine, cursor, dataPath, @@ -247,9 +248,9 @@ export { fnIf, group, lastReferenceValue, + log, merge, scrubEmojis, sourceValue, util, - as, } from '@openfn/language-common'; diff --git a/packages/intuit/CHANGELOG.md b/packages/intuit/CHANGELOG.md index 370b700edb..f3a756edfa 100644 --- a/packages/intuit/CHANGELOG.md +++ b/packages/intuit/CHANGELOG.md @@ -1,5 +1,12 @@ # @openfn/language-intuit +## 1.1.0 + +### Minor Changes + +- 71115af: export `combine` function from common +- bf26881: export `log` function from common + ## 1.0.20 ### Patch Changes diff --git a/packages/intuit/ast.json b/packages/intuit/ast.json index 2d53401325..70624756ac 100644 --- a/packages/intuit/ast.json +++ b/packages/intuit/ast.json @@ -281,6 +281,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": [ @@ -520,6 +563,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 } ] } \ No newline at end of file diff --git a/packages/intuit/package.json b/packages/intuit/package.json index 9e549bcf8a..444d0ac35c 100644 --- a/packages/intuit/package.json +++ b/packages/intuit/package.json @@ -1,7 +1,7 @@ { "name": "@openfn/language-intuit", "label": "Intuit", - "version": "1.0.20", + "version": "1.1.0", "description": "OpenFn adaptor for Intuit (QuickBooks)", "type": "module", "exports": { diff --git a/packages/intuit/src/Adaptor.js b/packages/intuit/src/Adaptor.js index 7bd34a39e8..933f6cc6ac 100644 --- a/packages/intuit/src/Adaptor.js +++ b/packages/intuit/src/Adaptor.js @@ -1,15 +1,16 @@ - // More functions can be added here as needed export { + combine, + cursor, dataPath, dataValue, dateFns, - cursor, each, field, fields, fn, lastReferenceValue, + log, merge, sourceValue, } from '@openfn/language-common'; diff --git a/packages/khanacademy/CHANGELOG.md b/packages/khanacademy/CHANGELOG.md index a32599352d..a1d5a03ea1 100644 --- a/packages/khanacademy/CHANGELOG.md +++ b/packages/khanacademy/CHANGELOG.md @@ -1,5 +1,12 @@ # @openfn/language-khanacademy +## 0.6.0 + +### Minor Changes + +- 71115af: export `combine` function from common +- bf26881: export `log` function from common + ## 0.5.31 ### Patch Changes diff --git a/packages/khanacademy/ast.json b/packages/khanacademy/ast.json index b25ae576dc..46f6a4607c 100644 --- a/packages/khanacademy/ast.json +++ b/packages/khanacademy/ast.json @@ -315,6 +315,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": [ @@ -468,6 +511,55 @@ ] }, "valid": true + }, + { + "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 } ] } \ No newline at end of file diff --git a/packages/khanacademy/package.json b/packages/khanacademy/package.json index 1556a7e6da..8082b71a00 100644 --- a/packages/khanacademy/package.json +++ b/packages/khanacademy/package.json @@ -1,7 +1,7 @@ { "name": "@openfn/language-khanacademy", "label": "Khan Academy", - "version": "0.5.31", + "version": "0.6.0", "description": "A Khan Academy Language Pack for OpenFn", "main": "dist/index.cjs", "scripts": { diff --git a/packages/khanacademy/src/Adaptor.js b/packages/khanacademy/src/Adaptor.js index 018472f2b0..00f91a2aa0 100644 --- a/packages/khanacademy/src/Adaptor.js +++ b/packages/khanacademy/src/Adaptor.js @@ -43,13 +43,13 @@ export function fetch(params) { const { email, password, consumerKey, secretKey } = state.configuration; const [resolvedParams] = expandReferences(state, params); - const {getEndpoint, queryParams, postUrl} = resolvedParams; + const { getEndpoint, queryParams, postUrl } = resolvedParams; const query = qs.stringify(queryParams); const getUrl = resolveUrl( 'https://www.khanacademy.org/api/v1' + '/', - getEndpoint + '?' + query + getEndpoint + '?' + query, ); console.log('Fetching data from URL: ' + getUrl); @@ -79,7 +79,7 @@ export function fetch(params) { console.log('Token request successful.'); resolve(qs.parse(body)); } - } + }, ); }) @@ -114,7 +114,7 @@ export function fetch(params) { console.log('Token auhorization successful.'); resolve(auth); } - } + }, ); }); }) @@ -144,7 +144,7 @@ export function fetch(params) { console.log('Token exchange successful.'); resolve(qs.parse(body)); } - } + }, ); }); }) @@ -175,7 +175,7 @@ export function fetch(params) { console.log(body); resolve(body); } - } + }, ); }); }) @@ -197,7 +197,7 @@ export function fetch(params) { console.log('POST succeeded.'); resolve(body); } - } + }, ); }); }) @@ -206,14 +206,16 @@ export function fetch(params) { } export { - fn, - fnIf, - field, - sourceValue, - fields, alterState, - merge, + combine, dataPath, dataValue, + field, + fields, + fn, + fnIf, lastReferenceValue, + log, + merge, + sourceValue, } from '@openfn/language-common'; diff --git a/packages/kobotoolbox/CHANGELOG.md b/packages/kobotoolbox/CHANGELOG.md index cfeb5e7497..dce070337a 100644 --- a/packages/kobotoolbox/CHANGELOG.md +++ b/packages/kobotoolbox/CHANGELOG.md @@ -1,5 +1,12 @@ # @openfn/language-kobotoolbox +## 4.3.0 + +### Minor Changes + +- 71115af: export `combine` function from common +- bf26881: export `log` function from common + ## 4.2.14 ### Patch Changes diff --git a/packages/kobotoolbox/ast.json b/packages/kobotoolbox/ast.json index 3896baad7c..e487ab21bb 100644 --- a/packages/kobotoolbox/ast.json +++ b/packages/kobotoolbox/ast.json @@ -563,6 +563,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": [ @@ -880,6 +923,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": [ diff --git a/packages/kobotoolbox/package.json b/packages/kobotoolbox/package.json index 096265b13c..82a40cbd74 100644 --- a/packages/kobotoolbox/package.json +++ b/packages/kobotoolbox/package.json @@ -1,7 +1,7 @@ { "name": "@openfn/language-kobotoolbox", "label": "KoboToolbox", - "version": "4.2.14", + "version": "4.3.0", "description": "OpenFn adaptor for KoboToolbox", "homepage": "https://docs.openfn.org", "repository": { diff --git a/packages/kobotoolbox/src/Adaptor.js b/packages/kobotoolbox/src/Adaptor.js index aa2843a833..c4c6f561a1 100644 --- a/packages/kobotoolbox/src/Adaptor.js +++ b/packages/kobotoolbox/src/Adaptor.js @@ -136,6 +136,7 @@ export function getDeploymentInfo(formId) { export { alterState, as, + combine, cursor, dataPath, dataValue, @@ -146,6 +147,7 @@ export { fnIf, group, lastReferenceValue, + log, map, merge, sourceValue, diff --git a/packages/lamisplus/CHANGELOG.md b/packages/lamisplus/CHANGELOG.md index 924d6da804..5b99c975cb 100644 --- a/packages/lamisplus/CHANGELOG.md +++ b/packages/lamisplus/CHANGELOG.md @@ -1,5 +1,11 @@ # @openfn/language-lamisplus +## 0.2.0 + +### Minor Changes + +- bf26881: export `log` function from common + ## 0.1.4 ### Patch Changes diff --git a/packages/lamisplus/ast.json b/packages/lamisplus/ast.json index 3886983c94..8a28edf5fc 100644 --- a/packages/lamisplus/ast.json +++ b/packages/lamisplus/ast.json @@ -795,6 +795,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": [ diff --git a/packages/lamisplus/package.json b/packages/lamisplus/package.json index 1902b39d9f..6a9b4cd8b9 100644 --- a/packages/lamisplus/package.json +++ b/packages/lamisplus/package.json @@ -1,6 +1,6 @@ { "name": "@openfn/language-lamisplus", - "version": "0.1.4", + "version": "0.2.0", "description": "OpenFn lamisplus adaptor", "type": "module", "exports": { diff --git a/packages/lamisplus/src/Adaptor.js b/packages/lamisplus/src/Adaptor.js index 5e0dfb50d1..e49ed1ae8c 100644 --- a/packages/lamisplus/src/Adaptor.js +++ b/packages/lamisplus/src/Adaptor.js @@ -99,6 +99,7 @@ export { fnIf, group, lastReferenceValue, + log, map, merge, scrubEmojis, diff --git a/packages/magpi/CHANGELOG.md b/packages/magpi/CHANGELOG.md index 268d76d8f9..c0151abb80 100644 --- a/packages/magpi/CHANGELOG.md +++ b/packages/magpi/CHANGELOG.md @@ -1,5 +1,12 @@ # @openfn/language-magpi +## 1.3.0 + +### Minor Changes + +- 71115af: export `combine` function from common +- bf26881: export `log` function from common + ## 1.2.12 ### Patch Changes diff --git a/packages/magpi/ast.json b/packages/magpi/ast.json index 54d82934c1..c81cf428cf 100644 --- a/packages/magpi/ast.json +++ b/packages/magpi/ast.json @@ -421,6 +421,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": [ @@ -574,6 +617,55 @@ ] }, "valid": true + }, + { + "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 } ] } \ No newline at end of file diff --git a/packages/magpi/package.json b/packages/magpi/package.json index 8b5e985931..d82442fe1d 100644 --- a/packages/magpi/package.json +++ b/packages/magpi/package.json @@ -1,7 +1,7 @@ { "name": "@openfn/language-magpi", "label": "Magpi", - "version": "1.2.12", + "version": "1.3.0", "description": "OpenFn adaptor for Magpi", "main": "dist/index.cjs", "scripts": { diff --git a/packages/magpi/src/Adaptor.js b/packages/magpi/src/Adaptor.js index 8019bc9fc1..847764277d 100644 --- a/packages/magpi/src/Adaptor.js +++ b/packages/magpi/src/Adaptor.js @@ -100,18 +100,18 @@ export function fetchSurveyData(params) { } console.log( - `Converted ${submissions.length} submission(s) to JSON:` + `Converted ${submissions.length} submission(s) to JSON:`, ); // console.log(submissions); resolve(submissions); } else { console.log( - 'There is no survey data matching the current parameters.' + 'There is no survey data matching the current parameters.', ); resolve([]); } } - } + }, ); }) .then(submissions => { @@ -132,7 +132,7 @@ export function fetchSurveyData(params) { } else { console.log('POST succeeded.'); } - } + }, ); }); return submissions; @@ -142,7 +142,7 @@ export function fetchSurveyData(params) { // TODO: if Magpi API does not return in date order, find oldest... state.lastSubmissionDate = submissions[0].LastSubmissionDate; console.log( - `Set \"lastSubmissionDate\" for next run to: ${submissions[0].LastSubmissionDate}` + `Set \"lastSubmissionDate\" for next run to: ${submissions[0].LastSubmissionDate}`, ); } // Set the lastSubmissionDate for the next time the job runs. @@ -183,15 +183,17 @@ export function submitRecord(jsonData) { } export { - fn, - fnIf, alterState, - field, - fields, - sourceValue, - each, - merge, + combine, dataPath, dataValue, + each, + field, + fields, + fn, + fnIf, lastReferenceValue, + log, + merge, + sourceValue, } from '@openfn/language-common'; diff --git a/packages/mailchimp/CHANGELOG.md b/packages/mailchimp/CHANGELOG.md index 2d8ea212dc..f52e51f240 100644 --- a/packages/mailchimp/CHANGELOG.md +++ b/packages/mailchimp/CHANGELOG.md @@ -1,5 +1,12 @@ # @openfn/language-mailchimp +## 1.1.0 + +### Minor Changes + +- 71115af: export `combine` function from common +- bf26881: export `log` function from common + ## 1.0.32 ### Patch Changes diff --git a/packages/mailchimp/ast.json b/packages/mailchimp/ast.json index 9aa9403e50..c9a853f1b4 100644 --- a/packages/mailchimp/ast.json +++ b/packages/mailchimp/ast.json @@ -1201,6 +1201,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": [ @@ -1407,6 +1450,55 @@ ] }, "valid": true + }, + { + "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 } ] } \ No newline at end of file diff --git a/packages/mailchimp/package.json b/packages/mailchimp/package.json index 3bf925c559..28118bd3e0 100644 --- a/packages/mailchimp/package.json +++ b/packages/mailchimp/package.json @@ -1,7 +1,7 @@ { "name": "@openfn/language-mailchimp", "label": "Mailchimp", - "version": "1.0.32", + "version": "1.1.0", "description": "An OpenFn adaptor for use with Mailchimp", "main": "dist/index.cjs", "scripts": { diff --git a/packages/mailchimp/src/Adaptor.js b/packages/mailchimp/src/Adaptor.js index ec0020ac88..1b58d681e4 100644 --- a/packages/mailchimp/src/Adaptor.js +++ b/packages/mailchimp/src/Adaptor.js @@ -462,16 +462,18 @@ export { axios, md5 }; // What functions do you want from the common adaptor? export { - fn, - fnIf, alterState, + chunk, + combine, dataPath, dataValue, each, field, fields, + fn, + fnIf, lastReferenceValue, + log, merge, - chunk, sourceValue, } from '@openfn/language-common'; diff --git a/packages/mailgun/CHANGELOG.md b/packages/mailgun/CHANGELOG.md index bebc71ab09..70976228e8 100644 --- a/packages/mailgun/CHANGELOG.md +++ b/packages/mailgun/CHANGELOG.md @@ -1,5 +1,12 @@ # @openfn/language-mailgun +## 0.7.0 + +### Minor Changes + +- 71115af: export `combine` function from common +- bf26881: export `log` function from common + ## 0.6.7 ### Patch Changes diff --git a/packages/mailgun/ast.json b/packages/mailgun/ast.json index 182d36c1f4..a15716aa6a 100644 --- a/packages/mailgun/ast.json +++ b/packages/mailgun/ast.json @@ -374,6 +374,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": [ @@ -527,6 +570,55 @@ ] }, "valid": true + }, + { + "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 } ] } \ No newline at end of file diff --git a/packages/mailgun/package.json b/packages/mailgun/package.json index bc85626be7..1355d50946 100644 --- a/packages/mailgun/package.json +++ b/packages/mailgun/package.json @@ -1,7 +1,7 @@ { "name": "@openfn/language-mailgun", "label": "Mailgun", - "version": "0.6.7", + "version": "0.7.0", "description": "mailgun Language Pack for OpenFn", "main": "dist/index.cjs", "scripts": { diff --git a/packages/mailgun/src/Adaptor.js b/packages/mailgun/src/Adaptor.js index c4fae2aff2..e29ea8c166 100644 --- a/packages/mailgun/src/Adaptor.js +++ b/packages/mailgun/src/Adaptor.js @@ -44,7 +44,7 @@ export function execute(...operations) { return commonExecute( setupClient, ...operations, - teardownClient + teardownClient, )({ ...initialState, ...state }); }; } @@ -113,16 +113,18 @@ export function send(params) { } export { - fn, - fnIf, - field, alterState, - fields, - sourceValue, - merge, - each, + beta, + combine, dataPath, dataValue, + each, + field, + fields, + fn, + fnIf, lastReferenceValue, - beta, + log, + merge, + sourceValue, } from '@openfn/language-common'; diff --git a/packages/maximo/CHANGELOG.md b/packages/maximo/CHANGELOG.md index 089a24e9ed..f67c948f8c 100644 --- a/packages/maximo/CHANGELOG.md +++ b/packages/maximo/CHANGELOG.md @@ -1,5 +1,12 @@ # @openfn/language-maximo +## 0.6.0 + +### Minor Changes + +- 71115af: export `combine` function from common +- bf26881: export `log` function from common + ## 0.5.33 ### Patch Changes diff --git a/packages/maximo/ast.json b/packages/maximo/ast.json index fb71ae26fa..efbdb48fe6 100644 --- a/packages/maximo/ast.json +++ b/packages/maximo/ast.json @@ -466,6 +466,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": [ @@ -619,6 +662,55 @@ ] }, "valid": true + }, + { + "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 } ] } \ No newline at end of file diff --git a/packages/maximo/package.json b/packages/maximo/package.json index 06462ea693..023452c1ab 100644 --- a/packages/maximo/package.json +++ b/packages/maximo/package.json @@ -1,7 +1,7 @@ { "name": "@openfn/language-maximo", "label": "Maximo", - "version": "0.5.33", + "version": "0.6.0", "description": "OpenFn adaptor for IBM Maximo EAM", "main": "dist/index.cjs", "scripts": { diff --git a/packages/maximo/src/Adaptor.js b/packages/maximo/src/Adaptor.js index 1db986cdbd..55d0fd70a3 100644 --- a/packages/maximo/src/Adaptor.js +++ b/packages/maximo/src/Adaptor.js @@ -98,10 +98,10 @@ export function fetch(params) { console.log('POST succeeded.'); resolve(getResponseBody); } - } + }, ); } - } + }, ); }) .then(response => { @@ -168,7 +168,7 @@ export function create(params) { console.log('POST succeeded.'); resolve(body); } - } + }, ); }).then(data => { const nextState = { ...state, response: { body: data } }; @@ -236,7 +236,7 @@ export function update(params) { console.log('Update succeeded.'); resolve(body); } - } + }, ); }).then(data => { const nextState = { ...state, response: { body: data } }; @@ -304,7 +304,7 @@ export function update75(params) { console.log('Update succeeded.'); resolve(body); } - } + }, ); }).then(data => { const nextState = { ...state, response: { body: data } }; @@ -314,15 +314,17 @@ export function update75(params) { } export { + alterState, + combine, + dataPath, + dataValue, + each, field, fields, - sourceValue, fn, fnIf, - alterState, - each, - merge, - dataPath, - dataValue, lastReferenceValue, + log, + merge, + sourceValue, } from '@openfn/language-common'; diff --git a/packages/medicmobile/CHANGELOG.md b/packages/medicmobile/CHANGELOG.md index 2139ea0365..d3c4f0c025 100644 --- a/packages/medicmobile/CHANGELOG.md +++ b/packages/medicmobile/CHANGELOG.md @@ -1,5 +1,12 @@ # @openfn/language-medicmobile +## 0.6.0 + +### Minor Changes + +- 71115af: export `combine` function from common +- bf26881: export `log` function from common + ## 0.5.30 ### Patch Changes diff --git a/packages/medicmobile/ast.json b/packages/medicmobile/ast.json index a99c6ae821..1d79bf7558 100644 --- a/packages/medicmobile/ast.json +++ b/packages/medicmobile/ast.json @@ -494,6 +494,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": [ @@ -647,6 +690,55 @@ ] }, "valid": true + }, + { + "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 } ] } \ No newline at end of file diff --git a/packages/medicmobile/package.json b/packages/medicmobile/package.json index 3d270c94c8..85db7a6dcc 100644 --- a/packages/medicmobile/package.json +++ b/packages/medicmobile/package.json @@ -1,7 +1,7 @@ { "name": "@openfn/language-medicmobile", "label": "Medic Mobile", - "version": "0.5.30", + "version": "0.6.0", "description": "OpenFn adaptor for Medic Mobile", "main": "dist/index.cjs", "scripts": { diff --git a/packages/medicmobile/src/Adaptor.js b/packages/medicmobile/src/Adaptor.js index bee155fef2..d2e977ca89 100644 --- a/packages/medicmobile/src/Adaptor.js +++ b/packages/medicmobile/src/Adaptor.js @@ -61,7 +61,7 @@ export function fetchSubmissions(formId, params, postUrl) { json: submissions[i], }); console.log( - `Posted submission ${submissions[i].fields.meta.instanceID} ✓` + `Posted submission ${submissions[i].fields.meta.instanceID} ✓`, ); } return state; @@ -93,7 +93,7 @@ export function changesApi(params, callback) { if (error) return error; console.log(response); return new Error( - `Server responded with ${response.statusCode}:\n ${response.body}` + `Server responded with ${response.statusCode}:\n ${response.body}`, ); } @@ -142,7 +142,7 @@ export function changesApi(params, callback) { console.log('Request Success ✓'); resolve(body); } - } + }, ) .auth(username, password); }).then(response => { @@ -198,15 +198,17 @@ export function pickFormData(formId) { } export { - fn, - fnIf, alterState, + combine, dataPath, dataValue, each, field, fields, + fn, + fnIf, lastReferenceValue, + log, merge, sourceValue, } from '@openfn/language-common'; diff --git a/packages/memento/CHANGELOG.md b/packages/memento/CHANGELOG.md index 8c66028be1..a4da29f32a 100644 --- a/packages/memento/CHANGELOG.md +++ b/packages/memento/CHANGELOG.md @@ -1,5 +1,11 @@ # @openfn/language-memento +## 1.1.0 + +### Minor Changes + +- bf26881: export `log` function from common + ## 1.0.9 ### Patch Changes diff --git a/packages/memento/ast.json b/packages/memento/ast.json index e39e0f2569..362a01dba3 100644 --- a/packages/memento/ast.json +++ b/packages/memento/ast.json @@ -1131,6 +1131,55 @@ }, "valid": true }, + { + "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": [ diff --git a/packages/memento/package.json b/packages/memento/package.json index 2ee9f0f354..6597d8800a 100644 --- a/packages/memento/package.json +++ b/packages/memento/package.json @@ -1,6 +1,6 @@ { "name": "@openfn/language-memento", - "version": "1.0.9", + "version": "1.1.0", "description": "OpenFn adaptor for Memento Database", "type": "module", "exports": { diff --git a/packages/memento/src/Adaptor.js b/packages/memento/src/Adaptor.js index f6c0c1b6fa..41f837267b 100644 --- a/packages/memento/src/Adaptor.js +++ b/packages/memento/src/Adaptor.js @@ -232,6 +232,7 @@ export { fnIf, group, lastReferenceValue, + log, map, merge, scrubEmojis, diff --git a/packages/minio/CHANGELOG.md b/packages/minio/CHANGELOG.md index 942692bb91..fb3d6027ee 100644 --- a/packages/minio/CHANGELOG.md +++ b/packages/minio/CHANGELOG.md @@ -1,5 +1,11 @@ # @openfn/language-minio +## 1.1.0 + +### Minor Changes + +- bf26881: export `log` function from common + ## 1.0.3 ### Patch Changes diff --git a/packages/minio/ast.json b/packages/minio/ast.json index 80739bb073..222b5cf597 100644 --- a/packages/minio/ast.json +++ b/packages/minio/ast.json @@ -1383,6 +1383,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": [ diff --git a/packages/minio/package.json b/packages/minio/package.json index 42cdcb032f..0e9abe2396 100644 --- a/packages/minio/package.json +++ b/packages/minio/package.json @@ -1,6 +1,6 @@ { "name": "@openfn/language-minio", - "version": "1.0.3", + "version": "1.1.0", "description": "OpenFn minio adaptor", "type": "module", "exports": { diff --git a/packages/minio/src/Adaptor.js b/packages/minio/src/Adaptor.js index 13f9892b2c..d8109e9e5c 100644 --- a/packages/minio/src/Adaptor.js +++ b/packages/minio/src/Adaptor.js @@ -363,7 +363,6 @@ export { cursor, dataPath, dataValue, - parseCsv, dateFns, each, field, @@ -372,8 +371,10 @@ export { fnIf, group, lastReferenceValue, + log, map, merge, + parseCsv, scrubEmojis, sourceValue, util, diff --git a/packages/mogli/CHANGELOG.md b/packages/mogli/CHANGELOG.md index cd6891d2c3..c013355cfe 100644 --- a/packages/mogli/CHANGELOG.md +++ b/packages/mogli/CHANGELOG.md @@ -1,5 +1,11 @@ v0.1.6 +## 0.7.0 + +### Minor Changes + +- bf26881: export `log` function from common + ## 0.6.15 ### Patch Changes diff --git a/packages/mogli/ast.json b/packages/mogli/ast.json index 474870cf75..dd3aa8e8ea 100644 --- a/packages/mogli/ast.json +++ b/packages/mogli/ast.json @@ -825,6 +825,55 @@ ] }, "valid": true + }, + { + "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 } ] } \ No newline at end of file diff --git a/packages/mogli/package.json b/packages/mogli/package.json index 79a00ca6b8..3c702b71bc 100644 --- a/packages/mogli/package.json +++ b/packages/mogli/package.json @@ -1,7 +1,7 @@ { "name": "@openfn/language-mogli", "label": "Mogli", - "version": "0.6.15", + "version": "0.7.0", "description": "OpenFn adaptor for Mogli SMS", "main": "dist/index.cjs", "scripts": { diff --git a/packages/mogli/src/Adaptor.js b/packages/mogli/src/Adaptor.js index 740741c4a0..3a1b08f666 100644 --- a/packages/mogli/src/Adaptor.js +++ b/packages/mogli/src/Adaptor.js @@ -199,23 +199,24 @@ function expandReferences(state, attrs) { export { lookup, relationship } from './sourceHelpers.js'; export { - each, - join, - fields, - field, - source, - sourceValue, + alterState, + arrayToString, + beta, combine, - merge, dataPath, dataValue, - referencePath, - lastReferenceValue, - index, - beta, - toArray, - arrayToString, - alterState, + each, + field, + fields, fn, fnIf, + index, + join, + lastReferenceValue, + log, + merge, + referencePath, + source, + sourceValue, + toArray, } from '@openfn/language-common'; diff --git a/packages/mojatax/CHANGELOG.md b/packages/mojatax/CHANGELOG.md index d70c501056..02fad61452 100644 --- a/packages/mojatax/CHANGELOG.md +++ b/packages/mojatax/CHANGELOG.md @@ -1,5 +1,12 @@ # @openfn/language-mojatax +## 1.1.0 + +### Minor Changes + +- 71115af: export `combine` function from common +- bf26881: export `log` function from common + ## 1.0.24 ### Patch Changes diff --git a/packages/mojatax/ast.json b/packages/mojatax/ast.json index 6b67caa3bd..e3d051c22f 100644 --- a/packages/mojatax/ast.json +++ b/packages/mojatax/ast.json @@ -454,6 +454,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": [ @@ -693,6 +736,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 } ] } \ No newline at end of file diff --git a/packages/mojatax/package.json b/packages/mojatax/package.json index 5a3ca06165..1d708a1fc6 100644 --- a/packages/mojatax/package.json +++ b/packages/mojatax/package.json @@ -1,7 +1,7 @@ { "name": "@openfn/language-mojatax", "label": "MojaTax", - "version": "1.0.24", + "version": "1.1.0", "description": "OpenFn adaptor for MojaTax", "type": "module", "exports": { diff --git a/packages/mojatax/src/Adaptor.js b/packages/mojatax/src/Adaptor.js index 01044c7555..a9644f8f70 100644 --- a/packages/mojatax/src/Adaptor.js +++ b/packages/mojatax/src/Adaptor.js @@ -45,7 +45,7 @@ export function execute(...operations) { return state => { return commonExecute( util.authorize, - ...operations + ...operations, )({ ...initialState, ...state, @@ -103,7 +103,7 @@ export function request(method, path, body, options = {}, callback = s => s) { { data: resolvedData, ...resolvedoptions, - } + }, ); return util.prepareNextState(state, response, callback); @@ -111,15 +111,17 @@ export function request(method, path, body, options = {}, callback = s => s) { } export { + combine, + cursor, dataPath, dataValue, dateFns, - cursor, each, field, fields, fn, lastReferenceValue, + log, merge, sourceValue, } from '@openfn/language-common'; diff --git a/packages/mongodb/CHANGELOG.md b/packages/mongodb/CHANGELOG.md index 3edb12f722..66101ed21b 100644 --- a/packages/mongodb/CHANGELOG.md +++ b/packages/mongodb/CHANGELOG.md @@ -1,5 +1,12 @@ # @openfn/language-mongodb +## 2.2.0 + +### Minor Changes + +- 71115af: export `combine` function from common +- bf26881: export `log` function from common + ## 2.1.30 ### Patch Changes diff --git a/packages/mongodb/ast.json b/packages/mongodb/ast.json index cc87ab0a1a..42e2507b54 100644 --- a/packages/mongodb/ast.json +++ b/packages/mongodb/ast.json @@ -464,6 +464,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": [ @@ -617,6 +660,55 @@ ] }, "valid": true + }, + { + "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 } ] } \ No newline at end of file diff --git a/packages/mongodb/package.json b/packages/mongodb/package.json index e0694f7c06..a8935b9ca6 100644 --- a/packages/mongodb/package.json +++ b/packages/mongodb/package.json @@ -1,7 +1,7 @@ { "name": "@openfn/language-mongodb", "label": "MongoDB", - "version": "2.1.30", + "version": "2.2.0", "description": "A language package for working with MongoDb", "main": "dist/index.cjs", "scripts": { diff --git a/packages/mongodb/src/Adaptor.js b/packages/mongodb/src/Adaptor.js index 7ea8f85a0d..6aae132028 100644 --- a/packages/mongodb/src/Adaptor.js +++ b/packages/mongodb/src/Adaptor.js @@ -29,7 +29,7 @@ export function execute(...operations) { return commonExecute( connect, ...operations, - disconnect + disconnect, )({ ...initialState, ...state }); }; } @@ -43,17 +43,19 @@ export function execute(...operations) { * @returns {State} */ function connect(state) { - const { clusterHostname, username, password, protocol = "mongodb+srv", options = { "retryWrites": true, "w": "majority" } } = state.configuration; - + const { + clusterHostname, + username, + password, + protocol = 'mongodb+srv', + options = { retryWrites: true, w: 'majority' }, + } = state.configuration; + const uri = `${protocol}://${encodeURIComponent( - username - )}:${encodeURIComponent( - password - )}@${clusterHostname}/test${ - Object.keys(options).length ? "?" : "" - }${ - encodeURIComponent(new URLSearchParams(options).toString()) - }`; + username, + )}:${encodeURIComponent(password)}@${clusterHostname}/test${ + Object.keys(options).length ? '?' : '' + }${encodeURIComponent(new URLSearchParams(options).toString())}`; const client = new MongoClient(uri, { useNewUrlParser: true }); @@ -114,7 +116,7 @@ export function insertDocuments(params) { state.client.close(); } else { console.log( - `Inserted ${documents.length} documents into the collection` + `Inserted ${documents.length} documents into the collection`, ); console.log(JSON.stringify(result, null, 2)); const nextState = composeNextState(state, result); @@ -213,15 +215,15 @@ export function updateDocument(params) { } else { console.log( `Updated a document matching ${JSON.stringify( - filter - )} in the collection.` + filter, + )} in the collection.`, ); console.log(JSON.stringify(result, null, 2)); const nextState = composeNextState(state, result); if (callback) resolve(callback(nextState)); resolve(nextState); } - } + }, ); }); } catch (error) { @@ -232,15 +234,17 @@ export function updateDocument(params) { } export { + alterState, + combine, + dataPath, + dataValue, + each, field, fields, - sourceValue, fn, fnIf, - alterState, - each, - merge, - dataPath, - dataValue, lastReferenceValue, + log, + merge, + sourceValue, } from '@openfn/language-common'; diff --git a/packages/monnify/CHANGELOG.md b/packages/monnify/CHANGELOG.md index 727df3c8c3..9909ba5f10 100644 --- a/packages/monnify/CHANGELOG.md +++ b/packages/monnify/CHANGELOG.md @@ -1,5 +1,11 @@ # @openfn/language-monnify +## 1.1.0 + +### Minor Changes + +- bf26881: export `log` function from common + ## 1.0.6 ### Patch Changes diff --git a/packages/monnify/ast.json b/packages/monnify/ast.json index 35d215b3b5..0c23cf6613 100644 --- a/packages/monnify/ast.json +++ b/packages/monnify/ast.json @@ -1005,6 +1005,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": [ diff --git a/packages/monnify/package.json b/packages/monnify/package.json index 8a17ed7450..6d32474228 100644 --- a/packages/monnify/package.json +++ b/packages/monnify/package.json @@ -1,6 +1,6 @@ { "name": "@openfn/language-monnify", - "version": "1.0.6", + "version": "1.1.0", "description": "OpenFn monnify adaptor", "type": "module", "exports": { diff --git a/packages/monnify/src/Adaptor.js b/packages/monnify/src/Adaptor.js index d2f445cb08..75c2eda34c 100644 --- a/packages/monnify/src/Adaptor.js +++ b/packages/monnify/src/Adaptor.js @@ -182,6 +182,7 @@ export { fnIf, group, lastReferenceValue, + log, map, merge, scrubEmojis, diff --git a/packages/motherduck/CHANGELOG.md b/packages/motherduck/CHANGELOG.md index 98d21cb87d..7b242a5e82 100644 --- a/packages/motherduck/CHANGELOG.md +++ b/packages/motherduck/CHANGELOG.md @@ -1,5 +1,11 @@ # @openfn/language-motherduck +## 1.1.0 + +### Minor Changes + +- bf26881: export `log` function from common + ## 1.0.8 ### Patch Changes diff --git a/packages/motherduck/ast.json b/packages/motherduck/ast.json index 9e00fdb417..8e68d36af3 100644 --- a/packages/motherduck/ast.json +++ b/packages/motherduck/ast.json @@ -988,6 +988,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": [ diff --git a/packages/motherduck/package.json b/packages/motherduck/package.json index 9755702402..57f1051d58 100644 --- a/packages/motherduck/package.json +++ b/packages/motherduck/package.json @@ -1,6 +1,6 @@ { "name": "@openfn/language-motherduck", - "version": "1.0.8", + "version": "1.1.0", "description": "OpenFn MotherDuck cloud database adaptor", "type": "module", "exports": { diff --git a/packages/motherduck/src/Adaptor.js b/packages/motherduck/src/Adaptor.js index 991e5e0ed9..0cc673e096 100644 --- a/packages/motherduck/src/Adaptor.js +++ b/packages/motherduck/src/Adaptor.js @@ -269,6 +269,7 @@ export function insert(table, records, options = {}) { export { alterState, arrayToString, + as, combine, cursor, dataPath, @@ -281,10 +282,10 @@ export { fnIf, group, lastReferenceValue, + log, map, merge, sourceValue, - as, } from '@openfn/language-common'; export { util }; diff --git a/packages/mpesa/CHANGELOG.md b/packages/mpesa/CHANGELOG.md index e2baa8b084..60b1000e1c 100644 --- a/packages/mpesa/CHANGELOG.md +++ b/packages/mpesa/CHANGELOG.md @@ -1,5 +1,12 @@ # @openfn/language-mpesa +## 1.2.0 + +### Minor Changes + +- 71115af: export `combine` function from common +- bf26881: export `log` function from common + ## 1.1.14 ### Patch Changes diff --git a/packages/mpesa/ast.json b/packages/mpesa/ast.json index a7414ec0dd..264fd5cdf4 100644 --- a/packages/mpesa/ast.json +++ b/packages/mpesa/ast.json @@ -303,7 +303,7 @@ "tags": [ { "title": "example", - "description": "request(\"POST\", \"/mpesa/c2b/v1/registerurl\", \n {\n \"ShortCode\": 600426,\n \"ResponseType\": \"Completed\",\n \"ConfirmationURL\": \"https://mydomain.com/confirmation\",\n \"ValidationURL\": \"https://mydomain.com/validation\"\n });", + "description": "request(\"POST\", \"/mpesa/c2b/v1/registerurl\",\n {\n \"ShortCode\": 600426,\n \"ResponseType\": \"Completed\",\n \"ConfirmationURL\": \"https://mydomain.com/confirmation\",\n \"ValidationURL\": \"https://mydomain.com/validation\"\n });", "caption": "Register a URL to receive payment notifications" }, { @@ -650,6 +650,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": [ @@ -890,6 +933,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": [ diff --git a/packages/mpesa/package.json b/packages/mpesa/package.json index 88ab005f04..b2ee3a7d08 100644 --- a/packages/mpesa/package.json +++ b/packages/mpesa/package.json @@ -1,7 +1,7 @@ { "name": "@openfn/language-mpesa", "label": "Mpesa", - "version": "1.1.14", + "version": "1.2.0", "description": "OpenFn adaptor for M-Pesa", "type": "module", "exports": { diff --git a/packages/mpesa/src/Adaptor.js b/packages/mpesa/src/Adaptor.js index 953122a7f3..d81291db18 100644 --- a/packages/mpesa/src/Adaptor.js +++ b/packages/mpesa/src/Adaptor.js @@ -19,7 +19,6 @@ import * as util from './Utils.js'; * @property {object} headers - An object of headers to append to the request. */ - /** * STKPush request data object * @typedef {Object} STKPushObject @@ -33,7 +32,6 @@ import * as util from './Utils.js'; * @property {string} TransactionDesc - Any additional information/comment that can be sent along with the request from you system. */ - /** * Initiate a STK pin prompt to a Safaricom mobile number. * @function @@ -55,10 +53,9 @@ import * as util from './Utils.js'; */ export function stkPush(data, options = {}) { return async state => { - const { short_code, pass_key } = state.configuration; - const timestamp = util.getTimestamp() + const timestamp = util.getTimestamp(); const password = short_code + pass_key + timestamp; @@ -72,17 +69,21 @@ export function stkPush(data, options = {}) { console.log('Initiating STK Push request...'); - const response = await util.request(state, 'POST', '/mpesa/stkpush/v1/processrequest', { ...options, body }) - return util.prepareNextState(state, response) - } + const response = await util.request( + state, + 'POST', + '/mpesa/stkpush/v1/processrequest', + { ...options, body }, + ); + return util.prepareNextState(state, response); + }; } - /** * Check transaction status data object. * @typedef {Object} TransactionStatusObject * @public - * @property {string} Initiator - The name of the initiator initiating the request. + * @property {string} Initiator - The name of the initiator initiating the request. * @property {string} SecurityCredential - Encrypted credential of the user getting transaction status. * @property {string} TransactionID - Unique identifier to identify a transaction on Mpesa. * @property {number} PartyA - Organization/MSISDN receiving the transaction. @@ -93,7 +94,6 @@ export function stkPush(data, options = {}) { * @property {string} Occassion - Optional parameter. */ - /** * Check the status of the transaction * @function @@ -117,7 +117,6 @@ export function stkPush(data, options = {}) { */ export function checkTransactionStatus(data, options = {}) { return async state => { - const { short_code, pass_key } = state.configuration; const timestamp = util.getTimestamp(); @@ -129,14 +128,19 @@ export function checkTransactionStatus(data, options = {}) { Password: Buffer.from(password).toString('base64'), Timestamp: timestamp, CommandID: 'TransactionStatusQuery', - ...data + ...data, }; console.log('Initiating check transaction request...'); - const response = await util.request(state, 'POST', '/mpesa/transactionstatus/v1/query', { ...options, body }); - return util.prepareNextState(state, response) - } + const response = await util.request( + state, + 'POST', + '/mpesa/transactionstatus/v1/query', + { ...options, body }, + ); + return util.prepareNextState(state, response); + }; } /** @@ -146,7 +150,7 @@ export function checkTransactionStatus(data, options = {}) { * @property {numeric} ShortCode - Usually, a unique number is tagged to an M-PESA pay bill/till number of the organization. * @property {string} ResponseType - This parameter specifies what is to happen if for any reason the validation URL is not reachable. Sample values: 'Canceled', 'Completed' * @property {URL} ConfirmationURL - This is the URL that receives the confirmation request from API upon payment completion. - * @property {URL} ValidationURL - This is the URL that receives the validation request from the API upon payment submission. + * @property {URL} ValidationURL - This is the URL that receives the validation request from the API upon payment submission. */ /** @@ -167,15 +171,18 @@ export function checkTransactionStatus(data, options = {}) { */ export function registerUrl(data, options) { return async state => { - console.log('Initiating register URL request...'); - const response = await util.request(state, 'POST', '/mpesa/c2b/v1/registerurl', { ...options, body: { ...data } }); - return util.prepareNextState(state, response) - } + const response = await util.request( + state, + 'POST', + '/mpesa/c2b/v1/registerurl', + { ...options, body: { ...data } }, + ); + return util.prepareNextState(state, response); + }; } - /** * Remit tax parameter definition * @typedef {Object} RemitTaxObject @@ -212,20 +219,24 @@ export function registerUrl(data, options) { */ export function remitTax(data, options = {}) { return async state => { - const body = { SenderIdentifierType: '4', RecieverIdentifierType: '4', PartyB: 572572, CommandID: 'PayTaxToKRA', ...data, - } + }; console.log('Initiating remit tax request...'); - const response = await util.request(state, 'POST', '/mpesa/b2b/v1/remittax', { ...options, body }); - return util.prepareNextState(state, response) - } + const response = await util.request( + state, + 'POST', + '/mpesa/b2b/v1/remittax', + { ...options, body }, + ); + return util.prepareNextState(state, response); + }; } /** @@ -242,7 +253,6 @@ export function remitTax(data, options = {}) { * @property {URL} ResultURL - A URL that will be used to send transaction results after processing. */ - /** * Pay for goods and services directly from your business account to a till number, merchant store number or Merchant HO * @function @@ -267,25 +277,29 @@ export function remitTax(data, options = {}) { */ export function buyGoods(data, options = {}) { return async state => { - const body = { CommandID: 'BusinessBuyGoods', SenderIdentifierType: '4', RecieverIdentifierType: '4', ...data, - } + }; console.log('Initiating buy goods request...'); - const response = await util.request(state, 'POST', '/mpesa/b2b/v1/paymentrequest', { ...options, body }); - return util.prepareNextState(state, response) - } + const response = await util.request( + state, + 'POST', + '/mpesa/b2b/v1/paymentrequest', + { ...options, body }, + ); + return util.prepareNextState(state, response); + }; } /** * Make a general HTTP request * @example