Skip to content

Commit 79352e2

Browse files
committed
removed google vault from executor
1 parent f46f997 commit 79352e2

File tree

12 files changed

+94
-260
lines changed

12 files changed

+94
-260
lines changed

apps/sim/executor/handlers/google-vault/google-vault-handler.ts

Lines changed: 0 additions & 198 deletions
This file was deleted.

apps/sim/executor/handlers/index.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ import { ConditionBlockHandler } from '@/executor/handlers/condition/condition-h
44
import { EvaluatorBlockHandler } from '@/executor/handlers/evaluator/evaluator-handler'
55
import { FunctionBlockHandler } from '@/executor/handlers/function/function-handler'
66
import { GenericBlockHandler } from '@/executor/handlers/generic/generic-handler'
7-
import { GoogleVaultBlockHandler } from '@/executor/handlers/google-vault/google-vault-handler'
87
import { HumanInTheLoopBlockHandler } from '@/executor/handlers/human-in-the-loop/human-in-the-loop-handler'
98
import { ResponseBlockHandler } from '@/executor/handlers/response/response-handler'
109
import { RouterBlockHandler } from '@/executor/handlers/router/router-handler'
@@ -20,7 +19,6 @@ export {
2019
EvaluatorBlockHandler,
2120
FunctionBlockHandler,
2221
GenericBlockHandler,
23-
GoogleVaultBlockHandler,
2422
ResponseBlockHandler,
2523
HumanInTheLoopBlockHandler,
2624
RouterBlockHandler,

apps/sim/executor/handlers/registry.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ import { ConditionBlockHandler } from '@/executor/handlers/condition/condition-h
1111
import { EvaluatorBlockHandler } from '@/executor/handlers/evaluator/evaluator-handler'
1212
import { FunctionBlockHandler } from '@/executor/handlers/function/function-handler'
1313
import { GenericBlockHandler } from '@/executor/handlers/generic/generic-handler'
14-
import { GoogleVaultBlockHandler } from '@/executor/handlers/google-vault/google-vault-handler'
1514
import { HumanInTheLoopBlockHandler } from '@/executor/handlers/human-in-the-loop/human-in-the-loop-handler'
1615
import { ResponseBlockHandler } from '@/executor/handlers/response/response-handler'
1716
import { RouterBlockHandler } from '@/executor/handlers/router/router-handler'
@@ -41,7 +40,6 @@ export function createBlockHandlers(): BlockHandler[] {
4140
new WorkflowBlockHandler(),
4241
new WaitBlockHandler(),
4342
new EvaluatorBlockHandler(),
44-
new GoogleVaultBlockHandler(),
4543
new GenericBlockHandler(),
4644
]
4745
}

apps/sim/tools/google_vault/create_matters.ts

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,7 @@
1+
import type { GoogleVaultCreateMattersParams } from '@/tools/google_vault/types'
2+
import { enhanceGoogleVaultError } from '@/tools/google_vault/utils'
13
import type { ToolConfig } from '@/tools/types'
24

3-
export interface GoogleVaultCreateMattersParams {
4-
accessToken: string
5-
name: string
6-
description?: string
7-
}
8-
9-
// matters.create
10-
// POST https://vault.googleapis.com/v1/matters
115
export const createMattersTool: ToolConfig<GoogleVaultCreateMattersParams> = {
126
id: 'create_matters',
137
name: 'Vault Create Matter',
@@ -38,7 +32,8 @@ export const createMattersTool: ToolConfig<GoogleVaultCreateMattersParams> = {
3832
transformResponse: async (response: Response) => {
3933
const data = await response.json()
4034
if (!response.ok) {
41-
throw new Error(data.error?.message || 'Failed to create matter')
35+
const errorMessage = data.error?.message || 'Failed to create matter'
36+
throw new Error(enhanceGoogleVaultError(errorMessage))
4237
}
4338
return { success: true, output: { matter: data } }
4439
},

apps/sim/tools/google_vault/create_matters_export.ts

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
import type { GoogleVaultCreateMattersExportParams } from '@/tools/google_vault/types'
2+
import { enhanceGoogleVaultError } from '@/tools/google_vault/utils'
23
import type { ToolConfig } from '@/tools/types'
34

4-
// matters.exports.create
5-
// POST https://vault.googleapis.com/v1/matters/{matterId}/exports
65
export const createMattersExportTool: ToolConfig<GoogleVaultCreateMattersExportParams> = {
76
id: 'create_matters_export',
87
name: 'Vault Create Export (by Matter)',
@@ -64,7 +63,6 @@ export const createMattersExportTool: ToolConfig<GoogleVaultCreateMattersExportP
6463
'Content-Type': 'application/json',
6564
}),
6665
body: (params) => {
67-
// Handle accountEmails - can be string (comma-separated) or array
6866
let emails: string[] = []
6967
if (params.accountEmails) {
7068
if (Array.isArray(params.accountEmails)) {
@@ -106,7 +104,8 @@ export const createMattersExportTool: ToolConfig<GoogleVaultCreateMattersExportP
106104
transformResponse: async (response: Response) => {
107105
const data = await response.json()
108106
if (!response.ok) {
109-
throw new Error(data.error?.message || 'Failed to create export')
107+
const errorMessage = data.error?.message || 'Failed to create export'
108+
throw new Error(enhanceGoogleVaultError(errorMessage))
110109
}
111110
return { success: true, output: { export: data } }
112111
},

apps/sim/tools/google_vault/create_matters_holds.ts

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
import type { GoogleVaultCreateMattersHoldsParams } from '@/tools/google_vault/types'
2+
import { enhanceGoogleVaultError } from '@/tools/google_vault/utils'
23
import type { ToolConfig } from '@/tools/types'
34

4-
// matters.holds.create
5-
// POST https://vault.googleapis.com/v1/matters/{matterId}/holds
65
export const createMattersHoldsTool: ToolConfig<GoogleVaultCreateMattersHoldsParams> = {
76
id: 'create_matters_holds',
87
name: 'Vault Create Hold (by Matter)',
@@ -36,7 +35,6 @@ export const createMattersHoldsTool: ToolConfig<GoogleVaultCreateMattersHoldsPar
3635
visibility: 'user-only',
3736
description: 'Organization unit ID to put on hold (alternative to accounts)',
3837
},
39-
// Query parameters for MAIL and GROUPS corpus (date filtering)
4038
terms: {
4139
type: 'string',
4240
required: false,
@@ -55,7 +53,6 @@ export const createMattersHoldsTool: ToolConfig<GoogleVaultCreateMattersHoldsPar
5553
visibility: 'user-only',
5654
description: 'End time for date filtering (ISO 8601 format, for MAIL and GROUPS corpus)',
5755
},
58-
// Drive-specific option
5956
includeSharedDrives: {
6057
type: 'boolean',
6158
required: false,
@@ -72,13 +69,11 @@ export const createMattersHoldsTool: ToolConfig<GoogleVaultCreateMattersHoldsPar
7269
'Content-Type': 'application/json',
7370
}),
7471
body: (params) => {
75-
// Build Hold body. One of accounts or orgUnit must be provided.
7672
const body: any = {
7773
name: params.holdName,
7874
corpus: params.corpus,
7975
}
8076

81-
// Handle accountEmails - can be string (comma-separated) or array
8277
let emails: string[] = []
8378
if (params.accountEmails) {
8479
if (Array.isArray(params.accountEmails)) {
@@ -92,13 +87,11 @@ export const createMattersHoldsTool: ToolConfig<GoogleVaultCreateMattersHoldsPar
9287
}
9388

9489
if (emails.length > 0) {
95-
// Google Vault expects HeldAccount objects with 'email' or 'accountId'. Use 'email' here.
9690
body.accounts = emails.map((email: string) => ({ email }))
9791
} else if (params.orgUnitId) {
9892
body.orgUnit = { orgUnitId: params.orgUnitId }
9993
}
10094

101-
// Build corpus-specific query for date filtering
10295
if (params.corpus === 'MAIL' || params.corpus === 'GROUPS') {
10396
const hasQueryParams = params.terms || params.startTime || params.endTime
10497
if (hasQueryParams) {
@@ -124,7 +117,8 @@ export const createMattersHoldsTool: ToolConfig<GoogleVaultCreateMattersHoldsPar
124117
transformResponse: async (response: Response) => {
125118
const data = await response.json()
126119
if (!response.ok) {
127-
throw new Error(data.error?.message || 'Failed to create hold')
120+
const errorMessage = data.error?.message || 'Failed to create hold'
121+
throw new Error(enhanceGoogleVaultError(errorMessage))
128122
}
129123
return { success: true, output: { hold: data } }
130124
},

0 commit comments

Comments
 (0)