@vectros-ai/mcp-server 0.5.2 → 0.5.3

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/cli-http.js CHANGED
@@ -2861,7 +2861,7 @@ var AuthClient = class {
2861
2861
  );
2862
2862
  }
2863
2863
  /**
2864
- * Creates a new access profile under the given app context. This call is idempotent by `principalId`: if a profile with the same `principalId` already exists, the existing profile is returned (with status 200) instead of creating a duplicate. You must provide exactly one of `scopes` (an inline list of scopes) or `roleId` (a reference to a role); supplying both, or neither, is rejected. `identityOverrides` may set only `orgId` and `clientId`; any other key (including the account identifier or `userId`) is rejected. If you use a scoped credential, the profile's effective scopes may not exceed your own; a root API key (`sk_`) is exempt. Requires the `profiles:c` scope.
2864
+ * Creates a new access profile under the given app context. This call is idempotent by `principalId`: if a profile with the same `principalId` already exists, the existing profile is returned (with status 200) instead of creating a duplicate. The response's `created` field (and the HTTP status — 201 when created, 200 when an existing profile was returned) tells the two apart. To overwrite an existing profile's `scopes`/`roleId`, `identityOverrides`, and `status` instead of returning it unchanged, set `?upsert=true` (this also requires the `profiles:u` scope). You must provide exactly one of `scopes` (an inline list of scopes) or `roleId` (a reference to a role); supplying both, or neither, is rejected. `identityOverrides` may set only `orgId` and `clientId`; any other key (including the account identifier or `userId`) is rejected. If you use a scoped credential, the profile's effective scopes may not exceed your own; a root API key (`sk_`) is exempt. Requires the `profiles:c` scope.
2865
2865
  *
2866
2866
  * @param {Vectros.CreateAccessProfileRequest} request
2867
2867
  * @param {AuthClient.RequestOptions} requestOptions - Request-specific configuration.
@@ -2883,7 +2883,10 @@ var AuthClient = class {
2883
2883
  return HttpResponsePromise.fromPromise(this.__createAccessProfile(request, requestOptions));
2884
2884
  }
2885
2885
  async __createAccessProfile(request, requestOptions) {
2886
- const { contextId, body: _body } = request;
2886
+ const { contextId, upsert, body: _body } = request;
2887
+ const _queryParams = {
2888
+ upsert
2889
+ };
2887
2890
  const _authRequest = await this._options.authProvider.getAuthRequest();
2888
2891
  const _headers = mergeHeaders(
2889
2892
  _authRequest.headers,
@@ -2898,7 +2901,7 @@ var AuthClient = class {
2898
2901
  method: "POST",
2899
2902
  headers: _headers,
2900
2903
  contentType: "application/json",
2901
- queryString: url_exports.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(),
2904
+ queryString: url_exports.queryBuilder().addMany(_queryParams).mergeAdditional(requestOptions?.queryParams).build(),
2902
2905
  requestType: "json",
2903
2906
  body: _body,
2904
2907
  timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1e3,
@@ -2993,9 +2996,9 @@ var AuthClient = class {
2993
2996
  return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/v1/app-contexts");
2994
2997
  }
2995
2998
  /**
2996
- * Creates a new app context. This call is idempotent by `contextId`: if an app context with the same `contextId` already exists, the existing app context is returned (with status 200) instead of creating a duplicate. The reserved `contextId` value `vectros-admin` cannot be created through this endpoint; it is provisioned automatically for your account. Requires the `app-contexts:c` scope.
2999
+ * Creates a new app context. This call is idempotent by `contextId`: if an app context with the same `contextId` already exists, the existing app context is returned (with status 200) instead of creating a duplicate. The response's `created` field (and the HTTP status — 201 when created, 200 when an existing context was returned) tells the two apart. To overwrite an existing context's `name`/`description` instead of returning it unchanged, set `?upsert=true` (this also requires the `app-contexts:u` scope). The reserved `contextId` value `vectros-admin` cannot be created through this endpoint; it is provisioned automatically for your account. Requires the `app-contexts:c` scope.
2997
3000
  *
2998
- * @param {Vectros.AppContextRequest} request
3001
+ * @param {Vectros.CreateAppContextRequest} request
2999
3002
  * @param {AuthClient.RequestOptions} requestOptions - Request-specific configuration.
3000
3003
  *
3001
3004
  * @throws {@link Vectros.BadRequestError}
@@ -3004,14 +3007,20 @@ var AuthClient = class {
3004
3007
  *
3005
3008
  * @example
3006
3009
  * await client.auth.createAppContext({
3007
- * contextId: "myapp",
3008
- * name: "My Internal App"
3010
+ * body: {
3011
+ * contextId: "myapp",
3012
+ * name: "My Internal App"
3013
+ * }
3009
3014
  * })
3010
3015
  */
3011
3016
  createAppContext(request, requestOptions) {
3012
3017
  return HttpResponsePromise.fromPromise(this.__createAppContext(request, requestOptions));
3013
3018
  }
3014
3019
  async __createAppContext(request, requestOptions) {
3020
+ const { upsert, body: _body } = request;
3021
+ const _queryParams = {
3022
+ upsert
3023
+ };
3015
3024
  const _authRequest = await this._options.authProvider.getAuthRequest();
3016
3025
  const _headers = mergeHeaders(
3017
3026
  _authRequest.headers,
@@ -3026,9 +3035,9 @@ var AuthClient = class {
3026
3035
  method: "POST",
3027
3036
  headers: _headers,
3028
3037
  contentType: "application/json",
3029
- queryString: url_exports.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(),
3038
+ queryString: url_exports.queryBuilder().addMany(_queryParams).mergeAdditional(requestOptions?.queryParams).build(),
3030
3039
  requestType: "json",
3031
- body: request,
3040
+ body: _body,
3032
3041
  timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1e3,
3033
3042
  maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries,
3034
3043
  abortSignal: requestOptions?.abortSignal,
@@ -3124,7 +3133,7 @@ var AuthClient = class {
3124
3133
  );
3125
3134
  }
3126
3135
  /**
3127
- * Creates a new role under the given app context. This call is idempotent by `roleId`: if a role with the same `roleId` already exists, the existing role is returned (with status 200) instead of creating a duplicate. If you use a scoped credential, the role's scopes may not exceed your own; a root API key (`sk_`) is exempt. Requires the `profiles:c` scope.
3136
+ * Creates a new role under the given app context. This call is idempotent by `roleId`: if a role with the same `roleId` already exists, the existing role is returned (with status 200) instead of creating a duplicate. The response's `created` field (and the HTTP status — 201 when created, 200 when an existing role was returned) tells the two apart. To overwrite an existing role's `name`/`description`/`scopes` instead of returning it unchanged, set `?upsert=true` (this also requires the `profiles:u` scope). If you use a scoped credential, the role's scopes may not exceed your own; a root API key (`sk_`) is exempt. Requires the `profiles:c` scope.
3128
3137
  *
3129
3138
  * @param {Vectros.CreateRoleRequest} request
3130
3139
  * @param {AuthClient.RequestOptions} requestOptions - Request-specific configuration.
@@ -3150,7 +3159,10 @@ var AuthClient = class {
3150
3159
  return HttpResponsePromise.fromPromise(this.__createRole(request, requestOptions));
3151
3160
  }
3152
3161
  async __createRole(request, requestOptions) {
3153
- const { contextId, body: _body } = request;
3162
+ const { contextId, upsert, body: _body } = request;
3163
+ const _queryParams = {
3164
+ upsert
3165
+ };
3154
3166
  const _authRequest = await this._options.authProvider.getAuthRequest();
3155
3167
  const _headers = mergeHeaders(
3156
3168
  _authRequest.headers,
@@ -3165,7 +3177,7 @@ var AuthClient = class {
3165
3177
  method: "POST",
3166
3178
  headers: _headers,
3167
3179
  contentType: "application/json",
3168
- queryString: url_exports.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(),
3180
+ queryString: url_exports.queryBuilder().addMany(_queryParams).mergeAdditional(requestOptions?.queryParams).build(),
3169
3181
  requestType: "json",
3170
3182
  body: _body,
3171
3183
  timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1e3,
@@ -4649,23 +4661,30 @@ var DocumentsClient = class {
4649
4661
  return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/v1/documents");
4650
4662
  }
4651
4663
  /**
4652
- * Creates a document from a raw text string and queues it for asynchronous indexing so it becomes searchable. Requires the `documents:c` scope.
4664
+ * Creates a document from a raw text string and queues it for asynchronous indexing so it becomes searchable. Optionally supply an `externalId` to make the create idempotent — if a document with the same `externalId` already exists in your context, that existing document is returned unchanged instead of a duplicate being created. The response's `created` field (and the HTTP status — 201 when created, 200 when an existing document was returned) tells the two apart. To overwrite an existing document's content instead of returning it unchanged, set `?upsert=true` (this also requires the `documents:u` scope). Requires the `documents:c` scope.
4653
4665
  *
4654
- * @param {Vectros.DocumentRequest} request
4666
+ * @param {Vectros.IngestDocumentRequest} request
4655
4667
  * @param {DocumentsClient.RequestOptions} requestOptions - Request-specific configuration.
4656
4668
  *
4657
4669
  * @throws {@link Vectros.BadRequestError}
4670
+ * @throws {@link Vectros.ForbiddenError}
4658
4671
  * @throws {@link Vectros.TooManyRequestsError}
4659
4672
  *
4660
4673
  * @example
4661
4674
  * await client.documents.ingestDocument({
4662
- * title: "Patient Intake Form \u2014 Jane Doe"
4675
+ * body: {
4676
+ * title: "Patient Intake Form \u2014 Jane Doe"
4677
+ * }
4663
4678
  * })
4664
4679
  */
4665
4680
  ingestDocument(request, requestOptions) {
4666
4681
  return HttpResponsePromise.fromPromise(this.__ingestDocument(request, requestOptions));
4667
4682
  }
4668
4683
  async __ingestDocument(request, requestOptions) {
4684
+ const { upsert, body: _body } = request;
4685
+ const _queryParams = {
4686
+ upsert
4687
+ };
4669
4688
  const _authRequest = await this._options.authProvider.getAuthRequest();
4670
4689
  const _headers = mergeHeaders(
4671
4690
  _authRequest.headers,
@@ -4680,9 +4699,9 @@ var DocumentsClient = class {
4680
4699
  method: "POST",
4681
4700
  headers: _headers,
4682
4701
  contentType: "application/json",
4683
- queryString: url_exports.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(),
4702
+ queryString: url_exports.queryBuilder().addMany(_queryParams).mergeAdditional(requestOptions?.queryParams).build(),
4684
4703
  requestType: "json",
4685
- body: request,
4704
+ body: _body,
4686
4705
  timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1e3,
4687
4706
  maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries,
4688
4707
  abortSignal: requestOptions?.abortSignal,
@@ -4696,6 +4715,8 @@ var DocumentsClient = class {
4696
4715
  switch (_response.error.statusCode) {
4697
4716
  case 400:
4698
4717
  throw new BadRequestError(_response.error.body, _response.rawResponse);
4718
+ case 403:
4719
+ throw new ForbiddenError(_response.error.body, _response.rawResponse);
4699
4720
  case 429:
4700
4721
  throw new TooManyRequestsError(_response.error.body, _response.rawResponse);
4701
4722
  default:
@@ -4962,7 +4983,7 @@ var DocumentsClient = class {
4962
4983
  return handleNonStatusCodeError(_response.error, _response.rawResponse, "PATCH", "/v1/documents/{id}");
4963
4984
  }
4964
4985
  /**
4965
- * Finds documents of a given type by a schema-declared lookup field. The document must be bound to a schema (via `schemaId`) that declares the field as a lookup field. A lookup on a sensitive field is rejected here, because the value would appear in the URL query string; use POST /v1/documents/lookup (the request-body variant) for a sensitive field instead. Results are paginated: set `limit` for the page size and feed the returned `nextCursor` back as `startFrom` to fetch the next page. The response is a `{data, nextCursor}` envelope. Requires the `documents:r` scope.
4986
+ * Finds documents of a given type by field value. Supported fields: `externalId` (the document's first-class external identifier — no schema declaration required) and any field declared as a lookup field on the bound schema. A lookup on a sensitive field is rejected here because the value would appear in the URL query string; use POST /v1/documents/lookup (the request-body variant) for a sensitive field instead. Results are paginated: set `limit` for the page size and feed the returned `nextCursor` back as `startFrom` to fetch the next page. The response is a `{data, nextCursor}` envelope. Requires the `documents:r` scope.
4966
4987
  *
4967
4988
  * @param {Vectros.LookupDocumentsRequest} request
4968
4989
  * @param {DocumentsClient.RequestOptions} requestOptions - Request-specific configuration.
@@ -5257,12 +5278,13 @@ var DocumentsClient = class {
5257
5278
  return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/v1/documents/{id}/versions");
5258
5279
  }
5259
5280
  /**
5260
- * Starts a file-based document by returning a short-lived presigned S3 PUT URL. Upload the file bytes directly to `uploadUrl`; the document is then automatically queued for text extraction and asynchronous indexing. Requires the `documents:c` scope.
5281
+ * Starts a file-based document by returning a short-lived presigned S3 PUT URL. Upload the file bytes directly to `uploadUrl`; the document is then automatically queued for text extraction and asynchronous indexing. Supplying an `externalId` makes this idempotent — re-initiating an upload with the same `externalId` re-issues a fresh presigned URL to the SAME existing document/object (so a re-upload inherently replaces the file body) rather than creating a duplicate. The response's `created` field (and the HTTP status — 201 when a new document was minted, 200 when an existing one was matched) tells the two apart. With `?upsert=true`, the submitted `payload`/`title` are also applied to the matched document (file-body divergence cannot be diffed at upload-init — the bytes have not arrived yet — so the re-upload itself replaces the body; `?upsert=true` requires the `documents:u` scope). Requires the `documents:c` scope.
5261
5282
  *
5262
5283
  * @param {Vectros.FileUploadRequest} request
5263
5284
  * @param {DocumentsClient.RequestOptions} requestOptions - Request-specific configuration.
5264
5285
  *
5265
5286
  * @throws {@link Vectros.BadRequestError}
5287
+ * @throws {@link Vectros.ForbiddenError}
5266
5288
  * @throws {@link Vectros.TooManyRequestsError}
5267
5289
  *
5268
5290
  * @example
@@ -5275,6 +5297,10 @@ var DocumentsClient = class {
5275
5297
  return HttpResponsePromise.fromPromise(this.__uploadDocument(request, requestOptions));
5276
5298
  }
5277
5299
  async __uploadDocument(request, requestOptions) {
5300
+ const { upsert, ..._body } = request;
5301
+ const _queryParams = {
5302
+ upsert
5303
+ };
5278
5304
  const _authRequest = await this._options.authProvider.getAuthRequest();
5279
5305
  const _headers = mergeHeaders(
5280
5306
  _authRequest.headers,
@@ -5289,9 +5315,9 @@ var DocumentsClient = class {
5289
5315
  method: "POST",
5290
5316
  headers: _headers,
5291
5317
  contentType: "application/json",
5292
- queryString: url_exports.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(),
5318
+ queryString: url_exports.queryBuilder().addMany(_queryParams).mergeAdditional(requestOptions?.queryParams).build(),
5293
5319
  requestType: "json",
5294
- body: request,
5320
+ body: _body,
5295
5321
  timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1e3,
5296
5322
  maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries,
5297
5323
  abortSignal: requestOptions?.abortSignal,
@@ -5305,6 +5331,8 @@ var DocumentsClient = class {
5305
5331
  switch (_response.error.statusCode) {
5306
5332
  case 400:
5307
5333
  throw new BadRequestError(_response.error.body, _response.rawResponse);
5334
+ case 403:
5335
+ throw new ForbiddenError(_response.error.body, _response.rawResponse);
5308
5336
  case 429:
5309
5337
  throw new TooManyRequestsError(_response.error.body, _response.rawResponse);
5310
5338
  default:
@@ -5383,23 +5411,30 @@ var FoldersClient = class {
5383
5411
  return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/v1/folders");
5384
5412
  }
5385
5413
  /**
5386
- * Creates a folder to organize your documents and records. If `parentFolderId` is omitted, the folder is created under your context's default root folder. Requires the `folders:c` scope.
5414
+ * Creates a folder to organize your documents and records. If `parentFolderId` is omitted, the folder is created under your context's default root folder. Folder creation is idempotent by (slug + parent): if a folder with the same slug already exists under the same parent, that existing folder is returned unchanged instead of a duplicate being created. The response's `created` field (and the HTTP status — 201 when created, 200 when an existing folder was returned) tells the two apart. To overwrite an existing folder's mutable fields instead of returning it unchanged, set `?upsert=true` (this also requires the `folders:u` scope). Requires the `folders:c` scope.
5387
5415
  *
5388
- * @param {Vectros.FolderRequest} request
5416
+ * @param {Vectros.CreateFolderRequest} request
5389
5417
  * @param {FoldersClient.RequestOptions} requestOptions - Request-specific configuration.
5390
5418
  *
5391
5419
  * @throws {@link Vectros.BadRequestError}
5420
+ * @throws {@link Vectros.ForbiddenError}
5392
5421
  * @throws {@link Vectros.TooManyRequestsError}
5393
5422
  *
5394
5423
  * @example
5395
5424
  * await client.folders.createFolder({
5396
- * name: "Patient Records 2024"
5425
+ * body: {
5426
+ * name: "Patient Records 2024"
5427
+ * }
5397
5428
  * })
5398
5429
  */
5399
5430
  createFolder(request, requestOptions) {
5400
5431
  return HttpResponsePromise.fromPromise(this.__createFolder(request, requestOptions));
5401
5432
  }
5402
5433
  async __createFolder(request, requestOptions) {
5434
+ const { upsert, body: _body } = request;
5435
+ const _queryParams = {
5436
+ upsert
5437
+ };
5403
5438
  const _authRequest = await this._options.authProvider.getAuthRequest();
5404
5439
  const _headers = mergeHeaders(
5405
5440
  _authRequest.headers,
@@ -5414,9 +5449,9 @@ var FoldersClient = class {
5414
5449
  method: "POST",
5415
5450
  headers: _headers,
5416
5451
  contentType: "application/json",
5417
- queryString: url_exports.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(),
5452
+ queryString: url_exports.queryBuilder().addMany(_queryParams).mergeAdditional(requestOptions?.queryParams).build(),
5418
5453
  requestType: "json",
5419
- body: request,
5454
+ body: _body,
5420
5455
  timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1e3,
5421
5456
  maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries,
5422
5457
  abortSignal: requestOptions?.abortSignal,
@@ -5430,6 +5465,8 @@ var FoldersClient = class {
5430
5465
  switch (_response.error.statusCode) {
5431
5466
  case 400:
5432
5467
  throw new BadRequestError(_response.error.body, _response.rawResponse);
5468
+ case 403:
5469
+ throw new ForbiddenError(_response.error.body, _response.rawResponse);
5433
5470
  case 429:
5434
5471
  throw new TooManyRequestsError(_response.error.body, _response.rawResponse);
5435
5472
  default:
@@ -5838,23 +5875,30 @@ var IdentityClient = class {
5838
5875
  return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/v1/clients");
5839
5876
  }
5840
5877
  /**
5841
- * Creates a new client identity in your account. This call is idempotent on `externalId`: if a client with the same `externalId` already exists, the existing record is returned instead of creating a duplicate. Requires the `clients:c` scope.
5878
+ * Creates a new client identity in your account. This call is idempotent on `externalId`: if a client with the same `externalId` already exists, the existing record is returned instead of creating a duplicate. The response's `created` field (and the HTTP status — 201 when created, 200 when an existing client was returned) tells the two apart. To overwrite an existing client's content instead of returning it unchanged, set `?upsert=true` (this also requires the `clients:u` scope). Requires the `clients:c` scope.
5842
5879
  *
5843
- * @param {Vectros.ClientRequest} request
5880
+ * @param {Vectros.CreateClientRequest} request
5844
5881
  * @param {IdentityClient.RequestOptions} requestOptions - Request-specific configuration.
5845
5882
  *
5846
5883
  * @throws {@link Vectros.BadRequestError}
5884
+ * @throws {@link Vectros.ForbiddenError}
5847
5885
  * @throws {@link Vectros.TooManyRequestsError}
5848
5886
  *
5849
5887
  * @example
5850
5888
  * await client.identity.createClient({
5851
- * externalId: "patient_789"
5889
+ * body: {
5890
+ * externalId: "patient_789"
5891
+ * }
5852
5892
  * })
5853
5893
  */
5854
5894
  createClient(request, requestOptions) {
5855
5895
  return HttpResponsePromise.fromPromise(this.__createClient(request, requestOptions));
5856
5896
  }
5857
5897
  async __createClient(request, requestOptions) {
5898
+ const { upsert, body: _body } = request;
5899
+ const _queryParams = {
5900
+ upsert
5901
+ };
5858
5902
  const _authRequest = await this._options.authProvider.getAuthRequest();
5859
5903
  const _headers = mergeHeaders(
5860
5904
  _authRequest.headers,
@@ -5869,9 +5913,9 @@ var IdentityClient = class {
5869
5913
  method: "POST",
5870
5914
  headers: _headers,
5871
5915
  contentType: "application/json",
5872
- queryString: url_exports.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(),
5916
+ queryString: url_exports.queryBuilder().addMany(_queryParams).mergeAdditional(requestOptions?.queryParams).build(),
5873
5917
  requestType: "json",
5874
- body: request,
5918
+ body: _body,
5875
5919
  timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1e3,
5876
5920
  maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries,
5877
5921
  abortSignal: requestOptions?.abortSignal,
@@ -5885,6 +5929,8 @@ var IdentityClient = class {
5885
5929
  switch (_response.error.statusCode) {
5886
5930
  case 400:
5887
5931
  throw new BadRequestError(_response.error.body, _response.rawResponse);
5932
+ case 403:
5933
+ throw new ForbiddenError(_response.error.body, _response.rawResponse);
5888
5934
  case 429:
5889
5935
  throw new TooManyRequestsError(_response.error.body, _response.rawResponse);
5890
5936
  default:
@@ -6273,23 +6319,30 @@ var IdentityClient = class {
6273
6319
  return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/v1/orgs");
6274
6320
  }
6275
6321
  /**
6276
- * Creates a new organization in your account. This call is idempotent on `externalId`: if an organization with the same `externalId` already exists, the existing record is returned instead of creating a duplicate. Requires the `orgs:c` scope.
6322
+ * Creates a new organization in your account. This call is idempotent on `externalId`: if an organization with the same `externalId` already exists, the existing record is returned instead of creating a duplicate. The response's `created` field (and the HTTP status — 201 when created, 200 when an existing organization was returned) tells the two apart. To overwrite an existing organization's content instead of returning it unchanged, set `?upsert=true` (this also requires the `orgs:u` scope). Requires the `orgs:c` scope.
6277
6323
  *
6278
- * @param {Vectros.OrgRequest} request
6324
+ * @param {Vectros.CreateOrgRequest} request
6279
6325
  * @param {IdentityClient.RequestOptions} requestOptions - Request-specific configuration.
6280
6326
  *
6281
6327
  * @throws {@link Vectros.BadRequestError}
6328
+ * @throws {@link Vectros.ForbiddenError}
6282
6329
  * @throws {@link Vectros.TooManyRequestsError}
6283
6330
  *
6284
6331
  * @example
6285
6332
  * await client.identity.createOrg({
6286
- * externalId: "clinic_001"
6333
+ * body: {
6334
+ * externalId: "clinic_001"
6335
+ * }
6287
6336
  * })
6288
6337
  */
6289
6338
  createOrg(request, requestOptions) {
6290
6339
  return HttpResponsePromise.fromPromise(this.__createOrg(request, requestOptions));
6291
6340
  }
6292
6341
  async __createOrg(request, requestOptions) {
6342
+ const { upsert, body: _body } = request;
6343
+ const _queryParams = {
6344
+ upsert
6345
+ };
6293
6346
  const _authRequest = await this._options.authProvider.getAuthRequest();
6294
6347
  const _headers = mergeHeaders(
6295
6348
  _authRequest.headers,
@@ -6304,9 +6357,9 @@ var IdentityClient = class {
6304
6357
  method: "POST",
6305
6358
  headers: _headers,
6306
6359
  contentType: "application/json",
6307
- queryString: url_exports.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(),
6360
+ queryString: url_exports.queryBuilder().addMany(_queryParams).mergeAdditional(requestOptions?.queryParams).build(),
6308
6361
  requestType: "json",
6309
- body: request,
6362
+ body: _body,
6310
6363
  timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1e3,
6311
6364
  maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries,
6312
6365
  abortSignal: requestOptions?.abortSignal,
@@ -6320,6 +6373,8 @@ var IdentityClient = class {
6320
6373
  switch (_response.error.statusCode) {
6321
6374
  case 400:
6322
6375
  throw new BadRequestError(_response.error.body, _response.rawResponse);
6376
+ case 403:
6377
+ throw new ForbiddenError(_response.error.body, _response.rawResponse);
6323
6378
  case 429:
6324
6379
  throw new TooManyRequestsError(_response.error.body, _response.rawResponse);
6325
6380
  default:
@@ -6694,23 +6749,30 @@ var IdentityClient = class {
6694
6749
  return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/v1/users");
6695
6750
  }
6696
6751
  /**
6697
- * Creates a user identity in your account. The operation is idempotent on `externalId`: if a user with the same `externalId` already exists, the existing record is returned instead of creating a duplicate. Requires the `users:c` scope.
6752
+ * Creates a user identity in your account. The operation is idempotent on `externalId`: if a user with the same `externalId` already exists, the existing record is returned instead of creating a duplicate. The response's `created` field (and the HTTP status — 201 when created, 200 when an existing user was returned) tells the two apart. To overwrite an existing user's mutable fields (email, status, payload, schema binding) instead of returning it unchanged, set `?upsert=true` (this also requires the `users:u` scope). Requires the `users:c` scope.
6698
6753
  *
6699
- * @param {Vectros.UserRequest} request
6754
+ * @param {Vectros.CreateUserRequest} request
6700
6755
  * @param {IdentityClient.RequestOptions} requestOptions - Request-specific configuration.
6701
6756
  *
6702
6757
  * @throws {@link Vectros.BadRequestError}
6758
+ * @throws {@link Vectros.ForbiddenError}
6703
6759
  * @throws {@link Vectros.TooManyRequestsError}
6704
6760
  *
6705
6761
  * @example
6706
6762
  * await client.identity.createUser({
6707
- * externalId: "usr_12345"
6763
+ * body: {
6764
+ * externalId: "usr_12345"
6765
+ * }
6708
6766
  * })
6709
6767
  */
6710
6768
  createUser(request, requestOptions) {
6711
6769
  return HttpResponsePromise.fromPromise(this.__createUser(request, requestOptions));
6712
6770
  }
6713
6771
  async __createUser(request, requestOptions) {
6772
+ const { upsert, body: _body } = request;
6773
+ const _queryParams = {
6774
+ upsert
6775
+ };
6714
6776
  const _authRequest = await this._options.authProvider.getAuthRequest();
6715
6777
  const _headers = mergeHeaders(
6716
6778
  _authRequest.headers,
@@ -6725,9 +6787,9 @@ var IdentityClient = class {
6725
6787
  method: "POST",
6726
6788
  headers: _headers,
6727
6789
  contentType: "application/json",
6728
- queryString: url_exports.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(),
6790
+ queryString: url_exports.queryBuilder().addMany(_queryParams).mergeAdditional(requestOptions?.queryParams).build(),
6729
6791
  requestType: "json",
6730
- body: request,
6792
+ body: _body,
6731
6793
  timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1e3,
6732
6794
  maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries,
6733
6795
  abortSignal: requestOptions?.abortSignal,
@@ -6741,6 +6803,8 @@ var IdentityClient = class {
6741
6803
  switch (_response.error.statusCode) {
6742
6804
  case 400:
6743
6805
  throw new BadRequestError(_response.error.body, _response.rawResponse);
6806
+ case 403:
6807
+ throw new ForbiddenError(_response.error.body, _response.rawResponse);
6744
6808
  case 429:
6745
6809
  throw new TooManyRequestsError(_response.error.body, _response.rawResponse);
6746
6810
  default:
@@ -7558,9 +7622,9 @@ var RecordsClient = class {
7558
7622
  return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/v1/records");
7559
7623
  }
7560
7624
  /**
7561
- * Creates a new record of a given type. The `payload` is validated against that type's schema before the record is stored. Identify the type by sending `typeName`, `schemaId`, or both (they must agree); if you send only `schemaId`, the type is taken from that schema. Optionally supply an `externalId` to make the create idempotent — if a record with the same `externalId` already exists in your context, that existing record is returned unchanged instead of a duplicate being created. Requires the `records:c:<type>` scope.
7625
+ * Creates a new record of a given type. The `payload` is validated against that type's schema before the record is stored. Identify the type by sending `typeName`, `schemaId`, or both (they must agree); if you send only `schemaId`, the type is taken from that schema. Optionally supply an `externalId` to make the create idempotent — if a record with the same `externalId` already exists in your context, that existing record is returned unchanged instead of a duplicate being created. The response's `created` field (and the HTTP status — 201 when created, 200 when an existing record was returned) tells the two apart. To overwrite an existing record's content instead of returning it unchanged, set `?upsert=true` (this also requires the `records:u:<type>` scope). Requires the `records:c:<type>` scope.
7562
7626
  *
7563
- * @param {Vectros.RecordRequest} request
7627
+ * @param {Vectros.CreateRecordRequest} request
7564
7628
  * @param {RecordsClient.RequestOptions} requestOptions - Request-specific configuration.
7565
7629
  *
7566
7630
  * @throws {@link Vectros.BadRequestError}
@@ -7569,19 +7633,25 @@ var RecordsClient = class {
7569
7633
  *
7570
7634
  * @example
7571
7635
  * await client.records.createRecord({
7572
- * typeName: "intake_form",
7573
- * schemaId: "6ba7b810-9dad-11d1-80b4-00c04fd430c8",
7574
- * payload: {
7575
- * "first_name": "Jane",
7576
- * "email": "jane@example.com"
7577
- * },
7578
- * folderId: "f47ac10b-58cc-4372-a567-0e02b2c3d479"
7636
+ * body: {
7637
+ * typeName: "intake_form",
7638
+ * schemaId: "6ba7b810-9dad-11d1-80b4-00c04fd430c8",
7639
+ * payload: {
7640
+ * "first_name": "Jane",
7641
+ * "email": "jane@example.com"
7642
+ * },
7643
+ * folderId: "f47ac10b-58cc-4372-a567-0e02b2c3d479"
7644
+ * }
7579
7645
  * })
7580
7646
  */
7581
7647
  createRecord(request, requestOptions) {
7582
7648
  return HttpResponsePromise.fromPromise(this.__createRecord(request, requestOptions));
7583
7649
  }
7584
7650
  async __createRecord(request, requestOptions) {
7651
+ const { upsert, body: _body } = request;
7652
+ const _queryParams = {
7653
+ upsert
7654
+ };
7585
7655
  const _authRequest = await this._options.authProvider.getAuthRequest();
7586
7656
  const _headers = mergeHeaders(
7587
7657
  _authRequest.headers,
@@ -7596,9 +7666,9 @@ var RecordsClient = class {
7596
7666
  method: "POST",
7597
7667
  headers: _headers,
7598
7668
  contentType: "application/json",
7599
- queryString: url_exports.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(),
7669
+ queryString: url_exports.queryBuilder().addMany(_queryParams).mergeAdditional(requestOptions?.queryParams).build(),
7600
7670
  requestType: "json",
7601
- body: request,
7671
+ body: _body,
7602
7672
  timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1e3,
7603
7673
  maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries,
7604
7674
  abortSignal: requestOptions?.abortSignal,
@@ -8194,43 +8264,50 @@ var SchemasClient = class {
8194
8264
  return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/v1/schemas");
8195
8265
  }
8196
8266
  /**
8197
- * Defines a new record type with optional field definitions, validation rules, and lookup indexes. Idempotent by `typeName` within the same ownership scope: re-creating an existing `typeName` returns the existing schema rather than failing. Requires the `schemas:w` scope.
8267
+ * Defines a new record type with optional field definitions, validation rules, and lookup indexes. Idempotent by `typeName` within the same ownership scope: re-creating an existing `typeName` returns the existing schema rather than failing. The response's `created` field (and the HTTP status — 201 when created, 200 when an existing schema was returned) tells the two apart. To reconcile an existing schema to the submitted shape instead of returning it unchanged, set `?upsert=true` (this also requires the `schemas:w` scope; only legal schema changes are applied — migration-locked changes are rejected). Requires the `schemas:w` scope.
8198
8268
  *
8199
- * @param {Vectros.SchemaRequest} request
8269
+ * @param {Vectros.CreateSchemaRequest} request
8200
8270
  * @param {SchemasClient.RequestOptions} requestOptions - Request-specific configuration.
8201
8271
  *
8202
8272
  * @throws {@link Vectros.BadRequestError}
8273
+ * @throws {@link Vectros.ForbiddenError}
8203
8274
  * @throws {@link Vectros.TooManyRequestsError}
8204
8275
  *
8205
8276
  * @example
8206
8277
  * await client.schemas.createSchema({
8207
- * typeName: "intake_form",
8208
- * displayName: "Client Intake Form",
8209
- * description: "Captures initial client information",
8210
- * fields: [{
8211
- * fieldId: "first_name",
8212
- * fieldType: "string",
8213
- * required: true,
8214
- * searchable: true
8215
- * }, {
8216
- * fieldId: "email",
8217
- * fieldType: "string",
8218
- * required: true
8219
- * }],
8220
- * lookupFields: [{
8221
- * fieldName: "email",
8222
- * unique: true
8223
- * }],
8224
- * capabilities: {
8225
- * "auditHistory": true
8226
- * },
8227
- * allowedSurfaces: ["record"]
8278
+ * body: {
8279
+ * typeName: "intake_form",
8280
+ * displayName: "Client Intake Form",
8281
+ * description: "Captures initial client information",
8282
+ * fields: [{
8283
+ * fieldId: "first_name",
8284
+ * fieldType: "string",
8285
+ * required: true,
8286
+ * searchable: true
8287
+ * }, {
8288
+ * fieldId: "email",
8289
+ * fieldType: "string",
8290
+ * required: true
8291
+ * }],
8292
+ * lookupFields: [{
8293
+ * fieldName: "email",
8294
+ * unique: true
8295
+ * }],
8296
+ * capabilities: {
8297
+ * "auditHistory": true
8298
+ * },
8299
+ * allowedSurfaces: ["record"]
8300
+ * }
8228
8301
  * })
8229
8302
  */
8230
8303
  createSchema(request, requestOptions) {
8231
8304
  return HttpResponsePromise.fromPromise(this.__createSchema(request, requestOptions));
8232
8305
  }
8233
8306
  async __createSchema(request, requestOptions) {
8307
+ const { upsert, body: _body } = request;
8308
+ const _queryParams = {
8309
+ upsert
8310
+ };
8234
8311
  const _authRequest = await this._options.authProvider.getAuthRequest();
8235
8312
  const _headers = mergeHeaders(
8236
8313
  _authRequest.headers,
@@ -8245,9 +8322,9 @@ var SchemasClient = class {
8245
8322
  method: "POST",
8246
8323
  headers: _headers,
8247
8324
  contentType: "application/json",
8248
- queryString: url_exports.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(),
8325
+ queryString: url_exports.queryBuilder().addMany(_queryParams).mergeAdditional(requestOptions?.queryParams).build(),
8249
8326
  requestType: "json",
8250
- body: request,
8327
+ body: _body,
8251
8328
  timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1e3,
8252
8329
  maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries,
8253
8330
  abortSignal: requestOptions?.abortSignal,
@@ -8261,6 +8338,8 @@ var SchemasClient = class {
8261
8338
  switch (_response.error.statusCode) {
8262
8339
  case 400:
8263
8340
  throw new BadRequestError(_response.error.body, _response.rawResponse);
8341
+ case 403:
8342
+ throw new ForbiddenError(_response.error.body, _response.rawResponse);
8264
8343
  case 429:
8265
8344
  throw new TooManyRequestsError(_response.error.body, _response.rawResponse);
8266
8345
  default:
@@ -8695,8 +8774,8 @@ function warnOnSuboptimalKey(key, log) {
8695
8774
 
8696
8775
  // src/build-info.ts
8697
8776
  var BUILD_INFO = {
8698
- mcpServer: true ? "0.5.2" : "dev",
8699
- sdk: true ? "0.30.0" : "dev"
8777
+ mcpServer: true ? "0.5.3" : "dev",
8778
+ sdk: true ? "0.31.0" : "dev"
8700
8779
  };
8701
8780
 
8702
8781
  // src/log.ts
@@ -9196,15 +9275,17 @@ var recordCreate = ({ client, log }) => ({
9196
9275
  const type = args.type;
9197
9276
  try {
9198
9277
  const created = await client.records.createRecord({
9199
- typeName: type,
9200
- payload: args.fields,
9201
- externalId: args.externalId,
9202
- indexMode: args.indexMode,
9203
- status: args.status,
9204
- folderId: args.folderId,
9205
- userId: args.userId,
9206
- orgId: args.orgId,
9207
- clientId: args.clientId
9278
+ body: {
9279
+ typeName: type,
9280
+ payload: args.fields,
9281
+ externalId: args.externalId,
9282
+ indexMode: args.indexMode,
9283
+ status: args.status,
9284
+ folderId: args.folderId,
9285
+ userId: args.userId,
9286
+ orgId: args.orgId,
9287
+ clientId: args.clientId
9288
+ }
9208
9289
  });
9209
9290
  log.debug({ tool: "record_create", type, id: created.id }, "record_create ok");
9210
9291
  return { content: [{ type: "text", text: JSON.stringify(created, null, 2) }] };
@@ -9846,13 +9927,15 @@ var folderCreate = ({ client, log }) => ({
9846
9927
  handler: async (args) => {
9847
9928
  try {
9848
9929
  const folder = await client.folders.createFolder({
9849
- name: args.name,
9850
- description: args.description,
9851
- parentFolderId: args.parentId,
9852
- slug: args.slug,
9853
- userId: args.userId,
9854
- orgId: args.orgId,
9855
- clientId: args.clientId
9930
+ body: {
9931
+ name: args.name,
9932
+ description: args.description,
9933
+ parentFolderId: args.parentId,
9934
+ slug: args.slug,
9935
+ userId: args.userId,
9936
+ orgId: args.orgId,
9937
+ clientId: args.clientId
9938
+ }
9856
9939
  });
9857
9940
  log.debug({ tool: "folder_create", id: folder.id, name: folder.name }, "folder_create ok");
9858
9941
  return { content: [{ type: "text", text: JSON.stringify(folder, null, 2) }] };
@@ -10106,11 +10189,13 @@ var documentIngest = ({ client, log, transport, ingestRoot }) => ({
10106
10189
  if (text) {
10107
10190
  const storeText = args.storeText ?? true;
10108
10191
  const result = await client.documents.ingestDocument({
10109
- title,
10110
- text,
10111
- indexMode,
10112
- storeText,
10113
- ...common
10192
+ body: {
10193
+ title,
10194
+ text,
10195
+ indexMode,
10196
+ storeText,
10197
+ ...common
10198
+ }
10114
10199
  });
10115
10200
  log.debug(
10116
10201
  { tool: "document_ingest", mode: "text", id: result?.id, indexMode },