Skip to content

Commit

Permalink
Merge pull request #68 from kinde-oss/feat/specupdate
Browse files Browse the repository at this point in the history
  • Loading branch information
DanielRivers authored Feb 20, 2025
2 parents 24d2dec + d393ec7 commit 4a1504b
Show file tree
Hide file tree
Showing 5 changed files with 792 additions and 0 deletions.
140 changes: 140 additions & 0 deletions lib/api/schemas.gen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -656,6 +656,10 @@ export const $user = {
type: "string",
description: "Default email address of the user in Kinde.",
},
phone: {
type: "string",
description: "User's primary phone number.",
},
username: {
type: "string",
description: "Primary username of the user in Kinde.",
Expand Down Expand Up @@ -792,6 +796,10 @@ export const $users_response = {
type: "string",
description: "Default email address of the user in Kinde.",
},
phone: {
type: "string",
description: "User's primary phone number.",
},
username: {
type: "string",
description: "Primary username of the user in Kinde.",
Expand Down Expand Up @@ -864,6 +872,125 @@ export const $users_response = {
},
} as const;

export const $search_users_response = {
type: "object",
properties: {
code: {
type: "string",
description: "Response code.",
},
message: {
type: "string",
description: "Response message.",
},
results: {
type: "array",
items: {
type: "object",
properties: {
id: {
type: "string",
description: "Unique ID of the user in Kinde.",
example: "kp_0ba7c433e5d648cf992621ce99d42817",
},
provided_id: {
type: "string",
description: "External ID for user.",
nullable: true,
example: "U123456",
},
email: {
type: "string",
description: "Default email address of the user in Kinde.",
nullable: true,
example: "[email protected]",
},
username: {
type: "string",
description: "Primary username of the user in Kinde.",
nullable: true,
example: "john.snow",
},
last_name: {
type: "string",
description: "User's last name.",
example: "Snow",
},
first_name: {
type: "string",
description: "User's first name.",
example: "John",
},
is_suspended: {
type: "boolean",
description: "Whether the user is currently suspended or not.",
example: true,
},
picture: {
type: "string",
description: "User's profile picture URL.",
example: "https://example.com/john_snow.jpg",
nullable: true,
},
total_sign_ins: {
type: "integer",
description: "Total number of user sign ins.",
nullable: true,
example: 1,
},
failed_sign_ins: {
type: "integer",
description: "Number of consecutive failed user sign ins.",
nullable: true,
example: 0,
},
last_signed_in: {
type: "string",
description: "Last sign in date in ISO 8601 format.",
nullable: true,
example: "2025-02-12T18:02:23.614638+00:00",
},
created_on: {
type: "string",
description: "Date of user creation in ISO 8601 format.",
nullable: true,
example: "2025-02-12T18:02:23.614638+00:00",
},
organizations: {
type: "array",
description: "Array of organizations a user belongs to.",
items: {
type: "string",
},
},
identities: {
type: "array",
description: "Array of identities belonging to the user.",
items: {
type: "object",
properties: {
type: {
type: "string",
},
identity: {
type: "string",
},
},
},
},
properties: {
type: "object",
description: "The user properties.",
additionalProperties: {
type: "string",
},
},
},
},
},
},
} as const;

export const $create_user_response = {
type: "object",
properties: {
Expand Down Expand Up @@ -1949,6 +2076,19 @@ export const $get_organization_response = {
deprecated: true,
description: "Deprecated - Use 'is_auto_membership_enabled' instead",
},
sender_name: {
nullable: true,
type: "string",
example: "Acme Corp",
description: "The name of the organization that will be used in emails",
},
sender_email: {
nullable: true,
type: "string",
example: "[email protected]",
description:
"The email address that will be used in emails. Requires custom SMTP to be set up.",
},
},
} as const;

Expand Down
145 changes: 145 additions & 0 deletions lib/api/services.gen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,12 @@ import type {
AddOrganizationLogoResponse,
DeleteOrganizationLogoData,
DeleteOrganizationLogoResponse,
GetOrganizationConnectionsData,
GetOrganizationConnectionsResponse,
EnableOrgConnectionData,
EnableOrgConnectionResponse,
RemoveOrgConnectionData,
RemoveOrgConnectionResponse,
GetPermissionsData,
GetPermissionsResponse,
CreatePermissionData,
Expand Down Expand Up @@ -219,6 +225,8 @@ import type {
UpdateRolePermissionsResponse,
RemoveRolePermissionData,
RemoveRolePermissionResponse,
SearchUsersData,
SearchUsersResponse,
GetSubscribersData,
GetSubscribersResponse,
CreateSubscriberData,
Expand Down Expand Up @@ -3200,6 +3208,100 @@ export class Organizations {
},
});
}

/**
* Get connections
* Gets all connections for an organization.
*
* <div>
* <code>read:organization_connections</code>
* </div>
*
* @param data The data for the request.
* @param data.organizationCode The organization code.
* @returns get_connections_response Organization connections successfully retrieved.
* @throws ApiError
*/
public static getOrganizationConnections(
data: GetOrganizationConnectionsData,
): CancelablePromise<GetOrganizationConnectionsResponse> {
return __request(OpenAPI, {
method: "GET",
url: "/api/v1/organizations/{organization_code}/connections",
path: {
organization_code: data.organizationCode,
},
errors: {
400: "Invalid request.",
403: "Unauthorized - invalid credentials.",
429: "Too many requests. Request was throttled.",
},
});
}

/**
* Enable connection
* Enable an auth connection for an organization.
*
* <div>
* <code>create:organization_connections</code>
* </div>
*
* @param data The data for the request.
* @param data.organizationCode The unique code for the organization.
* @param data.connectionId The identifier for the connection.
* @returns unknown Connection successfully enabled.
* @throws ApiError
*/
public static enableOrgConnection(
data: EnableOrgConnectionData,
): CancelablePromise<EnableOrgConnectionResponse> {
return __request(OpenAPI, {
method: "POST",
url: "/api/v1/organizations/{organization_code}/connections/{connection_id}",
path: {
organization_code: data.organizationCode,
connection_id: data.connectionId,
},
errors: {
400: "Invalid request.",
403: "Unauthorized - invalid credentials.",
429: "Too many requests. Request was throttled.",
},
});
}

/**
* Remove connection
* Turn off an auth connection for an organization
*
* <div>
* <code>delete:organization_connections</code>
* </div>
*
* @param data The data for the request.
* @param data.organizationCode The unique code for the organization.
* @param data.connectionId The identifier for the connection.
* @returns success_response Connection successfully removed.
* @throws ApiError
*/
public static removeOrgConnection(
data: RemoveOrgConnectionData,
): CancelablePromise<RemoveOrgConnectionResponse> {
return __request(OpenAPI, {
method: "DELETE",
url: "/api/v1/organizations/{organization_code}/connections/{connection_id}",
path: {
organization_code: data.organizationCode,
connection_id: data.connectionId,
},
errors: {
400: "Invalid request.",
403: "Unauthorized - invalid credentials.",
429: "Too many requests. Request was throttled.",
},
});
}
}

export class Permissions {
Expand Down Expand Up @@ -3817,6 +3919,49 @@ export class Roles {
}
}

export class Search {
/**
* Search users
* Search for users based on the provided query string. Set query to '*' to filter by other parameters only.
* The number of records to return at a time can be controlled using the `page_size` query string parameter.
*
* <div>
* <code>read:users</code>
* </div>
*
* @param data The data for the request.
* @param data.pageSize Number of results per page. Defaults to 10 if parameter not sent.
* @param data.query Search the users by email or name. Use '*' to search all.
* @param data.properties
* @param data.startingAfter The ID of the user to start after.
* @param data.endingBefore The ID of the user to end before.
* @param data.expand Specify additional data to retrieve. Use "organizations" and/or "identities".
* @returns search_users_response Users successfully retrieved.
* @throws ApiError
*/
public static searchUsers(
data: SearchUsersData = {},
): CancelablePromise<SearchUsersResponse> {
return __request(OpenAPI, {
method: "GET",
url: "/api/v1/search/users",
query: {
page_size: data.pageSize,
query: data.query,
properties: data.properties,
starting_after: data.startingAfter,
ending_before: data.endingBefore,
expand: data.expand,
},
errors: {
400: "Invalid request.",
403: "Unauthorized - invalid credentials.",
429: "Too many requests. Request was throttled.",
},
});
}
}

export class Subscribers {
/**
* List Subscribers
Expand Down
Loading

0 comments on commit 4a1504b

Please sign in to comment.