@activepieces/piece-google-contacts 0.0.0-pre1

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/README.md ADDED
@@ -0,0 +1,7 @@
1
+ # pieces-google-contacts
2
+
3
+ This library was generated with [Nx](https://nx.dev).
4
+
5
+ ## Running lint
6
+
7
+ Run `nx lint pieces-google-contacts` to execute the lint via [ESLint](https://eslint.org/).
package/package.json ADDED
@@ -0,0 +1,17 @@
1
+ {
2
+ "name": "@activepieces/piece-google-contacts",
3
+ "version": "0.0.0-pre1",
4
+ "dependencies": {
5
+ "@sinclair/typebox": "0.24.51",
6
+ "axios": "1.2.4",
7
+ "cron-validator": "1.3.1",
8
+ "nanoid": "3.3.4"
9
+ },
10
+ "peerDependencies": {
11
+ "@activepieces/framework": "0.0.1",
12
+ "@activepieces/shared": "0.0.1",
13
+ "tslib": "2.4.1"
14
+ },
15
+ "main": "./src/index.js",
16
+ "types": "./src/index.d.ts"
17
+ }
package/src/index.d.ts ADDED
@@ -0,0 +1 @@
1
+ export declare const googleContacts: import("@activepieces/framework").Piece;
package/src/index.js ADDED
@@ -0,0 +1,18 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.googleContacts = void 0;
4
+ const tslib_1 = require("tslib");
5
+ const package_json_1 = tslib_1.__importDefault(require("../package.json"));
6
+ const framework_1 = require("@activepieces/framework");
7
+ const create_contact_1 = require("./lib/action/create-contact");
8
+ const new_contact_1 = require("./lib/trigger/new-contact");
9
+ exports.googleContacts = (0, framework_1.createPiece)({
10
+ name: 'google_contacts',
11
+ logoUrl: 'https://cdn.activepieces.com/pieces/google_contacts.png',
12
+ actions: [create_contact_1.googleContactsAddContactAction],
13
+ displayName: "Google Contacts",
14
+ authors: ['abuaboud'],
15
+ triggers: [new_contact_1.googleContactNewOrUpdatedContact],
16
+ version: package_json_1.default.version,
17
+ });
18
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../packages/pieces/google-contacts/src/index.ts"],"names":[],"mappings":";;;;AAAA,2EAA0C;AAC1C,uDAAsD;AACtD,gEAA6E;AAC7E,2DAA6E;AAEhE,QAAA,cAAc,GAAG,IAAA,uBAAW,EAAC;IACzC,IAAI,EAAE,iBAAiB;IACvB,OAAO,EAAE,yDAAyD;IAClE,OAAO,EAAE,CAAC,+CAA8B,CAAC;IACzC,WAAW,EAAE,iBAAiB;IAC9B,OAAO,EAAE,CAAC,UAAU,CAAC;IACrB,QAAQ,EAAE,CAAC,8CAAgC,CAAC;IAC3C,OAAO,EAAE,sBAAW,CAAC,OAAO;CAC7B,CAAC,CAAC"}
@@ -0,0 +1 @@
1
+ export declare const googleContactsAddContactAction: import("@activepieces/framework").Action;
@@ -0,0 +1,84 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.googleContactsAddContactAction = void 0;
4
+ const tslib_1 = require("tslib");
5
+ const framework_1 = require("@activepieces/framework");
6
+ const common_1 = require("../common");
7
+ exports.googleContactsAddContactAction = (0, framework_1.createAction)({
8
+ name: 'add_contact',
9
+ description: 'Add a contact to a Google Contacts account',
10
+ displayName: 'Add Contact',
11
+ props: {
12
+ authentication: common_1.googleContactsCommon.authentication,
13
+ firstName: framework_1.Property.ShortText({
14
+ displayName: 'First Name',
15
+ description: 'The first name of the contact',
16
+ required: true,
17
+ }),
18
+ middleName: framework_1.Property.ShortText({
19
+ displayName: 'Middle Name',
20
+ description: 'The middle name of the contact',
21
+ required: false,
22
+ }),
23
+ lastName: framework_1.Property.ShortText({
24
+ displayName: 'Last Name',
25
+ description: 'The last name of the contact',
26
+ required: true,
27
+ }),
28
+ jobTitle: framework_1.Property.ShortText({
29
+ displayName: 'Job Title',
30
+ description: 'The job title of the contact',
31
+ required: false,
32
+ }),
33
+ company: framework_1.Property.ShortText({
34
+ displayName: 'Company',
35
+ description: 'The company of the contact',
36
+ required: false,
37
+ }),
38
+ email: framework_1.Property.ShortText({
39
+ displayName: 'Email',
40
+ description: 'The email address of the contact',
41
+ required: false,
42
+ }),
43
+ phoneNumber: framework_1.Property.ShortText({
44
+ displayName: 'Phone Number',
45
+ description: 'The phone number of the contact',
46
+ required: false,
47
+ }),
48
+ },
49
+ run(context) {
50
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
51
+ let requestBody = {
52
+ names: [
53
+ {
54
+ givenName: context.propsValue['firstName'],
55
+ middleName: context.propsValue['middleName'],
56
+ familyName: context.propsValue['lastName'],
57
+ }
58
+ ]
59
+ };
60
+ const contact = {};
61
+ if (context.propsValue['email']) {
62
+ contact['emailAddresses'] = [{ value: context.propsValue['email'], primary: true }];
63
+ }
64
+ if (context.propsValue['phoneNumber']) {
65
+ contact['phoneNumbers'] = [{ value: context.propsValue['phoneNumber'], primary: true }];
66
+ }
67
+ if (context.propsValue['company'] || context.propsValue['jobTitle']) {
68
+ contact['organizations'] = [{ name: context.propsValue['company'] || undefined, title: context.propsValue['jobTitle'] || undefined }];
69
+ }
70
+ requestBody = Object.assign(Object.assign({}, requestBody), contact);
71
+ const request = {
72
+ method: framework_1.HttpMethod.POST,
73
+ url: `${common_1.googleContactsCommon.baseUrl}:createContact`,
74
+ body: requestBody,
75
+ authentication: {
76
+ type: framework_1.AuthenticationType.BEARER_TOKEN,
77
+ token: context.propsValue['authentication']['access_token'],
78
+ }
79
+ };
80
+ return (yield framework_1.httpClient.sendRequest(request)).body;
81
+ });
82
+ }
83
+ });
84
+ //# sourceMappingURL=create-contact.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"create-contact.js","sourceRoot":"","sources":["../../../../../../../packages/pieces/google-contacts/src/lib/action/create-contact.ts"],"names":[],"mappings":";;;;AAAA,uDAA0H;AAC1H,sCAAiD;AAEpC,QAAA,8BAA8B,GAAG,IAAA,wBAAY,EAAC;IACvD,IAAI,EAAE,aAAa;IACnB,WAAW,EAAE,4CAA4C;IACzD,WAAW,EAAE,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C,CAAC"}
@@ -0,0 +1,4 @@
1
+ export declare const googleContactsCommon: {
2
+ authentication: import("@activepieces/framework").OAuth2Property<true>;
3
+ baseUrl: string;
4
+ };
@@ -0,0 +1,16 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.googleContactsCommon = void 0;
4
+ const framework_1 = require("@activepieces/framework");
5
+ exports.googleContactsCommon = {
6
+ authentication: framework_1.Property.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/contacts"]
13
+ }),
14
+ baseUrl: `https://people.googleapis.com/v1/people`
15
+ };
16
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../../packages/pieces/google-contacts/src/lib/common/index.ts"],"names":[],"mappings":";;;AAAA,uDAAmD;AAEtC,QAAA,oBAAoB,GAAG;IAChC,cAAc,EAAE,oBAAQ,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,0CAA0C,CAAC;KACtD,CAAC;IACF,OAAO,EAAE,yCAAyC;CACrD,CAAA"}
@@ -0,0 +1 @@
1
+ export declare const googleContactNewOrUpdatedContact: import("@activepieces/framework").Trigger;
@@ -0,0 +1,127 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.googleContactNewOrUpdatedContact = void 0;
4
+ const tslib_1 = require("tslib");
5
+ const framework_1 = require("@activepieces/framework");
6
+ const common_1 = require("../common");
7
+ exports.googleContactNewOrUpdatedContact = (0, framework_1.createTrigger)({
8
+ name: 'new_or_updated_contact',
9
+ displayName: 'New Or Updated Contact',
10
+ description: 'Triggers when there is a new or updated contact',
11
+ props: {
12
+ authentication: common_1.googleContactsCommon.authentication,
13
+ },
14
+ sampleData: {
15
+ "resourceName": "people/c4278485694217203807",
16
+ "etag": "%EiMBAgMFBgcICQoLDA0ODxATFBUWGSEiIyQlJicuNDU3PT4/QBoEAQIFByIMZFVwNlJPNEVKUzg9",
17
+ "metadata": {
18
+ "sources": [
19
+ {
20
+ "type": "CONTACT",
21
+ "id": "3b603c120c68305f",
22
+ "etag": "#dUp6RO4EJS8=",
23
+ "updateTime": "2023-01-30T14:35:18.142565Z"
24
+ }
25
+ ],
26
+ "objectType": "PERSON"
27
+ },
28
+ "names": [
29
+ {
30
+ "metadata": {
31
+ "primary": true,
32
+ "source": {
33
+ "type": "CONTACT",
34
+ "id": "3b603c120c68305f"
35
+ }
36
+ },
37
+ "displayName": "Shahed Mashni",
38
+ "familyName": "Mashni",
39
+ "givenName": "Shahed",
40
+ "displayNameLastFirst": "Mashni, Shahed",
41
+ "unstructuredName": "Shahed Mashni"
42
+ }
43
+ ],
44
+ "photos": [
45
+ {
46
+ "metadata": {
47
+ "primary": true,
48
+ "source": {
49
+ "type": "CONTACT",
50
+ "id": "3b603c120c68305f"
51
+ }
52
+ },
53
+ "url": "https://lh3.googleusercontent.com/cm/AAkddurmZojs4vCcxrpkfSxH9tnqcH-hI82ESDnwv6eq86nZeLStcjYEIe_TCx8r8g5Y=s100",
54
+ "default": true
55
+ }
56
+ ],
57
+ "memberships": [
58
+ {
59
+ "metadata": {
60
+ "source": {
61
+ "type": "CONTACT",
62
+ "id": "3b603c120c68305f"
63
+ }
64
+ },
65
+ "contactGroupMembership": {
66
+ "contactGroupId": "myContacts",
67
+ "contactGroupResourceName": "contactGroups/myContacts"
68
+ }
69
+ }
70
+ ]
71
+ },
72
+ type: framework_1.TriggerStrategy.POLLING,
73
+ onEnable(ctx) {
74
+ var _a;
75
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
76
+ const response = yield listContacts((0, framework_1.getAccessTokenOrThrow)(ctx.propsValue['authentication']), undefined);
77
+ yield ((_a = ctx.store) === null || _a === void 0 ? void 0 : _a.put("syncToken", response.body.nextSyncToken));
78
+ });
79
+ },
80
+ onDisable(ctx) {
81
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
82
+ console.log("Disabling google contact trigger");
83
+ });
84
+ },
85
+ run(ctx) {
86
+ var _a, _b;
87
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
88
+ let newContacts = [];
89
+ let fetchMore = true;
90
+ while (fetchMore) {
91
+ const syncToken = (yield ((_a = ctx.store) === null || _a === void 0 ? void 0 : _a.get("syncToken")));
92
+ const response = yield listContacts((0, framework_1.getAccessTokenOrThrow)(ctx.propsValue['authentication']), syncToken);
93
+ const newConnections = response.body.connections;
94
+ yield ((_b = ctx.store) === null || _b === void 0 ? void 0 : _b.put("syncToken", response.body.nextSyncToken));
95
+ if (newConnections === undefined || newConnections.length == 0) {
96
+ fetchMore = false;
97
+ }
98
+ if (newConnections !== undefined) {
99
+ newContacts = [...newContacts, ...newConnections];
100
+ }
101
+ }
102
+ console.log(`Found ${newContacts.length} new contacts`);
103
+ return newContacts.filter(f => {
104
+ return f.metadata.deleted !== true;
105
+ });
106
+ });
107
+ },
108
+ });
109
+ function listContacts(access_token, syncToken) {
110
+ let qParams = {
111
+ personFields: "Addresses,ageRanges,biographies,birthdays,calendarUrls,clientData,coverPhotos,emailAddresses,events,externalIds,genders,imClients,interests,locales,locations,memberships,metadata,miscKeywords,names,nicknames,occupations,organizations,phoneNumbers,photos,relations,sipAddresses,skills,urls,userDefined",
112
+ requestSyncToken: "true"
113
+ };
114
+ if (syncToken !== undefined) {
115
+ qParams = Object.assign(Object.assign({}, qParams), { syncToken: syncToken });
116
+ }
117
+ return framework_1.httpClient.sendRequest({
118
+ method: framework_1.HttpMethod.GET,
119
+ url: common_1.googleContactsCommon.baseUrl + "/me/connections",
120
+ authentication: {
121
+ type: framework_1.AuthenticationType.BEARER_TOKEN,
122
+ token: access_token,
123
+ },
124
+ queryParams: qParams
125
+ });
126
+ }
127
+ //# sourceMappingURL=new-contact.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"new-contact.js","sourceRoot":"","sources":["../../../../../../../packages/pieces/google-contacts/src/lib/trigger/new-contact.ts"],"names":[],"mappings":";;;;AAAA,uDAA0J;AAC1J,sCAAiD;AAEpC,QAAA,gCAAgC,GAAG,IAAA,yBAAa,EAAC;IAC1D,IAAI,EAAE,wBAAwB;IAC9B,WAAW,EAAE,wBAAwB;IACrC,WAAW,EAAE,iDAAiD;IAC9D,KAAK,EAAE;QACH,cAAc,EAAE,6BAAoB,CAAC,cAAc;KACtD;IACD,UAAU,EAAE;QACR,cAAc,EAAE,6BAA6B;QAC7C,MAAM,EAAE,+EAA+E;QACvF,UAAU,EAAE;YACR,SAAS,EAAE;gBACP;oBACI,MAAM,EAAE,SAAS;oBACjB,IAAI,EAAE,kBAAkB;oBACxB,MAAM,EAAE,eAAe;oBACvB,YAAY,EAAE,6BAA6B;iBAC9C;aACJ;YACD,YAAY,EAAE,QAAQ;SACzB;QACD,OAAO,EAAE;YACL;gBACI,UAAU,EAAE;oBACR,SAAS,EAAE,IAAI;oBACf,QAAQ,EAAE;wBACN,MAAM,EAAE,SAAS;wBACjB,IAAI,EAAE,kBAAkB;qBAC3B;iBACJ;gBACD,aAAa,EAAE,eAAe;gBAC9B,YAAY,EAAE,QAAQ;gBACtB,WAAW,EAAE,QAAQ;gBACrB,sBAAsB,EAAE,gBAAgB;gBACxC,kBAAkB,EAAE,eAAe;aACtC;SACJ;QACD,QAAQ,EAAE;YACN;gBACI,UAAU,EAAE;oBACR,SAAS,EAAE,IAAI;oBACf,QAAQ,EAAE;wBACN,MAAM,EAAE,SAAS;wBACjB,IAAI,EAAE,kBAAkB;qBAC3B;iBACJ;gBACD,KAAK,EAAE,gHAAgH;gBACvH,SAAS,EAAE,IAAI;aAClB;SACJ;QACD,aAAa,EAAE;YACX;gB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