@openfn/language-gmail 1.2.0 → 1.3.1
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 +22 -4
- package/dist/index.cjs +7 -2
- package/dist/index.js +7 -2
- package/package.json +3 -3
- package/types/Adaptor.d.ts +2 -2
package/ast.json
CHANGED
|
@@ -77,10 +77,28 @@
|
|
|
77
77
|
},
|
|
78
78
|
{
|
|
79
79
|
"title": "param",
|
|
80
|
-
"description": "The message configuration object.",
|
|
81
|
-
"type": {
|
|
82
|
-
"type": "
|
|
83
|
-
"
|
|
80
|
+
"description": "The message configuration object or array of objects.",
|
|
81
|
+
"type": {
|
|
82
|
+
"type": "UnionType",
|
|
83
|
+
"elements": [
|
|
84
|
+
{
|
|
85
|
+
"type": "NameExpression",
|
|
86
|
+
"name": "SendMessageOptions"
|
|
87
|
+
},
|
|
88
|
+
{
|
|
89
|
+
"type": "TypeApplication",
|
|
90
|
+
"expression": {
|
|
91
|
+
"type": "NameExpression",
|
|
92
|
+
"name": "Array"
|
|
93
|
+
},
|
|
94
|
+
"applications": [
|
|
95
|
+
{
|
|
96
|
+
"type": "NameExpression",
|
|
97
|
+
"name": "SendMessageOptions"
|
|
98
|
+
}
|
|
99
|
+
]
|
|
100
|
+
}
|
|
101
|
+
]
|
|
84
102
|
},
|
|
85
103
|
"name": "message"
|
|
86
104
|
},
|
package/dist/index.cjs
CHANGED
|
@@ -415,9 +415,14 @@ function getContentsFromMessages(options) {
|
|
|
415
415
|
function sendMessage(message) {
|
|
416
416
|
return async (state) => {
|
|
417
417
|
const [resolvedMessage] = (0, import_util.expandReferences)(state, message);
|
|
418
|
-
const
|
|
418
|
+
const messages = Array.isArray(resolvedMessage) ? resolvedMessage : [resolvedMessage];
|
|
419
|
+
const results = [];
|
|
420
|
+
for (const msg of messages) {
|
|
421
|
+
const result = await sendMessageWithAttachments(msg);
|
|
422
|
+
results.push(result);
|
|
423
|
+
}
|
|
419
424
|
return {
|
|
420
|
-
...(0, import_language_common.composeNextState)(state,
|
|
425
|
+
...(0, import_language_common.composeNextState)(state, results)
|
|
421
426
|
};
|
|
422
427
|
};
|
|
423
428
|
}
|
package/dist/index.js
CHANGED
|
@@ -394,9 +394,14 @@ function getContentsFromMessages(options) {
|
|
|
394
394
|
function sendMessage(message) {
|
|
395
395
|
return async (state) => {
|
|
396
396
|
const [resolvedMessage] = expandReferences(state, message);
|
|
397
|
-
const
|
|
397
|
+
const messages = Array.isArray(resolvedMessage) ? resolvedMessage : [resolvedMessage];
|
|
398
|
+
const results = [];
|
|
399
|
+
for (const msg of messages) {
|
|
400
|
+
const result = await sendMessageWithAttachments(msg);
|
|
401
|
+
results.push(result);
|
|
402
|
+
}
|
|
398
403
|
return {
|
|
399
|
-
...composeNextState(state,
|
|
404
|
+
...composeNextState(state, results)
|
|
400
405
|
};
|
|
401
406
|
};
|
|
402
407
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@openfn/language-gmail",
|
|
3
|
-
"
|
|
3
|
+
"label": "Gmail",
|
|
4
|
+
"version": "1.3.1",
|
|
4
5
|
"description": "OpenFn gmail adaptor",
|
|
5
6
|
"type": "module",
|
|
6
7
|
"exports": {
|
|
@@ -22,13 +23,12 @@
|
|
|
22
23
|
"dependencies": {
|
|
23
24
|
"googleapis": "100.0.0",
|
|
24
25
|
"jszip": "^3.10.1",
|
|
25
|
-
"@openfn/language-common": "2.
|
|
26
|
+
"@openfn/language-common": "2.5.0"
|
|
26
27
|
},
|
|
27
28
|
"devDependencies": {
|
|
28
29
|
"assertion-error": "2.0.0",
|
|
29
30
|
"chai": "4.3.6",
|
|
30
31
|
"deep-eql": "4.1.1",
|
|
31
|
-
"esno": "^0.16.3",
|
|
32
32
|
"mocha": "^10.7.3",
|
|
33
33
|
"rimraf": "3.0.2",
|
|
34
34
|
"undici": "^5.22.1"
|
package/types/Adaptor.d.ts
CHANGED
|
@@ -61,7 +61,7 @@ export function getContentsFromMessages(options: Options): Operation;
|
|
|
61
61
|
*
|
|
62
62
|
* @public
|
|
63
63
|
* @function
|
|
64
|
-
* @param {SendMessageOptions} message - The message configuration object.
|
|
64
|
+
* @param {SendMessageOptions|SendMessageOptions[]} message - The message configuration object or array of objects.
|
|
65
65
|
* @state {Object} data - The Gmail API response from sending the message.
|
|
66
66
|
* @returns {Operation}
|
|
67
67
|
* @example
|
|
@@ -74,7 +74,7 @@ export function getContentsFromMessages(options: Options): Operation;
|
|
|
74
74
|
* ]
|
|
75
75
|
* })
|
|
76
76
|
*/
|
|
77
|
-
export function sendMessage(message: SendMessageOptions): Operation;
|
|
77
|
+
export function sendMessage(message: SendMessageOptions | SendMessageOptions[]): Operation;
|
|
78
78
|
/**
|
|
79
79
|
* Execute a sequence of operations.
|
|
80
80
|
* Wraps `language-common/execute`, and prepends initial state for http.
|