Skip to content

Commit

Permalink
chore: cleanup backup section
Browse files Browse the repository at this point in the history
  • Loading branch information
apotdevin committed May 5, 2022
1 parent d91ad11 commit 19219d7
Show file tree
Hide file tree
Showing 11 changed files with 269 additions and 192 deletions.
12 changes: 11 additions & 1 deletion schema.gql
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ type AmbossSubscription {
}

type AmbossUser {
subscription: AmbossSubscription
backups: UserBackupInfo!
subscription: AmbossSubscription!
}

type AuthResponse {
Expand Down Expand Up @@ -418,6 +419,7 @@ type Mutation {
logout: Boolean!
openChannel(amount: Float!, isPrivate: Boolean, partnerPublicKey: String!, pushTokens: Float = 0, tokensPerVByte: Float): OpenOrCloseChannel!
pay(max_fee: Float!, max_paths: Float!, out: [String!], request: String!): Boolean!
pushBackup: Boolean!
removePeer(publicKey: String): Boolean!
removeTwofaSecret(token: String!): Boolean!
sendMessage(maxFee: Float, message: String!, messageType: String, publicKey: String!, tokens: Float): Float!
Expand Down Expand Up @@ -733,6 +735,14 @@ input UpdateRoutingFeesParams {
transaction_vout: Float
}

type UserBackupInfo {
available_size: String!
last_update: String
last_update_size: String
remaining_size: String!
total_size_saved: String!
}

type Utxo {
address: String!
address_format: String!
Expand Down
153 changes: 0 additions & 153 deletions src/client/pages/token.tsx

This file was deleted.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 7 additions & 0 deletions src/client/src/graphql/mutations/pushBackup.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import { gql } from '@apollo/client';

export const PUSH_BACKUP = gql`
mutation PushBackup {
pushBackup
}
`;

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 7 additions & 0 deletions src/client/src/graphql/queries/getAmbossUser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,13 @@ export const GET_AMBOSS_USER = gql`
subscribed
upgradable
}
backups {
last_update
last_update_size
total_size_saved
available_size
remaining_size
}
}
}
`;
13 changes: 12 additions & 1 deletion src/client/src/graphql/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@ export type AmbossSubscription = {

export type AmbossUser = {
__typename?: 'AmbossUser';
subscription?: Maybe<AmbossSubscription>;
backups: UserBackupInfo;
subscription: AmbossSubscription;
};

export type AuthResponse = {
Expand Down Expand Up @@ -481,6 +482,7 @@ export type Mutation = {
logout: Scalars['Boolean'];
openChannel: OpenOrCloseChannel;
pay: Scalars['Boolean'];
pushBackup: Scalars['Boolean'];
removePeer: Scalars['Boolean'];
removeTwofaSecret: Scalars['Boolean'];
sendMessage: Scalars['Float'];
Expand Down Expand Up @@ -1067,6 +1069,15 @@ export type UpdateRoutingFeesParams = {
transaction_vout?: InputMaybe<Scalars['Float']>;
};

export type UserBackupInfo = {
__typename?: 'UserBackupInfo';
available_size: Scalars['String'];
last_update?: Maybe<Scalars['String']>;
last_update_size?: Maybe<Scalars['String']>;
remaining_size: Scalars['String'];
total_size_saved: Scalars['String'];
};

export type Utxo = {
__typename?: 'Utxo';
address: Scalars['String'];
Expand Down
2 changes: 1 addition & 1 deletion src/client/src/hooks/UseAmbossUser.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,5 @@ export const useAmbossUser = () => {
return { user: null, loading };
}

return { user: data.getAmbossUser.subscription, loading };
return { user: data.getAmbossUser, loading };
};
Loading

0 comments on commit 19219d7

Please sign in to comment.