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