@vibexp/api-client 0.94.0 → 0.96.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.
@@ -34,8 +34,8 @@ export declare const health: <ThrowOnError extends boolean = false>(options?: Op
34
34
  * URL to begin the authentication flow.
35
35
  *
36
36
  * The provider is chosen with the `provider` query parameter, whose value is
37
- * one of the deployment's enabled providers (e.g. `google`, `github`,
38
- * `oidc`). When exactly one provider is enabled the parameter may be omitted
37
+ * the slug of one of the deployment's enabled providers (e.g. `google`,
38
+ * `github`, `oidc`, or an admin-chosen slug such as `corp-sso`). When exactly one provider is enabled the parameter may be omitted
39
39
  * and that provider is used. When several are enabled the parameter is
40
40
  * required; an unknown or disabled value is rejected (no silent default).
41
41
  *
@@ -44,12 +44,13 @@ export declare const login: <ThrowOnError extends boolean = false>(options?: Opt
44
44
  /**
45
45
  * List enabled login providers
46
46
  *
47
- * Returns the login providers enabled in this deployment's configuration,
48
- * each with a canonical `name` (the value to pass as `?provider=` to
49
- * `GET /api/v1/auth/login`) and a human-readable `display_name` for the
50
- * login UI. The login screen uses this to render a provider picker instead
51
- * of hardcoding the provider list. The list is stable-sorted and may be
52
- * empty when no provider is configured.
47
+ * Returns the login providers enabled on this instance, each with its slug
48
+ * as `name` (the value to pass as `?provider=` to
49
+ * `GET /api/v1/auth/login`), a human-readable `display_name` for the login
50
+ * UI and its `type`. The login screen uses this to render a provider picker
51
+ * instead of hardcoding the provider list. The list is in the
52
+ * admin-defined sort order, reflects provider changes with no restart, and
53
+ * may be empty when no provider is enabled.
53
54
  *
54
55
  */
55
56
  export declare const listAuthProviders: <ThrowOnError extends boolean = false>(options?: Options<ListAuthProvidersData, ThrowOnError>) => RequestResult<ListAuthProvidersResponses, ListAuthProvidersErrors, ThrowOnError>;
@@ -30,8 +30,8 @@ export const health = (options) => (options?.client ?? client).get({
30
30
  * URL to begin the authentication flow.
31
31
  *
32
32
  * The provider is chosen with the `provider` query parameter, whose value is
33
- * one of the deployment's enabled providers (e.g. `google`, `github`,
34
- * `oidc`). When exactly one provider is enabled the parameter may be omitted
33
+ * the slug of one of the deployment's enabled providers (e.g. `google`,
34
+ * `github`, `oidc`, or an admin-chosen slug such as `corp-sso`). When exactly one provider is enabled the parameter may be omitted
35
35
  * and that provider is used. When several are enabled the parameter is
36
36
  * required; an unknown or disabled value is rejected (no silent default).
37
37
  *
@@ -44,12 +44,13 @@ export const login = (options) => (options?.client ?? client).get({
44
44
  /**
45
45
  * List enabled login providers
46
46
  *
47
- * Returns the login providers enabled in this deployment's configuration,
48
- * each with a canonical `name` (the value to pass as `?provider=` to
49
- * `GET /api/v1/auth/login`) and a human-readable `display_name` for the
50
- * login UI. The login screen uses this to render a provider picker instead
51
- * of hardcoding the provider list. The list is stable-sorted and may be
52
- * empty when no provider is configured.
47
+ * Returns the login providers enabled on this instance, each with its slug
48
+ * as `name` (the value to pass as `?provider=` to
49
+ * `GET /api/v1/auth/login`), a human-readable `display_name` for the login
50
+ * UI and its `type`. The login screen uses this to render a provider picker
51
+ * instead of hardcoding the provider list. The list is in the
52
+ * admin-defined sort order, reflects provider changes with no restart, and
53
+ * may be empty when no provider is enabled.
53
54
  *
54
55
  */
55
56
  export const listAuthProviders = (options) => (options?.client ?? client).get({
@@ -146,18 +146,28 @@ export type User = {
146
146
  /**
147
147
  * The authenticated user as returned by GET /api/v1/auth/me — the full User
148
148
  * object plus session-relative flags. `is_instance_admin` lets the SPA gate the
149
- * Admin Portal menu and /admin routes; it is UI convenience only, as every
150
- * /api/v1/admin* call is authorized server-side regardless.
149
+ * Admin Portal menu and /admin routes, and `is_root_instance_admin` lets it
150
+ * hide the grant/revoke admin controls; both are UI convenience only, as every
151
+ * /api/v1/admin* call (and every grant or revoke) is authorized server-side
152
+ * regardless.
151
153
  *
152
154
  */
153
155
  export type CurrentUser = User & {
154
156
  /**
155
- * Whether the authenticated user's email is in the configured
156
- * auth.instance_admins list (matched case-insensitively). False when the
157
- * list is empty (feature dormant).
157
+ * Whether the authenticated user is an instance admin: either a root
158
+ * admin (see `is_root_instance_admin`) or a non-suspended user granted
159
+ * instance admin in the database by a root admin.
158
160
  *
159
161
  */
160
162
  is_instance_admin: boolean;
163
+ /**
164
+ * Whether the authenticated user's email is in the configured
165
+ * auth.instance_admins list (matched case-insensitively). Only root
166
+ * admins may grant or revoke other instance admins. UI convenience
167
+ * only; grant/revoke is authorized server-side.
168
+ *
169
+ */
170
+ is_root_instance_admin: boolean;
161
171
  };
162
172
  /**
163
173
  * Response body returned by GET /api/v1/auth/login containing the authorization URL
@@ -182,9 +192,9 @@ export type LogoutResponse = {
182
192
  */
183
193
  export type AuthProvider = {
184
194
  /**
185
- * Canonical provider name, also the value to pass as the `provider`
186
- * query parameter to GET /api/v1/auth/login (e.g. `google`, `github`,
187
- * `oidc`).
195
+ * Provider slug, also the value to pass as the `provider` query
196
+ * parameter to GET /api/v1/auth/login (e.g. `google`, `github`, `oidc`,
197
+ * or an admin-chosen slug such as `corp-sso`).
188
198
  *
189
199
  */
190
200
  name: string;
@@ -192,15 +202,21 @@ export type AuthProvider = {
192
202
  * Human-readable label for the provider button in the login UI
193
203
  */
194
204
  display_name: string;
205
+ /**
206
+ * The provider kind. Several `oidc` providers may be enabled side by
207
+ * side, each with its own slug.
208
+ *
209
+ */
210
+ type: 'google' | 'github' | 'oidc';
195
211
  };
196
212
  /**
197
213
  * Response body returned by GET /api/v1/auth/providers listing the login
198
- * providers enabled in this deployment's configuration.
214
+ * providers enabled on this instance.
199
215
  *
200
216
  */
201
217
  export type ProvidersResponse = {
202
218
  /**
203
- * Enabled login providers, stable-sorted by canonical name
219
+ * Enabled login providers, ordered by the admin-defined sort order
204
220
  */
205
221
  providers: Array<AuthProvider>;
206
222
  };
@@ -6953,9 +6969,9 @@ export type LoginData = {
6953
6969
  path?: never;
6954
6970
  query?: {
6955
6971
  /**
6956
- * Canonical name of the identity provider to use (e.g. `google`,
6957
- * `github`, `oidc`). Optional when a single provider is enabled;
6958
- * required when more than one is enabled.
6972
+ * Slug of the identity provider to use (the `name` returned by
6973
+ * GET /api/v1/auth/providers). Optional when a single provider is
6974
+ * enabled; required when more than one is enabled.
6959
6975
  *
6960
6976
  */
6961
6977
  provider?: string;
@@ -6974,7 +6990,9 @@ export type LoginErrors = {
6974
6990
  */
6975
6991
  500: ErrorResponse;
6976
6992
  /**
6977
- * No identity provider is configured (web login unavailable)
6993
+ * No identity provider is enabled (web login unavailable), or the
6994
+ * enabled providers could not be read
6995
+ *
6978
6996
  */
6979
6997
  503: ErrorResponse;
6980
6998
  };
@@ -6997,6 +7015,10 @@ export type ListAuthProvidersErrors = {
6997
7015
  * Internal server error
6998
7016
  */
6999
7017
  500: ErrorResponse;
7018
+ /**
7019
+ * The enabled providers could not be read
7020
+ */
7021
+ 503: ErrorResponse;
7000
7022
  };
7001
7023
  export type ListAuthProvidersError = ListAuthProvidersErrors[keyof ListAuthProvidersErrors];
7002
7024
  export type ListAuthProvidersResponses = {
@@ -7034,6 +7056,10 @@ export type AuthCallbackErrors = {
7034
7056
  * Identity provider authentication failed or session could not be created
7035
7057
  */
7036
7058
  500: ErrorResponse;
7059
+ /**
7060
+ * The enabled providers could not be read
7061
+ */
7062
+ 503: ErrorResponse;
7037
7063
  };
7038
7064
  export type AuthCallbackError = AuthCallbackErrors[keyof AuthCallbackErrors];
7039
7065
  export type LogoutData = {
package/dist/schema.d.ts CHANGED
@@ -58,8 +58,8 @@ export interface paths {
58
58
  * URL to begin the authentication flow.
59
59
  *
60
60
  * The provider is chosen with the `provider` query parameter, whose value is
61
- * one of the deployment's enabled providers (e.g. `google`, `github`,
62
- * `oidc`). When exactly one provider is enabled the parameter may be omitted
61
+ * the slug of one of the deployment's enabled providers (e.g. `google`,
62
+ * `github`, `oidc`, or an admin-chosen slug such as `corp-sso`). When exactly one provider is enabled the parameter may be omitted
63
63
  * and that provider is used. When several are enabled the parameter is
64
64
  * required; an unknown or disabled value is rejected (no silent default).
65
65
  */
@@ -81,12 +81,13 @@ export interface paths {
81
81
  };
82
82
  /**
83
83
  * List enabled login providers
84
- * @description Returns the login providers enabled in this deployment's configuration,
85
- * each with a canonical `name` (the value to pass as `?provider=` to
86
- * `GET /api/v1/auth/login`) and a human-readable `display_name` for the
87
- * login UI. The login screen uses this to render a provider picker instead
88
- * of hardcoding the provider list. The list is stable-sorted and may be
89
- * empty when no provider is configured.
84
+ * @description Returns the login providers enabled on this instance, each with its slug
85
+ * as `name` (the value to pass as `?provider=` to
86
+ * `GET /api/v1/auth/login`), a human-readable `display_name` for the login
87
+ * UI and its `type`. The login screen uses this to render a provider picker
88
+ * instead of hardcoding the provider list. The list is in the
89
+ * admin-defined sort order, reflects provider changes with no restart, and
90
+ * may be empty when no provider is enabled.
90
91
  */
91
92
  get: operations["listAuthProviders"];
92
93
  put?: never;
@@ -5812,17 +5813,27 @@ export interface components {
5812
5813
  /**
5813
5814
  * @description The authenticated user as returned by GET /api/v1/auth/me — the full User
5814
5815
  * object plus session-relative flags. `is_instance_admin` lets the SPA gate the
5815
- * Admin Portal menu and /admin routes; it is UI convenience only, as every
5816
- * /api/v1/admin/* call is authorized server-side regardless.
5816
+ * Admin Portal menu and /admin routes, and `is_root_instance_admin` lets it
5817
+ * hide the grant/revoke admin controls; both are UI convenience only, as every
5818
+ * /api/v1/admin/* call (and every grant or revoke) is authorized server-side
5819
+ * regardless.
5817
5820
  */
5818
5821
  CurrentUser: components["schemas"]["User"] & {
5819
5822
  /**
5820
- * @description Whether the authenticated user's email is in the configured
5821
- * auth.instance_admins list (matched case-insensitively). False when the
5822
- * list is empty (feature dormant).
5823
+ * @description Whether the authenticated user is an instance admin: either a root
5824
+ * admin (see `is_root_instance_admin`) or a non-suspended user granted
5825
+ * instance admin in the database by a root admin.
5823
5826
  * @example false
5824
5827
  */
5825
5828
  is_instance_admin: boolean;
5829
+ /**
5830
+ * @description Whether the authenticated user's email is in the configured
5831
+ * auth.instance_admins list (matched case-insensitively). Only root
5832
+ * admins may grant or revoke other instance admins. UI convenience
5833
+ * only; grant/revoke is authorized server-side.
5834
+ * @example false
5835
+ */
5836
+ is_root_instance_admin: boolean;
5826
5837
  };
5827
5838
  /** @description Response body returned by GET /api/v1/auth/login containing the authorization URL */
5828
5839
  LoginResponse: {
@@ -5844,9 +5855,9 @@ export interface components {
5844
5855
  /** @description One enabled login provider, with display metadata for the login UI */
5845
5856
  AuthProvider: {
5846
5857
  /**
5847
- * @description Canonical provider name, also the value to pass as the `provider`
5848
- * query parameter to GET /api/v1/auth/login (e.g. `google`, `github`,
5849
- * `oidc`).
5858
+ * @description Provider slug, also the value to pass as the `provider` query
5859
+ * parameter to GET /api/v1/auth/login (e.g. `google`, `github`, `oidc`,
5860
+ * or an admin-chosen slug such as `corp-sso`).
5850
5861
  * @example google
5851
5862
  */
5852
5863
  name: string;
@@ -5855,13 +5866,20 @@ export interface components {
5855
5866
  * @example Google
5856
5867
  */
5857
5868
  display_name: string;
5869
+ /**
5870
+ * @description The provider kind. Several `oidc` providers may be enabled side by
5871
+ * side, each with its own slug.
5872
+ * @example google
5873
+ * @enum {string}
5874
+ */
5875
+ type: "google" | "github" | "oidc";
5858
5876
  };
5859
5877
  /**
5860
5878
  * @description Response body returned by GET /api/v1/auth/providers listing the login
5861
- * providers enabled in this deployment's configuration.
5879
+ * providers enabled on this instance.
5862
5880
  */
5863
5881
  ProvidersResponse: {
5864
- /** @description Enabled login providers, stable-sorted by canonical name */
5882
+ /** @description Enabled login providers, ordered by the admin-defined sort order */
5865
5883
  providers: components["schemas"]["AuthProvider"][];
5866
5884
  };
5867
5885
  /** @description Request body for POST /api/v1/auth/dev/login (development environment only) */
@@ -13783,9 +13801,9 @@ export interface operations {
13783
13801
  parameters: {
13784
13802
  query?: {
13785
13803
  /**
13786
- * @description Canonical name of the identity provider to use (e.g. `google`,
13787
- * `github`, `oidc`). Optional when a single provider is enabled;
13788
- * required when more than one is enabled.
13804
+ * @description Slug of the identity provider to use (the `name` returned by
13805
+ * GET /api/v1/auth/providers). Optional when a single provider is
13806
+ * enabled; required when more than one is enabled.
13789
13807
  */
13790
13808
  provider?: string;
13791
13809
  };
@@ -13825,7 +13843,10 @@ export interface operations {
13825
13843
  "application/problem+json": components["schemas"]["ErrorResponse"];
13826
13844
  };
13827
13845
  };
13828
- /** @description No identity provider is configured (web login unavailable) */
13846
+ /**
13847
+ * @description No identity provider is enabled (web login unavailable), or the
13848
+ * enabled providers could not be read
13849
+ */
13829
13850
  503: {
13830
13851
  headers: {
13831
13852
  [name: string]: unknown;
@@ -13863,6 +13884,15 @@ export interface operations {
13863
13884
  "application/problem+json": components["schemas"]["ErrorResponse"];
13864
13885
  };
13865
13886
  };
13887
+ /** @description The enabled providers could not be read */
13888
+ 503: {
13889
+ headers: {
13890
+ [name: string]: unknown;
13891
+ };
13892
+ content: {
13893
+ "application/problem+json": components["schemas"]["ErrorResponse"];
13894
+ };
13895
+ };
13866
13896
  };
13867
13897
  };
13868
13898
  authCallback: {
@@ -13883,7 +13913,9 @@ export interface operations {
13883
13913
  * @description Redirects the browser to the frontend. On success, to the home page
13884
13914
  * (a session cookie is set). When sign-in is denied by the access
13885
13915
  * allowlist, to `/auth/callback?error=access_restricted` with no session
13886
- * cookie set.
13916
+ * cookie set. When the provider the flow started with was disabled or
13917
+ * removed before the callback, to
13918
+ * `/auth/callback?error=provider_unavailable`.
13887
13919
  */
13888
13920
  302: {
13889
13921
  headers: {
@@ -13925,6 +13957,15 @@ export interface operations {
13925
13957
  "application/problem+json": components["schemas"]["ErrorResponse"];
13926
13958
  };
13927
13959
  };
13960
+ /** @description The enabled providers could not be read */
13961
+ 503: {
13962
+ headers: {
13963
+ [name: string]: unknown;
13964
+ };
13965
+ content: {
13966
+ "application/problem+json": components["schemas"]["ErrorResponse"];
13967
+ };
13968
+ };
13928
13969
  };
13929
13970
  };
13930
13971
  logout: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vibexp/api-client",
3
- "version": "0.94.0",
3
+ "version": "0.96.0",
4
4
  "description": "Typed VibeXP API client generated from the OpenAPI spec (openapi-fetch main entrypoint, axios SDK at ./axios)",
5
5
  "license": "MIT",
6
6
  "repository": {