@openfn/language-asana 2.1.0 → 2.1.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 +48 -0
- package/dist/index.cjs +37 -3
- package/dist/index.js +19 -2
- package/package.json +13 -10
- package/types/Adaptor.d.ts +96 -0
- package/types/index.d.ts +3 -114
package/ast.json
CHANGED
|
@@ -338,6 +338,14 @@
|
|
|
338
338
|
"name": "Function"
|
|
339
339
|
},
|
|
340
340
|
"name": "func"
|
|
341
|
+
},
|
|
342
|
+
{
|
|
343
|
+
"title": "returns",
|
|
344
|
+
"description": null,
|
|
345
|
+
"type": {
|
|
346
|
+
"type": "NameExpression",
|
|
347
|
+
"name": "Operation"
|
|
348
|
+
}
|
|
341
349
|
}
|
|
342
350
|
]
|
|
343
351
|
},
|
|
@@ -373,6 +381,14 @@
|
|
|
373
381
|
"name": "String"
|
|
374
382
|
},
|
|
375
383
|
"name": "path"
|
|
384
|
+
},
|
|
385
|
+
{
|
|
386
|
+
"title": "returns",
|
|
387
|
+
"description": null,
|
|
388
|
+
"type": {
|
|
389
|
+
"type": "NameExpression",
|
|
390
|
+
"name": "Operation"
|
|
391
|
+
}
|
|
376
392
|
}
|
|
377
393
|
]
|
|
378
394
|
},
|
|
@@ -451,6 +467,14 @@
|
|
|
451
467
|
"name": "String"
|
|
452
468
|
},
|
|
453
469
|
"name": "path"
|
|
470
|
+
},
|
|
471
|
+
{
|
|
472
|
+
"title": "returns",
|
|
473
|
+
"description": null,
|
|
474
|
+
"type": {
|
|
475
|
+
"type": "NameExpression",
|
|
476
|
+
"name": "Operation"
|
|
477
|
+
}
|
|
454
478
|
}
|
|
455
479
|
]
|
|
456
480
|
},
|
|
@@ -486,6 +510,14 @@
|
|
|
486
510
|
"name": "String"
|
|
487
511
|
},
|
|
488
512
|
"name": "path"
|
|
513
|
+
},
|
|
514
|
+
{
|
|
515
|
+
"title": "returns",
|
|
516
|
+
"description": null,
|
|
517
|
+
"type": {
|
|
518
|
+
"type": "NameExpression",
|
|
519
|
+
"name": "Operation"
|
|
520
|
+
}
|
|
489
521
|
}
|
|
490
522
|
]
|
|
491
523
|
},
|
|
@@ -531,6 +563,14 @@
|
|
|
531
563
|
"name": "Operation"
|
|
532
564
|
},
|
|
533
565
|
"name": "operation"
|
|
566
|
+
},
|
|
567
|
+
{
|
|
568
|
+
"title": "returns",
|
|
569
|
+
"description": null,
|
|
570
|
+
"type": {
|
|
571
|
+
"type": "NameExpression",
|
|
572
|
+
"name": "Operation"
|
|
573
|
+
}
|
|
534
574
|
}
|
|
535
575
|
]
|
|
536
576
|
},
|
|
@@ -576,6 +616,14 @@
|
|
|
576
616
|
"name": "Value"
|
|
577
617
|
},
|
|
578
618
|
"name": "value"
|
|
619
|
+
},
|
|
620
|
+
{
|
|
621
|
+
"title": "returns",
|
|
622
|
+
"description": null,
|
|
623
|
+
"type": {
|
|
624
|
+
"type": "NameExpression",
|
|
625
|
+
"name": "Field"
|
|
626
|
+
}
|
|
579
627
|
}
|
|
580
628
|
]
|
|
581
629
|
},
|
package/dist/index.cjs
CHANGED
|
@@ -19,8 +19,25 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
|
|
|
19
19
|
// src/index.js
|
|
20
20
|
var src_exports = {};
|
|
21
21
|
__export(src_exports, {
|
|
22
|
-
|
|
23
|
-
|
|
22
|
+
alterState: () => import_language_common2.alterState,
|
|
23
|
+
createTask: () => createTask,
|
|
24
|
+
dataPath: () => import_language_common2.dataPath,
|
|
25
|
+
dataValue: () => import_language_common2.dataValue,
|
|
26
|
+
dateFns: () => import_language_common2.dateFns,
|
|
27
|
+
default: () => src_default,
|
|
28
|
+
each: () => import_language_common2.each,
|
|
29
|
+
execute: () => execute,
|
|
30
|
+
field: () => import_language_common2.field,
|
|
31
|
+
fields: () => import_language_common2.fields,
|
|
32
|
+
fn: () => import_language_common2.fn,
|
|
33
|
+
getTask: () => getTask,
|
|
34
|
+
getTasks: () => getTasks,
|
|
35
|
+
http: () => import_language_common2.http,
|
|
36
|
+
lastReferenceValue: () => import_language_common2.lastReferenceValue,
|
|
37
|
+
merge: () => import_language_common2.merge,
|
|
38
|
+
sourceValue: () => import_language_common2.sourceValue,
|
|
39
|
+
updateTask: () => updateTask,
|
|
40
|
+
upsertTask: () => upsertTask
|
|
24
41
|
});
|
|
25
42
|
module.exports = __toCommonJS(src_exports);
|
|
26
43
|
|
|
@@ -192,5 +209,22 @@ function upsertTask(project_gid, params, callback) {
|
|
|
192
209
|
var src_default = Adaptor_exports;
|
|
193
210
|
// Annotate the CommonJS export names for ESM import in node:
|
|
194
211
|
0 && (module.exports = {
|
|
195
|
-
|
|
212
|
+
alterState,
|
|
213
|
+
createTask,
|
|
214
|
+
dataPath,
|
|
215
|
+
dataValue,
|
|
216
|
+
dateFns,
|
|
217
|
+
each,
|
|
218
|
+
execute,
|
|
219
|
+
field,
|
|
220
|
+
fields,
|
|
221
|
+
fn,
|
|
222
|
+
getTask,
|
|
223
|
+
getTasks,
|
|
224
|
+
http,
|
|
225
|
+
lastReferenceValue,
|
|
226
|
+
merge,
|
|
227
|
+
sourceValue,
|
|
228
|
+
updateTask,
|
|
229
|
+
upsertTask
|
|
196
230
|
});
|
package/dist/index.js
CHANGED
|
@@ -189,6 +189,23 @@ function upsertTask(project_gid, params, callback) {
|
|
|
189
189
|
// src/index.js
|
|
190
190
|
var src_default = Adaptor_exports;
|
|
191
191
|
export {
|
|
192
|
-
|
|
193
|
-
|
|
192
|
+
alterState,
|
|
193
|
+
createTask,
|
|
194
|
+
dataPath,
|
|
195
|
+
dataValue,
|
|
196
|
+
dateFns,
|
|
197
|
+
src_default as default,
|
|
198
|
+
each,
|
|
199
|
+
execute,
|
|
200
|
+
field,
|
|
201
|
+
fields,
|
|
202
|
+
fn,
|
|
203
|
+
getTask,
|
|
204
|
+
getTasks,
|
|
205
|
+
http2 as http,
|
|
206
|
+
lastReferenceValue,
|
|
207
|
+
merge,
|
|
208
|
+
sourceValue,
|
|
209
|
+
updateTask,
|
|
210
|
+
upsertTask
|
|
194
211
|
};
|
package/package.json
CHANGED
|
@@ -1,13 +1,16 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@openfn/language-asana",
|
|
3
|
-
"version": "2.1.
|
|
3
|
+
"version": "2.1.1",
|
|
4
4
|
"description": "An adaptor to access objects in Asana",
|
|
5
5
|
"homepage": "https://docs.openfn.org",
|
|
6
6
|
"repository": {
|
|
7
7
|
"type": "git",
|
|
8
8
|
"url": "https://github.com/openfn/adaptors.git"
|
|
9
9
|
},
|
|
10
|
-
"
|
|
10
|
+
"exports": {
|
|
11
|
+
"import": "./dist/index.js",
|
|
12
|
+
"require": "./dist/index.cjs"
|
|
13
|
+
},
|
|
11
14
|
"author": "Open Function Group",
|
|
12
15
|
"license": "LGPLv3",
|
|
13
16
|
"files": [
|
|
@@ -17,27 +20,27 @@
|
|
|
17
20
|
"configuration-schema.json"
|
|
18
21
|
],
|
|
19
22
|
"dependencies": {
|
|
20
|
-
"@openfn/language-common": "^1.
|
|
23
|
+
"@openfn/language-common": "^1.7.4"
|
|
21
24
|
},
|
|
22
25
|
"devDependencies": {
|
|
23
|
-
"@openfn/
|
|
24
|
-
"
|
|
26
|
+
"@openfn/buildtools": "^1.0.2",
|
|
27
|
+
"@openfn/simple-ast": "0.4.1",
|
|
28
|
+
"assertion-error": "2.0.0",
|
|
25
29
|
"chai": "4.3.6",
|
|
26
30
|
"deep-eql": "4.1.1",
|
|
31
|
+
"esno": "^0.16.3",
|
|
27
32
|
"mocha": "7.2.0",
|
|
28
33
|
"nock": "13.2.9",
|
|
29
|
-
"
|
|
30
|
-
"esno": "0.16.3",
|
|
31
|
-
"rimraf": "3.0.2",
|
|
32
|
-
"@openfn/buildtools": "^1.0.0"
|
|
34
|
+
"rimraf": "3.0.2"
|
|
33
35
|
},
|
|
34
36
|
"type": "module",
|
|
35
37
|
"types": "types/index.d.ts",
|
|
38
|
+
"main": "dist/index.cjs",
|
|
36
39
|
"scripts": {
|
|
37
40
|
"build": "pnpm clean && build-adaptor asana",
|
|
38
41
|
"test": "mocha --experimental-specifier-resolution=node --no-warnings",
|
|
39
42
|
"test:watch": "mocha -w --experimental-specifier-resolution=node --no-warnings",
|
|
40
|
-
"clean": "
|
|
43
|
+
"clean": "rimraf dist types docs",
|
|
41
44
|
"pack": "pnpm pack --pack-destination ../../dist"
|
|
42
45
|
}
|
|
43
46
|
}
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Execute a sequence of operations.
|
|
3
|
+
* Wraps `language-common/execute`, and prepends initial state for http.
|
|
4
|
+
* @example
|
|
5
|
+
* execute(
|
|
6
|
+
* create('foo'),
|
|
7
|
+
* delete('bar')
|
|
8
|
+
* )(state)
|
|
9
|
+
* @function
|
|
10
|
+
* @param {Operations} operations - Operations to be performed.
|
|
11
|
+
* @returns {Operation}
|
|
12
|
+
*/
|
|
13
|
+
export function execute(...operations: Operations): Operation;
|
|
14
|
+
/**
|
|
15
|
+
* Get a single task of a given project.
|
|
16
|
+
* @public
|
|
17
|
+
* @example
|
|
18
|
+
* getTask("task_gid",
|
|
19
|
+
* {
|
|
20
|
+
* opt_fields: "name,notes,assignee"
|
|
21
|
+
* })
|
|
22
|
+
* @function
|
|
23
|
+
* @param {string} task_gid - Globally unique identifier for the task
|
|
24
|
+
* @param {object} params - Query params to include.
|
|
25
|
+
* @param {function} callback - (Optional) callback function
|
|
26
|
+
* @returns {Operation}
|
|
27
|
+
*/
|
|
28
|
+
export function getTask(task_gid: string, params: object, callback: Function): Operation;
|
|
29
|
+
/**
|
|
30
|
+
* Get the list of tasks for a given project.
|
|
31
|
+
* @public
|
|
32
|
+
* @example
|
|
33
|
+
* getTasks("project_gid",
|
|
34
|
+
* {
|
|
35
|
+
* opt_fields: "name,notes,assignee"
|
|
36
|
+
* })
|
|
37
|
+
* @function
|
|
38
|
+
* @param {string} project_gid - Globally unique identifier for the project
|
|
39
|
+
* @param {object} params - Query params to include.
|
|
40
|
+
* @param {function} callback - (Optional) callback function
|
|
41
|
+
* @returns {Operation}
|
|
42
|
+
*/
|
|
43
|
+
export function getTasks(project_gid: string, params: object, callback: Function): Operation;
|
|
44
|
+
/**
|
|
45
|
+
* Update a specific task.
|
|
46
|
+
* @public
|
|
47
|
+
* @example
|
|
48
|
+
* updateTask("task_gid",
|
|
49
|
+
* {
|
|
50
|
+
* name: 'test', "approval_status": "pending", "assignee": "12345"
|
|
51
|
+
* }
|
|
52
|
+
* )
|
|
53
|
+
* @function
|
|
54
|
+
* @param {string} task_gid - Globally unique identifier for the task
|
|
55
|
+
* @param {object} params - Body parameters
|
|
56
|
+
* @param {function} callback - (Optional) callback function
|
|
57
|
+
* @returns {Operation}
|
|
58
|
+
*/
|
|
59
|
+
export function updateTask(task_gid: string, params: object, callback: Function): Operation;
|
|
60
|
+
/**
|
|
61
|
+
* Create a task.
|
|
62
|
+
* @public
|
|
63
|
+
* @example
|
|
64
|
+
* createTask(
|
|
65
|
+
* {
|
|
66
|
+
* name: 'test', "approval_status": "pending", "assignee": "12345"
|
|
67
|
+
* }
|
|
68
|
+
* )
|
|
69
|
+
* @function
|
|
70
|
+
* @param {object} params - Body parameters
|
|
71
|
+
* @param {function} callback - (Optional) callback function
|
|
72
|
+
* @returns {Operation}
|
|
73
|
+
*/
|
|
74
|
+
export function createTask(params: object, callback: Function): Operation;
|
|
75
|
+
/**
|
|
76
|
+
* Update or create a task.
|
|
77
|
+
* @public
|
|
78
|
+
* @example
|
|
79
|
+
* upsertTask(
|
|
80
|
+
* "1201382240880",
|
|
81
|
+
* {
|
|
82
|
+
* "externalId": "name",
|
|
83
|
+
* "data": {
|
|
84
|
+
* name: 'test', "approval_status": "pending", "assignee": "12345"
|
|
85
|
+
* }
|
|
86
|
+
*
|
|
87
|
+
* }
|
|
88
|
+
* )
|
|
89
|
+
* @function
|
|
90
|
+
* @param {string} project_gid - Globally unique identifier for the project
|
|
91
|
+
* @param {object} params - an object with an externalId and some task data.
|
|
92
|
+
* @param {function} callback - (Optional) callback function
|
|
93
|
+
* @returns {Operation}
|
|
94
|
+
*/
|
|
95
|
+
export function upsertTask(project_gid: string, params: object, callback: Function): Operation;
|
|
96
|
+
export { alterState, dataPath, dataValue, dateFns, each, field, fields, fn, http, lastReferenceValue, merge, sourceValue } from "@openfn/language-common";
|
package/types/index.d.ts
CHANGED
|
@@ -1,114 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
*
|
|
3
|
-
*
|
|
4
|
-
* @example
|
|
5
|
-
* execute(
|
|
6
|
-
* create('foo'),
|
|
7
|
-
* delete('bar')
|
|
8
|
-
* )(state)
|
|
9
|
-
* @function
|
|
10
|
-
* @param {Operations} operations - Operations to be performed.
|
|
11
|
-
* @returns {Operation}
|
|
12
|
-
*/
|
|
13
|
-
declare function execute(...operations: Operations): Operation;
|
|
14
|
-
/**
|
|
15
|
-
* Get a single task of a given project.
|
|
16
|
-
* @public
|
|
17
|
-
* @example
|
|
18
|
-
* getTask("task_gid",
|
|
19
|
-
* {
|
|
20
|
-
* opt_fields: "name,notes,assignee"
|
|
21
|
-
* })
|
|
22
|
-
* @function
|
|
23
|
-
* @param {string} task_gid - Globally unique identifier for the task
|
|
24
|
-
* @param {object} params - Query params to include.
|
|
25
|
-
* @param {function} callback - (Optional) callback function
|
|
26
|
-
* @returns {Operation}
|
|
27
|
-
*/
|
|
28
|
-
declare function getTask(task_gid: string, params: object, callback: Function): Operation;
|
|
29
|
-
/**
|
|
30
|
-
* Get the list of tasks for a given project.
|
|
31
|
-
* @public
|
|
32
|
-
* @example
|
|
33
|
-
* getTasks("project_gid",
|
|
34
|
-
* {
|
|
35
|
-
* opt_fields: "name,notes,assignee"
|
|
36
|
-
* })
|
|
37
|
-
* @function
|
|
38
|
-
* @param {string} project_gid - Globally unique identifier for the project
|
|
39
|
-
* @param {object} params - Query params to include.
|
|
40
|
-
* @param {function} callback - (Optional) callback function
|
|
41
|
-
* @returns {Operation}
|
|
42
|
-
*/
|
|
43
|
-
declare function getTasks(project_gid: string, params: object, callback: Function): Operation;
|
|
44
|
-
/**
|
|
45
|
-
* Update a specific task.
|
|
46
|
-
* @public
|
|
47
|
-
* @example
|
|
48
|
-
* updateTask("task_gid",
|
|
49
|
-
* {
|
|
50
|
-
* name: 'test', "approval_status": "pending", "assignee": "12345"
|
|
51
|
-
* }
|
|
52
|
-
* )
|
|
53
|
-
* @function
|
|
54
|
-
* @param {string} task_gid - Globally unique identifier for the task
|
|
55
|
-
* @param {object} params - Body parameters
|
|
56
|
-
* @param {function} callback - (Optional) callback function
|
|
57
|
-
* @returns {Operation}
|
|
58
|
-
*/
|
|
59
|
-
declare function updateTask(task_gid: string, params: object, callback: Function): Operation;
|
|
60
|
-
/**
|
|
61
|
-
* Create a task.
|
|
62
|
-
* @public
|
|
63
|
-
* @example
|
|
64
|
-
* createTask(
|
|
65
|
-
* {
|
|
66
|
-
* name: 'test', "approval_status": "pending", "assignee": "12345"
|
|
67
|
-
* }
|
|
68
|
-
* )
|
|
69
|
-
* @function
|
|
70
|
-
* @param {object} params - Body parameters
|
|
71
|
-
* @param {function} callback - (Optional) callback function
|
|
72
|
-
* @returns {Operation}
|
|
73
|
-
*/
|
|
74
|
-
declare function createTask(params: object, callback: Function): Operation;
|
|
75
|
-
/**
|
|
76
|
-
* Update or create a task.
|
|
77
|
-
* @public
|
|
78
|
-
* @example
|
|
79
|
-
* upsertTask(
|
|
80
|
-
* "1201382240880",
|
|
81
|
-
* {
|
|
82
|
-
* "externalId": "name",
|
|
83
|
-
* "data": {
|
|
84
|
-
* name: 'test', "approval_status": "pending", "assignee": "12345"
|
|
85
|
-
* }
|
|
86
|
-
*
|
|
87
|
-
* }
|
|
88
|
-
* )
|
|
89
|
-
* @function
|
|
90
|
-
* @param {string} project_gid - Globally unique identifier for the project
|
|
91
|
-
* @param {object} params - an object with an externalId and some task data.
|
|
92
|
-
* @param {function} callback - (Optional) callback function
|
|
93
|
-
* @returns {Operation}
|
|
94
|
-
*/
|
|
95
|
-
declare function upsertTask(project_gid: string, params: object, callback: Function): Operation;
|
|
96
|
-
|
|
97
|
-
declare const Adaptor_execute: typeof execute;
|
|
98
|
-
declare const Adaptor_getTask: typeof getTask;
|
|
99
|
-
declare const Adaptor_getTasks: typeof getTasks;
|
|
100
|
-
declare const Adaptor_updateTask: typeof updateTask;
|
|
101
|
-
declare const Adaptor_createTask: typeof createTask;
|
|
102
|
-
declare const Adaptor_upsertTask: typeof upsertTask;
|
|
103
|
-
declare namespace Adaptor {
|
|
104
|
-
export {
|
|
105
|
-
Adaptor_execute as execute,
|
|
106
|
-
Adaptor_getTask as getTask,
|
|
107
|
-
Adaptor_getTasks as getTasks,
|
|
108
|
-
Adaptor_updateTask as updateTask,
|
|
109
|
-
Adaptor_createTask as createTask,
|
|
110
|
-
Adaptor_upsertTask as upsertTask,
|
|
111
|
-
};
|
|
112
|
-
}
|
|
113
|
-
|
|
114
|
-
export { Adaptor, Adaptor as default };
|
|
1
|
+
export default Adaptor;
|
|
2
|
+
export * from "./Adaptor";
|
|
3
|
+
import * as Adaptor from "./Adaptor";
|