@openfn/language-googlesheets 2.3.0 → 2.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/ast.json CHANGED
@@ -68,6 +68,15 @@
68
68
  },
69
69
  "name": "params.values"
70
70
  },
71
+ {
72
+ "title": "param",
73
+ "description": "(Optional) Callback function",
74
+ "type": {
75
+ "type": "NameExpression",
76
+ "name": "function"
77
+ },
78
+ "name": "callback"
79
+ },
71
80
  {
72
81
  "title": "returns",
73
82
  "description": null,
@@ -122,6 +131,15 @@
122
131
  },
123
132
  "name": "range"
124
133
  },
134
+ {
135
+ "title": "param",
136
+ "description": "(Optional) callback function",
137
+ "type": {
138
+ "type": "NameExpression",
139
+ "name": "function"
140
+ },
141
+ "name": "callback"
142
+ },
125
143
  {
126
144
  "title": "returns",
127
145
  "description": "spreadsheet information",
@@ -132,7 +150,7 @@
132
150
  }
133
151
  ]
134
152
  },
135
- "valid": false
153
+ "valid": true
136
154
  }
137
155
  ],
138
156
  "exports": [],
@@ -596,6 +614,83 @@
596
614
  ]
597
615
  },
598
616
  "valid": true
617
+ },
618
+ {
619
+ "name": "cursor",
620
+ "params": [
621
+ "value",
622
+ "options"
623
+ ],
624
+ "docs": {
625
+ "description": "Sets a cursor property on state.\nSupports natural language dates like `now`, `today`, `yesterday`, `n hours ago`, `n days ago`, and `start`,\nwhich will be converted relative to the environment (ie, the Lightning or CLI locale). Custom timezones \nare not yet supported.\nSee the usage guide at @{link https://docs.openfn.org/documentation/jobs/job-writing-guide#using-cursors}",
626
+ "tags": [
627
+ {
628
+ "title": "public",
629
+ "description": null,
630
+ "type": null
631
+ },
632
+ {
633
+ "title": "example",
634
+ "description": "cursor($.cursor, { defaultValue: 'today' })",
635
+ "caption": "Use a cursor from state if present, or else use the default value"
636
+ },
637
+ {
638
+ "title": "example",
639
+ "description": "cursor(22)",
640
+ "caption": "Use a pagination cursor"
641
+ },
642
+ {
643
+ "title": "function",
644
+ "description": null,
645
+ "name": null
646
+ },
647
+ {
648
+ "title": "param",
649
+ "description": "the cursor value. Usually an ISO date, natural language date, or page number",
650
+ "type": {
651
+ "type": "NameExpression",
652
+ "name": "any"
653
+ },
654
+ "name": "value"
655
+ },
656
+ {
657
+ "title": "param",
658
+ "description": "options to control the cursor.",
659
+ "type": {
660
+ "type": "NameExpression",
661
+ "name": "object"
662
+ },
663
+ "name": "options"
664
+ },
665
+ {
666
+ "title": "param",
667
+ "description": "set the cursor key. Will persist through the whole run.",
668
+ "type": {
669
+ "type": "NameExpression",
670
+ "name": "string"
671
+ },
672
+ "name": "options.key"
673
+ },
674
+ {
675
+ "title": "param",
676
+ "description": "the value to use if value is falsy",
677
+ "type": {
678
+ "type": "NameExpression",
679
+ "name": "any"
680
+ },
681
+ "name": "options.defaultValue"
682
+ },
683
+ {
684
+ "title": "returns",
685
+ "description": null,
686
+ "type": {
687
+ "type": "NameExpression",
688
+ "name": "Operation"
689
+ }
690
+ }
691
+ ]
692
+ },
693
+ "valid": false
599
694
  }
600
695
  ]
601
696
  }
package/dist/index.cjs CHANGED
@@ -23,6 +23,7 @@ __export(src_exports, {
23
23
  appendValues: () => appendValues,
24
24
  batchUpdateValues: () => batchUpdateValues,
25
25
  combine: () => import_language_common2.combine,
26
+ cursor: () => import_language_common2.cursor,
26
27
  dataPath: () => import_language_common2.dataPath,
27
28
  dataValue: () => import_language_common2.dataValue,
28
29
  default: () => src_default,
@@ -46,6 +47,7 @@ __export(Adaptor_exports, {
46
47
  appendValues: () => appendValues,
47
48
  batchUpdateValues: () => batchUpdateValues,
48
49
  combine: () => import_language_common2.combine,
50
+ cursor: () => import_language_common2.cursor,
49
51
  dataPath: () => import_language_common2.dataPath,
50
52
  dataValue: () => import_language_common2.dataValue,
51
53
  each: () => import_language_common2.each,
@@ -201,6 +203,7 @@ var src_default = Adaptor_exports;
201
203
  appendValues,
202
204
  batchUpdateValues,
203
205
  combine,
206
+ cursor,
204
207
  dataPath,
205
208
  dataValue,
206
209
  each,
package/dist/index.js CHANGED
@@ -11,6 +11,7 @@ __export(Adaptor_exports, {
11
11
  appendValues: () => appendValues,
12
12
  batchUpdateValues: () => batchUpdateValues,
13
13
  combine: () => combine,
14
+ cursor: () => cursor,
14
15
  dataPath: () => dataPath,
15
16
  dataValue: () => dataValue,
16
17
  each: () => each,
@@ -36,6 +37,7 @@ import { google } from "googleapis";
36
37
  import {
37
38
  alterState,
38
39
  combine,
40
+ cursor,
39
41
  dataPath,
40
42
  dataValue,
41
43
  each,
@@ -184,6 +186,7 @@ export {
184
186
  appendValues,
185
187
  batchUpdateValues,
186
188
  combine,
189
+ cursor,
187
190
  dataPath,
188
191
  dataValue,
189
192
  src_default as default,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@openfn/language-googlesheets",
3
- "version": "2.3.0",
3
+ "version": "2.4.0",
4
4
  "description": "A Google Sheets Language Pack for OpenFn",
5
5
  "homepage": "https://docs.openfn.org",
6
6
  "repository": {
@@ -23,7 +23,7 @@
23
23
  "configuration-schema.json"
24
24
  ],
25
25
  "dependencies": {
26
- "@openfn/language-common": "^1.12.0",
26
+ "@openfn/language-common": "^1.13.0",
27
27
  "googleapis": "100.0.0"
28
28
  },
29
29
  "devDependencies": {
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Execute a sequence of operations.
2
+ * Execute a sequence of oper.
3
3
  * Wraps `language-common/execute`, and prepends initial state for http.
4
4
  * @example
5
5
  * execute(
@@ -29,13 +29,14 @@ export function execute(...operations: Operations): Operation;
29
29
  * @param {string} [params.spreadsheetId] The spreadsheet ID.
30
30
  * @param {string} [params.range] The range of values to update.
31
31
  * @param {array} [params.values] A 2d array of values to update.
32
+ * @param {function} callback - (Optional) Callback function
32
33
  * @returns {Operation}
33
34
  */
34
35
  export function appendValues(params: {
35
36
  spreadsheetId?: string;
36
37
  range?: string;
37
38
  values?: any[];
38
- }, callback?: (s: any) => any): Operation;
39
+ }, callback?: Function): Operation;
39
40
  /**
40
41
  * Batch update values in a Spreadsheet.
41
42
  * @example
@@ -53,6 +54,7 @@ export function appendValues(params: {
53
54
  * @param {string} [params.range] The range of values to update.
54
55
  * @param {string} [params.valueInputOption] (Optional) Value update options. Defaults to 'USER_ENTERED'
55
56
  * @param {array} [params.values] A 2d array of values to update.
57
+ * @param {function} callback - (Optional) callback function
56
58
  * @returns {Operation} spreadsheet information
57
59
  */
58
60
  export function batchUpdateValues(params: {
@@ -60,7 +62,7 @@ export function batchUpdateValues(params: {
60
62
  range?: string;
61
63
  valueInputOption?: string;
62
64
  values?: any[];
63
- }, callback?: (s: any) => any): Operation;
65
+ }, callback?: Function): Operation;
64
66
  /**
65
67
  * Gets cell values from a Spreadsheet.
66
68
  * @public
@@ -69,7 +71,8 @@ export function batchUpdateValues(params: {
69
71
  * @function
70
72
  * @param {string} spreadsheetId The spreadsheet ID.
71
73
  * @param {string} range The sheet range.
74
+ * @param {function} callback - (Optional) callback function
72
75
  * @returns {Operation} spreadsheet information
73
76
  */
74
- export function getValues(spreadsheetId: string, range: string, callback?: (s: any) => any): Operation;
75
- export { alterState, combine, dataPath, dataValue, each, field, fields, fn, http, lastReferenceValue, merge, sourceValue } from "@openfn/language-common";
77
+ export function getValues(spreadsheetId: string, range: string, callback?: Function): Operation;
78
+ export { alterState, combine, cursor, dataPath, dataValue, each, field, fields, fn, http, lastReferenceValue, merge, sourceValue } from "@openfn/language-common";