diff --git a/sdk/bindings/CloudApiErrors.ts b/sdk/bindings/CloudApiErrors.ts index 433cd806..273cba52 100644 --- a/sdk/bindings/CloudApiErrors.ts +++ b/sdk/bindings/CloudApiErrors.ts @@ -1,3 +1,3 @@ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. -export type CloudApiErrors = "TeamDoesNotExist" | "UserDoesNotExist" | "CloudFeatureDisabled" | "InsufficientPermissions" | "TeamHasNoRegisteredApps" | "DatabaseError" | "MaximumUsersPerTeamReached" | "UserAlreadyBelongsToTheTeam" | "IncorrectPassword" | "AccessTokenFailure" | "RefreshTokenFailure" | "AppAlreadyExists" | "MaximumAppsPerTeamReached" | "TeamAlreadyExists" | "PersonalTeamAlreadyExists" | "EmailAlreadyExists" | "InternalServerError" | "UserDoesNotBelongsToTheTeam" | "InvalidName" | "UnauthorizedOriginError" | "AppDoesNotExist" | "UserAlreadyInvitedToTheTeam" | "MaximumInvitesPerTeamReached" | "InviteNotFound" | "ActionForbiddenForPersonalTeam" | "InviteDoesNotExist" | "InvalidPaginationCursor" | "InvalidOrExpiredVerificationCode" | "InvalidOrExpiredAuthCode" | "InvalidDomainName" | "DomainAlreadyVerified" | "DomainVerificationFailure" | "DomainNotFound" | "DomainVerificationNotStarted" | "DomainAlreadyVerifiedByAnotherApp" | "NoPendingDomainVerification" | "WebAuthnError" | "PasswordNotSet" | "UserDoesNotHavePasskey" | "PasskeyAlreadyExists" | "InvalidPasskeyCredential" | "PasskeyDoesNotExist" | "FailedToCreateTeam" | "DashboardImportFail" | "OriginHeaderRequired" | "InvalidOrigin" | "InvalidAction" | "AdminCannotLeaveTeam"; \ No newline at end of file +export type CloudApiErrors = "TeamDoesNotExist" | "UserDoesNotExist" | "CloudFeatureDisabled" | "InsufficientPermissions" | "TeamHasNoRegisteredApps" | "DatabaseError" | "MaximumUsersPerTeamReached" | "UserAlreadyBelongsToTheTeam" | "IncorrectPassword" | "AccessTokenFailure" | "RefreshTokenFailure" | "AppAlreadyExists" | "MaximumAppsPerTeamReached" | "TeamAlreadyExists" | "PersonalTeamAlreadyExists" | "EmailAlreadyExists" | "InternalServerError" | "UserDoesNotBelongsToTheTeam" | "InvalidName" | "UnauthorizedOriginError" | "AppDoesNotExist" | "UserAlreadyInvitedToTheTeam" | "MaximumInvitesPerTeamReached" | "InviteNotFound" | "ActionForbiddenForPersonalTeam" | "InviteDoesNotExist" | "InvalidPaginationCursor" | "InvalidOrExpiredVerificationCode" | "InvalidOrExpiredAuthCode" | "InvalidDomainName" | "DomainAlreadyVerified" | "DomainVerificationFailure" | "DomainNotFound" | "DomainVerificationNotStarted" | "DomainAlreadyVerifiedByAnotherApp" | "NoPendingDomainVerification" | "WebAuthnError" | "PasswordNotSet" | "UserDoesNotHavePasskey" | "PasskeyAlreadyExists" | "InvalidPasskeyCredential" | "PasskeyDoesNotExist" | "FailedToCreateTeam" | "DashboardImportFail" | "OriginHeaderRequired" | "InvalidOrigin" | "InvalidAction" | "AdminCannotLeaveTeam" | "GrafanaError"; \ No newline at end of file diff --git a/sdk/bindings/HttpCloudEndpoint.ts b/sdk/bindings/HttpCloudEndpoint.ts index 7c628271..3061c445 100644 --- a/sdk/bindings/HttpCloudEndpoint.ts +++ b/sdk/bindings/HttpCloudEndpoint.ts @@ -1,3 +1,3 @@ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. -export type HttpCloudEndpoint = "/register_new_app" | "/register_with_password_start" | "/register_with_password_finish" | "/login_with_password" | "/login_with_google" | "/refresh_token" | "/register_new_team" | "/remove_user_from_team" | "/get_user_joined_teams" | "/events" | "/invite_user_to_team" | "/accept_team_invite" | "/get_team_user_invites" | "/get_user_team_invites" | "/cancel_team_user_invite" | "/cancel_user_team_invite" | "/get_app_events" | "/reset_password_start" | "/reset_password_finish" | "/verify_domain_start" | "/verify_domain_finish" | "/remove_whitelisted_domain" | "/cancel_pending_domain_verification" | "/register_with_passkey_start" | "/register_with_passkey_finish" | "/reset_passkey_start" | "/reset_passkey_finish" | "/get_passkey_challenge" | "/delete_passkey" | "/add_passkey_start" | "/add_passkey_finish" | "/get_user_metadata" | "/get_team_metadata" | "/get_team_users_privileges" | "/change_user_privileges" | "/login_with_passkey_start" | "/login_with_passkey_finish" | "/verify_code" | "/leave_team"; \ No newline at end of file +export type HttpCloudEndpoint = "/register_new_app" | "/register_with_password_start" | "/register_with_password_finish" | "/login_with_password" | "/login_with_google" | "/refresh_token" | "/register_new_team" | "/remove_user_from_team" | "/get_user_joined_teams" | "/events" | "/invite_user_to_team" | "/accept_team_invite" | "/get_team_user_invites" | "/get_user_team_invites" | "/cancel_team_user_invite" | "/cancel_user_team_invite" | "/get_app_events" | "/reset_password_start" | "/reset_password_finish" | "/verify_domain_start" | "/verify_domain_finish" | "/remove_whitelisted_domain" | "/cancel_pending_domain_verification" | "/register_with_passkey_start" | "/register_with_passkey_finish" | "/reset_passkey_start" | "/reset_passkey_finish" | "/get_passkey_challenge" | "/delete_passkey" | "/add_passkey_start" | "/add_passkey_finish" | "/get_user_metadata" | "/get_team_metadata" | "/get_team_users_privileges" | "/change_user_privileges" | "/login_with_passkey_start" | "/login_with_passkey_finish" | "/verify_code" | "/leave_team" | "/delete_app" | "/delete_team"; \ No newline at end of file diff --git a/sdk/bindings/HttpDeleteAppRequest.ts b/sdk/bindings/HttpDeleteAppRequest.ts new file mode 100644 index 00000000..16cbfebc --- /dev/null +++ b/sdk/bindings/HttpDeleteAppRequest.ts @@ -0,0 +1,3 @@ +// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. + +export interface HttpDeleteAppRequest { appId: string, } \ No newline at end of file diff --git a/sdk/bindings/HttpDeleteTeamRequest.ts b/sdk/bindings/HttpDeleteTeamRequest.ts new file mode 100644 index 00000000..7ccb9b06 --- /dev/null +++ b/sdk/bindings/HttpDeleteTeamRequest.ts @@ -0,0 +1,3 @@ +// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. + +export interface HttpDeleteTeamRequest { teamId: string, } \ No newline at end of file diff --git a/sdk/bindings/index.ts b/sdk/bindings/index.ts index 56446ddd..86d8a152 100644 --- a/sdk/bindings/index.ts +++ b/sdk/bindings/index.ts @@ -51,6 +51,8 @@ export * from './HttpChangeUsersPrivilegesResponse'; export * from './HttpCloudEndpoint'; export * from './HttpConnectSessionRequest'; export * from './HttpConnectSessionResponse'; +export * from './HttpDeleteAppRequest'; +export * from './HttpDeleteTeamRequest'; export * from './HttpDropSessionsRequest'; export * from './HttpDropSessionsResponse'; export * from './HttpEndpoint'; diff --git a/sdk/packages/cloud/package.json b/sdk/packages/cloud/package.json index cbf69493..d5172f53 100644 --- a/sdk/packages/cloud/package.json +++ b/sdk/packages/cloud/package.json @@ -1,6 +1,6 @@ { "name": "@nightlylabs/nightly-cloud", - "version": "0.0.27", + "version": "0.0.28", "type": "module", "exports": { ".": { diff --git a/sdk/packages/cloud/src/app.ts b/sdk/packages/cloud/src/app.ts index cbf6bfc7..51374bee 100644 --- a/sdk/packages/cloud/src/app.ts +++ b/sdk/packages/cloud/src/app.ts @@ -9,6 +9,8 @@ import { HttpChangeUsersPrivilegesRequest, HttpChangeUsersPrivilegesResponse, HttpCloudEndpoint, + HttpDeleteAppRequest, + HttpDeleteTeamRequest, HttpGetAppEventsRequest, HttpGetAppEventsResponse, HttpGetTeamMetadataRequest, @@ -409,6 +411,10 @@ export class NightlyCloud { return response } + deleteTeam = async (request: HttpDeleteTeamRequest): Promise => { + await this.sendPostJson('/delete_team', EndpointType.Private, request) + } + registerNewApp = async ( request: HttpRegisterNewAppRequest ): Promise => { @@ -421,6 +427,10 @@ export class NightlyCloud { return response } + deleteApp = async (request: HttpDeleteAppRequest): Promise => { + await this.sendPostJson('/delete_app', EndpointType.Private, request) + } + inviteUserToTeam = async ( request: HttpInviteUserToTeamRequest ): Promise => { diff --git a/server/bindings/CloudApiErrors.ts b/server/bindings/CloudApiErrors.ts index 433cd806..273cba52 100644 --- a/server/bindings/CloudApiErrors.ts +++ b/server/bindings/CloudApiErrors.ts @@ -1,3 +1,3 @@ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. -export type CloudApiErrors = "TeamDoesNotExist" | "UserDoesNotExist" | "CloudFeatureDisabled" | "InsufficientPermissions" | "TeamHasNoRegisteredApps" | "DatabaseError" | "MaximumUsersPerTeamReached" | "UserAlreadyBelongsToTheTeam" | "IncorrectPassword" | "AccessTokenFailure" | "RefreshTokenFailure" | "AppAlreadyExists" | "MaximumAppsPerTeamReached" | "TeamAlreadyExists" | "PersonalTeamAlreadyExists" | "EmailAlreadyExists" | "InternalServerError" | "UserDoesNotBelongsToTheTeam" | "InvalidName" | "UnauthorizedOriginError" | "AppDoesNotExist" | "UserAlreadyInvitedToTheTeam" | "MaximumInvitesPerTeamReached" | "InviteNotFound" | "ActionForbiddenForPersonalTeam" | "InviteDoesNotExist" | "InvalidPaginationCursor" | "InvalidOrExpiredVerificationCode" | "InvalidOrExpiredAuthCode" | "InvalidDomainName" | "DomainAlreadyVerified" | "DomainVerificationFailure" | "DomainNotFound" | "DomainVerificationNotStarted" | "DomainAlreadyVerifiedByAnotherApp" | "NoPendingDomainVerification" | "WebAuthnError" | "PasswordNotSet" | "UserDoesNotHavePasskey" | "PasskeyAlreadyExists" | "InvalidPasskeyCredential" | "PasskeyDoesNotExist" | "FailedToCreateTeam" | "DashboardImportFail" | "OriginHeaderRequired" | "InvalidOrigin" | "InvalidAction" | "AdminCannotLeaveTeam"; \ No newline at end of file +export type CloudApiErrors = "TeamDoesNotExist" | "UserDoesNotExist" | "CloudFeatureDisabled" | "InsufficientPermissions" | "TeamHasNoRegisteredApps" | "DatabaseError" | "MaximumUsersPerTeamReached" | "UserAlreadyBelongsToTheTeam" | "IncorrectPassword" | "AccessTokenFailure" | "RefreshTokenFailure" | "AppAlreadyExists" | "MaximumAppsPerTeamReached" | "TeamAlreadyExists" | "PersonalTeamAlreadyExists" | "EmailAlreadyExists" | "InternalServerError" | "UserDoesNotBelongsToTheTeam" | "InvalidName" | "UnauthorizedOriginError" | "AppDoesNotExist" | "UserAlreadyInvitedToTheTeam" | "MaximumInvitesPerTeamReached" | "InviteNotFound" | "ActionForbiddenForPersonalTeam" | "InviteDoesNotExist" | "InvalidPaginationCursor" | "InvalidOrExpiredVerificationCode" | "InvalidOrExpiredAuthCode" | "InvalidDomainName" | "DomainAlreadyVerified" | "DomainVerificationFailure" | "DomainNotFound" | "DomainVerificationNotStarted" | "DomainAlreadyVerifiedByAnotherApp" | "NoPendingDomainVerification" | "WebAuthnError" | "PasswordNotSet" | "UserDoesNotHavePasskey" | "PasskeyAlreadyExists" | "InvalidPasskeyCredential" | "PasskeyDoesNotExist" | "FailedToCreateTeam" | "DashboardImportFail" | "OriginHeaderRequired" | "InvalidOrigin" | "InvalidAction" | "AdminCannotLeaveTeam" | "GrafanaError"; \ No newline at end of file diff --git a/server/bindings/HttpCloudEndpoint.ts b/server/bindings/HttpCloudEndpoint.ts index 7c628271..3061c445 100644 --- a/server/bindings/HttpCloudEndpoint.ts +++ b/server/bindings/HttpCloudEndpoint.ts @@ -1,3 +1,3 @@ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. -export type HttpCloudEndpoint = "/register_new_app" | "/register_with_password_start" | "/register_with_password_finish" | "/login_with_password" | "/login_with_google" | "/refresh_token" | "/register_new_team" | "/remove_user_from_team" | "/get_user_joined_teams" | "/events" | "/invite_user_to_team" | "/accept_team_invite" | "/get_team_user_invites" | "/get_user_team_invites" | "/cancel_team_user_invite" | "/cancel_user_team_invite" | "/get_app_events" | "/reset_password_start" | "/reset_password_finish" | "/verify_domain_start" | "/verify_domain_finish" | "/remove_whitelisted_domain" | "/cancel_pending_domain_verification" | "/register_with_passkey_start" | "/register_with_passkey_finish" | "/reset_passkey_start" | "/reset_passkey_finish" | "/get_passkey_challenge" | "/delete_passkey" | "/add_passkey_start" | "/add_passkey_finish" | "/get_user_metadata" | "/get_team_metadata" | "/get_team_users_privileges" | "/change_user_privileges" | "/login_with_passkey_start" | "/login_with_passkey_finish" | "/verify_code" | "/leave_team"; \ No newline at end of file +export type HttpCloudEndpoint = "/register_new_app" | "/register_with_password_start" | "/register_with_password_finish" | "/login_with_password" | "/login_with_google" | "/refresh_token" | "/register_new_team" | "/remove_user_from_team" | "/get_user_joined_teams" | "/events" | "/invite_user_to_team" | "/accept_team_invite" | "/get_team_user_invites" | "/get_user_team_invites" | "/cancel_team_user_invite" | "/cancel_user_team_invite" | "/get_app_events" | "/reset_password_start" | "/reset_password_finish" | "/verify_domain_start" | "/verify_domain_finish" | "/remove_whitelisted_domain" | "/cancel_pending_domain_verification" | "/register_with_passkey_start" | "/register_with_passkey_finish" | "/reset_passkey_start" | "/reset_passkey_finish" | "/get_passkey_challenge" | "/delete_passkey" | "/add_passkey_start" | "/add_passkey_finish" | "/get_user_metadata" | "/get_team_metadata" | "/get_team_users_privileges" | "/change_user_privileges" | "/login_with_passkey_start" | "/login_with_passkey_finish" | "/verify_code" | "/leave_team" | "/delete_app" | "/delete_team"; \ No newline at end of file diff --git a/server/bindings/HttpDeleteAppRequest.ts b/server/bindings/HttpDeleteAppRequest.ts new file mode 100644 index 00000000..16cbfebc --- /dev/null +++ b/server/bindings/HttpDeleteAppRequest.ts @@ -0,0 +1,3 @@ +// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. + +export interface HttpDeleteAppRequest { appId: string, } \ No newline at end of file diff --git a/server/bindings/HttpDeleteTeamRequest.ts b/server/bindings/HttpDeleteTeamRequest.ts new file mode 100644 index 00000000..7ccb9b06 --- /dev/null +++ b/server/bindings/HttpDeleteTeamRequest.ts @@ -0,0 +1,3 @@ +// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. + +export interface HttpDeleteTeamRequest { teamId: string, } \ No newline at end of file