Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 17 additions & 7 deletions src/lib/api/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -77,10 +77,6 @@ export {
shockerShockerShareCodeUpdate,
shockerShockerShareRemove,
tokenDeleteDeleteToken,
tokensCreateToken,
tokensEditToken,
tokensListTokens,
tokensReportTokens,
usersGetByName,
usersGetSelf,
versionGetBackendInfo,
Expand Down Expand Up @@ -121,8 +117,6 @@ export type {
SharedShocker,
ShockerResponse,
ShockerWithDevice,
TokenCreatedResponse,
TokenResponse,
UserNameBlacklistDto,
WebhookDto,
} from './internal/v1';
Expand All @@ -132,6 +126,13 @@ export {
accountLoginV2,
accountSignUpV2,
devicesCreateDeviceV2,
tokensCreateTokenV2,
tokensEditTokenV2,
tokensGetTokenByIdV2,
tokensListTokensV2,
tokensReportTokens,
tokensSelfGetSelfTokenV2,
tokensSetTokenPaused,
userSharesCreateShareInvite,
userSharesDeleteOutgoingInvite,
userSharesDenyIncomingInvite,
Expand All @@ -141,13 +142,22 @@ export {
userSharesRedeemInvite,
} from './internal/v2';

export { UsernameAvailability, UsernameErrorType } from './internal/v2';
export { ControlLimitMode, UsernameAvailability, UsernameErrorType } from './internal/v2';

export type {
CreateTokenRequestV2,
DurationLimitSettings,
EditTokenRequestV2,
IntensityLimitSettings,
SetTokenPausedRequest,
ShareInviteBaseDetails,
ShockerControlSettings,
ShockerLimits,
ShockerPermLimitPairWithIdAndName,
ShockerPermissions,
TokenCreatedResponseV2,
TokenPausedResponse,
TokenResponseV2,
UserShareInfo,
UsernameCheckResponse,
V2UserShares,
Expand Down
4 changes: 2 additions & 2 deletions src/lib/api/internal/v2/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// This file is auto-generated by @hey-api/openapi-ts

export { accountCheckUsername, accountLoginV2, accountPasswordResetInitiateV2, accountPasswordResetInitiateV2Legacy, accountSignUpV2, deviceGetLiveControlGatewayV2, devicesCreateDeviceV2, type Options, shockerSendControl, userSharesBulkPauseUserShareShockers, userSharesBulkRemoveUserShareShockers, userSharesBulkUserShareShockersUpdate, userSharesCreateShareInvite, userSharesDeleteOutgoingInvite, userSharesDenyIncomingInvite, userSharesGetIncomingInvitesList, userSharesGetOutgoingInvitesList, userSharesGetSharesByUsers, userSharesRedeemInvite } from './sdk.gen';
export { type AccountCheckUsernameData, type AccountCheckUsernameResponse, type AccountCheckUsernameResponses, type AccountLoginV2Data, type AccountLoginV2Error, type AccountLoginV2Errors, type AccountLoginV2Response, type AccountLoginV2Responses, type AccountPasswordResetInitiateV2Data, type AccountPasswordResetInitiateV2Error, type AccountPasswordResetInitiateV2Errors, type AccountPasswordResetInitiateV2LegacyData, type AccountPasswordResetInitiateV2LegacyError, type AccountPasswordResetInitiateV2LegacyErrors, type AccountPasswordResetInitiateV2LegacyResponses, type AccountPasswordResetInitiateV2Responses, type AccountSignUpV2Data, type AccountSignUpV2Error, type AccountSignUpV2Errors, type AccountSignUpV2Responses, type BasicUserInfo, type BulkUserShareShockersUpdateRequest, type ChangeUsernameRequest, type ClientOptions, type Control, type ControlRequest, ControlType, type CreateShareRequest, type DeviceGetLiveControlGatewayV2Data, type DeviceGetLiveControlGatewayV2Error, type DeviceGetLiveControlGatewayV2Errors, type DeviceGetLiveControlGatewayV2Response, type DeviceGetLiveControlGatewayV2Responses, type DevicesCreateDeviceV2Data, type DevicesCreateDeviceV2Response, type DevicesCreateDeviceV2Responses, type HubCreateRequest, type LcgNodeResponseV2, type LegacyEmptyResponse, type LoginV2, type LoginV2OkResponse, type OpenShockProblem, type OpenShockProblemWritable, type PasswordResetRequestV2, type PauseUserShareShockersRequest, type PauseUserShareShockersResponse, type RemoveUserSharesResponse, RoleType, type ShareInviteBaseDetails, type ShockerLimits, type ShockerPermissions, type ShockerPermLimitPairWithId, type ShockerPermLimitPairWithIdAndName, type ShockerSendControlData, type ShockerSendControlError, type ShockerSendControlErrors, type ShockerSendControlResponse, type ShockerSendControlResponses, type SignUpV2, UsernameAvailability, type UsernameCheckResponse, type UsernameError, UsernameErrorType, type UserShareInfo, type UserSharesBulkPauseUserShareShockersData, type UserSharesBulkPauseUserShareShockersResponse, type UserSharesBulkPauseUserShareShockersResponses, type UserSharesBulkRemoveUserShareShockersData, type UserSharesBulkRemoveUserShareShockersResponse, type UserSharesBulkRemoveUserShareShockersResponses, type UserSharesBulkUserShareShockersUpdateData, type UserSharesBulkUserShareShockersUpdateError, type UserSharesBulkUserShareShockersUpdateErrors, type UserSharesBulkUserShareShockersUpdateResponses, type UserSharesCreateShareInviteData, type UserSharesCreateShareInviteError, type UserSharesCreateShareInviteErrors, type UserSharesCreateShareInviteResponse, type UserSharesCreateShareInviteResponses, type UserSharesDeleteOutgoingInviteData, type UserSharesDeleteOutgoingInviteError, type UserSharesDeleteOutgoingInviteErrors, type UserSharesDeleteOutgoingInviteResponses, type UserSharesDenyIncomingInviteData, type UserSharesDenyIncomingInviteError, type UserSharesDenyIncomingInviteErrors, type UserSharesDenyIncomingInviteResponses, type UserSharesGetIncomingInvitesListData, type UserSharesGetIncomingInvitesListResponse, type UserSharesGetIncomingInvitesListResponses, type UserSharesGetOutgoingInvitesListData, type UserSharesGetOutgoingInvitesListResponse, type UserSharesGetOutgoingInvitesListResponses, type UserSharesGetSharesByUsersData, type UserSharesGetSharesByUsersResponse, type UserSharesGetSharesByUsersResponses, type UserSharesRedeemInviteData, type UserSharesRedeemInviteError, type UserSharesRedeemInviteErrors, type UserSharesRedeemInviteResponse, type UserSharesRedeemInviteResponses, type V2UserShares, type V2UserSharesListItem } from './types.gen';
export { accountCheckUsername, accountLoginV2, accountPasswordResetInitiateV2, accountPasswordResetInitiateV2Legacy, accountSignUpV2, deviceGetLiveControlGatewayV2, devicesCreateDeviceV2, type Options, shockerSendControl, tokensCreateTokenV2, tokensEditTokenV2, tokensGetTokenByIdV2, tokensListTokensV2, tokensReportTokens, tokensSelfGetSelfTokenV2, tokensSetTokenPaused, userSharesBulkPauseUserShareShockers, userSharesBulkRemoveUserShareShockers, userSharesBulkUserShareShockersUpdate, userSharesCreateShareInvite, userSharesDeleteOutgoingInvite, userSharesDenyIncomingInvite, userSharesGetIncomingInvitesList, userSharesGetOutgoingInvitesList, userSharesGetSharesByUsers, userSharesRedeemInvite } from './sdk.gen';
export { type AccountCheckUsernameData, type AccountCheckUsernameResponse, type AccountCheckUsernameResponses, type AccountLoginV2Data, type AccountLoginV2Error, type AccountLoginV2Errors, type AccountLoginV2Response, type AccountLoginV2Responses, type AccountPasswordResetInitiateV2Data, type AccountPasswordResetInitiateV2Error, type AccountPasswordResetInitiateV2Errors, type AccountPasswordResetInitiateV2LegacyData, type AccountPasswordResetInitiateV2LegacyError, type AccountPasswordResetInitiateV2LegacyErrors, type AccountPasswordResetInitiateV2LegacyResponses, type AccountPasswordResetInitiateV2Responses, type AccountSignUpV2Data, type AccountSignUpV2Error, type AccountSignUpV2Errors, type AccountSignUpV2Responses, type BasicUserInfo, type BulkUserShareShockersUpdateRequest, type ChangeUsernameRequest, type ClientOptions, type Control, ControlLimitMode, type ControlRequest, ControlType, type CreateShareRequest, type CreateTokenRequestV2, type DeviceGetLiveControlGatewayV2Data, type DeviceGetLiveControlGatewayV2Error, type DeviceGetLiveControlGatewayV2Errors, type DeviceGetLiveControlGatewayV2Response, type DeviceGetLiveControlGatewayV2Responses, type DevicesCreateDeviceV2Data, type DevicesCreateDeviceV2Response, type DevicesCreateDeviceV2Responses, type DurationLimitSettings, type EditTokenRequestV2, type HubCreateRequest, type IntensityLimitSettings, type LcgNodeResponseV2, type LegacyEmptyResponse, type LoginV2, type LoginV2OkResponse, type OpenShockProblem, type OpenShockProblemWritable, type PasswordResetRequestV2, type PauseUserShareShockersRequest, type PauseUserShareShockersResponse, PermissionType, type RemoveUserSharesResponse, type ReportTokensRequest, RoleType, type SetTokenPausedRequest, type ShareInviteBaseDetails, type ShockerControlSettings, type ShockerLimits, type ShockerPermissions, type ShockerPermLimitPairWithId, type ShockerPermLimitPairWithIdAndName, type ShockerSendControlData, type ShockerSendControlError, type ShockerSendControlErrors, type ShockerSendControlResponse, type ShockerSendControlResponses, type SignUpV2, type TokenCreatedResponseV2, type TokenPausedResponse, type TokenResponseV2, type TokensCreateTokenV2Data, type TokensCreateTokenV2Response, type TokensCreateTokenV2Responses, type TokensEditTokenV2Data, type TokensEditTokenV2Error, type TokensEditTokenV2Errors, type TokensEditTokenV2Responses, type TokensGetTokenByIdV2Data, type TokensGetTokenByIdV2Error, type TokensGetTokenByIdV2Errors, type TokensGetTokenByIdV2Response, type TokensGetTokenByIdV2Responses, type TokensListTokensV2Data, type TokensListTokensV2Response, type TokensListTokensV2Responses, type TokensReportTokensData, type TokensReportTokensResponses, type TokensSelfGetSelfTokenV2Data, type TokensSelfGetSelfTokenV2Response, type TokensSelfGetSelfTokenV2Responses, type TokensSetTokenPausedData, type TokensSetTokenPausedError, type TokensSetTokenPausedErrors, type TokensSetTokenPausedResponse, type TokensSetTokenPausedResponses, UsernameAvailability, type UsernameCheckResponse, type UsernameError, UsernameErrorType, type UserShareInfo, type UserSharesBulkPauseUserShareShockersData, type UserSharesBulkPauseUserShareShockersResponse, type UserSharesBulkPauseUserShareShockersResponses, type UserSharesBulkRemoveUserShareShockersData, type UserSharesBulkRemoveUserShareShockersResponse, type UserSharesBulkRemoveUserShareShockersResponses, type UserSharesBulkUserShareShockersUpdateData, type UserSharesBulkUserShareShockersUpdateError, type UserSharesBulkUserShareShockersUpdateErrors, type UserSharesBulkUserShareShockersUpdateResponses, type UserSharesCreateShareInviteData, type UserSharesCreateShareInviteError, type UserSharesCreateShareInviteErrors, type UserSharesCreateShareInviteResponse, type UserSharesCreateShareInviteResponses, type UserSharesDeleteOutgoingInviteData, type UserSharesDeleteOutgoingInviteError, type UserSharesDeleteOutgoingInviteErrors, type UserSharesDeleteOutgoingInviteResponses, type UserSharesDenyIncomingInviteData, type UserSharesDenyIncomingInviteError, type UserSharesDenyIncomingInviteErrors, type UserSharesDenyIncomingInviteResponses, type UserSharesGetIncomingInvitesListData, type UserSharesGetIncomingInvitesListResponse, type UserSharesGetIncomingInvitesListResponses, type UserSharesGetOutgoingInvitesListData, type UserSharesGetOutgoingInvitesListResponse, type UserSharesGetOutgoingInvitesListResponses, type UserSharesGetSharesByUsersData, type UserSharesGetSharesByUsersResponse, type UserSharesGetSharesByUsersResponses, type UserSharesRedeemInviteData, type UserSharesRedeemInviteError, type UserSharesRedeemInviteErrors, type UserSharesRedeemInviteResponse, type UserSharesRedeemInviteResponses, type V2UserShares, type V2UserSharesListItem } from './types.gen';
87 changes: 85 additions & 2 deletions src/lib/api/internal/v2/sdk.gen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

import type { Client, Options as Options2, TDataShape } from './client';
import { client } from './client.gen';
import { userSharesGetIncomingInvitesListResponseTransformer, userSharesGetOutgoingInvitesListResponseTransformer, userSharesGetSharesByUsersResponseTransformer, userSharesRedeemInviteResponseTransformer } from './transformers.gen';
import type { AccountCheckUsernameData, AccountCheckUsernameResponses, AccountLoginV2Data, AccountLoginV2Errors, AccountLoginV2Responses, AccountPasswordResetInitiateV2Data, AccountPasswordResetInitiateV2Errors, AccountPasswordResetInitiateV2LegacyData, AccountPasswordResetInitiateV2LegacyErrors, AccountPasswordResetInitiateV2LegacyResponses, AccountPasswordResetInitiateV2Responses, AccountSignUpV2Data, AccountSignUpV2Errors, AccountSignUpV2Responses, DeviceGetLiveControlGatewayV2Data, DeviceGetLiveControlGatewayV2Errors, DeviceGetLiveControlGatewayV2Responses, DevicesCreateDeviceV2Data, DevicesCreateDeviceV2Responses, ShockerSendControlData, ShockerSendControlErrors, ShockerSendControlResponses, UserSharesBulkPauseUserShareShockersData, UserSharesBulkPauseUserShareShockersResponses, UserSharesBulkRemoveUserShareShockersData, UserSharesBulkRemoveUserShareShockersResponses, UserSharesBulkUserShareShockersUpdateData, UserSharesBulkUserShareShockersUpdateErrors, UserSharesBulkUserShareShockersUpdateResponses, UserSharesCreateShareInviteData, UserSharesCreateShareInviteErrors, UserSharesCreateShareInviteResponses, UserSharesDeleteOutgoingInviteData, UserSharesDeleteOutgoingInviteErrors, UserSharesDeleteOutgoingInviteResponses, UserSharesDenyIncomingInviteData, UserSharesDenyIncomingInviteErrors, UserSharesDenyIncomingInviteResponses, UserSharesGetIncomingInvitesListData, UserSharesGetIncomingInvitesListResponses, UserSharesGetOutgoingInvitesListData, UserSharesGetOutgoingInvitesListResponses, UserSharesGetSharesByUsersData, UserSharesGetSharesByUsersResponses, UserSharesRedeemInviteData, UserSharesRedeemInviteErrors, UserSharesRedeemInviteResponses } from './types.gen';
import { tokensCreateTokenV2ResponseTransformer, tokensGetTokenByIdV2ResponseTransformer, tokensListTokensV2ResponseTransformer, tokensSelfGetSelfTokenV2ResponseTransformer, userSharesGetIncomingInvitesListResponseTransformer, userSharesGetOutgoingInvitesListResponseTransformer, userSharesGetSharesByUsersResponseTransformer, userSharesRedeemInviteResponseTransformer } from './transformers.gen';
import type { AccountCheckUsernameData, AccountCheckUsernameResponses, AccountLoginV2Data, AccountLoginV2Errors, AccountLoginV2Responses, AccountPasswordResetInitiateV2Data, AccountPasswordResetInitiateV2Errors, AccountPasswordResetInitiateV2LegacyData, AccountPasswordResetInitiateV2LegacyErrors, AccountPasswordResetInitiateV2LegacyResponses, AccountPasswordResetInitiateV2Responses, AccountSignUpV2Data, AccountSignUpV2Errors, AccountSignUpV2Responses, DeviceGetLiveControlGatewayV2Data, DeviceGetLiveControlGatewayV2Errors, DeviceGetLiveControlGatewayV2Responses, DevicesCreateDeviceV2Data, DevicesCreateDeviceV2Responses, ShockerSendControlData, ShockerSendControlErrors, ShockerSendControlResponses, TokensCreateTokenV2Data, TokensCreateTokenV2Responses, TokensEditTokenV2Data, TokensEditTokenV2Errors, TokensEditTokenV2Responses, TokensGetTokenByIdV2Data, TokensGetTokenByIdV2Errors, TokensGetTokenByIdV2Responses, TokensListTokensV2Data, TokensListTokensV2Responses, TokensReportTokensData, TokensReportTokensResponses, TokensSelfGetSelfTokenV2Data, TokensSelfGetSelfTokenV2Responses, TokensSetTokenPausedData, TokensSetTokenPausedErrors, TokensSetTokenPausedResponses, UserSharesBulkPauseUserShareShockersData, UserSharesBulkPauseUserShareShockersResponses, UserSharesBulkRemoveUserShareShockersData, UserSharesBulkRemoveUserShareShockersResponses, UserSharesBulkUserShareShockersUpdateData, UserSharesBulkUserShareShockersUpdateErrors, UserSharesBulkUserShareShockersUpdateResponses, UserSharesCreateShareInviteData, UserSharesCreateShareInviteErrors, UserSharesCreateShareInviteResponses, UserSharesDeleteOutgoingInviteData, UserSharesDeleteOutgoingInviteErrors, UserSharesDeleteOutgoingInviteResponses, UserSharesDenyIncomingInviteData, UserSharesDenyIncomingInviteErrors, UserSharesDenyIncomingInviteResponses, UserSharesGetIncomingInvitesListData, UserSharesGetIncomingInvitesListResponses, UserSharesGetOutgoingInvitesListData, UserSharesGetOutgoingInvitesListResponses, UserSharesGetSharesByUsersData, UserSharesGetSharesByUsersResponses, UserSharesRedeemInviteData, UserSharesRedeemInviteErrors, UserSharesRedeemInviteResponses } from './types.gen';

export type Options<TData extends TDataShape = TDataShape, ThrowOnError extends boolean = boolean, TResponse = unknown> = Options2<TData, ThrowOnError, TResponse> & {
/**
Expand All @@ -19,6 +19,89 @@ export type Options<TData extends TDataShape = TDataShape, ThrowOnError extends
meta?: Record<string, unknown>;
};

/**
* Gets information about the current token used to access this endpoint
*/
export const tokensSelfGetSelfTokenV2 = <ThrowOnError extends boolean = true>(options?: Options<TokensSelfGetSelfTokenV2Data, ThrowOnError>) => (options?.client ?? client).get<TokensSelfGetSelfTokenV2Responses, unknown, ThrowOnError, 'data'>({
responseTransformer: tokensSelfGetSelfTokenV2ResponseTransformer,
responseStyle: 'data',
url: '/2/tokens/self',
...options
});

/**
* Endpoint to delete potentially compromised api tokens
*/
export const tokensReportTokens = <ThrowOnError extends boolean = true>(options?: Options<TokensReportTokensData, ThrowOnError>) => (options?.client ?? client).post<TokensReportTokensResponses, unknown, ThrowOnError, 'data'>({
responseStyle: 'data',
url: '/2/tokens/report',
...options,
headers: {
'Content-Type': 'application/json',
...options?.headers
}
});

/**
* List all tokens for the current user
*/
export const tokensListTokensV2 = <ThrowOnError extends boolean = true>(options?: Options<TokensListTokensV2Data, ThrowOnError>) => (options?.client ?? client).get<TokensListTokensV2Responses, unknown, ThrowOnError, 'data'>({
responseTransformer: tokensListTokensV2ResponseTransformer,
responseStyle: 'data',
url: '/2/tokens',
...options
});

/**
* Create a new token
*/
export const tokensCreateTokenV2 = <ThrowOnError extends boolean = true>(options?: Options<TokensCreateTokenV2Data, ThrowOnError>) => (options?.client ?? client).post<TokensCreateTokenV2Responses, unknown, ThrowOnError, 'data'>({
responseTransformer: tokensCreateTokenV2ResponseTransformer,
responseStyle: 'data',
url: '/2/tokens',
...options,
headers: {
'Content-Type': 'application/json',
...options?.headers
}
});

/**
* Get a token by id
*/
export const tokensGetTokenByIdV2 = <ThrowOnError extends boolean = true>(options: Options<TokensGetTokenByIdV2Data, ThrowOnError>) => (options.client ?? client).get<TokensGetTokenByIdV2Responses, TokensGetTokenByIdV2Errors, ThrowOnError, 'data'>({
responseTransformer: tokensGetTokenByIdV2ResponseTransformer,
responseStyle: 'data',
url: '/2/tokens/{tokenId}',
...options
});

/**
* Edit a token
*/
export const tokensEditTokenV2 = <ThrowOnError extends boolean = true>(options: Options<TokensEditTokenV2Data, ThrowOnError>) => (options.client ?? client).patch<TokensEditTokenV2Responses, TokensEditTokenV2Errors, ThrowOnError, 'data'>({
responseStyle: 'data',
url: '/2/tokens/{tokenId}',
...options,
headers: {
'Content-Type': 'application/json',
...options.headers
}
});

/**
* Set whether a token is paused. A paused token may not send shocker control messages.
*/
export const tokensSetTokenPaused = <ThrowOnError extends boolean = true>(options: Options<TokensSetTokenPausedData, ThrowOnError>) => (options.client ?? client).patch<TokensSetTokenPausedResponses, TokensSetTokenPausedErrors, ThrowOnError, 'data'>({
responseStyle: 'data',
url: '/2/tokens/{tokenId}/paused',
...options,
headers: {
'Content-Type': 'application/json',
...options.headers
}
});

/**
* Check if a username is available
*/
Expand Down
Loading
Loading