api.ts 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307
  1. import gql from 'graphql-tag';
  2. import * as VueApolloComposable from '@vue/apollo-composable';
  3. import * as VueCompositionApi from 'vue';
  4. export type Maybe<T> = T | null;
  5. export type Exact<T extends { [key: string]: unknown }> = { [K in keyof T]: T[K] };
  6. export type MakeOptional<T, K extends keyof T> = Omit<T, K> & { [SubKey in K]?: Maybe<T[SubKey]> };
  7. export type MakeMaybe<T, K extends keyof T> = Omit<T, K> & { [SubKey in K]: Maybe<T[SubKey]> };
  8. export type ReactiveFunction<TParam> = () => TParam;
  9. /** All built-in and custom scalars, mapped to their actual values */
  10. export type Scalars = {
  11. ID: string;
  12. String: string;
  13. Boolean: boolean;
  14. Int: number;
  15. Float: number;
  16. /** An ISO 8601-encoded date */
  17. ISO8601Date: any;
  18. /** An ISO 8601-encoded datetime */
  19. ISO8601DateTime: any;
  20. /** Represents untyped JSON */
  21. JSON: any;
  22. };
  23. /** Autogenerated return type of Login */
  24. export type LoginPayload = {
  25. __typename?: 'LoginPayload';
  26. /** The logged-in user */
  27. currentUser: User;
  28. /** The current session */
  29. session: Session;
  30. };
  31. /** Autogenerated return type of Logout */
  32. export type LogoutPayload = {
  33. __typename?: 'LogoutPayload';
  34. /** Was the logout successful? */
  35. success: Scalars['Boolean'];
  36. };
  37. /** All available mutations. */
  38. export type Mutations = {
  39. __typename?: 'Mutations';
  40. /** Performs a user login to create a session */
  41. login?: Maybe<LoginPayload>;
  42. /** End the current session */
  43. logout?: Maybe<LogoutPayload>;
  44. };
  45. /** All available mutations. */
  46. export type MutationsLoginArgs = {
  47. fingerprint: Scalars['String'];
  48. login: Scalars['String'];
  49. password: Scalars['String'];
  50. };
  51. /** An object with an ID. */
  52. export type Node = {
  53. /** ID of the object. */
  54. id: Scalars['ID'];
  55. };
  56. /** Organizations that users can belong to */
  57. export type Organization = Node & {
  58. __typename?: 'Organization';
  59. active: Scalars['Boolean'];
  60. /** Create date/time of the record */
  61. createdAt: Scalars['ISO8601DateTime'];
  62. /** User that created this record */
  63. createdBy: User;
  64. domain?: Maybe<Scalars['String']>;
  65. domainAssignment: Scalars['Boolean'];
  66. id: Scalars['ID'];
  67. members: UserConnection;
  68. name: Scalars['String'];
  69. note?: Maybe<Scalars['String']>;
  70. shared: Scalars['Boolean'];
  71. /** Last update date/time of the record */
  72. updatedAt: Scalars['ISO8601DateTime'];
  73. /** Last user that updated this record */
  74. updatedBy: User;
  75. };
  76. /** Organizations that users can belong to */
  77. export type OrganizationMembersArgs = {
  78. after?: Maybe<Scalars['String']>;
  79. before?: Maybe<Scalars['String']>;
  80. first?: Maybe<Scalars['Int']>;
  81. last?: Maybe<Scalars['Int']>;
  82. };
  83. /** Information about pagination in a connection. */
  84. export type PageInfo = {
  85. __typename?: 'PageInfo';
  86. /** When paginating forwards, the cursor to continue. */
  87. endCursor?: Maybe<Scalars['String']>;
  88. /** When paginating forwards, are there more items? */
  89. hasNextPage: Scalars['Boolean'];
  90. /** When paginating backwards, are there more items? */
  91. hasPreviousPage: Scalars['Boolean'];
  92. /** When paginating backwards, the cursor to continue. */
  93. startCursor?: Maybe<Scalars['String']>;
  94. };
  95. /** All available queries */
  96. export type Queries = {
  97. __typename?: 'Queries';
  98. /** Fetches an object given its ID. */
  99. node?: Maybe<Node>;
  100. /** Fetches a list of objects given a list of IDs. */
  101. nodes: Array<Maybe<Node>>;
  102. /** Information about the current user session */
  103. session: Session;
  104. };
  105. /** All available queries */
  106. export type QueriesNodeArgs = {
  107. id: Scalars['ID'];
  108. };
  109. /** All available queries */
  110. export type QueriesNodesArgs = {
  111. ids: Array<Scalars['ID']>;
  112. };
  113. /** Data of a current session */
  114. export type Session = {
  115. __typename?: 'Session';
  116. data?: Maybe<Scalars['JSON']>;
  117. sessionId: Scalars['String'];
  118. };
  119. /** Users (admins, agents and customers) */
  120. export type User = Node & {
  121. __typename?: 'User';
  122. active: Scalars['Boolean'];
  123. address?: Maybe<Scalars['String']>;
  124. city?: Maybe<Scalars['String']>;
  125. country?: Maybe<Scalars['String']>;
  126. /** Create date/time of the record */
  127. createdAt: Scalars['ISO8601DateTime'];
  128. /** User that created this record */
  129. createdById: Scalars['Int'];
  130. department?: Maybe<Scalars['String']>;
  131. email?: Maybe<Scalars['String']>;
  132. fax?: Maybe<Scalars['String']>;
  133. firstname?: Maybe<Scalars['String']>;
  134. id: Scalars['ID'];
  135. image?: Maybe<Scalars['String']>;
  136. imageSource?: Maybe<Scalars['String']>;
  137. lastLogin?: Maybe<Scalars['ISO8601DateTime']>;
  138. lastname?: Maybe<Scalars['String']>;
  139. login: Scalars['String'];
  140. loginFailed: Scalars['Int'];
  141. mobile?: Maybe<Scalars['String']>;
  142. note?: Maybe<Scalars['String']>;
  143. organization?: Maybe<Organization>;
  144. outOfOffice: Scalars['Boolean'];
  145. outOfOfficeEndAt?: Maybe<Scalars['ISO8601Date']>;
  146. outOfOfficeReplacementId?: Maybe<Scalars['Int']>;
  147. outOfOfficeStartAt?: Maybe<Scalars['ISO8601Date']>;
  148. password?: Maybe<Scalars['String']>;
  149. phone?: Maybe<Scalars['String']>;
  150. preferences?: Maybe<Scalars['JSON']>;
  151. source?: Maybe<Scalars['String']>;
  152. street?: Maybe<Scalars['String']>;
  153. /** Last update date/time of the record */
  154. updatedAt: Scalars['ISO8601DateTime'];
  155. /** Last user that updated this record */
  156. updatedById: Scalars['Int'];
  157. verified: Scalars['Boolean'];
  158. vip?: Maybe<Scalars['Boolean']>;
  159. web?: Maybe<Scalars['String']>;
  160. zip?: Maybe<Scalars['String']>;
  161. };
  162. /** The connection type for User. */
  163. export type UserConnection = {
  164. __typename?: 'UserConnection';
  165. /** A list of edges. */
  166. edges?: Maybe<Array<Maybe<UserEdge>>>;
  167. /** A list of nodes. */
  168. nodes?: Maybe<Array<Maybe<User>>>;
  169. /** Information to aid in pagination. */
  170. pageInfo: PageInfo;
  171. };
  172. /** An edge in a connection. */
  173. export type UserEdge = {
  174. __typename?: 'UserEdge';
  175. /** A cursor for use in pagination. */
  176. cursor: Scalars['String'];
  177. /** The item at the end of the edge. */
  178. node?: Maybe<User>;
  179. };
  180. export type LoginMutationVariables = Exact<{
  181. login: Scalars['String'];
  182. password: Scalars['String'];
  183. fingerprint: Scalars['String'];
  184. }>;
  185. export type LoginMutation = { __typename?: 'Mutations', login?: { __typename?: 'LoginPayload', currentUser: { __typename?: 'User', firstname?: string | null | undefined, lastname?: string | null | undefined }, session: { __typename?: 'Session', sessionId: string, data?: any | null | undefined } } | null | undefined };
  186. export type LogoutMutationVariables = Exact<{ [key: string]: never; }>;
  187. export type LogoutMutation = { __typename?: 'Mutations', logout?: { __typename?: 'LogoutPayload', success: boolean } | null | undefined };
  188. export type SessionQueryVariables = Exact<{ [key: string]: never; }>;
  189. export type SessionQuery = { __typename?: 'Queries', session: { __typename?: 'Session', sessionId: string, data?: any | null | undefined } };
  190. export const LoginDocument = gql`
  191. mutation login($login: String!, $password: String!, $fingerprint: String!) {
  192. login(login: $login, password: $password, fingerprint: $fingerprint) {
  193. currentUser {
  194. firstname
  195. lastname
  196. }
  197. session {
  198. sessionId
  199. data
  200. }
  201. }
  202. }
  203. `;
  204. /**
  205. * __useLoginMutation__
  206. *
  207. * To run a mutation, you first call `useLoginMutation` within a Vue component and pass it any options that fit your needs.
  208. * When your component renders, `useLoginMutation` returns an object that includes:
  209. * - A mutate function that you can call at any time to execute the mutation
  210. * - Several other properties: https://v4.apollo.vuejs.org/api/use-mutation.html#return
  211. *
  212. * @param options that will be passed into the mutation, supported options are listed on: https://v4.apollo.vuejs.org/guide-composable/mutation.html#options;
  213. *
  214. * @example
  215. * const { mutate, loading, error, onDone } = useLoginMutation({
  216. * variables: {
  217. * login: // value for 'login'
  218. * password: // value for 'password'
  219. * fingerprint: // value for 'fingerprint'
  220. * },
  221. * });
  222. */
  223. export function useLoginMutation(options: VueApolloComposable.UseMutationOptions<LoginMutation, LoginMutationVariables> | ReactiveFunction<VueApolloComposable.UseMutationOptions<LoginMutation, LoginMutationVariables>>) {
  224. return VueApolloComposable.useMutation<LoginMutation, LoginMutationVariables>(LoginDocument, options);
  225. }
  226. export type LoginMutationCompositionFunctionResult = VueApolloComposable.UseMutationReturn<LoginMutation, LoginMutationVariables>;
  227. export const LogoutDocument = gql`
  228. mutation logout {
  229. logout {
  230. success
  231. }
  232. }
  233. `;
  234. /**
  235. * __useLogoutMutation__
  236. *
  237. * To run a mutation, you first call `useLogoutMutation` within a Vue component and pass it any options that fit your needs.
  238. * When your component renders, `useLogoutMutation` returns an object that includes:
  239. * - A mutate function that you can call at any time to execute the mutation
  240. * - Several other properties: https://v4.apollo.vuejs.org/api/use-mutation.html#return
  241. *
  242. * @param options that will be passed into the mutation, supported options are listed on: https://v4.apollo.vuejs.org/guide-composable/mutation.html#options;
  243. *
  244. * @example
  245. * const { mutate, loading, error, onDone } = useLogoutMutation();
  246. */
  247. export function useLogoutMutation(options: VueApolloComposable.UseMutationOptions<LogoutMutation, LogoutMutationVariables> | ReactiveFunction<VueApolloComposable.UseMutationOptions<LogoutMutation, LogoutMutationVariables>> = {}) {
  248. return VueApolloComposable.useMutation<LogoutMutation, LogoutMutationVariables>(LogoutDocument, options);
  249. }
  250. export type LogoutMutationCompositionFunctionResult = VueApolloComposable.UseMutationReturn<LogoutMutation, LogoutMutationVariables>;
  251. export const SessionDocument = gql`
  252. query session {
  253. session {
  254. sessionId
  255. data
  256. }
  257. }
  258. `;
  259. /**
  260. * __useSessionQuery__
  261. *
  262. * To run a query within a Vue component, call `useSessionQuery` and pass it any options that fit your needs.
  263. * When your component renders, `useSessionQuery` returns an object from Apollo Client that contains result, loading and error properties
  264. * you can use to render your UI.
  265. *
  266. * @param options that will be passed into the query, supported options are listed on: https://v4.apollo.vuejs.org/guide-composable/query.html#options;
  267. *
  268. * @example
  269. * const { result, loading, error } = useSessionQuery();
  270. */
  271. export function useSessionQuery(options: VueApolloComposable.UseQueryOptions<SessionQuery, SessionQueryVariables> | VueCompositionApi.Ref<VueApolloComposable.UseQueryOptions<SessionQuery, SessionQueryVariables>> | ReactiveFunction<VueApolloComposable.UseQueryOptions<SessionQuery, SessionQueryVariables>> = {}) {
  272. return VueApolloComposable.useQuery<SessionQuery, SessionQueryVariables>(SessionDocument, {}, options);
  273. }
  274. export type SessionQueryCompositionFunctionResult = VueApolloComposable.UseQueryReturn<SessionQuery, SessionQueryVariables>;