api.ts 7.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158
  1. import * as Types from './types';
  2. import gql from 'graphql-tag';
  3. import * as VueApolloComposable from '@vue/apollo-composable';
  4. import * as VueCompositionApi from 'vue';
  5. export type ReactiveFunction<TParam> = () => TParam;
  6. 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 } };
  7. export type LoginMutationVariables = Types.Exact<{
  8. login: Types.Scalars['String'];
  9. password: Types.Scalars['String'];
  10. fingerprint: Types.Scalars['String'];
  11. }>;
  12. export type LoginMutation = { __typename?: 'Mutations', login?: { __typename?: 'LoginPayload', sessionId: string } | null | undefined };
  13. export type LogoutMutationVariables = Types.Exact<{ [key: string]: never; }>;
  14. export type LogoutMutation = { __typename?: 'Mutations', logout?: { __typename?: 'LogoutPayload', success: boolean } | null | undefined };
  15. export type CurrentUserQueryVariables = Types.Exact<{ [key: string]: never; }>;
  16. 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 } };
  17. export type SessionIdQueryVariables = Types.Exact<{ [key: string]: never; }>;
  18. export type SessionIdQuery = { __typename?: 'Queries', sessionId: string };
  19. export const ObjectAttributeValuesFragmentDoc = gql`
  20. fragment objectAttributeValues on ObjectAttributeValue {
  21. attribute {
  22. name
  23. display
  24. dataType
  25. dataOption
  26. screens
  27. editable
  28. active
  29. }
  30. value
  31. }
  32. `;
  33. export const LoginDocument = gql`
  34. mutation login($login: String!, $password: String!, $fingerprint: String!) {
  35. login(login: $login, password: $password, fingerprint: $fingerprint) {
  36. sessionId
  37. }
  38. }
  39. `;
  40. /**
  41. * __useLoginMutation__
  42. *
  43. * To run a mutation, you first call `useLoginMutation` within a Vue component and pass it any options that fit your needs.
  44. * When your component renders, `useLoginMutation` returns an object that includes:
  45. * - A mutate function that you can call at any time to execute the mutation
  46. * - Several other properties: https://v4.apollo.vuejs.org/api/use-mutation.html#return
  47. *
  48. * @param options that will be passed into the mutation, supported options are listed on: https://v4.apollo.vuejs.org/guide-composable/mutation.html#options;
  49. *
  50. * @example
  51. * const { mutate, loading, error, onDone } = useLoginMutation({
  52. * variables: {
  53. * login: // value for 'login'
  54. * password: // value for 'password'
  55. * fingerprint: // value for 'fingerprint'
  56. * },
  57. * });
  58. */
  59. export function useLoginMutation(options: VueApolloComposable.UseMutationOptions<Types.LoginMutation, Types.LoginMutationVariables> | ReactiveFunction<VueApolloComposable.UseMutationOptions<Types.LoginMutation, Types.LoginMutationVariables>>) {
  60. return VueApolloComposable.useMutation<Types.LoginMutation, Types.LoginMutationVariables>(LoginDocument, options);
  61. }
  62. export type LoginMutationCompositionFunctionResult = VueApolloComposable.UseMutationReturn<Types.LoginMutation, Types.LoginMutationVariables>;
  63. export const LogoutDocument = gql`
  64. mutation logout {
  65. logout {
  66. success
  67. }
  68. }
  69. `;
  70. /**
  71. * __useLogoutMutation__
  72. *
  73. * To run a mutation, you first call `useLogoutMutation` within a Vue component and pass it any options that fit your needs.
  74. * When your component renders, `useLogoutMutation` returns an object that includes:
  75. * - A mutate function that you can call at any time to execute the mutation
  76. * - Several other properties: https://v4.apollo.vuejs.org/api/use-mutation.html#return
  77. *
  78. * @param options that will be passed into the mutation, supported options are listed on: https://v4.apollo.vuejs.org/guide-composable/mutation.html#options;
  79. *
  80. * @example
  81. * const { mutate, loading, error, onDone } = useLogoutMutation();
  82. */
  83. export function useLogoutMutation(options: VueApolloComposable.UseMutationOptions<Types.LogoutMutation, Types.LogoutMutationVariables> | ReactiveFunction<VueApolloComposable.UseMutationOptions<Types.LogoutMutation, Types.LogoutMutationVariables>> = {}) {
  84. return VueApolloComposable.useMutation<Types.LogoutMutation, Types.LogoutMutationVariables>(LogoutDocument, options);
  85. }
  86. export type LogoutMutationCompositionFunctionResult = VueApolloComposable.UseMutationReturn<Types.LogoutMutation, Types.LogoutMutationVariables>;
  87. export const CurrentUserDocument = gql`
  88. query currentUser {
  89. currentUser {
  90. firstname
  91. lastname
  92. objectAttributeValues {
  93. ...objectAttributeValues
  94. }
  95. organization {
  96. name
  97. objectAttributeValues {
  98. ...objectAttributeValues
  99. }
  100. }
  101. }
  102. }
  103. ${ObjectAttributeValuesFragmentDoc}`;
  104. /**
  105. * __useCurrentUserQuery__
  106. *
  107. * To run a query within a Vue component, call `useCurrentUserQuery` and pass it any options that fit your needs.
  108. * When your component renders, `useCurrentUserQuery` returns an object from Apollo Client that contains result, loading and error properties
  109. * you can use to render your UI.
  110. *
  111. * @param options that will be passed into the query, supported options are listed on: https://v4.apollo.vuejs.org/guide-composable/query.html#options;
  112. *
  113. * @example
  114. * const { result, loading, error } = useCurrentUserQuery();
  115. */
  116. export function useCurrentUserQuery(options: VueApolloComposable.UseQueryOptions<Types.CurrentUserQuery, Types.CurrentUserQueryVariables> | VueCompositionApi.Ref<VueApolloComposable.UseQueryOptions<Types.CurrentUserQuery, Types.CurrentUserQueryVariables>> | ReactiveFunction<VueApolloComposable.UseQueryOptions<Types.CurrentUserQuery, Types.CurrentUserQueryVariables>> = {}) {
  117. return VueApolloComposable.useQuery<Types.CurrentUserQuery, Types.CurrentUserQueryVariables>(CurrentUserDocument, {}, options);
  118. }
  119. export type CurrentUserQueryCompositionFunctionResult = VueApolloComposable.UseQueryReturn<Types.CurrentUserQuery, Types.CurrentUserQueryVariables>;
  120. export const SessionIdDocument = gql`
  121. query sessionId {
  122. sessionId
  123. }
  124. `;
  125. /**
  126. * __useSessionIdQuery__
  127. *
  128. * To run a query within a Vue component, call `useSessionIdQuery` and pass it any options that fit your needs.
  129. * When your component renders, `useSessionIdQuery` returns an object from Apollo Client that contains result, loading and error properties
  130. * you can use to render your UI.
  131. *
  132. * @param options that will be passed into the query, supported options are listed on: https://v4.apollo.vuejs.org/guide-composable/query.html#options;
  133. *
  134. * @example
  135. * const { result, loading, error } = useSessionIdQuery();
  136. */
  137. export function useSessionIdQuery(options: VueApolloComposable.UseQueryOptions<Types.SessionIdQuery, Types.SessionIdQueryVariables> | VueCompositionApi.Ref<VueApolloComposable.UseQueryOptions<Types.SessionIdQuery, Types.SessionIdQueryVariables>> | ReactiveFunction<VueApolloComposable.UseQueryOptions<Types.SessionIdQuery, Types.SessionIdQueryVariables>> = {}) {
  138. return VueApolloComposable.useQuery<Types.SessionIdQuery, Types.SessionIdQueryVariables>(SessionIdDocument, {}, options);
  139. }
  140. export type SessionIdQueryCompositionFunctionResult = VueApolloComposable.UseQueryReturn<Types.SessionIdQuery, Types.SessionIdQueryVariables>;