chore: import upstream snapshot with attribution
CI / Migrate Dev DB (push) Has been skipped
CI / Detect Version (push) Has been cancelled
CI / Migrate DB (push) Has been cancelled
CI / Build Dev ECR (./docker/app.Dockerfile, ECR_APP) (push) Has been cancelled
CI / Build Dev ECR (./docker/db.Dockerfile, ECR_MIGRATIONS) (push) Has been cancelled
CI / Build Dev ECR (./docker/pii.Dockerfile, ECR_PII) (push) Has been cancelled
CI / Build Dev ECR (./docker/realtime.Dockerfile, ECR_REALTIME) (push) Has been cancelled
CI / Deploy Trigger.dev (Dev) (push) Has been cancelled
CI / Build AMD64 (./docker/app.Dockerfile, ECR_APP, ghcr.io/simstudioai/simstudio) (push) Has been cancelled
CI / Build AMD64 (./docker/db.Dockerfile, ECR_MIGRATIONS, ghcr.io/simstudioai/migrations) (push) Has been cancelled
CI / Build AMD64 (./docker/pii.Dockerfile, ECR_PII, ghcr.io/simstudioai/pii) (push) Has been cancelled
CI / Build AMD64 (./docker/realtime.Dockerfile, ECR_REALTIME, ghcr.io/simstudioai/realtime) (push) Has been cancelled
CI / Build ARM64 (GHCR Only) (./docker/app.Dockerfile, ghcr.io/simstudioai/simstudio) (push) Has been cancelled
CI / Build ARM64 (GHCR Only) (./docker/db.Dockerfile, ghcr.io/simstudioai/migrations) (push) Has been cancelled
CI / Build ARM64 (GHCR Only) (./docker/pii.Dockerfile, ghcr.io/simstudioai/pii) (push) Has been cancelled
CI / Build ARM64 (GHCR Only) (./docker/realtime.Dockerfile, ghcr.io/simstudioai/realtime) (push) Has been cancelled
CI / Create GHCR Manifests (ghcr.io/simstudioai/migrations) (push) Has been cancelled
CI / Create GHCR Manifests (ghcr.io/simstudioai/pii) (push) Has been cancelled
CI / Create GHCR Manifests (ghcr.io/simstudioai/realtime) (push) Has been cancelled
CI / Create GHCR Manifests (ghcr.io/simstudioai/simstudio) (push) Has been cancelled
CI / Check Docs Changes (push) Has been cancelled
CI / Process Docs (push) Has been cancelled
CI / Create GitHub Release (push) Has been cancelled
CI / Test and Build (push) Has been cancelled
Publish CLI Package / publish-npm (push) Has been cancelled
Publish Python SDK / publish-pypi (push) Has been cancelled
Publish TypeScript SDK / publish-npm (push) Has been cancelled
CI / Migrate Dev DB (push) Has been skipped
CI / Detect Version (push) Has been cancelled
CI / Migrate DB (push) Has been cancelled
CI / Build Dev ECR (./docker/app.Dockerfile, ECR_APP) (push) Has been cancelled
CI / Build Dev ECR (./docker/db.Dockerfile, ECR_MIGRATIONS) (push) Has been cancelled
CI / Build Dev ECR (./docker/pii.Dockerfile, ECR_PII) (push) Has been cancelled
CI / Build Dev ECR (./docker/realtime.Dockerfile, ECR_REALTIME) (push) Has been cancelled
CI / Deploy Trigger.dev (Dev) (push) Has been cancelled
CI / Build AMD64 (./docker/app.Dockerfile, ECR_APP, ghcr.io/simstudioai/simstudio) (push) Has been cancelled
CI / Build AMD64 (./docker/db.Dockerfile, ECR_MIGRATIONS, ghcr.io/simstudioai/migrations) (push) Has been cancelled
CI / Build AMD64 (./docker/pii.Dockerfile, ECR_PII, ghcr.io/simstudioai/pii) (push) Has been cancelled
CI / Build AMD64 (./docker/realtime.Dockerfile, ECR_REALTIME, ghcr.io/simstudioai/realtime) (push) Has been cancelled
CI / Build ARM64 (GHCR Only) (./docker/app.Dockerfile, ghcr.io/simstudioai/simstudio) (push) Has been cancelled
CI / Build ARM64 (GHCR Only) (./docker/db.Dockerfile, ghcr.io/simstudioai/migrations) (push) Has been cancelled
CI / Build ARM64 (GHCR Only) (./docker/pii.Dockerfile, ghcr.io/simstudioai/pii) (push) Has been cancelled
CI / Build ARM64 (GHCR Only) (./docker/realtime.Dockerfile, ghcr.io/simstudioai/realtime) (push) Has been cancelled
CI / Create GHCR Manifests (ghcr.io/simstudioai/migrations) (push) Has been cancelled
CI / Create GHCR Manifests (ghcr.io/simstudioai/pii) (push) Has been cancelled
CI / Create GHCR Manifests (ghcr.io/simstudioai/realtime) (push) Has been cancelled
CI / Create GHCR Manifests (ghcr.io/simstudioai/simstudio) (push) Has been cancelled
CI / Check Docs Changes (push) Has been cancelled
CI / Process Docs (push) Has been cancelled
CI / Create GitHub Release (push) Has been cancelled
CI / Test and Build (push) Has been cancelled
Publish CLI Package / publish-npm (push) Has been cancelled
Publish Python SDK / publish-pypi (push) Has been cancelled
Publish TypeScript SDK / publish-npm (push) Has been cancelled
This commit is contained in:
@@ -0,0 +1,80 @@
|
||||
import type {
|
||||
GoogleGroupsAddAliasParams,
|
||||
GoogleGroupsAddAliasResponse,
|
||||
} from '@/tools/google_groups/types'
|
||||
import type { ToolConfig } from '@/tools/types'
|
||||
|
||||
export const addAliasTool: ToolConfig<GoogleGroupsAddAliasParams, GoogleGroupsAddAliasResponse> = {
|
||||
id: 'google_groups_add_alias',
|
||||
name: 'Google Groups Add Alias',
|
||||
description: 'Add an email alias to a Google Group',
|
||||
version: '1.0.0',
|
||||
|
||||
oauth: {
|
||||
required: true,
|
||||
provider: 'google-groups',
|
||||
},
|
||||
|
||||
params: {
|
||||
accessToken: {
|
||||
type: 'string',
|
||||
required: true,
|
||||
visibility: 'hidden',
|
||||
description: 'OAuth access token',
|
||||
},
|
||||
groupKey: {
|
||||
type: 'string',
|
||||
required: true,
|
||||
visibility: 'user-or-llm',
|
||||
description:
|
||||
'Group identifier. Can be the group email address (e.g., team@example.com) or the unique group ID',
|
||||
},
|
||||
alias: {
|
||||
type: 'string',
|
||||
required: true,
|
||||
visibility: 'user-or-llm',
|
||||
description: 'The email alias to add to the group',
|
||||
},
|
||||
},
|
||||
|
||||
request: {
|
||||
url: (params) => {
|
||||
const encodedGroupKey = encodeURIComponent(params.groupKey.trim())
|
||||
return `https://admin.googleapis.com/admin/directory/v1/groups/${encodedGroupKey}/aliases`
|
||||
},
|
||||
method: 'POST',
|
||||
headers: (params) => ({
|
||||
Authorization: `Bearer ${params.accessToken}`,
|
||||
'Content-Type': 'application/json',
|
||||
}),
|
||||
body: (params) =>
|
||||
JSON.stringify({
|
||||
alias: params.alias.trim(),
|
||||
}),
|
||||
},
|
||||
|
||||
transformResponse: async (response) => {
|
||||
const data = await response.json()
|
||||
if (!response.ok) {
|
||||
throw new Error(data.error?.message || 'Failed to add group alias')
|
||||
}
|
||||
return {
|
||||
success: true,
|
||||
output: {
|
||||
id: data.id ?? null,
|
||||
primaryEmail: data.primaryEmail ?? null,
|
||||
alias: data.alias ?? null,
|
||||
kind: data.kind ?? null,
|
||||
etag: data.etag ?? null,
|
||||
},
|
||||
}
|
||||
},
|
||||
|
||||
outputs: {
|
||||
id: { type: 'string', description: 'Unique group identifier' },
|
||||
primaryEmail: { type: 'string', description: "Group's primary email address" },
|
||||
alias: { type: 'string', description: 'The alias that was added' },
|
||||
kind: { type: 'string', description: 'API resource type' },
|
||||
etag: { type: 'string', description: 'Resource version identifier' },
|
||||
},
|
||||
}
|
||||
@@ -0,0 +1,77 @@
|
||||
import type { GoogleGroupsAddMemberParams, GoogleGroupsResponse } from '@/tools/google_groups/types'
|
||||
import type { ToolConfig } from '@/tools/types'
|
||||
|
||||
export const addMemberTool: ToolConfig<GoogleGroupsAddMemberParams, GoogleGroupsResponse> = {
|
||||
id: 'google_groups_add_member',
|
||||
name: 'Google Groups Add Member',
|
||||
description: 'Add a new member to a Google Group',
|
||||
version: '1.0.0',
|
||||
|
||||
oauth: {
|
||||
required: true,
|
||||
provider: 'google-groups',
|
||||
},
|
||||
|
||||
params: {
|
||||
accessToken: {
|
||||
type: 'string',
|
||||
required: true,
|
||||
visibility: 'hidden',
|
||||
description: 'OAuth access token',
|
||||
},
|
||||
groupKey: {
|
||||
type: 'string',
|
||||
required: true,
|
||||
visibility: 'user-or-llm',
|
||||
description:
|
||||
'Group identifier. Can be the group email address (e.g., team@example.com) or the unique group ID',
|
||||
},
|
||||
email: {
|
||||
type: 'string',
|
||||
required: true,
|
||||
visibility: 'user-or-llm',
|
||||
description: 'Email address of the member to add (e.g., user@example.com)',
|
||||
},
|
||||
role: {
|
||||
type: 'string',
|
||||
required: false,
|
||||
visibility: 'user-or-llm',
|
||||
description: 'Role for the member: MEMBER, MANAGER, or OWNER. Defaults to MEMBER',
|
||||
},
|
||||
},
|
||||
|
||||
request: {
|
||||
url: (params) => {
|
||||
const encodedGroupKey = encodeURIComponent(params.groupKey)
|
||||
return `https://admin.googleapis.com/admin/directory/v1/groups/${encodedGroupKey}/members`
|
||||
},
|
||||
method: 'POST',
|
||||
headers: (params) => ({
|
||||
Authorization: `Bearer ${params.accessToken}`,
|
||||
'Content-Type': 'application/json',
|
||||
}),
|
||||
body: (params) => {
|
||||
const body: Record<string, string> = {
|
||||
email: params.email,
|
||||
role: params.role || 'MEMBER',
|
||||
}
|
||||
|
||||
return JSON.stringify(body)
|
||||
},
|
||||
},
|
||||
|
||||
transformResponse: async (response) => {
|
||||
const data = await response.json()
|
||||
if (!response.ok) {
|
||||
throw new Error(data.error?.message || 'Failed to add member to group')
|
||||
}
|
||||
return {
|
||||
success: true,
|
||||
output: { member: data },
|
||||
}
|
||||
},
|
||||
|
||||
outputs: {
|
||||
member: { type: 'json', description: 'Added member object' },
|
||||
},
|
||||
}
|
||||
@@ -0,0 +1,77 @@
|
||||
import type { GoogleGroupsCreateParams, GoogleGroupsResponse } from '@/tools/google_groups/types'
|
||||
import type { ToolConfig } from '@/tools/types'
|
||||
|
||||
export const createGroupTool: ToolConfig<GoogleGroupsCreateParams, GoogleGroupsResponse> = {
|
||||
id: 'google_groups_create_group',
|
||||
name: 'Google Groups Create Group',
|
||||
description: 'Create a new Google Group in the domain',
|
||||
version: '1.0.0',
|
||||
|
||||
oauth: {
|
||||
required: true,
|
||||
provider: 'google-groups',
|
||||
},
|
||||
|
||||
params: {
|
||||
accessToken: {
|
||||
type: 'string',
|
||||
required: true,
|
||||
visibility: 'hidden',
|
||||
description: 'OAuth access token',
|
||||
},
|
||||
email: {
|
||||
type: 'string',
|
||||
required: true,
|
||||
visibility: 'user-or-llm',
|
||||
description: 'Email address for the new group (e.g., team@example.com)',
|
||||
},
|
||||
name: {
|
||||
type: 'string',
|
||||
required: true,
|
||||
visibility: 'user-or-llm',
|
||||
description: 'Display name for the group (e.g., Engineering Team)',
|
||||
},
|
||||
description: {
|
||||
type: 'string',
|
||||
required: false,
|
||||
visibility: 'user-or-llm',
|
||||
description: 'Description of the group',
|
||||
},
|
||||
},
|
||||
|
||||
request: {
|
||||
url: () => 'https://admin.googleapis.com/admin/directory/v1/groups',
|
||||
method: 'POST',
|
||||
headers: (params) => ({
|
||||
Authorization: `Bearer ${params.accessToken}`,
|
||||
'Content-Type': 'application/json',
|
||||
}),
|
||||
body: (params) => {
|
||||
const body: Record<string, string> = {
|
||||
email: params.email,
|
||||
name: params.name,
|
||||
}
|
||||
|
||||
if (params.description) {
|
||||
body.description = params.description
|
||||
}
|
||||
|
||||
return JSON.stringify(body)
|
||||
},
|
||||
},
|
||||
|
||||
transformResponse: async (response) => {
|
||||
const data = await response.json()
|
||||
if (!response.ok) {
|
||||
throw new Error(data.error?.message || 'Failed to create group')
|
||||
}
|
||||
return {
|
||||
success: true,
|
||||
output: { group: data },
|
||||
}
|
||||
},
|
||||
|
||||
outputs: {
|
||||
group: { type: 'json', description: 'Created group object' },
|
||||
},
|
||||
}
|
||||
@@ -0,0 +1,57 @@
|
||||
import type { GoogleGroupsDeleteParams, GoogleGroupsResponse } from '@/tools/google_groups/types'
|
||||
import type { ToolConfig } from '@/tools/types'
|
||||
|
||||
export const deleteGroupTool: ToolConfig<GoogleGroupsDeleteParams, GoogleGroupsResponse> = {
|
||||
id: 'google_groups_delete_group',
|
||||
name: 'Google Groups Delete Group',
|
||||
description: 'Delete a Google Group',
|
||||
version: '1.0.0',
|
||||
|
||||
oauth: {
|
||||
required: true,
|
||||
provider: 'google-groups',
|
||||
},
|
||||
|
||||
params: {
|
||||
accessToken: {
|
||||
type: 'string',
|
||||
required: true,
|
||||
visibility: 'hidden',
|
||||
description: 'OAuth access token',
|
||||
},
|
||||
groupKey: {
|
||||
type: 'string',
|
||||
required: true,
|
||||
visibility: 'user-or-llm',
|
||||
description:
|
||||
'Group identifier to delete. Can be the group email address (e.g., team@example.com) or the unique group ID',
|
||||
},
|
||||
},
|
||||
|
||||
request: {
|
||||
url: (params) => {
|
||||
const encodedGroupKey = encodeURIComponent(params.groupKey)
|
||||
return `https://admin.googleapis.com/admin/directory/v1/groups/${encodedGroupKey}`
|
||||
},
|
||||
method: 'DELETE',
|
||||
headers: (params) => ({
|
||||
Authorization: `Bearer ${params.accessToken}`,
|
||||
'Content-Type': 'application/json',
|
||||
}),
|
||||
},
|
||||
|
||||
transformResponse: async (response) => {
|
||||
if (!response.ok) {
|
||||
const data = await response.json()
|
||||
throw new Error(data.error?.message || 'Failed to delete group')
|
||||
}
|
||||
return {
|
||||
success: true,
|
||||
output: { message: 'Group deleted successfully' },
|
||||
}
|
||||
},
|
||||
|
||||
outputs: {
|
||||
message: { type: 'string', description: 'Success message' },
|
||||
},
|
||||
}
|
||||
@@ -0,0 +1,57 @@
|
||||
import type { GoogleGroupsGetParams, GoogleGroupsResponse } from '@/tools/google_groups/types'
|
||||
import type { ToolConfig } from '@/tools/types'
|
||||
|
||||
export const getGroupTool: ToolConfig<GoogleGroupsGetParams, GoogleGroupsResponse> = {
|
||||
id: 'google_groups_get_group',
|
||||
name: 'Google Groups Get Group',
|
||||
description: 'Get details of a specific Google Group by email or group ID',
|
||||
version: '1.0.0',
|
||||
|
||||
oauth: {
|
||||
required: true,
|
||||
provider: 'google-groups',
|
||||
},
|
||||
|
||||
params: {
|
||||
accessToken: {
|
||||
type: 'string',
|
||||
required: true,
|
||||
visibility: 'hidden',
|
||||
description: 'OAuth access token',
|
||||
},
|
||||
groupKey: {
|
||||
type: 'string',
|
||||
required: true,
|
||||
visibility: 'user-or-llm',
|
||||
description:
|
||||
'Group identifier. Can be the group email address (e.g., team@example.com) or the unique group ID',
|
||||
},
|
||||
},
|
||||
|
||||
request: {
|
||||
url: (params) => {
|
||||
const encodedGroupKey = encodeURIComponent(params.groupKey)
|
||||
return `https://admin.googleapis.com/admin/directory/v1/groups/${encodedGroupKey}`
|
||||
},
|
||||
method: 'GET',
|
||||
headers: (params) => ({
|
||||
Authorization: `Bearer ${params.accessToken}`,
|
||||
'Content-Type': 'application/json',
|
||||
}),
|
||||
},
|
||||
|
||||
transformResponse: async (response) => {
|
||||
const data = await response.json()
|
||||
if (!response.ok) {
|
||||
throw new Error(data.error?.message || 'Failed to get group')
|
||||
}
|
||||
return {
|
||||
success: true,
|
||||
output: { group: data },
|
||||
}
|
||||
},
|
||||
|
||||
outputs: {
|
||||
group: { type: 'json', description: 'Group object' },
|
||||
},
|
||||
}
|
||||
@@ -0,0 +1,65 @@
|
||||
import type { GoogleGroupsGetMemberParams, GoogleGroupsResponse } from '@/tools/google_groups/types'
|
||||
import type { ToolConfig } from '@/tools/types'
|
||||
|
||||
export const getMemberTool: ToolConfig<GoogleGroupsGetMemberParams, GoogleGroupsResponse> = {
|
||||
id: 'google_groups_get_member',
|
||||
name: 'Google Groups Get Member',
|
||||
description: 'Get details of a specific member in a Google Group',
|
||||
version: '1.0.0',
|
||||
|
||||
oauth: {
|
||||
required: true,
|
||||
provider: 'google-groups',
|
||||
},
|
||||
|
||||
params: {
|
||||
accessToken: {
|
||||
type: 'string',
|
||||
required: true,
|
||||
visibility: 'hidden',
|
||||
description: 'OAuth access token',
|
||||
},
|
||||
groupKey: {
|
||||
type: 'string',
|
||||
required: true,
|
||||
visibility: 'user-or-llm',
|
||||
description:
|
||||
'Group identifier. Can be the group email address (e.g., team@example.com) or the unique group ID',
|
||||
},
|
||||
memberKey: {
|
||||
type: 'string',
|
||||
required: true,
|
||||
visibility: 'user-or-llm',
|
||||
description:
|
||||
'Member identifier. Can be the member email address (e.g., user@example.com) or the unique member ID',
|
||||
},
|
||||
},
|
||||
|
||||
request: {
|
||||
url: (params) => {
|
||||
const encodedGroupKey = encodeURIComponent(params.groupKey)
|
||||
const encodedMemberKey = encodeURIComponent(params.memberKey)
|
||||
return `https://admin.googleapis.com/admin/directory/v1/groups/${encodedGroupKey}/members/${encodedMemberKey}`
|
||||
},
|
||||
method: 'GET',
|
||||
headers: (params) => ({
|
||||
Authorization: `Bearer ${params.accessToken}`,
|
||||
'Content-Type': 'application/json',
|
||||
}),
|
||||
},
|
||||
|
||||
transformResponse: async (response) => {
|
||||
const data = await response.json()
|
||||
if (!response.ok) {
|
||||
throw new Error(data.error?.message || 'Failed to get group member')
|
||||
}
|
||||
return {
|
||||
success: true,
|
||||
output: { member: data },
|
||||
}
|
||||
},
|
||||
|
||||
outputs: {
|
||||
member: { type: 'json', description: 'Member object' },
|
||||
},
|
||||
}
|
||||
@@ -0,0 +1,154 @@
|
||||
import type {
|
||||
GoogleGroupsGetSettingsParams,
|
||||
GoogleGroupsGetSettingsResponse,
|
||||
} from '@/tools/google_groups/types'
|
||||
import type { ToolConfig } from '@/tools/types'
|
||||
|
||||
export const getSettingsTool: ToolConfig<
|
||||
GoogleGroupsGetSettingsParams,
|
||||
GoogleGroupsGetSettingsResponse
|
||||
> = {
|
||||
id: 'google_groups_get_settings',
|
||||
name: 'Google Groups Get Settings',
|
||||
description:
|
||||
'Get the settings for a Google Group including access permissions, moderation, and posting options',
|
||||
version: '1.0.0',
|
||||
|
||||
oauth: {
|
||||
required: true,
|
||||
provider: 'google-groups',
|
||||
},
|
||||
|
||||
params: {
|
||||
accessToken: {
|
||||
type: 'string',
|
||||
required: true,
|
||||
visibility: 'hidden',
|
||||
description: 'OAuth access token',
|
||||
},
|
||||
groupEmail: {
|
||||
type: 'string',
|
||||
required: true,
|
||||
visibility: 'user-or-llm',
|
||||
description: 'The email address of the group (e.g., team@example.com)',
|
||||
},
|
||||
},
|
||||
|
||||
request: {
|
||||
url: (params) => {
|
||||
const encodedEmail = encodeURIComponent(params.groupEmail.trim())
|
||||
return `https://www.googleapis.com/groups/v1/groups/${encodedEmail}`
|
||||
},
|
||||
method: 'GET',
|
||||
headers: (params) => ({
|
||||
Authorization: `Bearer ${params.accessToken}`,
|
||||
'Content-Type': 'application/json',
|
||||
}),
|
||||
},
|
||||
|
||||
transformResponse: async (response) => {
|
||||
const data = await response.json()
|
||||
if (!response.ok) {
|
||||
throw new Error(data.error?.message || 'Failed to get group settings')
|
||||
}
|
||||
return {
|
||||
success: true,
|
||||
output: {
|
||||
email: data.email ?? null,
|
||||
name: data.name ?? null,
|
||||
description: data.description ?? null,
|
||||
whoCanJoin: data.whoCanJoin ?? null,
|
||||
whoCanViewMembership: data.whoCanViewMembership ?? null,
|
||||
whoCanViewGroup: data.whoCanViewGroup ?? null,
|
||||
whoCanPostMessage: data.whoCanPostMessage ?? null,
|
||||
allowExternalMembers: data.allowExternalMembers ?? null,
|
||||
allowWebPosting: data.allowWebPosting ?? null,
|
||||
primaryLanguage: data.primaryLanguage ?? null,
|
||||
isArchived: data.isArchived ?? null,
|
||||
archiveOnly: data.archiveOnly ?? null,
|
||||
messageModerationLevel: data.messageModerationLevel ?? null,
|
||||
spamModerationLevel: data.spamModerationLevel ?? null,
|
||||
replyTo: data.replyTo ?? null,
|
||||
customReplyTo: data.customReplyTo ?? null,
|
||||
includeCustomFooter: data.includeCustomFooter ?? null,
|
||||
customFooterText: data.customFooterText ?? null,
|
||||
sendMessageDenyNotification: data.sendMessageDenyNotification ?? null,
|
||||
defaultMessageDenyNotificationText: data.defaultMessageDenyNotificationText ?? null,
|
||||
membersCanPostAsTheGroup: data.membersCanPostAsTheGroup ?? null,
|
||||
includeInGlobalAddressList: data.includeInGlobalAddressList ?? null,
|
||||
whoCanLeaveGroup: data.whoCanLeaveGroup ?? null,
|
||||
whoCanContactOwner: data.whoCanContactOwner ?? null,
|
||||
favoriteRepliesOnTop: data.favoriteRepliesOnTop ?? null,
|
||||
whoCanApproveMembers: data.whoCanApproveMembers ?? null,
|
||||
whoCanBanUsers: data.whoCanBanUsers ?? null,
|
||||
whoCanModerateMembers: data.whoCanModerateMembers ?? null,
|
||||
whoCanModerateContent: data.whoCanModerateContent ?? null,
|
||||
whoCanAssistContent: data.whoCanAssistContent ?? null,
|
||||
enableCollaborativeInbox: data.enableCollaborativeInbox ?? null,
|
||||
whoCanDiscoverGroup: data.whoCanDiscoverGroup ?? null,
|
||||
defaultSender: data.defaultSender ?? null,
|
||||
},
|
||||
}
|
||||
},
|
||||
|
||||
outputs: {
|
||||
email: { type: 'string', description: "The group's email address" },
|
||||
name: { type: 'string', description: 'The group name (max 75 characters)' },
|
||||
description: { type: 'string', description: 'The group description (max 4096 characters)' },
|
||||
whoCanJoin: {
|
||||
type: 'string',
|
||||
description:
|
||||
'Who can join the group (ANYONE_CAN_JOIN, ALL_IN_DOMAIN_CAN_JOIN, INVITED_CAN_JOIN, CAN_REQUEST_TO_JOIN)',
|
||||
},
|
||||
whoCanViewMembership: { type: 'string', description: 'Who can view group membership' },
|
||||
whoCanViewGroup: { type: 'string', description: 'Who can view group messages' },
|
||||
whoCanPostMessage: { type: 'string', description: 'Who can post messages to the group' },
|
||||
allowExternalMembers: { type: 'string', description: 'Whether external users can be members' },
|
||||
allowWebPosting: { type: 'string', description: 'Whether web posting is allowed' },
|
||||
primaryLanguage: { type: 'string', description: "The group's primary language" },
|
||||
isArchived: { type: 'string', description: 'Whether messages are archived' },
|
||||
archiveOnly: { type: 'string', description: 'Whether the group is archive-only (inactive)' },
|
||||
messageModerationLevel: { type: 'string', description: 'Message moderation level' },
|
||||
spamModerationLevel: {
|
||||
type: 'string',
|
||||
description: 'Spam handling level (ALLOW, MODERATE, SILENTLY_MODERATE, REJECT)',
|
||||
},
|
||||
replyTo: { type: 'string', description: 'Default reply destination' },
|
||||
customReplyTo: { type: 'string', description: 'Custom email for replies' },
|
||||
includeCustomFooter: { type: 'string', description: 'Whether to include custom footer' },
|
||||
customFooterText: { type: 'string', description: 'Custom footer text (max 1000 characters)' },
|
||||
sendMessageDenyNotification: {
|
||||
type: 'string',
|
||||
description: 'Whether to send rejection notifications',
|
||||
},
|
||||
defaultMessageDenyNotificationText: {
|
||||
type: 'string',
|
||||
description: 'Default rejection message text',
|
||||
},
|
||||
membersCanPostAsTheGroup: {
|
||||
type: 'string',
|
||||
description: 'Whether members can post as the group',
|
||||
},
|
||||
includeInGlobalAddressList: {
|
||||
type: 'string',
|
||||
description: 'Whether included in Global Address List',
|
||||
},
|
||||
whoCanLeaveGroup: { type: 'string', description: 'Who can leave the group' },
|
||||
whoCanContactOwner: { type: 'string', description: 'Who can contact the group owner' },
|
||||
favoriteRepliesOnTop: { type: 'string', description: 'Whether favorite replies appear at top' },
|
||||
whoCanApproveMembers: { type: 'string', description: 'Who can approve new members' },
|
||||
whoCanBanUsers: { type: 'string', description: 'Who can ban users' },
|
||||
whoCanModerateMembers: { type: 'string', description: 'Who can manage members' },
|
||||
whoCanModerateContent: { type: 'string', description: 'Who can moderate content' },
|
||||
whoCanAssistContent: { type: 'string', description: 'Who can assist with content metadata' },
|
||||
enableCollaborativeInbox: {
|
||||
type: 'string',
|
||||
description: 'Whether collaborative inbox is enabled',
|
||||
},
|
||||
whoCanDiscoverGroup: { type: 'string', description: 'Who can discover the group' },
|
||||
defaultSender: {
|
||||
type: 'string',
|
||||
description: 'Default sender identity (DEFAULT_SELF or GROUP)',
|
||||
},
|
||||
},
|
||||
}
|
||||
@@ -0,0 +1,65 @@
|
||||
import type { GoogleGroupsHasMemberParams, GoogleGroupsResponse } from '@/tools/google_groups/types'
|
||||
import type { ToolConfig } from '@/tools/types'
|
||||
|
||||
export const hasMemberTool: ToolConfig<GoogleGroupsHasMemberParams, GoogleGroupsResponse> = {
|
||||
id: 'google_groups_has_member',
|
||||
name: 'Google Groups Has Member',
|
||||
description: 'Check if a user is a member of a Google Group',
|
||||
version: '1.0.0',
|
||||
|
||||
oauth: {
|
||||
required: true,
|
||||
provider: 'google-groups',
|
||||
},
|
||||
|
||||
params: {
|
||||
accessToken: {
|
||||
type: 'string',
|
||||
required: true,
|
||||
visibility: 'hidden',
|
||||
description: 'OAuth access token',
|
||||
},
|
||||
groupKey: {
|
||||
type: 'string',
|
||||
required: true,
|
||||
visibility: 'user-or-llm',
|
||||
description:
|
||||
'Group identifier. Can be the group email address (e.g., team@example.com) or the unique group ID',
|
||||
},
|
||||
memberKey: {
|
||||
type: 'string',
|
||||
required: true,
|
||||
visibility: 'user-or-llm',
|
||||
description:
|
||||
'Member identifier to check. Can be the member email address (e.g., user@example.com) or the unique member ID',
|
||||
},
|
||||
},
|
||||
|
||||
request: {
|
||||
url: (params) => {
|
||||
const encodedGroupKey = encodeURIComponent(params.groupKey)
|
||||
const encodedMemberKey = encodeURIComponent(params.memberKey)
|
||||
return `https://admin.googleapis.com/admin/directory/v1/groups/${encodedGroupKey}/hasMember/${encodedMemberKey}`
|
||||
},
|
||||
method: 'GET',
|
||||
headers: (params) => ({
|
||||
Authorization: `Bearer ${params.accessToken}`,
|
||||
'Content-Type': 'application/json',
|
||||
}),
|
||||
},
|
||||
|
||||
transformResponse: async (response) => {
|
||||
const data = await response.json()
|
||||
if (!response.ok) {
|
||||
throw new Error(data.error?.message || 'Failed to check membership')
|
||||
}
|
||||
return {
|
||||
success: true,
|
||||
output: { isMember: data.isMember },
|
||||
}
|
||||
},
|
||||
|
||||
outputs: {
|
||||
isMember: { type: 'boolean', description: 'Whether the user is a member of the group' },
|
||||
},
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
import { addAliasTool } from './add_alias'
|
||||
import { addMemberTool } from './add_member'
|
||||
import { createGroupTool } from './create_group'
|
||||
import { deleteGroupTool } from './delete_group'
|
||||
import { getGroupTool } from './get_group'
|
||||
import { getMemberTool } from './get_member'
|
||||
import { getSettingsTool } from './get_settings'
|
||||
import { hasMemberTool } from './has_member'
|
||||
import { listAliasesTool } from './list_aliases'
|
||||
import { listGroupsTool } from './list_groups'
|
||||
import { listMembersTool } from './list_members'
|
||||
import { removeAliasTool } from './remove_alias'
|
||||
import { removeMemberTool } from './remove_member'
|
||||
import { updateGroupTool } from './update_group'
|
||||
import { updateMemberTool } from './update_member'
|
||||
import { updateSettingsTool } from './update_settings'
|
||||
|
||||
export const googleGroupsAddAliasTool = addAliasTool
|
||||
export const googleGroupsAddMemberTool = addMemberTool
|
||||
export const googleGroupsCreateGroupTool = createGroupTool
|
||||
export const googleGroupsDeleteGroupTool = deleteGroupTool
|
||||
export const googleGroupsGetGroupTool = getGroupTool
|
||||
export const googleGroupsGetMemberTool = getMemberTool
|
||||
export const googleGroupsGetSettingsTool = getSettingsTool
|
||||
export const googleGroupsHasMemberTool = hasMemberTool
|
||||
export const googleGroupsListAliasesTool = listAliasesTool
|
||||
export const googleGroupsListGroupsTool = listGroupsTool
|
||||
export const googleGroupsListMembersTool = listMembersTool
|
||||
export const googleGroupsRemoveAliasTool = removeAliasTool
|
||||
export const googleGroupsRemoveMemberTool = removeMemberTool
|
||||
export const googleGroupsUpdateGroupTool = updateGroupTool
|
||||
export const googleGroupsUpdateMemberTool = updateMemberTool
|
||||
export const googleGroupsUpdateSettingsTool = updateSettingsTool
|
||||
@@ -0,0 +1,78 @@
|
||||
import type {
|
||||
GoogleGroupsListAliasesParams,
|
||||
GoogleGroupsListAliasesResponse,
|
||||
} from '@/tools/google_groups/types'
|
||||
import type { ToolConfig } from '@/tools/types'
|
||||
|
||||
export const listAliasesTool: ToolConfig<
|
||||
GoogleGroupsListAliasesParams,
|
||||
GoogleGroupsListAliasesResponse
|
||||
> = {
|
||||
id: 'google_groups_list_aliases',
|
||||
name: 'Google Groups List Aliases',
|
||||
description: 'List all email aliases for a Google Group',
|
||||
version: '1.0.0',
|
||||
|
||||
oauth: {
|
||||
required: true,
|
||||
provider: 'google-groups',
|
||||
},
|
||||
|
||||
params: {
|
||||
accessToken: {
|
||||
type: 'string',
|
||||
required: true,
|
||||
visibility: 'hidden',
|
||||
description: 'OAuth access token',
|
||||
},
|
||||
groupKey: {
|
||||
type: 'string',
|
||||
required: true,
|
||||
visibility: 'user-or-llm',
|
||||
description:
|
||||
'Group identifier. Can be the group email address (e.g., team@example.com) or the unique group ID',
|
||||
},
|
||||
},
|
||||
|
||||
request: {
|
||||
url: (params) => {
|
||||
const encodedGroupKey = encodeURIComponent(params.groupKey.trim())
|
||||
return `https://admin.googleapis.com/admin/directory/v1/groups/${encodedGroupKey}/aliases`
|
||||
},
|
||||
method: 'GET',
|
||||
headers: (params) => ({
|
||||
Authorization: `Bearer ${params.accessToken}`,
|
||||
'Content-Type': 'application/json',
|
||||
}),
|
||||
},
|
||||
|
||||
transformResponse: async (response) => {
|
||||
const data = await response.json()
|
||||
if (!response.ok) {
|
||||
throw new Error(data.error?.message || 'Failed to list group aliases')
|
||||
}
|
||||
return {
|
||||
success: true,
|
||||
output: {
|
||||
aliases: data.aliases ?? [],
|
||||
},
|
||||
}
|
||||
},
|
||||
|
||||
outputs: {
|
||||
aliases: {
|
||||
type: 'array',
|
||||
description: 'List of email aliases for the group',
|
||||
items: {
|
||||
type: 'object',
|
||||
properties: {
|
||||
id: { type: 'string', description: 'Unique group identifier' },
|
||||
primaryEmail: { type: 'string', description: "Group's primary email address" },
|
||||
alias: { type: 'string', description: 'Alias email address' },
|
||||
kind: { type: 'string', description: 'API resource type' },
|
||||
etag: { type: 'string', description: 'Resource version identifier' },
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
@@ -0,0 +1,105 @@
|
||||
import type { GoogleGroupsListParams, GoogleGroupsResponse } from '@/tools/google_groups/types'
|
||||
import type { ToolConfig } from '@/tools/types'
|
||||
|
||||
export const listGroupsTool: ToolConfig<GoogleGroupsListParams, GoogleGroupsResponse> = {
|
||||
id: 'google_groups_list_groups',
|
||||
name: 'Google Groups List Groups',
|
||||
description: 'List all groups in a Google Workspace domain',
|
||||
version: '1.0.0',
|
||||
|
||||
oauth: {
|
||||
required: true,
|
||||
provider: 'google-groups',
|
||||
},
|
||||
|
||||
params: {
|
||||
accessToken: {
|
||||
type: 'string',
|
||||
required: true,
|
||||
visibility: 'hidden',
|
||||
description: 'OAuth access token',
|
||||
},
|
||||
customer: {
|
||||
type: 'string',
|
||||
required: false,
|
||||
visibility: 'user-only',
|
||||
description: 'Customer ID or "my_customer" for the authenticated user\'s domain',
|
||||
},
|
||||
domain: {
|
||||
type: 'string',
|
||||
required: false,
|
||||
visibility: 'user-only',
|
||||
description: 'Domain name to filter groups by',
|
||||
},
|
||||
maxResults: {
|
||||
type: 'number',
|
||||
required: false,
|
||||
visibility: 'user-or-llm',
|
||||
description: 'Maximum number of results to return (1-200). Example: 50',
|
||||
},
|
||||
pageToken: {
|
||||
type: 'string',
|
||||
required: false,
|
||||
visibility: 'user-or-llm',
|
||||
description: 'Token for fetching the next page of results',
|
||||
},
|
||||
query: {
|
||||
type: 'string',
|
||||
required: false,
|
||||
visibility: 'user-only',
|
||||
description: 'Search query to filter groups (e.g., "email:admin*")',
|
||||
},
|
||||
},
|
||||
|
||||
request: {
|
||||
url: (params) => {
|
||||
const url = new URL('https://admin.googleapis.com/admin/directory/v1/groups')
|
||||
|
||||
// Use my_customer as default if no customer or domain specified
|
||||
if (params.customer) {
|
||||
url.searchParams.set('customer', params.customer)
|
||||
} else if (!params.domain) {
|
||||
url.searchParams.set('customer', 'my_customer')
|
||||
}
|
||||
|
||||
if (params.domain) {
|
||||
url.searchParams.set('domain', params.domain)
|
||||
}
|
||||
if (params.maxResults) {
|
||||
url.searchParams.set('maxResults', String(params.maxResults))
|
||||
}
|
||||
if (params.pageToken) {
|
||||
url.searchParams.set('pageToken', params.pageToken)
|
||||
}
|
||||
if (params.query) {
|
||||
url.searchParams.set('query', params.query)
|
||||
}
|
||||
|
||||
return url.toString()
|
||||
},
|
||||
method: 'GET',
|
||||
headers: (params) => ({
|
||||
Authorization: `Bearer ${params.accessToken}`,
|
||||
'Content-Type': 'application/json',
|
||||
}),
|
||||
},
|
||||
|
||||
transformResponse: async (response) => {
|
||||
const data = await response.json()
|
||||
if (!response.ok) {
|
||||
throw new Error(data.error?.message || 'Failed to list groups')
|
||||
}
|
||||
return {
|
||||
success: true,
|
||||
output: {
|
||||
groups: data.groups || [],
|
||||
nextPageToken: data.nextPageToken,
|
||||
},
|
||||
}
|
||||
},
|
||||
|
||||
outputs: {
|
||||
groups: { type: 'json', description: 'Array of group objects' },
|
||||
nextPageToken: { type: 'string', description: 'Token for fetching next page of results' },
|
||||
},
|
||||
}
|
||||
@@ -0,0 +1,96 @@
|
||||
import type {
|
||||
GoogleGroupsListMembersParams,
|
||||
GoogleGroupsResponse,
|
||||
} from '@/tools/google_groups/types'
|
||||
import type { ToolConfig } from '@/tools/types'
|
||||
|
||||
export const listMembersTool: ToolConfig<GoogleGroupsListMembersParams, GoogleGroupsResponse> = {
|
||||
id: 'google_groups_list_members',
|
||||
name: 'Google Groups List Members',
|
||||
description: 'List all members of a Google Group',
|
||||
version: '1.0.0',
|
||||
|
||||
oauth: {
|
||||
required: true,
|
||||
provider: 'google-groups',
|
||||
},
|
||||
|
||||
params: {
|
||||
accessToken: {
|
||||
type: 'string',
|
||||
required: true,
|
||||
visibility: 'hidden',
|
||||
description: 'OAuth access token',
|
||||
},
|
||||
groupKey: {
|
||||
type: 'string',
|
||||
required: true,
|
||||
visibility: 'user-or-llm',
|
||||
description:
|
||||
'Group identifier. Can be the group email address (e.g., team@example.com) or the unique group ID',
|
||||
},
|
||||
maxResults: {
|
||||
type: 'number',
|
||||
required: false,
|
||||
visibility: 'user-or-llm',
|
||||
description: 'Maximum number of results to return (1-200). Example: 50',
|
||||
},
|
||||
pageToken: {
|
||||
type: 'string',
|
||||
required: false,
|
||||
visibility: 'user-or-llm',
|
||||
description: 'Token for fetching the next page of results',
|
||||
},
|
||||
roles: {
|
||||
type: 'string',
|
||||
required: false,
|
||||
visibility: 'user-or-llm',
|
||||
description: 'Filter by roles (comma-separated: OWNER, MANAGER, MEMBER)',
|
||||
},
|
||||
},
|
||||
|
||||
request: {
|
||||
url: (params) => {
|
||||
const encodedGroupKey = encodeURIComponent(params.groupKey)
|
||||
const url = new URL(
|
||||
`https://admin.googleapis.com/admin/directory/v1/groups/${encodedGroupKey}/members`
|
||||
)
|
||||
|
||||
if (params.maxResults) {
|
||||
url.searchParams.set('maxResults', String(params.maxResults))
|
||||
}
|
||||
if (params.pageToken) {
|
||||
url.searchParams.set('pageToken', params.pageToken)
|
||||
}
|
||||
if (params.roles) {
|
||||
url.searchParams.set('roles', params.roles)
|
||||
}
|
||||
|
||||
return url.toString()
|
||||
},
|
||||
method: 'GET',
|
||||
headers: (params) => ({
|
||||
Authorization: `Bearer ${params.accessToken}`,
|
||||
'Content-Type': 'application/json',
|
||||
}),
|
||||
},
|
||||
|
||||
transformResponse: async (response) => {
|
||||
const data = await response.json()
|
||||
if (!response.ok) {
|
||||
throw new Error(data.error?.message || 'Failed to list group members')
|
||||
}
|
||||
return {
|
||||
success: true,
|
||||
output: {
|
||||
members: data.members || [],
|
||||
nextPageToken: data.nextPageToken,
|
||||
},
|
||||
}
|
||||
},
|
||||
|
||||
outputs: {
|
||||
members: { type: 'json', description: 'Array of member objects' },
|
||||
nextPageToken: { type: 'string', description: 'Token for fetching next page of results' },
|
||||
},
|
||||
}
|
||||
@@ -0,0 +1,72 @@
|
||||
import type {
|
||||
GoogleGroupsRemoveAliasParams,
|
||||
GoogleGroupsRemoveAliasResponse,
|
||||
} from '@/tools/google_groups/types'
|
||||
import type { ToolConfig } from '@/tools/types'
|
||||
|
||||
export const removeAliasTool: ToolConfig<
|
||||
GoogleGroupsRemoveAliasParams,
|
||||
GoogleGroupsRemoveAliasResponse
|
||||
> = {
|
||||
id: 'google_groups_remove_alias',
|
||||
name: 'Google Groups Remove Alias',
|
||||
description: 'Remove an email alias from a Google Group',
|
||||
version: '1.0.0',
|
||||
|
||||
oauth: {
|
||||
required: true,
|
||||
provider: 'google-groups',
|
||||
},
|
||||
|
||||
params: {
|
||||
accessToken: {
|
||||
type: 'string',
|
||||
required: true,
|
||||
visibility: 'hidden',
|
||||
description: 'OAuth access token',
|
||||
},
|
||||
groupKey: {
|
||||
type: 'string',
|
||||
required: true,
|
||||
visibility: 'user-or-llm',
|
||||
description:
|
||||
'Group identifier. Can be the group email address (e.g., team@example.com) or the unique group ID',
|
||||
},
|
||||
alias: {
|
||||
type: 'string',
|
||||
required: true,
|
||||
visibility: 'user-or-llm',
|
||||
description: 'The email alias to remove from the group',
|
||||
},
|
||||
},
|
||||
|
||||
request: {
|
||||
url: (params) => {
|
||||
const encodedGroupKey = encodeURIComponent(params.groupKey.trim())
|
||||
const encodedAlias = encodeURIComponent(params.alias.trim())
|
||||
return `https://admin.googleapis.com/admin/directory/v1/groups/${encodedGroupKey}/aliases/${encodedAlias}`
|
||||
},
|
||||
method: 'DELETE',
|
||||
headers: (params) => ({
|
||||
Authorization: `Bearer ${params.accessToken}`,
|
||||
'Content-Type': 'application/json',
|
||||
}),
|
||||
},
|
||||
|
||||
transformResponse: async (response) => {
|
||||
if (!response.ok) {
|
||||
const data = await response.json()
|
||||
throw new Error(data.error?.message || 'Failed to remove group alias')
|
||||
}
|
||||
return {
|
||||
success: true,
|
||||
output: {
|
||||
deleted: true,
|
||||
},
|
||||
}
|
||||
},
|
||||
|
||||
outputs: {
|
||||
deleted: { type: 'boolean', description: 'Whether the alias was successfully deleted' },
|
||||
},
|
||||
}
|
||||
@@ -0,0 +1,68 @@
|
||||
import type {
|
||||
GoogleGroupsRemoveMemberParams,
|
||||
GoogleGroupsResponse,
|
||||
} from '@/tools/google_groups/types'
|
||||
import type { ToolConfig } from '@/tools/types'
|
||||
|
||||
export const removeMemberTool: ToolConfig<GoogleGroupsRemoveMemberParams, GoogleGroupsResponse> = {
|
||||
id: 'google_groups_remove_member',
|
||||
name: 'Google Groups Remove Member',
|
||||
description: 'Remove a member from a Google Group',
|
||||
version: '1.0.0',
|
||||
|
||||
oauth: {
|
||||
required: true,
|
||||
provider: 'google-groups',
|
||||
},
|
||||
|
||||
params: {
|
||||
accessToken: {
|
||||
type: 'string',
|
||||
required: true,
|
||||
visibility: 'hidden',
|
||||
description: 'OAuth access token',
|
||||
},
|
||||
groupKey: {
|
||||
type: 'string',
|
||||
required: true,
|
||||
visibility: 'user-or-llm',
|
||||
description:
|
||||
'Group identifier. Can be the group email address (e.g., team@example.com) or the unique group ID',
|
||||
},
|
||||
memberKey: {
|
||||
type: 'string',
|
||||
required: true,
|
||||
visibility: 'user-or-llm',
|
||||
description:
|
||||
'Member identifier to remove. Can be the member email address (e.g., user@example.com) or the unique member ID',
|
||||
},
|
||||
},
|
||||
|
||||
request: {
|
||||
url: (params) => {
|
||||
const encodedGroupKey = encodeURIComponent(params.groupKey)
|
||||
const encodedMemberKey = encodeURIComponent(params.memberKey)
|
||||
return `https://admin.googleapis.com/admin/directory/v1/groups/${encodedGroupKey}/members/${encodedMemberKey}`
|
||||
},
|
||||
method: 'DELETE',
|
||||
headers: (params) => ({
|
||||
Authorization: `Bearer ${params.accessToken}`,
|
||||
'Content-Type': 'application/json',
|
||||
}),
|
||||
},
|
||||
|
||||
transformResponse: async (response) => {
|
||||
if (!response.ok) {
|
||||
const data = await response.json()
|
||||
throw new Error(data.error?.message || 'Failed to remove member from group')
|
||||
}
|
||||
return {
|
||||
success: true,
|
||||
output: { message: 'Member removed successfully' },
|
||||
}
|
||||
},
|
||||
|
||||
outputs: {
|
||||
message: { type: 'string', description: 'Success message' },
|
||||
},
|
||||
}
|
||||
@@ -0,0 +1,299 @@
|
||||
import type { ToolResponse } from '@/tools/types'
|
||||
|
||||
/**
|
||||
* Common parameters for Google Groups API calls
|
||||
*/
|
||||
interface GoogleGroupsCommonParams {
|
||||
accessToken: string
|
||||
}
|
||||
|
||||
/**
|
||||
* Parameters for listing groups
|
||||
*/
|
||||
export interface GoogleGroupsListParams extends GoogleGroupsCommonParams {
|
||||
customer?: string
|
||||
domain?: string
|
||||
maxResults?: number
|
||||
pageToken?: string
|
||||
query?: string
|
||||
}
|
||||
|
||||
/**
|
||||
* Parameters for getting a specific group
|
||||
*/
|
||||
export interface GoogleGroupsGetParams extends GoogleGroupsCommonParams {
|
||||
groupKey: string
|
||||
}
|
||||
|
||||
/**
|
||||
* Parameters for creating a group
|
||||
*/
|
||||
export interface GoogleGroupsCreateParams extends GoogleGroupsCommonParams {
|
||||
email: string
|
||||
name: string
|
||||
description?: string
|
||||
}
|
||||
|
||||
/**
|
||||
* Parameters for updating a group
|
||||
*/
|
||||
export interface GoogleGroupsUpdateParams extends GoogleGroupsCommonParams {
|
||||
groupKey: string
|
||||
name?: string
|
||||
description?: string
|
||||
email?: string
|
||||
}
|
||||
|
||||
/**
|
||||
* Parameters for deleting a group
|
||||
*/
|
||||
export interface GoogleGroupsDeleteParams extends GoogleGroupsCommonParams {
|
||||
groupKey: string
|
||||
}
|
||||
|
||||
/**
|
||||
* Parameters for listing group members
|
||||
*/
|
||||
export interface GoogleGroupsListMembersParams extends GoogleGroupsCommonParams {
|
||||
groupKey: string
|
||||
maxResults?: number
|
||||
pageToken?: string
|
||||
roles?: string
|
||||
}
|
||||
|
||||
/**
|
||||
* Parameters for getting a specific member
|
||||
*/
|
||||
export interface GoogleGroupsGetMemberParams extends GoogleGroupsCommonParams {
|
||||
groupKey: string
|
||||
memberKey: string
|
||||
}
|
||||
|
||||
/**
|
||||
* Parameters for adding a member to a group
|
||||
*/
|
||||
export interface GoogleGroupsAddMemberParams extends GoogleGroupsCommonParams {
|
||||
groupKey: string
|
||||
email: string
|
||||
role?: 'MEMBER' | 'MANAGER' | 'OWNER'
|
||||
}
|
||||
|
||||
/**
|
||||
* Parameters for removing a member from a group
|
||||
*/
|
||||
export interface GoogleGroupsRemoveMemberParams extends GoogleGroupsCommonParams {
|
||||
groupKey: string
|
||||
memberKey: string
|
||||
}
|
||||
|
||||
/**
|
||||
* Parameters for updating a member's role in a group
|
||||
*/
|
||||
export interface GoogleGroupsUpdateMemberParams extends GoogleGroupsCommonParams {
|
||||
groupKey: string
|
||||
memberKey: string
|
||||
role: 'MEMBER' | 'MANAGER' | 'OWNER'
|
||||
}
|
||||
|
||||
/**
|
||||
* Parameters for checking if a user is a member of a group
|
||||
*/
|
||||
export interface GoogleGroupsHasMemberParams extends GoogleGroupsCommonParams {
|
||||
groupKey: string
|
||||
memberKey: string
|
||||
}
|
||||
|
||||
/**
|
||||
* Parameters for listing group aliases
|
||||
*/
|
||||
export interface GoogleGroupsListAliasesParams extends GoogleGroupsCommonParams {
|
||||
groupKey: string
|
||||
}
|
||||
|
||||
/**
|
||||
* Parameters for adding a group alias
|
||||
*/
|
||||
export interface GoogleGroupsAddAliasParams extends GoogleGroupsCommonParams {
|
||||
groupKey: string
|
||||
alias: string
|
||||
}
|
||||
|
||||
/**
|
||||
* Parameters for removing a group alias
|
||||
*/
|
||||
export interface GoogleGroupsRemoveAliasParams extends GoogleGroupsCommonParams {
|
||||
groupKey: string
|
||||
alias: string
|
||||
}
|
||||
|
||||
/**
|
||||
* Parameters for getting group settings
|
||||
*/
|
||||
export interface GoogleGroupsGetSettingsParams extends GoogleGroupsCommonParams {
|
||||
groupEmail: string
|
||||
}
|
||||
|
||||
/**
|
||||
* Parameters for updating group settings
|
||||
*/
|
||||
export interface GoogleGroupsUpdateSettingsParams extends GoogleGroupsCommonParams {
|
||||
groupEmail: string
|
||||
name?: string
|
||||
description?: string
|
||||
whoCanJoin?: string
|
||||
whoCanViewMembership?: string
|
||||
whoCanViewGroup?: string
|
||||
whoCanPostMessage?: string
|
||||
allowExternalMembers?: string
|
||||
allowWebPosting?: string
|
||||
primaryLanguage?: string
|
||||
isArchived?: string
|
||||
archiveOnly?: string
|
||||
messageModerationLevel?: string
|
||||
spamModerationLevel?: string
|
||||
replyTo?: string
|
||||
customReplyTo?: string
|
||||
includeCustomFooter?: string
|
||||
customFooterText?: string
|
||||
sendMessageDenyNotification?: string
|
||||
defaultMessageDenyNotificationText?: string
|
||||
membersCanPostAsTheGroup?: string
|
||||
includeInGlobalAddressList?: string
|
||||
whoCanLeaveGroup?: string
|
||||
whoCanContactOwner?: string
|
||||
favoriteRepliesOnTop?: string
|
||||
whoCanApproveMembers?: string
|
||||
whoCanBanUsers?: string
|
||||
whoCanModerateMembers?: string
|
||||
whoCanModerateContent?: string
|
||||
whoCanAssistContent?: string
|
||||
enableCollaborativeInbox?: string
|
||||
whoCanDiscoverGroup?: string
|
||||
defaultSender?: string
|
||||
}
|
||||
|
||||
/**
|
||||
* Standard response for Google Groups operations
|
||||
*/
|
||||
export interface GoogleGroupsResponse extends ToolResponse {
|
||||
output: Record<string, unknown>
|
||||
}
|
||||
|
||||
/**
|
||||
* Response for listing group aliases
|
||||
*/
|
||||
export interface GoogleGroupsListAliasesResponse extends ToolResponse {
|
||||
output: {
|
||||
aliases: Array<{
|
||||
id?: string
|
||||
primaryEmail?: string
|
||||
alias?: string
|
||||
kind?: string
|
||||
etag?: string
|
||||
}>
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Response for adding a group alias
|
||||
*/
|
||||
export interface GoogleGroupsAddAliasResponse extends ToolResponse {
|
||||
output: {
|
||||
id: string | null
|
||||
primaryEmail: string | null
|
||||
alias: string | null
|
||||
kind: string | null
|
||||
etag: string | null
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Response for removing a group alias
|
||||
*/
|
||||
export interface GoogleGroupsRemoveAliasResponse extends ToolResponse {
|
||||
output: {
|
||||
deleted: boolean
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Response for getting group settings
|
||||
*/
|
||||
export interface GoogleGroupsGetSettingsResponse extends ToolResponse {
|
||||
output: {
|
||||
email: string | null
|
||||
name: string | null
|
||||
description: string | null
|
||||
whoCanJoin: string | null
|
||||
whoCanViewMembership: string | null
|
||||
whoCanViewGroup: string | null
|
||||
whoCanPostMessage: string | null
|
||||
allowExternalMembers: string | null
|
||||
allowWebPosting: string | null
|
||||
primaryLanguage: string | null
|
||||
isArchived: string | null
|
||||
archiveOnly: string | null
|
||||
messageModerationLevel: string | null
|
||||
spamModerationLevel: string | null
|
||||
replyTo: string | null
|
||||
customReplyTo: string | null
|
||||
includeCustomFooter: string | null
|
||||
customFooterText: string | null
|
||||
sendMessageDenyNotification: string | null
|
||||
defaultMessageDenyNotificationText: string | null
|
||||
membersCanPostAsTheGroup: string | null
|
||||
includeInGlobalAddressList: string | null
|
||||
whoCanLeaveGroup: string | null
|
||||
whoCanContactOwner: string | null
|
||||
favoriteRepliesOnTop: string | null
|
||||
whoCanApproveMembers: string | null
|
||||
whoCanBanUsers: string | null
|
||||
whoCanModerateMembers: string | null
|
||||
whoCanModerateContent: string | null
|
||||
whoCanAssistContent: string | null
|
||||
enableCollaborativeInbox: string | null
|
||||
whoCanDiscoverGroup: string | null
|
||||
defaultSender: string | null
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Response for updating group settings
|
||||
*/
|
||||
export interface GoogleGroupsUpdateSettingsResponse extends ToolResponse {
|
||||
output: {
|
||||
email: string | null
|
||||
name: string | null
|
||||
description: string | null
|
||||
whoCanJoin: string | null
|
||||
whoCanViewMembership: string | null
|
||||
whoCanViewGroup: string | null
|
||||
whoCanPostMessage: string | null
|
||||
allowExternalMembers: string | null
|
||||
allowWebPosting: string | null
|
||||
primaryLanguage: string | null
|
||||
isArchived: string | null
|
||||
archiveOnly: string | null
|
||||
messageModerationLevel: string | null
|
||||
spamModerationLevel: string | null
|
||||
replyTo: string | null
|
||||
customReplyTo: string | null
|
||||
includeCustomFooter: string | null
|
||||
customFooterText: string | null
|
||||
sendMessageDenyNotification: string | null
|
||||
defaultMessageDenyNotificationText: string | null
|
||||
membersCanPostAsTheGroup: string | null
|
||||
includeInGlobalAddressList: string | null
|
||||
whoCanLeaveGroup: string | null
|
||||
whoCanContactOwner: string | null
|
||||
favoriteRepliesOnTop: string | null
|
||||
whoCanApproveMembers: string | null
|
||||
whoCanBanUsers: string | null
|
||||
whoCanModerateMembers: string | null
|
||||
whoCanModerateContent: string | null
|
||||
whoCanAssistContent: string | null
|
||||
enableCollaborativeInbox: string | null
|
||||
whoCanDiscoverGroup: string | null
|
||||
defaultSender: string | null
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,90 @@
|
||||
import type { GoogleGroupsResponse, GoogleGroupsUpdateParams } from '@/tools/google_groups/types'
|
||||
import type { ToolConfig } from '@/tools/types'
|
||||
|
||||
export const updateGroupTool: ToolConfig<GoogleGroupsUpdateParams, GoogleGroupsResponse> = {
|
||||
id: 'google_groups_update_group',
|
||||
name: 'Google Groups Update Group',
|
||||
description: 'Update an existing Google Group',
|
||||
version: '1.0.0',
|
||||
|
||||
oauth: {
|
||||
required: true,
|
||||
provider: 'google-groups',
|
||||
},
|
||||
|
||||
params: {
|
||||
accessToken: {
|
||||
type: 'string',
|
||||
required: true,
|
||||
visibility: 'hidden',
|
||||
description: 'OAuth access token',
|
||||
},
|
||||
groupKey: {
|
||||
type: 'string',
|
||||
required: true,
|
||||
visibility: 'user-or-llm',
|
||||
description:
|
||||
'Group identifier. Can be the group email address (e.g., team@example.com) or the unique group ID',
|
||||
},
|
||||
name: {
|
||||
type: 'string',
|
||||
required: false,
|
||||
visibility: 'user-or-llm',
|
||||
description: 'New display name for the group (e.g., Engineering Team)',
|
||||
},
|
||||
description: {
|
||||
type: 'string',
|
||||
required: false,
|
||||
visibility: 'user-or-llm',
|
||||
description: 'New description for the group',
|
||||
},
|
||||
email: {
|
||||
type: 'string',
|
||||
required: false,
|
||||
visibility: 'user-or-llm',
|
||||
description: 'New email address for the group (e.g., newteam@example.com)',
|
||||
},
|
||||
},
|
||||
|
||||
request: {
|
||||
url: (params) => {
|
||||
const encodedGroupKey = encodeURIComponent(params.groupKey)
|
||||
return `https://admin.googleapis.com/admin/directory/v1/groups/${encodedGroupKey}`
|
||||
},
|
||||
method: 'PATCH',
|
||||
headers: (params) => ({
|
||||
Authorization: `Bearer ${params.accessToken}`,
|
||||
'Content-Type': 'application/json',
|
||||
}),
|
||||
body: (params) => {
|
||||
const body: Record<string, string> = {}
|
||||
|
||||
if (params.name) {
|
||||
body.name = params.name
|
||||
}
|
||||
if (params.description) {
|
||||
body.description = params.description
|
||||
}
|
||||
if (params.email) {
|
||||
body.email = params.email
|
||||
}
|
||||
|
||||
return JSON.stringify(body)
|
||||
},
|
||||
},
|
||||
|
||||
transformResponse: async (response) => {
|
||||
const data = await response.json()
|
||||
if (!response.ok) {
|
||||
throw new Error(data.error?.message || 'Failed to update group')
|
||||
}
|
||||
return {
|
||||
success: true,
|
||||
output: { group: data },
|
||||
}
|
||||
},
|
||||
|
||||
outputs: {
|
||||
group: { type: 'json', description: 'Updated group object' },
|
||||
},
|
||||
}
|
||||
@@ -0,0 +1,79 @@
|
||||
import type {
|
||||
GoogleGroupsResponse,
|
||||
GoogleGroupsUpdateMemberParams,
|
||||
} from '@/tools/google_groups/types'
|
||||
import type { ToolConfig } from '@/tools/types'
|
||||
|
||||
export const updateMemberTool: ToolConfig<GoogleGroupsUpdateMemberParams, GoogleGroupsResponse> = {
|
||||
id: 'google_groups_update_member',
|
||||
name: 'Google Groups Update Member',
|
||||
description: "Update a member's role in a Google Group (promote or demote)",
|
||||
version: '1.0.0',
|
||||
|
||||
oauth: {
|
||||
required: true,
|
||||
provider: 'google-groups',
|
||||
},
|
||||
|
||||
params: {
|
||||
accessToken: {
|
||||
type: 'string',
|
||||
required: true,
|
||||
visibility: 'hidden',
|
||||
description: 'OAuth access token',
|
||||
},
|
||||
groupKey: {
|
||||
type: 'string',
|
||||
required: true,
|
||||
visibility: 'user-or-llm',
|
||||
description:
|
||||
'Group identifier. Can be the group email address (e.g., team@example.com) or the unique group ID',
|
||||
},
|
||||
memberKey: {
|
||||
type: 'string',
|
||||
required: true,
|
||||
visibility: 'user-or-llm',
|
||||
description:
|
||||
'Member identifier. Can be the member email address (e.g., user@example.com) or the unique member ID',
|
||||
},
|
||||
role: {
|
||||
type: 'string',
|
||||
required: true,
|
||||
visibility: 'user-or-llm',
|
||||
description: 'New role for the member: MEMBER, MANAGER, or OWNER',
|
||||
},
|
||||
},
|
||||
|
||||
request: {
|
||||
url: (params) => {
|
||||
const encodedGroupKey = encodeURIComponent(params.groupKey)
|
||||
const encodedMemberKey = encodeURIComponent(params.memberKey)
|
||||
return `https://admin.googleapis.com/admin/directory/v1/groups/${encodedGroupKey}/members/${encodedMemberKey}`
|
||||
},
|
||||
method: 'PATCH',
|
||||
headers: (params) => ({
|
||||
Authorization: `Bearer ${params.accessToken}`,
|
||||
'Content-Type': 'application/json',
|
||||
}),
|
||||
body: (params) => {
|
||||
return JSON.stringify({
|
||||
role: params.role,
|
||||
})
|
||||
},
|
||||
},
|
||||
|
||||
transformResponse: async (response) => {
|
||||
const data = await response.json()
|
||||
if (!response.ok) {
|
||||
throw new Error(data.error?.message || 'Failed to update member role')
|
||||
}
|
||||
return {
|
||||
success: true,
|
||||
output: { member: data },
|
||||
}
|
||||
},
|
||||
|
||||
outputs: {
|
||||
member: { type: 'json', description: 'Updated member object' },
|
||||
},
|
||||
}
|
||||
@@ -0,0 +1,399 @@
|
||||
import type {
|
||||
GoogleGroupsUpdateSettingsParams,
|
||||
GoogleGroupsUpdateSettingsResponse,
|
||||
} from '@/tools/google_groups/types'
|
||||
import type { ToolConfig } from '@/tools/types'
|
||||
|
||||
export const updateSettingsTool: ToolConfig<
|
||||
GoogleGroupsUpdateSettingsParams,
|
||||
GoogleGroupsUpdateSettingsResponse
|
||||
> = {
|
||||
id: 'google_groups_update_settings',
|
||||
name: 'Google Groups Update Settings',
|
||||
description:
|
||||
'Update the settings for a Google Group including access permissions, moderation, and posting options',
|
||||
version: '1.0.0',
|
||||
|
||||
oauth: {
|
||||
required: true,
|
||||
provider: 'google-groups',
|
||||
},
|
||||
|
||||
params: {
|
||||
accessToken: {
|
||||
type: 'string',
|
||||
required: true,
|
||||
visibility: 'hidden',
|
||||
description: 'OAuth access token',
|
||||
},
|
||||
groupEmail: {
|
||||
type: 'string',
|
||||
required: true,
|
||||
visibility: 'user-or-llm',
|
||||
description: 'The email address of the group (e.g., team@example.com)',
|
||||
},
|
||||
name: {
|
||||
type: 'string',
|
||||
required: false,
|
||||
visibility: 'user-or-llm',
|
||||
description: 'The group name (max 75 characters)',
|
||||
},
|
||||
description: {
|
||||
type: 'string',
|
||||
required: false,
|
||||
visibility: 'user-or-llm',
|
||||
description: 'The group description (max 4096 characters)',
|
||||
},
|
||||
whoCanJoin: {
|
||||
type: 'string',
|
||||
required: false,
|
||||
visibility: 'user-or-llm',
|
||||
description:
|
||||
'Who can join: ANYONE_CAN_JOIN, ALL_IN_DOMAIN_CAN_JOIN, INVITED_CAN_JOIN, CAN_REQUEST_TO_JOIN',
|
||||
},
|
||||
whoCanViewMembership: {
|
||||
type: 'string',
|
||||
required: false,
|
||||
visibility: 'user-or-llm',
|
||||
description:
|
||||
'Who can view membership: ALL_IN_DOMAIN_CAN_VIEW, ALL_MEMBERS_CAN_VIEW, ALL_MANAGERS_CAN_VIEW',
|
||||
},
|
||||
whoCanViewGroup: {
|
||||
type: 'string',
|
||||
required: false,
|
||||
visibility: 'user-or-llm',
|
||||
description:
|
||||
'Who can view group messages: ANYONE_CAN_VIEW, ALL_IN_DOMAIN_CAN_VIEW, ALL_MEMBERS_CAN_VIEW, ALL_MANAGERS_CAN_VIEW, ALL_OWNERS_CAN_VIEW',
|
||||
},
|
||||
whoCanPostMessage: {
|
||||
type: 'string',
|
||||
required: false,
|
||||
visibility: 'user-or-llm',
|
||||
description:
|
||||
'Who can post: NONE_CAN_POST, ALL_MANAGERS_CAN_POST, ALL_MEMBERS_CAN_POST, ALL_OWNERS_CAN_POST, ALL_IN_DOMAIN_CAN_POST, ANYONE_CAN_POST',
|
||||
},
|
||||
allowExternalMembers: {
|
||||
type: 'string',
|
||||
required: false,
|
||||
visibility: 'user-or-llm',
|
||||
description: 'Whether external users can be members: true or false',
|
||||
},
|
||||
allowWebPosting: {
|
||||
type: 'string',
|
||||
required: false,
|
||||
visibility: 'user-or-llm',
|
||||
description: 'Whether web posting is allowed: true or false',
|
||||
},
|
||||
primaryLanguage: {
|
||||
type: 'string',
|
||||
required: false,
|
||||
visibility: 'user-or-llm',
|
||||
description: "The group's primary language (e.g., en)",
|
||||
},
|
||||
isArchived: {
|
||||
type: 'string',
|
||||
required: false,
|
||||
visibility: 'user-or-llm',
|
||||
description: 'Whether messages are archived: true or false',
|
||||
},
|
||||
archiveOnly: {
|
||||
type: 'string',
|
||||
required: false,
|
||||
visibility: 'user-or-llm',
|
||||
description: 'Whether the group is archive-only (inactive): true or false',
|
||||
},
|
||||
messageModerationLevel: {
|
||||
type: 'string',
|
||||
required: false,
|
||||
visibility: 'user-or-llm',
|
||||
description:
|
||||
'Message moderation: MODERATE_ALL_MESSAGES, MODERATE_NON_MEMBERS, MODERATE_NEW_MEMBERS, MODERATE_NONE',
|
||||
},
|
||||
spamModerationLevel: {
|
||||
type: 'string',
|
||||
required: false,
|
||||
visibility: 'user-or-llm',
|
||||
description: 'Spam handling: ALLOW, MODERATE, SILENTLY_MODERATE, REJECT',
|
||||
},
|
||||
replyTo: {
|
||||
type: 'string',
|
||||
required: false,
|
||||
visibility: 'user-or-llm',
|
||||
description:
|
||||
'Default reply: REPLY_TO_CUSTOM, REPLY_TO_SENDER, REPLY_TO_LIST, REPLY_TO_OWNER, REPLY_TO_IGNORE, REPLY_TO_MANAGERS',
|
||||
},
|
||||
customReplyTo: {
|
||||
type: 'string',
|
||||
required: false,
|
||||
visibility: 'user-or-llm',
|
||||
description: 'Custom email for replies (when replyTo is REPLY_TO_CUSTOM)',
|
||||
},
|
||||
includeCustomFooter: {
|
||||
type: 'string',
|
||||
required: false,
|
||||
visibility: 'user-or-llm',
|
||||
description: 'Whether to include custom footer: true or false',
|
||||
},
|
||||
customFooterText: {
|
||||
type: 'string',
|
||||
required: false,
|
||||
visibility: 'user-or-llm',
|
||||
description: 'Custom footer text (max 1000 characters)',
|
||||
},
|
||||
sendMessageDenyNotification: {
|
||||
type: 'string',
|
||||
required: false,
|
||||
visibility: 'user-or-llm',
|
||||
description: 'Whether to send rejection notifications: true or false',
|
||||
},
|
||||
defaultMessageDenyNotificationText: {
|
||||
type: 'string',
|
||||
required: false,
|
||||
visibility: 'user-or-llm',
|
||||
description: 'Default rejection message text',
|
||||
},
|
||||
membersCanPostAsTheGroup: {
|
||||
type: 'string',
|
||||
required: false,
|
||||
visibility: 'user-or-llm',
|
||||
description: 'Whether members can post as the group: true or false',
|
||||
},
|
||||
includeInGlobalAddressList: {
|
||||
type: 'string',
|
||||
required: false,
|
||||
visibility: 'user-or-llm',
|
||||
description: 'Whether included in Global Address List: true or false',
|
||||
},
|
||||
whoCanLeaveGroup: {
|
||||
type: 'string',
|
||||
required: false,
|
||||
visibility: 'user-or-llm',
|
||||
description: 'Who can leave: ALL_MANAGERS_CAN_LEAVE, ALL_MEMBERS_CAN_LEAVE, NONE_CAN_LEAVE',
|
||||
},
|
||||
whoCanContactOwner: {
|
||||
type: 'string',
|
||||
required: false,
|
||||
visibility: 'user-or-llm',
|
||||
description:
|
||||
'Who can contact owner: ALL_IN_DOMAIN_CAN_CONTACT, ALL_MANAGERS_CAN_CONTACT, ALL_MEMBERS_CAN_CONTACT, ANYONE_CAN_CONTACT',
|
||||
},
|
||||
favoriteRepliesOnTop: {
|
||||
type: 'string',
|
||||
required: false,
|
||||
visibility: 'user-or-llm',
|
||||
description: 'Whether favorite replies appear at top: true or false',
|
||||
},
|
||||
whoCanApproveMembers: {
|
||||
type: 'string',
|
||||
required: false,
|
||||
visibility: 'user-or-llm',
|
||||
description:
|
||||
'Who can approve members: ALL_OWNERS_CAN_APPROVE, ALL_MANAGERS_CAN_APPROVE, ALL_MEMBERS_CAN_APPROVE, NONE_CAN_APPROVE',
|
||||
},
|
||||
whoCanBanUsers: {
|
||||
type: 'string',
|
||||
required: false,
|
||||
visibility: 'user-or-llm',
|
||||
description: 'Who can ban users: ALL_MEMBERS, OWNERS_AND_MANAGERS, OWNERS_ONLY, NONE',
|
||||
},
|
||||
whoCanModerateMembers: {
|
||||
type: 'string',
|
||||
required: false,
|
||||
visibility: 'user-or-llm',
|
||||
description: 'Who can manage members: OWNERS_ONLY, OWNERS_AND_MANAGERS, ALL_MEMBERS, NONE',
|
||||
},
|
||||
whoCanModerateContent: {
|
||||
type: 'string',
|
||||
required: false,
|
||||
visibility: 'user-or-llm',
|
||||
description: 'Who can moderate content: OWNERS_ONLY, OWNERS_AND_MANAGERS, ALL_MEMBERS, NONE',
|
||||
},
|
||||
whoCanAssistContent: {
|
||||
type: 'string',
|
||||
required: false,
|
||||
visibility: 'user-or-llm',
|
||||
description:
|
||||
'Who can assist with content metadata: OWNERS_ONLY, OWNERS_AND_MANAGERS, ALL_MEMBERS, NONE',
|
||||
},
|
||||
enableCollaborativeInbox: {
|
||||
type: 'string',
|
||||
required: false,
|
||||
visibility: 'user-or-llm',
|
||||
description: 'Whether collaborative inbox is enabled: true or false',
|
||||
},
|
||||
whoCanDiscoverGroup: {
|
||||
type: 'string',
|
||||
required: false,
|
||||
visibility: 'user-or-llm',
|
||||
description:
|
||||
'Who can discover: ANYONE_CAN_DISCOVER, ALL_IN_DOMAIN_CAN_DISCOVER, ALL_MEMBERS_CAN_DISCOVER',
|
||||
},
|
||||
defaultSender: {
|
||||
type: 'string',
|
||||
required: false,
|
||||
visibility: 'user-or-llm',
|
||||
description: 'Default sender: DEFAULT_SELF or GROUP',
|
||||
},
|
||||
},
|
||||
|
||||
request: {
|
||||
url: (params) => {
|
||||
const encodedEmail = encodeURIComponent(params.groupEmail.trim())
|
||||
return `https://www.googleapis.com/groups/v1/groups/${encodedEmail}`
|
||||
},
|
||||
method: 'PATCH',
|
||||
headers: (params) => ({
|
||||
Authorization: `Bearer ${params.accessToken}`,
|
||||
'Content-Type': 'application/json',
|
||||
}),
|
||||
body: (params) => {
|
||||
const body: Record<string, string> = {}
|
||||
if (params.name !== undefined) body.name = params.name
|
||||
if (params.description !== undefined) body.description = params.description
|
||||
if (params.whoCanJoin !== undefined) body.whoCanJoin = params.whoCanJoin
|
||||
if (params.whoCanViewMembership !== undefined)
|
||||
body.whoCanViewMembership = params.whoCanViewMembership
|
||||
if (params.whoCanViewGroup !== undefined) body.whoCanViewGroup = params.whoCanViewGroup
|
||||
if (params.whoCanPostMessage !== undefined) body.whoCanPostMessage = params.whoCanPostMessage
|
||||
if (params.allowExternalMembers !== undefined)
|
||||
body.allowExternalMembers = params.allowExternalMembers
|
||||
if (params.allowWebPosting !== undefined) body.allowWebPosting = params.allowWebPosting
|
||||
if (params.primaryLanguage !== undefined) body.primaryLanguage = params.primaryLanguage
|
||||
if (params.isArchived !== undefined) body.isArchived = params.isArchived
|
||||
if (params.archiveOnly !== undefined) body.archiveOnly = params.archiveOnly
|
||||
if (params.messageModerationLevel !== undefined)
|
||||
body.messageModerationLevel = params.messageModerationLevel
|
||||
if (params.spamModerationLevel !== undefined)
|
||||
body.spamModerationLevel = params.spamModerationLevel
|
||||
if (params.replyTo !== undefined) body.replyTo = params.replyTo
|
||||
if (params.customReplyTo !== undefined) body.customReplyTo = params.customReplyTo
|
||||
if (params.includeCustomFooter !== undefined)
|
||||
body.includeCustomFooter = params.includeCustomFooter
|
||||
if (params.customFooterText !== undefined) body.customFooterText = params.customFooterText
|
||||
if (params.sendMessageDenyNotification !== undefined)
|
||||
body.sendMessageDenyNotification = params.sendMessageDenyNotification
|
||||
if (params.defaultMessageDenyNotificationText !== undefined)
|
||||
body.defaultMessageDenyNotificationText = params.defaultMessageDenyNotificationText
|
||||
if (params.membersCanPostAsTheGroup !== undefined)
|
||||
body.membersCanPostAsTheGroup = params.membersCanPostAsTheGroup
|
||||
if (params.includeInGlobalAddressList !== undefined)
|
||||
body.includeInGlobalAddressList = params.includeInGlobalAddressList
|
||||
if (params.whoCanLeaveGroup !== undefined) body.whoCanLeaveGroup = params.whoCanLeaveGroup
|
||||
if (params.whoCanContactOwner !== undefined)
|
||||
body.whoCanContactOwner = params.whoCanContactOwner
|
||||
if (params.favoriteRepliesOnTop !== undefined)
|
||||
body.favoriteRepliesOnTop = params.favoriteRepliesOnTop
|
||||
if (params.whoCanApproveMembers !== undefined)
|
||||
body.whoCanApproveMembers = params.whoCanApproveMembers
|
||||
if (params.whoCanBanUsers !== undefined) body.whoCanBanUsers = params.whoCanBanUsers
|
||||
if (params.whoCanModerateMembers !== undefined)
|
||||
body.whoCanModerateMembers = params.whoCanModerateMembers
|
||||
if (params.whoCanModerateContent !== undefined)
|
||||
body.whoCanModerateContent = params.whoCanModerateContent
|
||||
if (params.whoCanAssistContent !== undefined)
|
||||
body.whoCanAssistContent = params.whoCanAssistContent
|
||||
if (params.enableCollaborativeInbox !== undefined)
|
||||
body.enableCollaborativeInbox = params.enableCollaborativeInbox
|
||||
if (params.whoCanDiscoverGroup !== undefined)
|
||||
body.whoCanDiscoverGroup = params.whoCanDiscoverGroup
|
||||
if (params.defaultSender !== undefined) body.defaultSender = params.defaultSender
|
||||
return JSON.stringify(body)
|
||||
},
|
||||
},
|
||||
|
||||
transformResponse: async (response) => {
|
||||
const data = await response.json()
|
||||
if (!response.ok) {
|
||||
throw new Error(data.error?.message || 'Failed to update group settings')
|
||||
}
|
||||
return {
|
||||
success: true,
|
||||
output: {
|
||||
email: data.email ?? null,
|
||||
name: data.name ?? null,
|
||||
description: data.description ?? null,
|
||||
whoCanJoin: data.whoCanJoin ?? null,
|
||||
whoCanViewMembership: data.whoCanViewMembership ?? null,
|
||||
whoCanViewGroup: data.whoCanViewGroup ?? null,
|
||||
whoCanPostMessage: data.whoCanPostMessage ?? null,
|
||||
allowExternalMembers: data.allowExternalMembers ?? null,
|
||||
allowWebPosting: data.allowWebPosting ?? null,
|
||||
primaryLanguage: data.primaryLanguage ?? null,
|
||||
isArchived: data.isArchived ?? null,
|
||||
archiveOnly: data.archiveOnly ?? null,
|
||||
messageModerationLevel: data.messageModerationLevel ?? null,
|
||||
spamModerationLevel: data.spamModerationLevel ?? null,
|
||||
replyTo: data.replyTo ?? null,
|
||||
customReplyTo: data.customReplyTo ?? null,
|
||||
includeCustomFooter: data.includeCustomFooter ?? null,
|
||||
customFooterText: data.customFooterText ?? null,
|
||||
sendMessageDenyNotification: data.sendMessageDenyNotification ?? null,
|
||||
defaultMessageDenyNotificationText: data.defaultMessageDenyNotificationText ?? null,
|
||||
membersCanPostAsTheGroup: data.membersCanPostAsTheGroup ?? null,
|
||||
includeInGlobalAddressList: data.includeInGlobalAddressList ?? null,
|
||||
whoCanLeaveGroup: data.whoCanLeaveGroup ?? null,
|
||||
whoCanContactOwner: data.whoCanContactOwner ?? null,
|
||||
favoriteRepliesOnTop: data.favoriteRepliesOnTop ?? null,
|
||||
whoCanApproveMembers: data.whoCanApproveMembers ?? null,
|
||||
whoCanBanUsers: data.whoCanBanUsers ?? null,
|
||||
whoCanModerateMembers: data.whoCanModerateMembers ?? null,
|
||||
whoCanModerateContent: data.whoCanModerateContent ?? null,
|
||||
whoCanAssistContent: data.whoCanAssistContent ?? null,
|
||||
enableCollaborativeInbox: data.enableCollaborativeInbox ?? null,
|
||||
whoCanDiscoverGroup: data.whoCanDiscoverGroup ?? null,
|
||||
defaultSender: data.defaultSender ?? null,
|
||||
},
|
||||
}
|
||||
},
|
||||
|
||||
outputs: {
|
||||
email: { type: 'string', description: "The group's email address" },
|
||||
name: { type: 'string', description: 'The group name' },
|
||||
description: { type: 'string', description: 'The group description' },
|
||||
whoCanJoin: { type: 'string', description: 'Who can join the group' },
|
||||
whoCanViewMembership: { type: 'string', description: 'Who can view group membership' },
|
||||
whoCanViewGroup: { type: 'string', description: 'Who can view group messages' },
|
||||
whoCanPostMessage: { type: 'string', description: 'Who can post messages to the group' },
|
||||
allowExternalMembers: { type: 'string', description: 'Whether external users can be members' },
|
||||
allowWebPosting: { type: 'string', description: 'Whether web posting is allowed' },
|
||||
primaryLanguage: { type: 'string', description: "The group's primary language" },
|
||||
isArchived: { type: 'string', description: 'Whether messages are archived' },
|
||||
archiveOnly: { type: 'string', description: 'Whether the group is archive-only' },
|
||||
messageModerationLevel: { type: 'string', description: 'Message moderation level' },
|
||||
spamModerationLevel: { type: 'string', description: 'Spam handling level' },
|
||||
replyTo: { type: 'string', description: 'Default reply destination' },
|
||||
customReplyTo: { type: 'string', description: 'Custom email for replies' },
|
||||
includeCustomFooter: { type: 'string', description: 'Whether to include custom footer' },
|
||||
customFooterText: { type: 'string', description: 'Custom footer text' },
|
||||
sendMessageDenyNotification: {
|
||||
type: 'string',
|
||||
description: 'Whether to send rejection notifications',
|
||||
},
|
||||
defaultMessageDenyNotificationText: {
|
||||
type: 'string',
|
||||
description: 'Default rejection message text',
|
||||
},
|
||||
membersCanPostAsTheGroup: {
|
||||
type: 'string',
|
||||
description: 'Whether members can post as the group',
|
||||
},
|
||||
includeInGlobalAddressList: {
|
||||
type: 'string',
|
||||
description: 'Whether included in Global Address List',
|
||||
},
|
||||
whoCanLeaveGroup: { type: 'string', description: 'Who can leave the group' },
|
||||
whoCanContactOwner: { type: 'string', description: 'Who can contact the group owner' },
|
||||
favoriteRepliesOnTop: { type: 'string', description: 'Whether favorite replies appear at top' },
|
||||
whoCanApproveMembers: { type: 'string', description: 'Who can approve new members' },
|
||||
whoCanBanUsers: { type: 'string', description: 'Who can ban users' },
|
||||
whoCanModerateMembers: { type: 'string', description: 'Who can manage members' },
|
||||
whoCanModerateContent: { type: 'string', description: 'Who can moderate content' },
|
||||
whoCanAssistContent: { type: 'string', description: 'Who can assist with content metadata' },
|
||||
enableCollaborativeInbox: {
|
||||
type: 'string',
|
||||
description: 'Whether collaborative inbox is enabled',
|
||||
},
|
||||
whoCanDiscoverGroup: { type: 'string', description: 'Who can discover the group' },
|
||||
defaultSender: { type: 'string', description: 'Default sender identity' },
|
||||
},
|
||||
}
|
||||
Reference in New Issue
Block a user