@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/dist/index.mjs
CHANGED
|
@@ -62,6 +62,7 @@ __export(api_exports, {
|
|
|
62
62
|
TooManyRequestsError: () => TooManyRequestsError,
|
|
63
63
|
TruncationWarningEvent: () => TruncationWarningEvent,
|
|
64
64
|
UnauthorizedError: () => UnauthorizedError,
|
|
65
|
+
UserExistsResponse: () => UserExistsResponse,
|
|
65
66
|
UserRequest: () => UserRequest,
|
|
66
67
|
UserResponse: () => UserResponse,
|
|
67
68
|
auth: () => auth_exports,
|
|
@@ -738,6 +739,14 @@ var TruncationWarningEvent;
|
|
|
738
739
|
ContextWindowBudget: "context_window_budget"
|
|
739
740
|
};
|
|
740
741
|
})(TruncationWarningEvent || (TruncationWarningEvent = {}));
|
|
742
|
+
var UserExistsResponse;
|
|
743
|
+
((UserExistsResponse2) => {
|
|
744
|
+
UserExistsResponse2.Status = {
|
|
745
|
+
Active: "ACTIVE",
|
|
746
|
+
Suspended: "SUSPENDED",
|
|
747
|
+
Pending: "PENDING"
|
|
748
|
+
};
|
|
749
|
+
})(UserExistsResponse || (UserExistsResponse = {}));
|
|
741
750
|
var UserRequest;
|
|
742
751
|
((UserRequest2) => {
|
|
743
752
|
UserRequest2.Status = {
|
|
@@ -2481,7 +2490,7 @@ var AuthClient = class {
|
|
|
2481
2490
|
return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/v1/admin/keys/scoped");
|
|
2482
2491
|
}
|
|
2483
2492
|
/**
|
|
2484
|
-
* 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.
|
|
2493
|
+
* 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.
|
|
2485
2494
|
*
|
|
2486
2495
|
* @param {Vectros.CreateScopedKeyRequest} request
|
|
2487
2496
|
* @param {AuthClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
@@ -3231,11 +3240,12 @@ var AuthClient = class {
|
|
|
3231
3240
|
);
|
|
3232
3241
|
}
|
|
3233
3242
|
/**
|
|
3234
|
-
* 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.
|
|
3243
|
+
* 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.
|
|
3235
3244
|
*
|
|
3236
3245
|
* @param {Vectros.UpdateAccessProfileRequest} request
|
|
3237
3246
|
* @param {AuthClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
3238
3247
|
*
|
|
3248
|
+
* @throws {@link Vectros.BadRequestError}
|
|
3239
3249
|
* @throws {@link Vectros.ForbiddenError}
|
|
3240
3250
|
* @throws {@link Vectros.NotFoundError}
|
|
3241
3251
|
* @throws {@link Vectros.TooManyRequestsError}
|
|
@@ -3282,6 +3292,8 @@ var AuthClient = class {
|
|
|
3282
3292
|
}
|
|
3283
3293
|
if (_response.error.reason === "status-code") {
|
|
3284
3294
|
switch (_response.error.statusCode) {
|
|
3295
|
+
case 400:
|
|
3296
|
+
throw new BadRequestError(_response.error.body, _response.rawResponse);
|
|
3285
3297
|
case 403:
|
|
3286
3298
|
throw new ForbiddenError(_response.error.body, _response.rawResponse);
|
|
3287
3299
|
case 404:
|
|
@@ -3973,6 +3985,254 @@ var AuthClient = class {
|
|
|
3973
3985
|
}
|
|
3974
3986
|
return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/v1/usage");
|
|
3975
3987
|
}
|
|
3988
|
+
/**
|
|
3989
|
+
* Retrieves a single registered issuer by issuerId. Requires a root API key or the bootstrap's provisioning capability.
|
|
3990
|
+
*
|
|
3991
|
+
* @param {Vectros.GetIssuerRequest} request
|
|
3992
|
+
* @param {AuthClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
3993
|
+
*
|
|
3994
|
+
* @throws {@link Vectros.ForbiddenError}
|
|
3995
|
+
* @throws {@link Vectros.NotFoundError}
|
|
3996
|
+
*
|
|
3997
|
+
* @example
|
|
3998
|
+
* await client.auth.getIssuer({
|
|
3999
|
+
* issuerId: "auth0-prod"
|
|
4000
|
+
* })
|
|
4001
|
+
*/
|
|
4002
|
+
getIssuer(request, requestOptions) {
|
|
4003
|
+
return HttpResponsePromise.fromPromise(this.__getIssuer(request, requestOptions));
|
|
4004
|
+
}
|
|
4005
|
+
async __getIssuer(request, requestOptions) {
|
|
4006
|
+
const { issuerId } = request;
|
|
4007
|
+
const _authRequest = await this._options.authProvider.getAuthRequest();
|
|
4008
|
+
const _headers = mergeHeaders(
|
|
4009
|
+
_authRequest.headers,
|
|
4010
|
+
this._options?.headers,
|
|
4011
|
+
requestOptions?.headers
|
|
4012
|
+
);
|
|
4013
|
+
const _response = await fetcher({
|
|
4014
|
+
url: url_exports.join(
|
|
4015
|
+
await Supplier.get(this._options.baseUrl) ?? await Supplier.get(this._options.environment),
|
|
4016
|
+
`v1/auth/issuers/${url_exports.encodePathParam(issuerId)}`
|
|
4017
|
+
),
|
|
4018
|
+
method: "GET",
|
|
4019
|
+
headers: _headers,
|
|
4020
|
+
queryString: url_exports.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(),
|
|
4021
|
+
timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1e3,
|
|
4022
|
+
maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries,
|
|
4023
|
+
abortSignal: requestOptions?.abortSignal,
|
|
4024
|
+
fetchFn: this._options?.fetch,
|
|
4025
|
+
logging: this._options.logging
|
|
4026
|
+
});
|
|
4027
|
+
if (_response.ok) {
|
|
4028
|
+
return { data: _response.body, rawResponse: _response.rawResponse };
|
|
4029
|
+
}
|
|
4030
|
+
if (_response.error.reason === "status-code") {
|
|
4031
|
+
switch (_response.error.statusCode) {
|
|
4032
|
+
case 403:
|
|
4033
|
+
throw new ForbiddenError(_response.error.body, _response.rawResponse);
|
|
4034
|
+
case 404:
|
|
4035
|
+
throw new NotFoundError(_response.error.body, _response.rawResponse);
|
|
4036
|
+
default:
|
|
4037
|
+
throw new VectrosError({
|
|
4038
|
+
statusCode: _response.error.statusCode,
|
|
4039
|
+
body: _response.error.body,
|
|
4040
|
+
rawResponse: _response.rawResponse
|
|
4041
|
+
});
|
|
4042
|
+
}
|
|
4043
|
+
}
|
|
4044
|
+
return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/v1/auth/issuers/{issuerId}");
|
|
4045
|
+
}
|
|
4046
|
+
/**
|
|
4047
|
+
* 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.
|
|
4048
|
+
*
|
|
4049
|
+
* @param {Vectros.DeleteIssuerRequest} request
|
|
4050
|
+
* @param {AuthClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
4051
|
+
*
|
|
4052
|
+
* @throws {@link Vectros.ForbiddenError}
|
|
4053
|
+
* @throws {@link Vectros.NotFoundError}
|
|
4054
|
+
* @throws {@link Vectros.TooManyRequestsError}
|
|
4055
|
+
*
|
|
4056
|
+
* @example
|
|
4057
|
+
* await client.auth.deleteIssuer({
|
|
4058
|
+
* issuerId: "auth0-prod"
|
|
4059
|
+
* })
|
|
4060
|
+
*/
|
|
4061
|
+
deleteIssuer(request, requestOptions) {
|
|
4062
|
+
return HttpResponsePromise.fromPromise(this.__deleteIssuer(request, requestOptions));
|
|
4063
|
+
}
|
|
4064
|
+
async __deleteIssuer(request, requestOptions) {
|
|
4065
|
+
const { issuerId } = request;
|
|
4066
|
+
const _authRequest = await this._options.authProvider.getAuthRequest();
|
|
4067
|
+
const _headers = mergeHeaders(
|
|
4068
|
+
_authRequest.headers,
|
|
4069
|
+
this._options?.headers,
|
|
4070
|
+
requestOptions?.headers
|
|
4071
|
+
);
|
|
4072
|
+
const _response = await fetcher({
|
|
4073
|
+
url: url_exports.join(
|
|
4074
|
+
await Supplier.get(this._options.baseUrl) ?? await Supplier.get(this._options.environment),
|
|
4075
|
+
`v1/auth/issuers/${url_exports.encodePathParam(issuerId)}`
|
|
4076
|
+
),
|
|
4077
|
+
method: "DELETE",
|
|
4078
|
+
headers: _headers,
|
|
4079
|
+
queryString: url_exports.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(),
|
|
4080
|
+
timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1e3,
|
|
4081
|
+
maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries,
|
|
4082
|
+
abortSignal: requestOptions?.abortSignal,
|
|
4083
|
+
fetchFn: this._options?.fetch,
|
|
4084
|
+
logging: this._options.logging
|
|
4085
|
+
});
|
|
4086
|
+
if (_response.ok) {
|
|
4087
|
+
return { data: void 0, rawResponse: _response.rawResponse };
|
|
4088
|
+
}
|
|
4089
|
+
if (_response.error.reason === "status-code") {
|
|
4090
|
+
switch (_response.error.statusCode) {
|
|
4091
|
+
case 403:
|
|
4092
|
+
throw new ForbiddenError(_response.error.body, _response.rawResponse);
|
|
4093
|
+
case 404:
|
|
4094
|
+
throw new NotFoundError(_response.error.body, _response.rawResponse);
|
|
4095
|
+
case 429:
|
|
4096
|
+
throw new TooManyRequestsError(_response.error.body, _response.rawResponse);
|
|
4097
|
+
default:
|
|
4098
|
+
throw new VectrosError({
|
|
4099
|
+
statusCode: _response.error.statusCode,
|
|
4100
|
+
body: _response.error.body,
|
|
4101
|
+
rawResponse: _response.rawResponse
|
|
4102
|
+
});
|
|
4103
|
+
}
|
|
4104
|
+
}
|
|
4105
|
+
return handleNonStatusCodeError(
|
|
4106
|
+
_response.error,
|
|
4107
|
+
_response.rawResponse,
|
|
4108
|
+
"DELETE",
|
|
4109
|
+
"/v1/auth/issuers/{issuerId}"
|
|
4110
|
+
);
|
|
4111
|
+
}
|
|
4112
|
+
/**
|
|
4113
|
+
* Returns the issuers registered in your tenant. Requires a root API key or the bootstrap's provisioning capability. Returns a `{data, nextCursor}` envelope.
|
|
4114
|
+
*
|
|
4115
|
+
* @param {Vectros.ListIssuersRequest} request
|
|
4116
|
+
* @param {AuthClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
4117
|
+
*
|
|
4118
|
+
* @throws {@link Vectros.ForbiddenError}
|
|
4119
|
+
*
|
|
4120
|
+
* @example
|
|
4121
|
+
* await client.auth.listIssuers()
|
|
4122
|
+
*/
|
|
4123
|
+
listIssuers(request = {}, requestOptions) {
|
|
4124
|
+
return HttpResponsePromise.fromPromise(this.__listIssuers(request, requestOptions));
|
|
4125
|
+
}
|
|
4126
|
+
async __listIssuers(request = {}, requestOptions) {
|
|
4127
|
+
const { startFrom, limit } = request;
|
|
4128
|
+
const _queryParams = {
|
|
4129
|
+
startFrom,
|
|
4130
|
+
limit
|
|
4131
|
+
};
|
|
4132
|
+
const _authRequest = await this._options.authProvider.getAuthRequest();
|
|
4133
|
+
const _headers = mergeHeaders(
|
|
4134
|
+
_authRequest.headers,
|
|
4135
|
+
this._options?.headers,
|
|
4136
|
+
requestOptions?.headers
|
|
4137
|
+
);
|
|
4138
|
+
const _response = await fetcher({
|
|
4139
|
+
url: url_exports.join(
|
|
4140
|
+
await Supplier.get(this._options.baseUrl) ?? await Supplier.get(this._options.environment),
|
|
4141
|
+
"v1/auth/issuers"
|
|
4142
|
+
),
|
|
4143
|
+
method: "GET",
|
|
4144
|
+
headers: _headers,
|
|
4145
|
+
queryString: url_exports.queryBuilder().addMany(_queryParams).mergeAdditional(requestOptions?.queryParams).build(),
|
|
4146
|
+
timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1e3,
|
|
4147
|
+
maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries,
|
|
4148
|
+
abortSignal: requestOptions?.abortSignal,
|
|
4149
|
+
fetchFn: this._options?.fetch,
|
|
4150
|
+
logging: this._options.logging
|
|
4151
|
+
});
|
|
4152
|
+
if (_response.ok) {
|
|
4153
|
+
return { data: _response.body, rawResponse: _response.rawResponse };
|
|
4154
|
+
}
|
|
4155
|
+
if (_response.error.reason === "status-code") {
|
|
4156
|
+
switch (_response.error.statusCode) {
|
|
4157
|
+
case 403:
|
|
4158
|
+
throw new ForbiddenError(_response.error.body, _response.rawResponse);
|
|
4159
|
+
default:
|
|
4160
|
+
throw new VectrosError({
|
|
4161
|
+
statusCode: _response.error.statusCode,
|
|
4162
|
+
body: _response.error.body,
|
|
4163
|
+
rawResponse: _response.rawResponse
|
|
4164
|
+
});
|
|
4165
|
+
}
|
|
4166
|
+
}
|
|
4167
|
+
return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/v1/auth/issuers");
|
|
4168
|
+
}
|
|
4169
|
+
/**
|
|
4170
|
+
* 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.
|
|
4171
|
+
*
|
|
4172
|
+
* @param {Vectros.IssuerRequest} request
|
|
4173
|
+
* @param {AuthClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
4174
|
+
*
|
|
4175
|
+
* @throws {@link Vectros.BadRequestError}
|
|
4176
|
+
* @throws {@link Vectros.ForbiddenError}
|
|
4177
|
+
* @throws {@link Vectros.TooManyRequestsError}
|
|
4178
|
+
*
|
|
4179
|
+
* @example
|
|
4180
|
+
* await client.auth.registerIssuer({
|
|
4181
|
+
* issuerId: "auth0-prod",
|
|
4182
|
+
* issuer: "https://your-tenant.us.auth0.com/",
|
|
4183
|
+
* jwksUri: "https://your-tenant.us.auth0.com/.well-known/jwks.json",
|
|
4184
|
+
* audience: "https://api.your-app.example.com",
|
|
4185
|
+
* contextId: "casework"
|
|
4186
|
+
* })
|
|
4187
|
+
*/
|
|
4188
|
+
registerIssuer(request, requestOptions) {
|
|
4189
|
+
return HttpResponsePromise.fromPromise(this.__registerIssuer(request, requestOptions));
|
|
4190
|
+
}
|
|
4191
|
+
async __registerIssuer(request, requestOptions) {
|
|
4192
|
+
const _authRequest = await this._options.authProvider.getAuthRequest();
|
|
4193
|
+
const _headers = mergeHeaders(
|
|
4194
|
+
_authRequest.headers,
|
|
4195
|
+
this._options?.headers,
|
|
4196
|
+
requestOptions?.headers
|
|
4197
|
+
);
|
|
4198
|
+
const _response = await fetcher({
|
|
4199
|
+
url: url_exports.join(
|
|
4200
|
+
await Supplier.get(this._options.baseUrl) ?? await Supplier.get(this._options.environment),
|
|
4201
|
+
"v1/auth/issuers"
|
|
4202
|
+
),
|
|
4203
|
+
method: "POST",
|
|
4204
|
+
headers: _headers,
|
|
4205
|
+
contentType: "application/json",
|
|
4206
|
+
queryString: url_exports.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(),
|
|
4207
|
+
requestType: "json",
|
|
4208
|
+
body: request,
|
|
4209
|
+
timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1e3,
|
|
4210
|
+
maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries,
|
|
4211
|
+
abortSignal: requestOptions?.abortSignal,
|
|
4212
|
+
fetchFn: this._options?.fetch,
|
|
4213
|
+
logging: this._options.logging
|
|
4214
|
+
});
|
|
4215
|
+
if (_response.ok) {
|
|
4216
|
+
return { data: _response.body, rawResponse: _response.rawResponse };
|
|
4217
|
+
}
|
|
4218
|
+
if (_response.error.reason === "status-code") {
|
|
4219
|
+
switch (_response.error.statusCode) {
|
|
4220
|
+
case 400:
|
|
4221
|
+
throw new BadRequestError(_response.error.body, _response.rawResponse);
|
|
4222
|
+
case 403:
|
|
4223
|
+
throw new ForbiddenError(_response.error.body, _response.rawResponse);
|
|
4224
|
+
case 429:
|
|
4225
|
+
throw new TooManyRequestsError(_response.error.body, _response.rawResponse);
|
|
4226
|
+
default:
|
|
4227
|
+
throw new VectrosError({
|
|
4228
|
+
statusCode: _response.error.statusCode,
|
|
4229
|
+
body: _response.error.body,
|
|
4230
|
+
rawResponse: _response.rawResponse
|
|
4231
|
+
});
|
|
4232
|
+
}
|
|
4233
|
+
}
|
|
4234
|
+
return handleNonStatusCodeError(_response.error, _response.rawResponse, "POST", "/v1/auth/issuers");
|
|
4235
|
+
}
|
|
3976
4236
|
/**
|
|
3977
4237
|
* 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.
|
|
3978
4238
|
*
|
|
@@ -4296,6 +4556,72 @@ var AuthClient = class {
|
|
|
4296
4556
|
}
|
|
4297
4557
|
return handleNonStatusCodeError(_response.error, _response.rawResponse, "POST", "/v1/users/invite/resend");
|
|
4298
4558
|
}
|
|
4559
|
+
/**
|
|
4560
|
+
* 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.
|
|
4561
|
+
*
|
|
4562
|
+
* @param {Vectros.TokenExchangeRequest} request
|
|
4563
|
+
* @param {AuthClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
4564
|
+
*
|
|
4565
|
+
* @throws {@link Vectros.BadRequestError}
|
|
4566
|
+
* @throws {@link Vectros.UnauthorizedError}
|
|
4567
|
+
* @throws {@link Vectros.ForbiddenError}
|
|
4568
|
+
* @throws {@link Vectros.NotFoundError}
|
|
4569
|
+
* @throws {@link Vectros.TooManyRequestsError}
|
|
4570
|
+
*
|
|
4571
|
+
* @example
|
|
4572
|
+
* await client.auth.exchangeToken({
|
|
4573
|
+
* grant_type: "urn:ietf:params:oauth:grant-type:token-exchange",
|
|
4574
|
+
* subject_token: "subject_token",
|
|
4575
|
+
* subject_token_type: "urn:ietf:params:oauth:token-type:jwt"
|
|
4576
|
+
* })
|
|
4577
|
+
*/
|
|
4578
|
+
exchangeToken(request, requestOptions) {
|
|
4579
|
+
return HttpResponsePromise.fromPromise(this.__exchangeToken(request, requestOptions));
|
|
4580
|
+
}
|
|
4581
|
+
async __exchangeToken(request, requestOptions) {
|
|
4582
|
+
const _headers = mergeHeaders(this._options?.headers, requestOptions?.headers);
|
|
4583
|
+
const _response = await fetcher({
|
|
4584
|
+
url: url_exports.join(
|
|
4585
|
+
await Supplier.get(this._options.baseUrl) ?? await Supplier.get(this._options.environment),
|
|
4586
|
+
"v1/auth/token/exchange"
|
|
4587
|
+
),
|
|
4588
|
+
method: "POST",
|
|
4589
|
+
headers: _headers,
|
|
4590
|
+
contentType: "application/json",
|
|
4591
|
+
queryString: url_exports.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(),
|
|
4592
|
+
requestType: "json",
|
|
4593
|
+
body: request,
|
|
4594
|
+
timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1e3,
|
|
4595
|
+
maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries,
|
|
4596
|
+
abortSignal: requestOptions?.abortSignal,
|
|
4597
|
+
fetchFn: this._options?.fetch,
|
|
4598
|
+
logging: this._options.logging
|
|
4599
|
+
});
|
|
4600
|
+
if (_response.ok) {
|
|
4601
|
+
return { data: _response.body, rawResponse: _response.rawResponse };
|
|
4602
|
+
}
|
|
4603
|
+
if (_response.error.reason === "status-code") {
|
|
4604
|
+
switch (_response.error.statusCode) {
|
|
4605
|
+
case 400:
|
|
4606
|
+
throw new BadRequestError(_response.error.body, _response.rawResponse);
|
|
4607
|
+
case 401:
|
|
4608
|
+
throw new UnauthorizedError(_response.error.body, _response.rawResponse);
|
|
4609
|
+
case 403:
|
|
4610
|
+
throw new ForbiddenError(_response.error.body, _response.rawResponse);
|
|
4611
|
+
case 404:
|
|
4612
|
+
throw new NotFoundError(_response.error.body, _response.rawResponse);
|
|
4613
|
+
case 429:
|
|
4614
|
+
throw new TooManyRequestsError(_response.error.body, _response.rawResponse);
|
|
4615
|
+
default:
|
|
4616
|
+
throw new VectrosError({
|
|
4617
|
+
statusCode: _response.error.statusCode,
|
|
4618
|
+
body: _response.error.body,
|
|
4619
|
+
rawResponse: _response.rawResponse
|
|
4620
|
+
});
|
|
4621
|
+
}
|
|
4622
|
+
}
|
|
4623
|
+
return handleNonStatusCodeError(_response.error, _response.rawResponse, "POST", "/v1/auth/token/exchange");
|
|
4624
|
+
}
|
|
4299
4625
|
};
|
|
4300
4626
|
var ComplianceClient = class {
|
|
4301
4627
|
constructor(options) {
|
|
@@ -6903,6 +7229,69 @@ var IdentityClient = class {
|
|
|
6903
7229
|
}
|
|
6904
7230
|
return handleNonStatusCodeError(_response.error, _response.rawResponse, "POST", "/v1/users/lookup");
|
|
6905
7231
|
}
|
|
7232
|
+
/**
|
|
7233
|
+
* 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.
|
|
7234
|
+
*
|
|
7235
|
+
* @param {Vectros.UserExistsByEmailRequest} request
|
|
7236
|
+
* @param {IdentityClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
7237
|
+
*
|
|
7238
|
+
* @throws {@link Vectros.BadRequestError}
|
|
7239
|
+
* @throws {@link Vectros.ForbiddenError}
|
|
7240
|
+
*
|
|
7241
|
+
* @example
|
|
7242
|
+
* await client.identity.userExistsByEmail({
|
|
7243
|
+
* email: "user@example.com",
|
|
7244
|
+
* contextId: "myapp"
|
|
7245
|
+
* })
|
|
7246
|
+
*/
|
|
7247
|
+
userExistsByEmail(request = {}, requestOptions) {
|
|
7248
|
+
return HttpResponsePromise.fromPromise(this.__userExistsByEmail(request, requestOptions));
|
|
7249
|
+
}
|
|
7250
|
+
async __userExistsByEmail(request = {}, requestOptions) {
|
|
7251
|
+
const { email, contextId } = request;
|
|
7252
|
+
const _queryParams = {
|
|
7253
|
+
email,
|
|
7254
|
+
contextId
|
|
7255
|
+
};
|
|
7256
|
+
const _authRequest = await this._options.authProvider.getAuthRequest();
|
|
7257
|
+
const _headers = mergeHeaders(
|
|
7258
|
+
_authRequest.headers,
|
|
7259
|
+
this._options?.headers,
|
|
7260
|
+
requestOptions?.headers
|
|
7261
|
+
);
|
|
7262
|
+
const _response = await fetcher({
|
|
7263
|
+
url: url_exports.join(
|
|
7264
|
+
await Supplier.get(this._options.baseUrl) ?? await Supplier.get(this._options.environment),
|
|
7265
|
+
"v1/users/exists-by-email"
|
|
7266
|
+
),
|
|
7267
|
+
method: "GET",
|
|
7268
|
+
headers: _headers,
|
|
7269
|
+
queryString: url_exports.queryBuilder().addMany(_queryParams).mergeAdditional(requestOptions?.queryParams).build(),
|
|
7270
|
+
timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1e3,
|
|
7271
|
+
maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries,
|
|
7272
|
+
abortSignal: requestOptions?.abortSignal,
|
|
7273
|
+
fetchFn: this._options?.fetch,
|
|
7274
|
+
logging: this._options.logging
|
|
7275
|
+
});
|
|
7276
|
+
if (_response.ok) {
|
|
7277
|
+
return { data: _response.body, rawResponse: _response.rawResponse };
|
|
7278
|
+
}
|
|
7279
|
+
if (_response.error.reason === "status-code") {
|
|
7280
|
+
switch (_response.error.statusCode) {
|
|
7281
|
+
case 400:
|
|
7282
|
+
throw new BadRequestError(_response.error.body, _response.rawResponse);
|
|
7283
|
+
case 403:
|
|
7284
|
+
throw new ForbiddenError(_response.error.body, _response.rawResponse);
|
|
7285
|
+
default:
|
|
7286
|
+
throw new VectrosError({
|
|
7287
|
+
statusCode: _response.error.statusCode,
|
|
7288
|
+
body: _response.error.body,
|
|
7289
|
+
rawResponse: _response.rawResponse
|
|
7290
|
+
});
|
|
7291
|
+
}
|
|
7292
|
+
}
|
|
7293
|
+
return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/v1/users/exists-by-email");
|
|
7294
|
+
}
|
|
6906
7295
|
/**
|
|
6907
7296
|
* 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.
|
|
6908
7297
|
*
|
|
@@ -8664,15 +9053,15 @@ function warnOnSuboptimalKey(key, log) {
|
|
|
8664
9053
|
} else if (key.prefix === "st") {
|
|
8665
9054
|
log.warn(
|
|
8666
9055
|
{ prefix: key.prefix, env: key.env },
|
|
8667
|
-
"short-lived token (st_*) will expire mid-session (1h
|
|
9056
|
+
"short-lived token (st_*) will expire mid-session (1h max). For long-running MCP installs, prefer a long-lived ssk_* key."
|
|
8668
9057
|
);
|
|
8669
9058
|
}
|
|
8670
9059
|
}
|
|
8671
9060
|
|
|
8672
9061
|
// src/build-info.ts
|
|
8673
9062
|
var BUILD_INFO = {
|
|
8674
|
-
mcpServer: true ? "0.
|
|
8675
|
-
sdk: true ? "0.
|
|
9063
|
+
mcpServer: true ? "0.14.0" : "dev",
|
|
9064
|
+
sdk: true ? "0.39.0" : "dev"
|
|
8676
9065
|
};
|
|
8677
9066
|
|
|
8678
9067
|
// src/log.ts
|