@activepieces/piece-google-contacts 0.3.2 → 0.3.3
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 +5 -5
- package/src/index.d.ts +2 -2
- package/src/index.js +14 -3
- package/src/index.js.map +1 -1
- package/src/lib/action/create-contact.d.ts +1 -1
- package/src/lib/action/create-contact.js +10 -5
- package/src/lib/action/create-contact.js.map +1 -1
- package/src/lib/common/index.js +1 -1
- package/src/lib/common/index.js.map +1 -1
- package/src/lib/trigger/new-contact.d.ts +1 -1
- package/src/lib/trigger/new-contact.js +58 -58
- package/src/lib/trigger/new-contact.js.map +1 -1
package/package.json
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@activepieces/piece-google-contacts",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.3",
|
|
4
4
|
"dependencies": {
|
|
5
5
|
"@sinclair/typebox": "0.26.8",
|
|
6
|
-
"axios": "^1.
|
|
6
|
+
"axios": "^1.6.3",
|
|
7
7
|
"dayjs": "1.11.9",
|
|
8
8
|
"is-base64": "1.1.0",
|
|
9
9
|
"lodash": "4.17.21",
|
|
10
10
|
"nanoid": "3.3.6",
|
|
11
11
|
"semver": "7.5.4",
|
|
12
|
-
"@activepieces/pieces-common": "0.2.
|
|
13
|
-
"@activepieces/pieces-framework": "0.
|
|
14
|
-
"@activepieces/shared": "0.10.
|
|
12
|
+
"@activepieces/pieces-common": "0.2.8",
|
|
13
|
+
"@activepieces/pieces-framework": "0.7.14",
|
|
14
|
+
"@activepieces/shared": "0.10.66",
|
|
15
15
|
"tslib": "2.6.1"
|
|
16
16
|
},
|
|
17
17
|
"main": "./src/index.js",
|
package/src/index.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const googleContactsAuth: import("@activepieces/pieces-framework").OAuth2Property<
|
|
2
|
-
export declare const googleContacts: import("@activepieces/pieces-framework").Piece<import("@activepieces/pieces-framework").OAuth2Property<
|
|
1
|
+
export declare const googleContactsAuth: import("@activepieces/pieces-framework").OAuth2Property<import("@activepieces/pieces-framework").OAuth2Props>;
|
|
2
|
+
export declare const googleContacts: import("@activepieces/pieces-framework").Piece<import("@activepieces/pieces-framework").OAuth2Property<import("@activepieces/pieces-framework").OAuth2Props>>;
|
package/src/index.js
CHANGED
|
@@ -4,20 +4,31 @@ exports.googleContacts = exports.googleContactsAuth = void 0;
|
|
|
4
4
|
const pieces_framework_1 = require("@activepieces/pieces-framework");
|
|
5
5
|
const create_contact_1 = require("./lib/action/create-contact");
|
|
6
6
|
const new_contact_1 = require("./lib/trigger/new-contact");
|
|
7
|
+
const pieces_common_1 = require("@activepieces/pieces-common");
|
|
8
|
+
const common_1 = require("./lib/common");
|
|
7
9
|
exports.googleContactsAuth = pieces_framework_1.PieceAuth.OAuth2({
|
|
8
10
|
description: '',
|
|
9
11
|
authUrl: 'https://accounts.google.com/o/oauth2/auth',
|
|
10
12
|
tokenUrl: 'https://oauth2.googleapis.com/token',
|
|
11
13
|
required: true,
|
|
12
|
-
scope: ['https://www.googleapis.com/auth/contacts']
|
|
14
|
+
scope: ['https://www.googleapis.com/auth/contacts'],
|
|
13
15
|
});
|
|
14
16
|
exports.googleContacts = (0, pieces_framework_1.createPiece)({
|
|
15
17
|
minimumSupportedRelease: '0.5.0',
|
|
16
18
|
logoUrl: 'https://cdn.activepieces.com/pieces/google-contacts.png',
|
|
17
|
-
actions: [
|
|
19
|
+
actions: [
|
|
20
|
+
create_contact_1.googleContactsAddContactAction,
|
|
21
|
+
(0, pieces_common_1.createCustomApiCallAction)({
|
|
22
|
+
baseUrl: () => common_1.googleContactsCommon.baseUrl,
|
|
23
|
+
auth: exports.googleContactsAuth,
|
|
24
|
+
authMapping: (auth) => ({
|
|
25
|
+
Authorization: `Bearer ${auth.access_token}`,
|
|
26
|
+
}),
|
|
27
|
+
}),
|
|
28
|
+
],
|
|
18
29
|
displayName: 'Google Contacts',
|
|
19
30
|
authors: ['abuaboud', 'abdallah-alwarawreh'],
|
|
20
31
|
triggers: [new_contact_1.googleContactNewOrUpdatedContact],
|
|
21
|
-
auth: exports.googleContactsAuth
|
|
32
|
+
auth: exports.googleContactsAuth,
|
|
22
33
|
});
|
|
23
34
|
//# sourceMappingURL=index.js.map
|
package/src/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../packages/pieces/community/google-contacts/src/index.ts"],"names":[],"mappings":";;;AAAA,qEAIwC;AACxC,gEAA6E;AAC7E,2DAA6E;AAC7E,+DAAwE;AACxE,yCAAoD;AAEvC,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;AAEU,QAAA,cAAc,GAAG,IAAA,8BAAW,EAAC;IACxC,uBAAuB,EAAE,OAAO;IAChC,OAAO,EAAE,yDAAyD;IAClE,OAAO,EAAE;QACP,+CAA8B;QAC9B,IAAA,yCAAyB,EAAC;YACxB,OAAO,EAAE,GAAG,EAAE,CAAC,6BAAoB,CAAC,OAAO;YAC3C,IAAI,EAAE,0BAAkB;YACxB,WAAW,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC;gBACtB,aAAa,EAAE,UAAW,IAA4B,CAAC,YAAY,EAAE;aACtE,CAAC;SACH,CAAC;KACH;IACD,WAAW,EAAE,iBAAiB;IAC9B,OAAO,EAAE,CAAC,UAAU,EAAE,qBAAqB,CAAC;IAC5C,QAAQ,EAAE,CAAC,8CAAgC,CAAC;IAC5C,IAAI,EAAE,0BAAkB;CACzB,CAAC,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export declare const googleContactsAddContactAction: import("@activepieces/pieces-framework").IAction<import("@activepieces/pieces-framework").OAuth2Property<
|
|
1
|
+
export declare const googleContactsAddContactAction: import("@activepieces/pieces-framework").IAction<import("@activepieces/pieces-framework").OAuth2Property<import("@activepieces/pieces-framework").OAuth2Props>, {
|
|
2
2
|
firstName: import("@activepieces/pieces-framework").ShortTextProperty<true>;
|
|
3
3
|
middleName: import("@activepieces/pieces-framework").ShortTextProperty<false>;
|
|
4
4
|
lastName: import("@activepieces/pieces-framework").ShortTextProperty<true>;
|
|
@@ -56,8 +56,8 @@ exports.googleContactsAddContactAction = (0, pieces_framework_1.createAction)({
|
|
|
56
56
|
givenName: context.propsValue['firstName'],
|
|
57
57
|
middleName: context.propsValue['middleName'],
|
|
58
58
|
familyName: context.propsValue['lastName'],
|
|
59
|
-
}
|
|
60
|
-
]
|
|
59
|
+
},
|
|
60
|
+
],
|
|
61
61
|
};
|
|
62
62
|
const contact = {};
|
|
63
63
|
if (context.propsValue['email']) {
|
|
@@ -67,7 +67,12 @@ exports.googleContactsAddContactAction = (0, pieces_framework_1.createAction)({
|
|
|
67
67
|
contact['phoneNumbers'] = [{ value: context.propsValue['phoneNumber'] }];
|
|
68
68
|
}
|
|
69
69
|
if (context.propsValue['company'] || context.propsValue['jobTitle']) {
|
|
70
|
-
contact['organizations'] = [
|
|
70
|
+
contact['organizations'] = [
|
|
71
|
+
{
|
|
72
|
+
name: context.propsValue['company'] || undefined,
|
|
73
|
+
title: context.propsValue['jobTitle'] || undefined,
|
|
74
|
+
},
|
|
75
|
+
];
|
|
71
76
|
}
|
|
72
77
|
requestBody = Object.assign(Object.assign({}, requestBody), contact);
|
|
73
78
|
const request = {
|
|
@@ -77,10 +82,10 @@ exports.googleContactsAddContactAction = (0, pieces_framework_1.createAction)({
|
|
|
77
82
|
authentication: {
|
|
78
83
|
type: pieces_common_1.AuthenticationType.BEARER_TOKEN,
|
|
79
84
|
token: context.auth.access_token,
|
|
80
|
-
}
|
|
85
|
+
},
|
|
81
86
|
};
|
|
82
87
|
return (yield pieces_common_1.httpClient.sendRequest(request)).body;
|
|
83
88
|
});
|
|
84
|
-
}
|
|
89
|
+
},
|
|
85
90
|
});
|
|
86
91
|
//# sourceMappingURL=create-contact.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"create-contact.js","sourceRoot":"","sources":["
|
|
1
|
+
{"version":3,"file":"create-contact.js","sourceRoot":"","sources":["../../../../../../../../packages/pieces/community/google-contacts/src/lib/action/create-contact.ts"],"names":[],"mappings":";;;;AAAA,qEAAwE;AACxE,+DAKqC;AACrC,sCAAiD;AACjD,8BAA4C;AAE/B,QAAA,8BAA8B,GAAG,IAAA,+BAAY,EAAC;IACzD,IAAI,EAAE,sBAAkB;IACxB,IAAI,EAAE,aAAa;IACnB,WAAW,EAAE,4CAA4C;IACzD,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,KA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AAC;aACH;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"}
|
package/src/lib/common/index.js
CHANGED
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.googleContactsCommon = void 0;
|
|
4
4
|
exports.googleContactsCommon = {
|
|
5
|
-
baseUrl: `https://people.googleapis.com/v1/people
|
|
5
|
+
baseUrl: `https://people.googleapis.com/v1/people`,
|
|
6
6
|
};
|
|
7
7
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../../../packages/pieces/community/google-contacts/src/lib/common/index.ts"],"names":[],"mappings":";;;AAAa,QAAA,oBAAoB,GAAG;IAClC,OAAO,EAAE,yCAAyC;CACnD,CAAC"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { TriggerStrategy } from '@activepieces/pieces-framework';
|
|
2
|
-
export declare const googleContactNewOrUpdatedContact: import("@activepieces/pieces-framework").ITrigger<TriggerStrategy.POLLING, import("@activepieces/pieces-framework").OAuth2Property<
|
|
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.APP_WEBHOOK, import("@activepieces/pieces-framework").OAuth2Property<import("@activepieces/pieces-framework").OAuth2Props>, {}>;
|
|
@@ -12,10 +12,10 @@ const polling = {
|
|
|
12
12
|
let newContacts = [];
|
|
13
13
|
let fetchMore = true;
|
|
14
14
|
while (fetchMore) {
|
|
15
|
-
const syncToken = (yield store.get(
|
|
15
|
+
const syncToken = (yield store.get('syncToken'));
|
|
16
16
|
const response = yield listContacts((0, pieces_common_1.getAccessTokenOrThrow)(auth), syncToken);
|
|
17
17
|
const newConnections = response.body.connections;
|
|
18
|
-
yield store.put(
|
|
18
|
+
yield store.put('syncToken', response.body.nextSyncToken);
|
|
19
19
|
if (newConnections === undefined || newConnections.length == 0) {
|
|
20
20
|
fetchMore = false;
|
|
21
21
|
}
|
|
@@ -24,14 +24,14 @@ const polling = {
|
|
|
24
24
|
}
|
|
25
25
|
}
|
|
26
26
|
console.log(`Found ${newContacts.length} new contacts`);
|
|
27
|
-
newContacts = newContacts.filter(f => {
|
|
27
|
+
newContacts = newContacts.filter((f) => {
|
|
28
28
|
return f.metadata.deleted !== true;
|
|
29
29
|
});
|
|
30
30
|
return newContacts.map((item) => ({
|
|
31
31
|
id: newContacts.indexOf(item),
|
|
32
32
|
data: item,
|
|
33
33
|
}));
|
|
34
|
-
})
|
|
34
|
+
}),
|
|
35
35
|
};
|
|
36
36
|
exports.googleContactNewOrUpdatedContact = (0, pieces_framework_1.createTrigger)({
|
|
37
37
|
auth: __1.googleContactsAuth,
|
|
@@ -40,62 +40,62 @@ exports.googleContactNewOrUpdatedContact = (0, pieces_framework_1.createTrigger)
|
|
|
40
40
|
description: 'Triggers when there is a new or updated contact',
|
|
41
41
|
props: {},
|
|
42
42
|
sampleData: {
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
43
|
+
resourceName: 'people/c4278485694217203807',
|
|
44
|
+
etag: '%EiMBAgMFBgcICQoLDA0ODxATFBUWGSEiIyQlJicuNDU3PT4/QBoEAQIFByIMZFVwNlJPNEVKUzg9',
|
|
45
|
+
metadata: {
|
|
46
|
+
sources: [
|
|
47
47
|
{
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
}
|
|
48
|
+
type: 'CONTACT',
|
|
49
|
+
id: '3b603c120c68305f',
|
|
50
|
+
etag: '#dUp6RO4EJS8=',
|
|
51
|
+
updateTime: '2023-01-30T14:35:18.142565Z',
|
|
52
|
+
},
|
|
53
53
|
],
|
|
54
|
-
|
|
54
|
+
objectType: 'PERSON',
|
|
55
55
|
},
|
|
56
|
-
|
|
56
|
+
names: [
|
|
57
57
|
{
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
}
|
|
58
|
+
metadata: {
|
|
59
|
+
primary: true,
|
|
60
|
+
source: {
|
|
61
|
+
type: 'CONTACT',
|
|
62
|
+
id: '3b603c120c68305f',
|
|
63
|
+
},
|
|
64
64
|
},
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
}
|
|
65
|
+
displayName: 'Shahed Mashni',
|
|
66
|
+
familyName: 'Mashni',
|
|
67
|
+
givenName: 'Shahed',
|
|
68
|
+
displayNameLastFirst: 'Mashni, Shahed',
|
|
69
|
+
unstructuredName: 'Shahed Mashni',
|
|
70
|
+
},
|
|
71
71
|
],
|
|
72
|
-
|
|
72
|
+
photos: [
|
|
73
73
|
{
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
}
|
|
74
|
+
metadata: {
|
|
75
|
+
primary: true,
|
|
76
|
+
source: {
|
|
77
|
+
type: 'CONTACT',
|
|
78
|
+
id: '3b603c120c68305f',
|
|
79
|
+
},
|
|
80
80
|
},
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
}
|
|
81
|
+
url: 'https://lh3.googleusercontent.com/cm/AAkddurmZojs4vCcxrpkfSxH9tnqcH-hI82ESDnwv6eq86nZeLStcjYEIe_TCx8r8g5Y=s100',
|
|
82
|
+
default: true,
|
|
83
|
+
},
|
|
84
84
|
],
|
|
85
|
-
|
|
85
|
+
memberships: [
|
|
86
86
|
{
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
}
|
|
87
|
+
metadata: {
|
|
88
|
+
source: {
|
|
89
|
+
type: 'CONTACT',
|
|
90
|
+
id: '3b603c120c68305f',
|
|
91
|
+
},
|
|
92
92
|
},
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
}
|
|
97
|
-
}
|
|
98
|
-
]
|
|
93
|
+
contactGroupMembership: {
|
|
94
|
+
contactGroupId: 'myContacts',
|
|
95
|
+
contactGroupResourceName: 'contactGroups/myContacts',
|
|
96
|
+
},
|
|
97
|
+
},
|
|
98
|
+
],
|
|
99
99
|
},
|
|
100
100
|
type: pieces_framework_1.TriggerStrategy.POLLING,
|
|
101
101
|
onEnable(ctx) {
|
|
@@ -103,7 +103,7 @@ exports.googleContactNewOrUpdatedContact = (0, pieces_framework_1.createTrigger)
|
|
|
103
103
|
return yield pieces_common_1.pollingHelper.onEnable(polling, {
|
|
104
104
|
store: ctx.store,
|
|
105
105
|
auth: ctx.auth,
|
|
106
|
-
propsValue: {}
|
|
106
|
+
propsValue: {},
|
|
107
107
|
});
|
|
108
108
|
});
|
|
109
109
|
},
|
|
@@ -112,7 +112,7 @@ exports.googleContactNewOrUpdatedContact = (0, pieces_framework_1.createTrigger)
|
|
|
112
112
|
return yield pieces_common_1.pollingHelper.onEnable(polling, {
|
|
113
113
|
store: ctx.store,
|
|
114
114
|
auth: ctx.auth,
|
|
115
|
-
propsValue: {}
|
|
115
|
+
propsValue: {},
|
|
116
116
|
});
|
|
117
117
|
});
|
|
118
118
|
},
|
|
@@ -121,7 +121,7 @@ exports.googleContactNewOrUpdatedContact = (0, pieces_framework_1.createTrigger)
|
|
|
121
121
|
return yield pieces_common_1.pollingHelper.poll(polling, {
|
|
122
122
|
store: ctx.store,
|
|
123
123
|
auth: ctx.auth,
|
|
124
|
-
propsValue: {}
|
|
124
|
+
propsValue: {},
|
|
125
125
|
});
|
|
126
126
|
});
|
|
127
127
|
},
|
|
@@ -129,26 +129,26 @@ exports.googleContactNewOrUpdatedContact = (0, pieces_framework_1.createTrigger)
|
|
|
129
129
|
return yield pieces_common_1.pollingHelper.poll(polling, {
|
|
130
130
|
store: ctx.store,
|
|
131
131
|
auth: ctx.auth,
|
|
132
|
-
propsValue: {}
|
|
132
|
+
propsValue: {},
|
|
133
133
|
});
|
|
134
|
-
})
|
|
134
|
+
}),
|
|
135
135
|
});
|
|
136
136
|
function listContacts(access_token, syncToken) {
|
|
137
137
|
let qParams = {
|
|
138
|
-
personFields:
|
|
139
|
-
requestSyncToken:
|
|
138
|
+
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',
|
|
139
|
+
requestSyncToken: 'true',
|
|
140
140
|
};
|
|
141
141
|
if (syncToken !== undefined && syncToken !== null) {
|
|
142
142
|
qParams = Object.assign(Object.assign({}, qParams), { syncToken: syncToken });
|
|
143
143
|
}
|
|
144
144
|
return pieces_common_1.httpClient.sendRequest({
|
|
145
145
|
method: pieces_common_1.HttpMethod.GET,
|
|
146
|
-
url: common_1.googleContactsCommon.baseUrl +
|
|
146
|
+
url: common_1.googleContactsCommon.baseUrl + '/me/connections',
|
|
147
147
|
authentication: {
|
|
148
148
|
type: pieces_common_1.AuthenticationType.BEARER_TOKEN,
|
|
149
149
|
token: access_token,
|
|
150
150
|
},
|
|
151
|
-
queryParams: qParams
|
|
151
|
+
queryParams: qParams,
|
|
152
152
|
});
|
|
153
153
|
}
|
|
154
154
|
//# sourceMappingURL=new-contact.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"new-contact.js","sourceRoot":"","sources":["
|
|
1
|
+
{"version":3,"file":"new-contact.js","sourceRoot":"","sources":["../../../../../../../../packages/pieces/community/google-contacts/src/lib/trigger/new-contact.ts"],"names":[],"mappings":";;;;AAAA,qEAIwC;AACxC,+DASqC;AACrC,sCAAiD;AACjD,8BAA4C;AAE5C,MAAM,OAAO,GAAwD;IACnE,QAAQ,EAAE,8BAAc,CAAC,SAAS;IAClC,KAAK,EAAE,CAAO,EAAE,KAAK,EAAE,IAAI,EAAE,EAAE,EAAE;QAC/B,IAAI,WAAW,GAAiB,EAAE,CAAC;QACnC,IAAI,SAAS,GAAG,IAAI,CAAC;QACrB,OAAO,SAAS,EAAE;YAChB,MAAM,SAAS,GAAG,CAAC,MAAM,KAAK,CAAC,GAAG,CAAS,WAAW,CAAC,CAAE,CAAC;YAC1D,MAAM,QAAQ,GAAG,MAAM,YAAY,CACjC,IAAA,qCAAqB,EAAC,IAAI,CAAC,EAC3B,SAAS,CACV,CAAC;YACF,MAAM,cAAc,GAAG,QAAQ,CAAC,IAAI,CAAC,WAAW,CAAC;YACjD,MAAM,KAAK,CAAC,GAAG,CAAC,WAAW,EAAE,QAAQ,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC;YAC1D,IAAI,cAAc,KAAK,SAAS,IAAI,cAAc,CAAC,MAAM,IAAI,CAAC,EAAE;gBAC9D,SAAS,GAAG,KAAK,CAAC;aACnB;YACD,IAAI,cAAc,KAAK,SAAS,EAAE;gBAChC,WAAW,GAAG,CAAC,GAAG,WAAW,EAAE,GAAG,cAAc,CAAC,CAAC;aACnD;SACF;QACD,OAAO,CAAC,GAAG,C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