@sanity/cli 8.17.1 → 8.19.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/dist/actions/init/bootstrapRemoteTemplate.js +6 -2
- package/dist/actions/init/bootstrapRemoteTemplate.js.map +1 -1
- package/dist/actions/tokens/grants.js +192 -0
- package/dist/actions/tokens/grants.js.map +1 -0
- package/dist/commands/tokens/create.js +223 -83
- package/dist/commands/tokens/create.js.map +1 -1
- package/dist/generated/apiRoutes.js +2 -0
- package/dist/generated/apiRoutes.js.map +1 -1
- package/dist/prompts/promptForGrants.js +64 -0
- package/dist/prompts/promptForGrants.js.map +1 -0
- package/dist/services/tokens.js +36 -22
- package/dist/services/tokens.js.map +1 -1
- package/oclif.manifest.json +272 -255
- package/package.json +4 -4
|
@@ -1,11 +1,18 @@
|
|
|
1
1
|
import { Args, Flags } from '@oclif/core';
|
|
2
|
+
import { CLIError } from '@oclif/core/errors';
|
|
2
3
|
import { exitCodes, SanityCommand, subdebug } from '@sanity/cli-core';
|
|
4
|
+
import { getErrorMessage, isProjectRootNotFoundError } from '@sanity/cli-core/errors';
|
|
3
5
|
import { input, select } from '@sanity/cli-core/ux';
|
|
6
|
+
import { ClientError } from '@sanity/client';
|
|
7
|
+
import { MissingOrganizationError, resolveOrganizationId } from '../../actions/context/resolveOrganizationId.js';
|
|
4
8
|
import { expiryInDays, parseExpiryDate } from '../../actions/tokens/expiry.js';
|
|
9
|
+
import { DEFAULT_ROLE, findGrantConflict, formatGrant, getProjectTokenMembership, parseGrant, projectGrantKey, toMemberships } from '../../actions/tokens/grants.js';
|
|
5
10
|
import { validateRole } from '../../actions/tokens/validateRole.js';
|
|
11
|
+
import { promptForGrants } from '../../prompts/promptForGrants.js';
|
|
6
12
|
import { promptForProject } from '../../prompts/promptForProject.js';
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
13
|
+
import { listProjects } from '../../services/projects.js';
|
|
14
|
+
import { createOrganizationToken, createToken } from '../../services/tokens.js';
|
|
15
|
+
import { getOrganizationFlag, getProjectIdFlag } from '../../util/sharedFlags.js';
|
|
9
16
|
const tokensCreateDebug = subdebug('tokens:create');
|
|
10
17
|
// Mirrors the expiry presets offered by sanity.io/manage
|
|
11
18
|
const EXPIRY_PRESET_DAYS = [
|
|
@@ -13,6 +20,7 @@ const EXPIRY_PRESET_DAYS = [
|
|
|
13
20
|
60,
|
|
14
21
|
90
|
|
15
22
|
];
|
|
23
|
+
const ORGANIZATION_FORBIDDEN_MESSAGE = 'You need permission to create organization tokens. Grant a single project to create a project token instead.';
|
|
16
24
|
export class CreateTokenCommand extends SanityCommand {
|
|
17
25
|
static args = {
|
|
18
26
|
label: Args.string({
|
|
@@ -20,19 +28,23 @@ export class CreateTokenCommand extends SanityCommand {
|
|
|
20
28
|
required: false
|
|
21
29
|
})
|
|
22
30
|
};
|
|
23
|
-
static description = 'Create a new API token
|
|
31
|
+
static description = 'Create a new API token with access to an organization and its projects';
|
|
24
32
|
static examples = [
|
|
25
33
|
{
|
|
26
34
|
command: '<%= config.bin %> <%= command.id %> "My API Token"',
|
|
27
|
-
description: 'Create a token
|
|
35
|
+
description: 'Create a token, choosing its access interactively'
|
|
28
36
|
},
|
|
29
37
|
{
|
|
30
|
-
command: '<%= config.bin %> <%= command.id %> "
|
|
31
|
-
description: 'Create
|
|
38
|
+
command: '<%= config.bin %> <%= command.id %> "CI Token" --grant context=developer --grant blueprints --grant project:abc123=editor',
|
|
39
|
+
description: 'Create an organization token with Context, Blueprints and project access'
|
|
40
|
+
},
|
|
41
|
+
{
|
|
42
|
+
command: '<%= config.bin %> <%= command.id %> "My Token" --project-id abc123 --role=editor',
|
|
43
|
+
description: 'Create a project token with editor role'
|
|
32
44
|
},
|
|
33
45
|
{
|
|
34
46
|
command: '<%= config.bin %> <%= command.id %> "CI Token" --role=editor --yes',
|
|
35
|
-
description: 'Create a token in unattended mode'
|
|
47
|
+
description: 'Create a project token in unattended mode'
|
|
36
48
|
},
|
|
37
49
|
{
|
|
38
50
|
command: '<%= config.bin %> <%= command.id %> "Build Token" --expires-at 2027-01-01',
|
|
@@ -41,10 +53,6 @@ export class CreateTokenCommand extends SanityCommand {
|
|
|
41
53
|
{
|
|
42
54
|
command: '<%= config.bin %> <%= command.id %> "API Token" --json',
|
|
43
55
|
description: 'Output token information as JSON'
|
|
44
|
-
},
|
|
45
|
-
{
|
|
46
|
-
command: '<%= config.bin %> <%= command.id %> "My Token" --project-id abc123 --role=editor',
|
|
47
|
-
description: 'Create a token for a specific project'
|
|
48
56
|
}
|
|
49
57
|
];
|
|
50
58
|
static flags = {
|
|
@@ -52,16 +60,25 @@ export class CreateTokenCommand extends SanityCommand {
|
|
|
52
60
|
description: 'Project ID to create token in',
|
|
53
61
|
semantics: 'override'
|
|
54
62
|
}),
|
|
63
|
+
...getOrganizationFlag({
|
|
64
|
+
description: 'Organization to create an organization token in',
|
|
65
|
+
semantics: 'override'
|
|
66
|
+
}),
|
|
55
67
|
'expires-at': Flags.string({
|
|
56
68
|
description: 'Date or timestamp the token expires (ISO 8601; tokens never expire by default)',
|
|
57
69
|
helpValue: '2027-01-01'
|
|
58
70
|
}),
|
|
71
|
+
grant: Flags.string({
|
|
72
|
+
description: 'Access to grant, as <permission>[=<role>] or project:<projectId>=<role>[,<role>]. Permissions: context, blueprints, media-library, canvas, sdk-apps, access, deploy-studios. Repeatable',
|
|
73
|
+
helpValue: 'context=editor',
|
|
74
|
+
multiple: true
|
|
75
|
+
}),
|
|
59
76
|
json: Flags.boolean({
|
|
60
77
|
default: false,
|
|
61
78
|
description: 'Output as JSON'
|
|
62
79
|
}),
|
|
63
80
|
role: Flags.string({
|
|
64
|
-
description: 'Role to assign
|
|
81
|
+
description: 'Role to assign on the project (defaults to viewer in unattended mode)',
|
|
65
82
|
helpValue: 'viewer'
|
|
66
83
|
}),
|
|
67
84
|
yes: Flags.boolean({
|
|
@@ -78,7 +95,6 @@ export class CreateTokenCommand extends SanityCommand {
|
|
|
78
95
|
async run() {
|
|
79
96
|
const { args, flags } = await this.parse(CreateTokenCommand);
|
|
80
97
|
const { label: givenLabel } = args;
|
|
81
|
-
const { json, role } = flags;
|
|
82
98
|
const label = givenLabel === undefined ? await this.promptForLabel() : givenLabel.trim();
|
|
83
99
|
if (!label) {
|
|
84
100
|
this.error('Token label cannot be empty. Pass a non-empty value as the `<label>` argument.', {
|
|
@@ -86,55 +102,121 @@ export class CreateTokenCommand extends SanityCommand {
|
|
|
86
102
|
});
|
|
87
103
|
}
|
|
88
104
|
const flagExpiresAt = this.parseExpiryFlag(flags['expires-at']);
|
|
89
|
-
const
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
});
|
|
103
|
-
const selectedRole = await (role ? validateRole(role, projectId, this.output) : this.promptForRole(projectId));
|
|
104
|
-
const expiresAt = flags['expires-at'] === undefined ? await this.promptForExpiry() : flagExpiresAt;
|
|
105
|
+
const getExpiry = async ()=>flags['expires-at'] === undefined ? this.promptForExpiry() : flagExpiresAt;
|
|
106
|
+
const flagGrants = (flags.grant ?? []).map((value)=>this.parseGrantFlag(value));
|
|
107
|
+
const grantConflict = findGrantConflict(flagGrants);
|
|
108
|
+
if (grantConflict) {
|
|
109
|
+
this.error(grantConflict, {
|
|
110
|
+
exit: exitCodes.USAGE_ERROR
|
|
111
|
+
});
|
|
112
|
+
}
|
|
113
|
+
const { expiresAt, grants, organizationId, roleTitle } = this.isUnattended() || flagGrants.length > 0 || flags.role !== undefined ? {
|
|
114
|
+
...await this.getFlagGrants(flagGrants),
|
|
115
|
+
expiresAt: await getExpiry()
|
|
116
|
+
} : await this.promptForAccess(getExpiry);
|
|
117
|
+
let token;
|
|
105
118
|
try {
|
|
106
|
-
|
|
119
|
+
token = await this.createTokenForGrants({
|
|
107
120
|
expiresAt,
|
|
121
|
+
grants,
|
|
108
122
|
label,
|
|
109
|
-
|
|
123
|
+
organizationId
|
|
124
|
+
});
|
|
125
|
+
} catch (error) {
|
|
126
|
+
if (error instanceof CLIError) throw error;
|
|
127
|
+
tokensCreateDebug('Error creating token', error);
|
|
128
|
+
this.error(`Token creation failed:\n${getErrorMessage(error)}`, {
|
|
129
|
+
exit: exitCodes.RUNTIME_ERROR
|
|
110
130
|
});
|
|
111
|
-
|
|
131
|
+
}
|
|
132
|
+
if (flags.json) {
|
|
133
|
+
this.log(JSON.stringify(token, null, 2));
|
|
134
|
+
return;
|
|
135
|
+
}
|
|
136
|
+
this.log('API token created');
|
|
137
|
+
this.log(`Label: ${token.label}`);
|
|
138
|
+
this.log(`ID: ${token.id}`);
|
|
139
|
+
if (roleTitle) {
|
|
140
|
+
this.log(`Role: ${roleTitle}`);
|
|
141
|
+
}
|
|
142
|
+
if (token.expiresAt) {
|
|
143
|
+
this.log(`Expires: ${token.expiresAt}`);
|
|
144
|
+
}
|
|
145
|
+
this.log(`Token: ${token.token}`);
|
|
146
|
+
this.log('');
|
|
147
|
+
this.log("Copy the token now. It won't be shown again.");
|
|
148
|
+
if (!this.isUnattended()) {
|
|
149
|
+
this.log('');
|
|
150
|
+
this.log('To create the same token without prompts:');
|
|
151
|
+
this.log(` ${formatCreateCommand(this.config.bin, {
|
|
152
|
+
expiresAt,
|
|
153
|
+
grants,
|
|
154
|
+
label,
|
|
155
|
+
token
|
|
156
|
+
})}`);
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
async createTokenForGrants(options) {
|
|
160
|
+
const { expiresAt, grants, label } = options;
|
|
161
|
+
const projectMembership = getProjectTokenMembership(grants);
|
|
162
|
+
if (projectMembership) {
|
|
163
|
+
const { resourceId: projectId, roleNames } = projectMembership;
|
|
164
|
+
return createToken({
|
|
112
165
|
expiresAt,
|
|
113
166
|
label,
|
|
114
167
|
projectId,
|
|
115
|
-
|
|
168
|
+
roleNames
|
|
169
|
+
});
|
|
170
|
+
}
|
|
171
|
+
const organizationId = options.organizationId ?? await this.resolveOrganization();
|
|
172
|
+
try {
|
|
173
|
+
return await createOrganizationToken({
|
|
174
|
+
expiresAt,
|
|
175
|
+
label,
|
|
176
|
+
memberships: toMemberships(grants, organizationId),
|
|
177
|
+
organizationId
|
|
116
178
|
});
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
179
|
+
} catch (error) {
|
|
180
|
+
if (error instanceof ClientError && error.statusCode === 403) {
|
|
181
|
+
throw new Error(ORGANIZATION_FORBIDDEN_MESSAGE, {
|
|
182
|
+
cause: error
|
|
183
|
+
});
|
|
120
184
|
}
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
185
|
+
throw error;
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
async getFlagGrants(grants) {
|
|
189
|
+
const { 'project-id': projectIdFlag, role } = this.flags;
|
|
190
|
+
if (grants.length > 0 && !projectIdFlag && !role) {
|
|
191
|
+
return {
|
|
192
|
+
grants
|
|
193
|
+
};
|
|
194
|
+
}
|
|
195
|
+
const projectId = await this.resolveProjectId();
|
|
196
|
+
const projectKey = projectGrantKey(projectId);
|
|
197
|
+
if (grants.some((grant)=>grant.key === projectKey)) {
|
|
198
|
+
if (role) {
|
|
199
|
+
this.error(`Set the role for project ${projectId} with either --role or --grant ${projectKey}=<role>, not both.`, {
|
|
200
|
+
exit: exitCodes.USAGE_ERROR
|
|
201
|
+
});
|
|
127
202
|
}
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
} catch (error) {
|
|
132
|
-
const err = error;
|
|
133
|
-
tokensCreateDebug(`Error creating token for project ${projectId}`, err);
|
|
134
|
-
this.error(`Token creation failed:\n${err.message}`, {
|
|
135
|
-
exit: exitCodes.RUNTIME_ERROR
|
|
136
|
-
});
|
|
203
|
+
return {
|
|
204
|
+
grants
|
|
205
|
+
};
|
|
137
206
|
}
|
|
207
|
+
const projectRole = role ? await validateRole(role, projectId, this.output) : DEFAULT_ROLE;
|
|
208
|
+
return {
|
|
209
|
+
grants: [
|
|
210
|
+
...grants,
|
|
211
|
+
{
|
|
212
|
+
key: projectKey,
|
|
213
|
+
roles: [
|
|
214
|
+
projectRole.name
|
|
215
|
+
]
|
|
216
|
+
}
|
|
217
|
+
],
|
|
218
|
+
roleTitle: grants.length === 0 ? projectRole.title : undefined
|
|
219
|
+
};
|
|
138
220
|
}
|
|
139
221
|
parseExpiryFlag(value) {
|
|
140
222
|
if (value === undefined) {
|
|
@@ -148,6 +230,43 @@ export class CreateTokenCommand extends SanityCommand {
|
|
|
148
230
|
}
|
|
149
231
|
return parsed.expiresAt;
|
|
150
232
|
}
|
|
233
|
+
parseGrantFlag(value) {
|
|
234
|
+
const parsed = parseGrant(value.trim());
|
|
235
|
+
if ('error' in parsed) {
|
|
236
|
+
this.error(parsed.error, {
|
|
237
|
+
exit: exitCodes.USAGE_ERROR
|
|
238
|
+
});
|
|
239
|
+
}
|
|
240
|
+
return parsed.grant;
|
|
241
|
+
}
|
|
242
|
+
async promptForAccess(getExpiry) {
|
|
243
|
+
const requestedProjectId = this.flags['project-id'];
|
|
244
|
+
const configProjectId = (await this.tryGetCliConfig()).api?.projectId;
|
|
245
|
+
const projects = await listProjects({
|
|
246
|
+
onlyExplicitMembership: false
|
|
247
|
+
});
|
|
248
|
+
const organizationOf = (projectId)=>projects.find((project)=>project.id === projectId)?.organizationId ?? undefined;
|
|
249
|
+
const organizationId = await this.resolveOrganization({
|
|
250
|
+
fallback: organizationOf(configProjectId),
|
|
251
|
+
preferred: organizationOf(requestedProjectId)
|
|
252
|
+
});
|
|
253
|
+
const organizationProjects = projects.filter((project)=>project.organizationId === organizationId);
|
|
254
|
+
if (requestedProjectId && !organizationProjects.some(({ id })=>id === requestedProjectId)) {
|
|
255
|
+
this.error(`Project ${requestedProjectId} isn't in organization ${organizationId}, or you don't have access to it.`, {
|
|
256
|
+
exit: exitCodes.USAGE_ERROR
|
|
257
|
+
});
|
|
258
|
+
}
|
|
259
|
+
const expiresAt = await getExpiry();
|
|
260
|
+
const grants = await promptForGrants({
|
|
261
|
+
preselectedProjectId: requestedProjectId,
|
|
262
|
+
projects: organizationProjects
|
|
263
|
+
});
|
|
264
|
+
return {
|
|
265
|
+
expiresAt,
|
|
266
|
+
grants,
|
|
267
|
+
organizationId
|
|
268
|
+
};
|
|
269
|
+
}
|
|
151
270
|
async promptForExpiry() {
|
|
152
271
|
if (this.isUnattended()) {
|
|
153
272
|
return undefined // Tokens never expire by default
|
|
@@ -204,44 +323,65 @@ export class CreateTokenCommand extends SanityCommand {
|
|
|
204
323
|
});
|
|
205
324
|
return label.trim();
|
|
206
325
|
}
|
|
207
|
-
async
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
326
|
+
async resolveOrganization(projectOrganizations = {}) {
|
|
327
|
+
const { fallback, preferred } = projectOrganizations;
|
|
328
|
+
try {
|
|
329
|
+
return await resolveOrganizationId({
|
|
330
|
+
configuredOrganizationId: preferred ?? (await this.tryGetCliConfig()).app?.organizationId ?? fallback,
|
|
331
|
+
flagOrganizationId: this.flags.organization,
|
|
332
|
+
unattended: this.isUnattended()
|
|
333
|
+
});
|
|
334
|
+
} catch (error) {
|
|
335
|
+
tokensCreateDebug('Error resolving organization', error);
|
|
336
|
+
this.error(getErrorMessage(error), {
|
|
337
|
+
exit: error instanceof MissingOrganizationError ? exitCodes.USAGE_ERROR : exitCodes.RUNTIME_ERROR
|
|
338
|
+
});
|
|
214
339
|
}
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
340
|
+
}
|
|
341
|
+
async resolveProjectId() {
|
|
342
|
+
if (!this.isUnattended()) {
|
|
343
|
+
return this.getProjectId({
|
|
344
|
+
fallback: ()=>promptForProject({
|
|
345
|
+
requiredPermissions: [
|
|
346
|
+
{
|
|
347
|
+
grant: 'read',
|
|
348
|
+
permission: 'sanity.project.roles'
|
|
349
|
+
},
|
|
350
|
+
{
|
|
351
|
+
grant: 'create',
|
|
352
|
+
permission: 'sanity.project.tokens'
|
|
353
|
+
}
|
|
354
|
+
]
|
|
355
|
+
})
|
|
223
356
|
});
|
|
224
357
|
}
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
default: 'viewer',
|
|
232
|
-
message: 'Select role for the token:'
|
|
233
|
-
});
|
|
234
|
-
const selectedRole = robotRoles.find((r)=>r.name === selectedRoleName);
|
|
235
|
-
if (!selectedRole) {
|
|
236
|
-
this.error('No roles available for tokens', {
|
|
237
|
-
exit: exitCodes.RUNTIME_ERROR
|
|
358
|
+
try {
|
|
359
|
+
return await this.getProjectId();
|
|
360
|
+
} catch (error) {
|
|
361
|
+
if (!isProjectRootNotFoundError(error)) throw error;
|
|
362
|
+
this.error('Token access is required. Pass at least one `--grant`, or `--project-id` to create a project token.', {
|
|
363
|
+
exit: exitCodes.USAGE_ERROR
|
|
238
364
|
});
|
|
239
365
|
}
|
|
240
|
-
return {
|
|
241
|
-
name: selectedRole.name,
|
|
242
|
-
title: selectedRole.title
|
|
243
|
-
};
|
|
244
366
|
}
|
|
245
367
|
}
|
|
368
|
+
function quoteShellArg(value) {
|
|
369
|
+
return /^[\w./:@=,-]+$/.test(value) ? value : `'${value.replaceAll("'", String.raw`'\''`)}'`;
|
|
370
|
+
}
|
|
371
|
+
function formatCreateCommand(bin, { expiresAt, grants, label, token }) {
|
|
372
|
+
const organizationId = token.managedBy?.resourceType === 'organization' ? token.managedBy.resourceId : undefined;
|
|
373
|
+
return [
|
|
374
|
+
`${bin} tokens create`,
|
|
375
|
+
quoteShellArg(label),
|
|
376
|
+
...organizationId ? [
|
|
377
|
+
`--organization ${organizationId}`
|
|
378
|
+
] : [],
|
|
379
|
+
...expiresAt ? [
|
|
380
|
+
`--expires-at ${expiresAt}`
|
|
381
|
+
] : [],
|
|
382
|
+
...grants.map((grant)=>`--grant ${formatGrant(grant)}`),
|
|
383
|
+
'--yes'
|
|
384
|
+
].join(' ');
|
|
385
|
+
}
|
|
246
386
|
|
|
247
387
|
//# sourceMappingURL=create.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/commands/tokens/create.ts"],"sourcesContent":["import {Args, Flags} from '@oclif/core'\nimport {exitCodes, SanityCommand, subdebug} from '@sanity/cli-core'\nimport {input, select} from '@sanity/cli-core/ux'\n\nimport {expiryInDays, parseExpiryDate} from '../../actions/tokens/expiry.js'\nimport {type SelectedTokenRole} from '../../actions/tokens/types.js'\nimport {validateRole} from '../../actions/tokens/validateRole.js'\nimport {promptForProject} from '../../prompts/promptForProject.js'\nimport {createToken, getTokenRoles} from '../../services/tokens.js'\nimport {getProjectIdFlag} from '../../util/sharedFlags.js'\n\nconst tokensCreateDebug = subdebug('tokens:create')\n\n// Mirrors the expiry presets offered by sanity.io/manage\nconst EXPIRY_PRESET_DAYS = [30, 60, 90]\n\nexport class CreateTokenCommand extends SanityCommand<typeof CreateTokenCommand> {\n static override args = {\n label: Args.string({\n description: 'Label for the new token',\n required: false,\n }),\n }\n\n static override description = 'Create a new API token for the project'\n\n static override examples = [\n {\n command: '<%= config.bin %> <%= command.id %> \"My API Token\"',\n description: 'Create a token with a label',\n },\n {\n command: '<%= config.bin %> <%= command.id %> \"My API Token\" --role=editor',\n description: 'Create a token with editor role',\n },\n {\n command: '<%= config.bin %> <%= command.id %> \"CI Token\" --role=editor --yes',\n description: 'Create a token in unattended mode',\n },\n {\n command: '<%= config.bin %> <%= command.id %> \"Build Token\" --expires-at 2027-01-01',\n description: 'Create a token that expires on a given date',\n },\n {\n command: '<%= config.bin %> <%= command.id %> \"API Token\" --json',\n description: 'Output token information as JSON',\n },\n {\n command: '<%= config.bin %> <%= command.id %> \"My Token\" --project-id abc123 --role=editor',\n description: 'Create a token for a specific project',\n },\n ]\n\n static override flags = {\n ...getProjectIdFlag({\n description: 'Project ID to create token in',\n semantics: 'override',\n }),\n 'expires-at': Flags.string({\n description: 'Date or timestamp the token expires (ISO 8601; tokens never expire by default)',\n helpValue: '2027-01-01',\n }),\n json: Flags.boolean({\n default: false,\n description: 'Output as JSON',\n }),\n role: Flags.string({\n description: 'Role to assign to the token (defaults to viewer in unattended mode)',\n helpValue: 'viewer',\n }),\n yes: Flags.boolean({\n char: 'y',\n default: false,\n description: 'Skip prompts and use defaults (unattended mode)',\n }),\n }\n\n static override hiddenAliases: string[] = ['tokens:add', 'token:add', 'token:create']\n\n public async run(): Promise<void> {\n const {args, flags} = await this.parse(CreateTokenCommand)\n const {label: givenLabel} = args\n const {json, role} = flags\n\n const label = givenLabel === undefined ? await this.promptForLabel() : givenLabel.trim()\n if (!label) {\n this.error('Token label cannot be empty. Pass a non-empty value as the `<label>` argument.', {\n exit: exitCodes.USAGE_ERROR,\n })\n }\n\n const flagExpiresAt = this.parseExpiryFlag(flags['expires-at'])\n\n const projectId = await this.getProjectId({\n fallback: () =>\n promptForProject({\n requiredPermissions: [\n {grant: 'read', permission: 'sanity.project.roles'},\n {grant: 'create', permission: 'sanity.project.tokens'},\n ],\n }),\n })\n\n const selectedRole = await (role\n ? validateRole(role, projectId, this.output)\n : this.promptForRole(projectId))\n\n const expiresAt =\n flags['expires-at'] === undefined ? await this.promptForExpiry() : flagExpiresAt\n\n try {\n tokensCreateDebug(`Creating token for project ${projectId}`, {\n expiresAt,\n label,\n roleName: selectedRole.name,\n })\n const token = await createToken({\n expiresAt,\n label,\n projectId,\n roleName: selectedRole.name,\n })\n\n if (json) {\n this.log(JSON.stringify(token, null, 2))\n return\n }\n\n this.log('API token created')\n this.log(`Label: ${token.label}`)\n this.log(`ID: ${token.id}`)\n this.log(`Role: ${selectedRole.title}`)\n if (token.expiresAt) {\n this.log(`Expires: ${token.expiresAt}`)\n }\n this.log(`Token: ${token.token}`)\n this.log('')\n this.log(\"Copy the token now. It won't be shown again.\")\n } catch (error) {\n const err = error as Error\n\n tokensCreateDebug(`Error creating token for project ${projectId}`, err)\n this.error(`Token creation failed:\\n${err.message}`, {exit: exitCodes.RUNTIME_ERROR})\n }\n }\n\n private parseExpiryFlag(value: string | undefined): string | undefined {\n if (value === undefined) {\n return undefined\n }\n\n const parsed = parseExpiryDate(value)\n if ('error' in parsed) {\n this.error(parsed.error, {exit: exitCodes.USAGE_ERROR})\n }\n\n return parsed.expiresAt\n }\n\n private async promptForExpiry(): Promise<string | undefined> {\n if (this.isUnattended()) {\n return undefined // Tokens never expire by default\n }\n\n const choice = await select({\n choices: [\n {name: 'Never', value: 'never'},\n ...EXPIRY_PRESET_DAYS.map((days) => ({\n name: `${days} days (${expiryInDays(days).slice(0, 10)})`,\n value: String(days),\n })),\n {name: 'Custom date', value: 'custom'},\n ],\n default: 'never',\n message: 'Token expiry:',\n })\n\n if (choice === 'never') {\n return undefined\n }\n\n if (choice === 'custom') {\n const value = await input({\n message: 'Expiry date (ISO 8601, e.g. 2027-01-01):',\n validate: (input) => {\n const parsed = parseExpiryDate(input.trim())\n return 'error' in parsed ? parsed.error : true\n },\n })\n const parsed = parseExpiryDate(value.trim())\n return 'error' in parsed ? undefined : parsed.expiresAt\n }\n\n return expiryInDays(Number(choice))\n }\n\n private async promptForLabel(): Promise<string> {\n if (this.isUnattended()) {\n this.error('Token label is required. Pass it as the `<label>` argument.', {\n exit: exitCodes.USAGE_ERROR,\n })\n }\n\n const label = await input({\n message: 'Token label:',\n validate: (value) => {\n if (!value || !value.trim()) {\n return 'Label cannot be empty'\n }\n return true\n },\n })\n\n return label.trim()\n }\n\n private async promptForRole(projectId: string): Promise<SelectedTokenRole> {\n if (this.isUnattended()) {\n return {name: 'viewer', title: 'Viewer'} // Default role for unattended mode\n }\n\n const roles = await getTokenRoles(projectId)\n const robotRoles = roles.filter((role) => role.appliesToRobots)\n\n tokensCreateDebug('Robot roles', {robotRoles})\n\n if (robotRoles.length === 0) {\n this.error('No roles available for tokens', {exit: exitCodes.RUNTIME_ERROR})\n }\n\n const selectedRoleName = await select({\n choices: robotRoles.map((role) => ({\n name: `${role.title} (${role.name})`,\n short: role.title,\n value: role.name,\n })),\n default: 'viewer',\n message: 'Select role for the token:',\n })\n\n const selectedRole = robotRoles.find((r) => r.name === selectedRoleName)\n if (!selectedRole) {\n this.error('No roles available for tokens', {exit: exitCodes.RUNTIME_ERROR})\n }\n\n return {name: selectedRole.name, title: selectedRole.title}\n }\n}\n"],"names":["Args","Flags","exitCodes","SanityCommand","subdebug","input","select","expiryInDays","parseExpiryDate","validateRole","promptForProject","createToken","getTokenRoles","getProjectIdFlag","tokensCreateDebug","EXPIRY_PRESET_DAYS","CreateTokenCommand","args","label","string","description","required","examples","command","flags","semantics","helpValue","json","boolean","default","role","yes","char","hiddenAliases","run","parse","givenLabel","undefined","promptForLabel","trim","error","exit","USAGE_ERROR","flagExpiresAt","parseExpiryFlag","projectId","getProjectId","fallback","requiredPermissions","grant","permission","selectedRole","output","promptForRole","expiresAt","promptForExpiry","roleName","name","token","log","JSON","stringify","id","title","err","message","RUNTIME_ERROR","value","parsed","isUnattended","choice","choices","map","days","slice","String","validate","Number","roles","robotRoles","filter","appliesToRobots","length","selectedRoleName","short","find","r"],"mappings":"AAAA,SAAQA,IAAI,EAAEC,KAAK,QAAO,cAAa;AACvC,SAAQC,SAAS,EAAEC,aAAa,EAAEC,QAAQ,QAAO,mBAAkB;AACnE,SAAQC,KAAK,EAAEC,MAAM,QAAO,sBAAqB;AAEjD,SAAQC,YAAY,EAAEC,eAAe,QAAO,iCAAgC;AAE5E,SAAQC,YAAY,QAAO,uCAAsC;AACjE,SAAQC,gBAAgB,QAAO,oCAAmC;AAClE,SAAQC,WAAW,EAAEC,aAAa,QAAO,2BAA0B;AACnE,SAAQC,gBAAgB,QAAO,4BAA2B;AAE1D,MAAMC,oBAAoBV,SAAS;AAEnC,yDAAyD;AACzD,MAAMW,qBAAqB;IAAC;IAAI;IAAI;CAAG;A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IAAI,CAACX,KAAK,CAAC,iCAAiC;gBAACC,MAAMvC,UAAUgE,aAAa;YAAA;QAC5E;QAEA,OAAO;YAACT,MAAMN,aAAaM,IAAI;YAAEM,OAAOZ,aAAaY,KAAK;QAAA;IAC5D;AACF"}
|
|
1
|
+
{"version":3,"sources":["../../../src/commands/tokens/create.ts"],"sourcesContent":["import {Args, Flags} from '@oclif/core'\nimport {CLIError} from '@oclif/core/errors'\nimport {exitCodes, SanityCommand, subdebug} from '@sanity/cli-core'\nimport {getErrorMessage, isProjectRootNotFoundError} from '@sanity/cli-core/errors'\nimport {input, select} from '@sanity/cli-core/ux'\nimport {ClientError} from '@sanity/client'\n\nimport {\n MissingOrganizationError,\n resolveOrganizationId,\n} from '../../actions/context/resolveOrganizationId.js'\nimport {expiryInDays, parseExpiryDate} from '../../actions/tokens/expiry.js'\nimport {\n DEFAULT_ROLE,\n findGrantConflict,\n formatGrant,\n getProjectTokenMembership,\n type Grant,\n parseGrant,\n projectGrantKey,\n toMemberships,\n} from '../../actions/tokens/grants.js'\nimport {type RobotWithToken} from '../../actions/tokens/types.js'\nimport {validateRole} from '../../actions/tokens/validateRole.js'\nimport {promptForGrants} from '../../prompts/promptForGrants.js'\nimport {promptForProject} from '../../prompts/promptForProject.js'\nimport {listProjects} from '../../services/projects.js'\nimport {createOrganizationToken, createToken} from '../../services/tokens.js'\nimport {getOrganizationFlag, getProjectIdFlag} from '../../util/sharedFlags.js'\n\nconst tokensCreateDebug = subdebug('tokens:create')\n\ntype Access = {\n expiresAt: string | undefined\n grants: Grant[]\n\n organizationId?: string\n roleTitle?: string\n}\n\n// Mirrors the expiry presets offered by sanity.io/manage\nconst EXPIRY_PRESET_DAYS = [30, 60, 90]\n\nconst ORGANIZATION_FORBIDDEN_MESSAGE =\n 'You need permission to create organization tokens. Grant a single project to create a project token instead.'\n\nexport class CreateTokenCommand extends SanityCommand<typeof CreateTokenCommand> {\n static override args = {\n label: Args.string({\n description: 'Label for the new token',\n required: false,\n }),\n }\n\n static override description =\n 'Create a new API token with access to an organization and its projects'\n\n static override examples = [\n {\n command: '<%= config.bin %> <%= command.id %> \"My API Token\"',\n description: 'Create a token, choosing its access interactively',\n },\n {\n command:\n '<%= config.bin %> <%= command.id %> \"CI Token\" --grant context=developer --grant blueprints --grant project:abc123=editor',\n description: 'Create an organization token with Context, Blueprints and project access',\n },\n {\n command: '<%= config.bin %> <%= command.id %> \"My Token\" --project-id abc123 --role=editor',\n description: 'Create a project token with editor role',\n },\n {\n command: '<%= config.bin %> <%= command.id %> \"CI Token\" --role=editor --yes',\n description: 'Create a project token in unattended mode',\n },\n {\n command: '<%= config.bin %> <%= command.id %> \"Build Token\" --expires-at 2027-01-01',\n description: 'Create a token that expires on a given date',\n },\n {\n command: '<%= config.bin %> <%= command.id %> \"API Token\" --json',\n description: 'Output token information as JSON',\n },\n ]\n\n static override flags = {\n ...getProjectIdFlag({\n description: 'Project ID to create token in',\n semantics: 'override',\n }),\n ...getOrganizationFlag({\n description: 'Organization to create an organization token in',\n semantics: 'override',\n }),\n 'expires-at': Flags.string({\n description: 'Date or timestamp the token expires (ISO 8601; tokens never expire by default)',\n helpValue: '2027-01-01',\n }),\n grant: Flags.string({\n description:\n 'Access to grant, as <permission>[=<role>] or project:<projectId>=<role>[,<role>]. Permissions: context, blueprints, media-library, canvas, sdk-apps, access, deploy-studios. Repeatable',\n helpValue: 'context=editor',\n multiple: true,\n }),\n json: Flags.boolean({\n default: false,\n description: 'Output as JSON',\n }),\n role: Flags.string({\n description: 'Role to assign on the project (defaults to viewer in unattended mode)',\n helpValue: 'viewer',\n }),\n yes: Flags.boolean({\n char: 'y',\n default: false,\n description: 'Skip prompts and use defaults (unattended mode)',\n }),\n }\n\n static override hiddenAliases: string[] = ['tokens:add', 'token:add', 'token:create']\n\n public async run(): Promise<void> {\n const {args, flags} = await this.parse(CreateTokenCommand)\n const {label: givenLabel} = args\n\n const label = givenLabel === undefined ? await this.promptForLabel() : givenLabel.trim()\n if (!label) {\n this.error('Token label cannot be empty. Pass a non-empty value as the `<label>` argument.', {\n exit: exitCodes.USAGE_ERROR,\n })\n }\n\n const flagExpiresAt = this.parseExpiryFlag(flags['expires-at'])\n const getExpiry = async () =>\n flags['expires-at'] === undefined ? this.promptForExpiry() : flagExpiresAt\n const flagGrants = (flags.grant ?? []).map((value) => this.parseGrantFlag(value))\n const grantConflict = findGrantConflict(flagGrants)\n if (grantConflict) {\n this.error(grantConflict, {exit: exitCodes.USAGE_ERROR})\n }\n\n const {expiresAt, grants, organizationId, roleTitle}: Access =\n this.isUnattended() || flagGrants.length > 0 || flags.role !== undefined\n ? {...(await this.getFlagGrants(flagGrants)), expiresAt: await getExpiry()}\n : await this.promptForAccess(getExpiry)\n\n let token: RobotWithToken\n try {\n token = await this.createTokenForGrants({\n expiresAt,\n grants,\n label,\n organizationId,\n })\n } catch (error) {\n if (error instanceof CLIError) throw error\n tokensCreateDebug('Error creating token', error)\n this.error(`Token creation failed:\\n${getErrorMessage(error)}`, {\n exit: exitCodes.RUNTIME_ERROR,\n })\n }\n\n if (flags.json) {\n this.log(JSON.stringify(token, null, 2))\n return\n }\n\n this.log('API token created')\n this.log(`Label: ${token.label}`)\n this.log(`ID: ${token.id}`)\n if (roleTitle) {\n this.log(`Role: ${roleTitle}`)\n }\n if (token.expiresAt) {\n this.log(`Expires: ${token.expiresAt}`)\n }\n this.log(`Token: ${token.token}`)\n this.log('')\n this.log(\"Copy the token now. It won't be shown again.\")\n\n if (!this.isUnattended()) {\n this.log('')\n this.log('To create the same token without prompts:')\n this.log(` ${formatCreateCommand(this.config.bin, {expiresAt, grants, label, token})}`)\n }\n }\n\n private async createTokenForGrants(options: {\n expiresAt: string | undefined\n grants: Grant[]\n label: string\n organizationId: string | undefined\n }): Promise<RobotWithToken> {\n const {expiresAt, grants, label} = options\n const projectMembership = getProjectTokenMembership(grants)\n if (projectMembership) {\n const {resourceId: projectId, roleNames} = projectMembership\n return createToken({expiresAt, label, projectId, roleNames})\n }\n\n const organizationId = options.organizationId ?? (await this.resolveOrganization())\n try {\n return await createOrganizationToken({\n expiresAt,\n label,\n memberships: toMemberships(grants, organizationId),\n organizationId,\n })\n } catch (error) {\n if (error instanceof ClientError && error.statusCode === 403) {\n throw new Error(ORGANIZATION_FORBIDDEN_MESSAGE, {cause: error})\n }\n throw error\n }\n }\n\n private async getFlagGrants(grants: Grant[]): Promise<{grants: Grant[]; roleTitle?: string}> {\n const {'project-id': projectIdFlag, role} = this.flags\n if (grants.length > 0 && !projectIdFlag && !role) {\n return {grants}\n }\n\n const projectId = await this.resolveProjectId()\n const projectKey = projectGrantKey(projectId)\n if (grants.some((grant) => grant.key === projectKey)) {\n if (role) {\n this.error(\n `Set the role for project ${projectId} with either --role or --grant ${projectKey}=<role>, not both.`,\n {exit: exitCodes.USAGE_ERROR},\n )\n }\n return {grants}\n }\n\n const projectRole = role ? await validateRole(role, projectId, this.output) : DEFAULT_ROLE\n\n return {\n grants: [...grants, {key: projectKey, roles: [projectRole.name]}],\n roleTitle: grants.length === 0 ? projectRole.title : undefined,\n }\n }\n\n private parseExpiryFlag(value: string | undefined): string | undefined {\n if (value === undefined) {\n return undefined\n }\n\n const parsed = parseExpiryDate(value)\n if ('error' in parsed) {\n this.error(parsed.error, {exit: exitCodes.USAGE_ERROR})\n }\n\n return parsed.expiresAt\n }\n\n private parseGrantFlag(value: string): Grant {\n const parsed = parseGrant(value.trim())\n if ('error' in parsed) {\n this.error(parsed.error, {exit: exitCodes.USAGE_ERROR})\n }\n\n return parsed.grant\n }\n\n private async promptForAccess(getExpiry: () => Promise<string | undefined>): Promise<Access> {\n const requestedProjectId = this.flags['project-id']\n const configProjectId = (await this.tryGetCliConfig()).api?.projectId\n const projects = await listProjects({onlyExplicitMembership: false})\n const organizationOf = (projectId: string | undefined) =>\n projects.find((project) => project.id === projectId)?.organizationId ?? undefined\n const organizationId = await this.resolveOrganization({\n fallback: organizationOf(configProjectId),\n preferred: organizationOf(requestedProjectId),\n })\n const organizationProjects = projects.filter(\n (project) => project.organizationId === organizationId,\n )\n if (requestedProjectId && !organizationProjects.some(({id}) => id === requestedProjectId)) {\n this.error(\n `Project ${requestedProjectId} isn't in organization ${organizationId}, or you don't have access to it.`,\n {exit: exitCodes.USAGE_ERROR},\n )\n }\n\n const expiresAt = await getExpiry()\n const grants = await promptForGrants({\n preselectedProjectId: requestedProjectId,\n projects: organizationProjects,\n })\n return {expiresAt, grants, organizationId}\n }\n\n private async promptForExpiry(): Promise<string | undefined> {\n if (this.isUnattended()) {\n return undefined // Tokens never expire by default\n }\n\n const choice = await select({\n choices: [\n {name: 'Never', value: 'never'},\n ...EXPIRY_PRESET_DAYS.map((days) => ({\n name: `${days} days (${expiryInDays(days).slice(0, 10)})`,\n value: String(days),\n })),\n {name: 'Custom date', value: 'custom'},\n ],\n default: 'never',\n message: 'Token expiry:',\n })\n\n if (choice === 'never') {\n return undefined\n }\n\n if (choice === 'custom') {\n const value = await input({\n message: 'Expiry date (ISO 8601, e.g. 2027-01-01):',\n validate: (input) => {\n const parsed = parseExpiryDate(input.trim())\n return 'error' in parsed ? parsed.error : true\n },\n })\n const parsed = parseExpiryDate(value.trim())\n return 'error' in parsed ? undefined : parsed.expiresAt\n }\n\n return expiryInDays(Number(choice))\n }\n\n private async promptForLabel(): Promise<string> {\n if (this.isUnattended()) {\n this.error('Token label is required. Pass it as the `<label>` argument.', {\n exit: exitCodes.USAGE_ERROR,\n })\n }\n\n const label = await input({\n message: 'Token label:',\n validate: (value) => {\n if (!value || !value.trim()) {\n return 'Label cannot be empty'\n }\n return true\n },\n })\n\n return label.trim()\n }\n\n private async resolveOrganization(\n projectOrganizations: {fallback?: string; preferred?: string} = {},\n ): Promise<string> {\n const {fallback, preferred} = projectOrganizations\n try {\n return await resolveOrganizationId({\n configuredOrganizationId:\n preferred ?? (await this.tryGetCliConfig()).app?.organizationId ?? fallback,\n flagOrganizationId: this.flags.organization,\n unattended: this.isUnattended(),\n })\n } catch (error) {\n tokensCreateDebug('Error resolving organization', error)\n this.error(getErrorMessage(error), {\n exit:\n error instanceof MissingOrganizationError\n ? exitCodes.USAGE_ERROR\n : exitCodes.RUNTIME_ERROR,\n })\n }\n }\n\n private async resolveProjectId(): Promise<string> {\n if (!this.isUnattended()) {\n return this.getProjectId({\n fallback: () =>\n promptForProject({\n requiredPermissions: [\n {grant: 'read', permission: 'sanity.project.roles'},\n {grant: 'create', permission: 'sanity.project.tokens'},\n ],\n }),\n })\n }\n\n try {\n return await this.getProjectId()\n } catch (error) {\n if (!isProjectRootNotFoundError(error)) throw error\n this.error(\n 'Token access is required. Pass at least one `--grant`, or `--project-id` to create a project token.',\n {exit: exitCodes.USAGE_ERROR},\n )\n }\n }\n}\n\nfunction quoteShellArg(value: string): string {\n return /^[\\w./:@=,-]+$/.test(value) ? value : `'${value.replaceAll(\"'\", String.raw`'\\''`)}'`\n}\n\nfunction formatCreateCommand(\n bin: string,\n {\n expiresAt,\n grants,\n label,\n token,\n }: {\n expiresAt: string | undefined\n grants: Grant[]\n label: string\n token: RobotWithToken\n },\n): string {\n const organizationId =\n token.managedBy?.resourceType === 'organization' ? token.managedBy.resourceId : undefined\n return [\n `${bin} tokens create`,\n quoteShellArg(label),\n ...(organizationId ? [`--organization ${organizationId}`] : []),\n ...(expiresAt ? [`--expires-at ${expiresAt}`] : []),\n ...grants.map((grant) => `--grant ${formatGrant(grant)}`),\n '--yes',\n ].join(' ')\n}\n"],"names":["Args","Flags","CLIError","exitCodes","SanityCommand","subdebug","getErrorMessage","isProjectRootNotFoundError","input","select","ClientError","MissingOrganizationError","resolveOrganizationId","expiryInDays","parseExpiryDate","DEFAULT_ROLE","findGrantConflict","formatGrant","getProjectTokenMembership","parseGrant","projectGrantKey","toMemberships","validateRole","promptForGrants","promptForProject","listProjects","createOrganizationToken","createToken","getOrganizationFlag","getProjectIdFlag","tokensCreateDebug","EXPIRY_PRESET_DAYS","ORGANIZATION_FORBIDDEN_MESSAGE","CreateTokenCommand","args","label","string","description","required","examples","command","flags","semantics","helpValue","grant","multiple","json","boolean","default","role","yes","char","hiddenAliases","run","parse","givenLabel","undefined","promptForLabel","trim","error","exit","USAGE_ERROR","flagExpiresAt","parseExpiryFlag","getExpiry","promptForExpiry","flagGrants","map","value","parseGrantFlag","grantConflict","expiresAt","grants","organizationId","roleTitle","isUnattended","length","getFlagGrants","promptForAccess","token","createTokenForGrants","RUNTIME_ERROR","log","JSON","stringify","id","formatCreateCommand","config","bin","options","projectMembership","resourceId","projectId","roleNames","resolveOrganization","memberships","statusCode","Error","cause","projectIdFlag","resolveProjectId","projectKey","some","key","projectRole","output","roles","name","title","parsed","requestedProjectId","configProjectId","tryGetCliConfig","api","projects","onlyExplicitMembership","organizationOf","find","project","fallback","preferred","organizationProjects","filter","preselectedProjectId","choice","choices","days","slice","String","message","validate","Number","projectOrganizations","configuredOrganizationId","app","flagOrganizationId","organization","unattended","getProjectId","requiredPermissions","permission","quoteShellArg","test","replaceAll","raw","managedBy","resourceType","join"],"mappings":"AAAA,SAAQA,IAAI,EAAEC,KAAK,QAAO,cAAa;AACvC,SAAQC,QAAQ,QAAO,qBAAoB;AAC3C,SAAQC,SAAS,EAAEC,aAAa,EAAEC,QAAQ,QAAO,mBAAkB;AACnE,SAAQC,eAAe,EAAEC,0BAA0B,QAAO,0BAAyB;AACnF,SAAQC,KAAK,EAAEC,MAAM,QAAO,sBAAqB;AACjD,SAAQC,WAAW,QAAO,iBAAgB;AAE1C,SACEC,wBAAwB,EACxBC,qBAAqB,QAChB,iDAAgD;AACvD,SAAQC,YAAY,EAAEC,eAAe,QAAO,iCAAgC;AAC5E,SACEC,YAAY,EACZC,iBAAiB,EACjBC,WAAW,EACXC,yBAAyB,EAEzBC,UAAU,EACVC,eAAe,EACfC,aAAa,QACR,iCAAgC;AAEvC,SAAQC,YAAY,QAAO,uCAAsC;AACjE,SAAQC,eAAe,QAAO,mCAAkC;AAChE,SAAQC,gBAAgB,QAAO,oCAAmC;AAClE,SAAQC,YAAY,QAAO,6BAA4B;AACvD,SAAQ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GAAW,EACX,EACEjB,SAAS,EACTC,MAAM,EACNrC,KAAK,EACL4C,KAAK,EAMN;IAED,MAAMN,iBACJM,MAAMkE,SAAS,EAAEC,iBAAiB,iBAAiBnE,MAAMkE,SAAS,CAACtD,UAAU,GAAGnC;IAClF,OAAO;QACL,GAAGgC,IAAI,cAAc,CAAC;QACtBqD,cAAc1G;WACVsC,iBAAiB;YAAC,CAAC,eAAe,EAAEA,gBAAgB;SAAC,GAAG,EAAE;WAC1DF,YAAY;YAAC,CAAC,aAAa,EAAEA,WAAW;SAAC,GAAG,EAAE;WAC/CC,OAAOL,GAAG,CAAC,CAACvB,QAAU,CAAC,QAAQ,EAAE3B,YAAY2B,QAAQ;QACxD;KACD,CAACuG,IAAI,CAAC;AACT"}
|
|
@@ -95,6 +95,7 @@
|
|
|
95
95
|
'installations/{installationId}/configs',
|
|
96
96
|
'installations/{installationId}/configs/{configId}',
|
|
97
97
|
'installations/{installationId}/interfaces',
|
|
98
|
+
'organizations/{organizationId}/applications/{applicationId}',
|
|
98
99
|
'projects/{projectId}/user-applications',
|
|
99
100
|
'projects/{projectId}/user-applications/{userApplicationId}',
|
|
100
101
|
'projects/{projectId}/user-applications/{userApplicationId}/config/{configKey}',
|
|
@@ -136,6 +137,7 @@
|
|
|
136
137
|
'installations/{installationId}/configs',
|
|
137
138
|
'installations/{installationId}/configs/{configId}',
|
|
138
139
|
'installations/{installationId}/interfaces',
|
|
140
|
+
'organizations/{organizationId}/applications/{applicationId}',
|
|
139
141
|
'projects/{projectId}/user-applications',
|
|
140
142
|
'projects/{projectId}/user-applications/{userApplicationId}',
|
|
141
143
|
'projects/{projectId}/user-applications/{userApplicationId}/config/{configKey}',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/generated/apiRoutes.ts"],"sourcesContent":["/**\n * GENERATED FILE - DO NOT EDIT\n *\n * Routing manifest for `sanity api`, distilled from the published OpenAPI\n * specifications at https://www.sanity.io/docs/api/openapi\n *\n * Regenerate with: pnpm generate:api-routes\n */\nimport {type ApiRouteEntry} from '../actions/api/types.js'\n\nexport const apiRoutes: ApiRouteEntry[] = [\n {\n defaultApiVersion: 'v2025-07-11',\n host: 'global',\n pathPatterns: [\n 'access/invites/me',\n 'access/organization/{resourceId}/users/roles/default',\n 'access/requests/me',\n 'access/robots/me',\n 'access/robots/me/rotate',\n 'access/{resourceType}/{resourceId}/invites',\n 'access/{resourceType}/{resourceId}/invites/token/{inviteToken}',\n 'access/{resourceType}/{resourceId}/invites/token/{inviteToken}/accept',\n 'access/{resourceType}/{resourceId}/invites/token/{inviteToken}/eligibility',\n 'access/{resourceType}/{resourceId}/invites/{inviteId}',\n 'access/{resourceType}/{resourceId}/permissions',\n 'access/{resourceType}/{resourceId}/permissions/{permissionName}',\n 'access/{resourceType}/{resourceId}/requests',\n 'access/{resourceType}/{resourceId}/requests/state',\n 'access/{resourceType}/{resourceId}/requests/{requestId}/accept',\n 'access/{resourceType}/{resourceId}/requests/{requestId}/decline',\n 'access/{resourceType}/{resourceId}/robots',\n 'access/{resourceType}/{resourceId}/robots/{robotId}',\n 'access/{resourceType}/{resourceId}/roles',\n 'access/{resourceType}/{resourceId}/roles/{roleName}',\n 'access/{resourceType}/{resourceId}/user-permissions/me',\n 'access/{resourceType}/{resourceId}/user-permissions/me/check',\n 'access/{resourceType}/{resourceId}/users',\n 'access/{resourceType}/{resourceId}/users/me',\n 'access/{resourceType}/{resourceId}/users/{sanityUserId}',\n 'access/{resourceType}/{resourceId}/users/{sanityUserId}/roles',\n 'access/{resourceType}/{resourceId}/users/{sanityUserId}/roles/{roleName}'\n ],\n slug: 'access-api',\n title: 'Access API reference'\n },\n {\n defaultApiVersion: 'v2025-02-19',\n host: 'project',\n pathPatterns: [\n 'data/actions/{dataset}'\n ],\n slug: 'actions',\n title: 'Actions API reference'\n },\n {\n defaultApiVersion: 'v2021-02-01',\n host: 'global',\n pathPatterns: [\n 'activity',\n 'activity/export/csv'\n ],\n slug: 'activity-log',\n title: 'Activity Log API Reference'\n },\n {\n defaultApiVersion: 'vX',\n host: 'project',\n pathPatterns: [\n 'agent/action/generate/{dataset}',\n 'agent/action/patch/{dataset}',\n 'agent/action/prompt/{dataset}',\n 'agent/action/transform/{dataset}',\n 'agent/action/translate/{dataset}'\n ],\n slug: 'agent-actions',\n title: 'Agent Actions'\n },\n {\n host: 'global',\n pathPatterns: [\n 'applications',\n 'applications/{applicationId}',\n 'applications/{applicationId}/access',\n 'applications/{applicationId}/deployments',\n 'applications/{applicationId}/embeddable',\n 'applications/{applicationId}/installations',\n 'applications/{applicationId}/interfaces',\n 'applications/{applicationId}/workspaces',\n 'deploy',\n 'deploy/quickstart',\n 'installations',\n 'installations/ai-features',\n 'installations/catalog',\n 'installations/defaults',\n 'installations/{installationId}',\n 'installations/{installationId}/access',\n 'installations/{installationId}/configs',\n 'installations/{installationId}/configs/{configId}',\n 'installations/{installationId}/interfaces',\n 'projects/{projectId}/user-applications',\n 'projects/{projectId}/user-applications/{userApplicationId}',\n 'projects/{projectId}/user-applications/{userApplicationId}/config/{configKey}',\n 'projects/{projectId}/user-applications/{userApplicationId}/deployments',\n 'studiohosts/{appHost}/availability',\n 'user-applications',\n 'user-applications/auto-update-version/{userApplicationId}',\n 'user-applications/resolve/application',\n 'user-applications/resolve/project',\n 'user-applications/workspaces',\n 'user-applications/{userApplicationId}',\n 'user-applications/{userApplicationId}/applicationData',\n 'user-applications/{userApplicationId}/config/{configKey}',\n 'user-applications/{userApplicationId}/deployments',\n 'user-applications/{userApplicationId}/workspaces'\n ],\n slug: 'applications-api',\n title: 'Applications API Reference'\n },\n {\n host: 'project',\n pathPatterns: [\n 'applications',\n 'applications/{applicationId}',\n 'applications/{applicationId}/access',\n 'applications/{applicationId}/deployments',\n 'applications/{applicationId}/embeddable',\n 'applications/{applicationId}/installations',\n 'applications/{applicationId}/interfaces',\n 'applications/{applicationId}/workspaces',\n 'deploy',\n 'deploy/quickstart',\n 'installations',\n 'installations/ai-features',\n 'installations/catalog',\n 'installations/defaults',\n 'installations/{installationId}',\n 'installations/{installationId}/access',\n 'installations/{installationId}/configs',\n 'installations/{installationId}/configs/{configId}',\n 'installations/{installationId}/interfaces',\n 'projects/{projectId}/user-applications',\n 'projects/{projectId}/user-applications/{userApplicationId}',\n 'projects/{projectId}/user-applications/{userApplicationId}/config/{configKey}',\n 'projects/{projectId}/user-applications/{userApplicationId}/deployments',\n 'studiohosts/{appHost}/availability',\n 'user-applications',\n 'user-applications/auto-update-version/{userApplicationId}',\n 'user-applications/resolve/application',\n 'user-applications/resolve/project',\n 'user-applications/workspaces',\n 'user-applications/{userApplicationId}',\n 'user-applications/{userApplicationId}/applicationData',\n 'user-applications/{userApplicationId}/config/{configKey}',\n 'user-applications/{userApplicationId}/deployments',\n 'user-applications/{userApplicationId}/workspaces'\n ],\n slug: 'applications-api',\n title: 'Applications API Reference'\n },\n {\n defaultApiVersion: 'v2024-06-24',\n host: 'project',\n pathPatterns: [\n 'assets/files/{dataset}',\n 'assets/files/{dataset}/from-url',\n 'assets/images/{dataset}',\n 'assets/images/{dataset}/from-url',\n 'assets/media-library-link/{dataset}'\n ],\n slug: 'assets',\n title: 'Assets API reference'\n },\n {\n defaultApiVersion: 'v2025-02-19',\n host: 'global',\n pathPatterns: [\n 'projects/{projectId}/datasets/{datasetName}/backups',\n 'projects/{projectId}/datasets/{datasetName}/backups/{backupId}',\n 'projects/{projectId}/datasets/{datasetName}/settings/backups'\n ],\n slug: 'backups',\n title: 'Backups API reference'\n },\n {\n defaultApiVersion: 'v1',\n host: 'global',\n pathPatterns: [\n 'projects/{project_id}/datasets/{dataset_name}/assets/{asset_id}/purges',\n 'projects/{project_id}/datasets/{dataset_name}/purges'\n ],\n slug: 'cdn-cache-purge',\n title: 'CDN Cache Purge API Reference'\n },\n {\n defaultApiVersion: 'vX',\n host: 'global',\n pathPatterns: [\n 'agent/prompt',\n 'agent/{organizationId}/threads/{threadId}'\n ],\n slug: 'content-agent',\n title: 'Content Agent API reference'\n },\n {\n defaultApiVersion: 'v2025-02-19',\n host: 'global',\n pathPatterns: [\n 'projects/{projectId}/datasets/{dataset}/copy'\n ],\n slug: 'copy',\n title: 'Copy API reference'\n },\n {\n defaultApiVersion: 'v2025-02-19',\n host: 'project',\n pathPatterns: [\n 'data/doc/{dataset}/{documentId}'\n ],\n slug: 'doc',\n title: 'Doc API reference'\n },\n {\n defaultApiVersion: 'vX',\n host: 'project',\n pathPatterns: [\n 'embeddings-index/query/{dataset}/{indexName}',\n 'embeddings-index/{dataset}',\n 'embeddings-index/{dataset}/{indexName}'\n ],\n slug: 'embeddings-index',\n title: 'Embeddings Index API reference (deprecated)'\n },\n {\n defaultApiVersion: 'v2021-03-25',\n host: 'project',\n pathPatterns: [\n 'data/export/{dataset}'\n ],\n slug: 'export',\n title: 'Export API reference'\n },\n {\n host: 'global',\n pathPatterns: [\n 'functions',\n 'functions/{functionId}',\n 'functions/{functionId}/envvars',\n 'functions/{functionId}/envvars/{envVarKey}',\n 'functions/{functionId}/invoke',\n 'functions/{functionId}/logs',\n 'functions/{functionId}/logs/stream'\n ],\n slug: 'functions-api',\n title: 'Functions API reference'\n },\n {\n defaultApiVersion: 'v2025-02-19',\n host: 'project',\n pathPatterns: [\n 'data/history/{dataset}/documents/{documentId}',\n 'data/history/{dataset}/transactions',\n 'data/history/{dataset}/transactions/{documentIds}'\n ],\n slug: 'history',\n title: 'History API reference'\n },\n {\n defaultApiVersion: 'v2021-06-07',\n host: 'global',\n pathPatterns: [\n 'jobs/{jobId}',\n 'jobs/{jobId}/listen'\n ],\n slug: 'jobs',\n title: 'Jobs API reference'\n },\n {\n defaultApiVersion: 'v2025-02-19',\n host: 'project',\n pathPatterns: [\n 'data/listen/{dataset}'\n ],\n slug: 'listen',\n title: 'Listen API reference'\n },\n {\n defaultApiVersion: 'v2025-02-19',\n host: 'project',\n pathPatterns: [\n 'data/live/events/{dataset}'\n ],\n slug: 'live',\n title: 'Live Content API reference'\n },\n {\n defaultApiVersion: 'v2025-02-19',\n host: 'global',\n pathPatterns: [\n 'media-libraries/{libraryId}/from-url',\n 'media-libraries/{libraryId}/mutate',\n 'media-libraries/{libraryId}/query',\n 'media-libraries/{libraryId}/references/documents/{assetId}/to',\n 'media-libraries/{libraryId}/refsearch',\n 'media-libraries/{libraryId}/signing-keys',\n 'media-libraries/{libraryId}/signing-keys/{keyId}',\n 'media-libraries/{libraryId}/upload',\n 'media-libraries/{libraryId}/video/{videoId}/playback-info',\n 'media-libraries/{libraryId}/video/{videoId}/playback/{type}',\n 'media-libraries/{libraryId}/video/{videoId}/renditions/{name}',\n 'media-libraries/{libraryId}/video/{videoId}/subtitles',\n 'media-libraries/{libraryId}/video/{videoId}/subtitles/upload',\n 'media-libraries/{libraryId}/video/{videoId}/subtitles/{subtitleId}'\n ],\n slug: 'media-library',\n title: 'Media Library API reference'\n },\n {\n defaultApiVersion: 'v2025-02-19',\n host: 'project',\n pathPatterns: [\n 'media-libraries/{libraryId}/from-url',\n 'media-libraries/{libraryId}/mutate',\n 'media-libraries/{libraryId}/query',\n 'media-libraries/{libraryId}/references/documents/{assetId}/to',\n 'media-libraries/{libraryId}/refsearch',\n 'media-libraries/{libraryId}/signing-keys',\n 'media-libraries/{libraryId}/signing-keys/{keyId}',\n 'media-libraries/{libraryId}/upload',\n 'media-libraries/{libraryId}/video/{videoId}/playback-info',\n 'media-libraries/{libraryId}/video/{videoId}/playback/{type}',\n 'media-libraries/{libraryId}/video/{videoId}/renditions/{name}',\n 'media-libraries/{libraryId}/video/{videoId}/subtitles',\n 'media-libraries/{libraryId}/video/{videoId}/subtitles/upload',\n 'media-libraries/{libraryId}/video/{videoId}/subtitles/{subtitleId}'\n ],\n slug: 'media-library',\n title: 'Media Library API reference'\n },\n {\n defaultApiVersion: 'v2025-02-19',\n host: 'project',\n pathPatterns: [\n 'data/mutate/{dataset}'\n ],\n slug: 'mutation',\n title: 'Mutation API reference'\n },\n {\n defaultApiVersion: 'v2021-06-07',\n host: 'global',\n pathPatterns: [\n 'projects',\n 'projects/{projectId}',\n 'projects/{projectId}/cors',\n 'projects/{projectId}/cors/{id}',\n 'projects/{projectId}/datasets',\n 'projects/{projectId}/datasets/{datasetName}/tags/{tagIdentifier}',\n 'projects/{projectId}/datasets/{name}',\n 'projects/{projectId}/datasets/{name}/copy',\n 'projects/{projectId}/datasets/{name}/settings/embeddings',\n 'projects/{projectId}/datasets/{name}/tags',\n 'projects/{projectId}/features',\n 'projects/{projectId}/permissions',\n 'projects/{projectId}/tags',\n 'projects/{projectId}/tags/{tagIdentifier}',\n 'projects/{projectId}/tokens',\n 'projects/{projectId}/tokens/{tokenId}',\n 'projects/{projectId}/users/{userId}'\n ],\n slug: 'projects-api',\n title: 'Projects API reference'\n },\n {\n defaultApiVersion: 'v2025-02-19',\n host: 'project',\n pathPatterns: [\n 'data/query/{dataset}'\n ],\n slug: 'query',\n title: 'Query API reference'\n },\n {\n defaultApiVersion: 'v2021-10-04',\n host: 'global',\n pathPatterns: [\n 'organizations/{organizationId}/acl',\n 'organizations/{organizationId}/acl/{sanityUserId}',\n 'organizations/{organizationId}/grants',\n 'organizations/{organizationId}/providers/{providerId}/projects/{projectId}/role-mappings',\n 'projects/{projectId}/acl',\n 'projects/{projectId}/acl/{userId}',\n 'projects/{projectId}/datasets/{datasetName}/acl',\n 'projects/{projectId}/datasets/{datasetName}/grants',\n 'projects/{projectId}/grants',\n 'projects/{projectId}/permissionResourceSchemas',\n 'projects/{projectId}/roles',\n 'projects/{projectId}/roles/{roleName}'\n ],\n slug: 'roles',\n title: 'Roles API reference'\n },\n {\n defaultApiVersion: 'v2022-04-01',\n host: 'project',\n pathPatterns: [\n 'publish/{projectId}/{dataset}',\n 'schedules/{projectId}/{dataset}',\n 'schedules/{projectId}/{dataset}/{scheduleId}',\n 'schedules/{projectId}/{dataset}/{scheduleId}/publish',\n 'unpublish/{projectId}/{dataset}'\n ],\n slug: 'scheduling',\n title: 'Scheduling API reference'\n },\n {\n defaultApiVersion: 'v2026-04-27',\n host: 'global',\n pathPatterns: [\n 'organizations/{organizationId}/attribute-definitions',\n 'organizations/{organizationId}/attribute-definitions/{key}',\n 'organizations/{organizationId}/users/me/attributes',\n 'organizations/{organizationId}/users/{sanityUserId}/attributes'\n ],\n slug: 'user-attributes',\n title: 'User attributes API reference'\n },\n {\n defaultApiVersion: 'v2025-02-19',\n host: 'project',\n pathPatterns: [\n 'hooks/projects/{projectId}',\n 'hooks/projects/{projectId}/{id}',\n 'hooks/projects/{projectId}/{id}/attempts',\n 'hooks/{id}/messages'\n ],\n slug: 'webhooks',\n title: 'Webhooks API reference'\n }\n]\n"],"names":["apiRoutes","defaultApiVersion","host","pathPatterns","slug","title"],"mappings":"AAAA;;;;;;;CAOC,GAGD,OAAO,MAAMA,YAA6B;IACxC;QACEC,mBAAmB;QACnBC,MAAM;QACNC,cAAc;YACZ;YACA;YACA;YACA;YACA;YACA;YACA;YACA;YACA;YACA;YACA;YACA;YACA;YACA;YACA;YACA;YACA;YACA;YACA;YACA;YACA;YACA;YACA;YACA;YACA;YACA;YACA;SACD;QACDC,MAAM;QACNC,OAAO;IACT;IACA;QACEJ,mBAAmB;QACnBC,MAAM;QACNC,cAAc;YACZ;SACD;QACDC,MAAM;QACNC,OAAO;IACT;IACA;QACEJ,mBAAmB;QACnBC,MAAM;QACNC,cAAc;YACZ;YACA;SACD;QACDC,MAAM;QACNC,OAAO;IACT;IACA;QACEJ,mBAAmB;QACnBC,MAAM;QACNC,cAAc;YACZ;YACA;YACA;YACA;YACA;SACD;QACDC,MAAM;QACNC,OAAO;IACT;IACA;QACEH,MAAM;QACNC,cAAc;YACZ;YACA;YACA;YACA;YACA;YACA;YACA;YACA;YACA;YACA;YACA;YACA;YACA;YACA;YACA;YACA;YACA;YACA;YACA;YACA;YACA;YACA;YACA;YACA;YACA;YACA;YACA;YACA;YACA;YACA;YACA;YACA;YACA;YACA;SACD;QACDC,MAAM;QACNC,OAAO;IACT;IACA;QACEH,MAAM;QACNC,cAAc;YACZ;YACA;YACA;YACA;YACA;YACA;YACA;YACA;YACA;YACA;YACA;YACA;YACA;YACA;YACA;YACA;YACA;YACA;YACA;YACA;YACA;YACA;YACA;YACA;YACA;YACA;YACA;YACA;YACA;YACA;YACA;YACA;YACA;YACA;SACD;QACDC,MAAM;QACNC,OAAO;IACT;IACA;QACEJ,mBAAmB;QACnBC,MAAM;QACNC,cAAc;YACZ;YACA;YACA;YACA;YACA;SACD;QACDC,MAAM;QACNC,OAAO;IACT;IACA;QACEJ,mBAAmB;QACnBC,MAAM;QACNC,cAAc;YACZ;YACA;YACA;SACD;QACDC,MAAM;QACNC,OAAO;IACT;IACA;QACEJ,mBAAmB;QACnBC,MAAM;QACNC,cAAc;YACZ;YACA;SACD;QACDC,MAAM;QACNC,OAAO;IACT;IACA;QACEJ,mBAAmB;QACnBC,MAAM;QACNC,cAAc;YACZ;YACA;SACD;QACDC,MAAM;QACNC,OAAO;IACT;IACA;QACEJ,mBAAmB;QACnBC,MAAM;QACNC,cAAc;YACZ;SACD;QACDC,MAAM;QACNC,OAAO;IACT;IACA;QACEJ,mBAAmB;QACnBC,MAAM;QACNC,cAAc;YACZ;SACD;QACDC,MAAM;QACNC,OAAO;IACT;IACA;QACEJ,mBAAmB;QACnBC,MAAM;QACNC,cAAc;YACZ;YACA;YACA;SACD;QACDC,MAAM;QACNC,OAAO;IACT;IACA;QACEJ,mBAAmB;QACnBC,MAAM;QACNC,cAAc;YACZ;SACD;QACDC,MAAM;QACNC,OAAO;IACT;IACA;QACEH,MAAM;QACNC,cAAc;YACZ;YACA;YACA;YACA;YACA;YACA;YACA;SACD;QACDC,MAAM;QACNC,OAAO;IACT;IACA;QACEJ,mBAAmB;QACnBC,MAAM;QACNC,cAAc;YACZ;YACA;YACA;SACD;QACDC,MAAM;QACNC,OAAO;IACT;IACA;QACEJ,mBAAmB;QACnBC,MAAM;QACNC,cAAc;YACZ;YACA;SACD;QACDC,MAAM;QACNC,OAAO;IACT;IACA;QACEJ,mBAAmB;QACnBC,MAAM;QACNC,cAAc;YACZ;SACD;QACDC,MAAM;QACNC,OAAO;IACT;IACA;QACEJ,mBAAmB;QACnBC,MAAM;QACNC,cAAc;YACZ;SACD;QACDC,MAAM;QACNC,OAAO;IACT;IACA;QACEJ,mBAAmB;QACnBC,MAAM;QACNC,cAAc;YACZ;YACA;YACA;YACA;YACA;YACA;YACA;YACA;YACA;YACA;YACA;YACA;YACA;YACA;SACD;QACDC,MAAM;QACNC,OAAO;IACT;IACA;QACEJ,mBAAmB;QACnBC,MAAM;QACNC,cAAc;YACZ;YACA;YACA;YACA;YACA;YACA;YACA;YACA;YACA;YACA;YACA;YACA;YACA;YACA;SACD;QACDC,MAAM;QACNC,OAAO;IACT;IACA;QACEJ,mBAAmB;QACnBC,MAAM;QACNC,cAAc;YACZ;SACD;QACDC,MAAM;QACNC,OAAO;IACT;IACA;QACEJ,mBAAmB;QACnBC,MAAM;QACNC,cAAc;YACZ;YACA;YACA;YACA;YACA;YACA;YACA;YACA;YACA;YACA;YACA;YACA;YACA;YACA;YACA;YACA;YACA;SACD;QACDC,MAAM;QACNC,OAAO;IACT;IACA;QACEJ,mBAAmB;QACnBC,MAAM;QACNC,cAAc;YACZ;SACD;QACDC,MAAM;QACNC,OAAO;IACT;IACA;QACEJ,mBAAmB;QACnBC,MAAM;QACNC,cAAc;YACZ;YACA;YACA;YACA;YACA;YACA;YACA;YACA;YACA;YACA;YACA;YACA;SACD;QACDC,MAAM;QACNC,OAAO;IACT;IACA;QACEJ,mBAAmB;QACnBC,MAAM;QACNC,cAAc;YACZ;YACA;YACA;YACA;YACA;SACD;QACDC,MAAM;QACNC,OAAO;IACT;IACA;QACEJ,mBAAmB;QACnBC,MAAM;QACNC,cAAc;YACZ;YACA;YACA;YACA;SACD;QACDC,MAAM;QACNC,OAAO;IACT;IACA;QACEJ,mBAAmB;QACnBC,MAAM;QACNC,cAAc;YACZ;YACA;YACA;YACA;SACD;QACDC,MAAM;QACNC,OAAO;IACT;CACD,CAAA"}
|
|
1
|
+
{"version":3,"sources":["../../src/generated/apiRoutes.ts"],"sourcesContent":["/**\n * GENERATED FILE - DO NOT EDIT\n *\n * Routing manifest for `sanity api`, distilled from the published OpenAPI\n * specifications at https://www.sanity.io/docs/api/openapi\n *\n * Regenerate with: pnpm generate:api-routes\n */\nimport {type ApiRouteEntry} from '../actions/api/types.js'\n\nexport const apiRoutes: ApiRouteEntry[] = [\n {\n defaultApiVersion: 'v2025-07-11',\n host: 'global',\n pathPatterns: [\n 'access/invites/me',\n 'access/organization/{resourceId}/users/roles/default',\n 'access/requests/me',\n 'access/robots/me',\n 'access/robots/me/rotate',\n 'access/{resourceType}/{resourceId}/invites',\n 'access/{resourceType}/{resourceId}/invites/token/{inviteToken}',\n 'access/{resourceType}/{resourceId}/invites/token/{inviteToken}/accept',\n 'access/{resourceType}/{resourceId}/invites/token/{inviteToken}/eligibility',\n 'access/{resourceType}/{resourceId}/invites/{inviteId}',\n 'access/{resourceType}/{resourceId}/permissions',\n 'access/{resourceType}/{resourceId}/permissions/{permissionName}',\n 'access/{resourceType}/{resourceId}/requests',\n 'access/{resourceType}/{resourceId}/requests/state',\n 'access/{resourceType}/{resourceId}/requests/{requestId}/accept',\n 'access/{resourceType}/{resourceId}/requests/{requestId}/decline',\n 'access/{resourceType}/{resourceId}/robots',\n 'access/{resourceType}/{resourceId}/robots/{robotId}',\n 'access/{resourceType}/{resourceId}/roles',\n 'access/{resourceType}/{resourceId}/roles/{roleName}',\n 'access/{resourceType}/{resourceId}/user-permissions/me',\n 'access/{resourceType}/{resourceId}/user-permissions/me/check',\n 'access/{resourceType}/{resourceId}/users',\n 'access/{resourceType}/{resourceId}/users/me',\n 'access/{resourceType}/{resourceId}/users/{sanityUserId}',\n 'access/{resourceType}/{resourceId}/users/{sanityUserId}/roles',\n 'access/{resourceType}/{resourceId}/users/{sanityUserId}/roles/{roleName}'\n ],\n slug: 'access-api',\n title: 'Access API reference'\n },\n {\n defaultApiVersion: 'v2025-02-19',\n host: 'project',\n pathPatterns: [\n 'data/actions/{dataset}'\n ],\n slug: 'actions',\n title: 'Actions API reference'\n },\n {\n defaultApiVersion: 'v2021-02-01',\n host: 'global',\n pathPatterns: [\n 'activity',\n 'activity/export/csv'\n ],\n slug: 'activity-log',\n title: 'Activity Log API Reference'\n },\n {\n defaultApiVersion: 'vX',\n host: 'project',\n pathPatterns: [\n 'agent/action/generate/{dataset}',\n 'agent/action/patch/{dataset}',\n 'agent/action/prompt/{dataset}',\n 'agent/action/transform/{dataset}',\n 'agent/action/translate/{dataset}'\n ],\n slug: 'agent-actions',\n title: 'Agent Actions'\n },\n {\n host: 'global',\n pathPatterns: [\n 'applications',\n 'applications/{applicationId}',\n 'applications/{applicationId}/access',\n 'applications/{applicationId}/deployments',\n 'applications/{applicationId}/embeddable',\n 'applications/{applicationId}/installations',\n 'applications/{applicationId}/interfaces',\n 'applications/{applicationId}/workspaces',\n 'deploy',\n 'deploy/quickstart',\n 'installations',\n 'installations/ai-features',\n 'installations/catalog',\n 'installations/defaults',\n 'installations/{installationId}',\n 'installations/{installationId}/access',\n 'installations/{installationId}/configs',\n 'installations/{installationId}/configs/{configId}',\n 'installations/{installationId}/interfaces',\n 'organizations/{organizationId}/applications/{applicationId}',\n 'projects/{projectId}/user-applications',\n 'projects/{projectId}/user-applications/{userApplicationId}',\n 'projects/{projectId}/user-applications/{userApplicationId}/config/{configKey}',\n 'projects/{projectId}/user-applications/{userApplicationId}/deployments',\n 'studiohosts/{appHost}/availability',\n 'user-applications',\n 'user-applications/auto-update-version/{userApplicationId}',\n 'user-applications/resolve/application',\n 'user-applications/resolve/project',\n 'user-applications/workspaces',\n 'user-applications/{userApplicationId}',\n 'user-applications/{userApplicationId}/applicationData',\n 'user-applications/{userApplicationId}/config/{configKey}',\n 'user-applications/{userApplicationId}/deployments',\n 'user-applications/{userApplicationId}/workspaces'\n ],\n slug: 'applications-api',\n title: 'Applications API Reference'\n },\n {\n host: 'project',\n pathPatterns: [\n 'applications',\n 'applications/{applicationId}',\n 'applications/{applicationId}/access',\n 'applications/{applicationId}/deployments',\n 'applications/{applicationId}/embeddable',\n 'applications/{applicationId}/installations',\n 'applications/{applicationId}/interfaces',\n 'applications/{applicationId}/workspaces',\n 'deploy',\n 'deploy/quickstart',\n 'installations',\n 'installations/ai-features',\n 'installations/catalog',\n 'installations/defaults',\n 'installations/{installationId}',\n 'installations/{installationId}/access',\n 'installations/{installationId}/configs',\n 'installations/{installationId}/configs/{configId}',\n 'installations/{installationId}/interfaces',\n 'organizations/{organizationId}/applications/{applicationId}',\n 'projects/{projectId}/user-applications',\n 'projects/{projectId}/user-applications/{userApplicationId}',\n 'projects/{projectId}/user-applications/{userApplicationId}/config/{configKey}',\n 'projects/{projectId}/user-applications/{userApplicationId}/deployments',\n 'studiohosts/{appHost}/availability',\n 'user-applications',\n 'user-applications/auto-update-version/{userApplicationId}',\n 'user-applications/resolve/application',\n 'user-applications/resolve/project',\n 'user-applications/workspaces',\n 'user-applications/{userApplicationId}',\n 'user-applications/{userApplicationId}/applicationData',\n 'user-applications/{userApplicationId}/config/{configKey}',\n 'user-applications/{userApplicationId}/deployments',\n 'user-applications/{userApplicationId}/workspaces'\n ],\n slug: 'applications-api',\n title: 'Applications API Reference'\n },\n {\n defaultApiVersion: 'v2024-06-24',\n host: 'project',\n pathPatterns: [\n 'assets/files/{dataset}',\n 'assets/files/{dataset}/from-url',\n 'assets/images/{dataset}',\n 'assets/images/{dataset}/from-url',\n 'assets/media-library-link/{dataset}'\n ],\n slug: 'assets',\n title: 'Assets API reference'\n },\n {\n defaultApiVersion: 'v2025-02-19',\n host: 'global',\n pathPatterns: [\n 'projects/{projectId}/datasets/{datasetName}/backups',\n 'projects/{projectId}/datasets/{datasetName}/backups/{backupId}',\n 'projects/{projectId}/datasets/{datasetName}/settings/backups'\n ],\n slug: 'backups',\n title: 'Backups API reference'\n },\n {\n defaultApiVersion: 'v1',\n host: 'global',\n pathPatterns: [\n 'projects/{project_id}/datasets/{dataset_name}/assets/{asset_id}/purges',\n 'projects/{project_id}/datasets/{dataset_name}/purges'\n ],\n slug: 'cdn-cache-purge',\n title: 'CDN Cache Purge API Reference'\n },\n {\n defaultApiVersion: 'vX',\n host: 'global',\n pathPatterns: [\n 'agent/prompt',\n 'agent/{organizationId}/threads/{threadId}'\n ],\n slug: 'content-agent',\n title: 'Content Agent API reference'\n },\n {\n defaultApiVersion: 'v2025-02-19',\n host: 'global',\n pathPatterns: [\n 'projects/{projectId}/datasets/{dataset}/copy'\n ],\n slug: 'copy',\n title: 'Copy API reference'\n },\n {\n defaultApiVersion: 'v2025-02-19',\n host: 'project',\n pathPatterns: [\n 'data/doc/{dataset}/{documentId}'\n ],\n slug: 'doc',\n title: 'Doc API reference'\n },\n {\n defaultApiVersion: 'vX',\n host: 'project',\n pathPatterns: [\n 'embeddings-index/query/{dataset}/{indexName}',\n 'embeddings-index/{dataset}',\n 'embeddings-index/{dataset}/{indexName}'\n ],\n slug: 'embeddings-index',\n title: 'Embeddings Index API reference (deprecated)'\n },\n {\n defaultApiVersion: 'v2021-03-25',\n host: 'project',\n pathPatterns: [\n 'data/export/{dataset}'\n ],\n slug: 'export',\n title: 'Export API reference'\n },\n {\n host: 'global',\n pathPatterns: [\n 'functions',\n 'functions/{functionId}',\n 'functions/{functionId}/envvars',\n 'functions/{functionId}/envvars/{envVarKey}',\n 'functions/{functionId}/invoke',\n 'functions/{functionId}/logs',\n 'functions/{functionId}/logs/stream'\n ],\n slug: 'functions-api',\n title: 'Functions API reference'\n },\n {\n defaultApiVersion: 'v2025-02-19',\n host: 'project',\n pathPatterns: [\n 'data/history/{dataset}/documents/{documentId}',\n 'data/history/{dataset}/transactions',\n 'data/history/{dataset}/transactions/{documentIds}'\n ],\n slug: 'history',\n title: 'History API reference'\n },\n {\n defaultApiVersion: 'v2021-06-07',\n host: 'global',\n pathPatterns: [\n 'jobs/{jobId}',\n 'jobs/{jobId}/listen'\n ],\n slug: 'jobs',\n title: 'Jobs API reference'\n },\n {\n defaultApiVersion: 'v2025-02-19',\n host: 'project',\n pathPatterns: [\n 'data/listen/{dataset}'\n ],\n slug: 'listen',\n title: 'Listen API reference'\n },\n {\n defaultApiVersion: 'v2025-02-19',\n host: 'project',\n pathPatterns: [\n 'data/live/events/{dataset}'\n ],\n slug: 'live',\n title: 'Live Content API reference'\n },\n {\n defaultApiVersion: 'v2025-02-19',\n host: 'global',\n pathPatterns: [\n 'media-libraries/{libraryId}/from-url',\n 'media-libraries/{libraryId}/mutate',\n 'media-libraries/{libraryId}/query',\n 'media-libraries/{libraryId}/references/documents/{assetId}/to',\n 'media-libraries/{libraryId}/refsearch',\n 'media-libraries/{libraryId}/signing-keys',\n 'media-libraries/{libraryId}/signing-keys/{keyId}',\n 'media-libraries/{libraryId}/upload',\n 'media-libraries/{libraryId}/video/{videoId}/playback-info',\n 'media-libraries/{libraryId}/video/{videoId}/playback/{type}',\n 'media-libraries/{libraryId}/video/{videoId}/renditions/{name}',\n 'media-libraries/{libraryId}/video/{videoId}/subtitles',\n 'media-libraries/{libraryId}/video/{videoId}/subtitles/upload',\n 'media-libraries/{libraryId}/video/{videoId}/subtitles/{subtitleId}'\n ],\n slug: 'media-library',\n title: 'Media Library API reference'\n },\n {\n defaultApiVersion: 'v2025-02-19',\n host: 'project',\n pathPatterns: [\n 'media-libraries/{libraryId}/from-url',\n 'media-libraries/{libraryId}/mutate',\n 'media-libraries/{libraryId}/query',\n 'media-libraries/{libraryId}/references/documents/{assetId}/to',\n 'media-libraries/{libraryId}/refsearch',\n 'media-libraries/{libraryId}/signing-keys',\n 'media-libraries/{libraryId}/signing-keys/{keyId}',\n 'media-libraries/{libraryId}/upload',\n 'media-libraries/{libraryId}/video/{videoId}/playback-info',\n 'media-libraries/{libraryId}/video/{videoId}/playback/{type}',\n 'media-libraries/{libraryId}/video/{videoId}/renditions/{name}',\n 'media-libraries/{libraryId}/video/{videoId}/subtitles',\n 'media-libraries/{libraryId}/video/{videoId}/subtitles/upload',\n 'media-libraries/{libraryId}/video/{videoId}/subtitles/{subtitleId}'\n ],\n slug: 'media-library',\n title: 'Media Library API reference'\n },\n {\n defaultApiVersion: 'v2025-02-19',\n host: 'project',\n pathPatterns: [\n 'data/mutate/{dataset}'\n ],\n slug: 'mutation',\n title: 'Mutation API reference'\n },\n {\n defaultApiVersion: 'v2021-06-07',\n host: 'global',\n pathPatterns: [\n 'projects',\n 'projects/{projectId}',\n 'projects/{projectId}/cors',\n 'projects/{projectId}/cors/{id}',\n 'projects/{projectId}/datasets',\n 'projects/{projectId}/datasets/{datasetName}/tags/{tagIdentifier}',\n 'projects/{projectId}/datasets/{name}',\n 'projects/{projectId}/datasets/{name}/copy',\n 'projects/{projectId}/datasets/{name}/settings/embeddings',\n 'projects/{projectId}/datasets/{name}/tags',\n 'projects/{projectId}/features',\n 'projects/{projectId}/permissions',\n 'projects/{projectId}/tags',\n 'projects/{projectId}/tags/{tagIdentifier}',\n 'projects/{projectId}/tokens',\n 'projects/{projectId}/tokens/{tokenId}',\n 'projects/{projectId}/users/{userId}'\n ],\n slug: 'projects-api',\n title: 'Projects API reference'\n },\n {\n defaultApiVersion: 'v2025-02-19',\n host: 'project',\n pathPatterns: [\n 'data/query/{dataset}'\n ],\n slug: 'query',\n title: 'Query API reference'\n },\n {\n defaultApiVersion: 'v2021-10-04',\n host: 'global',\n pathPatterns: [\n 'organizations/{organizationId}/acl',\n 'organizations/{organizationId}/acl/{sanityUserId}',\n 'organizations/{organizationId}/grants',\n 'organizations/{organizationId}/providers/{providerId}/projects/{projectId}/role-mappings',\n 'projects/{projectId}/acl',\n 'projects/{projectId}/acl/{userId}',\n 'projects/{projectId}/datasets/{datasetName}/acl',\n 'projects/{projectId}/datasets/{datasetName}/grants',\n 'projects/{projectId}/grants',\n 'projects/{projectId}/permissionResourceSchemas',\n 'projects/{projectId}/roles',\n 'projects/{projectId}/roles/{roleName}'\n ],\n slug: 'roles',\n title: 'Roles API reference'\n },\n {\n defaultApiVersion: 'v2022-04-01',\n host: 'project',\n pathPatterns: [\n 'publish/{projectId}/{dataset}',\n 'schedules/{projectId}/{dataset}',\n 'schedules/{projectId}/{dataset}/{scheduleId}',\n 'schedules/{projectId}/{dataset}/{scheduleId}/publish',\n 'unpublish/{projectId}/{dataset}'\n ],\n slug: 'scheduling',\n title: 'Scheduling API reference'\n },\n {\n defaultApiVersion: 'v2026-04-27',\n host: 'global',\n pathPatterns: [\n 'organizations/{organizationId}/attribute-definitions',\n 'organizations/{organizationId}/attribute-definitions/{key}',\n 'organizations/{organizationId}/users/me/attributes',\n 'organizations/{organizationId}/users/{sanityUserId}/attributes'\n ],\n slug: 'user-attributes',\n title: 'User attributes API reference'\n },\n {\n defaultApiVersion: 'v2025-02-19',\n host: 'project',\n pathPatterns: [\n 'hooks/projects/{projectId}',\n 'hooks/projects/{projectId}/{id}',\n 'hooks/projects/{projectId}/{id}/attempts',\n 'hooks/{id}/messages'\n ],\n slug: 'webhooks',\n title: 'Webhooks API reference'\n }\n]\n"],"names":["apiRoutes","defaultApiVersion","host","pathPatterns","slug","title"],"mappings":"AAAA;;;;;;;CAOC,GAGD,OAAO,MAAMA,YAA6B;IACxC;QACEC,mBAAmB;QACnBC,MAAM;QACNC,cAAc;YACZ;YACA;YACA;YACA;YACA;YACA;YACA;YACA;YACA;YACA;YACA;YACA;YACA;YACA;YACA;YACA;YACA;YACA;YACA;YACA;YACA;YACA;YACA;YACA;YACA;YACA;YACA;SACD;QACDC,MAAM;QACNC,OAAO;IACT;IACA;QACEJ,mBAAmB;QACnBC,MAAM;QACNC,cAAc;YACZ;SACD;QACDC,MAAM;QACNC,OAAO;IACT;IACA;QACEJ,mBAAmB;QACnBC,MAAM;QACNC,cAAc;YACZ;YACA;SACD;QACDC,MAAM;QACNC,OAAO;IACT;IACA;QACEJ,mBAAmB;QACnBC,MAAM;QACNC,cAAc;YACZ;YACA;YACA;YACA;YACA;SACD;QACDC,MAAM;QACNC,OAAO;IACT;IACA;QACEH,MAAM;QACNC,cAAc;YACZ;YACA;YACA;YACA;YACA;YACA;YACA;YACA;YACA;YACA;YACA;YACA;YACA;YACA;YACA;YACA;YACA;YACA;YACA;YACA;YACA;YACA;YACA;YACA;YACA;YACA;YACA;YACA;YACA;YACA;YACA;YACA;YACA;YACA;YACA;SACD;QACDC,MAAM;QACNC,OAAO;IACT;IACA;QACEH,MAAM;QACNC,cAAc;YACZ;YACA;YACA;YACA;YACA;YACA;YACA;YACA;YACA;YACA;YACA;YACA;YACA;YACA;YACA;YACA;YACA;YACA;YACA;YACA;YACA;YACA;YACA;YACA;YACA;YACA;YACA;YACA;YACA;YACA;YACA;YACA;YACA;YACA;YACA;SACD;QACDC,MAAM;QACNC,OAAO;IACT;IACA;QACEJ,mBAAmB;QACnBC,MAAM;QACNC,cAAc;YACZ;YACA;YACA;YACA;YACA;SACD;QACDC,MAAM;QACNC,OAAO;IACT;IACA;QACEJ,mBAAmB;QACnBC,MAAM;QACNC,cAAc;YACZ;YACA;YACA;SACD;QACDC,MAAM;QACNC,OAAO;IACT;IACA;QACEJ,mBAAmB;QACnBC,MAAM;QACNC,cAAc;YACZ;YACA;SACD;QACDC,MAAM;QACNC,OAAO;IACT;IACA;QACEJ,mBAAmB;QACnBC,MAAM;QACNC,cAAc;YACZ;YACA;SACD;QACDC,MAAM;QACNC,OAAO;IACT;IACA;QACEJ,mBAAmB;QACnBC,MAAM;QACNC,cAAc;YACZ;SACD;QACDC,MAAM;QACNC,OAAO;IACT;IACA;QACEJ,mBAAmB;QACnBC,MAAM;QACNC,cAAc;YACZ;SACD;QACDC,MAAM;QACNC,OAAO;IACT;IACA;QACEJ,mBAAmB;QACnBC,MAAM;QACNC,cAAc;YACZ;YACA;YACA;SACD;QACDC,MAAM;QACNC,OAAO;IACT;IACA;QACEJ,mBAAmB;QACnBC,MAAM;QACNC,cAAc;YACZ;SACD;QACDC,MAAM;QACNC,OAAO;IACT;IACA;QACEH,MAAM;QACNC,cAAc;YACZ;YACA;YACA;YACA;YACA;YACA;YACA;SACD;QACDC,MAAM;QACNC,OAAO;IACT;IACA;QACEJ,mBAAmB;QACnBC,MAAM;QACNC,cAAc;YACZ;YACA;YACA;SACD;QACDC,MAAM;QACNC,OAAO;IACT;IACA;QACEJ,mBAAmB;QACnBC,MAAM;QACNC,cAAc;YACZ;YACA;SACD;QACDC,MAAM;QACNC,OAAO;IACT;IACA;QACEJ,mBAAmB;QACnBC,MAAM;QACNC,cAAc;YACZ;SACD;QACDC,MAAM;QACNC,OAAO;IACT;IACA;QACEJ,mBAAmB;QACnBC,MAAM;QACNC,cAAc;YACZ;SACD;QACDC,MAAM;QACNC,OAAO;IACT;IACA;QACEJ,mBAAmB;QACnBC,MAAM;QACNC,cAAc;YACZ;YACA;YACA;YACA;YACA;YACA;YACA;YACA;YACA;YACA;YACA;YACA;YACA;YACA;SACD;QACDC,MAAM;QACNC,OAAO;IACT;IACA;QACEJ,mBAAmB;QACnBC,MAAM;QACNC,cAAc;YACZ;YACA;YACA;YACA;YACA;YACA;YACA;YACA;YACA;YACA;YACA;YACA;YACA;YACA;SACD;QACDC,MAAM;QACNC,OAAO;IACT;IACA;QACEJ,mBAAmB;QACnBC,MAAM;QACNC,cAAc;YACZ;SACD;QACDC,MAAM;QACNC,OAAO;IACT;IACA;QACEJ,mBAAmB;QACnBC,MAAM;QACNC,cAAc;YACZ;YACA;YACA;YACA;YACA;YACA;YACA;YACA;YACA;YACA;YACA;YACA;YACA;YACA;YACA;YACA;YACA;SACD;QACDC,MAAM;QACNC,OAAO;IACT;IACA;QACEJ,mBAAmB;QACnBC,MAAM;QACNC,cAAc;YACZ;SACD;QACDC,MAAM;QACNC,OAAO;IACT;IACA;QACEJ,mBAAmB;QACnBC,MAAM;QACNC,cAAc;YACZ;YACA;YACA;YACA;YACA;YACA;YACA;YACA;YACA;YACA;YACA;YACA;SACD;QACDC,MAAM;QACNC,OAAO;IACT;IACA;QACEJ,mBAAmB;QACnBC,MAAM;QACNC,cAAc;YACZ;YACA;YACA;YACA;YACA;SACD;QACDC,MAAM;QACNC,OAAO;IACT;IACA;QACEJ,mBAAmB;QACnBC,MAAM;QACNC,cAAc;YACZ;YACA;YACA;YACA;SACD;QACDC,MAAM;QACNC,OAAO;IACT;IACA;QACEJ,mBAAmB;QACnBC,MAAM;QACNC,cAAc;YACZ;YACA;YACA;YACA;SACD;QACDC,MAAM;QACNC,OAAO;IACT;CACD,CAAA"}
|