@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.mjs CHANGED
@@ -2838,7 +2838,7 @@ var AuthClient = class {
2838
2838
  );
2839
2839
  }
2840
2840
  /**
2841
- * 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.
2841
+ * 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.
2842
2842
  *
2843
2843
  * @param {Vectros.CreateAccessProfileRequest} request
2844
2844
  * @param {AuthClient.RequestOptions} requestOptions - Request-specific configuration.
@@ -2860,7 +2860,10 @@ var AuthClient = class {
2860
2860
  return HttpResponsePromise.fromPromise(this.__createAccessProfile(request, requestOptions));
2861
2861
  }
2862
2862
  async __createAccessProfile(request, requestOptions) {
2863
- const { contextId, body: _body } = request;
2863
+ const { contextId, upsert, body: _body } = request;
2864
+ const _queryParams = {
2865
+ upsert
2866
+ };
2864
2867
  const _authRequest = await this._options.authProvider.getAuthRequest();
2865
2868
  const _headers = mergeHeaders(
2866
2869
  _authRequest.headers,
@@ -2875,7 +2878,7 @@ var AuthClient = class {
2875
2878
  method: "POST",
2876
2879
  headers: _headers,
2877
2880
  contentType: "application/json",
2878
- queryString: url_exports.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(),
2881
+ queryString: url_exports.queryBuilder().addMany(_queryParams).mergeAdditional(requestOptions?.queryParams).build(),
2879
2882
  requestType: "json",
2880
2883
  body: _body,
2881
2884
  timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1e3,
@@ -2970,9 +2973,9 @@ var AuthClient = class {
2970
2973
  return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/v1/app-contexts");
2971
2974
  }
2972
2975
  /**
2973
- * 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.
2976
+ * 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.
2974
2977
  *
2975
- * @param {Vectros.AppContextRequest} request
2978
+ * @param {Vectros.CreateAppContextRequest} request
2976
2979
  * @param {AuthClient.RequestOptions} requestOptions - Request-specific configuration.
2977
2980
  *
2978
2981
  * @throws {@link Vectros.BadRequestError}
@@ -2981,14 +2984,20 @@ var AuthClient = class {
2981
2984
  *
2982
2985
  * @example
2983
2986
  * await client.auth.createAppContext({
2984
- * contextId: "myapp",
2985
- * name: "My Internal App"
2987
+ * body: {
2988
+ * contextId: "myapp",
2989
+ * name: "My Internal App"
2990
+ * }
2986
2991
  * })
2987
2992
  */
2988
2993
  createAppContext(request, requestOptions) {
2989
2994
  return HttpResponsePromise.fromPromise(this.__createAppContext(request, requestOptions));
2990
2995
  }
2991
2996
  async __createAppContext(request, requestOptions) {
2997
+ const { upsert, body: _body } = request;
2998
+ const _queryParams = {
2999
+ upsert
3000
+ };
2992
3001
  const _authRequest = await this._options.authProvider.getAuthRequest();
2993
3002
  const _headers = mergeHeaders(
2994
3003
  _authRequest.headers,
@@ -3003,9 +3012,9 @@ var AuthClient = class {
3003
3012
  method: "POST",
3004
3013
  headers: _headers,
3005
3014
  contentType: "application/json",
3006
- queryString: url_exports.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(),
3015
+ queryString: url_exports.queryBuilder().addMany(_queryParams).mergeAdditional(requestOptions?.queryParams).build(),
3007
3016
  requestType: "json",
3008
- body: request,
3017
+ body: _body,
3009
3018
  timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1e3,
3010
3019
  maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries,
3011
3020
  abortSignal: requestOptions?.abortSignal,
@@ -3101,7 +3110,7 @@ var AuthClient = class {
3101
3110
  );
3102
3111
  }
3103
3112
  /**
3104
- * 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.
3113
+ * 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.
3105
3114
  *
3106
3115
  * @param {Vectros.CreateRoleRequest} request
3107
3116
  * @param {AuthClient.RequestOptions} requestOptions - Request-specific configuration.
@@ -3127,7 +3136,10 @@ var AuthClient = class {
3127
3136
  return HttpResponsePromise.fromPromise(this.__createRole(request, requestOptions));
3128
3137
  }
3129
3138
  async __createRole(request, requestOptions) {
3130
- const { contextId, body: _body } = request;
3139
+ const { contextId, upsert, body: _body } = request;
3140
+ const _queryParams = {
3141
+ upsert
3142
+ };
3131
3143
  const _authRequest = await this._options.authProvider.getAuthRequest();
3132
3144
  const _headers = mergeHeaders(
3133
3145
  _authRequest.headers,
@@ -3142,7 +3154,7 @@ var AuthClient = class {
3142
3154
  method: "POST",
3143
3155
  headers: _headers,
3144
3156
  contentType: "application/json",
3145
- queryString: url_exports.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(),
3157
+ queryString: url_exports.queryBuilder().addMany(_queryParams).mergeAdditional(requestOptions?.queryParams).build(),
3146
3158
  requestType: "json",
3147
3159
  body: _body,
3148
3160
  timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1e3,
@@ -4626,23 +4638,30 @@ var DocumentsClient = class {
4626
4638
  return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/v1/documents");
4627
4639
  }
4628
4640
  /**
4629
- * Creates a document from a raw text string and queues it for asynchronous indexing so it becomes searchable. Requires the `documents:c` scope.
4641
+ * 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.
4630
4642
  *
4631
- * @param {Vectros.DocumentRequest} request
4643
+ * @param {Vectros.IngestDocumentRequest} request
4632
4644
  * @param {DocumentsClient.RequestOptions} requestOptions - Request-specific configuration.
4633
4645
  *
4634
4646
  * @throws {@link Vectros.BadRequestError}
4647
+ * @throws {@link Vectros.ForbiddenError}
4635
4648
  * @throws {@link Vectros.TooManyRequestsError}
4636
4649
  *
4637
4650
  * @example
4638
4651
  * await client.documents.ingestDocument({
4639
- * title: "Patient Intake Form \u2014 Jane Doe"
4652
+ * body: {
4653
+ * title: "Patient Intake Form \u2014 Jane Doe"
4654
+ * }
4640
4655
  * })
4641
4656
  */
4642
4657
  ingestDocument(request, requestOptions) {
4643
4658
  return HttpResponsePromise.fromPromise(this.__ingestDocument(request, requestOptions));
4644
4659
  }
4645
4660
  async __ingestDocument(request, requestOptions) {
4661
+ const { upsert, body: _body } = request;
4662
+ const _queryParams = {
4663
+ upsert
4664
+ };
4646
4665
  const _authRequest = await this._options.authProvider.getAuthRequest();
4647
4666
  const _headers = mergeHeaders(
4648
4667
  _authRequest.headers,
@@ -4657,9 +4676,9 @@ var DocumentsClient = class {
4657
4676
  method: "POST",
4658
4677
  headers: _headers,
4659
4678
  contentType: "application/json",
4660
- queryString: url_exports.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(),
4679
+ queryString: url_exports.queryBuilder().addMany(_queryParams).mergeAdditional(requestOptions?.queryParams).build(),
4661
4680
  requestType: "json",
4662
- body: request,
4681
+ body: _body,
4663
4682
  timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1e3,
4664
4683
  maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries,
4665
4684
  abortSignal: requestOptions?.abortSignal,
@@ -4673,6 +4692,8 @@ var DocumentsClient = class {
4673
4692
  switch (_response.error.statusCode) {
4674
4693
  case 400:
4675
4694
  throw new BadRequestError(_response.error.body, _response.rawResponse);
4695
+ case 403:
4696
+ throw new ForbiddenError(_response.error.body, _response.rawResponse);
4676
4697
  case 429:
4677
4698
  throw new TooManyRequestsError(_response.error.body, _response.rawResponse);
4678
4699
  default:
@@ -4939,7 +4960,7 @@ var DocumentsClient = class {
4939
4960
  return handleNonStatusCodeError(_response.error, _response.rawResponse, "PATCH", "/v1/documents/{id}");
4940
4961
  }
4941
4962
  /**
4942
- * 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.
4963
+ * 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.
4943
4964
  *
4944
4965
  * @param {Vectros.LookupDocumentsRequest} request
4945
4966
  * @param {DocumentsClient.RequestOptions} requestOptions - Request-specific configuration.
@@ -5234,12 +5255,13 @@ var DocumentsClient = class {
5234
5255
  return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/v1/documents/{id}/versions");
5235
5256
  }
5236
5257
  /**
5237
- * 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.
5258
+ * 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.
5238
5259
  *
5239
5260
  * @param {Vectros.FileUploadRequest} request
5240
5261
  * @param {DocumentsClient.RequestOptions} requestOptions - Request-specific configuration.
5241
5262
  *
5242
5263
  * @throws {@link Vectros.BadRequestError}
5264
+ * @throws {@link Vectros.ForbiddenError}
5243
5265
  * @throws {@link Vectros.TooManyRequestsError}
5244
5266
  *
5245
5267
  * @example
@@ -5252,6 +5274,10 @@ var DocumentsClient = class {
5252
5274
  return HttpResponsePromise.fromPromise(this.__uploadDocument(request, requestOptions));
5253
5275
  }
5254
5276
  async __uploadDocument(request, requestOptions) {
5277
+ const { upsert, ..._body } = request;
5278
+ const _queryParams = {
5279
+ upsert
5280
+ };
5255
5281
  const _authRequest = await this._options.authProvider.getAuthRequest();
5256
5282
  const _headers = mergeHeaders(
5257
5283
  _authRequest.headers,
@@ -5266,9 +5292,9 @@ var DocumentsClient = class {
5266
5292
  method: "POST",
5267
5293
  headers: _headers,
5268
5294
  contentType: "application/json",
5269
- queryString: url_exports.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(),
5295
+ queryString: url_exports.queryBuilder().addMany(_queryParams).mergeAdditional(requestOptions?.queryParams).build(),
5270
5296
  requestType: "json",
5271
- body: request,
5297
+ body: _body,
5272
5298
  timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1e3,
5273
5299
  maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries,
5274
5300
  abortSignal: requestOptions?.abortSignal,
@@ -5282,6 +5308,8 @@ var DocumentsClient = class {
5282
5308
  switch (_response.error.statusCode) {
5283
5309
  case 400:
5284
5310
  throw new BadRequestError(_response.error.body, _response.rawResponse);
5311
+ case 403:
5312
+ throw new ForbiddenError(_response.error.body, _response.rawResponse);
5285
5313
  case 429:
5286
5314
  throw new TooManyRequestsError(_response.error.body, _response.rawResponse);
5287
5315
  default:
@@ -5360,23 +5388,30 @@ var FoldersClient = class {
5360
5388
  return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/v1/folders");
5361
5389
  }
5362
5390
  /**
5363
- * 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.
5391
+ * 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.
5364
5392
  *
5365
- * @param {Vectros.FolderRequest} request
5393
+ * @param {Vectros.CreateFolderRequest} request
5366
5394
  * @param {FoldersClient.RequestOptions} requestOptions - Request-specific configuration.
5367
5395
  *
5368
5396
  * @throws {@link Vectros.BadRequestError}
5397
+ * @throws {@link Vectros.ForbiddenError}
5369
5398
  * @throws {@link Vectros.TooManyRequestsError}
5370
5399
  *
5371
5400
  * @example
5372
5401
  * await client.folders.createFolder({
5373
- * name: "Patient Records 2024"
5402
+ * body: {
5403
+ * name: "Patient Records 2024"
5404
+ * }
5374
5405
  * })
5375
5406
  */
5376
5407
  createFolder(request, requestOptions) {
5377
5408
  return HttpResponsePromise.fromPromise(this.__createFolder(request, requestOptions));
5378
5409
  }
5379
5410
  async __createFolder(request, requestOptions) {
5411
+ const { upsert, body: _body } = request;
5412
+ const _queryParams = {
5413
+ upsert
5414
+ };
5380
5415
  const _authRequest = await this._options.authProvider.getAuthRequest();
5381
5416
  const _headers = mergeHeaders(
5382
5417
  _authRequest.headers,
@@ -5391,9 +5426,9 @@ var FoldersClient = class {
5391
5426
  method: "POST",
5392
5427
  headers: _headers,
5393
5428
  contentType: "application/json",
5394
- queryString: url_exports.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(),
5429
+ queryString: url_exports.queryBuilder().addMany(_queryParams).mergeAdditional(requestOptions?.queryParams).build(),
5395
5430
  requestType: "json",
5396
- body: request,
5431
+ body: _body,
5397
5432
  timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1e3,
5398
5433
  maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries,
5399
5434
  abortSignal: requestOptions?.abortSignal,
@@ -5407,6 +5442,8 @@ var FoldersClient = class {
5407
5442
  switch (_response.error.statusCode) {
5408
5443
  case 400:
5409
5444
  throw new BadRequestError(_response.error.body, _response.rawResponse);
5445
+ case 403:
5446
+ throw new ForbiddenError(_response.error.body, _response.rawResponse);
5410
5447
  case 429:
5411
5448
  throw new TooManyRequestsError(_response.error.body, _response.rawResponse);
5412
5449
  default:
@@ -5815,23 +5852,30 @@ var IdentityClient = class {
5815
5852
  return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/v1/clients");
5816
5853
  }
5817
5854
  /**
5818
- * 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.
5855
+ * 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.
5819
5856
  *
5820
- * @param {Vectros.ClientRequest} request
5857
+ * @param {Vectros.CreateClientRequest} request
5821
5858
  * @param {IdentityClient.RequestOptions} requestOptions - Request-specific configuration.
5822
5859
  *
5823
5860
  * @throws {@link Vectros.BadRequestError}
5861
+ * @throws {@link Vectros.ForbiddenError}
5824
5862
  * @throws {@link Vectros.TooManyRequestsError}
5825
5863
  *
5826
5864
  * @example
5827
5865
  * await client.identity.createClient({
5828
- * externalId: "patient_789"
5866
+ * body: {
5867
+ * externalId: "patient_789"
5868
+ * }
5829
5869
  * })
5830
5870
  */
5831
5871
  createClient(request, requestOptions) {
5832
5872
  return HttpResponsePromise.fromPromise(this.__createClient(request, requestOptions));
5833
5873
  }
5834
5874
  async __createClient(request, requestOptions) {
5875
+ const { upsert, body: _body } = request;
5876
+ const _queryParams = {
5877
+ upsert
5878
+ };
5835
5879
  const _authRequest = await this._options.authProvider.getAuthRequest();
5836
5880
  const _headers = mergeHeaders(
5837
5881
  _authRequest.headers,
@@ -5846,9 +5890,9 @@ var IdentityClient = class {
5846
5890
  method: "POST",
5847
5891
  headers: _headers,
5848
5892
  contentType: "application/json",
5849
- queryString: url_exports.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(),
5893
+ queryString: url_exports.queryBuilder().addMany(_queryParams).mergeAdditional(requestOptions?.queryParams).build(),
5850
5894
  requestType: "json",
5851
- body: request,
5895
+ body: _body,
5852
5896
  timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1e3,
5853
5897
  maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries,
5854
5898
  abortSignal: requestOptions?.abortSignal,
@@ -5862,6 +5906,8 @@ var IdentityClient = class {
5862
5906
  switch (_response.error.statusCode) {
5863
5907
  case 400:
5864
5908
  throw new BadRequestError(_response.error.body, _response.rawResponse);
5909
+ case 403:
5910
+ throw new ForbiddenError(_response.error.body, _response.rawResponse);
5865
5911
  case 429:
5866
5912
  throw new TooManyRequestsError(_response.error.body, _response.rawResponse);
5867
5913
  default:
@@ -6250,23 +6296,30 @@ var IdentityClient = class {
6250
6296
  return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/v1/orgs");
6251
6297
  }
6252
6298
  /**
6253
- * 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.
6299
+ * 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.
6254
6300
  *
6255
- * @param {Vectros.OrgRequest} request
6301
+ * @param {Vectros.CreateOrgRequest} request
6256
6302
  * @param {IdentityClient.RequestOptions} requestOptions - Request-specific configuration.
6257
6303
  *
6258
6304
  * @throws {@link Vectros.BadRequestError}
6305
+ * @throws {@link Vectros.ForbiddenError}
6259
6306
  * @throws {@link Vectros.TooManyRequestsError}
6260
6307
  *
6261
6308
  * @example
6262
6309
  * await client.identity.createOrg({
6263
- * externalId: "clinic_001"
6310
+ * body: {
6311
+ * externalId: "clinic_001"
6312
+ * }
6264
6313
  * })
6265
6314
  */
6266
6315
  createOrg(request, requestOptions) {
6267
6316
  return HttpResponsePromise.fromPromise(this.__createOrg(request, requestOptions));
6268
6317
  }
6269
6318
  async __createOrg(request, requestOptions) {
6319
+ const { upsert, body: _body } = request;
6320
+ const _queryParams = {
6321
+ upsert
6322
+ };
6270
6323
  const _authRequest = await this._options.authProvider.getAuthRequest();
6271
6324
  const _headers = mergeHeaders(
6272
6325
  _authRequest.headers,
@@ -6281,9 +6334,9 @@ var IdentityClient = class {
6281
6334
  method: "POST",
6282
6335
  headers: _headers,
6283
6336
  contentType: "application/json",
6284
- queryString: url_exports.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(),
6337
+ queryString: url_exports.queryBuilder().addMany(_queryParams).mergeAdditional(requestOptions?.queryParams).build(),
6285
6338
  requestType: "json",
6286
- body: request,
6339
+ body: _body,
6287
6340
  timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1e3,
6288
6341
  maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries,
6289
6342
  abortSignal: requestOptions?.abortSignal,
@@ -6297,6 +6350,8 @@ var IdentityClient = class {
6297
6350
  switch (_response.error.statusCode) {
6298
6351
  case 400:
6299
6352
  throw new BadRequestError(_response.error.body, _response.rawResponse);
6353
+ case 403:
6354
+ throw new ForbiddenError(_response.error.body, _response.rawResponse);
6300
6355
  case 429:
6301
6356
  throw new TooManyRequestsError(_response.error.body, _response.rawResponse);
6302
6357
  default:
@@ -6671,23 +6726,30 @@ var IdentityClient = class {
6671
6726
  return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/v1/users");
6672
6727
  }
6673
6728
  /**
6674
- * 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.
6729
+ * 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.
6675
6730
  *
6676
- * @param {Vectros.UserRequest} request
6731
+ * @param {Vectros.CreateUserRequest} request
6677
6732
  * @param {IdentityClient.RequestOptions} requestOptions - Request-specific configuration.
6678
6733
  *
6679
6734
  * @throws {@link Vectros.BadRequestError}
6735
+ * @throws {@link Vectros.ForbiddenError}
6680
6736
  * @throws {@link Vectros.TooManyRequestsError}
6681
6737
  *
6682
6738
  * @example
6683
6739
  * await client.identity.createUser({
6684
- * externalId: "usr_12345"
6740
+ * body: {
6741
+ * externalId: "usr_12345"
6742
+ * }
6685
6743
  * })
6686
6744
  */
6687
6745
  createUser(request, requestOptions) {
6688
6746
  return HttpResponsePromise.fromPromise(this.__createUser(request, requestOptions));
6689
6747
  }
6690
6748
  async __createUser(request, requestOptions) {
6749
+ const { upsert, body: _body } = request;
6750
+ const _queryParams = {
6751
+ upsert
6752
+ };
6691
6753
  const _authRequest = await this._options.authProvider.getAuthRequest();
6692
6754
  const _headers = mergeHeaders(
6693
6755
  _authRequest.headers,
@@ -6702,9 +6764,9 @@ var IdentityClient = class {
6702
6764
  method: "POST",
6703
6765
  headers: _headers,
6704
6766
  contentType: "application/json",
6705
- queryString: url_exports.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(),
6767
+ queryString: url_exports.queryBuilder().addMany(_queryParams).mergeAdditional(requestOptions?.queryParams).build(),
6706
6768
  requestType: "json",
6707
- body: request,
6769
+ body: _body,
6708
6770
  timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1e3,
6709
6771
  maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries,
6710
6772
  abortSignal: requestOptions?.abortSignal,
@@ -6718,6 +6780,8 @@ var IdentityClient = class {
6718
6780
  switch (_response.error.statusCode) {
6719
6781
  case 400:
6720
6782
  throw new BadRequestError(_response.error.body, _response.rawResponse);
6783
+ case 403:
6784
+ throw new ForbiddenError(_response.error.body, _response.rawResponse);
6721
6785
  case 429:
6722
6786
  throw new TooManyRequestsError(_response.error.body, _response.rawResponse);
6723
6787
  default:
@@ -7535,9 +7599,9 @@ var RecordsClient = class {
7535
7599
  return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/v1/records");
7536
7600
  }
7537
7601
  /**
7538
- * 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.
7602
+ * 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.
7539
7603
  *
7540
- * @param {Vectros.RecordRequest} request
7604
+ * @param {Vectros.CreateRecordRequest} request
7541
7605
  * @param {RecordsClient.RequestOptions} requestOptions - Request-specific configuration.
7542
7606
  *
7543
7607
  * @throws {@link Vectros.BadRequestError}
@@ -7546,19 +7610,25 @@ var RecordsClient = class {
7546
7610
  *
7547
7611
  * @example
7548
7612
  * await client.records.createRecord({
7549
- * typeName: "intake_form",
7550
- * schemaId: "6ba7b810-9dad-11d1-80b4-00c04fd430c8",
7551
- * payload: {
7552
- * "first_name": "Jane",
7553
- * "email": "jane@example.com"
7554
- * },
7555
- * folderId: "f47ac10b-58cc-4372-a567-0e02b2c3d479"
7613
+ * body: {
7614
+ * typeName: "intake_form",
7615
+ * schemaId: "6ba7b810-9dad-11d1-80b4-00c04fd430c8",
7616
+ * payload: {
7617
+ * "first_name": "Jane",
7618
+ * "email": "jane@example.com"
7619
+ * },
7620
+ * folderId: "f47ac10b-58cc-4372-a567-0e02b2c3d479"
7621
+ * }
7556
7622
  * })
7557
7623
  */
7558
7624
  createRecord(request, requestOptions) {
7559
7625
  return HttpResponsePromise.fromPromise(this.__createRecord(request, requestOptions));
7560
7626
  }
7561
7627
  async __createRecord(request, requestOptions) {
7628
+ const { upsert, body: _body } = request;
7629
+ const _queryParams = {
7630
+ upsert
7631
+ };
7562
7632
  const _authRequest = await this._options.authProvider.getAuthRequest();
7563
7633
  const _headers = mergeHeaders(
7564
7634
  _authRequest.headers,
@@ -7573,9 +7643,9 @@ var RecordsClient = class {
7573
7643
  method: "POST",
7574
7644
  headers: _headers,
7575
7645
  contentType: "application/json",
7576
- queryString: url_exports.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(),
7646
+ queryString: url_exports.queryBuilder().addMany(_queryParams).mergeAdditional(requestOptions?.queryParams).build(),
7577
7647
  requestType: "json",
7578
- body: request,
7648
+ body: _body,
7579
7649
  timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1e3,
7580
7650
  maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries,
7581
7651
  abortSignal: requestOptions?.abortSignal,
@@ -8171,43 +8241,50 @@ var SchemasClient = class {
8171
8241
  return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/v1/schemas");
8172
8242
  }
8173
8243
  /**
8174
- * 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.
8244
+ * 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.
8175
8245
  *
8176
- * @param {Vectros.SchemaRequest} request
8246
+ * @param {Vectros.CreateSchemaRequest} request
8177
8247
  * @param {SchemasClient.RequestOptions} requestOptions - Request-specific configuration.
8178
8248
  *
8179
8249
  * @throws {@link Vectros.BadRequestError}
8250
+ * @throws {@link Vectros.ForbiddenError}
8180
8251
  * @throws {@link Vectros.TooManyRequestsError}
8181
8252
  *
8182
8253
  * @example
8183
8254
  * await client.schemas.createSchema({
8184
- * typeName: "intake_form",
8185
- * displayName: "Client Intake Form",
8186
- * description: "Captures initial client information",
8187
- * fields: [{
8188
- * fieldId: "first_name",
8189
- * fieldType: "string",
8190
- * required: true,
8191
- * searchable: true
8192
- * }, {
8193
- * fieldId: "email",
8194
- * fieldType: "string",
8195
- * required: true
8196
- * }],
8197
- * lookupFields: [{
8198
- * fieldName: "email",
8199
- * unique: true
8200
- * }],
8201
- * capabilities: {
8202
- * "auditHistory": true
8203
- * },
8204
- * allowedSurfaces: ["record"]
8255
+ * body: {
8256
+ * typeName: "intake_form",
8257
+ * displayName: "Client Intake Form",
8258
+ * description: "Captures initial client information",
8259
+ * fields: [{
8260
+ * fieldId: "first_name",
8261
+ * fieldType: "string",
8262
+ * required: true,
8263
+ * searchable: true
8264
+ * }, {
8265
+ * fieldId: "email",
8266
+ * fieldType: "string",
8267
+ * required: true
8268
+ * }],
8269
+ * lookupFields: [{
8270
+ * fieldName: "email",
8271
+ * unique: true
8272
+ * }],
8273
+ * capabilities: {
8274
+ * "auditHistory": true
8275
+ * },
8276
+ * allowedSurfaces: ["record"]
8277
+ * }
8205
8278
  * })
8206
8279
  */
8207
8280
  createSchema(request, requestOptions) {
8208
8281
  return HttpResponsePromise.fromPromise(this.__createSchema(request, requestOptions));
8209
8282
  }
8210
8283
  async __createSchema(request, requestOptions) {
8284
+ const { upsert, body: _body } = request;
8285
+ const _queryParams = {
8286
+ upsert
8287
+ };
8211
8288
  const _authRequest = await this._options.authProvider.getAuthRequest();
8212
8289
  const _headers = mergeHeaders(
8213
8290
  _authRequest.headers,
@@ -8222,9 +8299,9 @@ var SchemasClient = class {
8222
8299
  method: "POST",
8223
8300
  headers: _headers,
8224
8301
  contentType: "application/json",
8225
- queryString: url_exports.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(),
8302
+ queryString: url_exports.queryBuilder().addMany(_queryParams).mergeAdditional(requestOptions?.queryParams).build(),
8226
8303
  requestType: "json",
8227
- body: request,
8304
+ body: _body,
8228
8305
  timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1e3,
8229
8306
  maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries,
8230
8307
  abortSignal: requestOptions?.abortSignal,
@@ -8238,6 +8315,8 @@ var SchemasClient = class {
8238
8315
  switch (_response.error.statusCode) {
8239
8316
  case 400:
8240
8317
  throw new BadRequestError(_response.error.body, _response.rawResponse);
8318
+ case 403:
8319
+ throw new ForbiddenError(_response.error.body, _response.rawResponse);
8241
8320
  case 429:
8242
8321
  throw new TooManyRequestsError(_response.error.body, _response.rawResponse);
8243
8322
  default:
@@ -8677,8 +8756,8 @@ function warnOnSuboptimalKey(key, log) {
8677
8756
 
8678
8757
  // src/build-info.ts
8679
8758
  var BUILD_INFO = {
8680
- mcpServer: true ? "0.5.2" : "dev",
8681
- sdk: true ? "0.30.0" : "dev"
8759
+ mcpServer: true ? "0.5.3" : "dev",
8760
+ sdk: true ? "0.31.0" : "dev"
8682
8761
  };
8683
8762
 
8684
8763
  // src/log.ts
@@ -9178,15 +9257,17 @@ var recordCreate = ({ client, log }) => ({
9178
9257
  const type = args.type;
9179
9258
  try {
9180
9259
  const created = await client.records.createRecord({
9181
- typeName: type,
9182
- payload: args.fields,
9183
- externalId: args.externalId,
9184
- indexMode: args.indexMode,
9185
- status: args.status,
9186
- folderId: args.folderId,
9187
- userId: args.userId,
9188
- orgId: args.orgId,
9189
- clientId: args.clientId
9260
+ body: {
9261
+ typeName: type,
9262
+ payload: args.fields,
9263
+ externalId: args.externalId,
9264
+ indexMode: args.indexMode,
9265
+ status: args.status,
9266
+ folderId: args.folderId,
9267
+ userId: args.userId,
9268
+ orgId: args.orgId,
9269
+ clientId: args.clientId
9270
+ }
9190
9271
  });
9191
9272
  log.debug({ tool: "record_create", type, id: created.id }, "record_create ok");
9192
9273
  return { content: [{ type: "text", text: JSON.stringify(created, null, 2) }] };
@@ -9828,13 +9909,15 @@ var folderCreate = ({ client, log }) => ({
9828
9909
  handler: async (args) => {
9829
9910
  try {
9830
9911
  const folder = await client.folders.createFolder({
9831
- name: args.name,
9832
- description: args.description,
9833
- parentFolderId: args.parentId,
9834
- slug: args.slug,
9835
- userId: args.userId,
9836
- orgId: args.orgId,
9837
- clientId: args.clientId
9912
+ body: {
9913
+ name: args.name,
9914
+ description: args.description,
9915
+ parentFolderId: args.parentId,
9916
+ slug: args.slug,
9917
+ userId: args.userId,
9918
+ orgId: args.orgId,
9919
+ clientId: args.clientId
9920
+ }
9838
9921
  });
9839
9922
  log.debug({ tool: "folder_create", id: folder.id, name: folder.name }, "folder_create ok");
9840
9923
  return { content: [{ type: "text", text: JSON.stringify(folder, null, 2) }] };
@@ -10088,11 +10171,13 @@ var documentIngest = ({ client, log, transport, ingestRoot }) => ({
10088
10171
  if (text) {
10089
10172
  const storeText = args.storeText ?? true;
10090
10173
  const result = await client.documents.ingestDocument({
10091
- title,
10092
- text,
10093
- indexMode,
10094
- storeText,
10095
- ...common
10174
+ body: {
10175
+ title,
10176
+ text,
10177
+ indexMode,
10178
+ storeText,
10179
+ ...common
10180
+ }
10096
10181
  });
10097
10182
  log.debug(
10098
10183
  { tool: "document_ingest", mode: "text", id: result?.id, indexMode },