From 8520630ddb763ea46345944cd2bdf8af1b2a91d6 Mon Sep 17 00:00:00 2001 From: Daniel Rivers Date: Fri, 10 May 2024 14:24:44 +0100 Subject: [PATCH 1/2] update openapi-ts generator --- .prettierignore | 2 - lib/api/core/OpenAPI.ts | 5 +- lib/api/core/request.ts | 4 +- lib/api/index.ts | 7 +- lib/api/{schemas.ts => schemas.gen.ts} | 0 lib/api/services.gen.ts | 2684 +++++++++++++++++++++++ lib/api/services.ts | 2482 --------------------- lib/api/{models.ts => types.gen.ts} | 2797 +++++++++++++++++++++++- openapi-ts.config.ts | 10 + 9 files changed, 5453 insertions(+), 2538 deletions(-) rename lib/api/{schemas.ts => schemas.gen.ts} (100%) create mode 100644 lib/api/services.gen.ts delete mode 100644 lib/api/services.ts rename lib/api/{models.ts => types.gen.ts} (54%) create mode 100644 openapi-ts.config.ts diff --git a/.prettierignore b/.prettierignore index 80826fb..f1002e6 100644 --- a/.prettierignore +++ b/.prettierignore @@ -1,4 +1,2 @@ -generated - pnpm-lock.yaml spec/kinde-mgmt-api-specs.yaml \ No newline at end of file diff --git a/lib/api/core/OpenAPI.ts b/lib/api/core/OpenAPI.ts index 34f6a22..bd204d1 100644 --- a/lib/api/core/OpenAPI.ts +++ b/lib/api/core/OpenAPI.ts @@ -49,5 +49,8 @@ export const OpenAPI: OpenAPIConfig = { USERNAME: undefined, VERSION: "1", WITH_CREDENTIALS: false, - interceptors: { request: new Interceptors(), response: new Interceptors() }, + interceptors: { + request: new Interceptors(), + response: new Interceptors(), + }, }; diff --git a/lib/api/core/request.ts b/lib/api/core/request.ts index dc68ec8..b5050c1 100644 --- a/lib/api/core/request.ts +++ b/lib/api/core/request.ts @@ -42,7 +42,9 @@ export const getQueryString = (params: Record): string => { return; } - if (Array.isArray(value)) { + if (value instanceof Date) { + append(key, value.toISOString()); + } else if (Array.isArray(value)) { value.forEach((v) => encodePair(key, v)); } else if (typeof value === "object") { Object.entries(value).forEach(([k, v]) => encodePair(`${key}[${k}]`, v)); diff --git a/lib/api/index.ts b/lib/api/index.ts index 45043b7..1a73593 100644 --- a/lib/api/index.ts +++ b/lib/api/index.ts @@ -1,8 +1,7 @@ // This file is auto-generated by @hey-api/openapi-ts - export { ApiError } from "./core/ApiError"; export { CancelablePromise, CancelError } from "./core/CancelablePromise"; export { OpenAPI, type OpenAPIConfig } from "./core/OpenAPI"; -export * from "./models"; -export * from "./schemas"; -export * from "./services"; +export * from "./schemas.gen"; +export * from "./services.gen"; +export * from "./types.gen"; diff --git a/lib/api/schemas.ts b/lib/api/schemas.gen.ts similarity index 100% rename from lib/api/schemas.ts rename to lib/api/schemas.gen.ts diff --git a/lib/api/services.gen.ts b/lib/api/services.gen.ts new file mode 100644 index 0000000..dc92842 --- /dev/null +++ b/lib/api/services.gen.ts @@ -0,0 +1,2684 @@ +// This file is auto-generated by @hey-api/openapi-ts + +import type { CancelablePromise } from "./core/CancelablePromise"; +import { OpenAPI } from "./core/OpenAPI"; +import { request as __request } from "./core/request"; +import type { + GetUserResponse, + TokenIntrospectionData, + TokenIntrospectionResponse, + TokenRevocationData, + TokenRevocationResponse, + GetUserProfileV2Response, + GetApIsResponse, + AddApIsData, + AddApIsResponse, + GetApiData, + GetApiResponse, + DeleteApiData, + DeleteApiResponse, + UpdateApiApplicationsData, + UpdateApiApplicationsResponse, + GetApplicationsData, + GetApplicationsResponse, + CreateApplicationData, + CreateApplicationResponse, + GetApplicationData, + GetApplicationResponse, + UpdateApplicationData, + UpdateApplicationResponse, + DeleteApplicationData, + DeleteApplicationResponse, + GetBusinessData, + GetBusinessResponse, + UpdateBusinessData, + UpdateBusinessResponse, + GetIndustriesData, + GetIndustriesResponse, + GetTimezonesData, + GetTimezonesResponse, + GetCallbackUrLsData, + GetCallbackUrLsResponse, + AddRedirectCallbackUrLsData, + AddRedirectCallbackUrLsResponse, + ReplaceRedirectCallbackUrLsData, + ReplaceRedirectCallbackUrLsResponse, + DeleteCallbackUrLsData, + DeleteCallbackUrLsResponse, + GetLogoutUrLsData, + GetLogoutUrLsResponse, + AddLogoutRedirectUrLsData, + AddLogoutRedirectUrLsResponse, + ReplaceLogoutRedirectUrLsData, + ReplaceLogoutRedirectUrLsResponse, + DeleteLogoutUrLsData, + DeleteLogoutUrLsResponse, + GetConnectedAppAuthUrlData, + GetConnectedAppAuthUrlResponse, + GetConnectedAppTokenData, + GetConnectedAppTokenResponse, + RevokeConnectedAppTokenData, + RevokeConnectedAppTokenResponse, + DeleteEnvironementFeatureFlagOverridesResponse, + GetEnvironementFeatureFlagsResponse, + DeleteEnvironementFeatureFlagOverrideData, + DeleteEnvironementFeatureFlagOverrideResponse, + UpdateEnvironementFeatureFlagOverrideData, + UpdateEnvironementFeatureFlagOverrideResponse, + CreateFeatureFlagData, + CreateFeatureFlagResponse, + DeleteFeatureFlagData, + DeleteFeatureFlagResponse, + UpdateFeatureFlagData, + UpdateFeatureFlagResponse, + GetOrganizationData, + GetOrganizationResponse, + CreateOrganizationData, + CreateOrganizationResponse, + UpdateOrganizationData, + UpdateOrganizationResponse, + DeleteOrganizationData, + DeleteOrganizationResponse, + GetOrganizationsData, + GetOrganizationsResponse, + GetOrganizationUsersData, + GetOrganizationUsersResponse, + AddOrganizationUsersData, + AddOrganizationUsersResponse, + UpdateOrganizationUsersData, + UpdateOrganizationUsersResponse, + GetOrganizationUserRolesData, + GetOrganizationUserRolesResponse, + CreateOrganizationUserRoleData, + CreateOrganizationUserRoleResponse, + DeleteOrganizationUserRoleData, + DeleteOrganizationUserRoleResponse, + GetOrganizationUserPermissionsData, + GetOrganizationUserPermissionsResponse, + CreateOrganizationUserPermissionData, + CreateOrganizationUserPermissionResponse, + DeleteOrganizationUserPermissionData, + DeleteOrganizationUserPermissionResponse, + RemoveOrganizationUserData, + RemoveOrganizationUserResponse, + GetOrganizationFeatureFlagsData, + GetOrganizationFeatureFlagsResponse, + DeleteOrganizationFeatureFlagOverridesData, + DeleteOrganizationFeatureFlagOverridesResponse, + DeleteOrganizationFeatureFlagOverrideData, + DeleteOrganizationFeatureFlagOverrideResponse, + UpdateOrganizationFeatureFlagOverrideData, + UpdateOrganizationFeatureFlagOverrideResponse, + UpdateOrganizationPropertyData, + UpdateOrganizationPropertyResponse, + GetOrganizationPropertyValuesData, + GetOrganizationPropertyValuesResponse, + UpdateOrganizationPropertiesData, + UpdateOrganizationPropertiesResponse, + DeleteOrganizationHandleData, + DeleteOrganizationHandleResponse, + GetPermissionsData, + GetPermissionsResponse, + CreatePermissionData, + CreatePermissionResponse, + UpdatePermissionsData, + UpdatePermissionsResponse, + DeletePermissionData, + DeletePermissionResponse, + GetPropertiesData, + GetPropertiesResponse, + CreatePropertyData, + CreatePropertyResponse, + UpdatePropertyData, + UpdatePropertyResponse, + GetCategoriesData, + GetCategoriesResponse, + CreateCategoryData, + CreateCategoryResponse, + UpdateCategoryData, + UpdateCategoryResponse, + GetRolesData, + GetRolesResponse, + CreateRoleData, + CreateRoleResponse, + GetRolePermissionData, + GetRolePermissionResponse, + UpdateRolePermissionsData, + UpdateRolePermissionsResponse, + RemoveRolePermissionData, + RemoveRolePermissionResponse, + UpdateRolesData, + UpdateRolesResponse, + DeleteRoleData, + DeleteRoleResponse, + GetSubscribersData, + GetSubscribersResponse, + CreateSubscriberData, + CreateSubscriberResponse, + GetSubscriberData, + GetSubscriberResponse, + GetUsersData, + GetUsersResponse, + RefreshUserClaimsData, + RefreshUserClaimsResponse, + GetUserDataData, + GetUserDataResponse, + CreateUserData, + CreateUserResponse, + UpdateUserData, + UpdateUserResponse, + DeleteUserData, + DeleteUserResponse, + UpdateUserFeatureFlagOverrideData, + UpdateUserFeatureFlagOverrideResponse, + UpdateUserPropertyData, + UpdateUserPropertyResponse, + GetUserPropertyValuesData, + GetUserPropertyValuesResponse, + UpdateUserPropertiesData, + UpdateUserPropertiesResponse, + SetUserPasswordData, + SetUserPasswordResponse, +} from "./types.gen"; + +export class Oauth { + /** + * Get User Profile + * Contains the id, names and email of the currently logged in user. + * + * @returns user_profile Details of logged in user V1. + * @throws ApiError + */ + public static getUser(): CancelablePromise { + return __request(OpenAPI, { + method: "GET", + url: "/oauth2/user_profile", + errors: { + 403: "Invalid credentials.", + }, + }); + } + + /** + * Get token details + * Retrieve information about the provided token. + * @param data The data for the request. + * @param data.formData Token details. + * @returns token_introspect Details of the token. + * @throws ApiError + */ + public static tokenIntrospection( + data: TokenIntrospectionData, + ): CancelablePromise { + return __request(OpenAPI, { + method: "POST", + url: "/oauth2/introspect", + formData: data.formData, + mediaType: "application/x-www-form-urlencoded", + errors: { + 401: "Bad request.", + 403: "Invalid credentials.", + 429: "Request was throttled.", + }, + }); + } + + /** + * Revoke token + * Revoke a previously issued token. + * @param data The data for the request. + * @param data.formData Details of the token to be revoked. + * @returns unknown Token successfully revoked. + * @throws ApiError + */ + public static tokenRevocation( + data: TokenRevocationData, + ): CancelablePromise { + return __request(OpenAPI, { + method: "POST", + url: "/oauth2/revoke", + formData: data.formData, + mediaType: "application/x-www-form-urlencoded", + errors: { + 401: "Bad request.", + 403: "Invalid credentials.", + 429: "Request was throttled.", + }, + }); + } + + /** + * Returns the details of the currently logged in user + * Contains the id, names, profile picture URL and email of the currently logged in user. + * + * @returns user_profile_v2 Details of logged in user V2. + * @throws ApiError + */ + public static getUserProfileV2(): CancelablePromise { + return __request(OpenAPI, { + method: "GET", + url: "/oauth2/v2/user_profile", + errors: { + 403: "Invalid credentials.", + 429: "Request was throttled.", + }, + }); + } +} + +export class ApIs { + /** + * List APIs + * Returns a list of APIs. + * + * @returns apis APIs successfully retrieved. + * @throws ApiError + */ + public static getApIs(): CancelablePromise { + return __request(OpenAPI, { + method: "GET", + url: "/api/v1/apis", + errors: { + 400: "Invalid request.", + 403: "Invalid credentials.", + 429: "Request was throttled.", + }, + }); + } + + /** + * Add APIs + * Add APIs. + * + * @param data The data for the request. + * @param data.requestBody API details. + * @returns success_response APIs successfully updated + * @throws ApiError + */ + public static addApIs(data: AddApIsData): CancelablePromise { + return __request(OpenAPI, { + method: "POST", + url: "/api/v1/apis", + body: data.requestBody, + mediaType: "application/json", + errors: { + 400: "Invalid request.", + 403: "Invalid credentials.", + 429: "Request was throttled.", + }, + }); + } + + /** + * List API details + * Returns the details of the API. + * + * @param data The data for the request. + * @param data.apiId The API's id. + * @returns api API successfully retrieved. + * @throws ApiError + */ + public static getApi(data: GetApiData): CancelablePromise { + return __request(OpenAPI, { + method: "GET", + url: "/api/v1/apis/{api_id}", + path: { + api_id: data.apiId, + }, + errors: { + 400: "Invalid request.", + 403: "Invalid credentials.", + 429: "Request was throttled.", + }, + }); + } + + /** + * Delete API + * Deletes API. + * + * @param data The data for the request. + * @param data.apiId The API's id. + * @returns success_response API successfully deleted. + * @throws ApiError + */ + public static deleteApi( + data: DeleteApiData, + ): CancelablePromise { + return __request(OpenAPI, { + method: "DELETE", + url: "/api/v1/apis/{api_id}", + path: { + api_id: data.apiId, + }, + errors: { + 400: "Invalid request.", + 403: "Invalid credentials.", + 429: "Request was throttled.", + }, + }); + } + + /** + * Update API Applications + * Update the applications under that API. + * + * @param data The data for the request. + * @param data.apiId The identifier for the API. + * @param data.requestBody The applications you want to connect or disconnect. + * @returns success_response API applications updated. + * @throws ApiError + */ + public static updateApiApplications( + data: UpdateApiApplicationsData, + ): CancelablePromise { + return __request(OpenAPI, { + method: "PATCH", + url: "/api/v1/apis/{api_id}/applications", + path: { + api_id: data.apiId, + }, + body: data.requestBody, + mediaType: "application/json", + errors: { + 400: "Invalid request.", + 403: "Invalid credentials.", + 429: "Request was throttled.", + }, + }); + } +} + +export class Applications { + /** + * List Applications + * Get a list of applications. + * + * @param data The data for the request. + * @param data.sort Field and order to sort the result by. + * @param data.pageSize Number of results per page. Defaults to 10 if parameter not sent. + * @param data.nextToken A string to get the next page of results if there are more results. + * @returns get_applications_response A successful response with a list of applications or an empty list. + * @throws ApiError + */ + public static getApplications( + data: GetApplicationsData = {}, + ): CancelablePromise { + return __request(OpenAPI, { + method: "GET", + url: "/api/v1/applications", + query: { + sort: data.sort, + page_size: data.pageSize, + next_token: data.nextToken, + }, + errors: { + 403: "Invalid credentials.", + 429: "Request was throttled.", + }, + }); + } + + /** + * Create Application + * Create an application. + * @param data The data for the request. + * @param data.requestBody Application details. + * @returns create_application_response Application successfully created. + * @throws ApiError + */ + public static createApplication( + data: CreateApplicationData = {}, + ): CancelablePromise { + return __request(OpenAPI, { + method: "POST", + url: "/api/v1/applications", + body: data.requestBody, + mediaType: "application/json", + errors: { + 400: "Error creating user.", + 403: "Invalid credentials.", + 429: "Request was throttled.", + }, + }); + } + + /** + * Get Application + * Gets an application given the application's id. + * + * @param data The data for the request. + * @param data.applicationId The identifier for the application. + * @returns get_application_response Application successfully retrieved. + * @throws ApiError + */ + public static getApplication( + data: GetApplicationData, + ): CancelablePromise { + return __request(OpenAPI, { + method: "GET", + url: "/api/v1/applications/{application_id}", + path: { + application_id: data.applicationId, + }, + errors: { + 400: "Bad request.", + 403: "Invalid credentials.", + 429: "Request was throttled.", + }, + }); + } + + /** + * Update Application + * Update an application. + * @param data The data for the request. + * @param data.applicationId The identifier for the application. + * @param data.requestBody Application details. + * @returns unknown Application successfully updated. + * @throws ApiError + */ + public static updateApplication( + data: UpdateApplicationData, + ): CancelablePromise { + return __request(OpenAPI, { + method: "PATCH", + url: "/api/v1/applications/{application_id}", + path: { + application_id: data.applicationId, + }, + body: data.requestBody, + mediaType: "application/json", + errors: { + 400: "Bad request.", + 403: "Invalid credentials.", + 429: "Request was throttled.", + }, + }); + } + + /** + * Delete Application + * Delete application. + * + * @param data The data for the request. + * @param data.applicationId The identifier for the application. + * @returns success_response Application successfully deleted. + * @throws ApiError + */ + public static deleteApplication( + data: DeleteApplicationData, + ): CancelablePromise { + return __request(OpenAPI, { + method: "DELETE", + url: "/api/v1/applications/{application_id}", + path: { + application_id: data.applicationId, + }, + errors: { + 400: "Invalid request.", + 403: "Invalid credentials.", + 429: "Request was throttled.", + }, + }); + } +} + +export class Business { + /** + * List business details + * Get your business details. + * @param data The data for the request. + * @param data.code Business code. + * @param data.name Business name. + * @param data.email Email associated with business. + * @param data.phone Phone number associated with business. + * @param data.industry The industry your business is in. + * @param data.timezone The timezone your business is in. + * @param data.privacyUrl Your Privacy policy URL. + * @param data.termsUrl Your Terms and Conditions URL. + * @returns success_response A successful response with your business details. + * @throws ApiError + */ + public static getBusiness( + data: GetBusinessData, + ): CancelablePromise { + return __request(OpenAPI, { + method: "GET", + url: "/api/v1/business", + query: { + code: data.code, + name: data.name, + email: data.email, + phone: data.phone, + industry: data.industry, + timezone: data.timezone, + privacy_url: data.privacyUrl, + terms_url: data.termsUrl, + }, + errors: { + 403: "Invalid credentials.", + 429: "Request was throttled.", + }, + }); + } + + /** + * Update business details + * Update business details. + * @param data The data for the request. + * @param data.businessName Business name. + * @param data.primaryEmail Email associated with business. + * @param data.primaryPhone Phone number associated with business. + * @param data.industryKey The key of the industry your business is in. + * @param data.timezoneId The ID of the timezone your business is in. + * @param data.privacyUrl Your Privacy policy URL. + * @param data.termsUrl Your Terms and Conditions URL. + * @param data.isShowKindeBranding Display "Powered by Kinde" on your sign up, sign in, and subscription pages. + * @param data.isClickWrap Show a policy acceptance checkbox on sign up. + * @param data.partnerCode Your Kinde Perk code. + * @returns success_response Business successfully updated. + * @throws ApiError + */ + public static updateBusiness( + data: UpdateBusinessData, + ): CancelablePromise { + return __request(OpenAPI, { + method: "PATCH", + url: "/api/v1/business", + query: { + business_name: data.businessName, + primary_email: data.primaryEmail, + primary_phone: data.primaryPhone, + industry_key: data.industryKey, + timezone_id: data.timezoneId, + privacy_url: data.privacyUrl, + terms_url: data.termsUrl, + is_show_kinde_branding: data.isShowKindeBranding, + is_click_wrap: data.isClickWrap, + partner_code: data.partnerCode, + }, + errors: { + 400: "Invalid request.", + 403: "Invalid credentials.", + 429: "Request was throttled.", + }, + }); + } +} + +export class Industries { + /** + * List industries and industry keys. + * Get a list of industries and associated industry keys. + * @param data The data for the request. + * @param data.industryKey Industry Key. + * @param data.name Industry name. + * @returns success_response A successful response with a list of industries and industry keys. + * @throws ApiError + */ + public static getIndustries( + data: GetIndustriesData = {}, + ): CancelablePromise { + return __request(OpenAPI, { + method: "GET", + url: "/api/v1/industries", + query: { + industry_key: data.industryKey, + name: data.name, + }, + errors: { + 403: "Invalid credentials.", + 429: "Request was throttled.", + }, + }); + } +} + +export class Timezones { + /** + * List timezones and timezone IDs. + * Get a list of timezones and associated timezone keys. + * @param data The data for the request. + * @param data.timezoneKey Timezone Key. + * @param data.name Timezone. + * @returns success_response A successful response with a list of timezones and timezone keys. + * @throws ApiError + */ + public static getTimezones( + data: GetTimezonesData = {}, + ): CancelablePromise { + return __request(OpenAPI, { + method: "GET", + url: "/api/v1/timezones", + query: { + timezone_key: data.timezoneKey, + name: data.name, + }, + errors: { + 403: "Invalid credentials.", + 429: "Request was throttled.", + }, + }); + } +} + +export class Callbacks { + /** + * List Callback URLs + * Returns an application's redirect callback URLs. + * + * @param data The data for the request. + * @param data.appId The identifier for the application. + * @returns redirect_callback_urls Callback URLs successfully retrieved. + * @throws ApiError + */ + public static getCallbackUrLs( + data: GetCallbackUrLsData, + ): CancelablePromise { + return __request(OpenAPI, { + method: "GET", + url: "/api/v1/applications/{app_id}/auth_redirect_urls", + path: { + app_id: data.appId, + }, + errors: { + 400: "Invalid request.", + 403: "Invalid credentials.", + 429: "Request was throttled.", + }, + }); + } + + /** + * Add Redirect Callback URLs + * Add additional redirect callback URLs. + * + * @param data The data for the request. + * @param data.appId The identifier for the application. + * @param data.requestBody Callback details. + * @returns success_response Callbacks successfully updated + * @throws ApiError + */ + public static addRedirectCallbackUrLs( + data: AddRedirectCallbackUrLsData, + ): CancelablePromise { + return __request(OpenAPI, { + method: "POST", + url: "/api/v1/applications/{app_id}/auth_redirect_urls", + path: { + app_id: data.appId, + }, + body: data.requestBody, + mediaType: "application/json", + errors: { + 400: "Invalid request.", + 403: "Invalid credentials.", + 429: "Request was throttled.", + }, + }); + } + + /** + * Replace Redirect Callback URLs + * Replace all redirect callback URLs. + * + * @param data The data for the request. + * @param data.appId The identifier for the application. + * @param data.requestBody Callback details. + * @returns success_response Callbacks successfully updated + * @throws ApiError + */ + public static replaceRedirectCallbackUrLs( + data: ReplaceRedirectCallbackUrLsData, + ): CancelablePromise { + return __request(OpenAPI, { + method: "PUT", + url: "/api/v1/applications/{app_id}/auth_redirect_urls", + path: { + app_id: data.appId, + }, + body: data.requestBody, + mediaType: "application/json", + errors: { + 400: "Invalid request.", + 403: "Invalid credentials.", + 429: "Request was throttled.", + }, + }); + } + + /** + * Delete Callback URLs + * Delete callback URLs. + * + * @param data The data for the request. + * @param data.appId The identifier for the application. + * @param data.urls Urls to delete, comma separated and url encoded. + * @returns success_response Callback URLs successfully deleted. + * @throws ApiError + */ + public static deleteCallbackUrLs( + data: DeleteCallbackUrLsData, + ): CancelablePromise { + return __request(OpenAPI, { + method: "DELETE", + url: "/api/v1/applications/{app_id}/auth_redirect_urls", + path: { + app_id: data.appId, + }, + query: { + urls: data.urls, + }, + errors: { + 400: "Invalid request.", + 403: "Invalid credentials.", + 429: "Request was throttled.", + }, + }); + } + + /** + * List Logout URLs + * Returns an application's logout redirect URLs. + * + * @param data The data for the request. + * @param data.appId The identifier for the application. + * @returns logout_redirect_urls Logout URLs successfully retrieved. + * @throws ApiError + */ + public static getLogoutUrLs( + data: GetLogoutUrLsData, + ): CancelablePromise { + return __request(OpenAPI, { + method: "GET", + url: "/api/v1/applications/{app_id}/auth_logout_urls", + path: { + app_id: data.appId, + }, + errors: { + 400: "Invalid request.", + 403: "Invalid credentials.", + 429: "Request was throttled.", + }, + }); + } + + /** + * Add Logout Redirect URLs + * Add additional logout redirect URLs. + * + * @param data The data for the request. + * @param data.appId The identifier for the application. + * @param data.requestBody Callback details. + * @returns success_response Logouts successfully updated + * @throws ApiError + */ + public static addLogoutRedirectUrLs( + data: AddLogoutRedirectUrLsData, + ): CancelablePromise { + return __request(OpenAPI, { + method: "POST", + url: "/api/v1/applications/{app_id}/auth_logout_urls", + path: { + app_id: data.appId, + }, + body: data.requestBody, + mediaType: "application/json", + errors: { + 400: "Invalid request.", + 403: "Invalid credentials.", + 429: "Request was throttled.", + }, + }); + } + + /** + * Replace Logout Redirect URLs + * Replace all logout redirect URLs. + * + * @param data The data for the request. + * @param data.appId The identifier for the application. + * @param data.requestBody Callback details. + * @returns success_response Logout URLs successfully updated + * @throws ApiError + */ + public static replaceLogoutRedirectUrLs( + data: ReplaceLogoutRedirectUrLsData, + ): CancelablePromise { + return __request(OpenAPI, { + method: "PUT", + url: "/api/v1/applications/{app_id}/auth_logout_urls", + path: { + app_id: data.appId, + }, + body: data.requestBody, + mediaType: "application/json", + errors: { + 400: "Invalid request.", + 403: "Invalid credentials.", + 429: "Request was throttled.", + }, + }); + } + + /** + * Delete Logout URLs + * Delete logout URLs. + * + * @param data The data for the request. + * @param data.appId The identifier for the application. + * @param data.urls Urls to delete, comma separated and url encoded. + * @returns success_response Logout URLs successfully deleted. + * @throws ApiError + */ + public static deleteLogoutUrLs( + data: DeleteLogoutUrLsData, + ): CancelablePromise { + return __request(OpenAPI, { + method: "DELETE", + url: "/api/v1/applications/{app_id}/auth_logout_urls", + path: { + app_id: data.appId, + }, + query: { + urls: data.urls, + }, + errors: { + 400: "Invalid request.", + 403: "Invalid credentials.", + 429: "Request was throttled.", + }, + }); + } +} + +export class ConnectedApps { + /** + * Get Connected App URL + * Get a URL that authenticates and authorizes a user to a third-party connected app. + * @param data The data for the request. + * @param data.keyCodeRef The unique key code reference of the connected app to authenticate against. + * @param data.userId The id of the user that needs to authenticate to the third-party connected app. + * @param data.orgCode The code of the Kinde organization that needs to authenticate to the third-party connected app. + * @param data.overrideCallbackUrl A URL that overrides the default callback URL setup in your connected app configuration + * @returns connected_apps_auth_url A URL that can be used to authenticate and a session id to identify this authentication session. + * @throws ApiError + */ + public static getConnectedAppAuthUrl( + data: GetConnectedAppAuthUrlData, + ): CancelablePromise { + return __request(OpenAPI, { + method: "GET", + url: "/api/v1/connected_apps/auth_url", + query: { + key_code_ref: data.keyCodeRef, + user_id: data.userId, + org_code: data.orgCode, + override_callback_url: data.overrideCallbackUrl, + }, + errors: { + 400: "Error retrieving connected app auth url.", + 403: "Invalid credentials.", + 404: "Error retrieving connected app auth url.", + 429: "Request was throttled.", + }, + }); + } + + /** + * Get Connected App Token + * Get an access token that can be used to call the third-party provider linked to the connected app. + * @param data The data for the request. + * @param data.sessionId The unique sesssion id reprensenting the login session of a user. + * @returns connected_apps_access_token An access token that can be used to query a third-party provider, as well as the token's expiry time. + * @throws ApiError + */ + public static getConnectedAppToken( + data: GetConnectedAppTokenData, + ): CancelablePromise { + return __request(OpenAPI, { + method: "GET", + url: "/api/v1/connected_apps/token", + query: { + session_id: data.sessionId, + }, + errors: { + 400: "The session id provided points to an invalid session.", + 403: "Invalid credentials.", + 429: "Request was throttled.", + }, + }); + } + + /** + * Revoke Connected App Token + * Revoke the tokens linked to the connected app session. + * @param data The data for the request. + * @param data.sessionId The unique sesssion id reprensenting the login session of a user. + * @returns success_response An access token that can be used to query a third-party provider, as well as the token's expiry time. + * @throws ApiError + */ + public static revokeConnectedAppToken( + data: RevokeConnectedAppTokenData, + ): CancelablePromise { + return __request(OpenAPI, { + method: "POST", + url: "/api/v1/connected_apps/revoke", + query: { + session_id: data.sessionId, + }, + errors: { + 400: "Bad request.", + 403: "Invalid credentials.", + 405: "Invalid HTTP method used.", + 429: "Request was throttled.", + }, + }); + } +} + +export class Environments { + /** + * Delete Environment Feature Flag Overrides + * Delete all environment feature flag overrides. + * @returns success_response Feature flag overrides deleted successfully. + * @throws ApiError + */ + public static deleteEnvironementFeatureFlagOverrides(): CancelablePromise { + return __request(OpenAPI, { + method: "DELETE", + url: "/api/v1/environment/feature_flags", + errors: { + 400: "Invalid request.", + 403: "Invalid credentials.", + 429: "Request was throttled.", + }, + }); + } + + /** + * List Environment Feature Flags + * Get environment feature flags. + * @returns get_environment_feature_flags_response Feature flags retrieved successfully. + * @throws ApiError + */ + public static getEnvironementFeatureFlags(): CancelablePromise { + return __request(OpenAPI, { + method: "GET", + url: "/api/v1/environment/feature_flags", + errors: { + 400: "Invalid request.", + 403: "Invalid credentials.", + 429: "Request was throttled.", + }, + }); + } + + /** + * Delete Environment Feature Flag Override + * Delete environment feature flag override. + * @param data The data for the request. + * @param data.featureFlagKey The identifier for the feature flag. + * @returns success_response Feature flag deleted successfully. + * @throws ApiError + */ + public static deleteEnvironementFeatureFlagOverride( + data: DeleteEnvironementFeatureFlagOverrideData, + ): CancelablePromise { + return __request(OpenAPI, { + method: "DELETE", + url: "/api/v1/environment/feature_flags/{feature_flag_key}", + path: { + feature_flag_key: data.featureFlagKey, + }, + errors: { + 400: "Invalid request.", + 403: "Invalid credentials.", + 429: "Request was throttled.", + }, + }); + } + + /** + * Update Environment Feature Flag Override + * Update environment feature flag override. + * @param data The data for the request. + * @param data.featureFlagKey The identifier for the feature flag. + * @param data.requestBody Flag details. + * @returns success_response Feature flag override successful + * @throws ApiError + */ + public static updateEnvironementFeatureFlagOverride( + data: UpdateEnvironementFeatureFlagOverrideData, + ): CancelablePromise { + return __request(OpenAPI, { + method: "PATCH", + url: "/api/v1/environment/feature_flags/{feature_flag_key}", + path: { + feature_flag_key: data.featureFlagKey, + }, + body: data.requestBody, + mediaType: "application/json", + errors: { + 400: "Invalid request.", + 403: "Invalid credentials.", + 429: "Request was throttled.", + }, + }); + } +} + +export class FeatureFlags { + /** + * Create Feature Flag + * Create feature flag. + * @param data The data for the request. + * @param data.requestBody Flag details. + * @returns success_response Feature flag successfully created + * @throws ApiError + */ + public static createFeatureFlag( + data: CreateFeatureFlagData, + ): CancelablePromise { + return __request(OpenAPI, { + method: "POST", + url: "/api/v1/feature_flags", + body: data.requestBody, + mediaType: "application/json", + errors: { + 400: "Invalid request.", + 403: "Invalid credentials.", + 429: "Request was throttled.", + }, + }); + } + + /** + * Delete Feature Flag + * Delete feature flag + * @param data The data for the request. + * @param data.featureFlagKey The identifier for the feature flag. + * @returns success_response Feature flag successfully updated. + * @throws ApiError + */ + public static deleteFeatureFlag( + data: DeleteFeatureFlagData, + ): CancelablePromise { + return __request(OpenAPI, { + method: "DELETE", + url: "/api/v1/feature_flags/{feature_flag_key}", + path: { + feature_flag_key: data.featureFlagKey, + }, + errors: { + 400: "Invalid request.", + 403: "Invalid credentials.", + 429: "Request was throttled.", + }, + }); + } + + /** + * Replace Feature Flag + * Update feature flag. + * @param data The data for the request. + * @param data.featureFlagKey The key identifier for the feature flag. + * @param data.name The name of the flag. + * @param data.description Description of the flag purpose. + * @param data.type The variable type + * @param data.allowOverrideLevel Allow the flag to be overridden at a different level. + * @param data.defaultValue Default value for the flag used by environments and organizations. + * @returns success_response Feature flag successfully updated. + * @throws ApiError + */ + public static updateFeatureFlag( + data: UpdateFeatureFlagData, + ): CancelablePromise { + return __request(OpenAPI, { + method: "PUT", + url: "/api/v1/feature_flags/{feature_flag_key}", + path: { + feature_flag_key: data.featureFlagKey, + }, + query: { + name: data.name, + description: data.description, + type: data.type, + allow_override_level: data.allowOverrideLevel, + default_value: data.defaultValue, + }, + errors: { + 400: "Invalid request.", + 403: "Invalid credentials.", + 429: "Request was throttled.", + }, + }); + } +} + +export class Organizations { + /** + * Get Organization + * Gets an organization given the organization's code. + * + * @param data The data for the request. + * @param data.code The organization's code. + * @returns organization Organization successfully retrieved. + * @throws ApiError + */ + public static getOrganization( + data: GetOrganizationData = {}, + ): CancelablePromise { + return __request(OpenAPI, { + method: "GET", + url: "/api/v1/organization", + query: { + code: data.code, + }, + errors: { + 400: "Bad request.", + 403: "Invalid credentials.", + 429: "Request was throttled.", + }, + }); + } + + /** + * Create Organization + * Create an organization. + * @param data The data for the request. + * @param data.requestBody Organization details. + * @returns create_organization_response Organization successfully created. + * @throws ApiError + */ + public static createOrganization( + data: CreateOrganizationData, + ): CancelablePromise { + return __request(OpenAPI, { + method: "POST", + url: "/api/v1/organization", + body: data.requestBody, + mediaType: "application/json", + errors: { + 400: "Error creating user.", + 403: "Invalid credentials.", + 429: "Request was throttled.", + 500: "Could not create organization.", + }, + }); + } + + /** + * Update Organization + * Update an organization. + * @param data The data for the request. + * @param data.orgCode The identifier for the organization. + * @param data.requestBody Organization details. + * @returns success_response Organization successfully updated. + * @throws ApiError + */ + public static updateOrganization( + data: UpdateOrganizationData, + ): CancelablePromise { + return __request(OpenAPI, { + method: "PATCH", + url: "/api/v1/organization/{org_code}", + path: { + org_code: data.orgCode, + }, + body: data.requestBody, + mediaType: "application/json", + errors: { + 400: "Error updating organization.", + 403: "Invalid credentials.", + 429: "Request was throttled.", + }, + }); + } + + /** + * Delete Organization + * Delete an organization. + * @param data The data for the request. + * @param data.orgCode The identifier for the organization. + * @returns unknown Organization successfully deleted. + * @throws ApiError + */ + public static deleteOrganization( + data: DeleteOrganizationData, + ): CancelablePromise { + return __request(OpenAPI, { + method: "DELETE", + url: "/api/v1/organization/{org_code}", + path: { + org_code: data.orgCode, + }, + errors: { + 400: "Error deleting organization.", + 403: "Invalid credentials.", + 429: "Request was throttled.", + }, + }); + } + + /** + * List Organizations + * Get a list of organizations. + * + * @param data The data for the request. + * @param data.sort Field and order to sort the result by. + * @param data.pageSize Number of results per page. Defaults to 10 if parameter not sent. + * @param data.nextToken A string to get the next page of results if there are more results. + * @returns get_organizations_response A successful response with a list of organizations or an empty list. + * @throws ApiError + */ + public static getOrganizations( + data: GetOrganizationsData = {}, + ): CancelablePromise { + return __request(OpenAPI, { + method: "GET", + url: "/api/v1/organizations", + query: { + sort: data.sort, + page_size: data.pageSize, + next_token: data.nextToken, + }, + errors: { + 403: "Invalid credentials.", + 429: "Request was throttled.", + }, + }); + } + + /** + * List Organization Users + * Get users in an organization. + * @param data The data for the request. + * @param data.orgCode The organization's code. + * @param data.sort Field and order to sort the result by. + * @param data.pageSize Number of results per page. Defaults to 10 if parameter not sent. + * @param data.nextToken A string to get the next page of results if there are more results. + * @param data.permissions Filter by user permissions comma separated (where all match) + * @param data.roles Filter by user roles comma separated (where all match) + * @returns get_organization_users_response A successful response with a list of organization users or an empty list. + * @throws ApiError + */ + public static getOrganizationUsers( + data: GetOrganizationUsersData, + ): CancelablePromise { + return __request(OpenAPI, { + method: "GET", + url: "/api/v1/organizations/{org_code}/users", + path: { + org_code: data.orgCode, + }, + query: { + sort: data.sort, + page_size: data.pageSize, + next_token: data.nextToken, + permissions: data.permissions, + roles: data.roles, + }, + errors: { + 400: "Error creating user", + 403: "Invalid credentials.", + 429: "Request was throttled.", + }, + }); + } + + /** + * Add Organization Users + * Add existing users to an organization. + * @param data The data for the request. + * @param data.orgCode The organization's code. + * @param data.requestBody + * @returns add_organization_users_response Users successfully added. + * @returns void No users added. + * @throws ApiError + */ + public static addOrganizationUsers( + data: AddOrganizationUsersData, + ): CancelablePromise { + return __request(OpenAPI, { + method: "POST", + url: "/api/v1/organizations/{org_code}/users", + path: { + org_code: data.orgCode, + }, + body: data.requestBody, + mediaType: "application/json", + errors: { + 400: "Bad request.", + 403: "Invalid credentials.", + 429: "Request was throttled.", + }, + }); + } + + /** + * Update Organization Users + * Update users that belong to an organization. + * @param data The data for the request. + * @param data.orgCode The organization's code. + * @param data.requestBody + * @returns update_organization_users_response Users successfully removed. + * @throws ApiError + */ + public static updateOrganizationUsers( + data: UpdateOrganizationUsersData, + ): CancelablePromise { + return __request(OpenAPI, { + method: "PATCH", + url: "/api/v1/organizations/{org_code}/users", + path: { + org_code: data.orgCode, + }, + body: data.requestBody, + mediaType: "application/json", + errors: { + 400: "Error updating organization user.", + 403: "Invalid credentials.", + 429: "Request was throttled.", + }, + }); + } + + /** + * List Organization User Roles + * Get roles for an organization user. + * @param data The data for the request. + * @param data.orgCode The organization's code. + * @param data.userId The user's id. + * @returns get_organizations_user_roles_response A successful response with a list of user roles. + * @throws ApiError + */ + public static getOrganizationUserRoles( + data: GetOrganizationUserRolesData, + ): CancelablePromise { + return __request(OpenAPI, { + method: "GET", + url: "/api/v1/organizations/{org_code}/users/{user_id}/roles", + path: { + org_code: data.orgCode, + user_id: data.userId, + }, + errors: { + 403: "Invalid credentials.", + 429: "Request was throttled.", + }, + }); + } + + /** + * Add Organization User Role + * Add role to an organization user. + * @param data The data for the request. + * @param data.orgCode The organization's code. + * @param data.userId The user's id. + * @param data.requestBody Role details. + * @returns success_response Role successfully added. + * @throws ApiError + */ + public static createOrganizationUserRole( + data: CreateOrganizationUserRoleData, + ): CancelablePromise { + return __request(OpenAPI, { + method: "POST", + url: "/api/v1/organizations/{org_code}/users/{user_id}/roles", + path: { + org_code: data.orgCode, + user_id: data.userId, + }, + body: data.requestBody, + mediaType: "application/json", + errors: { + 403: "Invalid credentials.", + 429: "Request was throttled.", + }, + }); + } + + /** + * Delete Organization User Role + * Delete role for an organization user. + * @param data The data for the request. + * @param data.orgCode The organization's code. + * @param data.userId The user's id. + * @param data.roleId The role id. + * @returns success_response User successfully removed. + * @throws ApiError + */ + public static deleteOrganizationUserRole( + data: DeleteOrganizationUserRoleData, + ): CancelablePromise { + return __request(OpenAPI, { + method: "DELETE", + url: "/api/v1/organizations/{org_code}/users/{user_id}/roles/{role_id}", + path: { + org_code: data.orgCode, + user_id: data.userId, + role_id: data.roleId, + }, + errors: { + 400: "Error creating user.", + 403: "Invalid credentials.", + 429: "Request was throttled.", + }, + }); + } + + /** + * List Organization User Permissions + * Get permissions for an organization user. + * @param data The data for the request. + * @param data.orgCode The organization's code. + * @param data.userId The user's id. + * @param data.expand Specify additional data to retrieve. Use "roles". + * @returns get_organizations_user_permissions_response A successful response with a list of user permissions. + * @throws ApiError + */ + public static getOrganizationUserPermissions( + data: GetOrganizationUserPermissionsData, + ): CancelablePromise { + return __request(OpenAPI, { + method: "GET", + url: "/api/v1/organizations/{org_code}/users/{user_id}/permissions", + path: { + org_code: data.orgCode, + user_id: data.userId, + }, + query: { + expand: data.expand, + }, + errors: { + 403: "Invalid credentials.", + 429: "Request was throttled.", + }, + }); + } + + /** + * Add Organization User Permission + * Add permission to an organization user. + * @param data The data for the request. + * @param data.orgCode The organization's code. + * @param data.userId The user's id. + * @param data.requestBody Permission details. + * @returns success_response User permission successfully updated. + * @throws ApiError + */ + public static createOrganizationUserPermission( + data: CreateOrganizationUserPermissionData, + ): CancelablePromise { + return __request(OpenAPI, { + method: "POST", + url: "/api/v1/organizations/{org_code}/users/{user_id}/permissions", + path: { + org_code: data.orgCode, + user_id: data.userId, + }, + body: data.requestBody, + mediaType: "application/json", + errors: { + 403: "Invalid credentials.", + 429: "Request was throttled.", + }, + }); + } + + /** + * Delete Organization User Permission + * Delete permission for an organization user. + * @param data The data for the request. + * @param data.orgCode The organization's code. + * @param data.userId The user's id. + * @param data.permissionId The permission id. + * @returns success_response User successfully removed. + * @throws ApiError + */ + public static deleteOrganizationUserPermission( + data: DeleteOrganizationUserPermissionData, + ): CancelablePromise { + return __request(OpenAPI, { + method: "DELETE", + url: "/api/v1/organizations/{org_code}/users/{user_id}/permissions/{permission_id}", + path: { + org_code: data.orgCode, + user_id: data.userId, + permission_id: data.permissionId, + }, + errors: { + 400: "Error creating user.", + 403: "Invalid credentials.", + 429: "Request was throttled.", + }, + }); + } + + /** + * Remove Organization User + * Remove user from an organization. + * @param data The data for the request. + * @param data.orgCode The organization's code. + * @param data.userId The user's id. + * @returns success_response User successfully removed from organization + * @throws ApiError + */ + public static removeOrganizationUser( + data: RemoveOrganizationUserData, + ): CancelablePromise { + return __request(OpenAPI, { + method: "DELETE", + url: "/api/v1/organizations/{org_code}/users/{user_id}", + path: { + org_code: data.orgCode, + user_id: data.userId, + }, + errors: { + 400: "Error removing user", + 403: "Invalid credentials.", + 429: "Request was throttled.", + }, + }); + } + + /** + * List Organization Feature Flags + * Get all organization feature flags. + * @param data The data for the request. + * @param data.orgCode The identifier for the organization. + * @returns get_organization_feature_flags_response Feature flag overrides successfully returned. + * @throws ApiError + */ + public static getOrganizationFeatureFlags( + data: GetOrganizationFeatureFlagsData, + ): CancelablePromise { + return __request(OpenAPI, { + method: "GET", + url: "/api/v1/organizations/{org_code}/feature_flags", + path: { + org_code: data.orgCode, + }, + errors: { + 400: "Invalid request.", + 403: "Invalid credentials.", + 429: "Request was throttled.", + }, + }); + } + + /** + * Delete Organization Feature Flag Overrides + * Delete all organization feature flag overrides. + * @param data The data for the request. + * @param data.orgCode The identifier for the organization. + * @returns success_response Feature flag overrides successfully deleted. + * @throws ApiError + */ + public static deleteOrganizationFeatureFlagOverrides( + data: DeleteOrganizationFeatureFlagOverridesData, + ): CancelablePromise { + return __request(OpenAPI, { + method: "DELETE", + url: "/api/v1/organizations/{org_code}/feature_flags", + path: { + org_code: data.orgCode, + }, + errors: { + 400: "Invalid request.", + 403: "Invalid credentials.", + 429: "Request was throttled.", + }, + }); + } + + /** + * Delete Organization Feature Flag Override + * Delete organization feature flag override. + * @param data The data for the request. + * @param data.orgCode The identifier for the organization. + * @param data.featureFlagKey The identifier for the feature flag. + * @returns success_response Feature flag override successfully deleted. + * @throws ApiError + */ + public static deleteOrganizationFeatureFlagOverride( + data: DeleteOrganizationFeatureFlagOverrideData, + ): CancelablePromise { + return __request(OpenAPI, { + method: "DELETE", + url: "/api/v1/organizations/{org_code}/feature_flags/{feature_flag_key}", + path: { + org_code: data.orgCode, + feature_flag_key: data.featureFlagKey, + }, + errors: { + 400: "Invalid request.", + 403: "Invalid credentials.", + 429: "Request was throttled.", + }, + }); + } + + /** + * Update Organization Feature Flag Override + * Update organization feature flag override. + * @param data The data for the request. + * @param data.orgCode The identifier for the organization + * @param data.featureFlagKey The identifier for the feature flag + * @param data.value Override value + * @returns success_response Feature flag override successfully updated. + * @throws ApiError + */ + public static updateOrganizationFeatureFlagOverride( + data: UpdateOrganizationFeatureFlagOverrideData, + ): CancelablePromise { + return __request(OpenAPI, { + method: "PATCH", + url: "/api/v1/organizations/{org_code}/feature_flags/{feature_flag_key}", + path: { + org_code: data.orgCode, + feature_flag_key: data.featureFlagKey, + }, + query: { + value: data.value, + }, + errors: { + 400: "Invalid request.", + 403: "Invalid credentials.", + 429: "Request was throttled.", + }, + }); + } + + /** + * Update Organization Property value + * Update organization property value. + * @param data The data for the request. + * @param data.orgCode The identifier for the organization + * @param data.propertyKey The identifier for the property + * @param data.value The new property value + * @returns success_response Property successfully updated. + * @throws ApiError + */ + public static updateOrganizationProperty( + data: UpdateOrganizationPropertyData, + ): CancelablePromise { + return __request(OpenAPI, { + method: "PUT", + url: "/api/v1/organizations/{org_code}/properties/{property_key}", + path: { + org_code: data.orgCode, + property_key: data.propertyKey, + }, + query: { + value: data.value, + }, + errors: { + 400: "Invalid request.", + 403: "Invalid credentials.", + 429: "Request was throttled.", + }, + }); + } + + /** + * Get Organization Property Values + * Gets properties for an organization by org code. + * + * @param data The data for the request. + * @param data.orgCode The organization's code. + * @returns get_property_values_response Properties successfully retrieved. + * @throws ApiError + */ + public static getOrganizationPropertyValues( + data: GetOrganizationPropertyValuesData, + ): CancelablePromise { + return __request(OpenAPI, { + method: "GET", + url: "/api/v1/organizations/{org_code}/properties", + path: { + org_code: data.orgCode, + }, + errors: { + 400: "Bad request.", + 403: "Invalid credentials.", + 429: "Request was throttled.", + }, + }); + } + + /** + * Update Organization Property values + * Update organization property values. + * @param data The data for the request. + * @param data.orgCode The identifier for the organization + * @param data.requestBody Properties to update. + * @returns success_response Properties successfully updated. + * @throws ApiError + */ + public static updateOrganizationProperties( + data: UpdateOrganizationPropertiesData, + ): CancelablePromise { + return __request(OpenAPI, { + method: "PATCH", + url: "/api/v1/organizations/{org_code}/properties", + path: { + org_code: data.orgCode, + }, + body: data.requestBody, + mediaType: "application/json", + errors: { + 400: "Invalid request.", + 403: "Invalid credentials.", + 429: "Request was throttled.", + }, + }); + } + + /** + * Delete organization handle + * Delete organization handle + * + * @param data The data for the request. + * @param data.orgCode The organization's code. + * @returns success_response Handle successfully deleted. + * @throws ApiError + */ + public static deleteOrganizationHandle( + data: DeleteOrganizationHandleData, + ): CancelablePromise { + return __request(OpenAPI, { + method: "DELETE", + url: "/api/v1/organization/{org_code}/handle", + path: { + org_code: data.orgCode, + }, + errors: { + 400: "Bad request.", + 403: "Invalid credentials.", + 429: "Request was throttled.", + }, + }); + } +} + +export class Permissions { + /** + * List Permissions + * The returned list can be sorted by permission name or permission ID in ascending or descending order. The number of records to return at a time can also be controlled using the `page_size` query string parameter. + * + * @param data The data for the request. + * @param data.sort Field and order to sort the result by. + * @param data.pageSize Number of results per page. Defaults to 10 if parameter not sent. + * @param data.nextToken A string to get the next page of results if there are more results. + * @returns get_permissions_response Permissions successfully retrieved. + * @throws ApiError + */ + public static getPermissions( + data: GetPermissionsData = {}, + ): CancelablePromise { + return __request(OpenAPI, { + method: "GET", + url: "/api/v1/permissions", + query: { + sort: data.sort, + page_size: data.pageSize, + next_token: data.nextToken, + }, + errors: { + 403: "Invalid credentials.", + 429: "Request was throttled.", + }, + }); + } + + /** + * Create Permission + * Create a new permission. + * @param data The data for the request. + * @param data.requestBody Permission details. + * @returns success_response Permission successfully created + * @throws ApiError + */ + public static createPermission( + data: CreatePermissionData = {}, + ): CancelablePromise { + return __request(OpenAPI, { + method: "POST", + url: "/api/v1/permissions", + body: data.requestBody, + mediaType: "application/json", + errors: { + 400: "Invalid request.", + 403: "Invalid credentials.", + 429: "Request was throttled.", + }, + }); + } + + /** + * Update Permission + * Update permission + * @param data The data for the request. + * @param data.permissionId The identifier for the permission. + * @param data.requestBody Permission details. + * @returns success_response Permission successfully updated + * @throws ApiError + */ + public static updatePermissions( + data: UpdatePermissionsData, + ): CancelablePromise { + return __request(OpenAPI, { + method: "PATCH", + url: "/api/v1/permissions/{permission_id}", + path: { + permission_id: data.permissionId, + }, + body: data.requestBody, + mediaType: "application/json", + errors: { + 400: "Invalid request.", + 403: "Invalid credentials.", + 429: "Request was throttled.", + }, + }); + } + + /** + * Delete Permission + * Delete permission + * @param data The data for the request. + * @param data.permissionId The identifier for the permission. + * @returns success_response permission successfully updated. + * @throws ApiError + */ + public static deletePermission( + data: DeletePermissionData, + ): CancelablePromise { + return __request(OpenAPI, { + method: "DELETE", + url: "/api/v1/permissions/{permission_id}", + path: { + permission_id: data.permissionId, + }, + errors: { + 400: "Invalid request.", + 403: "Invalid credentials.", + 429: "Request was throttled.", + }, + }); + } +} + +export class Properties { + /** + * List properties + * Returns a list of properties + * + * @param data The data for the request. + * @param data.pageSize Number of results per page. Defaults to 10 if parameter not sent. + * @param data.startingAfter The ID of the property to start after. + * @param data.endingBefore The ID of the property to end before. + * @param data.context Filter results by User or Organization context + * @returns get_properties_response Properties successfully retrieved. + * @throws ApiError + */ + public static getProperties( + data: GetPropertiesData = {}, + ): CancelablePromise { + return __request(OpenAPI, { + method: "GET", + url: "/api/v1/properties", + query: { + page_size: data.pageSize, + starting_after: data.startingAfter, + ending_before: data.endingBefore, + context: data.context, + }, + errors: { + 400: "Invalid request.", + 403: "Invalid credentials.", + 429: "Request was throttled.", + }, + }); + } + + /** + * Create Property + * Create property. + * @param data The data for the request. + * @param data.requestBody Property details. + * @returns create_property_response Property successfully created + * @throws ApiError + */ + public static createProperty( + data: CreatePropertyData, + ): CancelablePromise { + return __request(OpenAPI, { + method: "POST", + url: "/api/v1/properties", + body: data.requestBody, + mediaType: "application/json", + errors: { + 400: "Invalid request.", + 403: "Invalid credentials.", + 429: "Request was throttled.", + }, + }); + } + + /** + * Update Property + * Update property. + * @param data The data for the request. + * @param data.propertyId The unique identifier for the property. + * @param data.requestBody The fields of the property to update. + * @returns success_response Property successfully updated. + * @throws ApiError + */ + public static updateProperty( + data: UpdatePropertyData, + ): CancelablePromise { + return __request(OpenAPI, { + method: "PUT", + url: "/api/v1/properties/{property_id}", + path: { + property_id: data.propertyId, + }, + body: data.requestBody, + mediaType: "application/json", + errors: { + 400: "Invalid request.", + 403: "Invalid credentials.", + 429: "Request was throttled.", + }, + }); + } +} + +export class PropertyCategories { + /** + * List categories + * Returns a list of categories. + * + * @param data The data for the request. + * @param data.pageSize Number of results per page. Defaults to 10 if parameter not sent. + * @param data.startingAfter The ID of the category to start after. + * @param data.endingBefore The ID of the category to end before. + * @param data.context Filter the results by User or Organization context + * @returns get_categories_response Categories successfully retrieved. + * @throws ApiError + */ + public static getCategories( + data: GetCategoriesData = {}, + ): CancelablePromise { + return __request(OpenAPI, { + method: "GET", + url: "/api/v1/property_categories", + query: { + page_size: data.pageSize, + starting_after: data.startingAfter, + ending_before: data.endingBefore, + context: data.context, + }, + errors: { + 400: "Invalid request.", + 403: "Invalid credentials.", + 429: "Request was throttled.", + }, + }); + } + + /** + * Create Category + * Create category. + * @param data The data for the request. + * @param data.requestBody Category details. + * @returns create_category_response Category successfully created + * @throws ApiError + */ + public static createCategory( + data: CreateCategoryData, + ): CancelablePromise { + return __request(OpenAPI, { + method: "POST", + url: "/api/v1/property_categories", + body: data.requestBody, + mediaType: "application/json", + errors: { + 400: "Invalid request.", + 403: "Invalid credentials.", + 429: "Request was throttled.", + }, + }); + } + + /** + * Update Category + * Update category. + * @param data The data for the request. + * @param data.categoryId The unique identifier for the category. + * @param data.requestBody The fields of the category to update. + * @returns success_response category successfully updated. + * @throws ApiError + */ + public static updateCategory( + data: UpdateCategoryData, + ): CancelablePromise { + return __request(OpenAPI, { + method: "PUT", + url: "/api/v1/property_categories/{category_id}", + path: { + category_id: data.categoryId, + }, + body: data.requestBody, + mediaType: "application/json", + errors: { + 400: "Invalid request.", + 403: "Invalid credentials.", + 429: "Request was throttled.", + }, + }); + } +} + +export class Roles { + /** + * List Roles + * The returned list can be sorted by role name or role ID in ascending or descending order. The number of records to return at a time can also be controlled using the `page_size` query string parameter. + * + * @param data The data for the request. + * @param data.sort Field and order to sort the result by. + * @param data.pageSize Number of results per page. Defaults to 10 if parameter not sent. + * @param data.nextToken A string to get the next page of results if there are more results. + * @returns get_roles_response Roles successfully retrieved. + * @throws ApiError + */ + public static getRoles( + data: GetRolesData = {}, + ): CancelablePromise { + return __request(OpenAPI, { + method: "GET", + url: "/api/v1/roles", + query: { + sort: data.sort, + page_size: data.pageSize, + next_token: data.nextToken, + }, + errors: { + 403: "Invalid credentials.", + 429: "Request was throttled.", + }, + }); + } + + /** + * Create Role + * Create role. + * @param data The data for the request. + * @param data.requestBody Role details. + * @returns success_response Role successfully created + * @throws ApiError + */ + public static createRole( + data: CreateRoleData = {}, + ): CancelablePromise { + return __request(OpenAPI, { + method: "POST", + url: "/api/v1/roles", + body: data.requestBody, + mediaType: "application/json", + errors: { + 400: "Invalid request.", + 403: "Invalid credentials.", + }, + }); + } + + /** + * Get Role Permissions + * Get permissions for a role. + * @param data The data for the request. + * @param data.roleId The role's public id. + * @param data.sort Field and order to sort the result by. + * @param data.pageSize Number of results per page. Defaults to 10 if parameter not sent. + * @param data.nextToken A string to get the next page of results if there are more results. + * @returns roles_permission_response A list of permissions for a role + * @throws ApiError + */ + public static getRolePermission( + data: GetRolePermissionData, + ): CancelablePromise { + return __request(OpenAPI, { + method: "GET", + url: "/api/v1/roles/{role_id}/permissions", + path: { + role_id: data.roleId, + }, + query: { + sort: data.sort, + page_size: data.pageSize, + next_token: data.nextToken, + }, + errors: { + 400: "Error removing user", + 403: "Invalid credentials.", + 429: "Request was throttled.", + }, + }); + } + + /** + * Update Role Permissions + * Update role permissions. + * + * @param data The data for the request. + * @param data.roleId The identifier for the role. + * @param data.requestBody + * @returns update_role_permissions_response Permissions successfully updated. + * @throws ApiError + */ + public static updateRolePermissions( + data: UpdateRolePermissionsData, + ): CancelablePromise { + return __request(OpenAPI, { + method: "PATCH", + url: "/api/v1/roles/{role_id}/permissions", + path: { + role_id: data.roleId, + }, + body: data.requestBody, + mediaType: "application/json", + errors: { + 403: "Invalid credentials.", + 429: "Request was throttled.", + }, + }); + } + + /** + * Remove Role Permission + * Remove a permission from a role. + * @param data The data for the request. + * @param data.roleId The role's public id. + * @param data.permissionId The permission's public id. + * @returns success_response Permission successfully removed from role + * @throws ApiError + */ + public static removeRolePermission( + data: RemoveRolePermissionData, + ): CancelablePromise { + return __request(OpenAPI, { + method: "DELETE", + url: "/api/v1/roles/{role_id}/permissions/{permission_id}", + path: { + role_id: data.roleId, + permission_id: data.permissionId, + }, + errors: { + 400: "Error removing user", + 403: "Invalid credentials.", + 429: "Request was throttled.", + }, + }); + } + + /** + * Update Role + * Update a role + * @param data The data for the request. + * @param data.roleId The identifier for the role. + * @param data.requestBody Role details. + * @returns success_response Role successfully updated + * @throws ApiError + */ + public static updateRoles( + data: UpdateRolesData, + ): CancelablePromise { + return __request(OpenAPI, { + method: "PATCH", + url: "/api/v1/roles/{role_id}", + path: { + role_id: data.roleId, + }, + body: data.requestBody, + mediaType: "application/json", + errors: { + 400: "Invalid request.", + 403: "Invalid credentials.", + 429: "Request was throttled.", + }, + }); + } + + /** + * Delete Role + * Delete role + * @param data The data for the request. + * @param data.roleId The identifier for the role. + * @returns success_response Role successfully deleted. + * @throws ApiError + */ + public static deleteRole( + data: DeleteRoleData, + ): CancelablePromise { + return __request(OpenAPI, { + method: "DELETE", + url: "/api/v1/roles/{role_id}", + path: { + role_id: data.roleId, + }, + errors: { + 400: "Invalid request.", + 403: "Invalid credentials.", + 429: "Request was throttled.", + }, + }); + } +} + +export class Subscribers { + /** + * List Subscribers + * The returned list can be sorted by full name or email address + * in ascending or descending order. The number of records to return at a time can also be controlled using the `page_size` query + * string parameter. + * + * @param data The data for the request. + * @param data.sort Field and order to sort the result by. + * @param data.pageSize Number of results per page. Defaults to 10 if parameter not sent. + * @param data.nextToken A string to get the next page of results if there are more results. + * @returns get_subscribers_response Subscriber successfully retrieved. + * @throws ApiError + */ + public static getSubscribers( + data: GetSubscribersData = {}, + ): CancelablePromise { + return __request(OpenAPI, { + method: "GET", + url: "/api/v1/subscribers", + query: { + sort: data.sort, + page_size: data.pageSize, + next_token: data.nextToken, + }, + errors: { + 403: "Bad request.", + 429: "Request was throttled.", + }, + }); + } + + /** + * Create Subscriber + * Create subscriber. + * @param data The data for the request. + * @param data.firstName Subscriber's first name. + * @param data.lastName Subscriber's last name. + * @param data.email The email address of the subscriber. + * @returns create_subscriber_success_response Subscriber successfully created + * @throws ApiError + */ + public static createSubscriber( + data: CreateSubscriberData, + ): CancelablePromise { + return __request(OpenAPI, { + method: "POST", + url: "/api/v1/subscribers", + query: { + first_name: data.firstName, + last_name: data.lastName, + email: data.email, + }, + errors: { + 400: "Invalid request.", + 403: "Invalid credentials.", + 429: "Request was throttled.", + }, + }); + } + + /** + * Get Subscriber + * Retrieve a subscriber record. + * + * @param data The data for the request. + * @param data.subscriberId The subscriber's id. + * @returns get_subscriber_response Subscriber successfully retrieved. + * @throws ApiError + */ + public static getSubscriber( + data: GetSubscriberData, + ): CancelablePromise { + return __request(OpenAPI, { + method: "GET", + url: "/api/v1/subscribers/{subscriber_id}", + path: { + subscriber_id: data.subscriberId, + }, + errors: { + 400: "Bad request.", + 403: "Invalid credentials.", + 429: "Request was throttled.", + }, + }); + } +} + +export class Users { + /** + * List Users + * The returned list can be sorted by full name or email address in ascending or descending order. The number of records to return at a time can also be controlled using the `page_size` query string parameter. + * + * @param data The data for the request. + * @param data.pageSize Number of results per page. Defaults to 10 if parameter not sent. + * @param data.userId ID of the user to filter by. + * @param data.nextToken A string to get the next page of results if there are more results. + * @param data.email Filter the results by email address. The query string should be comma separated and url encoded. + * @param data.expand Specify additional data to retrieve. Use "organizations" and/or "identities". + * @returns users_response Users successfully retrieved. + * @throws ApiError + */ + public static getUsers( + data: GetUsersData = {}, + ): CancelablePromise { + return __request(OpenAPI, { + method: "GET", + url: "/api/v1/users", + query: { + page_size: data.pageSize, + user_id: data.userId, + next_token: data.nextToken, + email: data.email, + expand: data.expand, + }, + errors: { + 403: "Invalid credentials.", + 429: "Request was throttled.", + }, + }); + } + + /** + * Refresh User Claims and Invalidate Cache + * Refreshes the user's claims and invalidates the current cache. + * + * @param data The data for the request. + * @param data.userId The id of the user whose claims needs to be updated. + * @returns success_response Claims successfully refreshed. + * @throws ApiError + */ + public static refreshUserClaims( + data: RefreshUserClaimsData, + ): CancelablePromise { + return __request(OpenAPI, { + method: "POST", + url: "/api/v1/users/{user_id}/refresh_claims", + path: { + user_id: data.userId, + }, + errors: { + 400: "Bad request.", + 403: "Bad request.", + 429: "Request was throttled.", + }, + }); + } + + /** + * Get User + * Retrieve a user record. + * + * @param data The data for the request. + * @param data.id The user's id. + * @param data.expand Specify additional data to retrieve. Use "organizations" and/or "identities". + * @returns user User successfully updated. + * @throws ApiError + */ + public static getUserData( + data: GetUserDataData, + ): CancelablePromise { + return __request(OpenAPI, { + method: "GET", + url: "/api/v1/user", + query: { + id: data.id, + expand: data.expand, + }, + errors: { + 400: "Bad request.", + 403: "Invalid credentials.", + 429: "Request was throttled.", + }, + }); + } + + /** + * Create User + * Creates a user record and optionally zero or more identities for the user. An example identity could be the email + * address of the user. + * + * @param data The data for the request. + * @param data.requestBody The details of the user to create. + * @returns create_user_response User successfully created. + * @throws ApiError + */ + public static createUser( + data: CreateUserData = {}, + ): CancelablePromise { + return __request(OpenAPI, { + method: "POST", + url: "/api/v1/user", + body: data.requestBody, + mediaType: "application/json", + errors: { + 400: "Error creating user.", + 403: "Invalid credentials.", + 429: "Request was throttled.", + }, + }); + } + + /** + * Update User + * Update a user record. + * + * @param data The data for the request. + * @param data.id The user's id. + * @param data.requestBody The user to update. + * @returns update_user_response User successfully updated. + * @throws ApiError + */ + public static updateUser( + data: UpdateUserData, + ): CancelablePromise { + return __request(OpenAPI, { + method: "PATCH", + url: "/api/v1/user", + query: { + id: data.id, + }, + body: data.requestBody, + mediaType: "application/json", + errors: { + 400: "Bad request.", + 403: "Invalid credentials.", + 429: "Request was throttled.", + }, + }); + } + + /** + * Delete User + * Delete a user record. + * + * @param data The data for the request. + * @param data.id The user's id. + * @param data.isDeleteProfile Delete all data and remove the user's profile from all of Kinde, including the subscriber list + * @returns success_response User successfully deleted. + * @throws ApiError + */ + public static deleteUser( + data: DeleteUserData, + ): CancelablePromise { + return __request(OpenAPI, { + method: "DELETE", + url: "/api/v1/user", + query: { + id: data.id, + is_delete_profile: data.isDeleteProfile, + }, + errors: { + 400: "Bad request.", + 403: "Invalid credentials.", + 429: "Request was throttled.", + }, + }); + } + + /** + * Update User Feature Flag Override + * Update user feature flag override. + * @param data The data for the request. + * @param data.userId The identifier for the user + * @param data.featureFlagKey The identifier for the feature flag + * @param data.value Override value + * @returns success_response Feature flag override successfully updated. + * @throws ApiError + */ + public static updateUserFeatureFlagOverride( + data: UpdateUserFeatureFlagOverrideData, + ): CancelablePromise { + return __request(OpenAPI, { + method: "PATCH", + url: "/api/v1/users/{user_id}/feature_flags/{feature_flag_key}", + path: { + user_id: data.userId, + feature_flag_key: data.featureFlagKey, + }, + query: { + value: data.value, + }, + errors: { + 400: "Invalid request.", + 403: "Invalid credentials.", + 429: "Request was throttled.", + }, + }); + } + + /** + * Update Property value + * Update property value. + * @param data The data for the request. + * @param data.userId The identifier for the user + * @param data.propertyKey The identifier for the property + * @param data.value The new property value + * @returns success_response Property successfully updated. + * @throws ApiError + */ + public static updateUserProperty( + data: UpdateUserPropertyData, + ): CancelablePromise { + return __request(OpenAPI, { + method: "PUT", + url: "/api/v1/users/{user_id}/properties/{property_key}", + path: { + user_id: data.userId, + property_key: data.propertyKey, + }, + query: { + value: data.value, + }, + errors: { + 400: "Invalid request.", + 403: "Invalid credentials.", + 429: "Request was throttled.", + }, + }); + } + + /** + * Get property values + * Gets properties for an user by ID. + * + * @param data The data for the request. + * @param data.userId The user's ID. + * @returns get_property_values_response Properties successfully retrieved. + * @throws ApiError + */ + public static getUserPropertyValues( + data: GetUserPropertyValuesData, + ): CancelablePromise { + return __request(OpenAPI, { + method: "GET", + url: "/api/v1/users/{user_id}/properties", + path: { + user_id: data.userId, + }, + errors: { + 400: "Bad request.", + 403: "Invalid credentials.", + 429: "Request was throttled.", + }, + }); + } + + /** + * Update Property values + * Update property values. + * @param data The data for the request. + * @param data.userId The identifier for the user + * @param data.requestBody Properties to update. + * @returns success_response Properties successfully updated. + * @throws ApiError + */ + public static updateUserProperties( + data: UpdateUserPropertiesData, + ): CancelablePromise { + return __request(OpenAPI, { + method: "PATCH", + url: "/api/v1/users/{user_id}/properties", + path: { + user_id: data.userId, + }, + body: data.requestBody, + mediaType: "application/json", + errors: { + 400: "Invalid request.", + 403: "Invalid credentials.", + 429: "Request was throttled.", + }, + }); + } + + /** + * Set User password + * Set user password. + * @param data The data for the request. + * @param data.userId The identifier for the user + * @param data.requestBody Password details. + * @returns success_response User successfully created. + * @throws ApiError + */ + public static setUserPassword( + data: SetUserPasswordData, + ): CancelablePromise { + return __request(OpenAPI, { + method: "PUT", + url: "/api/v1/users/{user_id}/password", + path: { + user_id: data.userId, + }, + body: data.requestBody, + mediaType: "application/json", + errors: { + 400: "Error creating user.", + 403: "Invalid credentials.", + 429: "Request was throttled.", + }, + }); + } +} diff --git a/lib/api/services.ts b/lib/api/services.ts deleted file mode 100644 index fa06ce9..0000000 --- a/lib/api/services.ts +++ /dev/null @@ -1,2482 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -import type { CancelablePromise } from "./core/CancelablePromise"; -import { OpenAPI } from "./core/OpenAPI"; -import { request as __request } from "./core/request"; -import type { $OpenApiTs } from "./models"; - -export class Oauth { - /** - * Get User Profile - * Contains the id, names and email of the currently logged in user. - * - * @returns user_profile Details of logged in user V1. - * @throws ApiError - */ - public static getUser(): CancelablePromise< - $OpenApiTs["/oauth2/user_profile"]["get"]["res"][200] - > { - return __request(OpenAPI, { - method: "GET", - url: "/oauth2/user_profile", - errors: { - 403: `Invalid credentials.`, - }, - }); - } - - /** - * Get token details - * Retrieve information about the provided token. - * @returns token_introspect Details of the token. - * @throws ApiError - */ - public static tokenIntrospection( - data: $OpenApiTs["/oauth2/introspect"]["post"]["req"], - ): CancelablePromise<$OpenApiTs["/oauth2/introspect"]["post"]["res"][200]> { - const { formData } = data; - return __request(OpenAPI, { - method: "POST", - url: "/oauth2/introspect", - formData: formData, - mediaType: "application/x-www-form-urlencoded", - errors: { - 401: `Bad request.`, - 403: `Invalid credentials.`, - 429: `Request was throttled.`, - }, - }); - } - - /** - * Revoke token - * Revoke a previously issued token. - * @returns any Token successfully revoked. - * @throws ApiError - */ - public static tokenRevocation( - data: $OpenApiTs["/oauth2/revoke"]["post"]["req"], - ): CancelablePromise<$OpenApiTs["/oauth2/revoke"]["post"]["res"][200]> { - const { formData } = data; - return __request(OpenAPI, { - method: "POST", - url: "/oauth2/revoke", - formData: formData, - mediaType: "application/x-www-form-urlencoded", - errors: { - 401: `Bad request.`, - 403: `Invalid credentials.`, - 429: `Request was throttled.`, - }, - }); - } - - /** - * Returns the details of the currently logged in user - * Contains the id, names, profile picture URL and email of the currently logged in user. - * - * @returns user_profile_v2 Details of logged in user V2. - * @throws ApiError - */ - public static getUserProfileV2(): CancelablePromise< - $OpenApiTs["/oauth2/v2/user_profile"]["get"]["res"][200] - > { - return __request(OpenAPI, { - method: "GET", - url: "/oauth2/v2/user_profile", - errors: { - 403: `Invalid credentials.`, - 429: `Request was throttled.`, - }, - }); - } -} - -export class ApIs { - /** - * List APIs - * Returns a list of APIs. - * - * @returns apis APIs successfully retrieved. - * @throws ApiError - */ - public static getApIs(): CancelablePromise< - $OpenApiTs["/api/v1/apis"]["get"]["res"][200] - > { - return __request(OpenAPI, { - method: "GET", - url: "/api/v1/apis", - errors: { - 400: `Invalid request.`, - 403: `Invalid credentials.`, - 429: `Request was throttled.`, - }, - }); - } - - /** - * Add APIs - * Add APIs. - * - * @returns success_response APIs successfully updated - * @throws ApiError - */ - public static addApIs( - data: $OpenApiTs["/api/v1/apis"]["post"]["req"], - ): CancelablePromise<$OpenApiTs["/api/v1/apis"]["post"]["res"][200]> { - const { requestBody } = data; - return __request(OpenAPI, { - method: "POST", - url: "/api/v1/apis", - body: requestBody, - mediaType: "application/json", - errors: { - 400: `Invalid request.`, - 403: `Invalid credentials.`, - 429: `Request was throttled.`, - }, - }); - } - - /** - * List API details - * Returns the details of the API. - * - * @returns api API successfully retrieved. - * @throws ApiError - */ - public static getApi( - data: $OpenApiTs["/api/v1/apis/{api_id}"]["get"]["req"], - ): CancelablePromise<$OpenApiTs["/api/v1/apis/{api_id}"]["get"]["res"][200]> { - const { apiId } = data; - return __request(OpenAPI, { - method: "GET", - url: "/api/v1/apis/{api_id}", - path: { - api_id: apiId, - }, - errors: { - 400: `Invalid request.`, - 403: `Invalid credentials.`, - 429: `Request was throttled.`, - }, - }); - } - - /** - * Delete API - * Deletes API. - * - * @returns success_response API successfully deleted. - * @throws ApiError - */ - public static deleteApi( - data: $OpenApiTs["/api/v1/apis/{api_id}"]["delete"]["req"], - ): CancelablePromise< - $OpenApiTs["/api/v1/apis/{api_id}"]["delete"]["res"][200] - > { - const { apiId } = data; - return __request(OpenAPI, { - method: "DELETE", - url: "/api/v1/apis/{api_id}", - path: { - api_id: apiId, - }, - errors: { - 400: `Invalid request.`, - 403: `Invalid credentials.`, - 429: `Request was throttled.`, - }, - }); - } - - /** - * Update API Applications - * Update the applications under that API. - * - * @returns success_response API applications updated. - * @throws ApiError - */ - public static updateApiApplications( - data: $OpenApiTs["/api/v1/apis/{api_id}/applications"]["patch"]["req"], - ): CancelablePromise< - $OpenApiTs["/api/v1/apis/{api_id}/applications"]["patch"]["res"][200] - > { - const { apiId, requestBody } = data; - return __request(OpenAPI, { - method: "PATCH", - url: "/api/v1/apis/{api_id}/applications", - path: { - api_id: apiId, - }, - body: requestBody, - mediaType: "application/json", - errors: { - 400: `Invalid request.`, - 403: `Invalid credentials.`, - 429: `Request was throttled.`, - }, - }); - } -} - -export class Applications { - /** - * List Applications - * Get a list of applications. - * - * @returns get_applications_response A successful response with a list of applications or an empty list. - * @throws ApiError - */ - public static getApplications( - data: $OpenApiTs["/api/v1/applications"]["get"]["req"] = {}, - ): CancelablePromise<$OpenApiTs["/api/v1/applications"]["get"]["res"][200]> { - const { sort, pageSize, nextToken } = data; - return __request(OpenAPI, { - method: "GET", - url: "/api/v1/applications", - query: { - sort, - page_size: pageSize, - next_token: nextToken, - }, - errors: { - 403: `Invalid credentials.`, - 429: `Request was throttled.`, - }, - }); - } - - /** - * Create Application - * Create an application. - * @returns create_application_response Application successfully created. - * @throws ApiError - */ - public static createApplication( - data: $OpenApiTs["/api/v1/applications"]["post"]["req"] = {}, - ): CancelablePromise<$OpenApiTs["/api/v1/applications"]["post"]["res"][200]> { - const { requestBody } = data; - return __request(OpenAPI, { - method: "POST", - url: "/api/v1/applications", - body: requestBody, - mediaType: "application/json", - errors: { - 400: `Error creating user.`, - 403: `Invalid credentials.`, - 429: `Request was throttled.`, - }, - }); - } - - /** - * Get Application - * Gets an application given the application's id. - * - * @returns get_application_response Application successfully retrieved. - * @throws ApiError - */ - public static getApplication( - data: $OpenApiTs["/api/v1/applications/{application_id}"]["get"]["req"], - ): CancelablePromise< - $OpenApiTs["/api/v1/applications/{application_id}"]["get"]["res"][200] - > { - const { applicationId } = data; - return __request(OpenAPI, { - method: "GET", - url: "/api/v1/applications/{application_id}", - path: { - application_id: applicationId, - }, - errors: { - 400: `Bad request.`, - 403: `Invalid credentials.`, - 429: `Request was throttled.`, - }, - }); - } - - /** - * Update Application - * Update an application. - * @returns any Application successfully updated. - * @throws ApiError - */ - public static updateApplication( - data: $OpenApiTs["/api/v1/applications/{application_id}"]["patch"]["req"], - ): CancelablePromise< - $OpenApiTs["/api/v1/applications/{application_id}"]["patch"]["res"][200] - > { - const { applicationId, requestBody } = data; - return __request(OpenAPI, { - method: "PATCH", - url: "/api/v1/applications/{application_id}", - path: { - application_id: applicationId, - }, - body: requestBody, - mediaType: "application/json", - errors: { - 400: `Bad request.`, - 403: `Invalid credentials.`, - 429: `Request was throttled.`, - }, - }); - } - - /** - * Delete Application - * Delete application. - * - * @returns success_response Application successfully deleted. - * @throws ApiError - */ - public static deleteApplication( - data: $OpenApiTs["/api/v1/applications/{application_id}"]["delete"]["req"], - ): CancelablePromise< - $OpenApiTs["/api/v1/applications/{application_id}"]["delete"]["res"][200] - > { - const { applicationId } = data; - return __request(OpenAPI, { - method: "DELETE", - url: "/api/v1/applications/{application_id}", - path: { - application_id: applicationId, - }, - errors: { - 400: `Invalid request.`, - 403: `Invalid credentials.`, - 429: `Request was throttled.`, - }, - }); - } -} - -export class Business { - /** - * List business details - * Get your business details. - * @returns success_response A successful response with your business details. - * @throws ApiError - */ - public static getBusiness( - data: $OpenApiTs["/api/v1/business"]["get"]["req"], - ): CancelablePromise<$OpenApiTs["/api/v1/business"]["get"]["res"][201]> { - const { - code, - name, - email, - phone, - industry, - timezone, - privacyUrl, - termsUrl, - } = data; - return __request(OpenAPI, { - method: "GET", - url: "/api/v1/business", - query: { - code, - name, - email, - phone, - industry, - timezone, - privacy_url: privacyUrl, - terms_url: termsUrl, - }, - errors: { - 403: `Invalid credentials.`, - 429: `Request was throttled.`, - }, - }); - } - - /** - * Update business details - * Update business details. - * @returns success_response Business successfully updated. - * @throws ApiError - */ - public static updateBusiness( - data: $OpenApiTs["/api/v1/business"]["patch"]["req"], - ): CancelablePromise<$OpenApiTs["/api/v1/business"]["patch"]["res"][201]> { - const { - businessName, - primaryEmail, - primaryPhone, - industryKey, - timezoneId, - privacyUrl, - termsUrl, - isShowKindeBranding, - isClickWrap, - partnerCode, - } = data; - return __request(OpenAPI, { - method: "PATCH", - url: "/api/v1/business", - query: { - business_name: businessName, - primary_email: primaryEmail, - primary_phone: primaryPhone, - industry_key: industryKey, - timezone_id: timezoneId, - privacy_url: privacyUrl, - terms_url: termsUrl, - is_show_kinde_branding: isShowKindeBranding, - is_click_wrap: isClickWrap, - partner_code: partnerCode, - }, - errors: { - 400: `Invalid request.`, - 403: `Invalid credentials.`, - 429: `Request was throttled.`, - }, - }); - } -} - -export class Industries { - /** - * List industries and industry keys. - * Get a list of industries and associated industry keys. - * @returns success_response A successful response with a list of industries and industry keys. - * @throws ApiError - */ - public static getIndustries( - data: $OpenApiTs["/api/v1/industries"]["get"]["req"] = {}, - ): CancelablePromise<$OpenApiTs["/api/v1/industries"]["get"]["res"][201]> { - const { industryKey, name } = data; - return __request(OpenAPI, { - method: "GET", - url: "/api/v1/industries", - query: { - industry_key: industryKey, - name, - }, - errors: { - 403: `Invalid credentials.`, - 429: `Request was throttled.`, - }, - }); - } -} - -export class Timezones { - /** - * List timezones and timezone IDs. - * Get a list of timezones and associated timezone keys. - * @returns success_response A successful response with a list of timezones and timezone keys. - * @throws ApiError - */ - public static getTimezones( - data: $OpenApiTs["/api/v1/timezones"]["get"]["req"] = {}, - ): CancelablePromise<$OpenApiTs["/api/v1/timezones"]["get"]["res"][201]> { - const { timezoneKey, name } = data; - return __request(OpenAPI, { - method: "GET", - url: "/api/v1/timezones", - query: { - timezone_key: timezoneKey, - name, - }, - errors: { - 403: `Invalid credentials.`, - 429: `Request was throttled.`, - }, - }); - } -} - -export class Callbacks { - /** - * List Callback URLs - * Returns an application's redirect callback URLs. - * - * @returns redirect_callback_urls Callback URLs successfully retrieved. - * @throws ApiError - */ - public static getCallbackUrLs( - data: $OpenApiTs["/api/v1/applications/{app_id}/auth_redirect_urls"]["get"]["req"], - ): CancelablePromise< - $OpenApiTs["/api/v1/applications/{app_id}/auth_redirect_urls"]["get"]["res"][200] - > { - const { appId } = data; - return __request(OpenAPI, { - method: "GET", - url: "/api/v1/applications/{app_id}/auth_redirect_urls", - path: { - app_id: appId, - }, - errors: { - 400: `Invalid request.`, - 403: `Invalid credentials.`, - 429: `Request was throttled.`, - }, - }); - } - - /** - * Add Redirect Callback URLs - * Add additional redirect callback URLs. - * - * @returns success_response Callbacks successfully updated - * @throws ApiError - */ - public static addRedirectCallbackUrLs( - data: $OpenApiTs["/api/v1/applications/{app_id}/auth_redirect_urls"]["post"]["req"], - ): CancelablePromise< - $OpenApiTs["/api/v1/applications/{app_id}/auth_redirect_urls"]["post"]["res"][200] - > { - const { appId, requestBody } = data; - return __request(OpenAPI, { - method: "POST", - url: "/api/v1/applications/{app_id}/auth_redirect_urls", - path: { - app_id: appId, - }, - body: requestBody, - mediaType: "application/json", - errors: { - 400: `Invalid request.`, - 403: `Invalid credentials.`, - 429: `Request was throttled.`, - }, - }); - } - - /** - * Replace Redirect Callback URLs - * Replace all redirect callback URLs. - * - * @returns success_response Callbacks successfully updated - * @throws ApiError - */ - public static replaceRedirectCallbackUrLs( - data: $OpenApiTs["/api/v1/applications/{app_id}/auth_redirect_urls"]["put"]["req"], - ): CancelablePromise< - $OpenApiTs["/api/v1/applications/{app_id}/auth_redirect_urls"]["put"]["res"][200] - > { - const { appId, requestBody } = data; - return __request(OpenAPI, { - method: "PUT", - url: "/api/v1/applications/{app_id}/auth_redirect_urls", - path: { - app_id: appId, - }, - body: requestBody, - mediaType: "application/json", - errors: { - 400: `Invalid request.`, - 403: `Invalid credentials.`, - 429: `Request was throttled.`, - }, - }); - } - - /** - * Delete Callback URLs - * Delete callback URLs. - * - * @returns success_response Callback URLs successfully deleted. - * @throws ApiError - */ - public static deleteCallbackUrLs( - data: $OpenApiTs["/api/v1/applications/{app_id}/auth_redirect_urls"]["delete"]["req"], - ): CancelablePromise< - $OpenApiTs["/api/v1/applications/{app_id}/auth_redirect_urls"]["delete"]["res"][200] - > { - const { appId, urls } = data; - return __request(OpenAPI, { - method: "DELETE", - url: "/api/v1/applications/{app_id}/auth_redirect_urls", - path: { - app_id: appId, - }, - query: { - urls, - }, - errors: { - 400: `Invalid request.`, - 403: `Invalid credentials.`, - 429: `Request was throttled.`, - }, - }); - } - - /** - * List Logout URLs - * Returns an application's logout redirect URLs. - * - * @returns logout_redirect_urls Logout URLs successfully retrieved. - * @throws ApiError - */ - public static getLogoutUrLs( - data: $OpenApiTs["/api/v1/applications/{app_id}/auth_logout_urls"]["get"]["req"], - ): CancelablePromise< - $OpenApiTs["/api/v1/applications/{app_id}/auth_logout_urls"]["get"]["res"][200] - > { - const { appId } = data; - return __request(OpenAPI, { - method: "GET", - url: "/api/v1/applications/{app_id}/auth_logout_urls", - path: { - app_id: appId, - }, - errors: { - 400: `Invalid request.`, - 403: `Invalid credentials.`, - 429: `Request was throttled.`, - }, - }); - } - - /** - * Add Logout Redirect URLs - * Add additional logout redirect URLs. - * - * @returns success_response Logouts successfully updated - * @throws ApiError - */ - public static addLogoutRedirectUrLs( - data: $OpenApiTs["/api/v1/applications/{app_id}/auth_logout_urls"]["post"]["req"], - ): CancelablePromise< - $OpenApiTs["/api/v1/applications/{app_id}/auth_logout_urls"]["post"]["res"][200] - > { - const { appId, requestBody } = data; - return __request(OpenAPI, { - method: "POST", - url: "/api/v1/applications/{app_id}/auth_logout_urls", - path: { - app_id: appId, - }, - body: requestBody, - mediaType: "application/json", - errors: { - 400: `Invalid request.`, - 403: `Invalid credentials.`, - 429: `Request was throttled.`, - }, - }); - } - - /** - * Replace Logout Redirect URLs - * Replace all logout redirect URLs. - * - * @returns success_response Logout URLs successfully updated - * @throws ApiError - */ - public static replaceLogoutRedirectUrLs( - data: $OpenApiTs["/api/v1/applications/{app_id}/auth_logout_urls"]["put"]["req"], - ): CancelablePromise< - $OpenApiTs["/api/v1/applications/{app_id}/auth_logout_urls"]["put"]["res"][200] - > { - const { appId, requestBody } = data; - return __request(OpenAPI, { - method: "PUT", - url: "/api/v1/applications/{app_id}/auth_logout_urls", - path: { - app_id: appId, - }, - body: requestBody, - mediaType: "application/json", - errors: { - 400: `Invalid request.`, - 403: `Invalid credentials.`, - 429: `Request was throttled.`, - }, - }); - } - - /** - * Delete Logout URLs - * Delete logout URLs. - * - * @returns success_response Logout URLs successfully deleted. - * @throws ApiError - */ - public static deleteLogoutUrLs( - data: $OpenApiTs["/api/v1/applications/{app_id}/auth_logout_urls"]["delete"]["req"], - ): CancelablePromise< - $OpenApiTs["/api/v1/applications/{app_id}/auth_logout_urls"]["delete"]["res"][200] - > { - const { appId, urls } = data; - return __request(OpenAPI, { - method: "DELETE", - url: "/api/v1/applications/{app_id}/auth_logout_urls", - path: { - app_id: appId, - }, - query: { - urls, - }, - errors: { - 400: `Invalid request.`, - 403: `Invalid credentials.`, - 429: `Request was throttled.`, - }, - }); - } -} - -export class ConnectedApps { - /** - * Get Connected App URL - * Get a URL that authenticates and authorizes a user to a third-party connected app. - * @returns connected_apps_auth_url A URL that can be used to authenticate and a session id to identify this authentication session. - * @throws ApiError - */ - public static getConnectedAppAuthUrl( - data: $OpenApiTs["/api/v1/connected_apps/auth_url"]["get"]["req"], - ): CancelablePromise< - $OpenApiTs["/api/v1/connected_apps/auth_url"]["get"]["res"][200] - > { - const { keyCodeRef, userId, orgCode, overrideCallbackUrl } = data; - return __request(OpenAPI, { - method: "GET", - url: "/api/v1/connected_apps/auth_url", - query: { - key_code_ref: keyCodeRef, - user_id: userId, - org_code: orgCode, - override_callback_url: overrideCallbackUrl, - }, - errors: { - 400: `Error retrieving connected app auth url.`, - 403: `Invalid credentials.`, - 404: `Error retrieving connected app auth url.`, - 429: `Request was throttled.`, - }, - }); - } - - /** - * Get Connected App Token - * Get an access token that can be used to call the third-party provider linked to the connected app. - * @returns connected_apps_access_token An access token that can be used to query a third-party provider, as well as the token's expiry time. - * @throws ApiError - */ - public static getConnectedAppToken( - data: $OpenApiTs["/api/v1/connected_apps/token"]["get"]["req"], - ): CancelablePromise< - $OpenApiTs["/api/v1/connected_apps/token"]["get"]["res"][200] - > { - const { sessionId } = data; - return __request(OpenAPI, { - method: "GET", - url: "/api/v1/connected_apps/token", - query: { - session_id: sessionId, - }, - errors: { - 400: `The session id provided points to an invalid session.`, - 403: `Invalid credentials.`, - 429: `Request was throttled.`, - }, - }); - } - - /** - * Revoke Connected App Token - * Revoke the tokens linked to the connected app session. - * @returns success_response An access token that can be used to query a third-party provider, as well as the token's expiry time. - * @throws ApiError - */ - public static revokeConnectedAppToken( - data: $OpenApiTs["/api/v1/connected_apps/revoke"]["post"]["req"], - ): CancelablePromise< - $OpenApiTs["/api/v1/connected_apps/revoke"]["post"]["res"][200] - > { - const { sessionId } = data; - return __request(OpenAPI, { - method: "POST", - url: "/api/v1/connected_apps/revoke", - query: { - session_id: sessionId, - }, - errors: { - 400: `Bad request.`, - 403: `Invalid credentials.`, - 405: `Invalid HTTP method used.`, - 429: `Request was throttled.`, - }, - }); - } -} - -export class Environments { - /** - * Delete Environment Feature Flag Overrides - * Delete all environment feature flag overrides. - * @returns success_response Feature flag overrides deleted successfully. - * @throws ApiError - */ - public static deleteEnvironementFeatureFlagOverrides(): CancelablePromise< - $OpenApiTs["/api/v1/environment/feature_flags"]["delete"]["res"][200] - > { - return __request(OpenAPI, { - method: "DELETE", - url: "/api/v1/environment/feature_flags", - errors: { - 400: `Invalid request.`, - 403: `Invalid credentials.`, - 429: `Request was throttled.`, - }, - }); - } - - /** - * List Environment Feature Flags - * Get environment feature flags. - * @returns get_environment_feature_flags_response Feature flags retrieved successfully. - * @throws ApiError - */ - public static getEnvironementFeatureFlags(): CancelablePromise< - $OpenApiTs["/api/v1/environment/feature_flags"]["get"]["res"][200] - > { - return __request(OpenAPI, { - method: "GET", - url: "/api/v1/environment/feature_flags", - errors: { - 400: `Invalid request.`, - 403: `Invalid credentials.`, - 429: `Request was throttled.`, - }, - }); - } - - /** - * Delete Environment Feature Flag Override - * Delete environment feature flag override. - * @returns success_response Feature flag deleted successfully. - * @throws ApiError - */ - public static deleteEnvironementFeatureFlagOverride( - data: $OpenApiTs["/api/v1/environment/feature_flags/{feature_flag_key}"]["delete"]["req"], - ): CancelablePromise< - $OpenApiTs["/api/v1/environment/feature_flags/{feature_flag_key}"]["delete"]["res"][200] - > { - const { featureFlagKey } = data; - return __request(OpenAPI, { - method: "DELETE", - url: "/api/v1/environment/feature_flags/{feature_flag_key}", - path: { - feature_flag_key: featureFlagKey, - }, - errors: { - 400: `Invalid request.`, - 403: `Invalid credentials.`, - 429: `Request was throttled.`, - }, - }); - } - - /** - * Update Environment Feature Flag Override - * Update environment feature flag override. - * @returns success_response Feature flag override successful - * @throws ApiError - */ - public static updateEnvironementFeatureFlagOverride( - data: $OpenApiTs["/api/v1/environment/feature_flags/{feature_flag_key}"]["patch"]["req"], - ): CancelablePromise< - $OpenApiTs["/api/v1/environment/feature_flags/{feature_flag_key}"]["patch"]["res"][200] - > { - const { featureFlagKey, requestBody } = data; - return __request(OpenAPI, { - method: "PATCH", - url: "/api/v1/environment/feature_flags/{feature_flag_key}", - path: { - feature_flag_key: featureFlagKey, - }, - body: requestBody, - mediaType: "application/json", - errors: { - 400: `Invalid request.`, - 403: `Invalid credentials.`, - 429: `Request was throttled.`, - }, - }); - } -} - -export class FeatureFlags { - /** - * Create Feature Flag - * Create feature flag. - * @returns success_response Feature flag successfully created - * @throws ApiError - */ - public static createFeatureFlag( - data: $OpenApiTs["/api/v1/feature_flags"]["post"]["req"], - ): CancelablePromise< - $OpenApiTs["/api/v1/feature_flags"]["post"]["res"][201] - > { - const { requestBody } = data; - return __request(OpenAPI, { - method: "POST", - url: "/api/v1/feature_flags", - body: requestBody, - mediaType: "application/json", - errors: { - 400: `Invalid request.`, - 403: `Invalid credentials.`, - 429: `Request was throttled.`, - }, - }); - } - - /** - * Delete Feature Flag - * Delete feature flag - * @returns success_response Feature flag successfully updated. - * @throws ApiError - */ - public static deleteFeatureFlag( - data: $OpenApiTs["/api/v1/feature_flags/{feature_flag_key}"]["delete"]["req"], - ): CancelablePromise< - $OpenApiTs["/api/v1/feature_flags/{feature_flag_key}"]["delete"]["res"][200] - > { - const { featureFlagKey } = data; - return __request(OpenAPI, { - method: "DELETE", - url: "/api/v1/feature_flags/{feature_flag_key}", - path: { - feature_flag_key: featureFlagKey, - }, - errors: { - 400: `Invalid request.`, - 403: `Invalid credentials.`, - 429: `Request was throttled.`, - }, - }); - } - - /** - * Replace Feature Flag - * Update feature flag. - * @returns success_response Feature flag successfully updated. - * @throws ApiError - */ - public static updateFeatureFlag( - data: $OpenApiTs["/api/v1/feature_flags/{feature_flag_key}"]["put"]["req"], - ): CancelablePromise< - $OpenApiTs["/api/v1/feature_flags/{feature_flag_key}"]["put"]["res"][200] - > { - const { - featureFlagKey, - name, - description, - type, - allowOverrideLevel, - defaultValue, - } = data; - return __request(OpenAPI, { - method: "PUT", - url: "/api/v1/feature_flags/{feature_flag_key}", - path: { - feature_flag_key: featureFlagKey, - }, - query: { - name, - description, - type, - allow_override_level: allowOverrideLevel, - default_value: defaultValue, - }, - errors: { - 400: `Invalid request.`, - 403: `Invalid credentials.`, - 429: `Request was throttled.`, - }, - }); - } -} - -export class Organizations { - /** - * Get Organization - * Gets an organization given the organization's code. - * - * @returns organization Organization successfully retrieved. - * @throws ApiError - */ - public static getOrganization( - data: $OpenApiTs["/api/v1/organization"]["get"]["req"] = {}, - ): CancelablePromise<$OpenApiTs["/api/v1/organization"]["get"]["res"][200]> { - const { code } = data; - return __request(OpenAPI, { - method: "GET", - url: "/api/v1/organization", - query: { - code, - }, - errors: { - 400: `Bad request.`, - 403: `Invalid credentials.`, - 429: `Request was throttled.`, - }, - }); - } - - /** - * Create Organization - * Create an organization. - * @returns create_organization_response Organization successfully created. - * @throws ApiError - */ - public static createOrganization( - data: $OpenApiTs["/api/v1/organization"]["post"]["req"], - ): CancelablePromise<$OpenApiTs["/api/v1/organization"]["post"]["res"][200]> { - const { requestBody } = data; - return __request(OpenAPI, { - method: "POST", - url: "/api/v1/organization", - body: requestBody, - mediaType: "application/json", - errors: { - 400: `Error creating user.`, - 403: `Invalid credentials.`, - 429: `Request was throttled.`, - 500: `Could not create organization.`, - }, - }); - } - - /** - * Update Organization - * Update an organization. - * @returns success_response Organization successfully updated. - * @throws ApiError - */ - public static updateOrganization( - data: $OpenApiTs["/api/v1/organization/{org_code}"]["patch"]["req"], - ): CancelablePromise< - $OpenApiTs["/api/v1/organization/{org_code}"]["patch"]["res"][200] - > { - const { orgCode, requestBody } = data; - return __request(OpenAPI, { - method: "PATCH", - url: "/api/v1/organization/{org_code}", - path: { - org_code: orgCode, - }, - body: requestBody, - mediaType: "application/json", - errors: { - 400: `Error updating organization.`, - 403: `Invalid credentials.`, - 429: `Request was throttled.`, - }, - }); - } - - /** - * Delete Organization - * Delete an organization. - * @returns any Organization successfully deleted. - * @throws ApiError - */ - public static deleteOrganization( - data: $OpenApiTs["/api/v1/organization/{org_code}"]["delete"]["req"], - ): CancelablePromise< - $OpenApiTs["/api/v1/organization/{org_code}"]["delete"]["res"][200] - > { - const { orgCode } = data; - return __request(OpenAPI, { - method: "DELETE", - url: "/api/v1/organization/{org_code}", - path: { - org_code: orgCode, - }, - errors: { - 400: `Error deleting organization.`, - 403: `Invalid credentials.`, - 429: `Request was throttled.`, - }, - }); - } - - /** - * List Organizations - * Get a list of organizations. - * - * @returns get_organizations_response A successful response with a list of organizations or an empty list. - * @throws ApiError - */ - public static getOrganizations( - data: $OpenApiTs["/api/v1/organizations"]["get"]["req"] = {}, - ): CancelablePromise<$OpenApiTs["/api/v1/organizations"]["get"]["res"][200]> { - const { sort, pageSize, nextToken } = data; - return __request(OpenAPI, { - method: "GET", - url: "/api/v1/organizations", - query: { - sort, - page_size: pageSize, - next_token: nextToken, - }, - errors: { - 403: `Invalid credentials.`, - 429: `Request was throttled.`, - }, - }); - } - - /** - * List Organization Users - * Get users in an organization. - * @returns get_organization_users_response A successful response with a list of organization users or an empty list. - * @throws ApiError - */ - public static getOrganizationUsers( - data: $OpenApiTs["/api/v1/organizations/{org_code}/users"]["get"]["req"], - ): CancelablePromise< - $OpenApiTs["/api/v1/organizations/{org_code}/users"]["get"]["res"][200] - > { - const { orgCode, sort, pageSize, nextToken, permissions, roles } = data; - return __request(OpenAPI, { - method: "GET", - url: "/api/v1/organizations/{org_code}/users", - path: { - org_code: orgCode, - }, - query: { - sort, - page_size: pageSize, - next_token: nextToken, - permissions, - roles, - }, - errors: { - 400: `Error creating user`, - 403: `Invalid credentials.`, - 429: `Request was throttled.`, - }, - }); - } - - /** - * Add Organization Users - * Add existing users to an organization. - * @returns add_organization_users_response Users successfully added. - * @returns void No users added. - * @throws ApiError - */ - public static addOrganizationUsers( - data: $OpenApiTs["/api/v1/organizations/{org_code}/users"]["post"]["req"], - ): CancelablePromise< - | $OpenApiTs["/api/v1/organizations/{org_code}/users"]["post"]["res"][200] - | $OpenApiTs["/api/v1/organizations/{org_code}/users"]["post"]["res"][204] - > { - const { orgCode, requestBody } = data; - return __request(OpenAPI, { - method: "POST", - url: "/api/v1/organizations/{org_code}/users", - path: { - org_code: orgCode, - }, - body: requestBody, - mediaType: "application/json", - errors: { - 400: `Bad request.`, - 403: `Invalid credentials.`, - 429: `Request was throttled.`, - }, - }); - } - - /** - * Update Organization Users - * Update users that belong to an organization. - * @returns update_organization_users_response Users successfully removed. - * @throws ApiError - */ - public static updateOrganizationUsers( - data: $OpenApiTs["/api/v1/organizations/{org_code}/users"]["patch"]["req"], - ): CancelablePromise< - $OpenApiTs["/api/v1/organizations/{org_code}/users"]["patch"]["res"][200] - > { - const { orgCode, requestBody } = data; - return __request(OpenAPI, { - method: "PATCH", - url: "/api/v1/organizations/{org_code}/users", - path: { - org_code: orgCode, - }, - body: requestBody, - mediaType: "application/json", - errors: { - 400: `Error updating organization user.`, - 403: `Invalid credentials.`, - 429: `Request was throttled.`, - }, - }); - } - - /** - * List Organization User Roles - * Get roles for an organization user. - * @returns get_organizations_user_roles_response A successful response with a list of user roles. - * @throws ApiError - */ - public static getOrganizationUserRoles( - data: $OpenApiTs["/api/v1/organizations/{org_code}/users/{user_id}/roles"]["get"]["req"], - ): CancelablePromise< - $OpenApiTs["/api/v1/organizations/{org_code}/users/{user_id}/roles"]["get"]["res"][200] - > { - const { orgCode, userId } = data; - return __request(OpenAPI, { - method: "GET", - url: "/api/v1/organizations/{org_code}/users/{user_id}/roles", - path: { - org_code: orgCode, - user_id: userId, - }, - errors: { - 403: `Invalid credentials.`, - 429: `Request was throttled.`, - }, - }); - } - - /** - * Add Organization User Role - * Add role to an organization user. - * @returns success_response Role successfully added. - * @throws ApiError - */ - public static createOrganizationUserRole( - data: $OpenApiTs["/api/v1/organizations/{org_code}/users/{user_id}/roles"]["post"]["req"], - ): CancelablePromise< - $OpenApiTs["/api/v1/organizations/{org_code}/users/{user_id}/roles"]["post"]["res"][200] - > { - const { orgCode, userId, requestBody } = data; - return __request(OpenAPI, { - method: "POST", - url: "/api/v1/organizations/{org_code}/users/{user_id}/roles", - path: { - org_code: orgCode, - user_id: userId, - }, - body: requestBody, - mediaType: "application/json", - errors: { - 403: `Invalid credentials.`, - 429: `Request was throttled.`, - }, - }); - } - - /** - * Delete Organization User Role - * Delete role for an organization user. - * @returns success_response User successfully removed. - * @throws ApiError - */ - public static deleteOrganizationUserRole( - data: $OpenApiTs["/api/v1/organizations/{org_code}/users/{user_id}/roles/{role_id}"]["delete"]["req"], - ): CancelablePromise< - $OpenApiTs["/api/v1/organizations/{org_code}/users/{user_id}/roles/{role_id}"]["delete"]["res"][200] - > { - const { orgCode, userId, roleId } = data; - return __request(OpenAPI, { - method: "DELETE", - url: "/api/v1/organizations/{org_code}/users/{user_id}/roles/{role_id}", - path: { - org_code: orgCode, - user_id: userId, - role_id: roleId, - }, - errors: { - 400: `Error creating user.`, - 403: `Invalid credentials.`, - 429: `Request was throttled.`, - }, - }); - } - - /** - * List Organization User Permissions - * Get permissions for an organization user. - * @returns get_organizations_user_permissions_response A successful response with a list of user permissions. - * @throws ApiError - */ - public static getOrganizationUserPermissions( - data: $OpenApiTs["/api/v1/organizations/{org_code}/users/{user_id}/permissions"]["get"]["req"], - ): CancelablePromise< - $OpenApiTs["/api/v1/organizations/{org_code}/users/{user_id}/permissions"]["get"]["res"][200] - > { - const { orgCode, userId, expand } = data; - return __request(OpenAPI, { - method: "GET", - url: "/api/v1/organizations/{org_code}/users/{user_id}/permissions", - path: { - org_code: orgCode, - user_id: userId, - }, - query: { - expand, - }, - errors: { - 403: `Invalid credentials.`, - 429: `Request was throttled.`, - }, - }); - } - - /** - * Add Organization User Permission - * Add permission to an organization user. - * @returns success_response User permission successfully updated. - * @throws ApiError - */ - public static createOrganizationUserPermission( - data: $OpenApiTs["/api/v1/organizations/{org_code}/users/{user_id}/permissions"]["post"]["req"], - ): CancelablePromise< - $OpenApiTs["/api/v1/organizations/{org_code}/users/{user_id}/permissions"]["post"]["res"][200] - > { - const { orgCode, userId, requestBody } = data; - return __request(OpenAPI, { - method: "POST", - url: "/api/v1/organizations/{org_code}/users/{user_id}/permissions", - path: { - org_code: orgCode, - user_id: userId, - }, - body: requestBody, - mediaType: "application/json", - errors: { - 403: `Invalid credentials.`, - 429: `Request was throttled.`, - }, - }); - } - - /** - * Delete Organization User Permission - * Delete permission for an organization user. - * @returns success_response User successfully removed. - * @throws ApiError - */ - public static deleteOrganizationUserPermission( - data: $OpenApiTs["/api/v1/organizations/{org_code}/users/{user_id}/permissions/{permission_id}"]["delete"]["req"], - ): CancelablePromise< - $OpenApiTs["/api/v1/organizations/{org_code}/users/{user_id}/permissions/{permission_id}"]["delete"]["res"][200] - > { - const { orgCode, userId, permissionId } = data; - return __request(OpenAPI, { - method: "DELETE", - url: "/api/v1/organizations/{org_code}/users/{user_id}/permissions/{permission_id}", - path: { - org_code: orgCode, - user_id: userId, - permission_id: permissionId, - }, - errors: { - 400: `Error creating user.`, - 403: `Invalid credentials.`, - 429: `Request was throttled.`, - }, - }); - } - - /** - * Remove Organization User - * Remove user from an organization. - * @returns success_response User successfully removed from organization - * @throws ApiError - */ - public static removeOrganizationUser( - data: $OpenApiTs["/api/v1/organizations/{org_code}/users/{user_id}"]["delete"]["req"], - ): CancelablePromise< - $OpenApiTs["/api/v1/organizations/{org_code}/users/{user_id}"]["delete"]["res"][200] - > { - const { orgCode, userId } = data; - return __request(OpenAPI, { - method: "DELETE", - url: "/api/v1/organizations/{org_code}/users/{user_id}", - path: { - org_code: orgCode, - user_id: userId, - }, - errors: { - 400: `Error removing user`, - 403: `Invalid credentials.`, - 429: `Request was throttled.`, - }, - }); - } - - /** - * List Organization Feature Flags - * Get all organization feature flags. - * @returns get_organization_feature_flags_response Feature flag overrides successfully returned. - * @throws ApiError - */ - public static getOrganizationFeatureFlags( - data: $OpenApiTs["/api/v1/organizations/{org_code}/feature_flags"]["get"]["req"], - ): CancelablePromise< - $OpenApiTs["/api/v1/organizations/{org_code}/feature_flags"]["get"]["res"][200] - > { - const { orgCode } = data; - return __request(OpenAPI, { - method: "GET", - url: "/api/v1/organizations/{org_code}/feature_flags", - path: { - org_code: orgCode, - }, - errors: { - 400: `Invalid request.`, - 403: `Invalid credentials.`, - 429: `Request was throttled.`, - }, - }); - } - - /** - * Delete Organization Feature Flag Overrides - * Delete all organization feature flag overrides. - * @returns success_response Feature flag overrides successfully deleted. - * @throws ApiError - */ - public static deleteOrganizationFeatureFlagOverrides( - data: $OpenApiTs["/api/v1/organizations/{org_code}/feature_flags"]["delete"]["req"], - ): CancelablePromise< - $OpenApiTs["/api/v1/organizations/{org_code}/feature_flags"]["delete"]["res"][200] - > { - const { orgCode } = data; - return __request(OpenAPI, { - method: "DELETE", - url: "/api/v1/organizations/{org_code}/feature_flags", - path: { - org_code: orgCode, - }, - errors: { - 400: `Invalid request.`, - 403: `Invalid credentials.`, - 429: `Request was throttled.`, - }, - }); - } - - /** - * Delete Organization Feature Flag Override - * Delete organization feature flag override. - * @returns success_response Feature flag override successfully deleted. - * @throws ApiError - */ - public static deleteOrganizationFeatureFlagOverride( - data: $OpenApiTs["/api/v1/organizations/{org_code}/feature_flags/{feature_flag_key}"]["delete"]["req"], - ): CancelablePromise< - $OpenApiTs["/api/v1/organizations/{org_code}/feature_flags/{feature_flag_key}"]["delete"]["res"][200] - > { - const { orgCode, featureFlagKey } = data; - return __request(OpenAPI, { - method: "DELETE", - url: "/api/v1/organizations/{org_code}/feature_flags/{feature_flag_key}", - path: { - org_code: orgCode, - feature_flag_key: featureFlagKey, - }, - errors: { - 400: `Invalid request.`, - 403: `Invalid credentials.`, - 429: `Request was throttled.`, - }, - }); - } - - /** - * Update Organization Feature Flag Override - * Update organization feature flag override. - * @returns success_response Feature flag override successfully updated. - * @throws ApiError - */ - public static updateOrganizationFeatureFlagOverride( - data: $OpenApiTs["/api/v1/organizations/{org_code}/feature_flags/{feature_flag_key}"]["patch"]["req"], - ): CancelablePromise< - $OpenApiTs["/api/v1/organizations/{org_code}/feature_flags/{feature_flag_key}"]["patch"]["res"][200] - > { - const { orgCode, featureFlagKey, value } = data; - return __request(OpenAPI, { - method: "PATCH", - url: "/api/v1/organizations/{org_code}/feature_flags/{feature_flag_key}", - path: { - org_code: orgCode, - feature_flag_key: featureFlagKey, - }, - query: { - value, - }, - errors: { - 400: `Invalid request.`, - 403: `Invalid credentials.`, - 429: `Request was throttled.`, - }, - }); - } - - /** - * Update Organization Property value - * Update organization property value. - * @returns success_response Property successfully updated. - * @throws ApiError - */ - public static updateOrganizationProperty( - data: $OpenApiTs["/api/v1/organizations/{org_code}/properties/{property_key}"]["put"]["req"], - ): CancelablePromise< - $OpenApiTs["/api/v1/organizations/{org_code}/properties/{property_key}"]["put"]["res"][200] - > { - const { orgCode, propertyKey, value } = data; - return __request(OpenAPI, { - method: "PUT", - url: "/api/v1/organizations/{org_code}/properties/{property_key}", - path: { - org_code: orgCode, - property_key: propertyKey, - }, - query: { - value, - }, - errors: { - 400: `Invalid request.`, - 403: `Invalid credentials.`, - 429: `Request was throttled.`, - }, - }); - } - - /** - * Get Organization Property Values - * Gets properties for an organization by org code. - * - * @returns get_property_values_response Properties successfully retrieved. - * @throws ApiError - */ - public static getOrganizationPropertyValues( - data: $OpenApiTs["/api/v1/organizations/{org_code}/properties"]["get"]["req"], - ): CancelablePromise< - $OpenApiTs["/api/v1/organizations/{org_code}/properties"]["get"]["res"][200] - > { - const { orgCode } = data; - return __request(OpenAPI, { - method: "GET", - url: "/api/v1/organizations/{org_code}/properties", - path: { - org_code: orgCode, - }, - errors: { - 400: `Bad request.`, - 403: `Invalid credentials.`, - 429: `Request was throttled.`, - }, - }); - } - - /** - * Update Organization Property values - * Update organization property values. - * @returns success_response Properties successfully updated. - * @throws ApiError - */ - public static updateOrganizationProperties( - data: $OpenApiTs["/api/v1/organizations/{org_code}/properties"]["patch"]["req"], - ): CancelablePromise< - $OpenApiTs["/api/v1/organizations/{org_code}/properties"]["patch"]["res"][200] - > { - const { orgCode, requestBody } = data; - return __request(OpenAPI, { - method: "PATCH", - url: "/api/v1/organizations/{org_code}/properties", - path: { - org_code: orgCode, - }, - body: requestBody, - mediaType: "application/json", - errors: { - 400: `Invalid request.`, - 403: `Invalid credentials.`, - 429: `Request was throttled.`, - }, - }); - } - - /** - * Delete organization handle - * Delete organization handle - * - * @returns success_response Handle successfully deleted. - * @throws ApiError - */ - public static deleteOrganizationHandle( - data: $OpenApiTs["/api/v1/organization/{org_code}/handle"]["delete"]["req"], - ): CancelablePromise< - $OpenApiTs["/api/v1/organization/{org_code}/handle"]["delete"]["res"][200] - > { - const { orgCode } = data; - return __request(OpenAPI, { - method: "DELETE", - url: "/api/v1/organization/{org_code}/handle", - path: { - org_code: orgCode, - }, - errors: { - 400: `Bad request.`, - 403: `Invalid credentials.`, - 429: `Request was throttled.`, - }, - }); - } -} - -export class Permissions { - /** - * List Permissions - * The returned list can be sorted by permission name or permission ID in ascending or descending order. The number of records to return at a time can also be controlled using the `page_size` query string parameter. - * - * @returns get_permissions_response Permissions successfully retrieved. - * @throws ApiError - */ - public static getPermissions( - data: $OpenApiTs["/api/v1/permissions"]["get"]["req"] = {}, - ): CancelablePromise<$OpenApiTs["/api/v1/permissions"]["get"]["res"][200]> { - const { sort, pageSize, nextToken } = data; - return __request(OpenAPI, { - method: "GET", - url: "/api/v1/permissions", - query: { - sort, - page_size: pageSize, - next_token: nextToken, - }, - errors: { - 403: `Invalid credentials.`, - 429: `Request was throttled.`, - }, - }); - } - - /** - * Create Permission - * Create a new permission. - * @returns success_response Permission successfully created - * @throws ApiError - */ - public static createPermission( - data: $OpenApiTs["/api/v1/permissions"]["post"]["req"] = {}, - ): CancelablePromise<$OpenApiTs["/api/v1/permissions"]["post"]["res"][201]> { - const { requestBody } = data; - return __request(OpenAPI, { - method: "POST", - url: "/api/v1/permissions", - body: requestBody, - mediaType: "application/json", - errors: { - 400: `Invalid request.`, - 403: `Invalid credentials.`, - 429: `Request was throttled.`, - }, - }); - } - - /** - * Update Permission - * Update permission - * @returns success_response Permission successfully updated - * @throws ApiError - */ - public static updatePermissions( - data: $OpenApiTs["/api/v1/permissions/{permission_id}"]["patch"]["req"], - ): CancelablePromise< - $OpenApiTs["/api/v1/permissions/{permission_id}"]["patch"]["res"][201] - > { - const { permissionId, requestBody } = data; - return __request(OpenAPI, { - method: "PATCH", - url: "/api/v1/permissions/{permission_id}", - path: { - permission_id: permissionId, - }, - body: requestBody, - mediaType: "application/json", - errors: { - 400: `Invalid request.`, - 403: `Invalid credentials.`, - 429: `Request was throttled.`, - }, - }); - } - - /** - * Delete Permission - * Delete permission - * @returns success_response permission successfully updated. - * @throws ApiError - */ - public static deletePermission( - data: $OpenApiTs["/api/v1/permissions/{permission_id}"]["delete"]["req"], - ): CancelablePromise< - $OpenApiTs["/api/v1/permissions/{permission_id}"]["delete"]["res"][200] - > { - const { permissionId } = data; - return __request(OpenAPI, { - method: "DELETE", - url: "/api/v1/permissions/{permission_id}", - path: { - permission_id: permissionId, - }, - errors: { - 400: `Invalid request.`, - 403: `Invalid credentials.`, - 429: `Request was throttled.`, - }, - }); - } -} - -export class Properties { - /** - * List properties - * Returns a list of properties - * - * @returns get_properties_response Properties successfully retrieved. - * @throws ApiError - */ - public static getProperties( - data: $OpenApiTs["/api/v1/properties"]["get"]["req"] = {}, - ): CancelablePromise<$OpenApiTs["/api/v1/properties"]["get"]["res"][200]> { - const { pageSize, startingAfter, endingBefore, context } = data; - return __request(OpenAPI, { - method: "GET", - url: "/api/v1/properties", - query: { - page_size: pageSize, - starting_after: startingAfter, - ending_before: endingBefore, - context, - }, - errors: { - 400: `Invalid request.`, - 403: `Invalid credentials.`, - 429: `Request was throttled.`, - }, - }); - } - - /** - * Create Property - * Create property. - * @returns create_property_response Property successfully created - * @throws ApiError - */ - public static createProperty( - data: $OpenApiTs["/api/v1/properties"]["post"]["req"], - ): CancelablePromise<$OpenApiTs["/api/v1/properties"]["post"]["res"][201]> { - const { requestBody } = data; - return __request(OpenAPI, { - method: "POST", - url: "/api/v1/properties", - body: requestBody, - mediaType: "application/json", - errors: { - 400: `Invalid request.`, - 403: `Invalid credentials.`, - 429: `Request was throttled.`, - }, - }); - } - - /** - * Update Property - * Update property. - * @returns success_response Property successfully updated. - * @throws ApiError - */ - public static updateProperty( - data: $OpenApiTs["/api/v1/properties/{property_id}"]["put"]["req"], - ): CancelablePromise< - $OpenApiTs["/api/v1/properties/{property_id}"]["put"]["res"][200] - > { - const { propertyId, requestBody } = data; - return __request(OpenAPI, { - method: "PUT", - url: "/api/v1/properties/{property_id}", - path: { - property_id: propertyId, - }, - body: requestBody, - mediaType: "application/json", - errors: { - 400: `Invalid request.`, - 403: `Invalid credentials.`, - 429: `Request was throttled.`, - }, - }); - } -} - -export class PropertyCategories { - /** - * List categories - * Returns a list of categories. - * - * @returns get_categories_response Categories successfully retrieved. - * @throws ApiError - */ - public static getCategories( - data: $OpenApiTs["/api/v1/property_categories"]["get"]["req"] = {}, - ): CancelablePromise< - $OpenApiTs["/api/v1/property_categories"]["get"]["res"][200] - > { - const { pageSize, startingAfter, endingBefore, context } = data; - return __request(OpenAPI, { - method: "GET", - url: "/api/v1/property_categories", - query: { - page_size: pageSize, - starting_after: startingAfter, - ending_before: endingBefore, - context, - }, - errors: { - 400: `Invalid request.`, - 403: `Invalid credentials.`, - 429: `Request was throttled.`, - }, - }); - } - - /** - * Create Category - * Create category. - * @returns create_category_response Category successfully created - * @throws ApiError - */ - public static createCategory( - data: $OpenApiTs["/api/v1/property_categories"]["post"]["req"], - ): CancelablePromise< - $OpenApiTs["/api/v1/property_categories"]["post"]["res"][201] - > { - const { requestBody } = data; - return __request(OpenAPI, { - method: "POST", - url: "/api/v1/property_categories", - body: requestBody, - mediaType: "application/json", - errors: { - 400: `Invalid request.`, - 403: `Invalid credentials.`, - 429: `Request was throttled.`, - }, - }); - } - - /** - * Update Category - * Update category. - * @returns success_response category successfully updated. - * @throws ApiError - */ - public static updateCategory( - data: $OpenApiTs["/api/v1/property_categories/{category_id}"]["put"]["req"], - ): CancelablePromise< - $OpenApiTs["/api/v1/property_categories/{category_id}"]["put"]["res"][200] - > { - const { categoryId, requestBody } = data; - return __request(OpenAPI, { - method: "PUT", - url: "/api/v1/property_categories/{category_id}", - path: { - category_id: categoryId, - }, - body: requestBody, - mediaType: "application/json", - errors: { - 400: `Invalid request.`, - 403: `Invalid credentials.`, - 429: `Request was throttled.`, - }, - }); - } -} - -export class Roles { - /** - * List Roles - * The returned list can be sorted by role name or role ID in ascending or descending order. The number of records to return at a time can also be controlled using the `page_size` query string parameter. - * - * @returns get_roles_response Roles successfully retrieved. - * @throws ApiError - */ - public static getRoles( - data: $OpenApiTs["/api/v1/roles"]["get"]["req"] = {}, - ): CancelablePromise<$OpenApiTs["/api/v1/roles"]["get"]["res"][200]> { - const { sort, pageSize, nextToken } = data; - return __request(OpenAPI, { - method: "GET", - url: "/api/v1/roles", - query: { - sort, - page_size: pageSize, - next_token: nextToken, - }, - errors: { - 403: `Invalid credentials.`, - 429: `Request was throttled.`, - }, - }); - } - - /** - * Create Role - * Create role. - * @returns success_response Role successfully created - * @throws ApiError - */ - public static createRole( - data: $OpenApiTs["/api/v1/roles"]["post"]["req"] = {}, - ): CancelablePromise<$OpenApiTs["/api/v1/roles"]["post"]["res"][201]> { - const { requestBody } = data; - return __request(OpenAPI, { - method: "POST", - url: "/api/v1/roles", - body: requestBody, - mediaType: "application/json", - errors: { - 400: `Invalid request.`, - 403: `Invalid credentials.`, - }, - }); - } - - /** - * Get Role Permissions - * Get permissions for a role. - * @returns roles_permission_response A list of permissions for a role - * @throws ApiError - */ - public static getRolePermission( - data: $OpenApiTs["/api/v1/roles/{role_id}/permissions"]["get"]["req"], - ): CancelablePromise< - $OpenApiTs["/api/v1/roles/{role_id}/permissions"]["get"]["res"][200] - > { - const { roleId, sort, pageSize, nextToken } = data; - return __request(OpenAPI, { - method: "GET", - url: "/api/v1/roles/{role_id}/permissions", - path: { - role_id: roleId, - }, - query: { - sort, - page_size: pageSize, - next_token: nextToken, - }, - errors: { - 400: `Error removing user`, - 403: `Invalid credentials.`, - 429: `Request was throttled.`, - }, - }); - } - - /** - * Update Role Permissions - * Update role permissions. - * - * @returns update_role_permissions_response Permissions successfully updated. - * @throws ApiError - */ - public static updateRolePermissions( - data: $OpenApiTs["/api/v1/roles/{role_id}/permissions"]["patch"]["req"], - ): CancelablePromise< - $OpenApiTs["/api/v1/roles/{role_id}/permissions"]["patch"]["res"][200] - > { - const { roleId, requestBody } = data; - return __request(OpenAPI, { - method: "PATCH", - url: "/api/v1/roles/{role_id}/permissions", - path: { - role_id: roleId, - }, - body: requestBody, - mediaType: "application/json", - errors: { - 403: `Invalid credentials.`, - 429: `Request was throttled.`, - }, - }); - } - - /** - * Remove Role Permission - * Remove a permission from a role. - * @returns success_response Permission successfully removed from role - * @throws ApiError - */ - public static removeRolePermission( - data: $OpenApiTs["/api/v1/roles/{role_id}/permissions/{permission_id}"]["delete"]["req"], - ): CancelablePromise< - $OpenApiTs["/api/v1/roles/{role_id}/permissions/{permission_id}"]["delete"]["res"][200] - > { - const { roleId, permissionId } = data; - return __request(OpenAPI, { - method: "DELETE", - url: "/api/v1/roles/{role_id}/permissions/{permission_id}", - path: { - role_id: roleId, - permission_id: permissionId, - }, - errors: { - 400: `Error removing user`, - 403: `Invalid credentials.`, - 429: `Request was throttled.`, - }, - }); - } - - /** - * Update Role - * Update a role - * @returns success_response Role successfully updated - * @throws ApiError - */ - public static updateRoles( - data: $OpenApiTs["/api/v1/roles/{role_id}"]["patch"]["req"], - ): CancelablePromise< - $OpenApiTs["/api/v1/roles/{role_id}"]["patch"]["res"][201] - > { - const { roleId, requestBody } = data; - return __request(OpenAPI, { - method: "PATCH", - url: "/api/v1/roles/{role_id}", - path: { - role_id: roleId, - }, - body: requestBody, - mediaType: "application/json", - errors: { - 400: `Invalid request.`, - 403: `Invalid credentials.`, - 429: `Request was throttled.`, - }, - }); - } - - /** - * Delete Role - * Delete role - * @returns success_response Role successfully deleted. - * @throws ApiError - */ - public static deleteRole( - data: $OpenApiTs["/api/v1/roles/{role_id}"]["delete"]["req"], - ): CancelablePromise< - $OpenApiTs["/api/v1/roles/{role_id}"]["delete"]["res"][200] - > { - const { roleId } = data; - return __request(OpenAPI, { - method: "DELETE", - url: "/api/v1/roles/{role_id}", - path: { - role_id: roleId, - }, - errors: { - 400: `Invalid request.`, - 403: `Invalid credentials.`, - 429: `Request was throttled.`, - }, - }); - } -} - -export class Subscribers { - /** - * List Subscribers - * The returned list can be sorted by full name or email address - * in ascending or descending order. The number of records to return at a time can also be controlled using the `page_size` query - * string parameter. - * - * @returns get_subscribers_response Subscriber successfully retrieved. - * @throws ApiError - */ - public static getSubscribers( - data: $OpenApiTs["/api/v1/subscribers"]["get"]["req"] = {}, - ): CancelablePromise<$OpenApiTs["/api/v1/subscribers"]["get"]["res"][200]> { - const { sort, pageSize, nextToken } = data; - return __request(OpenAPI, { - method: "GET", - url: "/api/v1/subscribers", - query: { - sort, - page_size: pageSize, - next_token: nextToken, - }, - errors: { - 403: `Bad request.`, - 429: `Request was throttled.`, - }, - }); - } - - /** - * Create Subscriber - * Create subscriber. - * @returns create_subscriber_success_response Subscriber successfully created - * @throws ApiError - */ - public static createSubscriber( - data: $OpenApiTs["/api/v1/subscribers"]["post"]["req"], - ): CancelablePromise<$OpenApiTs["/api/v1/subscribers"]["post"]["res"][201]> { - const { firstName, lastName, email } = data; - return __request(OpenAPI, { - method: "POST", - url: "/api/v1/subscribers", - query: { - first_name: firstName, - last_name: lastName, - email, - }, - errors: { - 400: `Invalid request.`, - 403: `Invalid credentials.`, - 429: `Request was throttled.`, - }, - }); - } - - /** - * Get Subscriber - * Retrieve a subscriber record. - * - * @returns get_subscriber_response Subscriber successfully retrieved. - * @throws ApiError - */ - public static getSubscriber( - data: $OpenApiTs["/api/v1/subscribers/{subscriber_id}"]["get"]["req"], - ): CancelablePromise< - $OpenApiTs["/api/v1/subscribers/{subscriber_id}"]["get"]["res"][200] - > { - const { subscriberId } = data; - return __request(OpenAPI, { - method: "GET", - url: "/api/v1/subscribers/{subscriber_id}", - path: { - subscriber_id: subscriberId, - }, - errors: { - 400: `Bad request.`, - 403: `Invalid credentials.`, - 429: `Request was throttled.`, - }, - }); - } -} - -export class Users { - /** - * List Users - * The returned list can be sorted by full name or email address in ascending or descending order. The number of records to return at a time can also be controlled using the `page_size` query string parameter. - * - * @returns users_response Users successfully retrieved. - * @throws ApiError - */ - public static getUsers( - data: $OpenApiTs["/api/v1/users"]["get"]["req"] = {}, - ): CancelablePromise<$OpenApiTs["/api/v1/users"]["get"]["res"][200]> { - const { pageSize, userId, nextToken, email, expand } = data; - return __request(OpenAPI, { - method: "GET", - url: "/api/v1/users", - query: { - page_size: pageSize, - user_id: userId, - next_token: nextToken, - email, - expand, - }, - errors: { - 403: `Invalid credentials.`, - 429: `Request was throttled.`, - }, - }); - } - - /** - * Refresh User Claims and Invalidate Cache - * Refreshes the user's claims and invalidates the current cache. - * - * @returns success_response Claims successfully refreshed. - * @throws ApiError - */ - public static refreshUserClaims( - data: $OpenApiTs["/api/v1/users/{user_id}/refresh_claims"]["post"]["req"], - ): CancelablePromise< - $OpenApiTs["/api/v1/users/{user_id}/refresh_claims"]["post"]["res"][200] - > { - const { userId } = data; - return __request(OpenAPI, { - method: "POST", - url: "/api/v1/users/{user_id}/refresh_claims", - path: { - user_id: userId, - }, - errors: { - 400: `Bad request.`, - 403: `Bad request.`, - 429: `Request was throttled.`, - }, - }); - } - - /** - * Get User - * Retrieve a user record. - * - * @returns user User successfully updated. - * @throws ApiError - */ - public static getUserData( - data: $OpenApiTs["/api/v1/user"]["get"]["req"], - ): CancelablePromise<$OpenApiTs["/api/v1/user"]["get"]["res"][200]> { - const { id, expand } = data; - return __request(OpenAPI, { - method: "GET", - url: "/api/v1/user", - query: { - id, - expand, - }, - errors: { - 400: `Bad request.`, - 403: `Invalid credentials.`, - 429: `Request was throttled.`, - }, - }); - } - - /** - * Create User - * Creates a user record and optionally zero or more identities for the user. An example identity could be the email - * address of the user. - * - * @returns create_user_response User successfully created. - * @throws ApiError - */ - public static createUser( - data: $OpenApiTs["/api/v1/user"]["post"]["req"] = {}, - ): CancelablePromise<$OpenApiTs["/api/v1/user"]["post"]["res"][200]> { - const { requestBody } = data; - return __request(OpenAPI, { - method: "POST", - url: "/api/v1/user", - body: requestBody, - mediaType: "application/json", - errors: { - 400: `Error creating user.`, - 403: `Invalid credentials.`, - 429: `Request was throttled.`, - }, - }); - } - - /** - * Update User - * Update a user record. - * - * @returns update_user_response User successfully updated. - * @throws ApiError - */ - public static updateUser( - data: $OpenApiTs["/api/v1/user"]["patch"]["req"], - ): CancelablePromise<$OpenApiTs["/api/v1/user"]["patch"]["res"][200]> { - const { id, requestBody } = data; - return __request(OpenAPI, { - method: "PATCH", - url: "/api/v1/user", - query: { - id, - }, - body: requestBody, - mediaType: "application/json", - errors: { - 400: `Bad request.`, - 403: `Invalid credentials.`, - 429: `Request was throttled.`, - }, - }); - } - - /** - * Delete User - * Delete a user record. - * - * @returns success_response User successfully deleted. - * @throws ApiError - */ - public static deleteUser( - data: $OpenApiTs["/api/v1/user"]["delete"]["req"], - ): CancelablePromise<$OpenApiTs["/api/v1/user"]["delete"]["res"][200]> { - const { id, isDeleteProfile } = data; - return __request(OpenAPI, { - method: "DELETE", - url: "/api/v1/user", - query: { - id, - is_delete_profile: isDeleteProfile, - }, - errors: { - 400: `Bad request.`, - 403: `Invalid credentials.`, - 429: `Request was throttled.`, - }, - }); - } - - /** - * Update User Feature Flag Override - * Update user feature flag override. - * @returns success_response Feature flag override successfully updated. - * @throws ApiError - */ - public static updateUserFeatureFlagOverride( - data: $OpenApiTs["/api/v1/users/{user_id}/feature_flags/{feature_flag_key}"]["patch"]["req"], - ): CancelablePromise< - $OpenApiTs["/api/v1/users/{user_id}/feature_flags/{feature_flag_key}"]["patch"]["res"][200] - > { - const { userId, featureFlagKey, value } = data; - return __request(OpenAPI, { - method: "PATCH", - url: "/api/v1/users/{user_id}/feature_flags/{feature_flag_key}", - path: { - user_id: userId, - feature_flag_key: featureFlagKey, - }, - query: { - value, - }, - errors: { - 400: `Invalid request.`, - 403: `Invalid credentials.`, - 429: `Request was throttled.`, - }, - }); - } - - /** - * Update Property value - * Update property value. - * @returns success_response Property successfully updated. - * @throws ApiError - */ - public static updateUserProperty( - data: $OpenApiTs["/api/v1/users/{user_id}/properties/{property_key}"]["put"]["req"], - ): CancelablePromise< - $OpenApiTs["/api/v1/users/{user_id}/properties/{property_key}"]["put"]["res"][200] - > { - const { userId, propertyKey, value } = data; - return __request(OpenAPI, { - method: "PUT", - url: "/api/v1/users/{user_id}/properties/{property_key}", - path: { - user_id: userId, - property_key: propertyKey, - }, - query: { - value, - }, - errors: { - 400: `Invalid request.`, - 403: `Invalid credentials.`, - 429: `Request was throttled.`, - }, - }); - } - - /** - * Get property values - * Gets properties for an user by ID. - * - * @returns get_property_values_response Properties successfully retrieved. - * @throws ApiError - */ - public static getUserPropertyValues( - data: $OpenApiTs["/api/v1/users/{user_id}/properties"]["get"]["req"], - ): CancelablePromise< - $OpenApiTs["/api/v1/users/{user_id}/properties"]["get"]["res"][200] - > { - const { userId } = data; - return __request(OpenAPI, { - method: "GET", - url: "/api/v1/users/{user_id}/properties", - path: { - user_id: userId, - }, - errors: { - 400: `Bad request.`, - 403: `Invalid credentials.`, - 429: `Request was throttled.`, - }, - }); - } - - /** - * Update Property values - * Update property values. - * @returns success_response Properties successfully updated. - * @throws ApiError - */ - public static updateUserProperties( - data: $OpenApiTs["/api/v1/users/{user_id}/properties"]["patch"]["req"], - ): CancelablePromise< - $OpenApiTs["/api/v1/users/{user_id}/properties"]["patch"]["res"][200] - > { - const { userId, requestBody } = data; - return __request(OpenAPI, { - method: "PATCH", - url: "/api/v1/users/{user_id}/properties", - path: { - user_id: userId, - }, - body: requestBody, - mediaType: "application/json", - errors: { - 400: `Invalid request.`, - 403: `Invalid credentials.`, - 429: `Request was throttled.`, - }, - }); - } - - /** - * Set User password - * Set user password. - * @returns success_response User successfully created. - * @throws ApiError - */ - public static setUserPassword( - data: $OpenApiTs["/api/v1/users/{user_id}/password"]["put"]["req"], - ): CancelablePromise< - $OpenApiTs["/api/v1/users/{user_id}/password"]["put"]["res"][200] - > { - const { userId, requestBody } = data; - return __request(OpenAPI, { - method: "PUT", - url: "/api/v1/users/{user_id}/password", - path: { - user_id: userId, - }, - body: requestBody, - mediaType: "application/json", - errors: { - 400: `Error creating user.`, - 403: `Invalid credentials.`, - 429: `Request was throttled.`, - }, - }); - } -} diff --git a/lib/api/models.ts b/lib/api/types.gen.ts similarity index 54% rename from lib/api/models.ts rename to lib/api/types.gen.ts index 86e9f18..55647db 100644 --- a/lib/api/models.ts +++ b/lib/api/types.gen.ts @@ -610,13 +610,12 @@ export type get_organization_feature_flags_response = { /** * The environment's feature flag settings. */ - feature_flags?: Record< - string, - { + feature_flags?: { + [key: string]: { type?: "str" | "int" | "bool"; value?: string; - } - >; + }; + }; }; export type get_environment_feature_flags_response = { @@ -631,13 +630,12 @@ export type get_environment_feature_flags_response = { /** * The environment's feature flag settings. */ - feature_flags?: Record< - string, - { + feature_flags?: { + [key: string]: { type?: "str" | "int" | "bool"; value?: string; - } - >; + }; + }; /** * Pagination token. */ @@ -918,39 +916,1732 @@ export type api = { }>; }; -export type $OpenApiTs = { - "/oauth2/user_profile": { - get: { - res: { - /** - * Details of logged in user V1. - */ - 200: user_profile; - }; - }; +export type GetUserResponse = user_profile; + +export type TokenIntrospectionData = { + /** + * Token details. + */ + formData: { + /** + * The token to be introspected. + */ + token?: string; + /** + * The provided token's type. + */ + token_type?: string; }; - "/oauth2/introspect": { - post: { - req: { - /** - * Token details. - */ - formData: { - /** - * The token to be introspected. - */ - token?: string; - /** - * The provided token's type. - */ - token_type?: string; - }; - }; - res: { +}; + +export type TokenIntrospectionResponse = token_introspect; + +export type TokenRevocationData = { + /** + * Details of the token to be revoked. + */ + formData: { + /** + * The token to be revoked. + */ + token?: string; + /** + * The identifier for your client. + */ + client_id?: string; + /** + * The secret associated with your client. + */ + client_secret?: string; + }; +}; + +export type TokenRevocationResponse = unknown; + +export type GetUserProfileV2Response = user_profile_v2; + +export type GetApIsResponse = apis; + +export type AddApIsData = { + /** + * API details. + */ + requestBody: { + name: string; + audience: string; + }; +}; + +export type AddApIsResponse = success_response; + +export type GetApiData = { + /** + * The API's id. + */ + apiId: string; +}; + +export type GetApiResponse = api; + +export type DeleteApiData = { + /** + * The API's id. + */ + apiId: string; +}; + +export type DeleteApiResponse = success_response; + +export type UpdateApiApplicationsData = { + /** + * The identifier for the API. + */ + apiId: string; + /** + * The applications you want to connect or disconnect. + */ + requestBody: { + applications: Array<{ + /** + * The application's id. + */ + id: string; + /** + * Optional operation, set to 'delete' to remove the user from the organization. + */ + operation?: string; + }>; + }; +}; + +export type UpdateApiApplicationsResponse = success_response; + +export type GetApplicationsData = { + /** + * A string to get the next page of results if there are more results. + */ + nextToken?: string | null; + /** + * Number of results per page. Defaults to 10 if parameter not sent. + */ + pageSize?: number | null; + /** + * Field and order to sort the result by. + */ + sort?: "name_asc" | "name_desc" | null; +}; + +export type GetApplicationsResponse = get_applications_response; + +export type CreateApplicationData = { + /** + * Application details. + */ + requestBody?: { + /** + * The application's name. + */ + name?: string; + /** + * The application's type. + */ + type?: "reg" | "spa" | "m2m"; + }; +}; + +export type CreateApplicationResponse = create_application_response; + +export type GetApplicationData = { + /** + * The identifier for the application. + */ + applicationId: string; +}; + +export type GetApplicationResponse = get_application_response; + +export type UpdateApplicationData = { + /** + * The identifier for the application. + */ + applicationId: string; + /** + * Application details. + */ + requestBody?: { + /** + * The application's name. + */ + name?: string; + /** + * The application's language key. + */ + language_key?: string; + /** + * The application's logout uris. + */ + logout_uris?: Array; + /** + * The application's redirect uris. + */ + redirect_uris?: Array; + }; +}; + +export type UpdateApplicationResponse = unknown; + +export type DeleteApplicationData = { + /** + * The identifier for the application. + */ + applicationId: string; +}; + +export type DeleteApplicationResponse = success_response; + +export type GetBusinessData = { + /** + * Business code. + */ + code: string; + /** + * Email associated with business. + */ + email: string; + /** + * The industry your business is in. + */ + industry?: string; + /** + * Business name. + */ + name: string; + /** + * Phone number associated with business. + */ + phone?: string | null; + /** + * Your Privacy policy URL. + */ + privacyUrl?: string | null; + /** + * Your Terms and Conditions URL. + */ + termsUrl?: string | null; + /** + * The timezone your business is in. + */ + timezone?: string; +}; + +export type GetBusinessResponse = success_response; + +export type UpdateBusinessData = { + /** + * Business name. + */ + businessName: string; + /** + * The key of the industry your business is in. + */ + industryKey?: string; + /** + * Show a policy acceptance checkbox on sign up. + */ + isClickWrap?: boolean | null; + /** + * Display "Powered by Kinde" on your sign up, sign in, and subscription pages. + */ + isShowKindeBranding?: string | null; + /** + * Your Kinde Perk code. + */ + partnerCode?: string | null; + /** + * Email associated with business. + */ + primaryEmail: string; + /** + * Phone number associated with business. + */ + primaryPhone?: string | null; + /** + * Your Privacy policy URL. + */ + privacyUrl?: string | null; + /** + * Your Terms and Conditions URL. + */ + termsUrl?: string | null; + /** + * The ID of the timezone your business is in. + */ + timezoneId?: string; +}; + +export type UpdateBusinessResponse = success_response; + +export type GetIndustriesData = { + /** + * Industry Key. + */ + industryKey?: string; + /** + * Industry name. + */ + name?: string; +}; + +export type GetIndustriesResponse = success_response; + +export type GetTimezonesData = { + /** + * Timezone. + */ + name?: string; + /** + * Timezone Key. + */ + timezoneKey?: string; +}; + +export type GetTimezonesResponse = success_response; + +export type GetCallbackUrLsData = { + /** + * The identifier for the application. + */ + appId: string; +}; + +export type GetCallbackUrLsResponse = redirect_callback_urls; + +export type AddRedirectCallbackUrLsData = { + /** + * The identifier for the application. + */ + appId: string; + /** + * Callback details. + */ + requestBody: { + /** + * Array of callback urls. + */ + urls?: Array; + }; +}; + +export type AddRedirectCallbackUrLsResponse = success_response; + +export type ReplaceRedirectCallbackUrLsData = { + /** + * The identifier for the application. + */ + appId: string; + /** + * Callback details. + */ + requestBody: { + /** + * Array of callback urls. + */ + urls?: Array; + }; +}; + +export type ReplaceRedirectCallbackUrLsResponse = success_response; + +export type DeleteCallbackUrLsData = { + /** + * The identifier for the application. + */ + appId: string; + /** + * Urls to delete, comma separated and url encoded. + */ + urls: string; +}; + +export type DeleteCallbackUrLsResponse = success_response; + +export type GetLogoutUrLsData = { + /** + * The identifier for the application. + */ + appId: string; +}; + +export type GetLogoutUrLsResponse = logout_redirect_urls; + +export type AddLogoutRedirectUrLsData = { + /** + * The identifier for the application. + */ + appId: string; + /** + * Callback details. + */ + requestBody: { + /** + * Array of logout urls. + */ + urls?: Array; + }; +}; + +export type AddLogoutRedirectUrLsResponse = success_response; + +export type ReplaceLogoutRedirectUrLsData = { + /** + * The identifier for the application. + */ + appId: string; + /** + * Callback details. + */ + requestBody: { + /** + * Array of logout urls. + */ + urls?: Array; + }; +}; + +export type ReplaceLogoutRedirectUrLsResponse = success_response; + +export type DeleteLogoutUrLsData = { + /** + * The identifier for the application. + */ + appId: string; + /** + * Urls to delete, comma separated and url encoded. + */ + urls: string; +}; + +export type DeleteLogoutUrLsResponse = success_response; + +export type GetConnectedAppAuthUrlData = { + /** + * The unique key code reference of the connected app to authenticate against. + */ + keyCodeRef: string; + /** + * The code of the Kinde organization that needs to authenticate to the third-party connected app. + */ + orgCode?: string; + /** + * A URL that overrides the default callback URL setup in your connected app configuration + */ + overrideCallbackUrl?: string; + /** + * The id of the user that needs to authenticate to the third-party connected app. + */ + userId?: string; +}; + +export type GetConnectedAppAuthUrlResponse = connected_apps_auth_url; + +export type GetConnectedAppTokenData = { + /** + * The unique sesssion id reprensenting the login session of a user. + */ + sessionId: string; +}; + +export type GetConnectedAppTokenResponse = connected_apps_access_token; + +export type RevokeConnectedAppTokenData = { + /** + * The unique sesssion id reprensenting the login session of a user. + */ + sessionId: string; +}; + +export type RevokeConnectedAppTokenResponse = success_response; + +export type DeleteEnvironementFeatureFlagOverridesResponse = success_response; + +export type GetEnvironementFeatureFlagsResponse = + get_environment_feature_flags_response; + +export type DeleteEnvironementFeatureFlagOverrideData = { + /** + * The identifier for the feature flag. + */ + featureFlagKey: string; +}; + +export type DeleteEnvironementFeatureFlagOverrideResponse = success_response; + +export type UpdateEnvironementFeatureFlagOverrideData = { + /** + * The identifier for the feature flag. + */ + featureFlagKey: string; + /** + * Flag details. + */ + requestBody: { + /** + * The flag override value. + */ + value: string; + }; +}; + +export type UpdateEnvironementFeatureFlagOverrideResponse = success_response; + +export type CreateFeatureFlagData = { + /** + * Flag details. + */ + requestBody: { + /** + * The name of the flag. + */ + name: string; + /** + * Description of the flag purpose. + */ + description?: string; + /** + * The flag identifier to use in code. + */ + key: string; + /** + * The variable type. + */ + type: "str" | "int" | "bool"; + /** + * Allow the flag to be overridden at a different level. + */ + allow_override_level?: "env" | "org" | "usr"; + /** + * Default value for the flag used by environments and organizations. + */ + default_value: string; + }; +}; + +export type CreateFeatureFlagResponse = success_response; + +export type DeleteFeatureFlagData = { + /** + * The identifier for the feature flag. + */ + featureFlagKey: string; +}; + +export type DeleteFeatureFlagResponse = success_response; + +export type UpdateFeatureFlagData = { + /** + * Allow the flag to be overridden at a different level. + */ + allowOverrideLevel: "env" | "org"; + /** + * Default value for the flag used by environments and organizations. + */ + defaultValue: string; + /** + * Description of the flag purpose. + */ + description: string; + /** + * The key identifier for the feature flag. + */ + featureFlagKey: string; + /** + * The name of the flag. + */ + name: string; + /** + * The variable type + */ + type: "str" | "int" | "bool"; +}; + +export type UpdateFeatureFlagResponse = success_response; + +export type GetOrganizationData = { + /** + * The organization's code. + */ + code?: string; +}; + +export type GetOrganizationResponse = organization; + +export type CreateOrganizationData = { + /** + * Organization details. + */ + requestBody: { + /** + * The organization's name. + */ + name: string; + /** + * The organization's feature flag settings. + */ + feature_flags?: { + [key: string]: "str" | "int" | "bool"; + }; + /** + * The organization's ID. + */ + external_id?: string; + /** + * The organization's brand settings - background color. + */ + background_color?: string; + /** + * The organization's brand settings - button color. + */ + button_color?: string; + /** + * The organization's brand settings - button text color. + */ + button_text_color?: string; + /** + * The organization's brand settings - link color. + */ + link_color?: string; + /** + * The organization's brand settings - dark mode background color. + */ + background_color_dark?: string; + /** + * The organization's brand settings - dark mode button color. + */ + button_color_dark?: string; + /** + * The organization's brand settings - dark mode button text color. + */ + button_text_color_dark?: string; + /** + * The organization's brand settings - dark mode link color. + */ + link_color_dark?: string; + /** + * The organization's brand settings - theme/mode 'light' | 'dark' | 'user_preference'. + */ + theme_code?: string; + /** + * The organization's handle. + */ + handle?: string; + /** + * Users can sign up to this organization. + */ + is_allow_registrations?: boolean; + }; +}; + +export type CreateOrganizationResponse = create_organization_response; + +export type UpdateOrganizationData = { + /** + * The identifier for the organization. + */ + orgCode: string; + /** + * Organization details. + */ + requestBody?: { + /** + * The organization's name. + */ + name?: string; + /** + * The organization's ID. + */ + external_id?: string; + /** + * The organization's brand settings - background color. + */ + background_color?: string; + /** + * The organization's brand settings - button color. + */ + button_color?: string; + /** + * The organization's brand settings - button text color. + */ + button_text_color?: string; + /** + * The organization's brand settings - link color. + */ + link_color?: string; + /** + * The organization's brand settings - dark mode background color. + */ + background_color_dark?: string; + /** + * The organization's brand settings - dark mode button color. + */ + button_color_dark?: string; + /** + * The organization's brand settings - dark mode button text color. + */ + button_text_color_dark?: string; + /** + * The organization's brand settings - dark mode link color. + */ + link_color_dark?: string; + /** + * The organization's brand settings - theme/mode 'light' | 'dark' | 'user_preference'. + */ + theme_code?: string; + /** + * The organization's handle. + */ + handle?: string; + /** + * Users can sign up to this organization. + */ + is_allow_registrations?: boolean; + }; +}; + +export type UpdateOrganizationResponse = success_response; + +export type DeleteOrganizationData = { + /** + * The identifier for the organization. + */ + orgCode: string; +}; + +export type DeleteOrganizationResponse = unknown; + +export type GetOrganizationsData = { + /** + * A string to get the next page of results if there are more results. + */ + nextToken?: string | null; + /** + * Number of results per page. Defaults to 10 if parameter not sent. + */ + pageSize?: number | null; + /** + * Field and order to sort the result by. + */ + sort?: "name_asc" | "name_desc" | "email_asc" | "email_desc" | null; +}; + +export type GetOrganizationsResponse = get_organizations_response; + +export type GetOrganizationUsersData = { + /** + * A string to get the next page of results if there are more results. + */ + nextToken?: string | null; + /** + * The organization's code. + */ + orgCode: string; + /** + * Number of results per page. Defaults to 10 if parameter not sent. + */ + pageSize?: number | null; + /** + * Filter by user permissions comma separated (where all match) + */ + permissions?: string; + /** + * Filter by user roles comma separated (where all match) + */ + roles?: string; + /** + * Field and order to sort the result by. + */ + sort?: "name_asc" | "name_desc" | "email_asc" | "email_desc" | null; +}; + +export type GetOrganizationUsersResponse = get_organization_users_response; + +export type AddOrganizationUsersData = { + /** + * The organization's code. + */ + orgCode: string; + requestBody?: { + /** + * Users to be added to the organization. + */ + users?: Array<{ + /** + * The users id. + */ + id?: string; + /** + * Role keys to assign to the user. + */ + roles?: Array; + /** + * Permission keys to assign to the user. + */ + permissions?: Array; + }>; + }; +}; + +export type AddOrganizationUsersResponse = + add_organization_users_response | void; + +export type UpdateOrganizationUsersData = { + /** + * The organization's code. + */ + orgCode: string; + requestBody?: { + /** + * Users to add, update or remove from the organization. + */ + users?: Array<{ + /** + * The users id. + */ + id?: string; + /** + * Optional operation, set to 'delete' to remove the user from the organization. + */ + operation?: string; + /** + * Role keys to assign to the user. + */ + roles?: Array; + /** + * Permission keys to assign to the user. + */ + permissions?: Array; + }>; + }; +}; + +export type UpdateOrganizationUsersResponse = + update_organization_users_response; + +export type GetOrganizationUserRolesData = { + /** + * The organization's code. + */ + orgCode: string; + /** + * The user's id. + */ + userId: string; +}; + +export type GetOrganizationUserRolesResponse = + get_organizations_user_roles_response; + +export type CreateOrganizationUserRoleData = { + /** + * The organization's code. + */ + orgCode: string; + /** + * Role details. + */ + requestBody: { + /** + * The role id. + */ + role_id?: string; + }; + /** + * The user's id. + */ + userId: string; +}; + +export type CreateOrganizationUserRoleResponse = success_response; + +export type DeleteOrganizationUserRoleData = { + /** + * The organization's code. + */ + orgCode: string; + /** + * The role id. + */ + roleId: string; + /** + * The user's id. + */ + userId: string; +}; + +export type DeleteOrganizationUserRoleResponse = success_response; + +export type GetOrganizationUserPermissionsData = { + /** + * Specify additional data to retrieve. Use "roles". + */ + expand?: string | null; + /** + * The organization's code. + */ + orgCode: string; + /** + * The user's id. + */ + userId: string; +}; + +export type GetOrganizationUserPermissionsResponse = + get_organizations_user_permissions_response; + +export type CreateOrganizationUserPermissionData = { + /** + * The organization's code. + */ + orgCode: string; + /** + * Permission details. + */ + requestBody: { + /** + * The permission id. + */ + permission_id?: string; + }; + /** + * The user's id. + */ + userId: string; +}; + +export type CreateOrganizationUserPermissionResponse = success_response; + +export type DeleteOrganizationUserPermissionData = { + /** + * The organization's code. + */ + orgCode: string; + /** + * The permission id. + */ + permissionId: string; + /** + * The user's id. + */ + userId: string; +}; + +export type DeleteOrganizationUserPermissionResponse = success_response; + +export type RemoveOrganizationUserData = { + /** + * The organization's code. + */ + orgCode: string; + /** + * The user's id. + */ + userId: string; +}; + +export type RemoveOrganizationUserResponse = success_response; + +export type GetOrganizationFeatureFlagsData = { + /** + * The identifier for the organization. + */ + orgCode: string; +}; + +export type GetOrganizationFeatureFlagsResponse = + get_organization_feature_flags_response; + +export type DeleteOrganizationFeatureFlagOverridesData = { + /** + * The identifier for the organization. + */ + orgCode: string; +}; + +export type DeleteOrganizationFeatureFlagOverridesResponse = success_response; + +export type DeleteOrganizationFeatureFlagOverrideData = { + /** + * The identifier for the feature flag. + */ + featureFlagKey: string; + /** + * The identifier for the organization. + */ + orgCode: string; +}; + +export type DeleteOrganizationFeatureFlagOverrideResponse = success_response; + +export type UpdateOrganizationFeatureFlagOverrideData = { + /** + * The identifier for the feature flag + */ + featureFlagKey: string; + /** + * The identifier for the organization + */ + orgCode: string; + /** + * Override value + */ + value: string; +}; + +export type UpdateOrganizationFeatureFlagOverrideResponse = success_response; + +export type UpdateOrganizationPropertyData = { + /** + * The identifier for the organization + */ + orgCode: string; + /** + * The identifier for the property + */ + propertyKey: string; + /** + * The new property value + */ + value: string; +}; + +export type UpdateOrganizationPropertyResponse = success_response; + +export type GetOrganizationPropertyValuesData = { + /** + * The organization's code. + */ + orgCode: string; +}; + +export type GetOrganizationPropertyValuesResponse = + get_property_values_response; + +export type UpdateOrganizationPropertiesData = { + /** + * The identifier for the organization + */ + orgCode: string; + /** + * Properties to update. + */ + requestBody: { + /** + * Property keys and values + */ + properties: { + [key: string]: unknown; + }; + }; +}; + +export type UpdateOrganizationPropertiesResponse = success_response; + +export type DeleteOrganizationHandleData = { + /** + * The organization's code. + */ + orgCode: string; +}; + +export type DeleteOrganizationHandleResponse = success_response; + +export type GetPermissionsData = { + /** + * A string to get the next page of results if there are more results. + */ + nextToken?: string | null; + /** + * Number of results per page. Defaults to 10 if parameter not sent. + */ + pageSize?: number | null; + /** + * Field and order to sort the result by. + */ + sort?: "name_asc" | "name_desc" | "id_asc" | "id_desc" | null; +}; + +export type GetPermissionsResponse = get_permissions_response; + +export type CreatePermissionData = { + /** + * Permission details. + */ + requestBody?: { + /** + * The permission's name. + */ + name?: string; + /** + * The permission's description. + */ + description?: string; + /** + * The permission identifier to use in code. + */ + key?: string; + }; +}; + +export type CreatePermissionResponse = success_response; + +export type UpdatePermissionsData = { + /** + * The identifier for the permission. + */ + permissionId: number; + /** + * Permission details. + */ + requestBody?: { + /** + * The permission's name. + */ + name?: string; + /** + * The permission's description. + */ + description?: string; + /** + * The permission identifier to use in code. + */ + key?: string; + }; +}; + +export type UpdatePermissionsResponse = success_response; + +export type DeletePermissionData = { + /** + * The identifier for the permission. + */ + permissionId: string; +}; + +export type DeletePermissionResponse = success_response; + +export type GetPropertiesData = { + /** + * Filter results by User or Organization context + */ + context?: "usr" | "org" | null; + /** + * The ID of the property to end before. + */ + endingBefore?: string | null; + /** + * Number of results per page. Defaults to 10 if parameter not sent. + */ + pageSize?: number | null; + /** + * The ID of the property to start after. + */ + startingAfter?: string | null; +}; + +export type GetPropertiesResponse = get_properties_response; + +export type CreatePropertyData = { + /** + * Property details. + */ + requestBody: { + /** + * The name of the property. + */ + name: string; + /** + * Description of the property purpose. + */ + description?: string; + /** + * The property identifier to use in code. + */ + key: string; + /** + * The property type. + */ + type: "single_line_text" | "multi_line_text"; + /** + * The context that the property applies to. + */ + context: "org" | "usr"; + /** + * Whether the property can be included in id and access tokens. + */ + is_private: boolean; + /** + * Which category the property belongs to. + */ + category_id: string; + }; +}; + +export type CreatePropertyResponse = create_property_response; + +export type UpdatePropertyData = { + /** + * The unique identifier for the property. + */ + propertyId: string; + /** + * The fields of the property to update. + */ + requestBody: { + /** + * The name of the property. + */ + name?: string; + /** + * Description of the property purpose. + */ + description?: string; + /** + * Whether the property can be included in id and access tokens. + */ + is_private?: boolean; + }; +}; + +export type UpdatePropertyResponse = success_response; + +export type GetCategoriesData = { + /** + * Filter the results by User or Organization context + */ + context?: "usr" | "org" | null; + /** + * The ID of the category to end before. + */ + endingBefore?: string | null; + /** + * Number of results per page. Defaults to 10 if parameter not sent. + */ + pageSize?: number | null; + /** + * The ID of the category to start after. + */ + startingAfter?: string | null; +}; + +export type GetCategoriesResponse = get_categories_response; + +export type CreateCategoryData = { + /** + * Category details. + */ + requestBody: { + /** + * The name of the category. + */ + name: string; + /** + * The context that the category applies to. + */ + context: "org" | "usr"; + }; +}; + +export type CreateCategoryResponse = create_category_response; + +export type UpdateCategoryData = { + /** + * The unique identifier for the category. + */ + categoryId: string; + /** + * The fields of the category to update. + */ + requestBody: { + /** + * The name of the category. + */ + name?: string; + }; +}; + +export type UpdateCategoryResponse = success_response; + +export type GetRolesData = { + /** + * A string to get the next page of results if there are more results. + */ + nextToken?: string | null; + /** + * Number of results per page. Defaults to 10 if parameter not sent. + */ + pageSize?: number | null; + /** + * Field and order to sort the result by. + */ + sort?: "name_asc" | "name_desc" | "id_asc" | "id_desc" | null; +}; + +export type GetRolesResponse = get_roles_response; + +export type CreateRoleData = { + /** + * Role details. + */ + requestBody?: { + /** + * The role's name. + */ + name?: string; + /** + * The role's description. + */ + description?: string; + /** + * The role identifier to use in code. + */ + key?: string; + /** + * Set role as default for new users. + */ + is_default_role?: boolean; + }; +}; + +export type CreateRoleResponse = success_response; + +export type GetRolePermissionData = { + /** + * A string to get the next page of results if there are more results. + */ + nextToken?: string | null; + /** + * Number of results per page. Defaults to 10 if parameter not sent. + */ + pageSize?: number | null; + /** + * The role's public id. + */ + roleId: string; + /** + * Field and order to sort the result by. + */ + sort?: "name_asc" | "name_desc" | "id_asc" | "id_desc" | null; +}; + +export type GetRolePermissionResponse = roles_permission_response; + +export type UpdateRolePermissionsData = { + requestBody: { + /** + * Permissions to add or remove from the role. + */ + permissions?: Array<{ + /** + * The permission id. + */ + id?: string; + /** + * Optional operation, set to 'delete' to remove the permission from the role. + */ + operation?: string; + }>; + }; + /** + * The identifier for the role. + */ + roleId: string; +}; + +export type UpdateRolePermissionsResponse = update_role_permissions_response; + +export type RemoveRolePermissionData = { + /** + * The permission's public id. + */ + permissionId: string; + /** + * The role's public id. + */ + roleId: string; +}; + +export type RemoveRolePermissionResponse = success_response; + +export type UpdateRolesData = { + /** + * Role details. + */ + requestBody?: { + /** + * The role's name. + */ + name: string; + /** + * The role's description. + */ + description?: string; + /** + * The role identifier to use in code. + */ + key: string; + /** + * Set role as default for new users. + */ + is_default_role?: boolean; + }; + /** + * The identifier for the role. + */ + roleId: string; +}; + +export type UpdateRolesResponse = success_response; + +export type DeleteRoleData = { + /** + * The identifier for the role. + */ + roleId: string; +}; + +export type DeleteRoleResponse = success_response; + +export type GetSubscribersData = { + /** + * A string to get the next page of results if there are more results. + */ + nextToken?: string | null; + /** + * Number of results per page. Defaults to 10 if parameter not sent. + */ + pageSize?: number | null; + /** + * Field and order to sort the result by. + */ + sort?: "name_asc" | "name_desc" | "email_asc" | "email_desc" | null; +}; + +export type GetSubscribersResponse = get_subscribers_response; + +export type CreateSubscriberData = { + /** + * The email address of the subscriber. + */ + email: string | null; + /** + * Subscriber's first name. + */ + firstName: string; + /** + * Subscriber's last name. + */ + lastName: string | null; +}; + +export type CreateSubscriberResponse = create_subscriber_success_response; + +export type GetSubscriberData = { + /** + * The subscriber's id. + */ + subscriberId: string; +}; + +export type GetSubscriberResponse = get_subscriber_response; + +export type GetUsersData = { + /** + * Filter the results by email address. The query string should be comma separated and url encoded. + */ + email?: string | null; + /** + * Specify additional data to retrieve. Use "organizations" and/or "identities". + */ + expand?: string | null; + /** + * A string to get the next page of results if there are more results. + */ + nextToken?: string | null; + /** + * Number of results per page. Defaults to 10 if parameter not sent. + */ + pageSize?: number | null; + /** + * ID of the user to filter by. + */ + userId?: string | null; +}; + +export type GetUsersResponse = users_response; + +export type RefreshUserClaimsData = { + /** + * The id of the user whose claims needs to be updated. + */ + userId: string; +}; + +export type RefreshUserClaimsResponse = success_response; + +export type GetUserDataData = { + /** + * Specify additional data to retrieve. Use "organizations" and/or "identities". + */ + expand?: string | null; + /** + * The user's id. + */ + id: string; +}; + +export type GetUserDataResponse = user; + +export type CreateUserData = { + /** + * The details of the user to create. + */ + requestBody?: { + /** + * Basic information required to create a user. + */ + profile?: { + /** + * User's first name. + */ + given_name?: string; + /** + * User's last name. + */ + family_name?: string; + }; + /** + * The unique code associated with the organization you want the user to join. + */ + organization_code?: string; + /** + * Array of identities to assign to the created user + */ + identities?: Array<{ + /** + * The type of identity to create, for e.g. email. + */ + type?: "email" | "username"; + /** + * Additional details required to create the user. + */ + details?: { + /** + * The email address of the user. + */ + email?: string; + /** + * The phone number of the user. + */ + phone?: string; + /** + * The username of the user. + */ + username?: string; + }; + }>; + }; +}; + +export type CreateUserResponse = create_user_response; + +export type UpdateUserData = { + /** + * The user's id. + */ + id: string; + /** + * The user to update. + */ + requestBody: { + /** + * User's first name. + */ + given_name?: string; + /** + * User's last name. + */ + family_name?: string; + /** + * Whether the user is currently suspended or not. + */ + is_suspended?: boolean; + /** + * Prompt the user to change their password on next sign in. + */ + is_password_reset_requested?: boolean; + }; +}; + +export type UpdateUserResponse = update_user_response; + +export type DeleteUserData = { + /** + * The user's id. + */ + id: string; + /** + * Delete all data and remove the user's profile from all of Kinde, including the subscriber list + */ + isDeleteProfile?: boolean; +}; + +export type DeleteUserResponse = success_response; + +export type UpdateUserFeatureFlagOverrideData = { + /** + * The identifier for the feature flag + */ + featureFlagKey: string; + /** + * The identifier for the user + */ + userId: string; + /** + * Override value + */ + value: string; +}; + +export type UpdateUserFeatureFlagOverrideResponse = success_response; + +export type UpdateUserPropertyData = { + /** + * The identifier for the property + */ + propertyKey: string; + /** + * The identifier for the user + */ + userId: string; + /** + * The new property value + */ + value: string; +}; + +export type UpdateUserPropertyResponse = success_response; + +export type GetUserPropertyValuesData = { + /** + * The user's ID. + */ + userId: string; +}; + +export type GetUserPropertyValuesResponse = get_property_values_response; + +export type UpdateUserPropertiesData = { + /** + * Properties to update. + */ + requestBody: { + /** + * Property keys and values + */ + properties: { + [key: string]: unknown; + }; + }; + /** + * The identifier for the user + */ + userId: string; +}; + +export type UpdateUserPropertiesResponse = success_response; + +export type SetUserPasswordData = { + /** + * Password details. + */ + requestBody: { + /** + * The hashed password. + */ + hashed_password: string; + /** + * The hashing method or algorithm used to encrypt the user’s password. Default is bcrypt. + */ + hashing_method?: "bcrypt" | "crypt" | "md5" | "wordpress"; + /** + * Extra characters added to passwords to make them stronger. Not required for bcrypt. + */ + salt?: string; + /** + * Position of salt in password string. Not required for bcrypt. + */ + salt_position?: "prefix" | "suffix"; + /** + * The user will be prompted to set a new password after entering this one. + */ + is_temporary_password?: boolean; + }; + /** + * The identifier for the user + */ + userId: string; +}; + +export type SetUserPasswordResponse = success_response; + +export type $OpenApiTs = { + "/oauth2/user_profile": { + get: { + res: { + /** + * Details of logged in user V1. + */ + 200: user_profile; + /** + * Invalid credentials. + */ + 403: unknown; + }; + }; + }; + "/oauth2/introspect": { + post: { + req: { + /** + * Token details. + */ + formData: { + /** + * The token to be introspected. + */ + token?: string; + /** + * The provided token's type. + */ + token_type?: string; + }; + }; + res: { + /** + * Details of the token. + */ + 200: token_introspect; + /** + * Bad request. + */ + 401: token_error_response; + /** + * Invalid credentials. + */ + 403: unknown; /** - * Details of the token. + * Request was throttled. */ - 200: token_introspect; + 429: unknown; }; }; }; @@ -979,7 +2670,19 @@ export type $OpenApiTs = { /** * Token successfully revoked. */ - 200: any; + 200: unknown; + /** + * Bad request. + */ + 401: token_error_response; + /** + * Invalid credentials. + */ + 403: unknown; + /** + * Request was throttled. + */ + 429: unknown; }; }; }; @@ -990,6 +2693,14 @@ export type $OpenApiTs = { * Details of logged in user V2. */ 200: user_profile_v2; + /** + * Invalid credentials. + */ + 403: unknown; + /** + * Request was throttled. + */ + 429: unknown; }; }; }; @@ -1000,6 +2711,18 @@ export type $OpenApiTs = { * APIs successfully retrieved. */ 200: apis; + /** + * Invalid request. + */ + 400: error_response; + /** + * Invalid credentials. + */ + 403: error_response; + /** + * Request was throttled. + */ + 429: unknown; }; }; post: { @@ -1017,6 +2740,18 @@ export type $OpenApiTs = { * APIs successfully updated */ 200: success_response; + /** + * Invalid request. + */ + 400: error_response; + /** + * Invalid credentials. + */ + 403: error_response; + /** + * Request was throttled. + */ + 429: unknown; }; }; }; @@ -1033,6 +2768,18 @@ export type $OpenApiTs = { * API successfully retrieved. */ 200: api; + /** + * Invalid request. + */ + 400: error_response; + /** + * Invalid credentials. + */ + 403: error_response; + /** + * Request was throttled. + */ + 429: unknown; }; }; delete: { @@ -1047,6 +2794,18 @@ export type $OpenApiTs = { * API successfully deleted. */ 200: success_response; + /** + * Invalid request. + */ + 400: error_response; + /** + * Invalid credentials. + */ + 403: error_response; + /** + * Request was throttled. + */ + 429: unknown; }; }; }; @@ -1078,6 +2837,18 @@ export type $OpenApiTs = { * API applications updated. */ 200: success_response; + /** + * Invalid request. + */ + 400: error_response; + /** + * Invalid credentials. + */ + 403: error_response; + /** + * Request was throttled. + */ + 429: unknown; }; }; }; @@ -1102,6 +2873,14 @@ export type $OpenApiTs = { * A successful response with a list of applications or an empty list. */ 200: get_applications_response; + /** + * Invalid credentials. + */ + 403: unknown; + /** + * Request was throttled. + */ + 429: unknown; }; }; post: { @@ -1125,6 +2904,18 @@ export type $OpenApiTs = { * Application successfully created. */ 200: create_application_response; + /** + * Error creating user. + */ + 400: error_response; + /** + * Invalid credentials. + */ + 403: unknown; + /** + * Request was throttled. + */ + 429: unknown; }; }; }; @@ -1141,6 +2932,18 @@ export type $OpenApiTs = { * Application successfully retrieved. */ 200: get_application_response; + /** + * Bad request. + */ + 400: error_response; + /** + * Invalid credentials. + */ + 403: unknown; + /** + * Request was throttled. + */ + 429: unknown; }; }; patch: { @@ -1175,7 +2978,19 @@ export type $OpenApiTs = { /** * Application successfully updated. */ - 200: any; + 200: unknown; + /** + * Bad request. + */ + 400: error_response; + /** + * Invalid credentials. + */ + 403: unknown; + /** + * Request was throttled. + */ + 429: unknown; }; }; delete: { @@ -1190,6 +3005,18 @@ export type $OpenApiTs = { * Application successfully deleted. */ 200: success_response; + /** + * Invalid request. + */ + 400: error_response; + /** + * Invalid credentials. + */ + 403: error_response; + /** + * Request was throttled. + */ + 429: unknown; }; }; }; @@ -1234,6 +3061,14 @@ export type $OpenApiTs = { * A successful response with your business details. */ 201: success_response; + /** + * Invalid credentials. + */ + 403: unknown; + /** + * Request was throttled. + */ + 429: unknown; }; }; patch: { @@ -1284,6 +3119,18 @@ export type $OpenApiTs = { * Business successfully updated. */ 201: success_response; + /** + * Invalid request. + */ + 400: error_response; + /** + * Invalid credentials. + */ + 403: unknown; + /** + * Request was throttled. + */ + 429: unknown; }; }; }; @@ -1304,6 +3151,14 @@ export type $OpenApiTs = { * A successful response with a list of industries and industry keys. */ 201: success_response; + /** + * Invalid credentials. + */ + 403: unknown; + /** + * Request was throttled. + */ + 429: unknown; }; }; }; @@ -1324,6 +3179,14 @@ export type $OpenApiTs = { * A successful response with a list of timezones and timezone keys. */ 201: success_response; + /** + * Invalid credentials. + */ + 403: unknown; + /** + * Request was throttled. + */ + 429: unknown; }; }; }; @@ -1340,6 +3203,18 @@ export type $OpenApiTs = { * Callback URLs successfully retrieved. */ 200: redirect_callback_urls; + /** + * Invalid request. + */ + 400: error_response; + /** + * Invalid credentials. + */ + 403: unknown; + /** + * Request was throttled. + */ + 429: unknown; }; }; post: { @@ -1363,6 +3238,18 @@ export type $OpenApiTs = { * Callbacks successfully updated */ 200: success_response; + /** + * Invalid request. + */ + 400: error_response; + /** + * Invalid credentials. + */ + 403: error_response; + /** + * Request was throttled. + */ + 429: unknown; }; }; put: { @@ -1386,6 +3273,18 @@ export type $OpenApiTs = { * Callbacks successfully updated */ 200: success_response; + /** + * Invalid request. + */ + 400: error_response; + /** + * Invalid credentials. + */ + 403: unknown; + /** + * Request was throttled. + */ + 429: unknown; }; }; delete: { @@ -1404,6 +3303,18 @@ export type $OpenApiTs = { * Callback URLs successfully deleted. */ 200: success_response; + /** + * Invalid request. + */ + 400: error_response; + /** + * Invalid credentials. + */ + 403: error_response; + /** + * Request was throttled. + */ + 429: unknown; }; }; }; @@ -1420,6 +3331,18 @@ export type $OpenApiTs = { * Logout URLs successfully retrieved. */ 200: logout_redirect_urls; + /** + * Invalid request. + */ + 400: error_response; + /** + * Invalid credentials. + */ + 403: unknown; + /** + * Request was throttled. + */ + 429: unknown; }; }; post: { @@ -1443,6 +3366,18 @@ export type $OpenApiTs = { * Logouts successfully updated */ 200: success_response; + /** + * Invalid request. + */ + 400: error_response; + /** + * Invalid credentials. + */ + 403: error_response; + /** + * Request was throttled. + */ + 429: unknown; }; }; put: { @@ -1466,6 +3401,18 @@ export type $OpenApiTs = { * Logout URLs successfully updated */ 200: success_response; + /** + * Invalid request. + */ + 400: error_response; + /** + * Invalid credentials. + */ + 403: unknown; + /** + * Request was throttled. + */ + 429: unknown; }; }; delete: { @@ -1484,6 +3431,18 @@ export type $OpenApiTs = { * Logout URLs successfully deleted. */ 200: success_response; + /** + * Invalid request. + */ + 400: error_response; + /** + * Invalid credentials. + */ + 403: error_response; + /** + * Request was throttled. + */ + 429: unknown; }; }; }; @@ -1512,6 +3471,22 @@ export type $OpenApiTs = { * A URL that can be used to authenticate and a session id to identify this authentication session. */ 200: connected_apps_auth_url; + /** + * Error retrieving connected app auth url. + */ + 400: error_response; + /** + * Invalid credentials. + */ + 403: unknown; + /** + * Error retrieving connected app auth url. + */ + 404: error_response; + /** + * Request was throttled. + */ + 429: unknown; }; }; }; @@ -1528,6 +3503,18 @@ export type $OpenApiTs = { * An access token that can be used to query a third-party provider, as well as the token's expiry time. */ 200: connected_apps_access_token; + /** + * The session id provided points to an invalid session. + */ + 400: error_response; + /** + * Invalid credentials. + */ + 403: error_response; + /** + * Request was throttled. + */ + 429: unknown; }; }; }; @@ -1544,6 +3531,22 @@ export type $OpenApiTs = { * An access token that can be used to query a third-party provider, as well as the token's expiry time. */ 200: success_response; + /** + * Bad request. + */ + 400: error_response; + /** + * Invalid credentials. + */ + 403: error_response; + /** + * Invalid HTTP method used. + */ + 405: unknown; + /** + * Request was throttled. + */ + 429: unknown; }; }; }; @@ -1554,6 +3557,18 @@ export type $OpenApiTs = { * Feature flag overrides deleted successfully. */ 200: success_response; + /** + * Invalid request. + */ + 400: error_response; + /** + * Invalid credentials. + */ + 403: unknown; + /** + * Request was throttled. + */ + 429: unknown; }; }; get: { @@ -1562,6 +3577,18 @@ export type $OpenApiTs = { * Feature flags retrieved successfully. */ 200: get_environment_feature_flags_response; + /** + * Invalid request. + */ + 400: error_response; + /** + * Invalid credentials. + */ + 403: unknown; + /** + * Request was throttled. + */ + 429: unknown; }; }; }; @@ -1578,6 +3605,18 @@ export type $OpenApiTs = { * Feature flag deleted successfully. */ 200: success_response; + /** + * Invalid request. + */ + 400: error_response; + /** + * Invalid credentials. + */ + 403: unknown; + /** + * Request was throttled. + */ + 429: unknown; }; }; patch: { @@ -1601,6 +3640,18 @@ export type $OpenApiTs = { * Feature flag override successful */ 200: success_response; + /** + * Invalid request. + */ + 400: error_response; + /** + * Invalid credentials. + */ + 403: unknown; + /** + * Request was throttled. + */ + 429: unknown; }; }; }; @@ -1642,6 +3693,18 @@ export type $OpenApiTs = { * Feature flag successfully created */ 201: success_response; + /** + * Invalid request. + */ + 400: error_response; + /** + * Invalid credentials. + */ + 403: unknown; + /** + * Request was throttled. + */ + 429: unknown; }; }; }; @@ -1658,6 +3721,18 @@ export type $OpenApiTs = { * Feature flag successfully updated. */ 200: success_response; + /** + * Invalid request. + */ + 400: error_response; + /** + * Invalid credentials. + */ + 403: unknown; + /** + * Request was throttled. + */ + 429: unknown; }; }; put: { @@ -1692,6 +3767,18 @@ export type $OpenApiTs = { * Feature flag successfully updated. */ 200: success_response; + /** + * Invalid request. + */ + 400: error_response; + /** + * Invalid credentials. + */ + 403: unknown; + /** + * Request was throttled. + */ + 429: unknown; }; }; }; @@ -1708,6 +3795,18 @@ export type $OpenApiTs = { * Organization successfully retrieved. */ 200: organization; + /** + * Bad request. + */ + 400: error_response; + /** + * Invalid credentials. + */ + 403: unknown; + /** + * Request was throttled. + */ + 429: unknown; }; }; post: { @@ -1723,7 +3822,9 @@ export type $OpenApiTs = { /** * The organization's feature flag settings. */ - feature_flags?: Record; + feature_flags?: { + [key: string]: "str" | "int" | "bool"; + }; /** * The organization's ID. */ @@ -1779,6 +3880,22 @@ export type $OpenApiTs = { * Organization successfully created. */ 200: create_organization_response; + /** + * Error creating user. + */ + 400: error_response; + /** + * Invalid credentials. + */ + 403: unknown; + /** + * Request was throttled. + */ + 429: unknown; + /** + * Could not create organization. + */ + 500: unknown; }; }; }; @@ -1852,6 +3969,18 @@ export type $OpenApiTs = { * Organization successfully updated. */ 200: success_response; + /** + * Error updating organization. + */ + 400: error_response; + /** + * Invalid credentials. + */ + 403: unknown; + /** + * Request was throttled. + */ + 429: unknown; }; }; delete: { @@ -1865,7 +3994,19 @@ export type $OpenApiTs = { /** * Organization successfully deleted. */ - 200: any; + 200: unknown; + /** + * Error deleting organization. + */ + 400: error_response; + /** + * Invalid credentials. + */ + 403: unknown; + /** + * Request was throttled. + */ + 429: unknown; }; }; }; @@ -1890,6 +4031,14 @@ export type $OpenApiTs = { * A successful response with a list of organizations or an empty list. */ 200: get_organizations_response; + /** + * Invalid credentials. + */ + 403: unknown; + /** + * Request was throttled. + */ + 429: unknown; }; }; }; @@ -1926,6 +4075,18 @@ export type $OpenApiTs = { * A successful response with a list of organization users or an empty list. */ 200: get_organization_users_response; + /** + * Error creating user + */ + 400: error_response; + /** + * Invalid credentials. + */ + 403: unknown; + /** + * Request was throttled. + */ + 429: unknown; }; }; post: { @@ -1963,6 +4124,18 @@ export type $OpenApiTs = { * No users added. */ 204: void; + /** + * Bad request. + */ + 400: error_response; + /** + * Invalid credentials. + */ + 403: unknown; + /** + * Request was throttled. + */ + 429: unknown; }; }; patch: { @@ -2000,6 +4173,18 @@ export type $OpenApiTs = { * Users successfully removed. */ 200: update_organization_users_response; + /** + * Error updating organization user. + */ + 400: error_response; + /** + * Invalid credentials. + */ + 403: unknown; + /** + * Request was throttled. + */ + 429: unknown; }; }; }; @@ -2017,9 +4202,17 @@ export type $OpenApiTs = { }; res: { /** - * A successful response with a list of user roles. + * A successful response with a list of user roles. + */ + 200: get_organizations_user_roles_response; + /** + * Invalid credentials. + */ + 403: unknown; + /** + * Request was throttled. */ - 200: get_organizations_user_roles_response; + 429: unknown; }; }; post: { @@ -2047,6 +4240,14 @@ export type $OpenApiTs = { * Role successfully added. */ 200: success_response; + /** + * Invalid credentials. + */ + 403: unknown; + /** + * Request was throttled. + */ + 429: unknown; }; }; }; @@ -2071,6 +4272,18 @@ export type $OpenApiTs = { * User successfully removed. */ 200: success_response; + /** + * Error creating user. + */ + 400: error_response; + /** + * Invalid credentials. + */ + 403: unknown; + /** + * Request was throttled. + */ + 429: unknown; }; }; }; @@ -2095,6 +4308,14 @@ export type $OpenApiTs = { * A successful response with a list of user permissions. */ 200: get_organizations_user_permissions_response; + /** + * Invalid credentials. + */ + 403: unknown; + /** + * Request was throttled. + */ + 429: unknown; }; }; post: { @@ -2122,6 +4343,14 @@ export type $OpenApiTs = { * User permission successfully updated. */ 200: success_response; + /** + * Invalid credentials. + */ + 403: unknown; + /** + * Request was throttled. + */ + 429: unknown; }; }; }; @@ -2146,6 +4375,18 @@ export type $OpenApiTs = { * User successfully removed. */ 200: success_response; + /** + * Error creating user. + */ + 400: error_response; + /** + * Invalid credentials. + */ + 403: unknown; + /** + * Request was throttled. + */ + 429: unknown; }; }; }; @@ -2166,6 +4407,18 @@ export type $OpenApiTs = { * User successfully removed from organization */ 200: success_response; + /** + * Error removing user + */ + 400: error_response; + /** + * Invalid credentials. + */ + 403: unknown; + /** + * Request was throttled. + */ + 429: unknown; }; }; }; @@ -2182,6 +4435,18 @@ export type $OpenApiTs = { * Feature flag overrides successfully returned. */ 200: get_organization_feature_flags_response; + /** + * Invalid request. + */ + 400: error_response; + /** + * Invalid credentials. + */ + 403: unknown; + /** + * Request was throttled. + */ + 429: unknown; }; }; delete: { @@ -2196,6 +4461,18 @@ export type $OpenApiTs = { * Feature flag overrides successfully deleted. */ 200: success_response; + /** + * Invalid request. + */ + 400: error_response; + /** + * Invalid credentials. + */ + 403: unknown; + /** + * Request was throttled. + */ + 429: unknown; }; }; }; @@ -2216,6 +4493,18 @@ export type $OpenApiTs = { * Feature flag override successfully deleted. */ 200: success_response; + /** + * Invalid request. + */ + 400: error_response; + /** + * Invalid credentials. + */ + 403: unknown; + /** + * Request was throttled. + */ + 429: unknown; }; }; patch: { @@ -2238,6 +4527,18 @@ export type $OpenApiTs = { * Feature flag override successfully updated. */ 200: success_response; + /** + * Invalid request. + */ + 400: error_response; + /** + * Invalid credentials. + */ + 403: unknown; + /** + * Request was throttled. + */ + 429: unknown; }; }; }; @@ -2262,6 +4563,18 @@ export type $OpenApiTs = { * Property successfully updated. */ 200: success_response; + /** + * Invalid request. + */ + 400: error_response; + /** + * Invalid credentials. + */ + 403: unknown; + /** + * Request was throttled. + */ + 429: unknown; }; }; }; @@ -2278,6 +4591,18 @@ export type $OpenApiTs = { * Properties successfully retrieved. */ 200: get_property_values_response; + /** + * Bad request. + */ + 400: error_response; + /** + * Invalid credentials. + */ + 403: unknown; + /** + * Request was throttled. + */ + 429: unknown; }; }; patch: { @@ -2293,7 +4618,9 @@ export type $OpenApiTs = { /** * Property keys and values */ - properties: Record; + properties: { + [key: string]: unknown; + }; }; }; res: { @@ -2301,6 +4628,18 @@ export type $OpenApiTs = { * Properties successfully updated. */ 200: success_response; + /** + * Invalid request. + */ + 400: error_response; + /** + * Invalid credentials. + */ + 403: unknown; + /** + * Request was throttled. + */ + 429: unknown; }; }; }; @@ -2317,6 +4656,18 @@ export type $OpenApiTs = { * Handle successfully deleted. */ 200: success_response; + /** + * Bad request. + */ + 400: error_response; + /** + * Invalid credentials. + */ + 403: unknown; + /** + * Request was throttled. + */ + 429: unknown; }; }; }; @@ -2341,6 +4692,14 @@ export type $OpenApiTs = { * Permissions successfully retrieved. */ 200: get_permissions_response; + /** + * Invalid credentials. + */ + 403: error_response; + /** + * Request was throttled. + */ + 429: unknown; }; }; post: { @@ -2368,6 +4727,18 @@ export type $OpenApiTs = { * Permission successfully created */ 201: success_response; + /** + * Invalid request. + */ + 400: error_response; + /** + * Invalid credentials. + */ + 403: error_response; + /** + * Request was throttled. + */ + 429: unknown; }; }; }; @@ -2401,6 +4772,18 @@ export type $OpenApiTs = { * Permission successfully updated */ 201: success_response; + /** + * Invalid request. + */ + 400: error_response; + /** + * Invalid credentials. + */ + 403: error_response; + /** + * Request was throttled. + */ + 429: unknown; }; }; delete: { @@ -2415,6 +4798,18 @@ export type $OpenApiTs = { * permission successfully updated. */ 200: success_response; + /** + * Invalid request. + */ + 400: error_response; + /** + * Invalid credentials. + */ + 403: unknown; + /** + * Request was throttled. + */ + 429: unknown; }; }; }; @@ -2443,6 +4838,18 @@ export type $OpenApiTs = { * Properties successfully retrieved. */ 200: get_properties_response; + /** + * Invalid request. + */ + 400: error_response; + /** + * Invalid credentials. + */ + 403: error_response; + /** + * Request was throttled. + */ + 429: unknown; }; }; post: { @@ -2486,6 +4893,18 @@ export type $OpenApiTs = { * Property successfully created */ 201: create_property_response; + /** + * Invalid request. + */ + 400: error_response; + /** + * Invalid credentials. + */ + 403: unknown; + /** + * Request was throttled. + */ + 429: unknown; }; }; }; @@ -2519,6 +4938,18 @@ export type $OpenApiTs = { * Property successfully updated. */ 200: success_response; + /** + * Invalid request. + */ + 400: error_response; + /** + * Invalid credentials. + */ + 403: unknown; + /** + * Request was throttled. + */ + 429: unknown; }; }; }; @@ -2547,6 +4978,18 @@ export type $OpenApiTs = { * Categories successfully retrieved. */ 200: get_categories_response; + /** + * Invalid request. + */ + 400: error_response; + /** + * Invalid credentials. + */ + 403: error_response; + /** + * Request was throttled. + */ + 429: unknown; }; }; post: { @@ -2570,6 +5013,18 @@ export type $OpenApiTs = { * Category successfully created */ 201: create_category_response; + /** + * Invalid request. + */ + 400: error_response; + /** + * Invalid credentials. + */ + 403: unknown; + /** + * Request was throttled. + */ + 429: unknown; }; }; }; @@ -2595,6 +5050,18 @@ export type $OpenApiTs = { * category successfully updated. */ 200: success_response; + /** + * Invalid request. + */ + 400: error_response; + /** + * Invalid credentials. + */ + 403: unknown; + /** + * Request was throttled. + */ + 429: unknown; }; }; }; @@ -2619,6 +5086,14 @@ export type $OpenApiTs = { * Roles successfully retrieved. */ 200: get_roles_response; + /** + * Invalid credentials. + */ + 403: error_response; + /** + * Request was throttled. + */ + 429: unknown; }; }; post: { @@ -2650,6 +5125,14 @@ export type $OpenApiTs = { * Role successfully created */ 201: success_response; + /** + * Invalid request. + */ + 400: error_response; + /** + * Invalid credentials. + */ + 403: error_response; }; }; }; @@ -2678,6 +5161,18 @@ export type $OpenApiTs = { * A list of permissions for a role */ 200: roles_permission_response; + /** + * Error removing user + */ + 400: error_response; + /** + * Invalid credentials. + */ + 403: unknown; + /** + * Request was throttled. + */ + 429: unknown; }; }; patch: { @@ -2707,6 +5202,14 @@ export type $OpenApiTs = { * Permissions successfully updated. */ 200: update_role_permissions_response; + /** + * Invalid credentials. + */ + 403: error_response; + /** + * Request was throttled. + */ + 429: unknown; }; }; }; @@ -2727,6 +5230,18 @@ export type $OpenApiTs = { * Permission successfully removed from role */ 200: success_response; + /** + * Error removing user + */ + 400: error_response; + /** + * Invalid credentials. + */ + 403: unknown; + /** + * Request was throttled. + */ + 429: unknown; }; }; }; @@ -2764,6 +5279,18 @@ export type $OpenApiTs = { * Role successfully updated */ 201: success_response; + /** + * Invalid request. + */ + 400: error_response; + /** + * Invalid credentials. + */ + 403: error_response; + /** + * Request was throttled. + */ + 429: unknown; }; }; delete: { @@ -2778,6 +5305,18 @@ export type $OpenApiTs = { * Role successfully deleted. */ 200: success_response; + /** + * Invalid request. + */ + 400: error_response; + /** + * Invalid credentials. + */ + 403: unknown; + /** + * Request was throttled. + */ + 429: unknown; }; }; }; @@ -2802,6 +5341,14 @@ export type $OpenApiTs = { * Subscriber successfully retrieved. */ 200: get_subscribers_response; + /** + * Bad request. + */ + 403: error_response; + /** + * Request was throttled. + */ + 429: unknown; }; }; post: { @@ -2824,6 +5371,18 @@ export type $OpenApiTs = { * Subscriber successfully created */ 201: create_subscriber_success_response; + /** + * Invalid request. + */ + 400: error_response; + /** + * Invalid credentials. + */ + 403: error_response; + /** + * Request was throttled. + */ + 429: unknown; }; }; }; @@ -2840,6 +5399,18 @@ export type $OpenApiTs = { * Subscriber successfully retrieved. */ 200: get_subscriber_response; + /** + * Bad request. + */ + 400: error_response; + /** + * Invalid credentials. + */ + 403: error_response; + /** + * Request was throttled. + */ + 429: unknown; }; }; }; @@ -2872,6 +5443,14 @@ export type $OpenApiTs = { * Users successfully retrieved. */ 200: users_response; + /** + * Invalid credentials. + */ + 403: unknown; + /** + * Request was throttled. + */ + 429: unknown; }; }; }; @@ -2888,6 +5467,18 @@ export type $OpenApiTs = { * Claims successfully refreshed. */ 200: success_response; + /** + * Bad request. + */ + 400: error_response; + /** + * Bad request. + */ + 403: error_response; + /** + * Request was throttled. + */ + 429: unknown; }; }; }; @@ -2908,6 +5499,18 @@ export type $OpenApiTs = { * User successfully updated. */ 200: user; + /** + * Bad request. + */ + 400: error_response; + /** + * Invalid credentials. + */ + 403: unknown; + /** + * Request was throttled. + */ + 429: unknown; }; }; post: { @@ -2966,6 +5569,18 @@ export type $OpenApiTs = { * User successfully created. */ 200: create_user_response; + /** + * Error creating user. + */ + 400: error_response; + /** + * Invalid credentials. + */ + 403: unknown; + /** + * Request was throttled. + */ + 429: unknown; }; }; patch: { @@ -3001,6 +5616,18 @@ export type $OpenApiTs = { * User successfully updated. */ 200: update_user_response; + /** + * Bad request. + */ + 400: error_response; + /** + * Invalid credentials. + */ + 403: unknown; + /** + * Request was throttled. + */ + 429: unknown; }; }; delete: { @@ -3019,6 +5646,18 @@ export type $OpenApiTs = { * User successfully deleted. */ 200: success_response; + /** + * Bad request. + */ + 400: error_response; + /** + * Invalid credentials. + */ + 403: unknown; + /** + * Request was throttled. + */ + 429: unknown; }; }; }; @@ -3043,6 +5682,18 @@ export type $OpenApiTs = { * Feature flag override successfully updated. */ 200: success_response; + /** + * Invalid request. + */ + 400: error_response; + /** + * Invalid credentials. + */ + 403: unknown; + /** + * Request was throttled. + */ + 429: unknown; }; }; }; @@ -3067,6 +5718,18 @@ export type $OpenApiTs = { * Property successfully updated. */ 200: success_response; + /** + * Invalid request. + */ + 400: error_response; + /** + * Invalid credentials. + */ + 403: unknown; + /** + * Request was throttled. + */ + 429: unknown; }; }; }; @@ -3083,6 +5746,18 @@ export type $OpenApiTs = { * Properties successfully retrieved. */ 200: get_property_values_response; + /** + * Bad request. + */ + 400: error_response; + /** + * Invalid credentials. + */ + 403: unknown; + /** + * Request was throttled. + */ + 429: unknown; }; }; patch: { @@ -3094,7 +5769,9 @@ export type $OpenApiTs = { /** * Property keys and values */ - properties: Record; + properties: { + [key: string]: unknown; + }; }; /** * The identifier for the user @@ -3106,6 +5783,18 @@ export type $OpenApiTs = { * Properties successfully updated. */ 200: success_response; + /** + * Invalid request. + */ + 400: error_response; + /** + * Invalid credentials. + */ + 403: unknown; + /** + * Request was throttled. + */ + 429: unknown; }; }; }; @@ -3147,6 +5836,18 @@ export type $OpenApiTs = { * User successfully created. */ 200: success_response; + /** + * Error creating user. + */ + 400: error_response; + /** + * Invalid credentials. + */ + 403: unknown; + /** + * Request was throttled. + */ + 429: unknown; }; }; }; diff --git a/openapi-ts.config.ts b/openapi-ts.config.ts new file mode 100644 index 0000000..9694e3c --- /dev/null +++ b/openapi-ts.config.ts @@ -0,0 +1,10 @@ +import { format } from "path"; + +export default { + input: "./spec/kinde-mgmt-api-specs.yaml", + output: "lib/api", + format: "prettier", + services: { + name: "{{name}}", + }, +}; From f141edff0d86bf0e85183738219af04f334a173d Mon Sep 17 00:00:00 2001 From: Daniel Rivers Date: Fri, 10 May 2024 15:02:03 +0100 Subject: [PATCH 2/2] feat: update to latest API schema chore: yaml update feat: update management API schema --- lib/api/schemas.gen.ts | 67 ++++- lib/api/services.gen.ts | 202 ++++++++++++++ lib/api/types.gen.ts | 467 ++++++++++++++++++++++++++++++++- spec/kinde-mgmt-api-specs.yaml | 435 +++++++++++++++++++++++++++++- 4 files changed, 1158 insertions(+), 13 deletions(-) diff --git a/lib/api/schemas.gen.ts b/lib/api/schemas.gen.ts index 7cc44be..e32e4ed 100644 --- a/lib/api/schemas.gen.ts +++ b/lib/api/schemas.gen.ts @@ -471,6 +471,51 @@ export const $get_categories_response = { }, } as const; +export const $create_connection_response = { + type: "object", + properties: { + message: { + type: "string", + }, + code: { + type: "string", + }, + connection: { + type: "object", + properties: { + id: { + description: "The connection's ID.", + type: "string", + }, + }, + }, + }, +} as const; + +export const $get_connections_response = { + type: "object", + properties: { + code: { + type: "string", + description: "Response code.", + }, + message: { + type: "string", + description: "Response message.", + }, + connections: { + type: "array", + items: { + $ref: "#/components/schemas/connection", + }, + }, + has_more: { + description: "Whether more records exist.", + type: "boolean", + }, + }, +} as const; + export const $token_introspect = { type: "object", properties: { @@ -610,7 +655,25 @@ export const $category = { type: "string", }, name: { - type: "boolean", + type: "string", + }, + }, +} as const; + +export const $connection = { + type: "object", + properties: { + id: { + type: "string", + }, + name: { + type: "string", + }, + display_name: { + type: "string", + }, + strategy: { + type: "string", }, }, } as const; @@ -625,7 +688,7 @@ export const $property = { type: "string", }, name: { - type: "boolean", + type: "string", }, is_private: { type: "boolean", diff --git a/lib/api/services.gen.ts b/lib/api/services.gen.ts index dc92842..bcad4d6 100644 --- a/lib/api/services.gen.ts +++ b/lib/api/services.gen.ts @@ -29,6 +29,12 @@ import type { UpdateApplicationResponse, DeleteApplicationData, DeleteApplicationResponse, + GetApplicationConnectionsData, + GetApplicationConnectionsResponse, + EnableConnectionData, + EnableConnectionResponse, + RemoveConnectionData, + RemoveConnectionResponse, GetBusinessData, GetBusinessResponse, UpdateBusinessData, @@ -59,6 +65,14 @@ import type { GetConnectedAppTokenResponse, RevokeConnectedAppTokenData, RevokeConnectedAppTokenResponse, + GetConnectionsData, + GetConnectionsResponse, + CreateConnectionData, + CreateConnectionResponse, + GetConnectionData, + GetConnectionResponse, + UpdateConnectionData, + UpdateConnectionResponse, DeleteEnvironementFeatureFlagOverridesResponse, GetEnvironementFeatureFlagsResponse, DeleteEnvironementFeatureFlagOverrideData, @@ -522,6 +536,85 @@ export class Applications { }, }); } + + /** + * Get connections + * Gets all connections for an application. + * @param data The data for the request. + * @param data.applicationId The identifier/client ID for the application. + * @returns get_connections_response Application connections successfully retrieved. + * @throws ApiError + */ + public static getApplicationConnections( + data: GetApplicationConnectionsData, + ): CancelablePromise { + return __request(OpenAPI, { + method: "GET", + url: "/api/v1/applications/{application_id}/connections", + path: { + application_id: data.applicationId, + }, + errors: { + 400: "Bad request.", + 403: "Invalid credentials.", + 429: "Request was throttled.", + }, + }); + } + + /** + * Enable connection + * Enable an auth connection for an application. + * @param data The data for the request. + * @param data.applicationId The identifier/client ID for the application. + * @param data.connectionId The identifier for the connection. + * @returns unknown Connection successfully enabled. + * @throws ApiError + */ + public static enableConnection( + data: EnableConnectionData, + ): CancelablePromise { + return __request(OpenAPI, { + method: "POST", + url: "/api/v1/applications/{application_id}/connections/{connection_id}", + path: { + application_id: data.applicationId, + connection_id: data.connectionId, + }, + errors: { + 400: "Bad request.", + 403: "Invalid credentials.", + 429: "Request was throttled.", + }, + }); + } + + /** + * Remove connection + * Turn off an auth connection for an application + * @param data The data for the request. + * @param data.applicationId The identifier/client ID for the application. + * @param data.connectionId The identifier for the connection. + * @returns success_response Connection successfully removed. + * @throws ApiError + */ + public static removeConnection( + data: RemoveConnectionData, + ): CancelablePromise { + return __request(OpenAPI, { + method: "DELETE", + url: "/api/v1/applications/{application_id}/connections/{connection_id}", + path: { + application_id: data.applicationId, + connection_id: data.connectionId, + }, + errors: { + 400: "Invalid request.", + 403: "Invalid credentials.", + 429: "Request was throttled.", + }, + }); + } } export class Business { @@ -978,6 +1071,115 @@ export class ConnectedApps { } } +export class Connections { + /** + * List Connections + * Returns a list of Connections + * + * @param data The data for the request. + * @param data.pageSize Number of results per page. Defaults to 10 if parameter not sent. + * @param data.startingAfter The ID of the connection to start after. + * @param data.endingBefore The ID of the connection to end before. + * @returns get_connections_response Connections successfully retrieved. + * @throws ApiError + */ + public static getConnections( + data: GetConnectionsData = {}, + ): CancelablePromise { + return __request(OpenAPI, { + method: "GET", + url: "/api/v1/connections", + query: { + page_size: data.pageSize, + starting_after: data.startingAfter, + ending_before: data.endingBefore, + }, + errors: { + 400: "Invalid request.", + 403: "Invalid credentials.", + 429: "Request was throttled.", + }, + }); + } + + /** + * Create Connection + * Create Connection. + * @param data The data for the request. + * @param data.requestBody Connection details. + * @returns create_connection_response Connection successfully created + * @throws ApiError + */ + public static createConnection( + data: CreateConnectionData, + ): CancelablePromise { + return __request(OpenAPI, { + method: "POST", + url: "/api/v1/connections", + body: data.requestBody, + mediaType: "application/json", + errors: { + 400: "Invalid request.", + 403: "Invalid credentials.", + 429: "Request was throttled.", + }, + }); + } + + /** + * Get Connection + * Get Connection. + * @param data The data for the request. + * @param data.connectionId The unique identifier for the connection. + * @returns connection Connection successfully retrieved. + * @throws ApiError + */ + public static getConnection( + data: GetConnectionData, + ): CancelablePromise { + return __request(OpenAPI, { + method: "GET", + url: "/api/v1/connections/{connection_id}", + path: { + connection_id: data.connectionId, + }, + errors: { + 400: "Invalid request.", + 403: "Invalid credentials.", + 429: "Request was throttled.", + }, + }); + } + + /** + * Update Connection + * Update Connection. + * @param data The data for the request. + * @param data.connectionId The unique identifier for the connection. + * @param data.requestBody The fields of the connection to update. + * @returns success_response Connection successfully updated. + * @throws ApiError + */ + public static updateConnection( + data: UpdateConnectionData, + ): CancelablePromise { + return __request(OpenAPI, { + method: "PATCH", + url: "/api/v1/connections/{connection_id}", + path: { + connection_id: data.connectionId, + }, + body: data.requestBody, + mediaType: "application/json", + errors: { + 400: "Invalid request.", + 403: "Invalid credentials.", + 429: "Request was throttled.", + }, + }); + } +} + export class Environments { /** * Delete Environment Feature Flag Overrides diff --git a/lib/api/types.gen.ts b/lib/api/types.gen.ts index 55647db..c1f3900 100644 --- a/lib/api/types.gen.ts +++ b/lib/api/types.gen.ts @@ -334,6 +334,33 @@ export type get_categories_response = { has_more?: boolean; }; +export type create_connection_response = { + message?: string; + code?: string; + connection?: { + /** + * The connection's ID. + */ + id?: string; + }; +}; + +export type get_connections_response = { + /** + * Response code. + */ + code?: string; + /** + * Response message. + */ + message?: string; + connections?: Array; + /** + * Whether more records exist. + */ + has_more?: boolean; +}; + export type token_introspect = { /** * Indicates the status of the token. @@ -425,13 +452,20 @@ export type organization_user = { export type category = { id?: string; - name?: boolean; + name?: string; +}; + +export type connection = { + id?: string; + name?: string; + display_name?: string; + strategy?: string; }; export type property = { id?: string; key?: string; - name?: boolean; + name?: string; is_private?: boolean; description?: string; is_kinde_property?: boolean; @@ -1099,6 +1133,41 @@ export type DeleteApplicationData = { export type DeleteApplicationResponse = success_response; +export type GetApplicationConnectionsData = { + /** + * The identifier/client ID for the application. + */ + applicationId: string; +}; + +export type GetApplicationConnectionsResponse = get_connections_response; + +export type EnableConnectionData = { + /** + * The identifier/client ID for the application. + */ + applicationId: string; + /** + * The identifier for the connection. + */ + connectionId: string; +}; + +export type EnableConnectionResponse = unknown; + +export type RemoveConnectionData = { + /** + * The identifier/client ID for the application. + */ + applicationId: string; + /** + * The identifier for the connection. + */ + connectionId: string; +}; + +export type RemoveConnectionResponse = success_response; + export type GetBusinessData = { /** * Business code. @@ -1362,6 +1431,114 @@ export type RevokeConnectedAppTokenData = { export type RevokeConnectedAppTokenResponse = success_response; +export type GetConnectionsData = { + /** + * The ID of the connection to end before. + */ + endingBefore?: string | null; + /** + * Number of results per page. Defaults to 10 if parameter not sent. + */ + pageSize?: number | null; + /** + * The ID of the connection to start after. + */ + startingAfter?: string | null; +}; + +export type GetConnectionsResponse = get_connections_response; + +export type CreateConnectionData = { + /** + * Connection details. + */ + requestBody: { + /** + * The internal name of the connection. + */ + name: string; + /** + * The public facing name of the connection. + */ + display_name: string; + /** + * The identity provider identifier for the connection. + */ + strategy: + | "oauth2:apple" + | "oauth2:azure_ad" + | "oauth2:bitbucket" + | "oauth2:discord" + | "oauth2:facebook" + | "oauth2:github" + | "oauth2:gitlab" + | "oauth2:google" + | "oauth2:linkedin" + | "oauth2:microsoft" + | "oauth2:patreon" + | "oauth2:slack" + | "oauth2:stripe" + | "oauth2:twitch" + | "oauth2:twitter" + | "oauth2:xero" + | "saml:custom" + | "wsfed:azure_ad"; + /** + * Client IDs of applications in which this connection is to be enabled. + */ + enabled_applications?: Array; + /** + * The connection's options (varies by strategy). + */ + options?: { + [key: string]: unknown; + }; + }; +}; + +export type CreateConnectionResponse = create_connection_response; + +export type GetConnectionData = { + /** + * The unique identifier for the connection. + */ + connectionId: string; +}; + +export type GetConnectionResponse = connection; + +export type UpdateConnectionData = { + /** + * The unique identifier for the connection. + */ + connectionId: string; + /** + * The fields of the connection to update. + */ + requestBody: { + /** + * The internal name of the connection. + */ + name?: string; + /** + * The public facing name of the connection. + */ + display_name?: string; + /** + * Client IDs of applications in which this connection is to be enabled. + */ + enabled_applications?: Array; + /** + * The connection's options (varies by strategy). + */ + options?: { + [key: string]: unknown; + }; + }; +}; + +export type UpdateConnectionResponse = success_response; + export type DeleteEnvironementFeatureFlagOverridesResponse = success_response; export type GetEnvironementFeatureFlagsResponse = @@ -2099,7 +2276,7 @@ export type UpdatePropertyData = { /** * The name of the property. */ - name?: string; + name: string; /** * Description of the property purpose. */ @@ -2107,7 +2284,11 @@ export type UpdatePropertyData = { /** * Whether the property can be included in id and access tokens. */ - is_private?: boolean; + is_private: boolean; + /** + * Which category the property belongs to. + */ + category_id: string; }; }; @@ -3020,6 +3201,96 @@ export type $OpenApiTs = { }; }; }; + "/api/v1/applications/{application_id}/connections": { + get: { + req: { + /** + * The identifier/client ID for the application. + */ + applicationId: string; + }; + res: { + /** + * Application connections successfully retrieved. + */ + 200: get_connections_response; + /** + * Bad request. + */ + 400: error_response; + /** + * Invalid credentials. + */ + 403: unknown; + /** + * Request was throttled. + */ + 429: unknown; + }; + }; + }; + "/api/v1/applications/{application_id}/connections/{connection_id}": { + post: { + req: { + /** + * The identifier/client ID for the application. + */ + applicationId: string; + /** + * The identifier for the connection. + */ + connectionId: string; + }; + res: { + /** + * Connection successfully enabled. + */ + 200: unknown; + /** + * Bad request. + */ + 400: error_response; + /** + * Invalid credentials. + */ + 403: unknown; + /** + * Request was throttled. + */ + 429: unknown; + }; + }; + delete: { + req: { + /** + * The identifier/client ID for the application. + */ + applicationId: string; + /** + * The identifier for the connection. + */ + connectionId: string; + }; + res: { + /** + * Connection successfully removed. + */ + 200: success_response; + /** + * Invalid request. + */ + 400: error_response; + /** + * Invalid credentials. + */ + 403: error_response; + /** + * Request was throttled. + */ + 429: unknown; + }; + }; + }; "/api/v1/business": { get: { req: { @@ -3550,6 +3821,186 @@ export type $OpenApiTs = { }; }; }; + "/api/v1/connections": { + get: { + req: { + /** + * The ID of the connection to end before. + */ + endingBefore?: string | null; + /** + * Number of results per page. Defaults to 10 if parameter not sent. + */ + pageSize?: number | null; + /** + * The ID of the connection to start after. + */ + startingAfter?: string | null; + }; + res: { + /** + * Connections successfully retrieved. + */ + 200: get_connections_response; + /** + * Invalid request. + */ + 400: error_response; + /** + * Invalid credentials. + */ + 403: error_response; + /** + * Request was throttled. + */ + 429: unknown; + }; + }; + post: { + req: { + /** + * Connection details. + */ + requestBody: { + /** + * The internal name of the connection. + */ + name: string; + /** + * The public facing name of the connection. + */ + display_name: string; + /** + * The identity provider identifier for the connection. + */ + strategy: + | "oauth2:apple" + | "oauth2:azure_ad" + | "oauth2:bitbucket" + | "oauth2:discord" + | "oauth2:facebook" + | "oauth2:github" + | "oauth2:gitlab" + | "oauth2:google" + | "oauth2:linkedin" + | "oauth2:microsoft" + | "oauth2:patreon" + | "oauth2:slack" + | "oauth2:stripe" + | "oauth2:twitch" + | "oauth2:twitter" + | "oauth2:xero" + | "saml:custom" + | "wsfed:azure_ad"; + /** + * Client IDs of applications in which this connection is to be enabled. + */ + enabled_applications?: Array; + /** + * The connection's options (varies by strategy). + */ + options?: { + [key: string]: unknown; + }; + }; + }; + res: { + /** + * Connection successfully created + */ + 201: create_connection_response; + /** + * Invalid request. + */ + 400: error_response; + /** + * Invalid credentials. + */ + 403: unknown; + /** + * Request was throttled. + */ + 429: unknown; + }; + }; + }; + "/api/v1/connections/{connection_id}": { + get: { + req: { + /** + * The unique identifier for the connection. + */ + connectionId: string; + }; + res: { + /** + * Connection successfully retrieved. + */ + 200: connection; + /** + * Invalid request. + */ + 400: error_response; + /** + * Invalid credentials. + */ + 403: unknown; + /** + * Request was throttled. + */ + 429: unknown; + }; + }; + patch: { + req: { + /** + * The unique identifier for the connection. + */ + connectionId: string; + /** + * The fields of the connection to update. + */ + requestBody: { + /** + * The internal name of the connection. + */ + name?: string; + /** + * The public facing name of the connection. + */ + display_name?: string; + /** + * Client IDs of applications in which this connection is to be enabled. + */ + enabled_applications?: Array; + /** + * The connection's options (varies by strategy). + */ + options?: { + [key: string]: unknown; + }; + }; + }; + res: { + /** + * Connection successfully updated. + */ + 200: success_response; + /** + * Invalid request. + */ + 400: error_response; + /** + * Invalid credentials. + */ + 403: unknown; + /** + * Request was throttled. + */ + 429: unknown; + }; + }; + }; "/api/v1/environment/feature_flags": { delete: { res: { @@ -4922,7 +5373,7 @@ export type $OpenApiTs = { /** * The name of the property. */ - name?: string; + name: string; /** * Description of the property purpose. */ @@ -4930,7 +5381,11 @@ export type $OpenApiTs = { /** * Whether the property can be included in id and access tokens. */ - is_private?: boolean; + is_private: boolean; + /** + * Which category the property belongs to. + */ + category_id: string; }; }; res: { diff --git a/spec/kinde-mgmt-api-specs.yaml b/spec/kinde-mgmt-api-specs.yaml index ff6e6b8..f2ab37f 100644 --- a/spec/kinde-mgmt-api-specs.yaml +++ b/spec/kinde-mgmt-api-specs.yaml @@ -3,11 +3,11 @@ info: version: '1' title: Kinde Management API description: Provides endpoints to manage your Kinde Businesses - termsOfService: https://kinde.com/docs/important-information/terms-of-service/ + termsOfService: https://docs.kinde.com/trust-center/agreements/terms-of-service/ contact: name: Kinde Support Team email: support@kinde.com - url: https://kinde.com/docs/ + url: https://docs.kinde.com servers: - url: https://{businessName}.kinde.com variables: @@ -31,6 +31,8 @@ tags: x-displayName: Callbacks - name: Connected Apps x-displayName: Connected Apps + - name: Connections + x-displayName: Connections - name: Environments x-displayName: Environments - name: Feature Flags @@ -674,6 +676,132 @@ paths: description: Request was throttled. security: - kindeBearerAuth: [] + /api/v1/applications/{application_id}/connections: + get: + tags: + - Applications + operationId: GetApplicationConnections + description: Gets all connections for an application. + summary: Get connections + parameters: + - name: application_id + in: path + description: The identifier/client ID for the application. + required: true + schema: + type: string + nullable: false + responses: + '200': + description: Application connections successfully retrieved. + content: + application/json: + schema: + $ref: '#/components/schemas/get_connections_response' + application/json; charset=utf-8: + schema: + $ref: '#/components/schemas/get_connections_response' + '400': + description: Bad request. + content: + application/json: + schema: + $ref: '#/components/schemas/error_response' + application/json; charset=utf-8: + schema: + $ref: '#/components/schemas/error_response' + '403': + description: Invalid credentials. + '429': + description: Request was throttled. + security: + - kindeBearerAuth: [] + /api/v1/applications/{application_id}/connections/{connection_id}: + post: + tags: + - Applications + operationId: EnableConnection + description: Enable an auth connection for an application. + summary: Enable connection + parameters: + - name: application_id + in: path + description: The identifier/client ID for the application. + required: true + schema: + type: string + - name: connection_id + in: path + description: The identifier for the connection. + required: true + schema: + type: string + responses: + '200': + description: Connection successfully enabled. + '400': + description: Bad request. + content: + application/json: + schema: + $ref: '#/components/schemas/error_response' + application/json; charset=utf-8: + schema: + $ref: '#/components/schemas/error_response' + '403': + description: Invalid credentials. + '429': + description: Request was throttled. + security: + - kindeBearerAuth: [] + delete: + tags: + - Applications + operationId: RemoveConnection + description: Turn off an auth connection for an application + summary: Remove connection + parameters: + - name: application_id + in: path + description: The identifier/client ID for the application. + required: true + schema: + type: string + - name: connection_id + in: path + description: The identifier for the connection. + required: true + schema: + type: string + responses: + '200': + description: Connection successfully removed. + content: + application/json: + schema: + $ref: '#/components/schemas/success_response' + application/json; charset=utf-8: + schema: + $ref: '#/components/schemas/success_response' + '400': + description: Invalid request. + content: + application/json: + schema: + $ref: '#/components/schemas/error_response' + application/json; charset=utf-8: + schema: + $ref: '#/components/schemas/error_response' + '403': + description: Invalid credentials. + content: + application/json; charset=utf-8: + schema: + $ref: '#/components/schemas/error_response' + '429': + description: Request was throttled. + security: + - kindeBearerAuth: [] /api/v1/business: get: tags: @@ -1465,6 +1593,252 @@ paths: description: Request was throttled. security: - kindeBearerAuth: [] + /api/v1/connections: + get: + tags: + - Connections + operationId: GetConnections + description: | + Returns a list of Connections + summary: List Connections + parameters: + - name: page_size + in: query + description: Number of results per page. Defaults to 10 if parameter not sent. + schema: + type: integer + nullable: true + - name: starting_after + in: query + description: The ID of the connection to start after. + schema: + type: string + nullable: true + - name: ending_before + in: query + description: The ID of the connection to end before. + schema: + type: string + nullable: true + responses: + '200': + description: Connections successfully retrieved. + content: + application/json; charset=utf-8: + schema: + $ref: '#/components/schemas/get_connections_response' + application/json: + schema: + $ref: '#/components/schemas/get_connections_response' + '400': + description: Invalid request. + content: + application/json; charset=utf-8: + schema: + $ref: '#/components/schemas/error_response' + application/json: + schema: + $ref: '#/components/schemas/error_response' + '403': + description: Invalid credentials. + content: + application/json; charset=utf-8: + schema: + $ref: '#/components/schemas/error_response' + application/json: + schema: + $ref: '#/components/schemas/error_response' + '429': + description: Request was throttled. + security: + - kindeBearerAuth: [] + post: + tags: + - Connections + operationId: CreateConnection + description: Create Connection. + summary: Create Connection + requestBody: + description: Connection details. + required: true + content: + application/json: + schema: + type: object + properties: + name: + description: The internal name of the connection. + type: string + nullable: false + display_name: + description: The public facing name of the connection. + type: string + nullable: false + strategy: + description: The identity provider identifier for the connection. + type: string + enum: + - oauth2:apple + - oauth2:azure_ad + - oauth2:bitbucket + - oauth2:discord + - oauth2:facebook + - oauth2:github + - oauth2:gitlab + - oauth2:google + - oauth2:linkedin + - oauth2:microsoft + - oauth2:patreon + - oauth2:slack + - oauth2:stripe + - oauth2:twitch + - oauth2:twitter + - oauth2:xero + - saml:custom + - wsfed:azure_ad + nullable: false + enabled_applications: + description: >- + Client IDs of applications in which this connection is to be + enabled. + type: array + items: + type: string + options: + description: The connection's options (varies by strategy). + type: object + required: + - name + - display_name + - strategy + responses: + '201': + description: Connection successfully created + content: + application/json: + schema: + $ref: '#/components/schemas/create_connection_response' + application/json; charset=utf-8: + schema: + $ref: '#/components/schemas/create_connection_response' + '400': + description: Invalid request. + content: + application/json: + schema: + $ref: '#/components/schemas/error_response' + application/json; charset=utf-8: + schema: + $ref: '#/components/schemas/error_response' + '403': + description: Invalid credentials. + '429': + description: Request was throttled. + security: + - kindeBearerAuth: [] + /api/v1/connections/{connection_id}: + get: + tags: + - Connections + operationId: GetConnection + description: Get Connection. + summary: Get Connection + parameters: + - name: connection_id + in: path + description: The unique identifier for the connection. + required: true + schema: + type: string + responses: + '200': + description: Connection successfully retrieved. + content: + application/json: + schema: + $ref: '#/components/schemas/connection' + application/json; charset=utf-8: + schema: + $ref: '#/components/schemas/connection' + '400': + description: Invalid request. + content: + application/json: + schema: + $ref: '#/components/schemas/error_response' + application/json; charset=utf-8: + schema: + $ref: '#/components/schemas/error_response' + '403': + description: Invalid credentials. + '429': + description: Request was throttled. + security: + - kindeBearerAuth: [] + patch: + tags: + - Connections + operationId: UpdateConnection + description: Update Connection. + summary: Update Connection + parameters: + - name: connection_id + in: path + description: The unique identifier for the connection. + required: true + schema: + type: string + requestBody: + description: The fields of the connection to update. + required: true + content: + application/json: + schema: + type: object + properties: + name: + description: The internal name of the connection. + type: string + nullable: false + display_name: + description: The public facing name of the connection. + type: string + nullable: false + enabled_applications: + description: >- + Client IDs of applications in which this connection is to be + enabled. + type: array + items: + type: string + options: + description: The connection's options (varies by strategy). + type: object + responses: + '200': + description: Connection successfully updated. + content: + application/json: + schema: + $ref: '#/components/schemas/success_response' + application/json; charset=utf-8: + schema: + $ref: '#/components/schemas/success_response' + '400': + description: Invalid request. + content: + application/json: + schema: + $ref: '#/components/schemas/error_response' + application/json; charset=utf-8: + schema: + $ref: '#/components/schemas/error_response' + '403': + description: Invalid credentials. + '429': + description: Request was throttled. + security: + - kindeBearerAuth: [] /api/v1/environment/feature_flags: delete: tags: @@ -3408,6 +3782,14 @@ paths: description: >- Whether the property can be included in id and access tokens. + category_id: + description: Which category the property belongs to. + type: string + nullable: false + required: + - name + - is_private + - category_id responses: '200': description: Property successfully updated. @@ -5079,6 +5461,35 @@ components: has_more: description: Whether more records exist. type: boolean + create_connection_response: + type: object + properties: + message: + type: string + code: + type: string + connection: + type: object + properties: + id: + description: The connection's ID. + type: string + get_connections_response: + type: object + properties: + code: + type: string + description: Response code. + message: + type: string + description: Response message. + connections: + type: array + items: + $ref: '#/components/schemas/connection' + has_more: + description: Whether more records exist. + type: boolean token_introspect: type: object properties: @@ -5175,7 +5586,18 @@ components: id: type: string name: - type: boolean + type: string + connection: + type: object + properties: + id: + type: string + name: + type: string + display_name: + type: string + strategy: + type: string property: type: object properties: @@ -5184,7 +5606,7 @@ components: key: type: string name: - type: boolean + type: string is_private: type: boolean description: @@ -5751,6 +6173,9 @@ x-tagGroups: - name: Callbacks API tags: - Callbacks + - name: Connections API + tags: + - Connections - name: Environment API tags: - Environments @@ -5777,4 +6202,4 @@ x-tagGroups: - Subscribers - name: Users API tags: - - Users + - Users \ No newline at end of file