@activepieces/piece-google-contacts 0.4.5 → 0.4.7

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/src/index.d.ts DELETED
@@ -1,2 +0,0 @@
1
- export declare const googleContacts: import("@activepieces/pieces-framework").Piece<import("@activepieces/pieces-framework").OAuth2Property<import("@activepieces/pieces-framework").OAuth2Props>>;
2
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAcA,eAAO,MAAM,cAAc,+JA8BzB,CAAC"}
package/src/index.js.map DELETED
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";;;;AAAA,+DAAwE;AACxE,qEAIwC;AACxC,iDAAqD;AACrD,gEAA6E;AAC7E,gEAAgF;AAChF,gEAAiF;AACjF,yCAAoD;AACpD,2DAA6E;AAC7E,qCAAgD;AAEnC,QAAA,cAAc,GAAG,IAAA,8BAAW,EAAC;IACxC,uBAAuB,EAAE,QAAQ;IACjC,OAAO,EAAE,yDAAyD;IAClE,UAAU,EAAE,CAAC,sBAAa,CAAC,aAAa,CAAC;IACzC,OAAO,EAAE;QACP,+CAA8B;QAC9B,kDAAiC;QACjC,mDAAkC;QAClC,IAAA,yCAAyB,EAAC;YACxB,OAAO,EAAE,GAAG,EAAE,CAAC,6BAAoB,CAAC,OAAO;YAC3C,IAAI,EAAE,yBAAkB;YACxB,WAAW,EAAE,CAAO,IAAI,EAAE,EAAE;gBAAC,OAAA,CAAC;oBAC5B,aAAa,EAAE,UAAU,CAAC,IAAI,CAAC,CAAC,YAAY,EAAE;iBAC/C,CAAC,CAAA;cAAA;SACH,CAAC;KACH;IACD,WAAW,EAAE,iBAAiB;IAC9B,WAAW,EAAE,8BAA8B;IAE3C,OAAO,EAAE;QACP,qBAAqB;QACrB,YAAY;QACZ,YAAY;QACZ,WAAW;QACX,eAAe;QACf,UAAU;QACV,SAAS;KACV;IACD,QAAQ,EAAE,CAAC,8CAAgC,CAAC;IAC5C,IAAI,EAAE,yBAAkB;CACzB,CAAC,CAAC"}
@@ -1,10 +0,0 @@
1
- export declare const googleContactsAddContactAction: import("@activepieces/pieces-framework").IAction<import("@activepieces/pieces-framework").OAuth2Property<import("@activepieces/pieces-framework").OAuth2Props>, {
2
- firstName: import("@activepieces/pieces-framework").ShortTextProperty<true>;
3
- middleName: import("@activepieces/pieces-framework").ShortTextProperty<false>;
4
- lastName: import("@activepieces/pieces-framework").ShortTextProperty<true>;
5
- jobTitle: import("@activepieces/pieces-framework").ShortTextProperty<false>;
6
- company: import("@activepieces/pieces-framework").ShortTextProperty<false>;
7
- email: import("@activepieces/pieces-framework").ShortTextProperty<false>;
8
- phoneNumber: import("@activepieces/pieces-framework").ShortTextProperty<false>;
9
- }>;
10
- //# sourceMappingURL=create-contact.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"create-contact.d.ts","sourceRoot":"","sources":["../../../../src/lib/action/create-contact.ts"],"names":[],"mappings":"AAUA,eAAO,MAAM,8BAA8B;;;;;;;;EAmFzC,CAAC"}
@@ -1,93 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.googleContactsAddContactAction = void 0;
4
- const tslib_1 = require("tslib");
5
- const pieces_framework_1 = require("@activepieces/pieces-framework");
6
- const pieces_common_1 = require("@activepieces/pieces-common");
7
- const common_1 = require("../common");
8
- const auth_1 = require("../auth");
9
- exports.googleContactsAddContactAction = (0, pieces_framework_1.createAction)({
10
- auth: auth_1.googleContactsAuth,
11
- name: 'add_contact',
12
- description: 'Add a contact to a Google Contacts account',
13
- audience: 'both',
14
- aiMetadata: { description: 'Creates a new person in the authenticated Google Contacts account from name, email, phone, company, and job title fields. Use when an agent needs to add someone to address book contacts; first and last name are required. Not idempotent — each call creates a separate contact even with identical input, so guard against duplicates.', idempotent: false },
15
- displayName: 'Add Contact',
16
- props: {
17
- firstName: pieces_framework_1.Property.ShortText({
18
- displayName: 'First Name',
19
- description: 'The first name of the contact',
20
- required: true,
21
- }),
22
- middleName: pieces_framework_1.Property.ShortText({
23
- displayName: 'Middle Name',
24
- description: 'The middle name of the contact',
25
- required: false,
26
- }),
27
- lastName: pieces_framework_1.Property.ShortText({
28
- displayName: 'Last Name',
29
- description: 'The last name of the contact',
30
- required: true,
31
- }),
32
- jobTitle: pieces_framework_1.Property.ShortText({
33
- displayName: 'Job Title',
34
- description: 'The job title of the contact',
35
- required: false,
36
- }),
37
- company: pieces_framework_1.Property.ShortText({
38
- displayName: 'Company',
39
- description: 'The company of the contact',
40
- required: false,
41
- }),
42
- email: pieces_framework_1.Property.ShortText({
43
- displayName: 'Email',
44
- description: 'The email address of the contact',
45
- required: false,
46
- }),
47
- phoneNumber: pieces_framework_1.Property.ShortText({
48
- displayName: 'Phone Number',
49
- description: 'The phone number of the contact',
50
- required: false,
51
- }),
52
- },
53
- run(context) {
54
- return tslib_1.__awaiter(this, void 0, void 0, function* () {
55
- let requestBody = {
56
- names: [
57
- {
58
- givenName: context.propsValue['firstName'],
59
- middleName: context.propsValue['middleName'],
60
- familyName: context.propsValue['lastName'],
61
- },
62
- ],
63
- };
64
- const contact = {};
65
- if (context.propsValue['email']) {
66
- contact['emailAddresses'] = [{ value: context.propsValue['email'] }];
67
- }
68
- if (context.propsValue['phoneNumber']) {
69
- contact['phoneNumbers'] = [{ value: context.propsValue['phoneNumber'] }];
70
- }
71
- if (context.propsValue['company'] || context.propsValue['jobTitle']) {
72
- contact['organizations'] = [
73
- {
74
- name: context.propsValue['company'] || undefined,
75
- title: context.propsValue['jobTitle'] || undefined,
76
- },
77
- ];
78
- }
79
- requestBody = Object.assign(Object.assign({}, requestBody), contact);
80
- const request = {
81
- method: pieces_common_1.HttpMethod.POST,
82
- url: `${common_1.googleContactsCommon.baseUrl}:createContact`,
83
- body: requestBody,
84
- authentication: {
85
- type: pieces_common_1.AuthenticationType.BEARER_TOKEN,
86
- token: context.auth.access_token,
87
- },
88
- };
89
- return (yield pieces_common_1.httpClient.sendRequest(request)).body;
90
- });
91
- },
92
- });
93
- //# sourceMappingURL=create-contact.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"create-contact.js","sourceRoot":"","sources":["../../../../src/lib/action/create-contact.ts"],"names":[],"mappings":";;;;AAAA,qEAAwE;AACxE,+DAKqC;AACrC,sCAAiD;AACjD,kCAA6C;AAEhC,QAAA,8BAA8B,GAAG,IAAA,+BAAY,EAAC;IACzD,IAAI,EAAE,yBAAkB;IACxB,IAAI,EAAE,aAAa;IACnB,WAAW,EAAE,4CAA4C;IACzD,QAAQ,EAAE,MAAM;IAChB,UAAU,EAAE,EAAE,WAAW,EAAE,4UAA4U,EAAE,UAAU,EAAE,KAAK,EAAE;IAC5X,WAAW,EAAE,aAAa;IAC1B,KAAK,EAAE;QACL,SAAS,EAAE,2BAAQ,CAAC,SAAS,CAAC;YAC5B,WAAW,EAAE,YAAY;YACzB,WAAW,EAAE,+BAA+B;YAC5C,QAAQ,EAAE,IAAI;SACf,CAAC;QACF,UAAU,EAAE,2BAAQ,CAAC,SAAS,CAAC;YAC7B,WAAW,EAAE,aAAa;YAC1B,WAAW,EAAE,gCAAgC;YAC7C,QAAQ,EAAE,KAAK;SAChB,CAAC;QACF,QAAQ,EAAE,2BAAQ,CAAC,SAAS,CAAC;YAC3B,WAAW,EAAE,WAAW;YACxB,WAAW,EAAE,8BAA8B;YAC3C,QAAQ,EAAE,IAAI;SACf,CAAC;QACF,QAAQ,EAAE,2BAAQ,CAAC,SAAS,CAAC;YAC3B,WAAW,EAAE,WAAW;YACxB,WAAW,EAAE,8BAA8B;YAC3C,QAAQ,EAAE,KAAK;SAChB,CAAC;QACF,OAAO,EAAE,2BAAQ,CAAC,SAAS,CAAC;YAC1B,WAAW,EAAE,SAAS;YACtB,WAAW,EAAE,4BAA4B;YACzC,QAAQ,EAAE,KAAK;SAChB,CAAC;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BACnD;iBACF,CAAC;YACJ,CAAC;YACD,WAAW,mCAAQ,WAAW,GAAK,OAAO,CAAE,CAAC;YAC7C,MAAM,OAAO,GAAyC;gBACpD,MAAM,EAAE,0BAAU,CAAC,IAAI;gBACvB,GAAG,EAAE,GAAG,6BAAoB,CAAC,OAAO,gBAAgB;gBACpD,IAAI,EAAE,WAAW;gBACjB,cAAc,EAAE;oBACd,IAAI,EAAE,kCAAkB,CAAC,YAAY;oBACrC,KAAK,EAAE,OAAO,CAAC,IAAI,CAAC,YAAY;iBACjC;aACF,CAAC;YACF,OAAO,CAAC,MAAM,0BAAU,CAAC,WAAW,CAAC,OAAO,CAAC,CAAC,CAAC,IAAI,CAAC;QACtD,CAAC;KAAA;CACF,CAAC,CAAC"}
@@ -1,6 +0,0 @@
1
- export declare const googleContactsSearchContactsAction: import("@activepieces/pieces-framework").IAction<import("@activepieces/pieces-framework").OAuth2Property<import("@activepieces/pieces-framework").OAuth2Props>, {
2
- query: import("@activepieces/pieces-framework").ShortTextProperty<true>;
3
- readMask: import("@activepieces/pieces-framework").StaticMultiSelectDropdownProperty<string, true>;
4
- pageSize: import("@activepieces/pieces-framework").NumberProperty<false>;
5
- }>;
6
- //# sourceMappingURL=search-contact.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"search-contact.d.ts","sourceRoot":"","sources":["../../../../src/lib/action/search-contact.ts"],"names":[],"mappings":"AAWA,eAAO,MAAM,kCAAkC;;;;EA8E7C,CAAC"}
@@ -1,89 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.googleContactsSearchContactsAction = void 0;
4
- const tslib_1 = require("tslib");
5
- const pieces_framework_1 = require("@activepieces/pieces-framework");
6
- const pieces_common_1 = require("@activepieces/pieces-common");
7
- const common_1 = require("../common");
8
- const auth_1 = require("../auth");
9
- exports.googleContactsSearchContactsAction = (0, pieces_framework_1.createAction)({
10
- auth: auth_1.googleContactsAuth,
11
- name: 'search_contact',
12
- description: 'Search contacts in Google Contacts account.',
13
- audience: 'both',
14
- aiMetadata: { description: 'Searches the authenticated Google Contacts account for people matching a plain-text query, which prefix-matches against contact fields. Use when an agent needs to find a contact or its resourceName before updating it; the query is required and a read mask selects which fields come back (max 30 results). Read-only and idempotent.', idempotent: true },
15
- displayName: 'Search Contacts',
16
- props: {
17
- query: pieces_framework_1.Property.ShortText({
18
- displayName: 'Query',
19
- description: `The plain-text query for the request.The query is used to match prefix phrases of the fields on a person. For example, a person with name "foo name" matches queries such as "f", "fo", "foo", "foo n", "nam", etc., but not "oo n".`,
20
- required: true,
21
- }),
22
- readMask: pieces_framework_1.Property.StaticMultiSelectDropdown({
23
- displayName: 'Read Mask',
24
- description: 'A field mask to restrict which fields on each person are returned.',
25
- required: true,
26
- options: {
27
- options: [
28
- { label: 'addresses', value: 'addresses' },
29
- { label: 'ageRanges', value: 'ageRanges' },
30
- { label: 'biographies', value: 'biographies' },
31
- { label: 'birthdays', value: 'birthdays' },
32
- { label: 'calendarUrls', value: 'calendarUrls' },
33
- { label: 'clientData', value: 'clientData' },
34
- { label: 'coverPhotos', value: 'coverPhotos' },
35
- { label: 'emailAddresses', value: 'emailAddresses' },
36
- { label: 'events', value: 'events' },
37
- { label: 'externalIds', value: 'externalIds' },
38
- { label: 'genders', value: 'genders' },
39
- { label: 'imClients', value: 'imClients' },
40
- { label: 'interests', value: 'interests' },
41
- { label: 'locales', value: 'locales' },
42
- { label: 'locations', value: 'locations' },
43
- { label: 'memberships', value: 'memberships' },
44
- { label: 'metadata', value: 'metadata' },
45
- { label: 'miscKeywords', value: 'miscKeywords' },
46
- { label: 'names', value: 'names' },
47
- { label: 'nicknames', value: 'nicknames' },
48
- { label: 'occupations', value: 'occupations' },
49
- { label: 'organizations', value: 'organizations' },
50
- { label: 'phoneNumbers', value: 'phoneNumbers' },
51
- { label: 'photos', value: 'photos' },
52
- { label: 'relations', value: 'relations' },
53
- { label: 'sipAddresses', value: 'sipAddresses' },
54
- { label: 'skills', value: 'skills' },
55
- { label: 'urls', value: 'urls' },
56
- { label: 'userDefined', value: 'userDefined' },
57
- ],
58
- },
59
- defaultValue: ['names', 'emailAddresses'],
60
- }),
61
- pageSize: pieces_framework_1.Property.Number({
62
- displayName: 'Page Size',
63
- description: 'The number of results to return. Maximum 30.',
64
- required: false,
65
- }),
66
- },
67
- run(context) {
68
- return tslib_1.__awaiter(this, void 0, void 0, function* () {
69
- const qs = {
70
- query: context.propsValue['query'],
71
- readMask: context.propsValue['readMask'].join(','),
72
- };
73
- if (context.propsValue['pageSize']) {
74
- qs['pageSize'] = String(context.propsValue['pageSize']);
75
- }
76
- const request = {
77
- method: pieces_common_1.HttpMethod.GET,
78
- url: `${common_1.googleContactsCommon.baseUrl}:searchContacts`,
79
- authentication: {
80
- type: pieces_common_1.AuthenticationType.BEARER_TOKEN,
81
- token: context.auth.access_token,
82
- },
83
- queryParams: qs,
84
- };
85
- return (yield pieces_common_1.httpClient.sendRequest(request)).body;
86
- });
87
- },
88
- });
89
- //# sourceMappingURL=search-contact.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"search-contact.js","sourceRoot":"","sources":["../../../../src/lib/action/search-contact.ts"],"names":[],"mappings":";;;;AAAA,qEAAwE;AACxE,+DAMqC;AACrC,sCAAiD;AACjD,kCAA6C;AAEhC,QAAA,kCAAkC,GAAG,IAAA,+BAAY,EAAC;IAC7D,IAAI,EAAE,yBAAkB;IACxB,IAAI,EAAE,gBAAgB;IACtB,WAAW,EAAE,6CAA6C;IAC1D,QAAQ,EAAE,MAAM;IAChB,UAAU,EAAE,EAAE,WAAW,EAAE,4UAA4U,EAAE,UAAU,EAAE,IAAI,EAAE;IAC3X,WAAW,EAAE,iBAAiB;IAC9B,KAAK,EAAE;QACL,KAAK,EAAE,2BAAQ,CAAC,SAAS,CAAC;YACxB,WAAW,EAAE,OAAO;YACpB,WAAW,EAAE,sOAAsO;YACnP,QAAQ,EAAE,IAAI;SACf,CAAC;QACF,QAAQ,EAAE,2BAAQ,CA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O,CAAC,UAAU,CAAC,UAAU,CAAC,CAAC,CAAC;YAC1D,CAAC;YACD,MAAM,OAAO,GAAyC;gBACpD,MAAM,EAAE,0BAAU,CAAC,GAAG;gBACtB,GAAG,EAAE,GAAG,6BAAoB,CAAC,OAAO,iBAAiB;gBACrD,cAAc,EAAE;oBACd,IAAI,EAAE,kCAAkB,CAAC,YAAY;oBACrC,KAAK,EAAE,OAAO,CAAC,IAAI,CAAC,YAAY;iBACjC;gBACD,WAAW,EAAE,EAAE;aAChB,CAAC;YACF,OAAO,CAAC,MAAM,0BAAU,CAAC,WAAW,CAAC,OAAO,CAAC,CAAC,CAAC,IAAI,CAAC;QACtD,CAAC;KAAA;CACF,CAAC,CAAC"}
@@ -1,13 +0,0 @@
1
- export declare const googleContactsUpdateContactAction: import("@activepieces/pieces-framework").IAction<import("@activepieces/pieces-framework").OAuth2Property<import("@activepieces/pieces-framework").OAuth2Props>, {
2
- resourceName: import("@activepieces/pieces-framework").ShortTextProperty<true>;
3
- etag: import("@activepieces/pieces-framework").ShortTextProperty<true>;
4
- updatePersonFields: import("@activepieces/pieces-framework").StaticMultiSelectDropdownProperty<string, true>;
5
- firstName: import("@activepieces/pieces-framework").ShortTextProperty<false>;
6
- middleName: import("@activepieces/pieces-framework").ShortTextProperty<false>;
7
- lastName: import("@activepieces/pieces-framework").ShortTextProperty<false>;
8
- jobTitle: import("@activepieces/pieces-framework").ShortTextProperty<false>;
9
- company: import("@activepieces/pieces-framework").ShortTextProperty<false>;
10
- email: import("@activepieces/pieces-framework").ShortTextProperty<false>;
11
- phoneNumber: import("@activepieces/pieces-framework").ShortTextProperty<false>;
12
- }>;
13
- //# sourceMappingURL=update-contact.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"update-contact.d.ts","sourceRoot":"","sources":["../../../../src/lib/action/update-contact.ts"],"names":[],"mappings":"AAcA,eAAO,MAAM,iCAAiC;;;;;;;;;;;EAwH5C,CAAC"}
@@ -1,127 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.googleContactsUpdateContactAction = void 0;
4
- const tslib_1 = require("tslib");
5
- const pieces_framework_1 = require("@activepieces/pieces-framework");
6
- const pieces_common_1 = require("@activepieces/pieces-common");
7
- const common_1 = require("../common");
8
- const auth_1 = require("../auth");
9
- exports.googleContactsUpdateContactAction = (0, pieces_framework_1.createAction)({
10
- auth: auth_1.googleContactsAuth,
11
- name: 'update_contact',
12
- description: 'Update a contact in Google Contacts account.',
13
- audience: 'both',
14
- aiMetadata: { description: 'Updates fields (name, email, phone, company, job title) on an existing Google Contacts person identified by its resourceName (people/{id}). Use when an agent needs to modify a known contact; requires both the resourceName and the current etag, and a field mask listing which fields to update — the call is rejected if the contact changed since the etag was fetched. Repeating the same update with the same etag/values is safe and yields the same result.', idempotent: true },
15
- displayName: 'Update Contact',
16
- props: {
17
- resourceName: pieces_framework_1.Property.ShortText({
18
- displayName: 'Resource Name',
19
- description: 'The resource name for the person, assigned by the server. An ASCII string in the form of people/{person_id}.',
20
- required: true,
21
- }),
22
- etag: pieces_framework_1.Property.ShortText({
23
- displayName: 'Etag',
24
- description: "The `etag` ensures contact updates only apply if the contact hasn't changed since last retrieved.",
25
- required: true,
26
- }),
27
- updatePersonFields: pieces_framework_1.Property.StaticMultiSelectDropdown({
28
- displayName: 'Update Field Mask',
29
- description: 'A field mask to restrict which fields on the person are updated.',
30
- required: true,
31
- options: {
32
- options: [
33
- { label: 'Names', value: 'names' },
34
- { label: 'Email', value: 'emailAddresses' },
35
- { label: 'Phone Number', value: 'phoneNumbers' },
36
- { label: 'Job Title / Company', value: 'organizations' },
37
- ],
38
- },
39
- defaultValue: ['names', 'emailAddresses'],
40
- }),
41
- firstName: pieces_framework_1.Property.ShortText({
42
- displayName: 'First Name',
43
- description: 'The first name of the contact',
44
- required: false,
45
- }),
46
- middleName: pieces_framework_1.Property.ShortText({
47
- displayName: 'Middle Name',
48
- description: 'The middle name of the contact',
49
- required: false,
50
- }),
51
- lastName: pieces_framework_1.Property.ShortText({
52
- displayName: 'Last Name',
53
- description: 'The last name of the contact',
54
- required: false,
55
- }),
56
- jobTitle: pieces_framework_1.Property.ShortText({
57
- displayName: 'Job Title',
58
- description: 'The job title of the contact',
59
- required: false,
60
- }),
61
- company: pieces_framework_1.Property.ShortText({
62
- displayName: 'Company',
63
- description: 'The company of the contact',
64
- required: false,
65
- }),
66
- email: pieces_framework_1.Property.ShortText({
67
- displayName: 'Email',
68
- description: 'The email address of the contact',
69
- required: false,
70
- }),
71
- phoneNumber: pieces_framework_1.Property.ShortText({
72
- displayName: 'Phone Number',
73
- description: 'The phone number of the contact',
74
- required: false,
75
- }),
76
- },
77
- run(context) {
78
- return tslib_1.__awaiter(this, void 0, void 0, function* () {
79
- const resourceName = context.propsValue['resourceName'].substring(6);
80
- const requestBody = {
81
- etag: context.propsValue['etag'],
82
- };
83
- const qs = {
84
- updatePersonFields: context.propsValue['updatePersonFields'].join(','),
85
- };
86
- if (context.propsValue['firstName'] ||
87
- context.propsValue['middleName'] ||
88
- context.propsValue['lastName']) {
89
- requestBody['names'] = [
90
- {
91
- givenName: context.propsValue['firstName'] || undefined,
92
- middleName: context.propsValue['middleName'] || undefined,
93
- familyName: context.propsValue['lastName'] || undefined,
94
- },
95
- ];
96
- }
97
- if (context.propsValue['email']) {
98
- requestBody['emailAddresses'] = [{ value: context.propsValue['email'] }];
99
- }
100
- if (context.propsValue['phoneNumber']) {
101
- requestBody['phoneNumbers'] = [
102
- { value: context.propsValue['phoneNumber'] },
103
- ];
104
- }
105
- if (context.propsValue['company'] || context.propsValue['jobTitle']) {
106
- requestBody['organizations'] = [
107
- {
108
- name: context.propsValue['company'] || undefined,
109
- title: context.propsValue['jobTitle'] || undefined,
110
- },
111
- ];
112
- }
113
- const request = {
114
- method: pieces_common_1.HttpMethod.PATCH,
115
- url: `${common_1.googleContactsCommon.baseUrl}${resourceName}:updateContact`,
116
- body: requestBody,
117
- authentication: {
118
- type: pieces_common_1.AuthenticationType.BEARER_TOKEN,
119
- token: context.auth.access_token,
120
- },
121
- queryParams: qs,
122
- };
123
- return (yield pieces_common_1.httpClient.sendRequest(request)).body;
124
- });
125
- },
126
- });
127
- //# sourceMappingURL=update-contact.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"update-contact.js","sourceRoot":"","sources":["../../../../src/lib/action/update-contact.ts"],"names":[],"mappings":";;;;AAAA,qEAGwC;AACxC,+DAMqC;AACrC,sCAAiD;AACjD,kCAA6C;AAEhC,QAAA,iCAAiC,GAAG,IAAA,+BAAY,EAAC;IAC5D,IAAI,EAAE,yBAAkB;IACxB,IAAI,EAAE,gBAAgB;IACtB,WAAW,EAAE,8CAA8C;IAC3D,QAAQ,EAAE,MAAM;IAChB,UAAU,EAAE,EAAE,WAAW,EAAE,ucAAuc,EAAE,UAAU,EAAE,IAAI,EAAE;IACtf,WAAW,EAAE,gBAAgB;IAC7B,KAAK,EAAE;QACL,YAAY,EAAE,2BAAQ,CAAC,SAAS,CAAC;YAC/B,WAAW,EAAE,eAAe;YAC5B,WAAW,EACT,8GAA8G;YAChH,QAAQ,EAAE,IAAI;SACf,CAAC;QACF,IAAI,EAAE,2BAAQ,CAAC,SAAS,CAAC;YACvB,WAAW,EAAE,MAAM;YACnB,WAAW,EACT,mGAAmG;YACrG,QAAQ,EAAE,IAAI;SACf,CAAC;QACF,kBAAkB,EAAE,2BAAQ,CAAC,yBAAyB,CAAC;YACrD,WAAW,EAAE,mBAAmB;YAChC,WAAW,EACT,kEAAkE;YACpE,QAAQ,EAAE,IAAI;YACd,OAAO,EAAE;gBACP,OAAO,EAAE;oBACP,EAAE,KAAK,EAAE,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE;oBAClC,EAAE,KAAK,EAAE,OAAO,EAAE,KAAK,EAAE,gBAAgB,EAAE;oBAC3C,EAAE,KAAK,EAAE,cAAc,EAAE,KAAK,EAAE,cAAc,EAAE;oBAChD,EAAE,KAAK,EAAE,qBAAqB,EAAE,KAAK,EAAE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F,CAAC;YACJ,CAAC;YACD,MAAM,OAAO,GAAyC;gBACpD,MAAM,EAAE,0BAAU,CAAC,KAAK;gBACxB,GAAG,EAAE,GAAG,6BAAoB,CAAC,OAAO,GAAG,YAAY,gBAAgB;gBACnE,IAAI,EAAE,WAAW;gBACjB,cAAc,EAAE;oBACd,IAAI,EAAE,kCAAkB,CAAC,YAAY;oBACrC,KAAK,EAAE,OAAO,CAAC,IAAI,CAAC,YAAY;iBACjC;gBACD,WAAW,EAAE,EAAE;aAChB,CAAC;YACF,OAAO,CAAC,MAAM,0BAAU,CAAC,WAAW,CAAC,OAAO,CAAC,CAAC,CAAC,IAAI,CAAC;QACtD,CAAC;KAAA;CACF,CAAC,CAAC"}
package/src/lib/auth.d.ts DELETED
@@ -1,2 +0,0 @@
1
- export declare const googleContactsAuth: import("@activepieces/pieces-framework").OAuth2Property<import("@activepieces/pieces-framework").OAuth2Props>;
2
- //# sourceMappingURL=auth.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"auth.d.ts","sourceRoot":"","sources":["../../../src/lib/auth.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,kBAAkB,+GAO7B,CAAC"}
package/src/lib/auth.js DELETED
@@ -1,12 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.googleContactsAuth = void 0;
4
- const pieces_framework_1 = require("@activepieces/pieces-framework");
5
- exports.googleContactsAuth = pieces_framework_1.PieceAuth.OAuth2({
6
- description: '',
7
- authUrl: 'https://accounts.google.com/o/oauth2/auth',
8
- tokenUrl: 'https://oauth2.googleapis.com/token',
9
- required: true,
10
- scope: ['https://www.googleapis.com/auth/contacts'],
11
- });
12
- //# sourceMappingURL=auth.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"auth.js","sourceRoot":"","sources":["../../../src/lib/auth.ts"],"names":[],"mappings":";;;AAAA,qEAA2D;AAE9C,QAAA,kBAAkB,GAAG,4BAAS,CAAC,MAAM,CAAC;IACjD,WAAW,EAAE,EAAE;IAEf,OAAO,EAAE,2CAA2C;IACpD,QAAQ,EAAE,qCAAqC;IAC/C,QAAQ,EAAE,IAAI;IACd,KAAK,EAAE,CAAC,0CAA0C,CAAC;CACpD,CAAC,CAAC"}
@@ -1,4 +0,0 @@
1
- export declare const googleContactsCommon: {
2
- baseUrl: string;
3
- };
4
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/lib/common/index.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,oBAAoB;;CAEhC,CAAC"}
@@ -1,7 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.googleContactsCommon = void 0;
4
- exports.googleContactsCommon = {
5
- baseUrl: `https://people.googleapis.com/v1/people`,
6
- };
7
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/lib/common/index.ts"],"names":[],"mappings":";;;AAAa,QAAA,oBAAoB,GAAG;IAClC,OAAO,EAAE,yCAAyC;CACnD,CAAC"}
@@ -1,3 +0,0 @@
1
- import { TriggerStrategy } from '@activepieces/pieces-framework';
2
- export declare const googleContactNewOrUpdatedContact: import("@activepieces/pieces-framework").ITrigger<TriggerStrategy.WEBHOOK, import("@activepieces/pieces-framework").OAuth2Property<import("@activepieces/pieces-framework").OAuth2Props>, {}> | import("@activepieces/pieces-framework").ITrigger<TriggerStrategy.POLLING, import("@activepieces/pieces-framework").OAuth2Property<import("@activepieces/pieces-framework").OAuth2Props>, {}> | import("@activepieces/pieces-framework").ITrigger<TriggerStrategy.MANUAL, import("@activepieces/pieces-framework").OAuth2Property<import("@activepieces/pieces-framework").OAuth2Props>, {}> | import("@activepieces/pieces-framework").ITrigger<TriggerStrategy.APP_WEBHOOK, import("@activepieces/pieces-framework").OAuth2Property<import("@activepieces/pieces-framework").OAuth2Props>, {}>;
3
- //# sourceMappingURL=new-contact.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"new-contact.d.ts","sourceRoot":"","sources":["../../../../src/lib/trigger/new-contact.ts"],"names":[],"mappings":"AAAA,OAAO,EAIL,eAAe,EAChB,MAAM,gCAAgC,CAAC;AA+ExC,eAAO,MAAM,gCAAgC,kwBAmG3C,CAAC"}
@@ -1,176 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.googleContactNewOrUpdatedContact = void 0;
4
- const tslib_1 = require("tslib");
5
- const pieces_framework_1 = require("@activepieces/pieces-framework");
6
- const pieces_common_1 = require("@activepieces/pieces-common");
7
- const auth_1 = require("../auth");
8
- const googleapis_1 = require("googleapis");
9
- const googleapis_common_1 = require("googleapis-common");
10
- const dayjs_1 = tslib_1.__importDefault(require("dayjs"));
11
- const polling = {
12
- strategy: pieces_common_1.DedupeStrategy.TIMEBASED,
13
- items: (_a) => tslib_1.__awaiter(void 0, [_a], void 0, function* ({ store, auth }) {
14
- var _b, _c, _d;
15
- const authClient = new googleapis_common_1.OAuth2Client();
16
- authClient.setCredentials(auth);
17
- const contactsClient = googleapis_1.google.people({ version: 'v1', auth: authClient });
18
- let nextPageToken;
19
- const contactItems = [];
20
- do {
21
- const response = yield contactsClient.people.connections.list({
22
- resourceName: 'people/me',
23
- pageToken: nextPageToken,
24
- pageSize: 100,
25
- sortOrder: 'LAST_MODIFIED_DESCENDING',
26
- personFields: [
27
- 'addresses',
28
- 'ageRanges',
29
- 'biographies',
30
- 'birthdays',
31
- 'calendarUrls',
32
- 'clientData',
33
- 'coverPhotos',
34
- 'emailAddresses',
35
- 'events',
36
- 'externalIds',
37
- 'genders',
38
- 'imClients',
39
- 'interests',
40
- 'locales',
41
- 'locations',
42
- 'memberships',
43
- 'metadata',
44
- 'miscKeywords',
45
- 'names',
46
- 'nicknames',
47
- 'occupations',
48
- 'organizations',
49
- 'phoneNumbers',
50
- 'photos',
51
- 'relations',
52
- 'sipAddresses',
53
- 'skills',
54
- 'urls',
55
- 'userDefined',
56
- ].join(),
57
- });
58
- for (const contact of response.data.connections || []) {
59
- if (((_b = contact.metadata) === null || _b === void 0 ? void 0 : _b.deleted) !== true) {
60
- contactItems.push({
61
- data: contact,
62
- epochMilliSeconds: (0, dayjs_1.default)((_d = (_c = contact.metadata) === null || _c === void 0 ? void 0 : _c.sources) === null || _d === void 0 ? void 0 : _d[0].updateTime).valueOf(),
63
- });
64
- }
65
- }
66
- nextPageToken = response.data.nextPageToken;
67
- } while (nextPageToken);
68
- return contactItems;
69
- }),
70
- };
71
- exports.googleContactNewOrUpdatedContact = (0, pieces_framework_1.createTrigger)({
72
- auth: auth_1.googleContactsAuth,
73
- name: 'new_or_updated_contact',
74
- displayName: 'New Or Updated Contact',
75
- description: 'Triggers when there is a new or updated contact',
76
- aiMetadata: {
77
- description: 'Fires when a contact in the authenticated Google Contacts account is newly created or has been modified since the last poll. Each event represents one person record with its current fields; deleted contacts are excluded.',
78
- },
79
- props: {},
80
- sampleData: {
81
- resourceName: 'people/c4278485694217203807',
82
- etag: '%EiMBAgMFBgcICQoLDA0ODxATFBUWGSEiIyQlJicuNDU3PT4/QBoEAQIFByIMZFVwNlJPNEVKUzg9',
83
- metadata: {
84
- sources: [
85
- {
86
- type: 'CONTACT',
87
- id: '3b603c120c68305f',
88
- etag: '#dUp6RO4EJS8=',
89
- updateTime: '2023-01-30T14:35:18.142565Z',
90
- },
91
- ],
92
- objectType: 'PERSON',
93
- },
94
- names: [
95
- {
96
- metadata: {
97
- primary: true,
98
- source: {
99
- type: 'CONTACT',
100
- id: '3b603c120c68305f',
101
- },
102
- },
103
- displayName: 'Shahed Mashni',
104
- familyName: 'Mashni',
105
- givenName: 'Shahed',
106
- displayNameLastFirst: 'Mashni, Shahed',
107
- unstructuredName: 'Shahed Mashni',
108
- },
109
- ],
110
- photos: [
111
- {
112
- metadata: {
113
- primary: true,
114
- source: {
115
- type: 'CONTACT',
116
- id: '3b603c120c68305f',
117
- },
118
- },
119
- url: 'https://lh3.googleusercontent.com/cm/AAkddurmZojs4vCcxrpkfSxH9tnqcH-hI82ESDnwv6eq86nZeLStcjYEIe_TCx8r8g5Y=s100',
120
- default: true,
121
- },
122
- ],
123
- memberships: [
124
- {
125
- metadata: {
126
- source: {
127
- type: 'CONTACT',
128
- id: '3b603c120c68305f',
129
- },
130
- },
131
- contactGroupMembership: {
132
- contactGroupId: 'myContacts',
133
- contactGroupResourceName: 'contactGroups/myContacts',
134
- },
135
- },
136
- ],
137
- },
138
- type: pieces_framework_1.TriggerStrategy.POLLING,
139
- onEnable(ctx) {
140
- return tslib_1.__awaiter(this, void 0, void 0, function* () {
141
- return yield pieces_common_1.pollingHelper.onEnable(polling, {
142
- store: ctx.store,
143
- auth: ctx.auth,
144
- propsValue: {},
145
- });
146
- });
147
- },
148
- onDisable(ctx) {
149
- return tslib_1.__awaiter(this, void 0, void 0, function* () {
150
- return yield pieces_common_1.pollingHelper.onEnable(polling, {
151
- store: ctx.store,
152
- auth: ctx.auth,
153
- propsValue: {},
154
- });
155
- });
156
- },
157
- run(ctx) {
158
- return tslib_1.__awaiter(this, void 0, void 0, function* () {
159
- return yield pieces_common_1.pollingHelper.poll(polling, {
160
- store: ctx.store,
161
- auth: ctx.auth,
162
- propsValue: {},
163
- files: ctx.files,
164
- });
165
- });
166
- },
167
- test: (ctx) => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
168
- return yield pieces_common_1.pollingHelper.test(polling, {
169
- store: ctx.store,
170
- auth: ctx.auth,
171
- propsValue: {},
172
- files: ctx.files,
173
- });
174
- }),
175
- });
176
- //# sourceMappingURL=new-contact.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"new-contact.js","sourceRoot":"","sources":["../../../../src/lib/trigger/new-contact.ts"],"names":[],"mappings":";;;;AAAA,qEAKwC;AACxC,+DAIqC;AACrC,kCAA6C;AAC7C,2CAAoC;AACpC,yDAAiD;AACjD,0DAA0B;AAE1B,MAAM,OAAO,GAAiG;IAC5G,Q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