@vectros-ai/mcp-server 0.13.0 → 0.14.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/CHANGELOG.md +9 -0
- package/dist/cli-http.js +394 -5
- package/dist/cli-http.js.map +1 -1
- package/dist/cli-http.mjs +394 -5
- package/dist/cli-http.mjs.map +1 -1
- package/dist/cli.js +394 -5
- package/dist/cli.js.map +1 -1
- package/dist/cli.mjs +394 -5
- package/dist/cli.mjs.map +1 -1
- package/dist/index.d.mts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +394 -5
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +394 -5
- package/dist/index.mjs.map +1 -1
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,15 @@
|
|
|
3
3
|
All notable changes to `@vectros-ai/mcp-server` are documented here.
|
|
4
4
|
This project adheres to [Semantic Versioning](https://semver.org).
|
|
5
5
|
|
|
6
|
+
## 0.14.0
|
|
7
|
+
|
|
8
|
+
### Changed
|
|
9
|
+
|
|
10
|
+
- **Repinned to `@vectros-ai/sdk` 0.39.0.**
|
|
11
|
+
- **The `st_*` short-lived-token warning now states a 1-hour maximum, matching the
|
|
12
|
+
platform's narrowed cap** — it previously read "(1h default, 24h max)"; the 24h
|
|
13
|
+
ceiling no longer exists, so it now reads "(1h max)".
|
|
14
|
+
|
|
6
15
|
## 0.13.0
|
|
7
16
|
|
|
8
17
|
### Added
|
package/dist/cli-http.js
CHANGED
|
@@ -87,6 +87,7 @@ __export(api_exports, {
|
|
|
87
87
|
TooManyRequestsError: () => TooManyRequestsError,
|
|
88
88
|
TruncationWarningEvent: () => TruncationWarningEvent,
|
|
89
89
|
UnauthorizedError: () => UnauthorizedError,
|
|
90
|
+
UserExistsResponse: () => UserExistsResponse,
|
|
90
91
|
UserRequest: () => UserRequest,
|
|
91
92
|
UserResponse: () => UserResponse,
|
|
92
93
|
auth: () => auth_exports,
|
|
@@ -763,6 +764,14 @@ var TruncationWarningEvent;
|
|
|
763
764
|
ContextWindowBudget: "context_window_budget"
|
|
764
765
|
};
|
|
765
766
|
})(TruncationWarningEvent || (TruncationWarningEvent = {}));
|
|
767
|
+
var UserExistsResponse;
|
|
768
|
+
((UserExistsResponse2) => {
|
|
769
|
+
UserExistsResponse2.Status = {
|
|
770
|
+
Active: "ACTIVE",
|
|
771
|
+
Suspended: "SUSPENDED",
|
|
772
|
+
Pending: "PENDING"
|
|
773
|
+
};
|
|
774
|
+
})(UserExistsResponse || (UserExistsResponse = {}));
|
|
766
775
|
var UserRequest;
|
|
767
776
|
((UserRequest2) => {
|
|
768
777
|
UserRequest2.Status = {
|
|
@@ -2506,7 +2515,7 @@ var AuthClient = class {
|
|
|
2506
2515
|
return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/v1/admin/keys/scoped");
|
|
2507
2516
|
}
|
|
2508
2517
|
/**
|
|
2509
|
-
* Creates a scoped API key (an `ssk_*` secret) that inherits its permissions from an existing access profile in your account. The call is idempotent on the combination of tenant, context, user, and key name: re-issuing the same request returns the existing key WITHOUT re-disclosing its raw secret. The raw key is returned ONLY in this response — store it securely, as it cannot be retrieved again. Requires the `keys:c` scope.
|
|
2518
|
+
* Creates a scoped API key (an `ssk_*` secret) that inherits its permissions from an existing access profile in your account. The call is idempotent on the combination of tenant, context, user, and key name: re-issuing the same request returns the existing key WITHOUT re-disclosing its raw secret. The raw key is returned ONLY in this response — store it securely, as it cannot be retrieved again. Requires the `keys:c` scope. If you use a scoped credential, `keys:c` alone is not sufficient: because the minted key is durably bound to the profile you name, the profile's effective scopes may not exceed your own, and you may only mint against a profile whose `identityOverrides` values your own identity holds. A root API key (`sk_`) is exempt from both bounds.
|
|
2510
2519
|
*
|
|
2511
2520
|
* @param {Vectros.CreateScopedKeyRequest} request
|
|
2512
2521
|
* @param {AuthClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
@@ -3256,11 +3265,12 @@ var AuthClient = class {
|
|
|
3256
3265
|
);
|
|
3257
3266
|
}
|
|
3258
3267
|
/**
|
|
3259
|
-
* Updates an access profile. This is a partial update: any field you omit (or send as null) keeps its existing value. A profile must reference either inline `scopes` or a `roleId`, never both — so setting `scopes` clears any `roleId`, and setting `roleId` clears any inline `scopes`. The `contextId` and `principalId` are immutable. Status changes (for example active to suspended) take effect within about five minutes. If you use a scoped credential, the profile's effective scopes may not exceed your own, and its `identityOverrides` are bounded twice: you may only set a value your own identity holds, and you may only change or clear a value the profile already holds if that value is yours as well. Repointing or clearing another principal's established identity therefore returns 403. A root API key (`sk_`) is exempt. Requires the `profiles:u` scope.
|
|
3268
|
+
* Updates an access profile. This is a partial update: any field you omit (or send as null) keeps its existing value. A profile must reference either inline `scopes` or a `roleId`, never both — so setting `scopes` clears any `roleId`, and setting `roleId` clears any inline `scopes`. The `contextId` and `principalId` are immutable. Status changes (for example active to suspended) take effect within about five minutes. If you use a scoped credential, the profile's effective scopes may not exceed your own, and its `identityOverrides` are bounded twice: you may only set a value your own identity holds, and you may only change or clear a value the profile already holds if that value is yours as well. Repointing or clearing another principal's established identity therefore returns 403. A root API key (`sk_`) is exempt. If you set `roleId`, it must reference a role that already exists in this context. Requires the `profiles:u` scope.
|
|
3260
3269
|
*
|
|
3261
3270
|
* @param {Vectros.UpdateAccessProfileRequest} request
|
|
3262
3271
|
* @param {AuthClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
3263
3272
|
*
|
|
3273
|
+
* @throws {@link Vectros.BadRequestError}
|
|
3264
3274
|
* @throws {@link Vectros.ForbiddenError}
|
|
3265
3275
|
* @throws {@link Vectros.NotFoundError}
|
|
3266
3276
|
* @throws {@link Vectros.TooManyRequestsError}
|
|
@@ -3307,6 +3317,8 @@ var AuthClient = class {
|
|
|
3307
3317
|
}
|
|
3308
3318
|
if (_response.error.reason === "status-code") {
|
|
3309
3319
|
switch (_response.error.statusCode) {
|
|
3320
|
+
case 400:
|
|
3321
|
+
throw new BadRequestError(_response.error.body, _response.rawResponse);
|
|
3310
3322
|
case 403:
|
|
3311
3323
|
throw new ForbiddenError(_response.error.body, _response.rawResponse);
|
|
3312
3324
|
case 404:
|
|
@@ -3998,6 +4010,254 @@ var AuthClient = class {
|
|
|
3998
4010
|
}
|
|
3999
4011
|
return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/v1/usage");
|
|
4000
4012
|
}
|
|
4013
|
+
/**
|
|
4014
|
+
* Retrieves a single registered issuer by issuerId. Requires a root API key or the bootstrap's provisioning capability.
|
|
4015
|
+
*
|
|
4016
|
+
* @param {Vectros.GetIssuerRequest} request
|
|
4017
|
+
* @param {AuthClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
4018
|
+
*
|
|
4019
|
+
* @throws {@link Vectros.ForbiddenError}
|
|
4020
|
+
* @throws {@link Vectros.NotFoundError}
|
|
4021
|
+
*
|
|
4022
|
+
* @example
|
|
4023
|
+
* await client.auth.getIssuer({
|
|
4024
|
+
* issuerId: "auth0-prod"
|
|
4025
|
+
* })
|
|
4026
|
+
*/
|
|
4027
|
+
getIssuer(request, requestOptions) {
|
|
4028
|
+
return HttpResponsePromise.fromPromise(this.__getIssuer(request, requestOptions));
|
|
4029
|
+
}
|
|
4030
|
+
async __getIssuer(request, requestOptions) {
|
|
4031
|
+
const { issuerId } = request;
|
|
4032
|
+
const _authRequest = await this._options.authProvider.getAuthRequest();
|
|
4033
|
+
const _headers = mergeHeaders(
|
|
4034
|
+
_authRequest.headers,
|
|
4035
|
+
this._options?.headers,
|
|
4036
|
+
requestOptions?.headers
|
|
4037
|
+
);
|
|
4038
|
+
const _response = await fetcher({
|
|
4039
|
+
url: url_exports.join(
|
|
4040
|
+
await Supplier.get(this._options.baseUrl) ?? await Supplier.get(this._options.environment),
|
|
4041
|
+
`v1/auth/issuers/${url_exports.encodePathParam(issuerId)}`
|
|
4042
|
+
),
|
|
4043
|
+
method: "GET",
|
|
4044
|
+
headers: _headers,
|
|
4045
|
+
queryString: url_exports.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(),
|
|
4046
|
+
timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1e3,
|
|
4047
|
+
maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries,
|
|
4048
|
+
abortSignal: requestOptions?.abortSignal,
|
|
4049
|
+
fetchFn: this._options?.fetch,
|
|
4050
|
+
logging: this._options.logging
|
|
4051
|
+
});
|
|
4052
|
+
if (_response.ok) {
|
|
4053
|
+
return { data: _response.body, rawResponse: _response.rawResponse };
|
|
4054
|
+
}
|
|
4055
|
+
if (_response.error.reason === "status-code") {
|
|
4056
|
+
switch (_response.error.statusCode) {
|
|
4057
|
+
case 403:
|
|
4058
|
+
throw new ForbiddenError(_response.error.body, _response.rawResponse);
|
|
4059
|
+
case 404:
|
|
4060
|
+
throw new NotFoundError(_response.error.body, _response.rawResponse);
|
|
4061
|
+
default:
|
|
4062
|
+
throw new VectrosError({
|
|
4063
|
+
statusCode: _response.error.statusCode,
|
|
4064
|
+
body: _response.error.body,
|
|
4065
|
+
rawResponse: _response.rawResponse
|
|
4066
|
+
});
|
|
4067
|
+
}
|
|
4068
|
+
}
|
|
4069
|
+
return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/v1/auth/issuers/{issuerId}");
|
|
4070
|
+
}
|
|
4071
|
+
/**
|
|
4072
|
+
* Deregisters a trusted third-party IdP issuer. Requires a root API key or the bootstrap's provisioning capability. Unconditional — unlike some other registry deletes on this API, this does not check for or block on any downstream reference. Any user account already created via this issuer (by a prior self-signup or accepted invite) is NOT deleted or modified, but that user can no longer obtain a NEW token this way once you deregister the issuer — every `POST /v1/auth/token/exchange` call against it will 404, with no distinction between an unknown issuer and one you just deregistered. Register a replacement issuer, or restore this one, before your users' current tokens expire if you want their access to continue uninterrupted.
|
|
4073
|
+
*
|
|
4074
|
+
* @param {Vectros.DeleteIssuerRequest} request
|
|
4075
|
+
* @param {AuthClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
4076
|
+
*
|
|
4077
|
+
* @throws {@link Vectros.ForbiddenError}
|
|
4078
|
+
* @throws {@link Vectros.NotFoundError}
|
|
4079
|
+
* @throws {@link Vectros.TooManyRequestsError}
|
|
4080
|
+
*
|
|
4081
|
+
* @example
|
|
4082
|
+
* await client.auth.deleteIssuer({
|
|
4083
|
+
* issuerId: "auth0-prod"
|
|
4084
|
+
* })
|
|
4085
|
+
*/
|
|
4086
|
+
deleteIssuer(request, requestOptions) {
|
|
4087
|
+
return HttpResponsePromise.fromPromise(this.__deleteIssuer(request, requestOptions));
|
|
4088
|
+
}
|
|
4089
|
+
async __deleteIssuer(request, requestOptions) {
|
|
4090
|
+
const { issuerId } = request;
|
|
4091
|
+
const _authRequest = await this._options.authProvider.getAuthRequest();
|
|
4092
|
+
const _headers = mergeHeaders(
|
|
4093
|
+
_authRequest.headers,
|
|
4094
|
+
this._options?.headers,
|
|
4095
|
+
requestOptions?.headers
|
|
4096
|
+
);
|
|
4097
|
+
const _response = await fetcher({
|
|
4098
|
+
url: url_exports.join(
|
|
4099
|
+
await Supplier.get(this._options.baseUrl) ?? await Supplier.get(this._options.environment),
|
|
4100
|
+
`v1/auth/issuers/${url_exports.encodePathParam(issuerId)}`
|
|
4101
|
+
),
|
|
4102
|
+
method: "DELETE",
|
|
4103
|
+
headers: _headers,
|
|
4104
|
+
queryString: url_exports.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(),
|
|
4105
|
+
timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1e3,
|
|
4106
|
+
maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries,
|
|
4107
|
+
abortSignal: requestOptions?.abortSignal,
|
|
4108
|
+
fetchFn: this._options?.fetch,
|
|
4109
|
+
logging: this._options.logging
|
|
4110
|
+
});
|
|
4111
|
+
if (_response.ok) {
|
|
4112
|
+
return { data: void 0, rawResponse: _response.rawResponse };
|
|
4113
|
+
}
|
|
4114
|
+
if (_response.error.reason === "status-code") {
|
|
4115
|
+
switch (_response.error.statusCode) {
|
|
4116
|
+
case 403:
|
|
4117
|
+
throw new ForbiddenError(_response.error.body, _response.rawResponse);
|
|
4118
|
+
case 404:
|
|
4119
|
+
throw new NotFoundError(_response.error.body, _response.rawResponse);
|
|
4120
|
+
case 429:
|
|
4121
|
+
throw new TooManyRequestsError(_response.error.body, _response.rawResponse);
|
|
4122
|
+
default:
|
|
4123
|
+
throw new VectrosError({
|
|
4124
|
+
statusCode: _response.error.statusCode,
|
|
4125
|
+
body: _response.error.body,
|
|
4126
|
+
rawResponse: _response.rawResponse
|
|
4127
|
+
});
|
|
4128
|
+
}
|
|
4129
|
+
}
|
|
4130
|
+
return handleNonStatusCodeError(
|
|
4131
|
+
_response.error,
|
|
4132
|
+
_response.rawResponse,
|
|
4133
|
+
"DELETE",
|
|
4134
|
+
"/v1/auth/issuers/{issuerId}"
|
|
4135
|
+
);
|
|
4136
|
+
}
|
|
4137
|
+
/**
|
|
4138
|
+
* Returns the issuers registered in your tenant. Requires a root API key or the bootstrap's provisioning capability. Returns a `{data, nextCursor}` envelope.
|
|
4139
|
+
*
|
|
4140
|
+
* @param {Vectros.ListIssuersRequest} request
|
|
4141
|
+
* @param {AuthClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
4142
|
+
*
|
|
4143
|
+
* @throws {@link Vectros.ForbiddenError}
|
|
4144
|
+
*
|
|
4145
|
+
* @example
|
|
4146
|
+
* await client.auth.listIssuers()
|
|
4147
|
+
*/
|
|
4148
|
+
listIssuers(request = {}, requestOptions) {
|
|
4149
|
+
return HttpResponsePromise.fromPromise(this.__listIssuers(request, requestOptions));
|
|
4150
|
+
}
|
|
4151
|
+
async __listIssuers(request = {}, requestOptions) {
|
|
4152
|
+
const { startFrom, limit } = request;
|
|
4153
|
+
const _queryParams = {
|
|
4154
|
+
startFrom,
|
|
4155
|
+
limit
|
|
4156
|
+
};
|
|
4157
|
+
const _authRequest = await this._options.authProvider.getAuthRequest();
|
|
4158
|
+
const _headers = mergeHeaders(
|
|
4159
|
+
_authRequest.headers,
|
|
4160
|
+
this._options?.headers,
|
|
4161
|
+
requestOptions?.headers
|
|
4162
|
+
);
|
|
4163
|
+
const _response = await fetcher({
|
|
4164
|
+
url: url_exports.join(
|
|
4165
|
+
await Supplier.get(this._options.baseUrl) ?? await Supplier.get(this._options.environment),
|
|
4166
|
+
"v1/auth/issuers"
|
|
4167
|
+
),
|
|
4168
|
+
method: "GET",
|
|
4169
|
+
headers: _headers,
|
|
4170
|
+
queryString: url_exports.queryBuilder().addMany(_queryParams).mergeAdditional(requestOptions?.queryParams).build(),
|
|
4171
|
+
timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1e3,
|
|
4172
|
+
maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries,
|
|
4173
|
+
abortSignal: requestOptions?.abortSignal,
|
|
4174
|
+
fetchFn: this._options?.fetch,
|
|
4175
|
+
logging: this._options.logging
|
|
4176
|
+
});
|
|
4177
|
+
if (_response.ok) {
|
|
4178
|
+
return { data: _response.body, rawResponse: _response.rawResponse };
|
|
4179
|
+
}
|
|
4180
|
+
if (_response.error.reason === "status-code") {
|
|
4181
|
+
switch (_response.error.statusCode) {
|
|
4182
|
+
case 403:
|
|
4183
|
+
throw new ForbiddenError(_response.error.body, _response.rawResponse);
|
|
4184
|
+
default:
|
|
4185
|
+
throw new VectrosError({
|
|
4186
|
+
statusCode: _response.error.statusCode,
|
|
4187
|
+
body: _response.error.body,
|
|
4188
|
+
rawResponse: _response.rawResponse
|
|
4189
|
+
});
|
|
4190
|
+
}
|
|
4191
|
+
}
|
|
4192
|
+
return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/v1/auth/issuers");
|
|
4193
|
+
}
|
|
4194
|
+
/**
|
|
4195
|
+
* Registers a trusted third-party IdP issuer that BYO-IdP token exchange (`POST /v1/auth/token/exchange`) may accept a `subject_token` from. Requires a root API key or the CLI bootstrap's provisioning capability — never an ordinary partner-grantable scope. Idempotent by `issuerId` within your tenant; the `(issuer, audience)` pair must not already be registered by a different issuerId/tenant.
|
|
4196
|
+
*
|
|
4197
|
+
* @param {Vectros.IssuerRequest} request
|
|
4198
|
+
* @param {AuthClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
4199
|
+
*
|
|
4200
|
+
* @throws {@link Vectros.BadRequestError}
|
|
4201
|
+
* @throws {@link Vectros.ForbiddenError}
|
|
4202
|
+
* @throws {@link Vectros.TooManyRequestsError}
|
|
4203
|
+
*
|
|
4204
|
+
* @example
|
|
4205
|
+
* await client.auth.registerIssuer({
|
|
4206
|
+
* issuerId: "auth0-prod",
|
|
4207
|
+
* issuer: "https://your-tenant.us.auth0.com/",
|
|
4208
|
+
* jwksUri: "https://your-tenant.us.auth0.com/.well-known/jwks.json",
|
|
4209
|
+
* audience: "https://api.your-app.example.com",
|
|
4210
|
+
* contextId: "casework"
|
|
4211
|
+
* })
|
|
4212
|
+
*/
|
|
4213
|
+
registerIssuer(request, requestOptions) {
|
|
4214
|
+
return HttpResponsePromise.fromPromise(this.__registerIssuer(request, requestOptions));
|
|
4215
|
+
}
|
|
4216
|
+
async __registerIssuer(request, requestOptions) {
|
|
4217
|
+
const _authRequest = await this._options.authProvider.getAuthRequest();
|
|
4218
|
+
const _headers = mergeHeaders(
|
|
4219
|
+
_authRequest.headers,
|
|
4220
|
+
this._options?.headers,
|
|
4221
|
+
requestOptions?.headers
|
|
4222
|
+
);
|
|
4223
|
+
const _response = await fetcher({
|
|
4224
|
+
url: url_exports.join(
|
|
4225
|
+
await Supplier.get(this._options.baseUrl) ?? await Supplier.get(this._options.environment),
|
|
4226
|
+
"v1/auth/issuers"
|
|
4227
|
+
),
|
|
4228
|
+
method: "POST",
|
|
4229
|
+
headers: _headers,
|
|
4230
|
+
contentType: "application/json",
|
|
4231
|
+
queryString: url_exports.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(),
|
|
4232
|
+
requestType: "json",
|
|
4233
|
+
body: request,
|
|
4234
|
+
timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1e3,
|
|
4235
|
+
maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries,
|
|
4236
|
+
abortSignal: requestOptions?.abortSignal,
|
|
4237
|
+
fetchFn: this._options?.fetch,
|
|
4238
|
+
logging: this._options.logging
|
|
4239
|
+
});
|
|
4240
|
+
if (_response.ok) {
|
|
4241
|
+
return { data: _response.body, rawResponse: _response.rawResponse };
|
|
4242
|
+
}
|
|
4243
|
+
if (_response.error.reason === "status-code") {
|
|
4244
|
+
switch (_response.error.statusCode) {
|
|
4245
|
+
case 400:
|
|
4246
|
+
throw new BadRequestError(_response.error.body, _response.rawResponse);
|
|
4247
|
+
case 403:
|
|
4248
|
+
throw new ForbiddenError(_response.error.body, _response.rawResponse);
|
|
4249
|
+
case 429:
|
|
4250
|
+
throw new TooManyRequestsError(_response.error.body, _response.rawResponse);
|
|
4251
|
+
default:
|
|
4252
|
+
throw new VectrosError({
|
|
4253
|
+
statusCode: _response.error.statusCode,
|
|
4254
|
+
body: _response.error.body,
|
|
4255
|
+
rawResponse: _response.rawResponse
|
|
4256
|
+
});
|
|
4257
|
+
}
|
|
4258
|
+
}
|
|
4259
|
+
return handleNonStatusCodeError(_response.error, _response.rawResponse, "POST", "/v1/auth/issuers");
|
|
4260
|
+
}
|
|
4001
4261
|
/**
|
|
4002
4262
|
* Returns the identity bound to your credential — your account, principal type, key id, and scope details — so you can confirm who you are authenticated as and that the credential is valid. MCP clients use this to render "signed in as ..." in a chat UI without a separate identity endpoint.
|
|
4003
4263
|
*
|
|
@@ -4321,6 +4581,72 @@ var AuthClient = class {
|
|
|
4321
4581
|
}
|
|
4322
4582
|
return handleNonStatusCodeError(_response.error, _response.rawResponse, "POST", "/v1/users/invite/resend");
|
|
4323
4583
|
}
|
|
4584
|
+
/**
|
|
4585
|
+
* RFC 8693 OAuth 2.0 Token Exchange. Trades a JWT issued by a third-party identity provider you've registered (`POST /v1/auth/issuers`) for a Vectros `st_*` scoped bearer token — no Vectros credential required to call this endpoint. The exchanged token's scope is resolved entirely server-side from the matched user's access profile; this endpoint accepts no caller-supplied scope, resource, or audience parameter (RFC 8693 §2.1's `resource`/`audience`/`scope` are not used in v1 — the registered `(issuer, audience)` pair alone pins the target tenant and app context). On a first-time login (no existing Vectros identity for this subject), two opt-in binding paths exist: `invite_token` (a `PENDING` sub-user invitation), and — if the registration declares one or more self-signup policies — `signup_type` (a brand-new user is created and bound to the policy's configured role). If `invite_token` is present at all, it is the ONLY path tried — a failed invite never falls through to self-signup. Neither field is required for a subject with an existing identity. Uses the OAuth-standard error envelope (`{"error":..., "error_description":...}`, RFC 6749 §5.2), NOT this API's usual `{"message":...}` shape — its client is generic OAuth tooling, not the Vectros SDK.
|
|
4586
|
+
*
|
|
4587
|
+
* @param {Vectros.TokenExchangeRequest} request
|
|
4588
|
+
* @param {AuthClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
4589
|
+
*
|
|
4590
|
+
* @throws {@link Vectros.BadRequestError}
|
|
4591
|
+
* @throws {@link Vectros.UnauthorizedError}
|
|
4592
|
+
* @throws {@link Vectros.ForbiddenError}
|
|
4593
|
+
* @throws {@link Vectros.NotFoundError}
|
|
4594
|
+
* @throws {@link Vectros.TooManyRequestsError}
|
|
4595
|
+
*
|
|
4596
|
+
* @example
|
|
4597
|
+
* await client.auth.exchangeToken({
|
|
4598
|
+
* grant_type: "urn:ietf:params:oauth:grant-type:token-exchange",
|
|
4599
|
+
* subject_token: "subject_token",
|
|
4600
|
+
* subject_token_type: "urn:ietf:params:oauth:token-type:jwt"
|
|
4601
|
+
* })
|
|
4602
|
+
*/
|
|
4603
|
+
exchangeToken(request, requestOptions) {
|
|
4604
|
+
return HttpResponsePromise.fromPromise(this.__exchangeToken(request, requestOptions));
|
|
4605
|
+
}
|
|
4606
|
+
async __exchangeToken(request, requestOptions) {
|
|
4607
|
+
const _headers = mergeHeaders(this._options?.headers, requestOptions?.headers);
|
|
4608
|
+
const _response = await fetcher({
|
|
4609
|
+
url: url_exports.join(
|
|
4610
|
+
await Supplier.get(this._options.baseUrl) ?? await Supplier.get(this._options.environment),
|
|
4611
|
+
"v1/auth/token/exchange"
|
|
4612
|
+
),
|
|
4613
|
+
method: "POST",
|
|
4614
|
+
headers: _headers,
|
|
4615
|
+
contentType: "application/json",
|
|
4616
|
+
queryString: url_exports.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(),
|
|
4617
|
+
requestType: "json",
|
|
4618
|
+
body: request,
|
|
4619
|
+
timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1e3,
|
|
4620
|
+
maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries,
|
|
4621
|
+
abortSignal: requestOptions?.abortSignal,
|
|
4622
|
+
fetchFn: this._options?.fetch,
|
|
4623
|
+
logging: this._options.logging
|
|
4624
|
+
});
|
|
4625
|
+
if (_response.ok) {
|
|
4626
|
+
return { data: _response.body, rawResponse: _response.rawResponse };
|
|
4627
|
+
}
|
|
4628
|
+
if (_response.error.reason === "status-code") {
|
|
4629
|
+
switch (_response.error.statusCode) {
|
|
4630
|
+
case 400:
|
|
4631
|
+
throw new BadRequestError(_response.error.body, _response.rawResponse);
|
|
4632
|
+
case 401:
|
|
4633
|
+
throw new UnauthorizedError(_response.error.body, _response.rawResponse);
|
|
4634
|
+
case 403:
|
|
4635
|
+
throw new ForbiddenError(_response.error.body, _response.rawResponse);
|
|
4636
|
+
case 404:
|
|
4637
|
+
throw new NotFoundError(_response.error.body, _response.rawResponse);
|
|
4638
|
+
case 429:
|
|
4639
|
+
throw new TooManyRequestsError(_response.error.body, _response.rawResponse);
|
|
4640
|
+
default:
|
|
4641
|
+
throw new VectrosError({
|
|
4642
|
+
statusCode: _response.error.statusCode,
|
|
4643
|
+
body: _response.error.body,
|
|
4644
|
+
rawResponse: _response.rawResponse
|
|
4645
|
+
});
|
|
4646
|
+
}
|
|
4647
|
+
}
|
|
4648
|
+
return handleNonStatusCodeError(_response.error, _response.rawResponse, "POST", "/v1/auth/token/exchange");
|
|
4649
|
+
}
|
|
4324
4650
|
};
|
|
4325
4651
|
var ComplianceClient = class {
|
|
4326
4652
|
constructor(options) {
|
|
@@ -6928,6 +7254,69 @@ var IdentityClient = class {
|
|
|
6928
7254
|
}
|
|
6929
7255
|
return handleNonStatusCodeError(_response.error, _response.rawResponse, "POST", "/v1/users/lookup");
|
|
6930
7256
|
}
|
|
7257
|
+
/**
|
|
7258
|
+
* Answers "does a user with this email hold an ACTIVE access profile in this app context" — a narrow existence check, not a general lookup. `exists` is false for a member whose access to this context has been suspended, not only for a member who was never granted it. The answer is scoped to the `contextId` you supply: it does not reveal whether the email exists elsewhere in your tenant or account, only whether it belongs to an active member of the named context. Returns `{exists, userId, status}` — never the full user record — so a caller asking "does X exist" cannot receive that user's payload/schema binding/etc. as a side effect. Useful for resolving an email you were handed (for example, by an org-admin adding an existing member to another org) to a `userId`, without paging through the full context membership. Requires the `users:r` scope.
|
|
7259
|
+
*
|
|
7260
|
+
* @param {Vectros.UserExistsByEmailRequest} request
|
|
7261
|
+
* @param {IdentityClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
7262
|
+
*
|
|
7263
|
+
* @throws {@link Vectros.BadRequestError}
|
|
7264
|
+
* @throws {@link Vectros.ForbiddenError}
|
|
7265
|
+
*
|
|
7266
|
+
* @example
|
|
7267
|
+
* await client.identity.userExistsByEmail({
|
|
7268
|
+
* email: "user@example.com",
|
|
7269
|
+
* contextId: "myapp"
|
|
7270
|
+
* })
|
|
7271
|
+
*/
|
|
7272
|
+
userExistsByEmail(request = {}, requestOptions) {
|
|
7273
|
+
return HttpResponsePromise.fromPromise(this.__userExistsByEmail(request, requestOptions));
|
|
7274
|
+
}
|
|
7275
|
+
async __userExistsByEmail(request = {}, requestOptions) {
|
|
7276
|
+
const { email, contextId } = request;
|
|
7277
|
+
const _queryParams = {
|
|
7278
|
+
email,
|
|
7279
|
+
contextId
|
|
7280
|
+
};
|
|
7281
|
+
const _authRequest = await this._options.authProvider.getAuthRequest();
|
|
7282
|
+
const _headers = mergeHeaders(
|
|
7283
|
+
_authRequest.headers,
|
|
7284
|
+
this._options?.headers,
|
|
7285
|
+
requestOptions?.headers
|
|
7286
|
+
);
|
|
7287
|
+
const _response = await fetcher({
|
|
7288
|
+
url: url_exports.join(
|
|
7289
|
+
await Supplier.get(this._options.baseUrl) ?? await Supplier.get(this._options.environment),
|
|
7290
|
+
"v1/users/exists-by-email"
|
|
7291
|
+
),
|
|
7292
|
+
method: "GET",
|
|
7293
|
+
headers: _headers,
|
|
7294
|
+
queryString: url_exports.queryBuilder().addMany(_queryParams).mergeAdditional(requestOptions?.queryParams).build(),
|
|
7295
|
+
timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1e3,
|
|
7296
|
+
maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries,
|
|
7297
|
+
abortSignal: requestOptions?.abortSignal,
|
|
7298
|
+
fetchFn: this._options?.fetch,
|
|
7299
|
+
logging: this._options.logging
|
|
7300
|
+
});
|
|
7301
|
+
if (_response.ok) {
|
|
7302
|
+
return { data: _response.body, rawResponse: _response.rawResponse };
|
|
7303
|
+
}
|
|
7304
|
+
if (_response.error.reason === "status-code") {
|
|
7305
|
+
switch (_response.error.statusCode) {
|
|
7306
|
+
case 400:
|
|
7307
|
+
throw new BadRequestError(_response.error.body, _response.rawResponse);
|
|
7308
|
+
case 403:
|
|
7309
|
+
throw new ForbiddenError(_response.error.body, _response.rawResponse);
|
|
7310
|
+
default:
|
|
7311
|
+
throw new VectrosError({
|
|
7312
|
+
statusCode: _response.error.statusCode,
|
|
7313
|
+
body: _response.error.body,
|
|
7314
|
+
rawResponse: _response.rawResponse
|
|
7315
|
+
});
|
|
7316
|
+
}
|
|
7317
|
+
}
|
|
7318
|
+
return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/v1/users/exists-by-email");
|
|
7319
|
+
}
|
|
6931
7320
|
/**
|
|
6932
7321
|
* Returns the audit trail of changes to a user, most recent first. Identity history is always recorded and always available. Sensitive field values are redacted in every historical version. Returns a page in the `{data, nextCursor}` envelope. Requires the `users:r` scope.
|
|
6933
7322
|
*
|
|
@@ -8684,15 +9073,15 @@ function warnOnSuboptimalKey(key, log) {
|
|
|
8684
9073
|
} else if (key.prefix === "st") {
|
|
8685
9074
|
log.warn(
|
|
8686
9075
|
{ prefix: key.prefix, env: key.env },
|
|
8687
|
-
"short-lived token (st_*) will expire mid-session (1h
|
|
9076
|
+
"short-lived token (st_*) will expire mid-session (1h max). For long-running MCP installs, prefer a long-lived ssk_* key."
|
|
8688
9077
|
);
|
|
8689
9078
|
}
|
|
8690
9079
|
}
|
|
8691
9080
|
|
|
8692
9081
|
// src/build-info.ts
|
|
8693
9082
|
var BUILD_INFO = {
|
|
8694
|
-
mcpServer: true ? "0.
|
|
8695
|
-
sdk: true ? "0.
|
|
9083
|
+
mcpServer: true ? "0.14.0" : "dev",
|
|
9084
|
+
sdk: true ? "0.39.0" : "dev"
|
|
8696
9085
|
};
|
|
8697
9086
|
|
|
8698
9087
|
// src/log.ts
|