api.ts 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415
  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. /** Key/value type with complex values. */
  24. export type KeyComplexValue = {
  25. __typename?: 'KeyComplexValue';
  26. key: Scalars['String'];
  27. value?: Maybe<Scalars['JSON']>;
  28. };
  29. /** Autogenerated return type of Login */
  30. export type LoginPayload = {
  31. __typename?: 'LoginPayload';
  32. /** The current session */
  33. sessionId: Scalars['String'];
  34. };
  35. /** Autogenerated return type of Logout */
  36. export type LogoutPayload = {
  37. __typename?: 'LogoutPayload';
  38. /** Was the logout successful? */
  39. success: Scalars['Boolean'];
  40. };
  41. /** All available mutations. */
  42. export type Mutations = {
  43. __typename?: 'Mutations';
  44. /** Performs a user login to create a session */
  45. login?: Maybe<LoginPayload>;
  46. /** End the current session */
  47. logout?: Maybe<LogoutPayload>;
  48. };
  49. /** All available mutations. */
  50. export type MutationsLoginArgs = {
  51. fingerprint: Scalars['String'];
  52. login: Scalars['String'];
  53. password: Scalars['String'];
  54. };
  55. /** An object with an ID. */
  56. export type Node = {
  57. /** ID of the object. */
  58. id: Scalars['ID'];
  59. };
  60. /** Data of one object attribute value of another object */
  61. export type ObjectAttributeValue = {
  62. __typename?: 'ObjectAttributeValue';
  63. /** The object attribute record */
  64. attribute: ObjectManagerAttribute;
  65. /** The value of the current object's object attribute */
  66. value?: Maybe<Scalars['String']>;
  67. };
  68. /** Custom object fields (only editable & active) */
  69. export type ObjectAttributeValueInterface = {
  70. objectAttributeValues: Array<ObjectAttributeValue>;
  71. };
  72. /** An object manager attribute record */
  73. export type ObjectManagerAttribute = Node & {
  74. __typename?: 'ObjectManagerAttribute';
  75. active: Scalars['Boolean'];
  76. /** Create date/time of the record */
  77. createdAt: Scalars['ISO8601DateTime'];
  78. /** User that created this record */
  79. createdBy: User;
  80. dataOption?: Maybe<Scalars['JSON']>;
  81. dataType: Scalars['String'];
  82. display: Scalars['String'];
  83. editable: Scalars['Boolean'];
  84. id: Scalars['ID'];
  85. name: Scalars['String'];
  86. position: Scalars['Int'];
  87. screens?: Maybe<Scalars['JSON']>;
  88. /** Last update date/time of the record */
  89. updatedAt: Scalars['ISO8601DateTime'];
  90. /** Last user that updated this record */
  91. updatedBy: User;
  92. };
  93. /** Organizations that users can belong to */
  94. export type Organization = Node & ObjectAttributeValueInterface & {
  95. __typename?: 'Organization';
  96. active: Scalars['Boolean'];
  97. /** Create date/time of the record */
  98. createdAt: Scalars['ISO8601DateTime'];
  99. /** User that created this record */
  100. createdBy: User;
  101. domain?: Maybe<Scalars['String']>;
  102. domainAssignment: Scalars['Boolean'];
  103. id: Scalars['ID'];
  104. members: UserConnection;
  105. name: Scalars['String'];
  106. note?: Maybe<Scalars['String']>;
  107. objectAttributeValues: Array<ObjectAttributeValue>;
  108. shared: Scalars['Boolean'];
  109. /** Last update date/time of the record */
  110. updatedAt: Scalars['ISO8601DateTime'];
  111. /** Last user that updated this record */
  112. updatedBy: User;
  113. };
  114. /** Organizations that users can belong to */
  115. export type OrganizationMembersArgs = {
  116. after?: Maybe<Scalars['String']>;
  117. before?: Maybe<Scalars['String']>;
  118. first?: Maybe<Scalars['Int']>;
  119. last?: Maybe<Scalars['Int']>;
  120. };
  121. /** Information about pagination in a connection. */
  122. export type PageInfo = {
  123. __typename?: 'PageInfo';
  124. /** When paginating forwards, the cursor to continue. */
  125. endCursor?: Maybe<Scalars['String']>;
  126. /** When paginating forwards, are there more items? */
  127. hasNextPage: Scalars['Boolean'];
  128. /** When paginating backwards, are there more items? */
  129. hasPreviousPage: Scalars['Boolean'];
  130. /** When paginating backwards, the cursor to continue. */
  131. startCursor?: Maybe<Scalars['String']>;
  132. };
  133. /** All available queries */
  134. export type Queries = {
  135. __typename?: 'Queries';
  136. /** Configuration required for front end operation (more results returned for authenticated users) */
  137. applicationConfig: Array<KeyComplexValue>;
  138. /** Information about the authenticated user */
  139. currentUser: User;
  140. /** Fetches an object given its ID. */
  141. node?: Maybe<Node>;
  142. /** Fetches a list of objects given a list of IDs. */
  143. nodes: Array<Maybe<Node>>;
  144. /** Information about the current session */
  145. sessionId: Scalars['String'];
  146. };
  147. /** All available queries */
  148. export type QueriesNodeArgs = {
  149. id: Scalars['ID'];
  150. };
  151. /** All available queries */
  152. export type QueriesNodesArgs = {
  153. ids: Array<Scalars['ID']>;
  154. };
  155. /** Users (admins, agents and customers) */
  156. export type User = Node & ObjectAttributeValueInterface & {
  157. __typename?: 'User';
  158. active: Scalars['Boolean'];
  159. /** Create date/time of the record */
  160. createdAt: Scalars['ISO8601DateTime'];
  161. /** User that created this record */
  162. createdById: Scalars['Int'];
  163. email?: Maybe<Scalars['String']>;
  164. fax?: Maybe<Scalars['String']>;
  165. firstname?: Maybe<Scalars['String']>;
  166. id: Scalars['ID'];
  167. image?: Maybe<Scalars['String']>;
  168. imageSource?: Maybe<Scalars['String']>;
  169. lastLogin?: Maybe<Scalars['ISO8601DateTime']>;
  170. lastname?: Maybe<Scalars['String']>;
  171. login: Scalars['String'];
  172. loginFailed: Scalars['Int'];
  173. mobile?: Maybe<Scalars['String']>;
  174. note?: Maybe<Scalars['String']>;
  175. objectAttributeValues: Array<ObjectAttributeValue>;
  176. organization?: Maybe<Organization>;
  177. outOfOffice: Scalars['Boolean'];
  178. outOfOfficeEndAt?: Maybe<Scalars['ISO8601Date']>;
  179. outOfOfficeReplacementId?: Maybe<Scalars['Int']>;
  180. outOfOfficeStartAt?: Maybe<Scalars['ISO8601Date']>;
  181. password?: Maybe<Scalars['String']>;
  182. phone?: Maybe<Scalars['String']>;
  183. preferences?: Maybe<Scalars['JSON']>;
  184. source?: Maybe<Scalars['String']>;
  185. /** Last update date/time of the record */
  186. updatedAt: Scalars['ISO8601DateTime'];
  187. /** Last user that updated this record */
  188. updatedById: Scalars['Int'];
  189. verified: Scalars['Boolean'];
  190. vip?: Maybe<Scalars['Boolean']>;
  191. web?: Maybe<Scalars['String']>;
  192. };
  193. /** The connection type for User. */
  194. export type UserConnection = {
  195. __typename?: 'UserConnection';
  196. /** A list of edges. */
  197. edges?: Maybe<Array<Maybe<UserEdge>>>;
  198. /** A list of nodes. */
  199. nodes?: Maybe<Array<Maybe<User>>>;
  200. /** Information to aid in pagination. */
  201. pageInfo: PageInfo;
  202. };
  203. /** An edge in a connection. */
  204. export type UserEdge = {
  205. __typename?: 'UserEdge';
  206. /** A cursor for use in pagination. */
  207. cursor: Scalars['String'];
  208. /** The item at the end of the edge. */
  209. node?: Maybe<User>;
  210. };
  211. export type ObjectAttributeValuesFragment = { __typename?: 'ObjectAttributeValue', value?: string | null | undefined, attribute: { __typename?: 'ObjectManagerAttribute', name: string, display: string, dataType: string, dataOption?: any | null | undefined, screens?: any | null | undefined, editable: boolean, active: boolean } };
  212. export type LoginMutationVariables = Exact<{
  213. login: Scalars['String'];
  214. password: Scalars['String'];
  215. fingerprint: Scalars['String'];
  216. }>;
  217. export type LoginMutation = { __typename?: 'Mutations', login?: { __typename?: 'LoginPayload', sessionId: string } | null | undefined };
  218. export type LogoutMutationVariables = Exact<{ [key: string]: never; }>;
  219. export type LogoutMutation = { __typename?: 'Mutations', logout?: { __typename?: 'LogoutPayload', success: boolean } | null | undefined };
  220. export type ApplicationConfigQueryVariables = Exact<{ [key: string]: never; }>;
  221. export type ApplicationConfigQuery = { __typename?: 'Queries', applicationConfig: Array<{ __typename?: 'KeyComplexValue', key: string, value?: any | null | undefined }> };
  222. export type CurrentUserQueryVariables = Exact<{ [key: string]: never; }>;
  223. export type CurrentUserQuery = { __typename?: 'Queries', currentUser: { __typename?: 'User', firstname?: string | null | undefined, lastname?: string | null | undefined, objectAttributeValues: Array<{ __typename?: 'ObjectAttributeValue', value?: string | null | undefined, attribute: { __typename?: 'ObjectManagerAttribute', name: string, display: string, dataType: string, dataOption?: any | null | undefined, screens?: any | null | undefined, editable: boolean, active: boolean } }>, organization?: { __typename?: 'Organization', name: string, objectAttributeValues: Array<{ __typename?: 'ObjectAttributeValue', value?: string | null | undefined, attribute: { __typename?: 'ObjectManagerAttribute', name: string, display: string, dataType: string, dataOption?: any | null | undefined, screens?: any | null | undefined, editable: boolean, active: boolean } }> } | null | undefined } };
  224. export type SessionIdQueryVariables = Exact<{ [key: string]: never; }>;
  225. export type SessionIdQuery = { __typename?: 'Queries', sessionId: string };
  226. export const ObjectAttributeValuesFragmentDoc = gql`
  227. fragment objectAttributeValues on ObjectAttributeValue {
  228. attribute {
  229. name
  230. display
  231. dataType
  232. dataOption
  233. screens
  234. editable
  235. active
  236. }
  237. value
  238. }
  239. `;
  240. export const LoginDocument = gql`
  241. mutation login($login: String!, $password: String!, $fingerprint: String!) {
  242. login(login: $login, password: $password, fingerprint: $fingerprint) {
  243. sessionId
  244. }
  245. }
  246. `;
  247. /**
  248. * __useLoginMutation__
  249. *
  250. * To run a mutation, you first call `useLoginMutation` within a Vue component and pass it any options that fit your needs.
  251. * When your component renders, `useLoginMutation` returns an object that includes:
  252. * - A mutate function that you can call at any time to execute the mutation
  253. * - Several other properties: https://v4.apollo.vuejs.org/api/use-mutation.html#return
  254. *
  255. * @param options that will be passed into the mutation, supported options are listed on: https://v4.apollo.vuejs.org/guide-composable/mutation.html#options;
  256. *
  257. * @example
  258. * const { mutate, loading, error, onDone } = useLoginMutation({
  259. * variables: {
  260. * login: // value for 'login'
  261. * password: // value for 'password'
  262. * fingerprint: // value for 'fingerprint'
  263. * },
  264. * });
  265. */
  266. export function useLoginMutation(options: VueApolloComposable.UseMutationOptions<LoginMutation, LoginMutationVariables> | ReactiveFunction<VueApolloComposable.UseMutationOptions<LoginMutation, LoginMutationVariables>>) {
  267. return VueApolloComposable.useMutation<LoginMutation, LoginMutationVariables>(LoginDocument, options);
  268. }
  269. export type LoginMutationCompositionFunctionResult = VueApolloComposable.UseMutationReturn<LoginMutation, LoginMutationVariables>;
  270. export const LogoutDocument = gql`
  271. mutation logout {
  272. logout {
  273. success
  274. }
  275. }
  276. `;
  277. /**
  278. * __useLogoutMutation__
  279. *
  280. * To run a mutation, you first call `useLogoutMutation` within a Vue component and pass it any options that fit your needs.
  281. * When your component renders, `useLogoutMutation` returns an object that includes:
  282. * - A mutate function that you can call at any time to execute the mutation
  283. * - Several other properties: https://v4.apollo.vuejs.org/api/use-mutation.html#return
  284. *
  285. * @param options that will be passed into the mutation, supported options are listed on: https://v4.apollo.vuejs.org/guide-composable/mutation.html#options;
  286. *
  287. * @example
  288. * const { mutate, loading, error, onDone } = useLogoutMutation();
  289. */
  290. export function useLogoutMutation(options: VueApolloComposable.UseMutationOptions<LogoutMutation, LogoutMutationVariables> | ReactiveFunction<VueApolloComposable.UseMutationOptions<LogoutMutation, LogoutMutationVariables>> = {}) {
  291. return VueApolloComposable.useMutation<LogoutMutation, LogoutMutationVariables>(LogoutDocument, options);
  292. }
  293. export type LogoutMutationCompositionFunctionResult = VueApolloComposable.UseMutationReturn<LogoutMutation, LogoutMutationVariables>;
  294. export const ApplicationConfigDocument = gql`
  295. query applicationConfig {
  296. applicationConfig {
  297. key
  298. value
  299. }
  300. }
  301. `;
  302. /**
  303. * __useApplicationConfigQuery__
  304. *
  305. * To run a query within a Vue component, call `useApplicationConfigQuery` and pass it any options that fit your needs.
  306. * When your component renders, `useApplicationConfigQuery` returns an object from Apollo Client that contains result, loading and error properties
  307. * you can use to render your UI.
  308. *
  309. * @param options that will be passed into the query, supported options are listed on: https://v4.apollo.vuejs.org/guide-composable/query.html#options;
  310. *
  311. * @example
  312. * const { result, loading, error } = useApplicationConfigQuery();
  313. */
  314. export function useApplicationConfigQuery(options: VueApolloComposable.UseQueryOptions<ApplicationConfigQuery, ApplicationConfigQueryVariables> | VueCompositionApi.Ref<VueApolloComposable.UseQueryOptions<ApplicationConfigQuery, ApplicationConfigQueryVariables>> | ReactiveFunction<VueApolloComposable.UseQueryOptions<ApplicationConfigQuery, ApplicationConfigQueryVariables>> = {}) {
  315. return VueApolloComposable.useQuery<ApplicationConfigQuery, ApplicationConfigQueryVariables>(ApplicationConfigDocument, {}, options);
  316. }
  317. export type ApplicationConfigQueryCompositionFunctionResult = VueApolloComposable.UseQueryReturn<ApplicationConfigQuery, ApplicationConfigQueryVariables>;
  318. export const CurrentUserDocument = gql`
  319. query currentUser {
  320. currentUser {
  321. firstname
  322. lastname
  323. objectAttributeValues {
  324. ...objectAttributeValues
  325. }
  326. organization {
  327. name
  328. objectAttributeValues {
  329. ...objectAttributeValues
  330. }
  331. }
  332. }
  333. }
  334. ${ObjectAttributeValuesFragmentDoc}`;
  335. /**
  336. * __useCurrentUserQuery__
  337. *
  338. * To run a query within a Vue component, call `useCurrentUserQuery` and pass it any options that fit your needs.
  339. * When your component renders, `useCurrentUserQuery` returns an object from Apollo Client that contains result, loading and error properties
  340. * you can use to render your UI.
  341. *
  342. * @param options that will be passed into the query, supported options are listed on: https://v4.apollo.vuejs.org/guide-composable/query.html#options;
  343. *
  344. * @example
  345. * const { result, loading, error } = useCurrentUserQuery();
  346. */
  347. export function useCurrentUserQuery(options: VueApolloComposable.UseQueryOptions<CurrentUserQuery, CurrentUserQueryVariables> | VueCompositionApi.Ref<VueApolloComposable.UseQueryOptions<CurrentUserQuery, CurrentUserQueryVariables>> | ReactiveFunction<VueApolloComposable.UseQueryOptions<CurrentUserQuery, CurrentUserQueryVariables>> = {}) {
  348. return VueApolloComposable.useQuery<CurrentUserQuery, CurrentUserQueryVariables>(CurrentUserDocument, {}, options);
  349. }
  350. export type CurrentUserQueryCompositionFunctionResult = VueApolloComposable.UseQueryReturn<CurrentUserQuery, CurrentUserQueryVariables>;
  351. export const SessionIdDocument = gql`
  352. query sessionId {
  353. sessionId
  354. }
  355. `;
  356. /**
  357. * __useSessionIdQuery__
  358. *
  359. * To run a query within a Vue component, call `useSessionIdQuery` and pass it any options that fit your needs.
  360. * When your component renders, `useSessionIdQuery` returns an object from Apollo Client that contains result, loading and error properties
  361. * you can use to render your UI.
  362. *
  363. * @param options that will be passed into the query, supported options are listed on: https://v4.apollo.vuejs.org/guide-composable/query.html#options;
  364. *
  365. * @example
  366. * const { result, loading, error } = useSessionIdQuery();
  367. */
  368. export function useSessionIdQuery(options: VueApolloComposable.UseQueryOptions<SessionIdQuery, SessionIdQueryVariables> | VueCompositionApi.Ref<VueApolloComposable.UseQueryOptions<SessionIdQuery, SessionIdQueryVariables>> | ReactiveFunction<VueApolloComposable.UseQueryOptions<SessionIdQuery, SessionIdQueryVariables>> = {}) {
  369. return VueApolloComposable.useQuery<SessionIdQuery, SessionIdQueryVariables>(SessionIdDocument, {}, options);
  370. }
  371. export type SessionIdQueryCompositionFunctionResult = VueApolloComposable.UseQueryReturn<SessionIdQuery, SessionIdQueryVariables>;