Skip to content

Commit

Permalink
Merge pull request #756 from OpenFn/cursor-logs
Browse files Browse the repository at this point in the history
improve cursor logs
  • Loading branch information
josephjclark authored Sep 24, 2024
2 parents d84f1fa + 3d0d2f6 commit 4a20313
Show file tree
Hide file tree
Showing 92 changed files with 377 additions and 53 deletions.
7 changes: 7 additions & 0 deletions packages/asana/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# @openfn/language-asana

## 4.0.2

### Patch Changes

- Updated dependencies [77a690f]
- @openfn/language-common@2.0.2

## 4.0.1

### Patch Changes
Expand Down
2 changes: 1 addition & 1 deletion packages/asana/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@openfn/language-asana",
"version": "4.0.1",
"version": "4.0.2",
"description": "An adaptor to access objects in Asana",
"homepage": "https://docs.openfn.org",
"repository": {
Expand Down
7 changes: 7 additions & 0 deletions packages/azure-storage/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# @openfn/language-azure-storage

## 2.0.2

### Patch Changes

- Updated dependencies [77a690f]
- @openfn/language-common@2.0.2

## 2.0.1

### Patch Changes
Expand Down
2 changes: 1 addition & 1 deletion packages/azure-storage/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@openfn/language-azure-storage",
"version": "2.0.1",
"version": "2.0.2",
"description": "OpenFn adaptor for Azure Storage",
"type": "module",
"exports": {
Expand Down
7 changes: 7 additions & 0 deletions packages/beyonic/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# @openfn/language-beyonic

## 0.3.4

### Patch Changes

- Updated dependencies [77a690f]
- @openfn/language-common@2.0.2

## 0.3.3

### Patch Changes
Expand Down
2 changes: 1 addition & 1 deletion packages/beyonic/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@openfn/language-beyonic",
"version": "0.3.3",
"version": "0.3.4",
"description": "beyonic Language Pack for OpenFn",
"homepage": "https://docs.openfn.org",
"repository": {
Expand Down
7 changes: 7 additions & 0 deletions packages/bigquery/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# @openfn/language-bigquery

## 3.0.2

### Patch Changes

- Updated dependencies [77a690f]
- @openfn/language-common@2.0.2

## 3.0.1

### Patch Changes
Expand Down
2 changes: 1 addition & 1 deletion packages/bigquery/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@openfn/language-bigquery",
"version": "3.0.1",
"version": "3.0.2",
"description": "A Google BigQuery language package for use with Open Function",
"main": "dist/index.cjs",
"scripts": {
Expand Down
7 changes: 7 additions & 0 deletions packages/cartodb/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# @openfn/language-cartodb

## 0.4.4

### Patch Changes

- Updated dependencies [77a690f]
- @openfn/language-common@2.0.2

## 0.4.3

### Patch Changes
Expand Down
2 changes: 1 addition & 1 deletion packages/cartodb/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@openfn/language-cartodb",
"version": "0.4.3",
"version": "0.4.4",
"description": "cartodb Language Pack for OpenFn",
"main": "dist/index.cjs",
"scripts": {
Expand Down
7 changes: 7 additions & 0 deletions packages/cht/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# @openfn/language-cht

## 1.0.2

### Patch Changes

- Updated dependencies [77a690f]
- @openfn/language-common@2.0.2

## 1.0.1

### Patch Changes
Expand Down
2 changes: 1 addition & 1 deletion packages/cht/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@openfn/language-cht",
"version": "1.0.1",
"version": "1.0.2",
"description": "OpenFn CHT adaptor",
"type": "module",
"exports": {
Expand Down
7 changes: 7 additions & 0 deletions packages/commcare/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# @openfn/language-commcare

## 3.1.2

### Patch Changes

- Updated dependencies [77a690f]
- @openfn/language-common@2.0.2

## 3.1.1

### Patch Changes
Expand Down
2 changes: 1 addition & 1 deletion packages/commcare/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@openfn/language-commcare",
"version": "3.1.1",
"version": "3.1.2",
"description": "Commcare Language Pack for OpenFn",
"homepage": "https://docs.openfn.org",
"repository": {
Expand Down
6 changes: 6 additions & 0 deletions packages/common/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
## 2.0.0

## 2.0.2

### Patch Changes

- 77a690f: improve cursor setup message

## 2.0.1

### Patch Changes
Expand Down
2 changes: 1 addition & 1 deletion packages/common/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@openfn/language-common",
"version": "2.0.1",
"version": "2.0.2",
"description": "Common Expressions for OpenFn",
"homepage": "https://docs.openfn.org",
"repository": {
Expand Down
4 changes: 2 additions & 2 deletions packages/common/src/Adaptor.js
Original file line number Diff line number Diff line change
Expand Up @@ -877,12 +877,12 @@ export function cursor(value, options = {}) {
// See https://date-fns.org/v3.6.0/docs/format
dateFns.format(date, 'HH:MM d MMM yyyy (OOO)');

console.log(`Setting cursor "${cursor}" to: ${formatted}`);
console.log(`Setting ${cursorKey} "${cursor}" to: ${formatted}`);
return state;
}
}
state[cursorKey] = format?.(cursor) ?? cursor;
console.log('Setting cursor to:', state[cursorKey]);
console.log(`Setting ${cursorKey} to:`, state[cursorKey]);

return state;
};
Expand Down
17 changes: 17 additions & 0 deletions packages/common/test/index.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -926,6 +926,23 @@ describe('cursor', () => {
});

// testing the log output is hard here, I've only verified it manally
it('should log the correct message with multiple arguments', () => {
const state = {};
let originalLog;
let consoleOutput = [];
// Setup: Override console.log
originalLog = console.log;
console.log = (...args) => consoleOutput.push(args);

cursor(1234, { key: 'lastRunDateTime' })(state);
expect(consoleOutput[0]).to.deep.equal([
'Setting lastRunDateTime to:',
1234,
]);

// Teardown: Restore console.log
console.log = originalLog;
});
it('should use an object', () => {
const state = {};
const c = { page: 22, next: 23 };
Expand Down
7 changes: 7 additions & 0 deletions packages/dhis2/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# @openfn/language-dhis2

## 5.0.2

### Patch Changes

- Updated dependencies [77a690f]
- @openfn/language-common@2.0.2

## 5.0.1

### Patch Changes
Expand Down
2 changes: 1 addition & 1 deletion packages/dhis2/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@openfn/language-dhis2",
"version": "5.0.1",
"version": "5.0.2",
"description": "DHIS2 Language Pack for OpenFn",
"homepage": "https://docs.openfn.org",
"repository": {
Expand Down
7 changes: 7 additions & 0 deletions packages/dynamics/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# @openfn/language-dynamics

## 0.5.5

### Patch Changes

- Updated dependencies [77a690f]
- @openfn/language-common@2.0.2

## 0.5.4

### Patch Changes
Expand Down
4 changes: 2 additions & 2 deletions packages/dynamics/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@openfn/language-dynamics",
"version": "0.5.4",
"version": "0.5.5",
"description": "A Microsoft Dynamics Language Pack for OpenFn",
"main": "dist/index.cjs",
"scripts": {
Expand All @@ -20,7 +20,7 @@
"configuration-schema.json"
],
"dependencies": {
"@openfn/language-common": "2.0.1",
"@openfn/language-common": "2.0.2",
"request": "^2.72.0"
},
"devDependencies": {
Expand Down
7 changes: 7 additions & 0 deletions packages/facebook/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# @openfn/language-facebook

## 0.4.3

### Patch Changes

- Updated dependencies [77a690f]
- @openfn/language-common@2.0.2

## 0.4.2

### Patch Changes
Expand Down
2 changes: 1 addition & 1 deletion packages/facebook/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@openfn/language-facebook",
"version": "0.4.2",
"version": "0.4.3",
"description": "An Language Package for Facebook Messenger API",
"main": "dist/index.cjs",
"scripts": {
Expand Down
7 changes: 7 additions & 0 deletions packages/googlesheets/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# @openfn/language-googlesheets

## 3.0.2

### Patch Changes

- Updated dependencies [77a690f]
- @openfn/language-common@2.0.2

## 3.0.1

### Patch Changes
Expand Down
2 changes: 1 addition & 1 deletion packages/googlesheets/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@openfn/language-googlesheets",
"version": "3.0.1",
"version": "3.0.2",
"description": "A Google Sheets Language Pack for OpenFn",
"homepage": "https://docs.openfn.org",
"repository": {
Expand Down
7 changes: 7 additions & 0 deletions packages/hive/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# @openfn/language-hive

## 0.3.3

### Patch Changes

- Updated dependencies [77a690f]
- @openfn/language-common@2.0.2

## 0.3.2

### Patch Changes
Expand Down
2 changes: 1 addition & 1 deletion packages/hive/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@openfn/language-hive",
"version": "0.3.2",
"version": "0.3.3",
"description": "An Apache HIVE adaptor for OpenFn",
"type": "module",
"exports": {
Expand Down
7 changes: 7 additions & 0 deletions packages/http/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# @openfn/language-http

## 6.4.4

### Patch Changes

- Updated dependencies [77a690f]
- @openfn/language-common@2.0.2

## 6.4.3

### Patch Changes
Expand Down
2 changes: 1 addition & 1 deletion packages/http/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@openfn/language-http",
"version": "6.4.3",
"version": "6.4.4",
"description": "An HTTP request language package for use with Open Function",
"homepage": "https://docs.openfn.org",
"repository": {
Expand Down
7 changes: 7 additions & 0 deletions packages/khanacademy/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# @openfn/language-khanacademy

## 0.5.3

### Patch Changes

- Updated dependencies [77a690f]
- @openfn/language-common@2.0.2

## 0.5.2

### Patch Changes
Expand Down
2 changes: 1 addition & 1 deletion packages/khanacademy/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@openfn/language-khanacademy",
"version": "0.5.2",
"version": "0.5.3",
"description": "A Khan Academy Language Pack for OpenFn",
"main": "dist/index.cjs",
"scripts": {
Expand Down
7 changes: 7 additions & 0 deletions packages/mailchimp/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# @openfn/language-mailchimp

## 1.0.4

### Patch Changes

- Updated dependencies [77a690f]
- @openfn/language-common@2.0.2

## 1.0.3

### Patch Changes
Expand Down
2 changes: 1 addition & 1 deletion packages/mailchimp/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@openfn/language-mailchimp",
"version": "1.0.3",
"version": "1.0.4",
"description": "An OpenFn adaptor for use with Mailchimp",
"main": "dist/index.cjs",
"scripts": {
Expand Down
7 changes: 7 additions & 0 deletions packages/mailgun/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# @openfn/language-mailgun

## 0.5.3

### Patch Changes

- Updated dependencies [77a690f]
- @openfn/language-common@2.0.2

## 0.5.2

### Patch Changes
Expand Down
Loading

0 comments on commit 4a20313

Please sign in to comment.