@vibexp/api-client 0.97.0 → 0.98.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.
@@ -4181,6 +4181,347 @@ export const listAdminAiSummarySettingsAudit = (options) => (options?.client ??
4181
4181
  url: '/api/v1/admin/settings/ai-summary/audit',
4182
4182
  ...options
4183
4183
  });
4184
+ /**
4185
+ * List the sign-in identity providers
4186
+ *
4187
+ * Returns every stored sign-in identity provider in sign-in page order, each
4188
+ * with its health on the replica serving the request, whether a client secret
4189
+ * is stored (`has_client_secret`; the secret itself is never returned) and the
4190
+ * derived `redirect_uri` to register with the identity provider, together with
4191
+ * the authentication settings `version`. Reading the list resolves the enabled
4192
+ * providers first, so `health` reflects their current configuration.
4193
+ * Instance admin or a first-run setup session; every other request receives 404.
4194
+ *
4195
+ */
4196
+ export const listAdminAuthProviders = (options) => (options?.client ?? client).get({
4197
+ responseType: 'json',
4198
+ security: [{
4199
+ key: 'ApiKeyAuth',
4200
+ scheme: 'bearer',
4201
+ type: 'http'
4202
+ }, {
4203
+ in: 'cookie',
4204
+ name: 'vx_session',
4205
+ type: 'apiKey'
4206
+ }],
4207
+ url: '/api/v1/admin/settings/auth/providers',
4208
+ ...options
4209
+ });
4210
+ /**
4211
+ * Create a sign-in identity provider
4212
+ *
4213
+ * Validates and stores a new provider, taking effect on the next sign-in with
4214
+ * no restart, and appends one entry (`action: upsert`) to the `auth_providers`
4215
+ * audit log in the same transaction. The client secret is stored encrypted and
4216
+ * never returned. A body carrying an unknown field is rejected with 400.
4217
+ * Instance admin or a first-run setup session; every other request receives 404.
4218
+ *
4219
+ */
4220
+ export const createAdminAuthProvider = (options) => (options.client ?? client).post({
4221
+ responseType: 'json',
4222
+ security: [{
4223
+ key: 'ApiKeyAuth',
4224
+ scheme: 'bearer',
4225
+ type: 'http'
4226
+ }, {
4227
+ in: 'cookie',
4228
+ name: 'vx_session',
4229
+ type: 'apiKey'
4230
+ }],
4231
+ url: '/api/v1/admin/settings/auth/providers',
4232
+ ...options,
4233
+ headers: {
4234
+ 'Content-Type': 'application/json',
4235
+ ...options.headers
4236
+ }
4237
+ });
4238
+ /**
4239
+ * Test a sign-in identity provider
4240
+ *
4241
+ * Checks a stored provider (`id`), an unsaved candidate, or a stored provider
4242
+ * with some fields replaced (see `AdminAuthProviderTestRequest`): OIDC
4243
+ * discovery for `oidc` and `google`, a credential check against GitHub for
4244
+ * `github`. Nothing is stored and nothing is audited. A failed test is still a
4245
+ * 200, reported with `is_valid: false`.
4246
+ * Instance admin or a first-run setup session; every other request receives 404.
4247
+ *
4248
+ */
4249
+ export const testAdminAuthProvider = (options) => (options.client ?? client).post({
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/admin/settings/auth/providers/test',
4261
+ ...options,
4262
+ headers: {
4263
+ 'Content-Type': 'application/json',
4264
+ ...options.headers
4265
+ }
4266
+ });
4267
+ /**
4268
+ * Delete a sign-in identity provider
4269
+ *
4270
+ * Removes the provider, taking effect on the next sign-in, and appends one
4271
+ * entry (`action: delete`) to the `auth_providers` audit log in the same
4272
+ * transaction.
4273
+ *
4274
+ * Lockout guard: deleting the last enabled provider, or the provider the
4275
+ * calling admin's session was issued by, is rejected with 409 `lockout_risk`
4276
+ * unless `confirm_lockout_risk=true` is passed.
4277
+ * Instance admin or a first-run setup session; every other request receives 404.
4278
+ *
4279
+ */
4280
+ export const deleteAdminAuthProvider = (options) => (options.client ?? client).delete({
4281
+ security: [{
4282
+ key: 'ApiKeyAuth',
4283
+ scheme: 'bearer',
4284
+ type: 'http'
4285
+ }, {
4286
+ in: 'cookie',
4287
+ name: 'vx_session',
4288
+ type: 'apiKey'
4289
+ }],
4290
+ url: '/api/v1/admin/settings/auth/providers/{id}',
4291
+ ...options
4292
+ });
4293
+ /**
4294
+ * Replace a sign-in identity provider
4295
+ *
4296
+ * Validates and stores a whole replacement of the provider's editable fields
4297
+ * (`type` and `slug` are immutable), taking effect on the next sign-in, and
4298
+ * appends one entry (`action: upsert`) to the `auth_providers` audit log in the
4299
+ * same transaction. Omitting `client_secret` keeps the stored one.
4300
+ *
4301
+ * Lockout guard: a change that disables the last enabled provider, or the
4302
+ * provider the calling admin's session was issued by, is rejected with 409
4303
+ * `lockout_risk` (the problem's `metadata.reason` is `no_enabled_provider` or
4304
+ * `own_provider`) unless the body sets `confirm_lockout_risk: true`.
4305
+ * Instance admin or a first-run setup session; every other request receives 404.
4306
+ *
4307
+ */
4308
+ export const updateAdminAuthProvider = (options) => (options.client ?? client).put({
4309
+ responseType: 'json',
4310
+ security: [{
4311
+ key: 'ApiKeyAuth',
4312
+ scheme: 'bearer',
4313
+ type: 'http'
4314
+ }, {
4315
+ in: 'cookie',
4316
+ name: 'vx_session',
4317
+ type: 'apiKey'
4318
+ }],
4319
+ url: '/api/v1/admin/settings/auth/providers/{id}',
4320
+ ...options,
4321
+ headers: {
4322
+ 'Content-Type': 'application/json',
4323
+ ...options.headers
4324
+ }
4325
+ });
4326
+ /**
4327
+ * Reset the sign-in access allowlist to open access
4328
+ *
4329
+ * Removes the stored allowlist, so every user may sign in, and appends one
4330
+ * entry (`action: delete`) to the `auth_allowlist` audit log. Idempotent and
4331
+ * unconditional: with nothing stored it is still a 204 and writes no audit
4332
+ * entry.
4333
+ * Instance admin or a first-run setup session; every other request receives 404.
4334
+ *
4335
+ */
4336
+ export const resetAdminAuthAllowlist = (options) => (options?.client ?? client).delete({
4337
+ security: [{
4338
+ key: 'ApiKeyAuth',
4339
+ scheme: 'bearer',
4340
+ type: 'http'
4341
+ }, {
4342
+ in: 'cookie',
4343
+ name: 'vx_session',
4344
+ type: 'apiKey'
4345
+ }],
4346
+ url: '/api/v1/admin/settings/auth/allowlist',
4347
+ ...options
4348
+ });
4349
+ /**
4350
+ * Get the sign-in access allowlist
4351
+ *
4352
+ * Returns the stored access allowlist. Always 200: with nothing stored both
4353
+ * lists are empty, `active` is false and `version` is null.
4354
+ * Instance admin or a first-run setup session; every other request receives 404.
4355
+ *
4356
+ */
4357
+ export const getAdminAuthAllowlist = (options) => (options?.client ?? client).get({
4358
+ responseType: 'json',
4359
+ security: [{
4360
+ key: 'ApiKeyAuth',
4361
+ scheme: 'bearer',
4362
+ type: 'http'
4363
+ }, {
4364
+ in: 'cookie',
4365
+ name: 'vx_session',
4366
+ type: 'apiKey'
4367
+ }],
4368
+ url: '/api/v1/admin/settings/auth/allowlist',
4369
+ ...options
4370
+ });
4371
+ /**
4372
+ * Replace the sign-in access allowlist
4373
+ *
4374
+ * Validates, normalizes and stores a whole replacement of the access
4375
+ * allowlist, enforced on signed-in users within seconds with no restart, and
4376
+ * appends one entry (`action: upsert`) to the `auth_allowlist` audit log in the
4377
+ * same transaction. Use the preview operation first to see who would be
4378
+ * affected. A body that omits a list, sends one as null, or carries an unknown
4379
+ * field is rejected with 400.
4380
+ * Instance admin or a first-run setup session; every other request receives 404.
4381
+ *
4382
+ */
4383
+ export const updateAdminAuthAllowlist = (options) => (options.client ?? client).put({
4384
+ responseType: 'json',
4385
+ security: [{
4386
+ key: 'ApiKeyAuth',
4387
+ scheme: 'bearer',
4388
+ type: 'http'
4389
+ }, {
4390
+ in: 'cookie',
4391
+ name: 'vx_session',
4392
+ type: 'apiKey'
4393
+ }],
4394
+ url: '/api/v1/admin/settings/auth/allowlist',
4395
+ ...options,
4396
+ headers: {
4397
+ 'Content-Type': 'application/json',
4398
+ ...options.headers
4399
+ }
4400
+ });
4401
+ /**
4402
+ * Preview the impact of a candidate access allowlist
4403
+ *
4404
+ * Reports the active users who would stop matching if the candidate replaced
4405
+ * the stored allowlist: their count and a capped sample of their emails.
4406
+ * Nothing is stored and nothing is audited.
4407
+ * Instance admin or a first-run setup session; every other request receives 404.
4408
+ *
4409
+ */
4410
+ export const previewAdminAuthAllowlist = (options) => (options.client ?? client).post({
4411
+ responseType: 'json',
4412
+ security: [{
4413
+ key: 'ApiKeyAuth',
4414
+ scheme: 'bearer',
4415
+ type: 'http'
4416
+ }, {
4417
+ in: 'cookie',
4418
+ name: 'vx_session',
4419
+ type: 'apiKey'
4420
+ }],
4421
+ url: '/api/v1/admin/settings/auth/allowlist/preview',
4422
+ ...options,
4423
+ headers: {
4424
+ 'Content-Type': 'application/json',
4425
+ ...options.headers
4426
+ }
4427
+ });
4428
+ /**
4429
+ * List the instance admins
4430
+ *
4431
+ * Returns the root admins (the emails named in config.yaml's
4432
+ * `auth.instance_admins`, read-only) and the admins granted in the database.
4433
+ * Instance-admin only (a setup session is not admitted); non-admin and unauthenticated requests receive 404.
4434
+ *
4435
+ */
4436
+ export const listAdminInstanceAdmins = (options) => (options?.client ?? client).get({
4437
+ responseType: 'json',
4438
+ security: [{
4439
+ key: 'ApiKeyAuth',
4440
+ scheme: 'bearer',
4441
+ type: 'http'
4442
+ }, {
4443
+ in: 'cookie',
4444
+ name: 'vx_session',
4445
+ type: 'apiKey'
4446
+ }],
4447
+ url: '/api/v1/admin/settings/auth/admins',
4448
+ ...options
4449
+ });
4450
+ /**
4451
+ * Grant instance admin to an existing user
4452
+ *
4453
+ * Makes an existing, active user an instance admin, named by `user_id` or
4454
+ * `email`, and appends one entry to the `instance_admins` audit log.
4455
+ * Idempotent: granting a user who already holds a grant returns it unchanged
4456
+ * and audits nothing. Only a ROOT admin may grant: a database-granted admin
4457
+ * receives 403.
4458
+ * Instance-admin only (a setup session is not admitted); non-admin and unauthenticated requests receive 404.
4459
+ *
4460
+ */
4461
+ export const grantAdminInstanceAdmin = (options) => (options.client ?? client).post({
4462
+ responseType: 'json',
4463
+ security: [{
4464
+ key: 'ApiKeyAuth',
4465
+ scheme: 'bearer',
4466
+ type: 'http'
4467
+ }, {
4468
+ in: 'cookie',
4469
+ name: 'vx_session',
4470
+ type: 'apiKey'
4471
+ }],
4472
+ url: '/api/v1/admin/settings/auth/admins',
4473
+ ...options,
4474
+ headers: {
4475
+ 'Content-Type': 'application/json',
4476
+ ...options.headers
4477
+ }
4478
+ });
4479
+ /**
4480
+ * Revoke a database-granted instance admin
4481
+ *
4482
+ * Removes the user's instance admin grant and appends one entry to the
4483
+ * `instance_admins` audit log. Only a ROOT admin may revoke: a database-granted
4484
+ * admin receives 403.
4485
+ * Instance-admin only (a setup session is not admitted); non-admin and unauthenticated requests receive 404.
4486
+ *
4487
+ */
4488
+ export const revokeAdminInstanceAdmin = (options) => (options.client ?? client).delete({
4489
+ security: [{
4490
+ key: 'ApiKeyAuth',
4491
+ scheme: 'bearer',
4492
+ type: 'http'
4493
+ }, {
4494
+ in: 'cookie',
4495
+ name: 'vx_session',
4496
+ type: 'apiKey'
4497
+ }],
4498
+ url: '/api/v1/admin/settings/auth/admins/{user_id}',
4499
+ ...options
4500
+ });
4501
+ /**
4502
+ * List an authentication setting's audit log
4503
+ *
4504
+ * Returns one page of the audit log of one authentication setting
4505
+ * (`auth_providers`, `auth_allowlist`, `instance_admins` or `auth_setup`),
4506
+ * newest first, with each actor's display name resolved. Snapshots never
4507
+ * contain a credential. Pass the previous page's `next_cursor` to continue.
4508
+ * Instance-admin only (a setup session is not admitted); non-admin and unauthenticated requests receive 404.
4509
+ *
4510
+ */
4511
+ export const listAdminAuthSettingsAudit = (options) => (options.client ?? client).get({
4512
+ responseType: 'json',
4513
+ security: [{
4514
+ key: 'ApiKeyAuth',
4515
+ scheme: 'bearer',
4516
+ type: 'http'
4517
+ }, {
4518
+ in: 'cookie',
4519
+ name: 'vx_session',
4520
+ type: 'apiKey'
4521
+ }],
4522
+ url: '/api/v1/admin/settings/auth/audit',
4523
+ ...options
4524
+ });
4184
4525
  /**
4185
4526
  * List a resource's comments
4186
4527
  *