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