@auxee/piece-google-chat-custom 0.0.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/package.json +31 -0
- package/src/index.d.ts +1 -0
- package/src/index.js +47 -0
- package/src/index.js.map +1 -0
- package/src/lib/actions/add-a-space-member.d.ts +4 -0
- package/src/lib/actions/add-a-space-member.js +33 -0
- package/src/lib/actions/add-a-space-member.js.map +1 -0
- package/src/lib/actions/find-member.d.ts +4 -0
- package/src/lib/actions/find-member.js +52 -0
- package/src/lib/actions/find-member.js.map +1 -0
- package/src/lib/actions/get-direct-message-details.d.ts +3 -0
- package/src/lib/actions/get-direct-message-details.js +30 -0
- package/src/lib/actions/get-direct-message-details.js.map +1 -0
- package/src/lib/actions/get-message.d.ts +3 -0
- package/src/lib/actions/get-message.js +30 -0
- package/src/lib/actions/get-message.js.map +1 -0
- package/src/lib/actions/search-messages.d.ts +5 -0
- package/src/lib/actions/search-messages.js +40 -0
- package/src/lib/actions/search-messages.js.map +1 -0
- package/src/lib/actions/send-a-message.d.ts +8 -0
- package/src/lib/actions/send-a-message.js +103 -0
- package/src/lib/actions/send-a-message.js.map +1 -0
- package/src/lib/common/constants.d.ts +16 -0
- package/src/lib/common/constants.js +35 -0
- package/src/lib/common/constants.js.map +1 -0
- package/src/lib/common/index.d.ts +42 -0
- package/src/lib/common/index.js +20 -0
- package/src/lib/common/index.js.map +1 -0
- package/src/lib/common/props.d.ts +19 -0
- package/src/lib/common/props.js +278 -0
- package/src/lib/common/props.js.map +1 -0
- package/src/lib/common/requests.d.ts +98 -0
- package/src/lib/common/requests.js +358 -0
- package/src/lib/common/requests.js.map +1 -0
- package/src/lib/common/schemas.d.ts +54 -0
- package/src/lib/common/schemas.js +91 -0
- package/src/lib/common/schemas.js.map +1 -0
- package/src/lib/triggers/new-mention.d.ts +14 -0
- package/src/lib/triggers/new-mention.js +96 -0
- package/src/lib/triggers/new-mention.js.map +1 -0
- package/src/lib/triggers/new-message.d.ts +11 -0
- package/src/lib/triggers/new-message.js +80 -0
- package/src/lib/triggers/new-message.js.map +1 -0
package/package.json
ADDED
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@auxee/piece-google-chat-custom",
|
|
3
|
+
"version": "0.0.1",
|
|
4
|
+
"description": "Google Chat piece with platform OAuth2 configuration from environment variables",
|
|
5
|
+
"type": "commonjs",
|
|
6
|
+
"main": "./src/index.js",
|
|
7
|
+
"types": "./src/index.d.ts",
|
|
8
|
+
"private": false,
|
|
9
|
+
"publishConfig": {
|
|
10
|
+
"access": "public",
|
|
11
|
+
"registry": "https://registry.npmjs.org/"
|
|
12
|
+
},
|
|
13
|
+
"dependencies": {
|
|
14
|
+
"@activepieces/pieces-common": "0.8.2",
|
|
15
|
+
"@activepieces/pieces-framework": "0.20.3",
|
|
16
|
+
"@activepieces/shared": "0.26.2",
|
|
17
|
+
"@sinclair/typebox": "0.34.11",
|
|
18
|
+
"axios": "1.13.1",
|
|
19
|
+
"axios-retry": "4.4.1",
|
|
20
|
+
"deepmerge-ts": "7.1.0",
|
|
21
|
+
"mime-types": "2.1.35",
|
|
22
|
+
"nanoid": "3.3.8",
|
|
23
|
+
"semver": "7.6.0",
|
|
24
|
+
"socket.io-client": "4.8.1",
|
|
25
|
+
"tslib": "^2.6.2",
|
|
26
|
+
"zod": "4.1.13"
|
|
27
|
+
},
|
|
28
|
+
"resolutions": {
|
|
29
|
+
"rollup": "npm:@rollup/wasm-node"
|
|
30
|
+
}
|
|
31
|
+
}
|
package/src/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const googleChatCustom: import("@activepieces/pieces-framework").Piece<import("@activepieces/pieces-framework").BasicAuthProperty | import("@activepieces/pieces-framework").CustomAuthProperty<any> | import("@activepieces/pieces-framework").OAuth2Property<any> | import("@activepieces/pieces-framework").SecretTextProperty<boolean>>;
|
package/src/index.js
ADDED
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.googleChatCustom = 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 shared_1 = require("@activepieces/shared");
|
|
8
|
+
const constants_1 = require("./lib/common/constants");
|
|
9
|
+
const new_message_1 = require("./lib/triggers/new-message");
|
|
10
|
+
const new_mention_1 = require("./lib/triggers/new-mention");
|
|
11
|
+
const send_a_message_1 = require("./lib/actions/send-a-message");
|
|
12
|
+
const get_direct_message_details_1 = require("./lib/actions/get-direct-message-details");
|
|
13
|
+
const add_a_space_member_1 = require("./lib/actions/add-a-space-member");
|
|
14
|
+
const get_message_1 = require("./lib/actions/get-message");
|
|
15
|
+
const search_messages_1 = require("./lib/actions/search-messages");
|
|
16
|
+
const find_member_1 = require("./lib/actions/find-member");
|
|
17
|
+
exports.googleChatCustom = (0, pieces_framework_1.createPiece)({
|
|
18
|
+
displayName: 'Google Chat (Custom)',
|
|
19
|
+
auth: constants_1.googleChatApiAuth,
|
|
20
|
+
minimumSupportedRelease: '0.36.1',
|
|
21
|
+
description: 'Google Chat is a messaging app that allows you to send and receive messages, create spaces, and more. Uses environment-based OAuth configuration.',
|
|
22
|
+
logoUrl: 'https://cdn.activepieces.com/pieces/googlechat.png',
|
|
23
|
+
categories: [shared_1.PieceCategory.COMMUNICATION],
|
|
24
|
+
authors: ['auxee'],
|
|
25
|
+
actions: [
|
|
26
|
+
send_a_message_1.sendAMessage,
|
|
27
|
+
get_direct_message_details_1.getDirectMessageDetails,
|
|
28
|
+
add_a_space_member_1.addASpaceMember,
|
|
29
|
+
get_message_1.getMessageDetails,
|
|
30
|
+
search_messages_1.searchMessages,
|
|
31
|
+
find_member_1.findMember,
|
|
32
|
+
(0, pieces_common_1.createCustomApiCallAction)({
|
|
33
|
+
baseUrl: () => 'https://chat.googleapis.com/v1',
|
|
34
|
+
auth: constants_1.googleChatApiAuth,
|
|
35
|
+
authMapping: (auth) => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
|
|
36
|
+
return ({
|
|
37
|
+
Authorization: `Bearer ${auth.access_token}`,
|
|
38
|
+
});
|
|
39
|
+
}),
|
|
40
|
+
}),
|
|
41
|
+
],
|
|
42
|
+
triggers: [
|
|
43
|
+
new_message_1.newMessage,
|
|
44
|
+
new_mention_1.newMention
|
|
45
|
+
],
|
|
46
|
+
});
|
|
47
|
+
//# sourceMappingURL=index.js.map
|
package/src/index.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../packages/pieces/custom/google-chat-custom/src/index.ts"],"names":[],"mappings":";;;;AAAA,qEAAkF;AAClF,+DAAwE;AACxE,iDAAqD;AACrD,sDAA2D;AAC3D,4DAAwD;AACxD,4DAAwD;AACxD,iEAA4D;AAC5D,yFAAmF;AACnF,yEAAmE;AACnE,2DAA8D;AAC9D,mEAA+D;AAC/D,2DAAuD;AAE1C,QAAA,gBAAgB,GAAG,IAAA,8BAAW,EAAC;IAC1C,WAAW,EAAE,sBAAsB;IACnC,IAAI,EAAE,6BAAiB;IACvB,uBAAuB,EAAE,QAAQ;IACjC,WAAW,EAAE,mJAAmJ;IAChK,OAAO,EAAE,oDAAoD;IAC7D,UAAU,EAAE,CAAC,sBAAa,CAAC,aAAa,CAAC;IACzC,OAAO,EAAE,CAAC,OAAO,CAAC;IAClB,OAAO,EAAE;QACP,6BAAY;QACZ,oDAAuB;QACvB,oCAAe;QACf,+BAAiB;QACjB,gCAAc;QACd,wBAAU;QACV,IAAA,yCAAyB,EAAC;YACxB,OAAO,EAAE,GAAG,EAAE,CAAC,gCAAgC;YAC/C,IAAI,EAAE,6BAAiB;YACvB,WAAW,EAAE,CAAO,IAAI,EAAE,EAAE;gBAAC,OAAA,CAAC;oBAC5B,aAAa,EAAE,UAAW,IAA4B,CAAC,YAAY,EAAE;iBACtE,CAAC,CAAA;cAAA;SACH,CAAC;KACH;IACD,QAAQ,EAAE;QACR,wBAAU;QACV,wBAAU;KACX;CACF,CAAC,CAAC"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export declare const addASpaceMember: import("@activepieces/pieces-framework").IAction<import("@activepieces/pieces-framework").OAuth2Property<import("@activepieces/pieces-framework").OAuth2Props>, {
|
|
2
|
+
spaceId: import("@activepieces/pieces-framework").DropdownProperty<unknown, true> | import("@activepieces/pieces-framework").DropdownProperty<unknown, false>;
|
|
3
|
+
personId: import("@activepieces/pieces-framework").DropdownProperty<unknown, true>;
|
|
4
|
+
}>;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.addASpaceMember = 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 props_1 = require("../common/props");
|
|
9
|
+
const requests_1 = require("../common/requests");
|
|
10
|
+
exports.addASpaceMember = (0, pieces_framework_1.createAction)({
|
|
11
|
+
auth: common_1.googleChatApiAuth,
|
|
12
|
+
name: 'addASpaceMember',
|
|
13
|
+
displayName: 'Add a Space Member',
|
|
14
|
+
description: 'Add a user to a Google Chat space.',
|
|
15
|
+
props: {
|
|
16
|
+
spaceId: (0, props_1.spacesDropdown)({ refreshers: ['auth'], required: true }),
|
|
17
|
+
personId: (0, props_1.peoplesDropdown)(['auth']),
|
|
18
|
+
},
|
|
19
|
+
run(_a) {
|
|
20
|
+
return tslib_1.__awaiter(this, arguments, void 0, function* ({ auth, propsValue }) {
|
|
21
|
+
yield pieces_common_1.propsValidation.validateZod(propsValue, common_1.googleChatCommon.addSpaceMemberSchema);
|
|
22
|
+
const { spaceId, personId } = propsValue;
|
|
23
|
+
const userId = personId.replace('people', 'users');
|
|
24
|
+
const response = yield requests_1.googleChatAPIService.AddASpaceMember({
|
|
25
|
+
accessToken: auth.access_token,
|
|
26
|
+
spaceId: spaceId,
|
|
27
|
+
userId: userId
|
|
28
|
+
});
|
|
29
|
+
return response;
|
|
30
|
+
});
|
|
31
|
+
},
|
|
32
|
+
});
|
|
33
|
+
//# sourceMappingURL=add-a-space-member.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"add-a-space-member.js","sourceRoot":"","sources":["../../../../../../../../packages/pieces/custom/google-chat-custom/src/lib/actions/add-a-space-member.ts"],"names":[],"mappings":";;;;AAAA,qEAAwE;AACxE,+DAA8D;AAC9D,sCAAgE;AAChE,2CAAyF;AACzF,iDAA0D;AAE7C,QAAA,eAAe,GAAG,IAAA,+BAAY,EAAC;IAC1C,IAAI,EAAE,0BAAiB;IACvB,IAAI,EAAE,iBAAiB;IACvB,WAAW,EAAE,oBAAoB;IACjC,WAAW,EAAE,oCAAoC;IACjD,KAAK,EAAE;QACL,OAAO,EAAE,IAAA,sBAAc,EAAC,EAAE,UAAU,EAAE,CAAC,MAAM,CAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;QACjE,QAAQ,EAAE,IAAA,uBAAe,EAAC,CAAC,MAAM,CAAC,CAAC;KACpC;IACK,GAAG;qEAAC,EAAE,IAAI,EAAE,UAAU,EAAE;YAC5B,MAAM,+BAAe,CAAC,WAAW,CAAC,UAAU,EAAE,yBAAgB,CAAC,oBAAoB,CAAC,CAAC;YAErF,MAAM,EAAE,OAAO,EAAE,QAAQ,EAAE,GAAG,UAAU,CAAC;YAEzC,MAAM,MAAM,GAAI,QAAmB,CAAC,OAAO,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAC;YAE/D,MAAM,QAAQ,GAAG,MAAM,+BAAoB,CAAC,eAAe,CAAC;gBAC1D,WAAW,EAAE,IAAI,CAAC,YAAY;gBAC9B,OAAO,EAAE,OAAiB;gBAC1B,MAAM,EAAE,MAAgB;aACzB,CAAC,CAAA;YAEF,OAAO,QAAQ,CAAC;QAClB,CAAC;KAAA;CACF,CAAC,CAAC"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export declare const findMember: import("@activepieces/pieces-framework").IAction<import("@activepieces/pieces-framework").OAuth2Property<import("@activepieces/pieces-framework").OAuth2Props>, {
|
|
2
|
+
spaceId: import("@activepieces/pieces-framework").DropdownProperty<unknown, true> | import("@activepieces/pieces-framework").DropdownProperty<unknown, false>;
|
|
3
|
+
email: import("@activepieces/pieces-framework").ShortTextProperty<true>;
|
|
4
|
+
}>;
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.findMember = 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 props_1 = require("../common/props");
|
|
9
|
+
const requests_1 = require("../common/requests");
|
|
10
|
+
exports.findMember = (0, pieces_framework_1.createAction)({
|
|
11
|
+
auth: common_1.googleChatApiAuth,
|
|
12
|
+
name: 'findMember',
|
|
13
|
+
displayName: 'Find Member',
|
|
14
|
+
description: 'Search space member by email',
|
|
15
|
+
props: {
|
|
16
|
+
spaceId: (0, props_1.spacesDropdown)({ refreshers: ['auth'], required: true }),
|
|
17
|
+
email: pieces_framework_1.Property.ShortText({
|
|
18
|
+
displayName: 'Member Email',
|
|
19
|
+
description: 'The email address of the member to find',
|
|
20
|
+
required: true,
|
|
21
|
+
}),
|
|
22
|
+
},
|
|
23
|
+
run(_a) {
|
|
24
|
+
return tslib_1.__awaiter(this, arguments, void 0, function* ({ auth, propsValue }) {
|
|
25
|
+
yield pieces_common_1.propsValidation.validateZod(propsValue, common_1.googleChatCommon.findMemberSchema);
|
|
26
|
+
const { spaceId, email } = propsValue;
|
|
27
|
+
const accessToken = auth.access_token;
|
|
28
|
+
try {
|
|
29
|
+
const people = yield requests_1.googleChatAPIService.fetchPeople(accessToken);
|
|
30
|
+
const person = people.find((p) => {
|
|
31
|
+
var _a;
|
|
32
|
+
return (_a = p === null || p === void 0 ? void 0 : p.emailAddresses) === null || _a === void 0 ? void 0 : _a.some((e) => e.value.toLowerCase() === email.toLowerCase());
|
|
33
|
+
});
|
|
34
|
+
if (!person)
|
|
35
|
+
return { error: `No user found with email ${email}` };
|
|
36
|
+
const spaceMemberId = person.resourceName.replace('people', 'users');
|
|
37
|
+
const spaceMembers = yield requests_1.googleChatAPIService.fetchSpaceMembers(accessToken, spaceId);
|
|
38
|
+
const matchingMember = spaceMembers.find((m) => { var _a; return ((_a = m.member) === null || _a === void 0 ? void 0 : _a.name) === spaceMemberId; });
|
|
39
|
+
if (!matchingMember)
|
|
40
|
+
return {
|
|
41
|
+
error: `${email} is not a member of space ${spaceId}`,
|
|
42
|
+
};
|
|
43
|
+
return matchingMember;
|
|
44
|
+
}
|
|
45
|
+
catch (e) {
|
|
46
|
+
console.error('Error finding member by email', e);
|
|
47
|
+
return { error: 'Failed to retrieve member information' };
|
|
48
|
+
}
|
|
49
|
+
});
|
|
50
|
+
},
|
|
51
|
+
});
|
|
52
|
+
//# sourceMappingURL=find-member.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"find-member.js","sourceRoot":"","sources":["../../../../../../../../packages/pieces/custom/google-chat-custom/src/lib/actions/find-member.ts"],"names":[],"mappings":";;;;AAAA,qEAAwE;AACxE,+DAA8D;AAC9D,sCAAgE;AAChE,2CAAiD;AACjD,iDAA0D;AAE7C,QAAA,UAAU,GAAG,IAAA,+BAAY,EAAC;IACrC,IAAI,EAAE,0BAAiB;IACvB,IAAI,EAAE,YAAY;IAClB,WAAW,EAAE,aAAa;IAC1B,WAAW,EAAE,8BAA8B;IAC3C,KAAK,EAAE;QACL,OAAO,EAAE,IAAA,sBAAc,EAAC,EAAE,UAAU,EAAE,CAAC,MAAM,CAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;QACjE,KAAK,EAAE,2BAAQ,CAAC,SAAS,CAAC;YACxB,WAAW,EAAE,cAAc;YAC3B,WAAW,EAAE,yCAAyC;YACtD,QAAQ,EAAE,IAAI;SACf,CAAC;KACH;IACK,GAAG;qEAAC,EAAE,IAAI,EAAE,UAAU,EAAE;YAC5B,MAAM,+BAAe,CAAC,WAAW,CAAC,UAAU,EAAE,yBAAgB,CAAC,gBAAgB,CAAC,CAAC;YAEjF,MAAM,EAAE,OAAO,EAAE,KAAK,EAAE,GAAG,UAAU,CAAC;YACtC,MAAM,WAAW,GAAG,IAAI,CAAC,YAAY,CAAC;YAEtC,IAAI,CAAC;gBACH,MAAM,MAAM,GAAG,MAAM,+BAAoB,CAAC,WAAW,CACnD,WAAW,CACZ,CAAC;gBAEF,MAAM,MAAM,GAAG,MAAM,CAAC,IAAI,CAAC,CAAC,CAAM,EAAE,EAAE;;oBACpC,OAAA,MAAA,CAAC,aAAD,CAAC,uBAAD,CAAC,CAAE,cAAc,0CAAE,IAAI,CACrB,CAAC,CAAM,EAAE,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC,WAAW,EAAE,KAAK,KAAK,CAAC,WAAW,EAAE,CAC1D,CAAA;iBAAA,CACF,CAAC;gBAEF,IAAI,CAAC,MAAM;oBAAE,OAAO,EAAE,KAAK,EAAE,4BAA4B,KAAK,EAAE,EAAE,CAAC;gBAEnE,MAAM,aAAa,GAAI,MAAM,CAAC,YAAuB,CAAC,OAAO,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAC;gBAEjF,MAAM,YAAY,GAAG,MAAM,+BAAoB,CAAC,iBAAiB,CAC/D,WAAW,EACX,OAAiB,CAClB,CAAC;gBAEF,MAAM,cAAc,GAAG,YAAY,CAAC,IAAI,CACtC,CAAC,CAAM,EAAE,EAAE,WAAC,OAAA,CAAA,MAAA,CAAC,CAAC,MAAM,0CAAE,IAAI,MAAK,aAAa,CAAA,EAAA,CAC7C,CAAC;gBAEF,IAAI,CAAC,cAAc;oBAAE,OAAO;wBAC1B,KAAK,EAAE,GAAG,KAAK,6BAA6B,OAAO,EAAE;qBACtD,CAAC;gBAEF,OAAO,cAAc,CAAC;YACxB,CAAC;YAAC,OAAO,CAAC,EAAE,CAAC;gBACX,OAAO,CAAC,KAAK,CAAC,+BAA+B,EAAE,CAAC,CAAC,CAAC;gBAClD,OAAO,EAAE,KAAK,EAAE,uCAAuC,EAAE,CAAC;YAC5D,CAAC;QACH,CAAC;KAAA;CACF,CAAC,CAAC"}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
export declare const getDirectMessageDetails: import("@activepieces/pieces-framework").IAction<import("@activepieces/pieces-framework").OAuth2Property<import("@activepieces/pieces-framework").OAuth2Props>, {
|
|
2
|
+
directMessageId: import("@activepieces/pieces-framework").DropdownProperty<unknown, true> | import("@activepieces/pieces-framework").DropdownProperty<unknown, false>;
|
|
3
|
+
}>;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getDirectMessageDetails = 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 props_1 = require("../common/props");
|
|
9
|
+
const requests_1 = require("../common/requests");
|
|
10
|
+
exports.getDirectMessageDetails = (0, pieces_framework_1.createAction)({
|
|
11
|
+
auth: common_1.googleChatApiAuth,
|
|
12
|
+
name: 'getDirectMessageDetails',
|
|
13
|
+
displayName: 'Get Direct Message Details',
|
|
14
|
+
description: 'Retrieve details of a specific direct message by ID.',
|
|
15
|
+
props: {
|
|
16
|
+
directMessageId: (0, props_1.directMessagesDropdown)({ refreshers: ['auth'], required: true }),
|
|
17
|
+
},
|
|
18
|
+
run(_a) {
|
|
19
|
+
return tslib_1.__awaiter(this, arguments, void 0, function* ({ auth, propsValue }) {
|
|
20
|
+
yield pieces_common_1.propsValidation.validateZod(propsValue, common_1.googleChatCommon.getDirectMessageDetailsSchema);
|
|
21
|
+
const { directMessageId } = propsValue;
|
|
22
|
+
const response = yield requests_1.googleChatAPIService.getSpace({
|
|
23
|
+
accessToken: auth.access_token,
|
|
24
|
+
spaceId: directMessageId,
|
|
25
|
+
});
|
|
26
|
+
return response;
|
|
27
|
+
});
|
|
28
|
+
},
|
|
29
|
+
});
|
|
30
|
+
//# sourceMappingURL=get-direct-message-details.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get-direct-message-details.js","sourceRoot":"","sources":["../../../../../../../../packages/pieces/custom/google-chat-custom/src/lib/actions/get-direct-message-details.ts"],"names":[],"mappings":";;;;AAAA,qEAAwE;AACxE,+DAA8D;AAC9D,sCAAgE;AAChE,2CAAyE;AACzE,iDAA0D;AAE7C,QAAA,uBAAuB,GAAG,IAAA,+BAAY,EAAC;IAClD,IAAI,EAAE,0BAAiB;IACvB,IAAI,EAAE,yBAAyB;IAC/B,WAAW,EAAE,4BAA4B;IACzC,WAAW,EAAE,sDAAsD;IACnE,KAAK,EAAE;QACL,eAAe,EAAE,IAAA,8BAAsB,EAAC,EAAE,UAAU,EAAE,CAAC,MAAM,CAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;KAClF;IACK,GAAG;qEAAC,EAAE,IAAI,EAAE,UAAU,EAAE;YAC5B,MAAM,+BAAe,CAAC,WAAW,CAAC,UAAU,EAAE,yBAAgB,CAAC,6BAA6B,CAAC,CAAC;YAE9F,MAAM,EAAE,eAAe,EAAE,GAAG,UAAU,CAAC;YAEvC,MAAM,QAAQ,GAAG,MAAM,+BAAoB,CAAC,QAAQ,CAAC;gBACnD,WAAW,EAAE,IAAI,CAAC,YAAY;gBAC9B,OAAO,EAAE,eAAyB;aACnC,CAAC,CAAC;YAEH,OAAO,QAAQ,CAAC;QAClB,CAAC;KAAA;CACF,CAAC,CAAC"}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
export declare const getMessageDetails: import("@activepieces/pieces-framework").IAction<import("@activepieces/pieces-framework").OAuth2Property<import("@activepieces/pieces-framework").OAuth2Props>, {
|
|
2
|
+
name: import("@activepieces/pieces-framework").ShortTextProperty<true>;
|
|
3
|
+
}>;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getMessageDetails = 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 requests_1 = require("../common/requests");
|
|
9
|
+
exports.getMessageDetails = (0, pieces_framework_1.createAction)({
|
|
10
|
+
auth: common_1.googleChatApiAuth,
|
|
11
|
+
name: 'getMessageDetails',
|
|
12
|
+
displayName: 'Get Message Details',
|
|
13
|
+
description: 'Retrieve details of a specific message by ID. Supports both system-generated and custom message IDs.',
|
|
14
|
+
props: {
|
|
15
|
+
name: pieces_framework_1.Property.ShortText({
|
|
16
|
+
displayName: 'Message Resource Name',
|
|
17
|
+
description: 'The full resource name of the message. Format: spaces/{space}/messages/{message}',
|
|
18
|
+
required: true,
|
|
19
|
+
}),
|
|
20
|
+
},
|
|
21
|
+
run(_a) {
|
|
22
|
+
return tslib_1.__awaiter(this, arguments, void 0, function* ({ auth, propsValue }) {
|
|
23
|
+
yield pieces_common_1.propsValidation.validateZod(propsValue, common_1.googleChatCommon.getMessageSchema);
|
|
24
|
+
const { name } = propsValue;
|
|
25
|
+
const message = yield requests_1.googleChatAPIService.getMessage(auth.access_token, name);
|
|
26
|
+
return message;
|
|
27
|
+
});
|
|
28
|
+
},
|
|
29
|
+
});
|
|
30
|
+
//# sourceMappingURL=get-message.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get-message.js","sourceRoot":"","sources":["../../../../../../../../packages/pieces/custom/google-chat-custom/src/lib/actions/get-message.ts"],"names":[],"mappings":";;;;AAAA,qEAAwE;AACxE,+DAA8D;AAC9D,sCAAgE;AAChE,iDAA0D;AAE7C,QAAA,iBAAiB,GAAG,IAAA,+BAAY,EAAC;IAC5C,IAAI,EAAE,0BAAiB;IACvB,IAAI,EAAE,mBAAmB;IACzB,WAAW,EAAE,qBAAqB;IAClC,WAAW,EAAE,sGAAsG;IACnH,KAAK,EAAE;QACL,IAAI,EAAE,2BAAQ,CAAC,SAAS,CAAC;YACvB,WAAW,EAAE,uBAAuB;YACpC,WAAW,EAAE,kFAAkF;YAC/F,QAAQ,EAAE,IAAI;SACf,CAAC;KACH;IACK,GAAG;qEAAC,EAAE,IAAI,EAAE,UAAU,EAAE;YAC5B,MAAM,+BAAe,CAAC,WAAW,CAAC,UAAU,EAAE,yBAAgB,CAAC,gBAAgB,CAAC,CAAC;YAEjF,MAAM,EAAE,IAAI,EAAE,GAAG,UAAU,CAAC;YAE5B,MAAM,OAAO,GAAG,MAAM,+BAAoB,CAAC,UAAU,CACnD,IAAI,CAAC,YAAY,EACjB,IAAI,CACL,CAAC;YAEF,OAAO,OAAO,CAAC;QACjB,CAAC;KAAA;CACF,CAAC,CAAC"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export declare const searchMessages: import("@activepieces/pieces-framework").IAction<import("@activepieces/pieces-framework").OAuth2Property<import("@activepieces/pieces-framework").OAuth2Props>, {
|
|
2
|
+
spaceId: import("@activepieces/pieces-framework").DropdownProperty<unknown, true> | import("@activepieces/pieces-framework").DropdownProperty<unknown, false>;
|
|
3
|
+
keyword: import("@activepieces/pieces-framework").ShortTextProperty<true>;
|
|
4
|
+
limit: import("@activepieces/pieces-framework").NumberProperty<false>;
|
|
5
|
+
}>;
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.searchMessages = 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 props_1 = require("../common/props");
|
|
9
|
+
const requests_1 = require("../common/requests");
|
|
10
|
+
exports.searchMessages = (0, pieces_framework_1.createAction)({
|
|
11
|
+
auth: common_1.googleChatApiAuth,
|
|
12
|
+
name: 'searchMessages',
|
|
13
|
+
displayName: 'Search Messages',
|
|
14
|
+
description: 'Search within Chat for messages matching keywords or filters.',
|
|
15
|
+
props: {
|
|
16
|
+
spaceId: (0, props_1.allSpacesDropdown)({ refreshers: ['auth'], required: true }),
|
|
17
|
+
keyword: pieces_framework_1.Property.ShortText({
|
|
18
|
+
displayName: 'Keyword',
|
|
19
|
+
description: 'Search for messages containing this text',
|
|
20
|
+
required: true,
|
|
21
|
+
}),
|
|
22
|
+
limit: pieces_framework_1.Property.Number({
|
|
23
|
+
displayName: 'Max Results',
|
|
24
|
+
description: 'Maximum number of messages to return',
|
|
25
|
+
required: false,
|
|
26
|
+
defaultValue: 50,
|
|
27
|
+
}),
|
|
28
|
+
},
|
|
29
|
+
run(_a) {
|
|
30
|
+
return tslib_1.__awaiter(this, arguments, void 0, function* ({ auth, propsValue }) {
|
|
31
|
+
yield pieces_common_1.propsValidation.validateZod(propsValue, common_1.googleChatCommon.searchMessagesSchema);
|
|
32
|
+
const { spaceId, keyword, limit } = propsValue;
|
|
33
|
+
const response = yield requests_1.googleChatAPIService.listMessages(auth.access_token, spaceId, limit);
|
|
34
|
+
const messages = response.messages || [];
|
|
35
|
+
const filtered = messages.filter((msg) => { var _a; return (_a = msg.text) === null || _a === void 0 ? void 0 : _a.toLowerCase().includes(keyword.toLowerCase()); });
|
|
36
|
+
return filtered;
|
|
37
|
+
});
|
|
38
|
+
},
|
|
39
|
+
});
|
|
40
|
+
//# sourceMappingURL=search-messages.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"search-messages.js","sourceRoot":"","sources":["../../../../../../../../packages/pieces/custom/google-chat-custom/src/lib/actions/search-messages.ts"],"names":[],"mappings":";;;;AAAA,qEAAwE;AACxE,+DAA8D;AAC9D,sCAAgE;AAChE,2CAAoD;AACpD,iDAA0D;AAE7C,QAAA,cAAc,GAAG,IAAA,+BAAY,EAAC;IACzC,IAAI,EAAE,0BAAiB;IACvB,IAAI,EAAE,gBAAgB;IACtB,WAAW,EAAE,iBAAiB;IAC9B,WAAW,EAAE,+DAA+D;IAC5E,KAAK,EAAE;QACL,OAAO,EAAE,IAAA,yBAAiB,EAAC,EAAE,UAAU,EAAE,CAAC,MAAM,CAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;QACpE,OAAO,EAAE,2BAAQ,CAAC,SAAS,CAAC;YAC1B,WAAW,EAAE,SAAS;YACtB,WAAW,EAAE,0CAA0C;YACvD,QAAQ,EAAE,IAAI;SACf,CAAC;QACF,KAAK,EAAE,2BAAQ,CAAC,MAAM,CAAC;YACrB,WAAW,EAAE,aAAa;YAC1B,WAAW,EAAE,sCAAsC;YACnD,QAAQ,EAAE,KAAK;YACf,YAAY,EAAE,EAAE;SACjB,CAAC;KACH;IACK,GAAG;qEAAC,EAAE,IAAI,EAAE,UAAU,EAAE;YAC5B,MAAM,+BAAe,CAAC,WAAW,CAAC,UAAU,EAAE,yBAAgB,CAAC,oBAAoB,CAAC,CAAC;YAErF,MAAM,EAAE,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,GAAG,UAAU,CAAC;YAE/C,MAAM,QAAQ,GAAG,MAAM,+BAAoB,CAAC,YAAY,CACtD,IAAI,CAAC,YAAY,EACjB,OAAiB,EACjB,KAAK,CACN,CAAC;YAEF,MAAM,QAAQ,GAAG,QAAQ,CAAC,QAAQ,IAAI,EAAE,CAAC;YAEzC,MAAM,QAAQ,GAAG,QAAQ,CAAC,MAAM,CAAC,CAAC,GAAQ,EAAE,EAAE,WAC5C,OAAA,MAAA,GAAG,CAAC,IAAI,0CAAE,WAAW,GAAG,QAAQ,CAAC,OAAO,CAAC,WAAW,EAAE,CAAC,CAAA,EAAA,CACxD,CAAC;YAEF,OAAO,QAAQ,CAAC;QAClB,CAAC;KAAA;CACF,CAAC,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export declare const sendAMessage: import("@activepieces/pieces-framework").IAction<import("@activepieces/pieces-framework").OAuth2Property<import("@activepieces/pieces-framework").OAuth2Props>, {
|
|
2
|
+
spaceId: import("@activepieces/pieces-framework").DropdownProperty<unknown, true> | import("@activepieces/pieces-framework").DropdownProperty<unknown, false>;
|
|
3
|
+
text: import("@activepieces/pieces-framework").LongTextProperty<true>;
|
|
4
|
+
thread: import("@activepieces/pieces-framework").DropdownProperty<any, false> | import("@activepieces/pieces-framework").DropdownProperty<any, true>;
|
|
5
|
+
customMessageId: import("@activepieces/pieces-framework").ShortTextProperty<false>;
|
|
6
|
+
isPrivate: import("@activepieces/pieces-framework").CheckboxProperty<false>;
|
|
7
|
+
privateMessageViewer: import("@activepieces/pieces-framework").DropdownProperty<any, false>;
|
|
8
|
+
}>;
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.sendAMessage = 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 props_1 = require("../common/props");
|
|
9
|
+
const requests_1 = require("../common/requests");
|
|
10
|
+
exports.sendAMessage = (0, pieces_framework_1.createAction)({
|
|
11
|
+
auth: common_1.googleChatApiAuth,
|
|
12
|
+
name: 'sendAMessage',
|
|
13
|
+
displayName: 'Send a Message',
|
|
14
|
+
description: 'Send a message to a space or direct conversation.',
|
|
15
|
+
props: {
|
|
16
|
+
spaceId: (0, props_1.allSpacesDropdown)({ refreshers: ['auth'], required: true }),
|
|
17
|
+
text: pieces_framework_1.Property.LongText({
|
|
18
|
+
displayName: 'Message',
|
|
19
|
+
description: 'The message content to send. Supports basic formatting like *bold*, _italic_, and @mentions.',
|
|
20
|
+
required: true,
|
|
21
|
+
}),
|
|
22
|
+
thread: (0, props_1.threadsDropdown)({ refreshers: ['auth', 'spaceId'], required: false }),
|
|
23
|
+
customMessageId: pieces_framework_1.Property.ShortText({
|
|
24
|
+
displayName: 'Custom Message ID',
|
|
25
|
+
description: 'Optional unique ID for this message (auto-generated if empty). Useful for deduplication.',
|
|
26
|
+
required: false,
|
|
27
|
+
}),
|
|
28
|
+
isPrivate: pieces_framework_1.Property.Checkbox({
|
|
29
|
+
displayName: 'Send as Private Message',
|
|
30
|
+
description: 'Send this message privately to a specific user. Requires app authentication.',
|
|
31
|
+
required: false,
|
|
32
|
+
}),
|
|
33
|
+
privateMessageViewer: pieces_framework_1.Property.Dropdown({
|
|
34
|
+
displayName: 'Private Message Recipient',
|
|
35
|
+
description: 'Select the user who can view this private message.',
|
|
36
|
+
required: false,
|
|
37
|
+
refreshers: ['auth', 'isPrivate'],
|
|
38
|
+
defaultValue: '',
|
|
39
|
+
options(_a) {
|
|
40
|
+
return tslib_1.__awaiter(this, arguments, void 0, function* ({ auth, isPrivate }) {
|
|
41
|
+
if (!isPrivate) {
|
|
42
|
+
return {
|
|
43
|
+
disabled: true,
|
|
44
|
+
placeholder: 'Enable "Send as Private Message" first',
|
|
45
|
+
options: [],
|
|
46
|
+
};
|
|
47
|
+
}
|
|
48
|
+
if (!auth) {
|
|
49
|
+
return {
|
|
50
|
+
disabled: true,
|
|
51
|
+
placeholder: 'Connect your Google account first',
|
|
52
|
+
options: [],
|
|
53
|
+
};
|
|
54
|
+
}
|
|
55
|
+
try {
|
|
56
|
+
const members = yield requests_1.googleChatAPIService.fetchPeople(auth.access_token);
|
|
57
|
+
return {
|
|
58
|
+
options: members
|
|
59
|
+
.map((member) => {
|
|
60
|
+
var _a, _b;
|
|
61
|
+
const nameObj = ((_a = member.names) === null || _a === void 0 ? void 0 : _a.find((n) => n.metadata.primary)) ||
|
|
62
|
+
((_b = member.names) === null || _b === void 0 ? void 0 : _b[0]);
|
|
63
|
+
if (!nameObj)
|
|
64
|
+
return null;
|
|
65
|
+
return {
|
|
66
|
+
label: nameObj.displayName,
|
|
67
|
+
value: member.resourceName,
|
|
68
|
+
};
|
|
69
|
+
})
|
|
70
|
+
.filter(Boolean),
|
|
71
|
+
};
|
|
72
|
+
}
|
|
73
|
+
catch (e) {
|
|
74
|
+
console.error('Failed to fetch people', e);
|
|
75
|
+
return {
|
|
76
|
+
options: [],
|
|
77
|
+
placeholder: 'Unable to load people',
|
|
78
|
+
};
|
|
79
|
+
}
|
|
80
|
+
});
|
|
81
|
+
},
|
|
82
|
+
}),
|
|
83
|
+
},
|
|
84
|
+
run(_a) {
|
|
85
|
+
return tslib_1.__awaiter(this, arguments, void 0, function* ({ auth, propsValue }) {
|
|
86
|
+
yield pieces_common_1.propsValidation.validateZod(propsValue, common_1.googleChatCommon.sendMessageSchema);
|
|
87
|
+
const { spaceId, text, thread, customMessageId, isPrivate, privateMessageViewer } = propsValue;
|
|
88
|
+
const response = yield requests_1.googleChatAPIService.sendMessage({
|
|
89
|
+
accessToken: auth.access_token,
|
|
90
|
+
spaceId: spaceId,
|
|
91
|
+
text,
|
|
92
|
+
thread,
|
|
93
|
+
// messageReplyOption removed - not used in custom piece
|
|
94
|
+
customMessageId,
|
|
95
|
+
isPrivate,
|
|
96
|
+
// Only include privateMessageViewer if isPrivate is true and a viewer is selected
|
|
97
|
+
privateMessageViewer: isPrivate && privateMessageViewer ? privateMessageViewer : undefined,
|
|
98
|
+
});
|
|
99
|
+
return response;
|
|
100
|
+
});
|
|
101
|
+
},
|
|
102
|
+
});
|
|
103
|
+
//# sourceMappingURL=send-a-message.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"send-a-message.js","sourceRoot":"","sources":["../../../../../../../../packages/pieces/custom/google-chat-custom/src/lib/actions/send-a-message.ts"],"names":[],"mappings":"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"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Google Chat OAuth2 authentication using environment variables.
|
|
3
|
+
* Uses the same client ID and secret as Google Drive (shared OAuth app).
|
|
4
|
+
*
|
|
5
|
+
* Environment Variables Required:
|
|
6
|
+
* - GOOGLE_DRIVE_CLIENT_ID (or GOOGLE_CLIENT_ID)
|
|
7
|
+
* - GOOGLE_DRIVE_CLIENT_SECRET (or GOOGLE_CLIENT_SECRET)
|
|
8
|
+
*/
|
|
9
|
+
export declare const googleChatApiAuth: import("@activepieces/pieces-framework").OAuth2Property<import("@activepieces/pieces-framework").OAuth2Props>;
|
|
10
|
+
export declare const GOOGLE_SERVICE_ENTITIES: {
|
|
11
|
+
chat: string;
|
|
12
|
+
cloudresourcemanager: string;
|
|
13
|
+
pubsub: string;
|
|
14
|
+
workspaceevents: string;
|
|
15
|
+
people: string;
|
|
16
|
+
};
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.GOOGLE_SERVICE_ENTITIES = exports.googleChatApiAuth = void 0;
|
|
4
|
+
const pieces_framework_1 = require("@activepieces/pieces-framework");
|
|
5
|
+
/**
|
|
6
|
+
* Google Chat OAuth2 authentication using environment variables.
|
|
7
|
+
* Uses the same client ID and secret as Google Drive (shared OAuth app).
|
|
8
|
+
*
|
|
9
|
+
* Environment Variables Required:
|
|
10
|
+
* - GOOGLE_DRIVE_CLIENT_ID (or GOOGLE_CLIENT_ID)
|
|
11
|
+
* - GOOGLE_DRIVE_CLIENT_SECRET (or GOOGLE_CLIENT_SECRET)
|
|
12
|
+
*/
|
|
13
|
+
exports.googleChatApiAuth = pieces_framework_1.PieceAuth.OAuth2({
|
|
14
|
+
authUrl: 'https://accounts.google.com/o/oauth2/auth',
|
|
15
|
+
tokenUrl: 'https://oauth2.googleapis.com/token',
|
|
16
|
+
required: true,
|
|
17
|
+
scope: [
|
|
18
|
+
'https://www.googleapis.com/auth/chat.messages',
|
|
19
|
+
'https://www.googleapis.com/auth/chat.spaces',
|
|
20
|
+
'https://www.googleapis.com/auth/chat.memberships',
|
|
21
|
+
'https://www.googleapis.com/auth/cloud-platform',
|
|
22
|
+
'https://www.googleapis.com/auth/directory.readonly',
|
|
23
|
+
],
|
|
24
|
+
// Shared Google OAuth credentials - same as Google Drive
|
|
25
|
+
clientId: process.env.GOOGLE_OAUTH_CLIENT_ID || process.env.GOOGLE_CHAT_CLIENT_ID || process.env.GOOGLE_DRIVE_CLIENT_ID || process.env.AP_GOOGLE_OAUTH_CLIENT_ID || '',
|
|
26
|
+
clientSecret: process.env.GOOGLE_OAUTH_CLIENT_SECRET || process.env.GOOGLE_CHAT_CLIENT_SECRET || process.env.GOOGLE_DRIVE_CLIENT_SECRET || process.env.AP_GOOGLE_OAUTH_CLIENT_SECRET || '',
|
|
27
|
+
});
|
|
28
|
+
exports.GOOGLE_SERVICE_ENTITIES = {
|
|
29
|
+
chat: 'chat',
|
|
30
|
+
cloudresourcemanager: 'cloudresourcemanager',
|
|
31
|
+
pubsub: 'pubsub',
|
|
32
|
+
workspaceevents: 'workspaceevents',
|
|
33
|
+
people: 'people',
|
|
34
|
+
};
|
|
35
|
+
//# sourceMappingURL=constants.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../../../../../../packages/pieces/custom/google-chat-custom/src/lib/common/constants.ts"],"names":[],"mappings":";;;AAAA,qEAA2D;AAE3D;;;;;;;GAOG;AACU,QAAA,iBAAiB,GAAG,4BAAS,CAAC,MAAM,CAAC;IAChD,OAAO,EAAE,2CAA2C;IACpD,QAAQ,EAAE,qCAAqC;IAC/C,QAAQ,EAAE,IAAI;IACd,KAAK,EAAE;QACL,+CAA+C;QAC/C,6CAA6C;QAC7C,kDAAkD;QAClD,gDAAgD;QAChD,oDAAoD;KACrD;IACD,yDAAyD;IACzD,QAAQ,EAAE,OAAO,CAAC,GAAG,CAAC,sBAAsB,IAAI,OAAO,CAAC,GAAG,CAAC,qBAAqB,IAAI,OAAO,CAAC,GAAG,CAAC,sBAAsB,IAAI,OAAO,CAAC,GAAG,CAAC,yBAAyB,IAAI,EAAE;IACtK,YAAY,EAAE,OAAO,CAAC,GAAG,CAAC,0BAA0B,IAAI,OAAO,CAAC,GAAG,CAAC,yBAAyB,IAAI,OAAO,CAAC,GAAG,CAAC,0BAA0B,IAAI,OAAO,CAAC,GAAG,CAAC,6BAA6B,IAAI,EAAE;CACpL,CAAC,CAAC;AAEG,QAAA,uBAAuB,GAAG;IACrC,IAAI,EAAE,MAAM;IACZ,oBAAoB,EAAE,sBAAsB;IAC5C,MAAM,EAAE,QAAQ;IAChB,eAAe,EAAE,iBAAiB;IAClC,MAAM,EAAE,QAAQ;CACjB,CAAC"}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
export * from './schemas';
|
|
2
|
+
export * from './constants';
|
|
3
|
+
export * from './props';
|
|
4
|
+
export * from './requests';
|
|
5
|
+
export declare const googleChatCommon: {
|
|
6
|
+
sendMessageSchema: {
|
|
7
|
+
spaceId: import("zod").ZodString;
|
|
8
|
+
text: import("zod").ZodString;
|
|
9
|
+
thread: import("zod").ZodOptional<import("zod").ZodString>;
|
|
10
|
+
customMessageId: import("zod").ZodOptional<import("zod").ZodString>;
|
|
11
|
+
isPrivate: import("zod").ZodOptional<import("zod").ZodBoolean>;
|
|
12
|
+
privateMessageViewer: import("zod").ZodPipe<import("zod").ZodNullable<import("zod").ZodOptional<import("zod").ZodString>>, import("zod").ZodTransform<string, string>>;
|
|
13
|
+
};
|
|
14
|
+
getMessageSchema: {
|
|
15
|
+
name: import("zod").ZodString;
|
|
16
|
+
};
|
|
17
|
+
addSpaceMemberSchema: {
|
|
18
|
+
spaceId: import("zod").ZodString;
|
|
19
|
+
personId: import("zod").ZodString;
|
|
20
|
+
};
|
|
21
|
+
findMemberSchema: {
|
|
22
|
+
spaceId: import("zod").ZodString;
|
|
23
|
+
email: import("zod").ZodString;
|
|
24
|
+
};
|
|
25
|
+
searchMessagesSchema: {
|
|
26
|
+
spaceId: import("zod").ZodString;
|
|
27
|
+
keyword: import("zod").ZodString;
|
|
28
|
+
limit: import("zod").ZodOptional<import("zod").ZodNumber>;
|
|
29
|
+
};
|
|
30
|
+
getDirectMessageDetailsSchema: {
|
|
31
|
+
directMessageId: import("zod").ZodString;
|
|
32
|
+
};
|
|
33
|
+
newMessageTriggerSchema: {
|
|
34
|
+
projectId: import("zod").ZodString;
|
|
35
|
+
spaceId: import("zod").ZodOptional<import("zod").ZodString>;
|
|
36
|
+
};
|
|
37
|
+
newMentionTriggerSchema: {
|
|
38
|
+
projectId: import("zod").ZodString;
|
|
39
|
+
spaceId: import("zod").ZodOptional<import("zod").ZodString>;
|
|
40
|
+
spaceMemberId: import("zod").ZodOptional<import("zod").ZodString>;
|
|
41
|
+
};
|
|
42
|
+
};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.googleChatCommon = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
tslib_1.__exportStar(require("./schemas"), exports);
|
|
6
|
+
tslib_1.__exportStar(require("./constants"), exports);
|
|
7
|
+
tslib_1.__exportStar(require("./props"), exports);
|
|
8
|
+
tslib_1.__exportStar(require("./requests"), exports);
|
|
9
|
+
const schemas = tslib_1.__importStar(require("./schemas"));
|
|
10
|
+
exports.googleChatCommon = {
|
|
11
|
+
sendMessageSchema: schemas.sendMessageSchema,
|
|
12
|
+
getMessageSchema: schemas.getMessageSchema,
|
|
13
|
+
addSpaceMemberSchema: schemas.addSpaceMemberSchema,
|
|
14
|
+
findMemberSchema: schemas.findMemberSchema,
|
|
15
|
+
searchMessagesSchema: schemas.searchMessagesSchema,
|
|
16
|
+
getDirectMessageDetailsSchema: schemas.getDirectMessageDetailsSchema,
|
|
17
|
+
newMessageTriggerSchema: schemas.newMessageTriggerSchema,
|
|
18
|
+
newMentionTriggerSchema: schemas.newMentionTriggerSchema,
|
|
19
|
+
};
|
|
20
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../../../packages/pieces/custom/google-chat-custom/src/lib/common/index.ts"],"names":[],"mappings":";;;;AAAA,oDAA0B;AAC1B,sDAA4B;AAC5B,kDAAwB;AACxB,qDAA2B;AAE3B,2DAAqC;AAExB,QAAA,gBAAgB,GAAG;IAC9B,iBAAiB,EAAE,OAAO,CAAC,iBAAiB;IAC5C,gBAAgB,EAAE,OAAO,CAAC,gBAAgB;IAC1C,oBAAoB,EAAE,OAAO,CAAC,oBAAoB;IAClD,gBAAgB,EAAE,OAAO,CAAC,gBAAgB;IAC1C,oBAAoB,EAAE,OAAO,CAAC,oBAAoB;IAClD,6BAA6B,EAAE,OAAO,CAAC,6BAA6B;IACpE,uBAAuB,EAAE,OAAO,CAAC,uBAAuB;IACxD,uBAAuB,EAAE,OAAO,CAAC,uBAAuB;CACzD,CAAC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
export declare const projectsDropdown: (refreshers: string[]) => import("@activepieces/pieces-framework").DropdownProperty<unknown, true>;
|
|
2
|
+
export declare const spacesDropdown: ({ refreshers, required, }: {
|
|
3
|
+
refreshers: string[];
|
|
4
|
+
required?: boolean;
|
|
5
|
+
}) => import("@activepieces/pieces-framework").DropdownProperty<unknown, true> | import("@activepieces/pieces-framework").DropdownProperty<unknown, false>;
|
|
6
|
+
export declare const allSpacesDropdown: ({ refreshers, required, }: {
|
|
7
|
+
refreshers: string[];
|
|
8
|
+
required?: boolean;
|
|
9
|
+
}) => import("@activepieces/pieces-framework").DropdownProperty<unknown, true> | import("@activepieces/pieces-framework").DropdownProperty<unknown, false>;
|
|
10
|
+
export declare const directMessagesDropdown: ({ refreshers, required, }: {
|
|
11
|
+
refreshers: string[];
|
|
12
|
+
required?: boolean;
|
|
13
|
+
}) => import("@activepieces/pieces-framework").DropdownProperty<unknown, true> | import("@activepieces/pieces-framework").DropdownProperty<unknown, false>;
|
|
14
|
+
export declare const spacesMembersDropdown: (refreshers: string[]) => import("@activepieces/pieces-framework").DropdownProperty<unknown, false>;
|
|
15
|
+
export declare const peoplesDropdown: (refreshers: string[]) => import("@activepieces/pieces-framework").DropdownProperty<unknown, true>;
|
|
16
|
+
export declare const threadsDropdown: ({ refreshers, required, }: {
|
|
17
|
+
refreshers: string[];
|
|
18
|
+
required?: boolean;
|
|
19
|
+
}) => import("@activepieces/pieces-framework").DropdownProperty<any, false> | import("@activepieces/pieces-framework").DropdownProperty<any, true>;
|