@mesadev/sdk 0.42.1 → 0.44.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.
Files changed (54) hide show
  1. package/dist/api/access-token.d.ts +57 -24
  2. package/dist/api/access-token.d.ts.map +1 -1
  3. package/dist/api/access-token.js +137 -19
  4. package/dist/api/access-token.js.map +1 -1
  5. package/dist/api/client.d.ts +3 -5
  6. package/dist/api/client.d.ts.map +1 -1
  7. package/dist/api/client.js +4 -19
  8. package/dist/api/client.js.map +1 -1
  9. package/dist/api/credentials.d.ts +4 -0
  10. package/dist/api/credentials.d.ts.map +1 -0
  11. package/dist/api/credentials.js +8 -0
  12. package/dist/api/credentials.js.map +1 -0
  13. package/dist/api/index.d.ts +1 -1
  14. package/dist/api/index.d.ts.map +1 -1
  15. package/dist/api/index.js.map +1 -1
  16. package/dist/api/resources.d.ts +61 -29
  17. package/dist/api/resources.d.ts.map +1 -1
  18. package/dist/api/resources.js +47 -14
  19. package/dist/api/resources.js.map +1 -1
  20. package/dist/api/signing-key.d.ts +15 -0
  21. package/dist/api/signing-key.d.ts.map +1 -0
  22. package/dist/api/signing-key.js +38 -0
  23. package/dist/api/signing-key.js.map +1 -0
  24. package/dist/fs/index.d.ts +2 -1
  25. package/dist/fs/index.d.ts.map +1 -1
  26. package/dist/fs/index.js +1 -0
  27. package/dist/fs/index.js.map +1 -1
  28. package/dist/fs/layout.d.ts +87 -0
  29. package/dist/fs/layout.d.ts.map +1 -0
  30. package/dist/fs/layout.js +78 -0
  31. package/dist/fs/layout.js.map +1 -0
  32. package/dist/fs/mesa-file-system.d.ts +41 -2
  33. package/dist/fs/mesa-file-system.d.ts.map +1 -1
  34. package/dist/fs/mesa-file-system.js +23 -5
  35. package/dist/fs/mesa-file-system.js.map +1 -1
  36. package/dist/fs/native-loader.d.ts +8 -1
  37. package/dist/fs/native-loader.d.ts.map +1 -1
  38. package/dist/fs/native-loader.js +26 -4
  39. package/dist/fs/native-loader.js.map +1 -1
  40. package/dist/index.d.ts +3 -3
  41. package/dist/index.d.ts.map +1 -1
  42. package/dist/index.js +1 -1
  43. package/dist/index.js.map +1 -1
  44. package/dist/lib/errors.d.ts +1 -1
  45. package/dist/lib/errors.d.ts.map +1 -1
  46. package/dist/lib/errors.js +5 -2
  47. package/dist/lib/errors.js.map +1 -1
  48. package/dist/mesa.d.ts +163 -23
  49. package/dist/mesa.d.ts.map +1 -1
  50. package/dist/mesa.js +302 -45
  51. package/dist/mesa.js.map +1 -1
  52. package/dist/version.d.ts +1 -1
  53. package/dist/version.js +1 -1
  54. package/package.json +5 -3
package/dist/mesa.js CHANGED
@@ -1,17 +1,22 @@
1
- import { ACCESS_TOKEN_DEFAULT_TTL_SECONDS, signAccessToken } from './api/access-token.js';
1
+ import { z } from 'zod';
2
+ import { normalizeSigningKeyAuthors, signAccessToken, signPrivateKeyAccessToken, toApiRepositoryRestriction, toSignerRepositoryRestriction, } from './api/access-token.js';
2
3
  import { createRestClient } from './api/client.js';
3
4
  import { createApiResources, } from './api/resources.js';
5
+ import { looksLikePrivateKey } from './api/credentials.js';
6
+ import { parsePrivateKey } from './api/signing-key.js';
7
+ import { createLayout } from './fs/layout.js';
4
8
  import { MesaFileSystem, } from './fs/mesa-file-system.js';
5
9
  import { InvalidApiUrlError, InvalidOptionsError, MissingCredentialError, OrgResolutionError } from './lib/errors.js';
6
10
  const DEFAULT_API_URL = 'https://api.mesa.dev/v1';
7
11
  const API_KEY_ENV_VAR = 'MESA_API_KEY';
8
- /**
9
- * Default requested scopes when a caller does not specify any (used both for
10
- * `tokens.create` and for filesystem mounts). The server clamps these to the
11
- * key's actual scopes at verify time, so requesting the full set just means "as
12
- * much as this key allows"; per-repo read-only is enforced client-side.
13
- */
12
+ const PRIVATE_KEY_ENV_VAR = 'MESA_PRIVATE_KEY';
13
+ const ACCESS_TOKEN_ORG_PATTERN = /^[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$/;
14
+ /** Historical `tokens.create()` default and least-authority MesaFS mount scopes. */
14
15
  const DEFAULT_TOKEN_SCOPES = ['read', 'write'];
16
+ const authSchema = z.union([
17
+ z.strictObject({ privateKey: z.string().trim().min(1) }),
18
+ z.strictObject({ accessToken: z.string().trim().min(1) }),
19
+ ]);
15
20
  function getEnvVar(name) {
16
21
  if (typeof process === 'undefined') {
17
22
  return undefined;
@@ -19,6 +24,9 @@ function getEnvVar(name) {
19
24
  return process.env[name]?.trim();
20
25
  }
21
26
  function normalizeUrl(input) {
27
+ if (looksLikePrivateKey(input)) {
28
+ throw new InvalidApiUrlError('Mesa private keys cannot be used as URLs');
29
+ }
22
30
  let parsed;
23
31
  try {
24
32
  parsed = new URL(input);
@@ -32,20 +40,76 @@ function normalizeUrl(input) {
32
40
  parsed.pathname = parsed.pathname.replace(/\/+$/, '') || '/';
33
41
  return parsed.toString().replace(/\/$/, '');
34
42
  }
43
+ function normalizeBearerCredential(credential) {
44
+ const normalized = credential.trim();
45
+ if (normalized.length === 0) {
46
+ throw new InvalidOptionsError('Bearer credentials must be non-empty strings.');
47
+ }
48
+ if (looksLikePrivateKey(normalized)) {
49
+ throw new InvalidOptionsError('Received a Mesa private key where a bearer credential was expected. Configure it with `privateKey` or `auth.privateKey`.');
50
+ }
51
+ if (/^Bearer\s+/i.test(normalized)) {
52
+ throw new InvalidOptionsError('Pass only the token or API key value, without the `Bearer` scheme.');
53
+ }
54
+ return normalized;
55
+ }
56
+ function getAccessTokenOrg(token) {
57
+ try {
58
+ const parts = token.split('.');
59
+ if (parts.length !== 3 || parts.some((part) => part.length === 0))
60
+ throw new Error();
61
+ const payload = JSON.parse(Buffer.from(parts[1], 'base64url').toString('utf8'));
62
+ if (typeof payload.iss !== 'string' || !ACCESS_TOKEN_ORG_PATTERN.test(payload.iss))
63
+ throw new Error();
64
+ return payload.iss;
65
+ }
66
+ catch {
67
+ throw new InvalidOptionsError('Access tokens must be compact JWTs with a valid organization `iss` claim.');
68
+ }
69
+ }
35
70
  /**
36
- * Resolve the client's API key from explicit options or the environment. The
37
- * SDK client is always constructed from an API key it signs the short-lived
38
- * access tokens that mounts and requests run on.
71
+ * Resolve one explicit or environment credential. Explicit credentials never
72
+ * combine, and the existing API-key environment variable remains authoritative
73
+ * during migration when both environment variables are set.
39
74
  */
40
- function resolveApiKey(options) {
41
- const apiKey = options.apiKey?.trim() || getEnvVar(API_KEY_ENV_VAR);
42
- if (apiKey) {
43
- return apiKey;
75
+ function resolveCredential(options) {
76
+ const explicitCredentialCount = [options.apiKey, options.privateKey, options.auth].filter((credential) => credential !== undefined).length;
77
+ if (explicitCredentialCount > 1) {
78
+ throw new InvalidOptionsError('Pass exactly one of `apiKey`, `privateKey`, or `auth`.');
79
+ }
80
+ if (options.auth !== undefined) {
81
+ const parsed = authSchema.safeParse(options.auth);
82
+ if (!parsed.success) {
83
+ throw new InvalidOptionsError('`auth` accepts exactly one non-empty `privateKey` or `accessToken`.');
84
+ }
85
+ if ('privateKey' in parsed.data) {
86
+ return { kind: 'privateKey', value: parsePrivateKey(parsed.data.privateKey) };
87
+ }
88
+ const value = normalizeBearerCredential(parsed.data.accessToken);
89
+ return {
90
+ kind: 'accessToken',
91
+ value,
92
+ org: getAccessTokenOrg(value),
93
+ };
94
+ }
95
+ if (options.privateKey !== undefined) {
96
+ return { kind: 'privateKey', value: parsePrivateKey(options.privateKey) };
97
+ }
98
+ if (options.apiKey !== undefined) {
99
+ return { kind: 'apiKey', value: normalizeBearerCredential(options.apiKey) };
100
+ }
101
+ const environmentApiKey = getEnvVar(API_KEY_ENV_VAR);
102
+ if (environmentApiKey !== undefined) {
103
+ return { kind: 'apiKey', value: normalizeBearerCredential(environmentApiKey) };
44
104
  }
45
- throw new MissingCredentialError(API_KEY_ENV_VAR);
105
+ const environmentPrivateKey = getEnvVar(PRIVATE_KEY_ENV_VAR);
106
+ if (environmentPrivateKey !== undefined) {
107
+ return { kind: 'privateKey', value: parsePrivateKey(environmentPrivateKey) };
108
+ }
109
+ throw new MissingCredentialError(API_KEY_ENV_VAR, PRIVATE_KEY_ENV_VAR);
46
110
  }
47
111
  export class Mesa {
48
- /** The API key this client was constructed with. */
112
+ /** The API key this client was constructed with, if it is an API-key client. */
49
113
  apiKey;
50
114
  apiUrl;
51
115
  vcsUrl;
@@ -69,19 +133,46 @@ export class Mesa {
69
133
  cachedKeyId = null;
70
134
  keyIdResolutionPromise = null;
71
135
  constructor(options = {}) {
72
- this.apiKey = resolveApiKey(options);
73
- this.credential = this.apiKey;
136
+ if (options.authors !== undefined) {
137
+ throw new InvalidOptionsError('The `authors` option is not accepted by the Mesa constructor. Pass authors to the operation instead.');
138
+ }
139
+ const resolvedCredential = resolveCredential(options);
140
+ this.credential = resolvedCredential;
141
+ this.apiKey = resolvedCredential.kind === 'apiKey' ? resolvedCredential.value : undefined;
74
142
  this.apiUrl = normalizeUrl(options.apiUrl?.trim() || DEFAULT_API_URL);
75
143
  this.vcsUrl = normalizeUrl(options.vcsUrl?.trim() || new URL(this.apiUrl).origin);
144
+ if (options.userAgent && looksLikePrivateKey(options.userAgent)) {
145
+ throw new InvalidOptionsError('User-agent metadata must not contain Mesa private key material.');
146
+ }
147
+ const providedOrg = options.org?.trim();
148
+ if (providedOrg && looksLikePrivateKey(providedOrg)) {
149
+ throw new InvalidOptionsError('Organization options must not contain Mesa private key material.');
150
+ }
151
+ if (resolvedCredential.kind === 'privateKey' && providedOrg && providedOrg !== resolvedCredential.value.org) {
152
+ throw new InvalidOptionsError('The `org` option must match the organization encoded in the private key.');
153
+ }
154
+ if (resolvedCredential.kind === 'accessToken' && providedOrg && providedOrg !== resolvedCredential.org) {
155
+ throw new InvalidOptionsError('The `org` option must match the organization encoded in the access token.');
156
+ }
76
157
  this.restClient = createRestClient({
77
- credential: this.credential,
158
+ credential: resolvedCredential.kind === 'privateKey'
159
+ ? () => signPrivateKeyAccessToken({ credential: resolvedCredential.value }).token
160
+ : resolvedCredential.value,
78
161
  apiUrl: this.apiUrl,
79
162
  fetch: options.fetch,
80
163
  userAgent: options.userAgent,
81
- vcsUrl: this.vcsUrl,
82
164
  });
83
- const providedOrg = options.org?.trim();
84
- if (providedOrg) {
165
+ if (resolvedCredential.kind === 'privateKey') {
166
+ this.cachedOrgSlug = resolvedCredential.value.org;
167
+ this.orgResolutionPromise = Promise.resolve(resolvedCredential.value.org);
168
+ this.whoAmIResolutionPromise = null;
169
+ }
170
+ else if (resolvedCredential.kind === 'accessToken') {
171
+ this.cachedOrgSlug = resolvedCredential.org;
172
+ this.orgResolutionPromise = Promise.resolve(resolvedCredential.org);
173
+ this.whoAmIResolutionPromise = null;
174
+ }
175
+ else if (providedOrg) {
85
176
  this.cachedOrgSlug = providedOrg;
86
177
  this.orgResolutionPromise = Promise.resolve(providedOrg);
87
178
  this.whoAmIResolutionPromise = null;
@@ -97,6 +188,14 @@ export class Mesa {
97
188
  resolveOrg: (org) => this.resolveOrg(org),
98
189
  webhookSecret: options.webhookSecret,
99
190
  signToken: (input) => this.signToken(input),
191
+ requestAttribution: resolvedCredential.kind === 'privateKey'
192
+ ? {
193
+ kind: 'private-key',
194
+ sign: (authors) => signPrivateKeyAccessToken({ credential: resolvedCredential.value, authors }).token,
195
+ }
196
+ : resolvedCredential.kind === 'accessToken'
197
+ ? { kind: 'fixed-token' }
198
+ : { kind: 'request' },
100
199
  });
101
200
  this.org = resources.org;
102
201
  this.tokens = resources.tokens;
@@ -108,44 +207,177 @@ export class Mesa {
108
207
  this.diffs = resources.diffs;
109
208
  this.webhookTargets = resources.webhookTargets;
110
209
  this.webhooks = resources.webhooks;
111
- this.fs = {
210
+ // Layout minting and mounting are reachable only through a definition;
211
+ // the layout carries no organization, so the client's org scopes both.
212
+ const mintLayoutToken = async (layout, ttl, authors) => {
213
+ // Run the core structural validator before minting so a malformed
214
+ // layout fails here with the mount's own error. Repository names
215
+ // resolve only at mount time — a layout naming a nonexistent
216
+ // repository still mints a token and fails at mount.
217
+ MesaFileSystem.validateLayout(layout.toString());
218
+ const { org, scopes, repos } = await this.deriveLayoutTokenRequest(layout, 'mesa.fs({ layout }).token()');
219
+ const tokenInput = { org, scopes, repos, ttl_seconds: ttl };
220
+ return resources.tokens.create(this.credential.kind === 'privateKey' ? { ...tokenInput, authors: authors } : tokenInput);
221
+ };
222
+ const mountLayout = async (definitionLayout, ttl, authors, options) => {
223
+ const { layout, org, scopes, repos } = await this.deriveLayoutTokenRequest(definitionLayout, 'mesa.fs({ layout }).mount()');
224
+ if (this.credential.kind === 'accessToken') {
225
+ return this.createFs(org, options, this.credential.value, layout);
226
+ }
227
+ // Mint a single access token for the mount's whole lifetime. There is
228
+ // no refresh and no credential hot-swap, so when the token expires the
229
+ // mount expires with it.
230
+ const tokenInput = { org, scopes, repos, ttl_seconds: ttl };
231
+ const token = this.credential.kind === 'privateKey'
232
+ ? signPrivateKeyAccessToken({
233
+ credential: this.credential.value,
234
+ authors: authors,
235
+ scopes: tokenInput.scopes,
236
+ repos: tokenInput.repos,
237
+ ttlSeconds: tokenInput.ttl_seconds,
238
+ }).token
239
+ : (await resources.tokens.create(tokenInput)).token;
240
+ return this.createFs(org, options, token, layout);
241
+ };
242
+ const defineLayout = ({ layout, ttl, authors: authorsInput }) => {
243
+ if (layout === undefined) {
244
+ // Catches untyped callers passing a bare path map instead of options.
245
+ throw new InvalidOptionsError("mesa.fs() requires a 'layout'");
246
+ }
247
+ const authors = authorsInput === undefined ? undefined : normalizeSigningKeyAuthors(authorsInput);
248
+ if (this.credential.kind === 'privateKey' && authors === undefined) {
249
+ throw new InvalidOptionsError('Private-key layout definitions require a nonempty `authors` option.');
250
+ }
251
+ if (this.credential.kind !== 'privateKey' && authors !== undefined) {
252
+ throw new InvalidOptionsError('Layout authors require a private-key client.');
253
+ }
254
+ if (this.credential.kind === 'accessToken' && ttl !== undefined) {
255
+ throw new InvalidOptionsError('The lifetime of an existing access token cannot be changed.');
256
+ }
257
+ // Built eagerly, so an invalid record fails here at definition time.
258
+ const prepared = createLayout(layout);
259
+ const definition = {
260
+ layout: () => prepared,
261
+ mount: (options = {}) => mountLayout(prepared, ttl, authors, options),
262
+ token: () => mintLayoutToken(prepared, ttl, authors),
263
+ };
264
+ return definition;
265
+ };
266
+ this.fs = Object.assign(defineLayout, {
267
+ /**
268
+ * Canonical mount profile: mount exactly the listed repositories at
269
+ * their `/org/repo` paths with explicit repo visibility, a name-scoped
270
+ * token, and offline signing with no name→id resolution round-trip.
271
+ * Layouts mount through a definition: `mesa.fs({ layout }).mount()`.
272
+ */
112
273
  mount: async (fsOptions) => {
113
- if (fsOptions.repos.length === 0) {
274
+ const authors = fsOptions.authors === undefined ? undefined : normalizeSigningKeyAuthors(fsOptions.authors);
275
+ if (this.credential.kind === 'privateKey' && authors === undefined) {
276
+ throw new InvalidOptionsError('Private-key mounts require a nonempty `authors` option.');
277
+ }
278
+ if (this.credential.kind !== 'privateKey' && authors !== undefined) {
279
+ throw new InvalidOptionsError('Mount authors require a private-key client.');
280
+ }
281
+ const canonicalRepos = fsOptions.repos;
282
+ if (canonicalRepos === undefined) {
283
+ // Untyped callers may still pass the retired layout form.
284
+ throw new InvalidOptionsError('mesa.fs.mount() mounts the canonical repos profile; mount a layout with mesa.fs({ layout }).mount()');
285
+ }
286
+ if (canonicalRepos.length === 0) {
114
287
  throw new InvalidOptionsError('mesa.fs.mount() requires at least one repo');
115
288
  }
116
289
  const org = await this.resolveOrg();
117
- // Scope the token to the mounted repos as full `org/repo` names. The
118
- // server resolves names → ids at verify time, so no network call is
119
- // needed to resolve ids here.
120
- const repos = fsOptions.repos.map((r) => `${org}/${r.name}`);
121
- // Mint a single access token for the mount's whole lifetime. There is no
122
- // refresh and no credential hot-swap: when the token expires, the mount
123
- // expires with it.
124
- const { token } = await this.tokens.create({
290
+ if (this.credential.kind === 'accessToken') {
291
+ if (fsOptions.ttl !== undefined) {
292
+ throw new InvalidOptionsError('The lifetime of an existing access token cannot be changed by `fs.mount()`.');
293
+ }
294
+ return this.createFs(org, fsOptions, this.credential.value);
295
+ }
296
+ const tokenInput = {
125
297
  org,
126
298
  scopes: DEFAULT_TOKEN_SCOPES,
127
- repos,
128
- ttl_seconds: fsOptions.ttl ?? ACCESS_TOKEN_DEFAULT_TTL_SECONDS,
129
- });
299
+ repos: canonicalRepos.map((r) => `${org}/${r.name}`),
300
+ ttl_seconds: fsOptions.ttl,
301
+ };
302
+ const token = this.credential.kind === 'privateKey'
303
+ ? signPrivateKeyAccessToken({
304
+ credential: this.credential.value,
305
+ authors: authors,
306
+ scopes: tokenInput.scopes,
307
+ repos: tokenInput.repos,
308
+ ttlSeconds: tokenInput.ttl_seconds,
309
+ }).token
310
+ : (await resources.tokens.create(tokenInput)).token;
130
311
  return this.createFs(org, fsOptions, token);
131
312
  },
132
- };
313
+ });
133
314
  }
134
- createFs(org, fsOptions, credential) {
135
- const config = {
315
+ createFs(org, fsOptions, credential, layout) {
316
+ const base = {
136
317
  org,
137
318
  credential,
138
- repos: fsOptions.repos,
139
319
  cache: fsOptions.cache,
140
320
  apiBaseUrl: this.apiUrl,
141
321
  vcsUrl: this.vcsUrl,
142
322
  telemetry: fsOptions.telemetry,
143
323
  };
324
+ // The canonical repos profile keeps explicit repo visibility; the layout
325
+ // profile presents exactly the composed workspace, replacing the
326
+ // canonical browse tree, so per-repo visibility does not apply.
327
+ const config = layout !== undefined
328
+ ? { ...base, repos: [], layout, mountedRepos: 'all' }
329
+ : { ...base, repos: fsOptions.repos ?? [], mountedRepos: (fsOptions.repos ?? []).map((repo) => repo.name) };
144
330
  return MesaFileSystem.create(config);
145
331
  }
332
+ /**
333
+ * Derive the least-privilege token request for a layout: its repositories
334
+ * collected from every declaration and scoped by name (signed offline, no
335
+ * repository lookup), plus the narrowest scopes the declared modes allow.
336
+ * Shared by the definition's `mount()` and `token()` so the derivation
337
+ * exists exactly once.
338
+ */
339
+ async deriveLayoutTokenRequest(layout, caller) {
340
+ // The layout carries no organization of its own; the client's
341
+ // organization scopes the token.
342
+ const org = await this.resolveOrg();
343
+ const declarations = [];
344
+ const visit = (entries) => {
345
+ for (const entry of Object.values(entries)) {
346
+ for (const declaration of Array.isArray(entry) ? entry : [entry]) {
347
+ declarations.push(declaration);
348
+ if (declaration.subPaths)
349
+ visit(declaration.subPaths);
350
+ }
351
+ }
352
+ };
353
+ // The spec is a pure path map: every key is a declaration entry.
354
+ visit(layout.spec);
355
+ if (declarations.length === 0) {
356
+ throw new InvalidOptionsError(`${caller} requires at least one layout repository`);
357
+ }
358
+ const repos = [...new Set(declarations.map((declaration) => `${org}/${declaration.name}`))];
359
+ const scopes = declarations.some((declaration) => declaration.mode === 'rw') ? [...DEFAULT_TOKEN_SCOPES] : ['read'];
360
+ return { layout, org, scopes, repos };
361
+ }
146
362
  async resolveOrg(org) {
147
- if (org?.trim()) {
148
- return org;
363
+ const requestedOrg = org?.trim();
364
+ if (requestedOrg && looksLikePrivateKey(requestedOrg)) {
365
+ throw new InvalidOptionsError('Organization options must not contain Mesa private key material.');
366
+ }
367
+ if (this.credential.kind === 'privateKey') {
368
+ if (requestedOrg && requestedOrg !== this.credential.value.org) {
369
+ throw new InvalidOptionsError('Private-key clients are bound to the organization encoded in the key.');
370
+ }
371
+ return this.credential.value.org;
372
+ }
373
+ if (this.credential.kind === 'accessToken') {
374
+ if (requestedOrg && requestedOrg !== this.credential.org) {
375
+ throw new InvalidOptionsError('Access-token clients are bound to the organization encoded in the token.');
376
+ }
377
+ return this.credential.org;
378
+ }
379
+ if (requestedOrg) {
380
+ return requestedOrg;
149
381
  }
150
382
  if (this.cachedOrgSlug) {
151
383
  return this.cachedOrgSlug;
@@ -201,21 +433,46 @@ export class Mesa {
201
433
  });
202
434
  return this.keyIdResolutionPromise;
203
435
  }
204
- /** Sign an access token locally from the raw API key this client holds. */
436
+ /** Sign an access token locally from the credential this client holds. */
205
437
  async signToken(input) {
438
+ if (this.credential.kind === 'privateKey') {
439
+ if (input.authors === undefined) {
440
+ throw new InvalidOptionsError('Private-key tokens require a nonempty `authors` option.');
441
+ }
442
+ const signed = signPrivateKeyAccessToken({
443
+ credential: this.credential.value,
444
+ authors: input.authors,
445
+ scopes: input.scopes ?? [...DEFAULT_TOKEN_SCOPES],
446
+ ttlSeconds: input.ttl_seconds,
447
+ ...toSignerRepositoryRestriction(input),
448
+ });
449
+ return {
450
+ token: signed.token,
451
+ expires_at: signed.expiresAt,
452
+ scopes: signed.scopes,
453
+ ...toApiRepositoryRestriction(signed),
454
+ };
455
+ }
456
+ if (this.credential.kind === 'accessToken') {
457
+ throw new InvalidOptionsError('Access-token clients cannot mint another access token. Use an API key or private key.');
458
+ }
459
+ if (input.authors !== undefined) {
460
+ throw new InvalidOptionsError('Private-key access tokens can only be minted with a private key.');
461
+ }
206
462
  const keyId = await this.resolveKeyId();
463
+ const repositoryRestriction = toSignerRepositoryRestriction(input);
207
464
  const signed = signAccessToken({
208
465
  apiKeyId: keyId,
209
- rawApiKey: this.apiKey,
466
+ rawApiKey: this.credential.value,
210
467
  scopes: input.scopes ?? [...DEFAULT_TOKEN_SCOPES],
211
- repos: input.repos ?? null,
212
468
  ttlSeconds: input.ttl_seconds,
469
+ ...repositoryRestriction,
213
470
  });
214
471
  return {
215
472
  token: signed.token,
216
473
  expires_at: signed.expiresAt,
217
474
  scopes: signed.scopes,
218
- repos: signed.repos,
475
+ ...toApiRepositoryRestriction(signed),
219
476
  };
220
477
  }
221
478
  async resolveOrgFromWhoAmI(whoAmIPromise) {
package/dist/mesa.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"mesa.js","sourceRoot":"","sources":["../src/mesa.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,gCAAgC,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAC1F,OAAO,EAAE,gBAAgB,EAAmB,MAAM,iBAAiB,CAAC;AACpE,OAAO,EAEL,kBAAkB,GAGnB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EACL,cAAc,GAIf,MAAM,0BAA0B,CAAC;AAClC,OAAO,EAAE,kBAAkB,EAAE,mBAAmB,EAAE,sBAAsB,EAAE,kBAAkB,EAAE,MAAM,iBA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ACnC,OAAO,MAAM,CAAC,GAAG,CAAC,IAAI,CAAC;QACzB,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,MAAM,IAAI,kBAAkB,CAC1B,+GAA+G,EAC/G,EAAE,KAAK,EAAE,KAAK,EAAE,CACjB,CAAC;QACJ,CAAC;IACH,CAAC;CACF"}
package/dist/version.d.ts CHANGED
@@ -1,2 +1,2 @@
1
- export declare const SDK_VERSION = "0.42.1";
1
+ export declare const SDK_VERSION = "0.44.0";
2
2
  //# sourceMappingURL=version.d.ts.map
package/dist/version.js CHANGED
@@ -1,3 +1,3 @@
1
1
  // Generated by pnpm run stamp:version. Do not edit.
2
- export const SDK_VERSION = "0.42.1";
2
+ export const SDK_VERSION = "0.44.0";
3
3
  //# sourceMappingURL=version.js.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mesadev/sdk",
3
- "version": "0.42.1",
3
+ "version": "0.44.0",
4
4
  "description": "Official Mesa TypeScript SDK",
5
5
  "type": "module",
6
6
  "sideEffects": false,
@@ -25,8 +25,8 @@
25
25
  "node": ">=18"
26
26
  },
27
27
  "dependencies": {
28
- "@mesadev/mesafs-napi": "0.42.1",
29
- "@mesadev/rest": "0.42.1",
28
+ "@mesadev/mesafs-napi": "0.44.0",
29
+ "@mesadev/rest": "0.44.0",
30
30
  "just-bash": "^2.13.0",
31
31
  "zod": "^4.3.6"
32
32
  },
@@ -44,6 +44,8 @@
44
44
  "scripts": {
45
45
  "stamp:version": "node scripts/stamp-version.mjs",
46
46
  "typecheck": "tsc --noEmit -p tsconfig.typecheck.json",
47
+ "test": "pnpm run test:unit",
48
+ "test:unit": "pnpm run stamp:version && vitest run",
47
49
  "clean": "rm -rf dist",
48
50
  "build": "pnpm run stamp:version && pnpm run clean && pnpm --dir ../rest/ts run build && tsc -b tsconfig.build.json"
49
51
  }