@activepieces/piece-google-tasks 0.2.1 → 0.3.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/package.json CHANGED
@@ -1,14 +1,14 @@
1
1
  {
2
2
  "name": "@activepieces/piece-google-tasks",
3
- "version": "0.2.1",
3
+ "version": "0.3.0",
4
4
  "dependencies": {
5
- "@sinclair/typebox": "0.26.8",
5
+ "@sinclair/typebox": "^0.26.3",
6
6
  "axios": "1.2.4",
7
- "nanoid": "3.3.4",
8
- "@activepieces/pieces-framework": "0.3.13",
9
- "@activepieces/shared": "0.3.11",
10
- "@activepieces/pieces-common": "0.0.1",
11
- "tslib": "2.4.1"
7
+ "nanoid": "^3.3.4",
8
+ "@activepieces/pieces-common": "0.1.0",
9
+ "@activepieces/pieces-framework": "0.4.0",
10
+ "@activepieces/shared": "0.4.0",
11
+ "tslib": "1.14.1"
12
12
  },
13
13
  "main": "./src/index.js",
14
14
  "types": "./src/index.d.ts"
package/src/index.d.ts CHANGED
@@ -1 +1,2 @@
1
- export declare const googleTasks: import("@activepieces/pieces-framework").Piece;
1
+ export declare const googleTasksAuth: import("@activepieces/pieces-framework").OAuth2Property<true, import("@activepieces/pieces-framework").OAuth2Props>;
2
+ export declare const googleTasks: import("@activepieces/pieces-framework").Piece<import("@activepieces/pieces-framework").OAuth2Property<true, import("@activepieces/pieces-framework").OAuth2Props>>;
package/src/index.js CHANGED
@@ -1,17 +1,23 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.googleTasks = void 0;
4
- const tslib_1 = require("tslib");
5
- const package_json_1 = tslib_1.__importDefault(require("../package.json"));
3
+ exports.googleTasks = exports.googleTasksAuth = void 0;
6
4
  const pieces_framework_1 = require("@activepieces/pieces-framework");
7
5
  const new_task_1 = require("./lib/actions/new-task");
6
+ exports.googleTasksAuth = pieces_framework_1.PieceAuth.OAuth2({
7
+ description: "",
8
+ displayName: 'Authentication',
9
+ authUrl: "https://accounts.google.com/o/oauth2/auth",
10
+ tokenUrl: "https://oauth2.googleapis.com/token",
11
+ required: true,
12
+ scope: ["https://www.googleapis.com/auth/tasks"]
13
+ });
8
14
  exports.googleTasks = (0, pieces_framework_1.createPiece)({
9
- name: 'google-tasks',
15
+ minimumSupportedRelease: '0.5.0',
10
16
  logoUrl: 'https://cdn.activepieces.com/pieces/google-tasks.png',
11
17
  actions: [new_task_1.googleTasksAddNewTaskAction],
12
18
  displayName: "Google Tasks",
13
19
  authors: ['abaza738'],
14
20
  triggers: [],
15
- version: package_json_1.default.version,
21
+ auth: exports.googleTasksAuth,
16
22
  });
17
23
  //# sourceMappingURL=index.js.map
package/src/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../packages/pieces/google-tasks/src/index.ts"],"names":[],"mappings":";;;;AAAA,2EAA0C;AAC1C,qEAA6D;AAC7D,qDAAqE;AAExD,QAAA,WAAW,GAAG,IAAA,8BAAW,EAAC;IACtC,IAAI,EAAE,cAAc;IACpB,OAAO,EAAE,sDAAsD;IAC/D,OAAO,EAAE,CAAC,sCAA2B,CAAC;IACtC,WAAW,EAAE,cAAc;IAC3B,OAAO,EAAE,CAAC,UAAU,CAAC;IACrB,QAAQ,EAAE,EAAE;IACX,OAAO,EAAE,sBAAW,CAAC,OAAO;CAC7B,CAAC,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../packages/pieces/google-tasks/src/index.ts"],"names":[],"mappings":";;;AAAA,qEAAwE;AACxE,qDAAqE;AAExD,QAAA,eAAe,GAAG,4BAAS,CAAC,MAAM,CAAC;IAC5C,WAAW,EAAE,EAAE;IACf,WAAW,EAAE,gBAAgB;IAC7B,OAAO,EAAE,2CAA2C;IACpD,QAAQ,EAAE,qCAAqC;IAC/C,QAAQ,EAAE,IAAI;IACd,KAAK,EAAE,CAAC,uCAAuC,CAAC;CACnD,CAAC,CAAA;AAEW,QAAA,WAAW,GAAG,IAAA,8BAAW,EAAC;IAClC,uBAAuB,EAAE,OAAO;IACjC,OAAO,EAAE,sDAAsD;IAClE,OAAO,EAAE,CAAC,sCAA2B,CAAC;IACtC,WAAW,EAAE,cAAc;IAC3B,OAAO,EAAE,CAAC,UAAU,CAAC;IACrB,QAAQ,EAAE,EAAE;IACT,IAAI,EAAE,uBAAe;CACxB,CAAC,CAAC"}
@@ -1 +1,6 @@
1
- export declare const googleTasksAddNewTaskAction: import("@activepieces/pieces-framework").Action;
1
+ export declare const googleTasksAddNewTaskAction: import("@activepieces/pieces-framework").IAction<import("@activepieces/pieces-framework").OAuth2Property<true, import("@activepieces/pieces-framework").OAuth2Props>, {
2
+ tasks_list: import("@activepieces/pieces-framework").DropdownProperty<string, false> | import("@activepieces/pieces-framework").DropdownProperty<string, true>;
3
+ title: import("@activepieces/pieces-framework").ShortTextProperty<true>;
4
+ notes: import("@activepieces/pieces-framework").LongTextProperty<false>;
5
+ completed: import("@activepieces/pieces-framework").CheckboxProperty<false>;
6
+ }>;
@@ -4,18 +4,19 @@ exports.googleTasksAddNewTaskAction = void 0;
4
4
  const tslib_1 = require("tslib");
5
5
  const pieces_framework_1 = require("@activepieces/pieces-framework");
6
6
  const common_1 = require("../common");
7
+ const __1 = require("../../");
7
8
  exports.googleTasksAddNewTaskAction = (0, pieces_framework_1.createAction)({
9
+ auth: __1.googleTasksAuth,
8
10
  name: 'add_task',
9
11
  description: 'Add a new task to a specified task list',
10
12
  displayName: 'Add Task',
11
13
  props: {
12
- authentication: common_1.googleTasksCommon.authentication,
13
14
  tasks_list: common_1.googleTasksCommon.tasksList,
14
15
  title: common_1.googleTasksCommon.title,
15
16
  notes: common_1.googleTasksCommon.notes,
16
17
  completed: common_1.googleTasksCommon.completed,
17
18
  },
18
- run({ propsValue }) {
19
+ run({ auth, propsValue }) {
19
20
  return tslib_1.__awaiter(this, void 0, void 0, function* () {
20
21
  const task = {
21
22
  kind: 'tasks#task',
@@ -24,7 +25,7 @@ exports.googleTasksAddNewTaskAction = (0, pieces_framework_1.createAction)({
24
25
  completed: propsValue.completed ? new Date().toISOString() : '',
25
26
  notes: propsValue.notes,
26
27
  };
27
- return (0, common_1.createTask)(propsValue.authentication, propsValue.tasks_list, task);
28
+ return (0, common_1.createTask)(auth, propsValue.tasks_list, task);
28
29
  });
29
30
  },
30
31
  });
@@ -1 +1 @@
1
- {"version":3,"file":"new-task.js","sourceRoot":"","sources":["../../../../../../../packages/pieces/google-tasks/src/lib/actions/new-task.ts"],"names":[],"mappings":";;;;AAAA,qEAA8D;AAC9D,sCAA4E;AAE/D,QAAA,2BAA2B,GAAG,IAAA,+BAAY,EAAC;IACpD,IAAI,EAAE,UAAU;IAChB,WAAW,EAAE,yCAAyC;IACtD,WAAW,EAAE,UAAU;IACvB,KAAK,EAAE;QACH,cAAc,EAAE,0BAAiB,CAAC,cAAc;QAChD,UAAU,EAAE,0BAAiB,CAAC,SAAS;QACvC,KAAK,EAAE,0BAAiB,CAAC,KAAK;QAC9B,KAAK,EAAE,0BAAiB,CAAC,KAAK;QAC9B,SAAS,EAAE,0BAAiB,CAAC,SAAS;KACzC;IACK,GAAG,CAAC,EAAE,UAAU,EAAE;;YACpB,MAAM,IAAI,GAAS;gBACf,IAAI,EAAE,YAAY;gBAClB,MAAM,EAAE,UAAU,CAAC,SAAS,CAAC,CAAC,CAAC,mBAAU,CAAC,SAAS,CAAC,CAAC,CAAC,mBAAU,CAAC,YAAY;gBAC7E,KAAK,EAAE,UAAU,CAAC,KAAK;gBACvB,SAAS,EAAE,UAAU,CAAC,SAAS,CAAC,CAAC,CAAC,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE,CAAC,CAAC,CAAC,EAAE;gBAC/D,KAAK,EAAE,UAAU,CAAC,KAAK;aAC1B,CAAC;YAEF,OAAO,IAAA,mBAAU,EAAC,UAAU,CAAC,cAAc,EAAE,UAAU,CAAC,UAAW,EAAE,IAAI,CAAC,CAAC;QAC/E,CAAC;KAAA;CACJ,CAAC,CAAC"}
1
+ {"version":3,"file":"new-task.js","sourceRoot":"","sources":["../../../../../../../packages/pieces/google-tasks/src/lib/actions/new-task.ts"],"names":[],"mappings":";;;;AAAA,qEAA8D;AAC9D,sCAA4E;AAC5E,8BAAyC;AAE5B,QAAA,2BAA2B,GAAG,IAAA,+BAAY,EAAC;IACpD,IAAI,EAAE,mBAAe;IACjB,IAAI,EAAE,UAAU;IAChB,WAAW,EAAE,yCAAyC;IACtD,WAAW,EAAE,UAAU;IACvB,KAAK,EAAE;QACH,UAAU,EAAE,0BAAiB,CAAC,SAAS;QACvC,KAAK,EAAE,0BAAiB,CAAC,KAAK;QAC9B,KAAK,EAAE,0BAAiB,CAAC,KAAK;QAC9B,SAAS,EAAE,0BAAiB,CAAC,SAAS;KACzC;IACK,GAAG,CAAC,EAAE,IAAI,EAAE,UAAU,EAAE;;YAC1B,MAAM,IAAI,GAAS;gBACf,IAAI,EAAE,YAAY;gBAClB,MAAM,EAAE,UAAU,CAAC,SAAS,CAAC,CAAC,CAAC,mBAAU,CAAC,SAAS,CAAC,CAAC,CAAC,mBAAU,CAAC,YAAY;gBAC7E,KAAK,EAAE,UAAU,CAAC,KAAK;gBACvB,SAAS,EAAE,UAAU,CAAC,SAAS,CAAC,CAAC,CAAC,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE,CAAC,CAAC,CAAC,EAAE;gBAC/D,KAAK,EAAE,UAAU,CAAC,KAAK;aAC1B,CAAC;YAEF,OAAO,IAAA,mBAAU,EAAC,IAAI,EAAE,UAAU,CAAC,UAAW,EAAE,IAAI,CAAC,CAAC;QAC1D,CAAC;KAAA;CAER,CAAC,CAAC"}
@@ -6,7 +6,7 @@ export declare enum TaskStatus {
6
6
  /**
7
7
  * @see https://developers.google.com/tasks/reference/rest/v1/tasklists/list#response-body
8
8
  */
9
- export declare type TasksListResponse = {
9
+ export type TasksListResponse = {
10
10
  "kind": string;
11
11
  "etag": string;
12
12
  "nextPageToken": string;
@@ -15,7 +15,7 @@ export declare type TasksListResponse = {
15
15
  /**
16
16
  * @see https://developers.google.com/tasks/reference/rest/v1/tasklists#resource:-tasklist
17
17
  */
18
- export declare type TasksList = {
18
+ export type TasksList = {
19
19
  kind: string;
20
20
  id: string;
21
21
  etag: string;
@@ -26,7 +26,7 @@ export declare type TasksList = {
26
26
  /**
27
27
  * @see https://developers.google.com/tasks/reference/rest/v1/tasks#resource:-task
28
28
  */
29
- export declare type Task = {
29
+ export type Task = {
30
30
  kind: "tasks#task";
31
31
  title: string;
32
32
  status: TaskStatus;
@@ -43,7 +43,6 @@ export declare type Task = {
43
43
  };
44
44
  export declare const googleTasksCommon: {
45
45
  baseUrl: string;
46
- authentication: import("@activepieces/pieces-framework").OAuth2Property<true, import("@activepieces/pieces-framework").OAuth2Props>;
47
46
  /**
48
47
  * @property Target task list ID where the new task will be created
49
48
  */
@@ -8,33 +8,25 @@ var TaskStatus;
8
8
  (function (TaskStatus) {
9
9
  TaskStatus["NEEDS_ACTION"] = "needsAction";
10
10
  TaskStatus["COMPLETED"] = "completed";
11
- })(TaskStatus = exports.TaskStatus || (exports.TaskStatus = {}));
11
+ })(TaskStatus || (exports.TaskStatus = TaskStatus = {}));
12
12
  exports.googleTasksCommon = {
13
13
  baseUrl: `https://tasks.googleapis.com`,
14
- authentication: pieces_framework_1.Property.OAuth2({
15
- description: "",
16
- displayName: 'Authentication',
17
- authUrl: "https://accounts.google.com/o/oauth2/auth",
18
- tokenUrl: "https://oauth2.googleapis.com/token",
19
- required: true,
20
- scope: ["https://www.googleapis.com/auth/tasks"]
21
- }),
22
14
  /**
23
15
  * @property Target task list ID where the new task will be created
24
16
  */
25
17
  tasksList: pieces_framework_1.Property.Dropdown({
26
18
  displayName: 'Tasks List',
27
- refreshers: ['authentication'],
19
+ refreshers: [],
28
20
  required: true,
29
- options: (propsValue) => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
30
- if (!propsValue['authentication']) {
21
+ options: ({ auth }) => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
22
+ if (!auth) {
31
23
  return {
32
24
  disabled: true,
33
25
  placeholder: "Please connect your account first",
34
26
  options: [],
35
27
  };
36
28
  }
37
- const authProp = propsValue['authentication'];
29
+ const authProp = auth;
38
30
  const tasksLists = yield getTasks(authProp);
39
31
  return {
40
32
  disabled: false,
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../../packages/pieces/google-tasks/src/lib/common/index.ts"],"names":[],"mappings":";;;;AAAA,qEAA+E;AAC/E,+DAAsG;AAEtG,IAAY,UAGX;AAHD,WAAY,UAAU;IAClB,0CAA4B,CAAA;IAC5B,qCAAuB,CAAA;AAC3B,CAAC,EAHW,UAAU,GAAV,kBAAU,KAAV,kBAAU,QAGrB;AA6CY,QAAA,iBAAiB,GAAG;IAC7B,OAAO,EAAE,8BAA8B;IACvC,cAAc,EAAE,2BAAQ,CAAC,MAAM,CAAC;QAC5B,WAAW,EAAE,EAAE;QACf,WAAW,EAAE,gBAAgB;QAC7B,OAAO,EAAE,2CAA2C;QACpD,QAAQ,EAAE,qCAAqC;QAC/C,QAAQ,EAAE,IAAI;QACd,KAAK,EAAE,CAAC,uCAAuC,CAAC;KACnD,CAAC;IAEF;;OAEG;IACH,SAAS,EAAE,2BAAQ,CAAC,QAAQ,CAAS;QACjC,WAAW,EAAE,YAAY;QACzB,UAAU,EAAE,CAAC,gBAAgB,CAAC;QAC9B,QAAQ,EAAE,IAAI;QACd,OAAO,EAAE,CAAO,UAAU,EAAE,EAAE;YAC1B,IAAI,CAAC,UAAU,CAAC,gBAAgB,CAAC,EAAE;gBAC/B,OAAO;oBACH,QAAQ,EAAE,IAAI;oBACd,WAAW,EAAE,mCAAmC;oBAChD,OAAO,EAAE,EAAE;iBACd,CAAC;aACL;YAED,MAAM,QAAQ,GAAwB,UAAU,CAAC,gBAAgB,CAAwB,CAAC;YAC1F,MAAM,UAAU,GAAG,MAAM,QAAQ,CAAC,QAAQ,CAAC,CAAC;YAE5C,OAAO;gBACH,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c,EAAE;gBACZ,IAAI,EAAE,kCAAkB,CAAC,YAAY;gBACrC,KAAK,EAAE,QAAQ,CAAC,YAAY;aAC/B;YACD,IAAI,EAAE,IAAI;SACb,CAAC;QAEF,OAAO,0BAAU,CAAC,WAAW,CAAC,OAAO,CAAC,CAAC;IAC3C,CAAC;CAAA;AAZD,gCAYC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../../packages/pieces/google-tasks/src/lib/common/index.ts"],"names":[],"mappings":";;;;AAAA,qEAA+E;AAC/E,+DAAsG;AAEtG,IAAY,UAGX;AAHD,WAAY,UAAU;IAClB,0CAA4B,CAAA;IAC5B,qCAAuB,CAAA;AAC3B,CAAC,EAHW,UAAU,0BAAV,UAAU,QAGrB;AA6CY,QAAA,iBAAiB,GAAG;IAC7B,OAAO,EAAE,8BAA8B;IAEvC;;OAEG;IACH,SAAS,EAAE,2BAAQ,CAAC,QAAQ,CAAS;QACjC,WAAW,EAAE,YAAY;QACzB,UAAU,EAAE,EAAE;QACd,QAAQ,EAAE,IAAI;QACd,OAAO,EAAE,CAAO,EAAE,IAAI,EAAE,EAAE,EAAE;YACxB,IAAI,CAAC,IAAI,EAAE;gBACP,OAAO;oBACH,QAAQ,EAAE,IAAI;oBACd,WAAW,EAAE,mCAAmC;oBAChD,OAAO,EAAE,EAAE;iBACd,CAAC;aACL;YAED,MAAM,QAAQ,GAAwB,IAA2B,CAAC;YAClE,MAAM,UAAU,GAAG,MAAM,QAAQ,CAAC,QAAQ,CAAC,CAAC;YAE5C,OAAO;gBACH,QAAQ,EAAE,KAAK;gBACf,OAAO,EAAE,UAAU,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE;oBAC3B,OAAO;wBACH,KAAK,EAAE,IAAI,CAAC,KAAK;wBACjB,KAAK,EAAE,IAAI,CAAC,EAAE;qBACjB,CAAC;gBACN,CAAC,CAAC;aACL,CAAC;QACN,CAAC,CAAA;KACJ,CAAC;IACF,KAAK,EAAE,2BAAQ,CAAC,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