@vibexp/api-client 0.42.0 → 0.44.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -602,21 +602,6 @@ export const createMemory = (options) => (options.client ?? client).post({
602
602
  ...options.headers
603
603
  }
604
604
  });
605
- /**
606
- * Search memories by metadata
607
- *
608
- * Searches memories by specific metadata key-value pairs within the specified team
609
- */
610
- export const searchMemoriesByMetadata = (options) => (options.client ?? client).get({
611
- responseType: 'json',
612
- security: [{
613
- key: 'BearerAuth',
614
- scheme: 'bearer',
615
- type: 'http'
616
- }],
617
- url: '/api/v1/{team_id}/memories/search',
618
- ...options
619
- });
620
605
  /**
621
606
  * Delete memory by ID
622
607
  *
@@ -743,7 +728,7 @@ export const getProjectResourceCreationMetrics = (options) => (options.client ??
743
728
  /**
744
729
  * List spec libraries
745
730
  *
746
- * Retrieves all spec libraries for the authenticated user with optional filtering and pagination. Metadata filtering is dynamic: any query parameter named `metadata_<key>` filters on that metadata field, e.g. `metadata_env=prod` matches spec libraries whose metadata `env` equals `prod`. Multiple `metadata_*` parameters are combined (AND).
731
+ * Retrieves all spec libraries for the authenticated user with optional filtering and pagination. Use the `metadata` parameter to filter on metadata; the undocumented `metadata_<key>` prefix convention is deprecated and will be removed.
747
732
  */
748
733
  export const listSpecLibraries = (options) => (options.client ?? client).get({
749
734
  responseType: 'json',
@@ -792,7 +777,7 @@ export const getBlueprintStats = (options) => (options.client ?? client).get({
792
777
  /**
793
778
  * List spec libraries by project
794
779
  *
795
- * Retrieves spec libraries for a specific project with optional filtering. Metadata filtering is dynamic: any query parameter named `metadata_<key>` filters on that metadata field, e.g. `metadata_env=prod` matches spec libraries whose metadata `env` equals `prod`. Multiple `metadata_*` parameters are combined (AND).
780
+ * Retrieves spec libraries for a specific project with optional filtering. Use the `metadata` parameter to filter on metadata; the undocumented `metadata_<key>` prefix convention is deprecated and will be removed.
796
781
  */
797
782
  export const listSpecLibrariesByProject = (options) => (options.client ?? client).get({
798
783
  responseType: 'json',
@@ -1415,11 +1400,16 @@ export const disconnectGitHub = (options) => (options.client ?? client).delete({
1415
1400
  ...options
1416
1401
  });
1417
1402
  /**
1418
- * Handle GitHub webhook events
1403
+ * Retired use the per-App webhook URL
1419
1404
  *
1420
- * Receives and processes GitHub webhook events (e.g., push, installation changes).
1421
- * This endpoint validates the webhook signature using the configured GitHub webhook secret.
1422
- * This is a public endpoint no authentication header is required; GitHub signs the payload.
1405
+ * **Retired (410 Gone).** This endpoint verified deliveries against a single
1406
+ * instance-wide webhook secret. Each team now registers its own GitHub App
1407
+ * with its own secret, so there is no single secret left to verify against
1408
+ * and this path cannot be made to work.
1409
+ *
1410
+ * Each team's webhook URL is shown in its GitHub App settings; update it on
1411
+ * GitHub. This path is kept for a release or two so misdirected deliveries
1412
+ * get an explanation rather than a signature error.
1423
1413
  *
1424
1414
  */
1425
1415
  export const handleGitHubWebhook = (options) => (options.client ?? client).post({
@@ -1430,6 +1420,31 @@ export const handleGitHubWebhook = (options) => (options.client ?? client).post(
1430
1420
  ...options.headers
1431
1421
  }
1432
1422
  });
1423
+ /**
1424
+ * Handle a GitHub webhook delivery for one team's App
1425
+ *
1426
+ * Receives a GitHub webhook delivery for the App identified by the routing
1427
+ * token in the path. Each team registers its own GitHub App with its own
1428
+ * webhook secret, so the token is what selects which secret the
1429
+ * `X-Hub-Signature-256` HMAC is verified against.
1430
+ *
1431
+ * Public and unauthenticated by necessity — GitHub posts with no session.
1432
+ * The token routes the delivery; the webhook secret authenticates it. The
1433
+ * payload is not parsed until the signature verifies, so no attacker-supplied
1434
+ * byte influences which key it is checked with.
1435
+ *
1436
+ * An unknown or malformed token returns 404 with no detail, so the endpoint
1437
+ * cannot be used to discover which tokens exist.
1438
+ *
1439
+ */
1440
+ export const handleGitHubWebhookByToken = (options) => (options.client ?? client).post({
1441
+ url: '/api/v1/webhooks/github/{token}',
1442
+ ...options,
1443
+ headers: {
1444
+ 'Content-Type': 'application/json',
1445
+ ...options.headers
1446
+ }
1447
+ });
1433
1448
  /**
1434
1449
  * List feeds
1435
1450
  *
@@ -3708,6 +3723,44 @@ export const validateEmbeddingProvider = (options) => (options.client ?? client)
3708
3723
  ...options.headers
3709
3724
  }
3710
3725
  });
3726
+ /**
3727
+ * List the metadata keys in use
3728
+ *
3729
+ * Returns the distinct metadata keys present on the caller's rows of the requested resource type, optionally narrowed to a single project. Use it to populate the key side of a metadata filter.
3730
+ */
3731
+ export const getMetadataKeys = (options) => (options.client ?? client).get({
3732
+ responseType: 'json',
3733
+ security: [{
3734
+ key: 'ApiKeyAuth',
3735
+ scheme: 'bearer',
3736
+ type: 'http'
3737
+ }, {
3738
+ in: 'cookie',
3739
+ name: 'vx_session',
3740
+ type: 'apiKey'
3741
+ }],
3742
+ url: '/api/v1/{team_id}/metadata/keys',
3743
+ ...options
3744
+ });
3745
+ /**
3746
+ * List the values stored under a metadata key
3747
+ *
3748
+ * Returns the distinct values stored under one metadata key on the caller's rows of the requested resource type. Values held in an array are flattened and non-string scalars are rendered in their text form, so the result is directly usable as filter input. Supply `q` for typeahead.
3749
+ */
3750
+ export const getMetadataValues = (options) => (options.client ?? client).get({
3751
+ responseType: 'json',
3752
+ security: [{
3753
+ key: 'ApiKeyAuth',
3754
+ scheme: 'bearer',
3755
+ type: 'http'
3756
+ }, {
3757
+ in: 'cookie',
3758
+ name: 'vx_session',
3759
+ type: 'apiKey'
3760
+ }],
3761
+ url: '/api/v1/{team_id}/metadata/values',
3762
+ ...options
3763
+ });
3711
3764
  /**
3712
3765
  * Reset the team's search ranking settings to the instance defaults
3713
3766
  *
@@ -3993,6 +4046,566 @@ export const clearEmbeddingsSettings = (options) => (options.client ?? client).d
3993
4046
  url: '/api/v1/{team_id}/settings/embedding-providers/embeddings',
3994
4047
  ...options
3995
4048
  });
4049
+ /**
4050
+ * Delete the team's GitHub App configuration
4051
+ *
4052
+ * Removes the team's GitHub App registration. This also disconnects every
4053
+ * installation made through that App, since installations are meaningful
4054
+ * only in the context of the App they were installed from.
4055
+ *
4056
+ */
4057
+ export const deleteGitHubAppConfig = (options) => (options.client ?? client).delete({
4058
+ security: [{
4059
+ key: 'ApiKeyAuth',
4060
+ scheme: 'bearer',
4061
+ type: 'http'
4062
+ }, {
4063
+ in: 'cookie',
4064
+ name: 'vx_session',
4065
+ type: 'apiKey'
4066
+ }],
4067
+ url: '/api/v1/{team_id}/integrations/github/app',
4068
+ ...options
4069
+ });
4070
+ /**
4071
+ * Get the team's GitHub App configuration
4072
+ *
4073
+ * Returns the team's GitHub App registration. Secrets are never included —
4074
+ * the response carries `has_private_key`, `has_client_secret` and
4075
+ * `has_webhook_secret` booleans plus the `webhook_url` to paste into GitHub.
4076
+ *
4077
+ */
4078
+ export const getGitHubAppConfig = (options) => (options.client ?? client).get({
4079
+ responseType: 'json',
4080
+ security: [{
4081
+ key: 'ApiKeyAuth',
4082
+ scheme: 'bearer',
4083
+ type: 'http'
4084
+ }, {
4085
+ in: 'cookie',
4086
+ name: 'vx_session',
4087
+ type: 'apiKey'
4088
+ }],
4089
+ url: '/api/v1/{team_id}/integrations/github/app',
4090
+ ...options
4091
+ });
4092
+ /**
4093
+ * Register the team's GitHub App
4094
+ *
4095
+ * Registers a GitHub App for the team. The `private_key` and `client_secret`
4096
+ * are encrypted at rest and are never returned.
4097
+ *
4098
+ * The webhook secret is **generated by the server**, not supplied by the
4099
+ * caller, and is returned in this response **once only**. It cannot be read
4100
+ * back afterwards; a lost secret must be rotated. Returns 200 (not 201),
4101
+ * matching the provider convention.
4102
+ *
4103
+ */
4104
+ export const createGitHubAppConfig = (options) => (options.client ?? client).post({
4105
+ responseType: 'json',
4106
+ security: [{
4107
+ key: 'ApiKeyAuth',
4108
+ scheme: 'bearer',
4109
+ type: 'http'
4110
+ }, {
4111
+ in: 'cookie',
4112
+ name: 'vx_session',
4113
+ type: 'apiKey'
4114
+ }],
4115
+ url: '/api/v1/{team_id}/integrations/github/app',
4116
+ ...options,
4117
+ headers: {
4118
+ 'Content-Type': 'application/json',
4119
+ ...options.headers
4120
+ }
4121
+ });
4122
+ /**
4123
+ * Update the team's GitHub App configuration
4124
+ *
4125
+ * Updates the team's GitHub App registration. Every field is optional: an
4126
+ * omitted field keeps the stored value, and an explicitly empty value is
4127
+ * rejected rather than clearing the stored one. Secrets are never returned.
4128
+ *
4129
+ * The webhook secret cannot be set here — it is server-generated and
4130
+ * replaced through rotation.
4131
+ *
4132
+ */
4133
+ export const updateGitHubAppConfig = (options) => (options.client ?? client).put({
4134
+ responseType: 'json',
4135
+ security: [{
4136
+ key: 'ApiKeyAuth',
4137
+ scheme: 'bearer',
4138
+ type: 'http'
4139
+ }, {
4140
+ in: 'cookie',
4141
+ name: 'vx_session',
4142
+ type: 'apiKey'
4143
+ }],
4144
+ url: '/api/v1/{team_id}/integrations/github/app',
4145
+ ...options,
4146
+ headers: {
4147
+ 'Content-Type': 'application/json',
4148
+ ...options.headers
4149
+ }
4150
+ });
4151
+ /**
4152
+ * Validate the team's GitHub App configuration
4153
+ *
4154
+ * Probes GitHub with the stored credentials and reports whether they work.
4155
+ * This proves the private key belongs to the configured `app_id`, that the
4156
+ * stored slug matches what GitHub reports (a typo there would otherwise
4157
+ * produce a broken install URL), and which permissions the App holds.
4158
+ *
4159
+ * A failed probe is reported in the body with `is_valid: false`, not as an
4160
+ * HTTP error. `error_details` is always one of a fixed set of categories;
4161
+ * the real upstream error is logged server-side only.
4162
+ *
4163
+ * Authorized as a mutation, because it makes the server perform an
4164
+ * authenticated outbound call on the team's behalf.
4165
+ *
4166
+ */
4167
+ export const validateGitHubAppConfig = (options) => (options.client ?? client).post({
4168
+ responseType: 'json',
4169
+ security: [{
4170
+ key: 'ApiKeyAuth',
4171
+ scheme: 'bearer',
4172
+ type: 'http'
4173
+ }, {
4174
+ in: 'cookie',
4175
+ name: 'vx_session',
4176
+ type: 'apiKey'
4177
+ }],
4178
+ url: '/api/v1/{team_id}/integrations/github/app/validate',
4179
+ ...options
4180
+ });
4181
+ /**
4182
+ * Rotate the GitHub App webhook token
4183
+ *
4184
+ * Mints a new opaque routing token, which changes the App's `webhook_url`.
4185
+ * The previous URL stops resolving immediately, so the new one must be
4186
+ * pasted into the App's settings on GitHub or deliveries will stop.
4187
+ *
4188
+ * This rotates the routing token only, not the webhook secret.
4189
+ *
4190
+ */
4191
+ export const rotateGitHubAppWebhookToken = (options) => (options.client ?? client).post({
4192
+ responseType: 'json',
4193
+ security: [{
4194
+ key: 'ApiKeyAuth',
4195
+ scheme: 'bearer',
4196
+ type: 'http'
4197
+ }, {
4198
+ in: 'cookie',
4199
+ name: 'vx_session',
4200
+ type: 'apiKey'
4201
+ }],
4202
+ url: '/api/v1/{team_id}/integrations/github/app/rotate-webhook-token',
4203
+ ...options
4204
+ });
4205
+ /**
4206
+ * Delete the team's GitHub App configuration
4207
+ *
4208
+ * Removes the team's GitHub App registration. This also disconnects every
4209
+ * installation made through that App, since installations are meaningful
4210
+ * only in the context of the App they were installed from.
4211
+ *
4212
+ */
4213
+ export const deleteGitHubAppConfigSettings = (options) => (options.client ?? client).delete({
4214
+ security: [{
4215
+ key: 'ApiKeyAuth',
4216
+ scheme: 'bearer',
4217
+ type: 'http'
4218
+ }, {
4219
+ in: 'cookie',
4220
+ name: 'vx_session',
4221
+ type: 'apiKey'
4222
+ }],
4223
+ url: '/api/v1/{team_id}/settings/github-app',
4224
+ ...options
4225
+ });
4226
+ /**
4227
+ * Get the team's GitHub App configuration
4228
+ *
4229
+ * Returns the team's GitHub App registration. Secrets are never included —
4230
+ * the response carries `has_private_key`, `has_client_secret` and
4231
+ * `has_webhook_secret` booleans plus the `webhook_url` to paste into GitHub.
4232
+ *
4233
+ */
4234
+ export const getGitHubAppConfigSettings = (options) => (options.client ?? client).get({
4235
+ responseType: 'json',
4236
+ security: [{
4237
+ key: 'ApiKeyAuth',
4238
+ scheme: 'bearer',
4239
+ type: 'http'
4240
+ }, {
4241
+ in: 'cookie',
4242
+ name: 'vx_session',
4243
+ type: 'apiKey'
4244
+ }],
4245
+ url: '/api/v1/{team_id}/settings/github-app',
4246
+ ...options
4247
+ });
4248
+ /**
4249
+ * Register the team's GitHub App
4250
+ *
4251
+ * Registers a GitHub App for the team. The `private_key` and `client_secret`
4252
+ * are encrypted at rest and are never returned.
4253
+ *
4254
+ * The webhook secret is **generated by the server**, not supplied by the
4255
+ * caller, and is returned in this response **once only**. It cannot be read
4256
+ * back afterwards; a lost secret must be rotated. Returns 200 (not 201),
4257
+ * matching the provider convention.
4258
+ *
4259
+ */
4260
+ export const createGitHubAppConfigSettings = (options) => (options.client ?? client).post({
4261
+ responseType: 'json',
4262
+ security: [{
4263
+ key: 'ApiKeyAuth',
4264
+ scheme: 'bearer',
4265
+ type: 'http'
4266
+ }, {
4267
+ in: 'cookie',
4268
+ name: 'vx_session',
4269
+ type: 'apiKey'
4270
+ }],
4271
+ url: '/api/v1/{team_id}/settings/github-app',
4272
+ ...options,
4273
+ headers: {
4274
+ 'Content-Type': 'application/json',
4275
+ ...options.headers
4276
+ }
4277
+ });
4278
+ /**
4279
+ * Update the team's GitHub App configuration
4280
+ *
4281
+ * Updates the team's GitHub App registration. Every field is optional: an
4282
+ * omitted field keeps the stored value, and an explicitly empty value is
4283
+ * rejected rather than clearing the stored one. Secrets are never returned.
4284
+ *
4285
+ * The webhook secret cannot be set here — it is server-generated and
4286
+ * replaced through rotation.
4287
+ *
4288
+ */
4289
+ export const updateGitHubAppConfigSettings = (options) => (options.client ?? client).put({
4290
+ responseType: 'json',
4291
+ security: [{
4292
+ key: 'ApiKeyAuth',
4293
+ scheme: 'bearer',
4294
+ type: 'http'
4295
+ }, {
4296
+ in: 'cookie',
4297
+ name: 'vx_session',
4298
+ type: 'apiKey'
4299
+ }],
4300
+ url: '/api/v1/{team_id}/settings/github-app',
4301
+ ...options,
4302
+ headers: {
4303
+ 'Content-Type': 'application/json',
4304
+ ...options.headers
4305
+ }
4306
+ });
4307
+ /**
4308
+ * Validate the team's GitHub App configuration
4309
+ *
4310
+ * Probes GitHub with the stored credentials and reports whether they work.
4311
+ * This proves the private key belongs to the configured `app_id`, that the
4312
+ * stored slug matches what GitHub reports (a typo there would otherwise
4313
+ * produce a broken install URL), and which permissions the App holds.
4314
+ *
4315
+ * A failed probe is reported in the body with `is_valid: false`, not as an
4316
+ * HTTP error. `error_details` is always one of a fixed set of categories;
4317
+ * the real upstream error is logged server-side only.
4318
+ *
4319
+ * Authorized as a mutation, because it makes the server perform an
4320
+ * authenticated outbound call on the team's behalf.
4321
+ *
4322
+ */
4323
+ export const validateGitHubAppConfigSettings = (options) => (options.client ?? client).post({
4324
+ responseType: 'json',
4325
+ security: [{
4326
+ key: 'ApiKeyAuth',
4327
+ scheme: 'bearer',
4328
+ type: 'http'
4329
+ }, {
4330
+ in: 'cookie',
4331
+ name: 'vx_session',
4332
+ type: 'apiKey'
4333
+ }],
4334
+ url: '/api/v1/{team_id}/settings/github-app/validate',
4335
+ ...options
4336
+ });
4337
+ /**
4338
+ * Rotate the GitHub App webhook token
4339
+ *
4340
+ * Mints a new opaque routing token, which changes the App's `webhook_url`.
4341
+ * The previous URL stops resolving immediately, so the new one must be
4342
+ * pasted into the App's settings on GitHub or deliveries will stop.
4343
+ *
4344
+ * This rotates the routing token only, not the webhook secret.
4345
+ *
4346
+ */
4347
+ export const rotateGitHubAppWebhookTokenSettings = (options) => (options.client ?? client).post({
4348
+ responseType: 'json',
4349
+ security: [{
4350
+ key: 'ApiKeyAuth',
4351
+ scheme: 'bearer',
4352
+ type: 'http'
4353
+ }, {
4354
+ in: 'cookie',
4355
+ name: 'vx_session',
4356
+ type: 'apiKey'
4357
+ }],
4358
+ url: '/api/v1/{team_id}/settings/github-app/rotate-webhook-token',
4359
+ ...options
4360
+ });
4361
+ /**
4362
+ * Remove the team's email provider
4363
+ *
4364
+ * Deletes the team's provider, so the team reverts to the instance provider.
4365
+ * A subsequent GET reports `source: "instance"`.
4366
+ *
4367
+ * Deleting when the team has no provider of its own returns 409 rather than
4368
+ * 404: the endpoint exists and the team is addressable, it is simply not in a
4369
+ * state that can serve the request.
4370
+ *
4371
+ */
4372
+ export const deleteTeamEmailProvider = (options) => (options.client ?? client).delete({
4373
+ security: [{
4374
+ key: 'ApiKeyAuth',
4375
+ scheme: 'bearer',
4376
+ type: 'http'
4377
+ }, {
4378
+ in: 'cookie',
4379
+ name: 'vx_session',
4380
+ type: 'apiKey'
4381
+ }],
4382
+ url: '/api/v1/{team_id}/email-provider',
4383
+ ...options
4384
+ });
4385
+ /**
4386
+ * Get the team's effective email configuration
4387
+ *
4388
+ * Returns the email configuration in force for the team.
4389
+ *
4390
+ * This **always returns 200**, never 404. A team without its own provider is
4391
+ * inheriting the instance provider, which is a valid state the caller needs
4392
+ * described — it reports `configured: false`, `source: "instance"` and the
4393
+ * instance's `effective_from_address`.
4394
+ *
4395
+ * Readable by any team member: the response carries no credential, and
4396
+ * `effective_from_address` is already in the From: header of every mail those
4397
+ * members receive.
4398
+ *
4399
+ */
4400
+ export const getTeamEmailProvider = (options) => (options.client ?? client).get({
4401
+ responseType: 'json',
4402
+ security: [{
4403
+ key: 'ApiKeyAuth',
4404
+ scheme: 'bearer',
4405
+ type: 'http'
4406
+ }, {
4407
+ in: 'cookie',
4408
+ name: 'vx_session',
4409
+ type: 'apiKey'
4410
+ }],
4411
+ url: '/api/v1/{team_id}/email-provider',
4412
+ ...options
4413
+ });
4414
+ /**
4415
+ * Configure the team's email provider
4416
+ *
4417
+ * Creates or replaces the team's email provider. Idempotent: the same body
4418
+ * applied twice leaves one row and returns 200 both times.
4419
+ *
4420
+ * `secret` is required the first time. On a team that already has a provider,
4421
+ * omit it to keep the stored credential; sending an empty string is rejected
4422
+ * rather than treated as "clear", because a provider without a credential
4423
+ * cannot send and silently disabling a team's mail is worse than an error.
4424
+ *
4425
+ * A team-supplied `settings.smtp.host` or `settings.mailgun.base_url` that
4426
+ * resolves into a reserved network range is rejected before anything is
4427
+ * stored or dialled.
4428
+ *
4429
+ */
4430
+ export const upsertTeamEmailProvider = (options) => (options.client ?? client).put({
4431
+ responseType: 'json',
4432
+ security: [{
4433
+ key: 'ApiKeyAuth',
4434
+ scheme: 'bearer',
4435
+ type: 'http'
4436
+ }, {
4437
+ in: 'cookie',
4438
+ name: 'vx_session',
4439
+ type: 'apiKey'
4440
+ }],
4441
+ url: '/api/v1/{team_id}/email-provider',
4442
+ ...options,
4443
+ headers: {
4444
+ 'Content-Type': 'application/json',
4445
+ ...options.headers
4446
+ }
4447
+ });
4448
+ /**
4449
+ * Send a test email with a candidate configuration
4450
+ *
4451
+ * Sends a real message using the configuration **in this request body**, not
4452
+ * the stored one, so credentials can be verified before they are saved. The
4453
+ * body therefore always requires `secret`.
4454
+ *
4455
+ * The recipient is **always the acting user's own account email**. It cannot
4456
+ * be supplied by the caller, so this endpoint cannot be used to send mail to
4457
+ * third parties.
4458
+ *
4459
+ * A failed send is reported in the body with `is_valid: false` and a fixed
4460
+ * `details.error_details` category, not as an HTTP error. A 500 means an
4461
+ * internal fault, not a bad configuration.
4462
+ *
4463
+ * Authorized as a mutation, because it makes the server perform an outbound
4464
+ * send with team-supplied credentials.
4465
+ *
4466
+ */
4467
+ export const testTeamEmailProvider = (options) => (options.client ?? client).post({
4468
+ responseType: 'json',
4469
+ security: [{
4470
+ key: 'ApiKeyAuth',
4471
+ scheme: 'bearer',
4472
+ type: 'http'
4473
+ }, {
4474
+ in: 'cookie',
4475
+ name: 'vx_session',
4476
+ type: 'apiKey'
4477
+ }],
4478
+ url: '/api/v1/{team_id}/email-provider/test',
4479
+ ...options,
4480
+ headers: {
4481
+ 'Content-Type': 'application/json',
4482
+ ...options.headers
4483
+ }
4484
+ });
4485
+ /**
4486
+ * Remove the team's email provider
4487
+ *
4488
+ * Deletes the team's provider, so the team reverts to the instance provider.
4489
+ * A subsequent GET reports `source: "instance"`.
4490
+ *
4491
+ * Deleting when the team has no provider of its own returns 409 rather than
4492
+ * 404: the endpoint exists and the team is addressable, it is simply not in a
4493
+ * state that can serve the request.
4494
+ *
4495
+ */
4496
+ export const deleteTeamEmailProviderSettings = (options) => (options.client ?? client).delete({
4497
+ security: [{
4498
+ key: 'ApiKeyAuth',
4499
+ scheme: 'bearer',
4500
+ type: 'http'
4501
+ }, {
4502
+ in: 'cookie',
4503
+ name: 'vx_session',
4504
+ type: 'apiKey'
4505
+ }],
4506
+ url: '/api/v1/{team_id}/settings/email-provider',
4507
+ ...options
4508
+ });
4509
+ /**
4510
+ * Get the team's effective email configuration
4511
+ *
4512
+ * Returns the email configuration in force for the team.
4513
+ *
4514
+ * This **always returns 200**, never 404. A team without its own provider is
4515
+ * inheriting the instance provider, which is a valid state the caller needs
4516
+ * described — it reports `configured: false`, `source: "instance"` and the
4517
+ * instance's `effective_from_address`.
4518
+ *
4519
+ * Readable by any team member: the response carries no credential, and
4520
+ * `effective_from_address` is already in the From: header of every mail those
4521
+ * members receive.
4522
+ *
4523
+ */
4524
+ export const getTeamEmailProviderSettings = (options) => (options.client ?? client).get({
4525
+ responseType: 'json',
4526
+ security: [{
4527
+ key: 'ApiKeyAuth',
4528
+ scheme: 'bearer',
4529
+ type: 'http'
4530
+ }, {
4531
+ in: 'cookie',
4532
+ name: 'vx_session',
4533
+ type: 'apiKey'
4534
+ }],
4535
+ url: '/api/v1/{team_id}/settings/email-provider',
4536
+ ...options
4537
+ });
4538
+ /**
4539
+ * Configure the team's email provider
4540
+ *
4541
+ * Creates or replaces the team's email provider. Idempotent: the same body
4542
+ * applied twice leaves one row and returns 200 both times.
4543
+ *
4544
+ * `secret` is required the first time. On a team that already has a provider,
4545
+ * omit it to keep the stored credential; sending an empty string is rejected
4546
+ * rather than treated as "clear", because a provider without a credential
4547
+ * cannot send and silently disabling a team's mail is worse than an error.
4548
+ *
4549
+ * A team-supplied `settings.smtp.host` or `settings.mailgun.base_url` that
4550
+ * resolves into a reserved network range is rejected before anything is
4551
+ * stored or dialled.
4552
+ *
4553
+ */
4554
+ export const upsertTeamEmailProviderSettings = (options) => (options.client ?? client).put({
4555
+ responseType: 'json',
4556
+ security: [{
4557
+ key: 'ApiKeyAuth',
4558
+ scheme: 'bearer',
4559
+ type: 'http'
4560
+ }, {
4561
+ in: 'cookie',
4562
+ name: 'vx_session',
4563
+ type: 'apiKey'
4564
+ }],
4565
+ url: '/api/v1/{team_id}/settings/email-provider',
4566
+ ...options,
4567
+ headers: {
4568
+ 'Content-Type': 'application/json',
4569
+ ...options.headers
4570
+ }
4571
+ });
4572
+ /**
4573
+ * Send a test email with a candidate configuration
4574
+ *
4575
+ * Sends a real message using the configuration **in this request body**, not
4576
+ * the stored one, so credentials can be verified before they are saved. The
4577
+ * body therefore always requires `secret`.
4578
+ *
4579
+ * The recipient is **always the acting user's own account email**. It cannot
4580
+ * be supplied by the caller, so this endpoint cannot be used to send mail to
4581
+ * third parties.
4582
+ *
4583
+ * A failed send is reported in the body with `is_valid: false` and a fixed
4584
+ * `details.error_details` category, not as an HTTP error. A 500 means an
4585
+ * internal fault, not a bad configuration.
4586
+ *
4587
+ * Authorized as a mutation, because it makes the server perform an outbound
4588
+ * send with team-supplied credentials.
4589
+ *
4590
+ */
4591
+ export const testTeamEmailProviderSettings = (options) => (options.client ?? client).post({
4592
+ responseType: 'json',
4593
+ security: [{
4594
+ key: 'ApiKeyAuth',
4595
+ scheme: 'bearer',
4596
+ type: 'http'
4597
+ }, {
4598
+ in: 'cookie',
4599
+ name: 'vx_session',
4600
+ type: 'apiKey'
4601
+ }],
4602
+ url: '/api/v1/{team_id}/settings/email-provider/test',
4603
+ ...options,
4604
+ headers: {
4605
+ 'Content-Type': 'application/json',
4606
+ ...options.headers
4607
+ }
4608
+ });
3996
4609
  /**
3997
4610
  * List model providers
3998
4611
  *