@nuvlore/extension-access-bitbucket 0.1.1 → 0.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +4 -19
- package/vendor/extension-sso/LICENSE +0 -202
- package/vendor/extension-sso/README.md +0 -35
- package/vendor/extension-sso/commands/okta-login.md +0 -10
- package/vendor/extension-sso/package.json +0 -51
- package/vendor/extension-sso/skills/workday-okta-auth/SKILL.md +0 -20
- package/vendor/extension-sso/src/autoAuth.mjs +0 -25
- package/vendor/extension-sso/src/browserLogin.mjs +0 -1
- package/vendor/extension-sso/src/chromeCookies.mjs +0 -1
- package/vendor/extension-sso/src/cookieJar.mjs +0 -1
- package/vendor/extension-sso/src/extensionAccess.mjs +0 -173
- package/vendor/extension-sso/src/htmlSessionExtract.mjs +0 -1
- package/vendor/extension-sso/src/oktaAppAccess.mjs +0 -133
- package/vendor/extension-sso/src/oktaAppCatalog.mjs +0 -118
- package/vendor/extension-sso/src/oktaAppRead.mjs +0 -119
- package/vendor/extension-sso/src/oktaConfig.mjs +0 -12
- package/vendor/extension-sso/src/oktaSession.mjs +0 -32
- package/vendor/extension-sso/src/serviceOperations.mjs +0 -407
- package/vendor/extension-sso/src/serviceReadSearch.mjs +0 -395
- package/vendor/extension-sso/src/serviceReads.mjs +0 -109
- package/vendor/extension-sso/src/serviceRegistry.mjs +0 -497
- package/vendor/extension-sso/src/sessionAuth.mjs +0 -339
- package/vendor/extension-sso/src/sessionManager.mjs +0 -212
- package/vendor/extension-sso/src/sessionValidate.mjs +0 -74
- package/vendor/extension-sso/src/ssoConfig.mjs +0 -31
- package/vendor/extension-sso/src/ssoHttpRead.mjs +0 -292
- package/vendor/extension-sso/tools/extension-access-tools.shared.mjs +0 -16
- package/vendor/extension-sso/tools/okta-app-tools.shared.mjs +0 -5
- package/vendor/extension-sso/tools/okta-tools.shared.mjs +0 -18
- package/vendor/extension-sso/tools/workday_extension_read.mjs +0 -51
- package/vendor/extension-sso/tools/workday_extension_read_access.mjs +0 -65
- package/vendor/extension-sso/tools/workday_list_extension_access.mjs +0 -39
- package/vendor/extension-sso/tools/workday_list_okta_apps.mjs +0 -18
- package/vendor/extension-sso/tools/workday_list_service_operations.mjs +0 -41
- package/vendor/extension-sso/tools/workday_list_service_read_search_capabilities.mjs +0 -34
- package/vendor/extension-sso/tools/workday_list_services.mjs +0 -31
- package/vendor/extension-sso/tools/workday_okta_app_probe_all.mjs +0 -24
- package/vendor/extension-sso/tools/workday_okta_app_read.mjs +0 -30
- package/vendor/extension-sso/tools/workday_okta_app_read_access.mjs +0 -25
- package/vendor/extension-sso/tools/workday_okta_auth_header.mjs +0 -58
- package/vendor/extension-sso/tools/workday_okta_login.mjs +0 -65
- package/vendor/extension-sso/tools/workday_okta_open_app.mjs +0 -63
- package/vendor/extension-sso/tools/workday_okta_open_service.mjs +0 -63
- package/vendor/extension-sso/tools/workday_okta_status.mjs +0 -35
- package/vendor/extension-sso/tools/workday_service_auth.mjs +0 -65
- package/vendor/extension-sso/tools/workday_service_operation_read.mjs +0 -51
- package/vendor/extension-sso/tools/workday_service_read.mjs +0 -56
- package/vendor/extension-sso/tools/workday_service_search.mjs +0 -62
- package/vendor/extension-sso/tools/workday_sso_cookie_header.mjs +0 -59
- package/vendor/extension-sso/vendor/extension-browser-sso/LICENSE +0 -202
- package/vendor/extension-sso/vendor/extension-browser-sso/README.md +0 -16
- package/vendor/extension-sso/vendor/extension-browser-sso/package.json +0 -47
- package/vendor/extension-sso/vendor/extension-browser-sso/src/autoAuth.mjs +0 -47
- package/vendor/extension-sso/vendor/extension-browser-sso/src/browserHttpRead.mjs +0 -76
- package/vendor/extension-sso/vendor/extension-browser-sso/src/browserLogin.mjs +0 -24
- package/vendor/extension-sso/vendor/extension-browser-sso/src/chromeCookies.mjs +0 -192
- package/vendor/extension-sso/vendor/extension-browser-sso/src/cookieJar.mjs +0 -132
- package/vendor/extension-sso/vendor/extension-browser-sso/src/extensions/toolkit/devops-data-paths.mjs +0 -222
- package/vendor/extension-sso/vendor/extension-browser-sso/src/extensions/toolkit/devops-diagnostics.mjs +0 -440
- package/vendor/extension-sso/vendor/extension-browser-sso/src/extensions/toolkit/enterprise-api-read.mjs +0 -180
- package/vendor/extension-sso/vendor/extension-browser-sso/src/extensions/toolkit/read-only-command-pack.mjs +0 -1
- package/vendor/extension-sso/vendor/extension-browser-sso/src/extensions/toolkit/read-only-plan.mjs +0 -45
- package/vendor/extension-sso/vendor/extension-browser-sso/src/extensions/toolkit/read-only-shell-policy.d.mts +0 -26
- package/vendor/extension-sso/vendor/extension-browser-sso/src/extensions/toolkit/read-only-shell-policy.mjs +0 -170
- package/vendor/extension-sso/vendor/extension-browser-sso/src/htmlSessionExtract.mjs +0 -64
- package/vendor/extension-sso/vendor/extension-read-only-toolkit/LICENSE +0 -202
- package/vendor/extension-sso/vendor/extension-read-only-toolkit/README.md +0 -29
- package/vendor/extension-sso/vendor/extension-read-only-toolkit/package.json +0 -43
- package/vendor/extension-sso/vendor/extension-read-only-toolkit/src/devops-data-paths.mjs +0 -222
- package/vendor/extension-sso/vendor/extension-read-only-toolkit/src/devops-diagnostics.mjs +0 -440
- package/vendor/extension-sso/vendor/extension-read-only-toolkit/src/enterprise-api-read.mjs +0 -180
- package/vendor/extension-sso/vendor/extension-read-only-toolkit/src/read-only-command-pack.mjs +0 -1
- package/vendor/extension-sso/vendor/extension-read-only-toolkit/src/read-only-plan.mjs +0 -45
- package/vendor/extension-sso/vendor/extension-read-only-toolkit/src/read-only-shell-policy.d.mts +0 -26
- package/vendor/extension-sso/vendor/extension-read-only-toolkit/src/read-only-shell-policy.mjs +0 -170
|
@@ -1,407 +0,0 @@
|
|
|
1
|
-
import { ssoReadGet } from "./ssoHttpRead.mjs";
|
|
2
|
-
|
|
3
|
-
const OPERATION_DEFINITIONS = {
|
|
4
|
-
jira: {
|
|
5
|
-
myself: {
|
|
6
|
-
description: "Read current Jira user profile.",
|
|
7
|
-
path: "/rest/api/latest/myself"
|
|
8
|
-
},
|
|
9
|
-
projects: {
|
|
10
|
-
description: "List Jira projects.",
|
|
11
|
-
path: "/rest/api/latest/project"
|
|
12
|
-
},
|
|
13
|
-
issue: {
|
|
14
|
-
description: "Read one Jira issue by key.",
|
|
15
|
-
path: "/rest/api/latest/issue/:issueKey",
|
|
16
|
-
required: ["issueKey"],
|
|
17
|
-
query: ({ fields }) => (fields ? { fields } : {})
|
|
18
|
-
},
|
|
19
|
-
search: {
|
|
20
|
-
description: "Search Jira issues with JQL.",
|
|
21
|
-
path: "/rest/api/latest/search",
|
|
22
|
-
required: ["jql"],
|
|
23
|
-
query: ({ jql, maxResults = 25, fields }) => ({ jql, maxResults, ...(fields ? { fields } : {}) })
|
|
24
|
-
},
|
|
25
|
-
project: {
|
|
26
|
-
description: "Read one Jira project by key.",
|
|
27
|
-
path: "/rest/api/latest/project/:projectKey",
|
|
28
|
-
required: ["projectKey"]
|
|
29
|
-
},
|
|
30
|
-
project_versions: {
|
|
31
|
-
description: "List Jira project versions.",
|
|
32
|
-
path: "/rest/api/latest/project/:projectKey/versions",
|
|
33
|
-
required: ["projectKey"]
|
|
34
|
-
},
|
|
35
|
-
user_assignable_search: {
|
|
36
|
-
description: "Search assignable Jira users for a project or issue.",
|
|
37
|
-
path: "/rest/api/latest/user/assignable/search",
|
|
38
|
-
query: ({ project, issueKey, query = "", maxResults = 25 }) => ({ project, issueKey, query, maxResults })
|
|
39
|
-
}
|
|
40
|
-
},
|
|
41
|
-
bitbucket: {
|
|
42
|
-
projects: {
|
|
43
|
-
description: "List Bitbucket projects.",
|
|
44
|
-
path: "/rest/api/1.0/projects",
|
|
45
|
-
query: ({ limit = 25, start }) => ({ limit, start })
|
|
46
|
-
},
|
|
47
|
-
project: {
|
|
48
|
-
description: "Read one Bitbucket project.",
|
|
49
|
-
path: "/rest/api/1.0/projects/:projectKey",
|
|
50
|
-
required: ["projectKey"]
|
|
51
|
-
},
|
|
52
|
-
pull_requests: {
|
|
53
|
-
description: "List Bitbucket pull requests for a repository.",
|
|
54
|
-
path: "/rest/api/1.0/projects/:projectKey/repos/:repoSlug/pull-requests",
|
|
55
|
-
required: ["projectKey", "repoSlug"],
|
|
56
|
-
query: ({ limit = 25, start, state = "OPEN" }) => ({ limit, start, state })
|
|
57
|
-
},
|
|
58
|
-
repos: {
|
|
59
|
-
description: "List repositories in a Bitbucket project.",
|
|
60
|
-
path: "/rest/api/1.0/projects/:projectKey/repos",
|
|
61
|
-
required: ["projectKey"],
|
|
62
|
-
query: ({ limit = 25, start }) => ({ limit, start })
|
|
63
|
-
},
|
|
64
|
-
repo: {
|
|
65
|
-
description: "Read one Bitbucket repository.",
|
|
66
|
-
path: "/rest/api/1.0/projects/:projectKey/repos/:repoSlug",
|
|
67
|
-
required: ["projectKey", "repoSlug"]
|
|
68
|
-
},
|
|
69
|
-
pull_request: {
|
|
70
|
-
description: "Read one Bitbucket pull request.",
|
|
71
|
-
path: "/rest/api/1.0/projects/:projectKey/repos/:repoSlug/pull-requests/:pullRequestId",
|
|
72
|
-
required: ["projectKey", "repoSlug", "pullRequestId"]
|
|
73
|
-
},
|
|
74
|
-
commits: {
|
|
75
|
-
description: "List Bitbucket commits for a repository.",
|
|
76
|
-
path: "/rest/api/1.0/projects/:projectKey/repos/:repoSlug/commits",
|
|
77
|
-
required: ["projectKey", "repoSlug"],
|
|
78
|
-
query: ({ limit = 25, until, since }) => ({ limit, until, since })
|
|
79
|
-
}
|
|
80
|
-
},
|
|
81
|
-
confluence: {
|
|
82
|
-
user: {
|
|
83
|
-
description: "Read current Confluence user.",
|
|
84
|
-
path: "/rest/api/user/current"
|
|
85
|
-
},
|
|
86
|
-
content: {
|
|
87
|
-
description: "Read Confluence content by id.",
|
|
88
|
-
path: "/rest/api/content/:contentId",
|
|
89
|
-
required: ["contentId"],
|
|
90
|
-
query: ({ expand = "body.storage,version,space" }) => ({ expand })
|
|
91
|
-
},
|
|
92
|
-
search: {
|
|
93
|
-
description: "Search Confluence content with CQL.",
|
|
94
|
-
path: "/rest/api/content/search",
|
|
95
|
-
required: ["cql"],
|
|
96
|
-
query: ({ cql, limit = 25, start, expand }) => ({ cql, limit, start, expand })
|
|
97
|
-
},
|
|
98
|
-
space: {
|
|
99
|
-
description: "Read one Confluence space.",
|
|
100
|
-
path: "/rest/api/space/:spaceKey",
|
|
101
|
-
required: ["spaceKey"],
|
|
102
|
-
query: ({ expand }) => ({ expand })
|
|
103
|
-
},
|
|
104
|
-
space_content: {
|
|
105
|
-
description: "List content in a Confluence space.",
|
|
106
|
-
path: "/rest/api/space/:spaceKey/content",
|
|
107
|
-
required: ["spaceKey"],
|
|
108
|
-
query: ({ limit = 25, start, expand }) => ({ limit, start, expand })
|
|
109
|
-
}
|
|
110
|
-
},
|
|
111
|
-
bamboo: {
|
|
112
|
-
plans: {
|
|
113
|
-
description: "List Bamboo plans.",
|
|
114
|
-
path: "/rest/api/latest/plan",
|
|
115
|
-
query: ({ maxResults = 25 }) => ({ maxResults })
|
|
116
|
-
},
|
|
117
|
-
plan: {
|
|
118
|
-
description: "Read one Bamboo plan.",
|
|
119
|
-
path: "/rest/api/latest/plan/:planKey",
|
|
120
|
-
required: ["planKey"],
|
|
121
|
-
query: ({ expand }) => ({ expand })
|
|
122
|
-
},
|
|
123
|
-
plan_results: {
|
|
124
|
-
description: "List Bamboo results for a plan.",
|
|
125
|
-
path: "/rest/api/latest/result/:planKey",
|
|
126
|
-
required: ["planKey"],
|
|
127
|
-
query: ({ maxResults = 25, startIndex, expand }) => ({ maxResults, startIndex, expand })
|
|
128
|
-
},
|
|
129
|
-
result: {
|
|
130
|
-
description: "Read one Bamboo build result.",
|
|
131
|
-
path: "/rest/api/latest/result/:resultKey",
|
|
132
|
-
required: ["resultKey"],
|
|
133
|
-
query: ({ expand = "stages.stage.results.result.artifacts" }) => ({ expand })
|
|
134
|
-
},
|
|
135
|
-
latest_result: {
|
|
136
|
-
description: "Read latest Bamboo result for a plan.",
|
|
137
|
-
path: "/rest/api/latest/result/:planKey/latest",
|
|
138
|
-
required: ["planKey"],
|
|
139
|
-
query: ({ expand }) => ({ expand })
|
|
140
|
-
}
|
|
141
|
-
},
|
|
142
|
-
github: {
|
|
143
|
-
repo: {
|
|
144
|
-
description: "Read one GitHub Enterprise repository.",
|
|
145
|
-
path: "/api/v3/repos/:owner/:repo",
|
|
146
|
-
required: ["owner", "repo"]
|
|
147
|
-
},
|
|
148
|
-
pull: {
|
|
149
|
-
description: "Read one GitHub Enterprise pull request.",
|
|
150
|
-
path: "/api/v3/repos/:owner/:repo/pulls/:pullNumber",
|
|
151
|
-
required: ["owner", "repo", "pullNumber"]
|
|
152
|
-
},
|
|
153
|
-
issues: {
|
|
154
|
-
description: "List GitHub Enterprise issues for a repository.",
|
|
155
|
-
path: "/api/v3/repos/:owner/:repo/issues",
|
|
156
|
-
required: ["owner", "repo"],
|
|
157
|
-
query: ({ state = "open", per_page = 25 }) => ({ state, per_page })
|
|
158
|
-
},
|
|
159
|
-
commits: {
|
|
160
|
-
description: "List GitHub Enterprise commits for a repository.",
|
|
161
|
-
path: "/api/v3/repos/:owner/:repo/commits",
|
|
162
|
-
required: ["owner", "repo"],
|
|
163
|
-
query: ({ sha, per_page = 25 }) => ({ sha, per_page })
|
|
164
|
-
}
|
|
165
|
-
},
|
|
166
|
-
teamcity: {
|
|
167
|
-
projects: {
|
|
168
|
-
description: "List TeamCity projects.",
|
|
169
|
-
path: "/app/rest/projects"
|
|
170
|
-
},
|
|
171
|
-
project: {
|
|
172
|
-
description: "Read one TeamCity project.",
|
|
173
|
-
path: "/app/rest/projects/id::projectId",
|
|
174
|
-
required: ["projectId"]
|
|
175
|
-
},
|
|
176
|
-
builds: {
|
|
177
|
-
description: "List TeamCity builds by locator.",
|
|
178
|
-
path: "/app/rest/builds",
|
|
179
|
-
query: ({ locator = "count:25" }) => ({ locator })
|
|
180
|
-
},
|
|
181
|
-
build: {
|
|
182
|
-
description: "Read one TeamCity build.",
|
|
183
|
-
path: "/app/rest/builds/id::buildId",
|
|
184
|
-
required: ["buildId"]
|
|
185
|
-
}
|
|
186
|
-
},
|
|
187
|
-
pagerduty: {
|
|
188
|
-
incidents: {
|
|
189
|
-
description: "List PagerDuty incidents.",
|
|
190
|
-
path: "/api/v2/incidents",
|
|
191
|
-
query: ({ statuses, service_ids, since, until, limit = 25 }) => ({ statuses, service_ids, since, until, limit })
|
|
192
|
-
},
|
|
193
|
-
incident: {
|
|
194
|
-
description: "Read one PagerDuty incident.",
|
|
195
|
-
path: "/api/v2/incidents/:incidentId",
|
|
196
|
-
required: ["incidentId"]
|
|
197
|
-
},
|
|
198
|
-
oncalls: {
|
|
199
|
-
description: "List PagerDuty on-calls.",
|
|
200
|
-
path: "/api/v2/oncalls",
|
|
201
|
-
query: ({ schedule_ids, escalation_policy_ids, since, until, limit = 25 }) => ({
|
|
202
|
-
schedule_ids,
|
|
203
|
-
escalation_policy_ids,
|
|
204
|
-
since,
|
|
205
|
-
until,
|
|
206
|
-
limit
|
|
207
|
-
})
|
|
208
|
-
},
|
|
209
|
-
services: {
|
|
210
|
-
description: "List PagerDuty services.",
|
|
211
|
-
path: "/api/v2/services",
|
|
212
|
-
query: ({ query, limit = 25 }) => ({ query, limit })
|
|
213
|
-
}
|
|
214
|
-
},
|
|
215
|
-
repository: {
|
|
216
|
-
artifact: {
|
|
217
|
-
description: "Read Artifactory storage metadata for an artifact path.",
|
|
218
|
-
path: "/artifactory/api/storage/:artifactPath",
|
|
219
|
-
required: ["artifactPath"]
|
|
220
|
-
},
|
|
221
|
-
search_gavc: {
|
|
222
|
-
description: "Search Artifactory by Maven GAVC coordinates.",
|
|
223
|
-
path: "/artifactory/api/search/gavc",
|
|
224
|
-
query: ({ g, a, v, c, repos }) => ({ g, a, v, c, repos })
|
|
225
|
-
},
|
|
226
|
-
system_ping: {
|
|
227
|
-
description: "Read Artifactory system ping.",
|
|
228
|
-
path: "/artifactory/api/system/ping"
|
|
229
|
-
}
|
|
230
|
-
},
|
|
231
|
-
pharos: {
|
|
232
|
-
health: {
|
|
233
|
-
description: "Read Pharos health.",
|
|
234
|
-
path: "/api/health"
|
|
235
|
-
},
|
|
236
|
-
search: {
|
|
237
|
-
description: "Read Pharos API search endpoint.",
|
|
238
|
-
path: "/api/search",
|
|
239
|
-
query: ({ query, limit = 25 }) => ({ query, limit })
|
|
240
|
-
},
|
|
241
|
-
datasources: {
|
|
242
|
-
description: "List Pharos/Grafana datasources.",
|
|
243
|
-
path: "/api/datasources"
|
|
244
|
-
}
|
|
245
|
-
},
|
|
246
|
-
dashboard: {
|
|
247
|
-
discover: {
|
|
248
|
-
description: "Read Solas dashboard discover page.",
|
|
249
|
-
path: "/s/readonly/app/discover"
|
|
250
|
-
},
|
|
251
|
-
path: {
|
|
252
|
-
description: "Read a Solas read-only dashboard path.",
|
|
253
|
-
path: "/s/readonly/:dashboardPath",
|
|
254
|
-
required: ["dashboardPath"]
|
|
255
|
-
}
|
|
256
|
-
},
|
|
257
|
-
"service-hub": {
|
|
258
|
-
current_user: {
|
|
259
|
-
description: "Read current ServiceNow user.",
|
|
260
|
-
path: "/api/now/ui/user/current_user"
|
|
261
|
-
},
|
|
262
|
-
table: {
|
|
263
|
-
description: "Read ServiceNow table records with sysparm_query.",
|
|
264
|
-
path: "/api/now/table/:tableName",
|
|
265
|
-
required: ["tableName", "sysparm_query"],
|
|
266
|
-
query: ({ sysparm_limit = 25, sysparm_fields, sysparm_display_value = "all" }) => ({
|
|
267
|
-
sysparm_limit,
|
|
268
|
-
sysparm_fields,
|
|
269
|
-
sysparm_display_value
|
|
270
|
-
})
|
|
271
|
-
},
|
|
272
|
-
record: {
|
|
273
|
-
description: "Read one ServiceNow record by sys_id.",
|
|
274
|
-
path: "/api/now/table/:tableName/:sysId",
|
|
275
|
-
required: ["tableName", "sysId"],
|
|
276
|
-
query: ({ sysparm_fields, sysparm_display_value = "all" }) => ({ sysparm_fields, sysparm_display_value })
|
|
277
|
-
}
|
|
278
|
-
},
|
|
279
|
-
collibra: {
|
|
280
|
-
assets: {
|
|
281
|
-
description: "Search Collibra assets by name.",
|
|
282
|
-
path: "/rest/2.0/assets",
|
|
283
|
-
query: ({ nameMatchContains, limit = 25, offset = 0, communityId }) => ({
|
|
284
|
-
nameMatchContains,
|
|
285
|
-
limit,
|
|
286
|
-
offset,
|
|
287
|
-
communityId
|
|
288
|
-
})
|
|
289
|
-
},
|
|
290
|
-
asset: {
|
|
291
|
-
description: "Read one Collibra asset.",
|
|
292
|
-
path: "/rest/2.0/assets/:assetId",
|
|
293
|
-
required: ["assetId"]
|
|
294
|
-
},
|
|
295
|
-
communities: {
|
|
296
|
-
description: "List Collibra communities.",
|
|
297
|
-
path: "/rest/2.0/communities",
|
|
298
|
-
query: ({ limit = 25, offset = 0 }) => ({ limit, offset })
|
|
299
|
-
}
|
|
300
|
-
},
|
|
301
|
-
snyk: {
|
|
302
|
-
me: {
|
|
303
|
-
description: "Read current Snyk user session.",
|
|
304
|
-
path: "/api/me"
|
|
305
|
-
},
|
|
306
|
-
orgs: {
|
|
307
|
-
description: "List Snyk organizations visible to the session.",
|
|
308
|
-
path: "/api/internal/orgs"
|
|
309
|
-
},
|
|
310
|
-
projects: {
|
|
311
|
-
description: "List/search Snyk projects in an org.",
|
|
312
|
-
path: "/org/:orgSlug/manage/projects",
|
|
313
|
-
required: ["orgSlug"],
|
|
314
|
-
query: ({ search, limit = 25, page = 1 }) => ({ search, limit, page })
|
|
315
|
-
},
|
|
316
|
-
project: {
|
|
317
|
-
description: "Read one Snyk project.",
|
|
318
|
-
path: "/org/:orgSlug/project/:projectId",
|
|
319
|
-
required: ["orgSlug", "projectId"]
|
|
320
|
-
}
|
|
321
|
-
},
|
|
322
|
-
"google-drive": {
|
|
323
|
-
files: {
|
|
324
|
-
description: "Search Google Drive files with Drive v3 q= query.",
|
|
325
|
-
path: "/drive/v3/files",
|
|
326
|
-
query: ({ q, pageSize = 25, pageToken, fields, corpora, supportsAllDrives = true, includeItemsFromAllDrives = true }) => ({
|
|
327
|
-
q,
|
|
328
|
-
pageSize,
|
|
329
|
-
pageToken,
|
|
330
|
-
fields,
|
|
331
|
-
corpora,
|
|
332
|
-
supportsAllDrives,
|
|
333
|
-
includeItemsFromAllDrives
|
|
334
|
-
})
|
|
335
|
-
},
|
|
336
|
-
file: {
|
|
337
|
-
description: "Read Google Drive file metadata.",
|
|
338
|
-
path: "/drive/v3/files/:fileId",
|
|
339
|
-
required: ["fileId"],
|
|
340
|
-
query: ({ fields }) => ({ fields })
|
|
341
|
-
}
|
|
342
|
-
},
|
|
343
|
-
mixpanel: {
|
|
344
|
-
workspaces: {
|
|
345
|
-
description: "List Mixpanel workspaces visible to the session.",
|
|
346
|
-
path: "/api/app/workspaces"
|
|
347
|
-
}
|
|
348
|
-
}
|
|
349
|
-
};
|
|
350
|
-
|
|
351
|
-
function cleanQuery(query = {}) {
|
|
352
|
-
return Object.fromEntries(Object.entries(query).filter(([, value]) => value !== undefined && value !== null && value !== ""));
|
|
353
|
-
}
|
|
354
|
-
|
|
355
|
-
function encodePathValue(value) {
|
|
356
|
-
return String(value).split("/").map(encodeURIComponent).join("/");
|
|
357
|
-
}
|
|
358
|
-
|
|
359
|
-
export function listServiceOperations() {
|
|
360
|
-
return Object.entries(OPERATION_DEFINITIONS).map(([service, operations]) => ({
|
|
361
|
-
service,
|
|
362
|
-
readOnly: true,
|
|
363
|
-
methods: ["GET"],
|
|
364
|
-
operations: Object.entries(operations).map(([operation, definition]) => ({
|
|
365
|
-
operation,
|
|
366
|
-
description: definition.description,
|
|
367
|
-
required: definition.required ?? []
|
|
368
|
-
}))
|
|
369
|
-
}));
|
|
370
|
-
}
|
|
371
|
-
|
|
372
|
-
export function getServiceOperation(service, operation) {
|
|
373
|
-
const serviceId = String(service || "").trim().toLowerCase();
|
|
374
|
-
const operationId = String(operation || "").trim();
|
|
375
|
-
const definition = OPERATION_DEFINITIONS[serviceId]?.[operationId];
|
|
376
|
-
if (!definition) {
|
|
377
|
-
throw new Error(`Unknown read-only operation: ${serviceId || "(missing)"}.${operationId || "(missing)"}`);
|
|
378
|
-
}
|
|
379
|
-
return { service: serviceId, operation: operationId, ...definition };
|
|
380
|
-
}
|
|
381
|
-
|
|
382
|
-
export function buildServiceOperationInput(service, operation, params = {}) {
|
|
383
|
-
const definition = getServiceOperation(service, operation);
|
|
384
|
-
const missing = (definition.required ?? []).filter((key) => params[key] === undefined || params[key] === null || params[key] === "");
|
|
385
|
-
if (missing.length) {
|
|
386
|
-
throw new Error(`Missing required parameter(s) for ${definition.service}.${definition.operation}: ${missing.join(", ")}`);
|
|
387
|
-
}
|
|
388
|
-
|
|
389
|
-
let restPath = definition.path;
|
|
390
|
-
for (const [key, value] of Object.entries(params)) {
|
|
391
|
-
restPath = restPath.replaceAll(`:${key}`, encodePathValue(value));
|
|
392
|
-
}
|
|
393
|
-
if (/:[A-Za-z][A-Za-z0-9_]*/.test(restPath)) {
|
|
394
|
-
throw new Error(`Unresolved path parameter in ${definition.service}.${definition.operation}: ${restPath}`);
|
|
395
|
-
}
|
|
396
|
-
|
|
397
|
-
return {
|
|
398
|
-
restPath,
|
|
399
|
-
query: cleanQuery(definition.query?.(params) ?? {})
|
|
400
|
-
};
|
|
401
|
-
}
|
|
402
|
-
|
|
403
|
-
export async function readServiceOperation(service, operation, params = {}, options = {}) {
|
|
404
|
-
const { service: serviceId } = getServiceOperation(service, operation);
|
|
405
|
-
const input = buildServiceOperationInput(serviceId, operation, params);
|
|
406
|
-
return ssoReadGet(serviceId, input, options);
|
|
407
|
-
}
|