@sentry/junior-google 0.243.0 → 0.245.0
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/README.md +38 -23
- package/dist/config.d.ts +3 -2
- package/dist/credentials.d.ts +31 -0
- package/dist/index.d.ts +3 -3
- package/dist/index.js +433 -106
- package/dist/tools/files.d.ts +76 -0
- package/dist/tools/{list-doc-comments.d.ts → list-file-comments.d.ts} +7 -7
- package/dist/tools/read-doc.d.ts +1 -1
- package/dist/tools/read-sheet.d.ts +145 -0
- package/dist/tools/read-slides.d.ts +144 -0
- package/dist/tools/{search-docs.d.ts → search-files.d.ts} +11 -8
- package/dist/tools/shared.d.ts +2 -1
- package/package.json +2 -2
- package/dist/tools/docs.d.ts +0 -37
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import type { GoogleOperation } from "../credentials";
|
|
3
|
+
import { type GoogleToolContext } from "./shared";
|
|
4
|
+
/** Google file types that the tools read, with their Drive MIME types. */
|
|
5
|
+
declare const FILE_TYPES: {
|
|
6
|
+
readonly document: {
|
|
7
|
+
readonly label: "Google Doc";
|
|
8
|
+
readonly mimeType: "application/vnd.google-apps.document";
|
|
9
|
+
};
|
|
10
|
+
readonly presentation: {
|
|
11
|
+
readonly label: "Google Slides presentation";
|
|
12
|
+
readonly mimeType: "application/vnd.google-apps.presentation";
|
|
13
|
+
};
|
|
14
|
+
readonly spreadsheet: {
|
|
15
|
+
readonly label: "Google Sheet";
|
|
16
|
+
readonly mimeType: "application/vnd.google-apps.spreadsheet";
|
|
17
|
+
};
|
|
18
|
+
};
|
|
19
|
+
export type GoogleFileType = keyof typeof FILE_TYPES;
|
|
20
|
+
export declare const GOOGLE_FILE_TYPES: GoogleFileType[];
|
|
21
|
+
/** Return the Drive MIME type of one file type. */
|
|
22
|
+
export declare function googleFileMimeType(type: GoogleFileType): string;
|
|
23
|
+
/** Return the file type of a Drive MIME type, when the tools read it. */
|
|
24
|
+
export declare function googleFileType(mimeType: string): GoogleFileType | undefined;
|
|
25
|
+
/** File id or link input for the tools that use one file. */
|
|
26
|
+
export declare function fileReferenceSchema(name: string): z.ZodString;
|
|
27
|
+
/** One Drive file, and the resource key that a link-shared file can need. */
|
|
28
|
+
export interface FileReference {
|
|
29
|
+
fileId: string;
|
|
30
|
+
resourceKey?: string;
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* Return the file id and resource key from a file id or link.
|
|
34
|
+
*
|
|
35
|
+
* Links look like `docs.google.com/document/d/<id>/edit`,
|
|
36
|
+
* `docs.google.com/spreadsheets/d/<id>/edit`,
|
|
37
|
+
* `docs.google.com/presentation/d/<id>/edit`,
|
|
38
|
+
* `drive.google.com/file/d/<id>/view`, or `drive.google.com/open?id=<id>`.
|
|
39
|
+
* Older files shared by link also need the link's `resourcekey` value.
|
|
40
|
+
*/
|
|
41
|
+
export declare function parseFileReference(value: string): FileReference;
|
|
42
|
+
/** Call one Google operation on a file, with its resource key when known. */
|
|
43
|
+
export declare function googleFileRequest(ctx: GoogleToolContext, file: FileReference, input: {
|
|
44
|
+
headers?: Record<string, string>;
|
|
45
|
+
operation: GoogleOperation;
|
|
46
|
+
path: string;
|
|
47
|
+
query?: Record<string, string | string[]>;
|
|
48
|
+
}): Promise<{
|
|
49
|
+
body: unknown;
|
|
50
|
+
status: number;
|
|
51
|
+
}>;
|
|
52
|
+
/**
|
|
53
|
+
* Read the Drive metadata of one file, and require one of the given types.
|
|
54
|
+
*
|
|
55
|
+
* `drive.readonly` can read any Drive file, so each tool checks the type
|
|
56
|
+
* before it reads content or comments.
|
|
57
|
+
*/
|
|
58
|
+
export declare function readGoogleFile(ctx: GoogleToolContext, file: FileReference, types: readonly GoogleFileType[]): Promise<{
|
|
59
|
+
type: "document" | "presentation" | "spreadsheet";
|
|
60
|
+
id: string;
|
|
61
|
+
mimeType: string;
|
|
62
|
+
name: string;
|
|
63
|
+
modifiedTime?: string | undefined;
|
|
64
|
+
webViewLink?: string | undefined;
|
|
65
|
+
}>;
|
|
66
|
+
/** Optional output fields shared by the tools that read one file. */
|
|
67
|
+
export declare function fileOutputFields(file: {
|
|
68
|
+
modifiedTime?: string;
|
|
69
|
+
webViewLink?: string;
|
|
70
|
+
}): {
|
|
71
|
+
url?: string | undefined;
|
|
72
|
+
modifiedTime?: string | undefined;
|
|
73
|
+
};
|
|
74
|
+
/** Longest file text that one tool result returns. */
|
|
75
|
+
export declare const MAX_CONTENT_CHARS = 100000;
|
|
76
|
+
export {};
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import type { GoogleToolContext } from "./shared";
|
|
2
|
-
/** List the comments and replies on one Google Doc. */
|
|
3
|
-
export declare function
|
|
4
|
-
|
|
2
|
+
/** List the comments and replies on one Google Doc, Sheet, or Slides file. */
|
|
3
|
+
export declare function createListGoogleFileCommentsTool(ctx: GoogleToolContext): import("@sentry/junior-plugin-api").PluginToolDefinition<{
|
|
4
|
+
file: string;
|
|
5
5
|
pageToken?: string | undefined;
|
|
6
6
|
}, {
|
|
7
7
|
[x: string]: unknown;
|
|
8
|
-
target: "
|
|
8
|
+
target: "listGoogleFileComments";
|
|
9
9
|
comments: {
|
|
10
10
|
commentId: string;
|
|
11
11
|
content: string;
|
|
@@ -20,7 +20,7 @@ export declare function createListGoogleDocCommentsTool(ctx: GoogleToolContext):
|
|
|
20
20
|
createdTime?: string | undefined;
|
|
21
21
|
quotedText?: string | undefined;
|
|
22
22
|
}[];
|
|
23
|
-
|
|
23
|
+
fileId: string;
|
|
24
24
|
objectAnnotations?: {
|
|
25
25
|
kind: "object";
|
|
26
26
|
key: string;
|
|
@@ -78,7 +78,7 @@ export declare function createListGoogleDocCommentsTool(ctx: GoogleToolContext):
|
|
|
78
78
|
nextPageToken?: string | undefined;
|
|
79
79
|
}, {
|
|
80
80
|
[x: string]: unknown;
|
|
81
|
-
target: "
|
|
81
|
+
target: "listGoogleFileComments";
|
|
82
82
|
comments: {
|
|
83
83
|
commentId: string;
|
|
84
84
|
content: string;
|
|
@@ -93,7 +93,7 @@ export declare function createListGoogleDocCommentsTool(ctx: GoogleToolContext):
|
|
|
93
93
|
createdTime?: string | undefined;
|
|
94
94
|
quotedText?: string | undefined;
|
|
95
95
|
}[];
|
|
96
|
-
|
|
96
|
+
fileId: string;
|
|
97
97
|
objectAnnotations?: {
|
|
98
98
|
kind: "object";
|
|
99
99
|
key: string;
|
package/dist/tools/read-doc.d.ts
CHANGED
|
@@ -3,7 +3,7 @@ import type { GoogleToolContext } from "./shared";
|
|
|
3
3
|
* Read one Google Doc as Markdown.
|
|
4
4
|
*
|
|
5
5
|
* Drive exports the Doc, so this needs no Docs API. Comments are not in the
|
|
6
|
-
* export; `
|
|
6
|
+
* export; `listGoogleFileComments` reads them.
|
|
7
7
|
*/
|
|
8
8
|
export declare function createReadGoogleDocTool(ctx: GoogleToolContext): import("@sentry/junior-plugin-api").PluginToolDefinition<{
|
|
9
9
|
document: string;
|
|
@@ -0,0 +1,145 @@
|
|
|
1
|
+
import type { GoogleToolContext } from "./shared";
|
|
2
|
+
/**
|
|
3
|
+
* Read the cells of one Google Sheet as CSV, one entry per range.
|
|
4
|
+
*
|
|
5
|
+
* A Drive CSV export has only the first tab, so this uses the Sheets API. It
|
|
6
|
+
* accepts the same `drive.readonly` scope as the Drive tools.
|
|
7
|
+
*/
|
|
8
|
+
export declare function createReadGoogleSheetTool(ctx: GoogleToolContext): import("@sentry/junior-plugin-api").PluginToolDefinition<{
|
|
9
|
+
spreadsheet: string;
|
|
10
|
+
range?: string | undefined;
|
|
11
|
+
}, {
|
|
12
|
+
[x: string]: unknown;
|
|
13
|
+
target: "readGoogleSheet";
|
|
14
|
+
ranges: {
|
|
15
|
+
content: string;
|
|
16
|
+
range: string;
|
|
17
|
+
truncated: boolean;
|
|
18
|
+
}[];
|
|
19
|
+
spreadsheetId: string;
|
|
20
|
+
tabs: string[];
|
|
21
|
+
title: string;
|
|
22
|
+
truncated: boolean;
|
|
23
|
+
objectAnnotations?: {
|
|
24
|
+
kind: "object";
|
|
25
|
+
key: string;
|
|
26
|
+
label: string;
|
|
27
|
+
objectType: "code_change" | "task" | "deployment" | "calendar_event" | "automation" | "item";
|
|
28
|
+
title: string;
|
|
29
|
+
url: string | null;
|
|
30
|
+
description?: string | undefined;
|
|
31
|
+
status?: string | undefined;
|
|
32
|
+
trigger?: string | undefined;
|
|
33
|
+
warning?: string | undefined;
|
|
34
|
+
displayType?: string | undefined;
|
|
35
|
+
sourceUpdatedAt?: string | undefined;
|
|
36
|
+
facts?: {
|
|
37
|
+
type: "code_change";
|
|
38
|
+
author?: string | undefined;
|
|
39
|
+
sourceBranch?: string | undefined;
|
|
40
|
+
targetBranch?: string | undefined;
|
|
41
|
+
reviewers?: string[] | undefined;
|
|
42
|
+
review?: "required" | "approved" | "changes_requested" | undefined;
|
|
43
|
+
checks?: {
|
|
44
|
+
passed: number;
|
|
45
|
+
failed: number;
|
|
46
|
+
pending: number;
|
|
47
|
+
} | undefined;
|
|
48
|
+
mergeable?: boolean | undefined;
|
|
49
|
+
changedFiles?: number | undefined;
|
|
50
|
+
additions?: number | undefined;
|
|
51
|
+
deletions?: number | undefined;
|
|
52
|
+
} | {
|
|
53
|
+
type: "task";
|
|
54
|
+
assignees?: string[] | undefined;
|
|
55
|
+
priority?: string | undefined;
|
|
56
|
+
project?: string | undefined;
|
|
57
|
+
cycle?: string | undefined;
|
|
58
|
+
dueDate?: string | undefined;
|
|
59
|
+
labels?: string[] | undefined;
|
|
60
|
+
} | {
|
|
61
|
+
type: "deployment";
|
|
62
|
+
project?: string | undefined;
|
|
63
|
+
environment?: string | undefined;
|
|
64
|
+
revision?: string | undefined;
|
|
65
|
+
branch?: string | undefined;
|
|
66
|
+
} | {
|
|
67
|
+
type: "calendar_event";
|
|
68
|
+
when?: string | undefined;
|
|
69
|
+
attendees?: string[] | undefined;
|
|
70
|
+
} | undefined;
|
|
71
|
+
}[] | undefined;
|
|
72
|
+
continuation?: {
|
|
73
|
+
arguments: Record<string, unknown>;
|
|
74
|
+
reason?: string | undefined;
|
|
75
|
+
} | undefined;
|
|
76
|
+
modifiedTime?: string | undefined;
|
|
77
|
+
url?: string | undefined;
|
|
78
|
+
}, {
|
|
79
|
+
[x: string]: unknown;
|
|
80
|
+
target: "readGoogleSheet";
|
|
81
|
+
ranges: {
|
|
82
|
+
content: string;
|
|
83
|
+
range: string;
|
|
84
|
+
truncated: boolean;
|
|
85
|
+
}[];
|
|
86
|
+
spreadsheetId: string;
|
|
87
|
+
tabs: string[];
|
|
88
|
+
title: string;
|
|
89
|
+
truncated: boolean;
|
|
90
|
+
objectAnnotations?: {
|
|
91
|
+
kind: "object";
|
|
92
|
+
key: string;
|
|
93
|
+
label: string;
|
|
94
|
+
objectType: "code_change" | "task" | "deployment" | "calendar_event" | "automation" | "item";
|
|
95
|
+
title: string;
|
|
96
|
+
url: string | null;
|
|
97
|
+
description?: string | undefined;
|
|
98
|
+
status?: string | undefined;
|
|
99
|
+
trigger?: string | undefined;
|
|
100
|
+
warning?: string | undefined;
|
|
101
|
+
displayType?: string | undefined;
|
|
102
|
+
sourceUpdatedAt?: string | undefined;
|
|
103
|
+
facts?: {
|
|
104
|
+
type: "code_change";
|
|
105
|
+
author?: string | undefined;
|
|
106
|
+
sourceBranch?: string | undefined;
|
|
107
|
+
targetBranch?: string | undefined;
|
|
108
|
+
reviewers?: string[] | undefined;
|
|
109
|
+
review?: "required" | "approved" | "changes_requested" | undefined;
|
|
110
|
+
checks?: {
|
|
111
|
+
passed: number;
|
|
112
|
+
failed: number;
|
|
113
|
+
pending: number;
|
|
114
|
+
} | undefined;
|
|
115
|
+
mergeable?: boolean | undefined;
|
|
116
|
+
changedFiles?: number | undefined;
|
|
117
|
+
additions?: number | undefined;
|
|
118
|
+
deletions?: number | undefined;
|
|
119
|
+
} | {
|
|
120
|
+
type: "task";
|
|
121
|
+
assignees?: string[] | undefined;
|
|
122
|
+
priority?: string | undefined;
|
|
123
|
+
project?: string | undefined;
|
|
124
|
+
cycle?: string | undefined;
|
|
125
|
+
dueDate?: string | undefined;
|
|
126
|
+
labels?: string[] | undefined;
|
|
127
|
+
} | {
|
|
128
|
+
type: "deployment";
|
|
129
|
+
project?: string | undefined;
|
|
130
|
+
environment?: string | undefined;
|
|
131
|
+
revision?: string | undefined;
|
|
132
|
+
branch?: string | undefined;
|
|
133
|
+
} | {
|
|
134
|
+
type: "calendar_event";
|
|
135
|
+
when?: string | undefined;
|
|
136
|
+
attendees?: string[] | undefined;
|
|
137
|
+
} | undefined;
|
|
138
|
+
}[] | undefined;
|
|
139
|
+
continuation?: {
|
|
140
|
+
arguments: Record<string, unknown>;
|
|
141
|
+
reason?: string | undefined;
|
|
142
|
+
} | undefined;
|
|
143
|
+
modifiedTime?: string | undefined;
|
|
144
|
+
url?: string | undefined;
|
|
145
|
+
}>;
|
|
@@ -0,0 +1,144 @@
|
|
|
1
|
+
import type { GoogleToolContext } from "./shared";
|
|
2
|
+
/**
|
|
3
|
+
* Read the text and speaker notes of each slide in one Google Slides file.
|
|
4
|
+
*
|
|
5
|
+
* This uses the Slides API to keep slide numbers and speaker notes. It
|
|
6
|
+
* accepts the same `drive.readonly` scope as the Drive tools.
|
|
7
|
+
*/
|
|
8
|
+
export declare function createReadGoogleSlidesTool(ctx: GoogleToolContext): import("@sentry/junior-plugin-api").PluginToolDefinition<{
|
|
9
|
+
presentation: string;
|
|
10
|
+
}, {
|
|
11
|
+
[x: string]: unknown;
|
|
12
|
+
target: "readGoogleSlides";
|
|
13
|
+
presentationId: string;
|
|
14
|
+
slideCount: number;
|
|
15
|
+
slides: {
|
|
16
|
+
slideNumber: number;
|
|
17
|
+
text: string;
|
|
18
|
+
notes?: string | undefined;
|
|
19
|
+
}[];
|
|
20
|
+
title: string;
|
|
21
|
+
truncated: boolean;
|
|
22
|
+
objectAnnotations?: {
|
|
23
|
+
kind: "object";
|
|
24
|
+
key: string;
|
|
25
|
+
label: string;
|
|
26
|
+
objectType: "code_change" | "task" | "deployment" | "calendar_event" | "automation" | "item";
|
|
27
|
+
title: string;
|
|
28
|
+
url: string | null;
|
|
29
|
+
description?: string | undefined;
|
|
30
|
+
status?: string | undefined;
|
|
31
|
+
trigger?: string | undefined;
|
|
32
|
+
warning?: string | undefined;
|
|
33
|
+
displayType?: string | undefined;
|
|
34
|
+
sourceUpdatedAt?: string | undefined;
|
|
35
|
+
facts?: {
|
|
36
|
+
type: "code_change";
|
|
37
|
+
author?: string | undefined;
|
|
38
|
+
sourceBranch?: string | undefined;
|
|
39
|
+
targetBranch?: string | undefined;
|
|
40
|
+
reviewers?: string[] | undefined;
|
|
41
|
+
review?: "required" | "approved" | "changes_requested" | undefined;
|
|
42
|
+
checks?: {
|
|
43
|
+
passed: number;
|
|
44
|
+
failed: number;
|
|
45
|
+
pending: number;
|
|
46
|
+
} | undefined;
|
|
47
|
+
mergeable?: boolean | undefined;
|
|
48
|
+
changedFiles?: number | undefined;
|
|
49
|
+
additions?: number | undefined;
|
|
50
|
+
deletions?: number | undefined;
|
|
51
|
+
} | {
|
|
52
|
+
type: "task";
|
|
53
|
+
assignees?: string[] | undefined;
|
|
54
|
+
priority?: string | undefined;
|
|
55
|
+
project?: string | undefined;
|
|
56
|
+
cycle?: string | undefined;
|
|
57
|
+
dueDate?: string | undefined;
|
|
58
|
+
labels?: string[] | undefined;
|
|
59
|
+
} | {
|
|
60
|
+
type: "deployment";
|
|
61
|
+
project?: string | undefined;
|
|
62
|
+
environment?: string | undefined;
|
|
63
|
+
revision?: string | undefined;
|
|
64
|
+
branch?: string | undefined;
|
|
65
|
+
} | {
|
|
66
|
+
type: "calendar_event";
|
|
67
|
+
when?: string | undefined;
|
|
68
|
+
attendees?: string[] | undefined;
|
|
69
|
+
} | undefined;
|
|
70
|
+
}[] | undefined;
|
|
71
|
+
continuation?: {
|
|
72
|
+
arguments: Record<string, unknown>;
|
|
73
|
+
reason?: string | undefined;
|
|
74
|
+
} | undefined;
|
|
75
|
+
modifiedTime?: string | undefined;
|
|
76
|
+
url?: string | undefined;
|
|
77
|
+
}, {
|
|
78
|
+
[x: string]: unknown;
|
|
79
|
+
target: "readGoogleSlides";
|
|
80
|
+
presentationId: string;
|
|
81
|
+
slideCount: number;
|
|
82
|
+
slides: {
|
|
83
|
+
slideNumber: number;
|
|
84
|
+
text: string;
|
|
85
|
+
notes?: string | undefined;
|
|
86
|
+
}[];
|
|
87
|
+
title: string;
|
|
88
|
+
truncated: boolean;
|
|
89
|
+
objectAnnotations?: {
|
|
90
|
+
kind: "object";
|
|
91
|
+
key: string;
|
|
92
|
+
label: string;
|
|
93
|
+
objectType: "code_change" | "task" | "deployment" | "calendar_event" | "automation" | "item";
|
|
94
|
+
title: string;
|
|
95
|
+
url: string | null;
|
|
96
|
+
description?: string | undefined;
|
|
97
|
+
status?: string | undefined;
|
|
98
|
+
trigger?: string | undefined;
|
|
99
|
+
warning?: string | undefined;
|
|
100
|
+
displayType?: string | undefined;
|
|
101
|
+
sourceUpdatedAt?: string | undefined;
|
|
102
|
+
facts?: {
|
|
103
|
+
type: "code_change";
|
|
104
|
+
author?: string | undefined;
|
|
105
|
+
sourceBranch?: string | undefined;
|
|
106
|
+
targetBranch?: string | undefined;
|
|
107
|
+
reviewers?: string[] | undefined;
|
|
108
|
+
review?: "required" | "approved" | "changes_requested" | undefined;
|
|
109
|
+
checks?: {
|
|
110
|
+
passed: number;
|
|
111
|
+
failed: number;
|
|
112
|
+
pending: number;
|
|
113
|
+
} | undefined;
|
|
114
|
+
mergeable?: boolean | undefined;
|
|
115
|
+
changedFiles?: number | undefined;
|
|
116
|
+
additions?: number | undefined;
|
|
117
|
+
deletions?: number | undefined;
|
|
118
|
+
} | {
|
|
119
|
+
type: "task";
|
|
120
|
+
assignees?: string[] | undefined;
|
|
121
|
+
priority?: string | undefined;
|
|
122
|
+
project?: string | undefined;
|
|
123
|
+
cycle?: string | undefined;
|
|
124
|
+
dueDate?: string | undefined;
|
|
125
|
+
labels?: string[] | undefined;
|
|
126
|
+
} | {
|
|
127
|
+
type: "deployment";
|
|
128
|
+
project?: string | undefined;
|
|
129
|
+
environment?: string | undefined;
|
|
130
|
+
revision?: string | undefined;
|
|
131
|
+
branch?: string | undefined;
|
|
132
|
+
} | {
|
|
133
|
+
type: "calendar_event";
|
|
134
|
+
when?: string | undefined;
|
|
135
|
+
attendees?: string[] | undefined;
|
|
136
|
+
} | undefined;
|
|
137
|
+
}[] | undefined;
|
|
138
|
+
continuation?: {
|
|
139
|
+
arguments: Record<string, unknown>;
|
|
140
|
+
reason?: string | undefined;
|
|
141
|
+
} | undefined;
|
|
142
|
+
modifiedTime?: string | undefined;
|
|
143
|
+
url?: string | undefined;
|
|
144
|
+
}>;
|
|
@@ -1,14 +1,16 @@
|
|
|
1
1
|
import { type GoogleToolContext } from "./shared";
|
|
2
|
-
/** Find
|
|
3
|
-
export declare function
|
|
2
|
+
/** Find Docs, Sheets, and Slides that Junior's account can open. */
|
|
3
|
+
export declare function createSearchGoogleFilesTool(ctx: GoogleToolContext): import("@sentry/junior-plugin-api").PluginToolDefinition<{
|
|
4
4
|
query: string;
|
|
5
5
|
maxResults: number;
|
|
6
|
+
types?: ("document" | "presentation" | "spreadsheet")[] | undefined;
|
|
6
7
|
}, {
|
|
7
8
|
[x: string]: unknown;
|
|
8
|
-
target: "
|
|
9
|
-
|
|
10
|
-
|
|
9
|
+
target: "searchGoogleFiles";
|
|
10
|
+
files: {
|
|
11
|
+
fileId: string;
|
|
11
12
|
title: string;
|
|
13
|
+
type: "document" | "presentation" | "spreadsheet";
|
|
12
14
|
modifiedTime?: string | undefined;
|
|
13
15
|
url?: string | undefined;
|
|
14
16
|
}[];
|
|
@@ -68,10 +70,11 @@ export declare function createSearchGoogleDocsTool(ctx: GoogleToolContext): impo
|
|
|
68
70
|
} | undefined;
|
|
69
71
|
}, {
|
|
70
72
|
[x: string]: unknown;
|
|
71
|
-
target: "
|
|
72
|
-
|
|
73
|
-
|
|
73
|
+
target: "searchGoogleFiles";
|
|
74
|
+
files: {
|
|
75
|
+
fileId: string;
|
|
74
76
|
title: string;
|
|
77
|
+
type: "document" | "presentation" | "spreadsheet";
|
|
75
78
|
modifiedTime?: string | undefined;
|
|
76
79
|
url?: string | undefined;
|
|
77
80
|
}[];
|
package/dist/tools/shared.d.ts
CHANGED
|
@@ -38,7 +38,8 @@ export declare function googleApiRequest(ctx: GoogleToolContext, input: {
|
|
|
38
38
|
headers?: Record<string, string>;
|
|
39
39
|
operation: GoogleOperation;
|
|
40
40
|
path: string;
|
|
41
|
-
|
|
41
|
+
/** A list value repeats the parameter, as Sheets `ranges` needs. */
|
|
42
|
+
query?: Record<string, string | string[]>;
|
|
42
43
|
}): Promise<{
|
|
43
44
|
body: unknown;
|
|
44
45
|
status: number;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sentry/junior-google",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.245.0",
|
|
4
4
|
"private": false,
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
"commander": "^14.0.3",
|
|
26
26
|
"drizzle-orm": "^0.45.2",
|
|
27
27
|
"zod": "^4.5.4",
|
|
28
|
-
"@sentry/junior-plugin-api": "0.
|
|
28
|
+
"@sentry/junior-plugin-api": "0.245.0"
|
|
29
29
|
},
|
|
30
30
|
"devDependencies": {
|
|
31
31
|
"@oxlint/plugins": "1.79.0",
|
package/dist/tools/docs.d.ts
DELETED
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
import { z } from "zod";
|
|
2
|
-
import type { GoogleOperation } from "../credentials";
|
|
3
|
-
import { type GoogleToolContext } from "./shared";
|
|
4
|
-
export declare const GOOGLE_DOC_MIME_TYPE = "application/vnd.google-apps.document";
|
|
5
|
-
/** Doc id or link input for the tools that read one Doc. */
|
|
6
|
-
export declare const docReferenceSchema: z.ZodString;
|
|
7
|
-
/** One Drive file, and the resource key that a link-shared file can need. */
|
|
8
|
-
export interface DocReference {
|
|
9
|
-
fileId: string;
|
|
10
|
-
resourceKey?: string;
|
|
11
|
-
}
|
|
12
|
-
/**
|
|
13
|
-
* Return the file id and resource key from a Doc id or link.
|
|
14
|
-
*
|
|
15
|
-
* Links look like `docs.google.com/document/d/<id>/edit`,
|
|
16
|
-
* `drive.google.com/file/d/<id>/view`, or `drive.google.com/open?id=<id>`.
|
|
17
|
-
* Older Docs shared by link also need the link's `resourcekey` value.
|
|
18
|
-
*/
|
|
19
|
-
export declare function parseDocReference(value: string): DocReference;
|
|
20
|
-
/** Call one Drive operation on a file, with its resource key when known. */
|
|
21
|
-
export declare function driveFileRequest(ctx: GoogleToolContext, doc: DocReference, input: {
|
|
22
|
-
headers?: Record<string, string>;
|
|
23
|
-
operation: GoogleOperation;
|
|
24
|
-
path: string;
|
|
25
|
-
query?: Record<string, string>;
|
|
26
|
-
}): Promise<{
|
|
27
|
-
body: unknown;
|
|
28
|
-
status: number;
|
|
29
|
-
}>;
|
|
30
|
-
/** Read the Drive metadata of one file, and require it to be a Google Doc. */
|
|
31
|
-
export declare function readDocFile(ctx: GoogleToolContext, doc: DocReference): Promise<{
|
|
32
|
-
id: string;
|
|
33
|
-
mimeType: string;
|
|
34
|
-
name: string;
|
|
35
|
-
modifiedTime?: string | undefined;
|
|
36
|
-
webViewLink?: string | undefined;
|
|
37
|
-
}>;
|