@jsb188/graphql 1.1.3 → 1.1.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (39) hide show
  1. package/cache/config.ts +3 -3
  2. package/cache/index.ts +173 -85
  3. package/gql/fragments/accountAuthFragments.ts +3 -9
  4. package/gql/fragments/accountFragments.ts +11 -0
  5. package/gql/fragments/logFragments.ts +25 -0
  6. package/gql/fragments/organizationFragments.ts +10 -2
  7. package/gql/mutations/accountMutations.ts +21 -0
  8. package/gql/mutations/aiChatMutations.ts +1 -0
  9. package/gql/mutations/authMutations.ts +171 -0
  10. package/gql/mutations/index.ts +7 -0
  11. package/gql/mutations/logMutations.ts +43 -0
  12. package/gql/mutations/userAuthMutations.ts +0 -163
  13. package/gql/queries/aiChatQueries.ts +1 -0
  14. package/gql/queries/appQueries.ts +2 -1
  15. package/gql/queries/logQueries.ts +37 -0
  16. package/gql/queries/organizationQueries.ts +1 -0
  17. package/hooks/index.ts +134 -75
  18. package/hooks/use-account-mtn.ts +43 -0
  19. package/hooks/use-aiChat-mtn.ts +96 -0
  20. package/hooks/use-aiChat-qry.ts +65 -3
  21. package/hooks/use-auth-mtn.ts +99 -112
  22. package/hooks/use-log-mtn.ts +85 -0
  23. package/hooks/use-log-qry.ts +77 -0
  24. package/package.json +10 -20
  25. package/types.d.ts +1 -0
  26. package/gql/fragments/cardFragments.ts +0 -15
  27. package/gql/fragments/chatFragments.ts +0 -98
  28. package/gql/fragments/journalFragments.ts +0 -14
  29. package/gql/fragments/userAuthFragments.ts +0 -8
  30. package/gql/fragments/userFragments.ts +0 -69
  31. package/gql/mutations/accountAuthMutations.ts +0 -81
  32. package/gql/mutations/chatMutations.ts +0 -116
  33. package/gql/mutations/journalMutations.ts +0 -2
  34. package/gql/mutations/userMutations.ts +0 -89
  35. package/gql/queries/cardQueries.ts +0 -24
  36. package/gql/queries/chatQueries.ts +0 -86
  37. package/gql/queries/journalQueries.ts +0 -28
  38. package/gql/queries/userQueries.ts +0 -104
  39. package/hooks/use-journal-qry.ts +0 -50
@@ -0,0 +1,171 @@
1
+ import { gql } from 'graphql-tag';
2
+ import { accountAuthFragment } from '../fragments/accountAuthFragments';
3
+ import { emailFragment, phoneFragment } from '../fragments/otherFragments';
4
+ import { accountFragment } from '../fragments/accountFragments';
5
+
6
+ const authenticateResultText = `...accountAuthFragment
7
+
8
+ account {
9
+ ...accountFragment
10
+
11
+ email {
12
+ ...emailFragment
13
+ }
14
+
15
+ phone {
16
+ ...phoneFragment
17
+ }
18
+ }`;
19
+
20
+ const authenticateFragments = `
21
+ ${accountAuthFragment}
22
+ ${accountFragment}
23
+ ${emailFragment}
24
+ ${phoneFragment}
25
+ `;
26
+
27
+ export const authenticateWithPasswordMtn = gql`
28
+ mutation authenticateWithPassword (
29
+ $identifier: String!
30
+ $password: String!
31
+ ) {
32
+ authenticateWithPassword (
33
+ identifier: $identifier
34
+ password: $password
35
+ ) {
36
+ ${authenticateResultText}
37
+ }
38
+ }
39
+ ${authenticateFragments}
40
+ `;
41
+
42
+ export const authenticateWithTokenMtn = gql`
43
+ mutation authenticateWithToken (
44
+ $token: Token!
45
+ ) {
46
+ authenticateWithToken (
47
+ token: $token
48
+ ) {
49
+ ${authenticateResultText}
50
+ }
51
+ }
52
+ ${authenticateFragments}
53
+ `;
54
+
55
+ export const continueWithGoogleMtn = gql`
56
+ mutation continueWithGoogle (
57
+ $oauthToken: String!
58
+ ) {
59
+ continueWithGoogle (
60
+ oauthToken: $oauthToken
61
+ ) {
62
+ ${authenticateResultText}
63
+ }
64
+ }
65
+ ${authenticateFragments}
66
+ `;
67
+
68
+ export const checkUsernameOrEmailMtn = gql`
69
+ mutation checkUsernameOrEmail (
70
+ $usernameOrEmail: String!
71
+ $authCheck: Boolean
72
+ ) {
73
+ checkUsernameOrEmail (
74
+ usernameOrEmail: $usernameOrEmail
75
+ authCheck: $authCheck
76
+ ) {
77
+ value
78
+ type
79
+ hasPassword
80
+ taken
81
+ }
82
+ }`;
83
+
84
+ export const changeAccountPasswordMtn = gql`
85
+ mutation changeAccountPassword (
86
+ $password: String!
87
+ $currentPassword: String
88
+ $token: Token
89
+ ) {
90
+ changeAccountPassword (
91
+ password: $password
92
+ currentPassword: $currentPassword
93
+ token: $token
94
+ )
95
+ }`;
96
+
97
+ export const requestTokenizedEmailMtn = gql`
98
+ mutation requestTokenizedEmail (
99
+ $email: String!
100
+ $requestType: TokenType!
101
+ ) {
102
+ requestTokenizedEmail (
103
+ email: $email
104
+ requestType: $requestType
105
+ )
106
+ }`;
107
+
108
+ export const sendPhoneVerificationCodeMtn = gql`
109
+ mutation sendPhoneVerificationCode (
110
+ $phone: String!
111
+ ) {
112
+ sendPhoneVerificationCode (
113
+ phone: $phone
114
+ )
115
+ }`;
116
+
117
+ export const confirmPhoneVerificationCodeMtn = gql`
118
+ mutation confirmPhoneVerificationCode (
119
+ $phone: String!
120
+ $code: String!
121
+ ) {
122
+ confirmPhoneVerificationCode (
123
+ phone: $phone
124
+ code: $code
125
+ ) {
126
+ success
127
+ token
128
+ }
129
+ }`;
130
+
131
+ export const sendEmailVerificationMtn = gql`
132
+ mutation sendEmailVerification (
133
+ $userId: UserID!
134
+ $email: String!
135
+ ) {
136
+ sendEmailVerification (
137
+ userId: $userId
138
+ email: $email
139
+ ) {
140
+ token
141
+ userId
142
+ username
143
+ emailAddress
144
+ }
145
+ }`;
146
+
147
+ export const signUpWithEmailMtn = gql`
148
+ mutation signUpWithEmail (
149
+ $emailAddress: String!
150
+ $password: String!
151
+ ) {
152
+ signUpWithEmail (
153
+ emailAddress: $emailAddress
154
+ password: $password
155
+ )
156
+ }`;
157
+
158
+ export const signInWithAppleMtn = gql`
159
+ mutation signInWithApple (
160
+ $code: String!
161
+ $idToken: String!
162
+ ) {
163
+ signInWithApple (
164
+ code: $code
165
+ idToken: $idToken
166
+ ) {
167
+ ${authenticateResultText}
168
+ }
169
+ }
170
+ ${authenticateFragments}
171
+ `;
@@ -0,0 +1,7 @@
1
+ export * from './accountMutations';
2
+ export * from './aiChatMutations';
3
+ export * from './authMutations';
4
+ export * from './billingMutations';
5
+ export * from './logMutations';
6
+ export * from './otherMutations';
7
+ export * from './userAuthMutations';
@@ -0,0 +1,43 @@
1
+ import { gql } from 'graphql-tag';
2
+ import { logEntryFragment, logEntryArableFragment } from '../fragments/logFragments';
3
+
4
+ export const editLogEntryMtn = gql`
5
+ mutation editLogEntry (
6
+ $logEntryId: GenericID!
7
+ $accountId: GenericID
8
+ $date: DateTime
9
+
10
+ $arableDetails: LogEntryArableInput
11
+ $livestockDetails: LogEntryLivestockInput
12
+ ) {
13
+ editLogEntry (
14
+ logEntryId: $logEntryId
15
+ accountId: $accountId
16
+ date: $date
17
+
18
+ arableDetails: $arableDetails
19
+ livestockDetails: $livestockDetails
20
+ ) {
21
+ ...logEntryFragment
22
+
23
+ details {
24
+ ...on LogEntryArable {
25
+ ...logEntryArableFragment
26
+ }
27
+ }
28
+ }
29
+ }
30
+
31
+ ${logEntryFragment}
32
+ ${logEntryArableFragment}
33
+ `;
34
+
35
+ export const deleteLogEntryMtn = gql`
36
+ mutation deleteLogEntry (
37
+ $logEntryId: GenericID!
38
+ ) {
39
+ deleteLogEntry (
40
+ logEntryId: $logEntryId
41
+ )
42
+ }
43
+ `;
@@ -1,113 +1,4 @@
1
1
  import { gql } from 'graphql-tag';
2
- import { userAuthFragment } from '../fragments/userAuthFragments';
3
- import { emailFragment, phoneFragment } from '../fragments/otherFragments';
4
- import { plusFragment, userFragment, userPersonaFragment } from '../fragments/userFragments';
5
-
6
- const signInResultText = `...userAuthFragment
7
-
8
- user {
9
- ...userFragment
10
- lightMode
11
-
12
- plus {
13
- ...plusFragment
14
- }
15
-
16
- email {
17
- ...emailFragment
18
- }
19
-
20
- phone {
21
- ...phoneFragment
22
- }
23
-
24
- personas {
25
- ...userPersonaFragment
26
- }
27
- }`;
28
-
29
- const signInFragments = `
30
- ${userAuthFragment}
31
- ${userFragment}
32
- ${plusFragment}
33
- ${emailFragment}
34
- ${userPersonaFragment}
35
- ${phoneFragment}
36
- `;
37
-
38
- export const signInWithTokenMtn = gql`
39
- mutation signInWithToken (
40
- $token: Token!
41
- ) {
42
- signInWithToken (
43
- token: $token
44
- ) {
45
- ${signInResultText}
46
- }
47
- }
48
- ${signInFragments}
49
- `;
50
-
51
- export const checkUsernameOrEmailMtn = gql`
52
- mutation checkUsernameOrEmail (
53
- $usernameOrEmail: String!
54
- $authCheck: Boolean
55
- ) {
56
- checkUsernameOrEmail (
57
- usernameOrEmail: $usernameOrEmail
58
- authCheck: $authCheck
59
- ) {
60
- value
61
- type
62
- taken
63
- }
64
- }`;
65
-
66
- export const emailVerificationStatusMtn = gql`
67
- mutation emailVerificationStatus (
68
- $token: Token!
69
- ) {
70
- emailVerificationStatus (
71
- token: $token
72
- )
73
- }`;
74
-
75
- export const sendEmailVerificationMtn = gql`
76
- mutation sendEmailVerification (
77
- $userId: UserID!
78
- $email: String!
79
- ) {
80
- sendEmailVerification (
81
- userId: $userId
82
- email: $email
83
- ) {
84
- token
85
- userId
86
- username
87
- emailAddress
88
- }
89
- }`;
90
-
91
- export const signUpMtn = gql`
92
- mutation signUp (
93
- $email: String!
94
- $displayName: String!
95
- $username: String!
96
- $password: String!
97
- ) {
98
- signUp (
99
- email: $email
100
- displayName: $displayName
101
- username: $username
102
- password: $password
103
- ) {
104
- token
105
- userId
106
- username
107
- emailAddress
108
- }
109
- }
110
- `;
111
2
 
112
3
  export const signOutMtn = gql`
113
4
  mutation signOut {
@@ -127,60 +18,6 @@ mutation updateAppSettings (
127
18
  }
128
19
  `;
129
20
 
130
- export const signInMtn = gql`
131
- mutation signIn (
132
- $usernameOrEmail: String!
133
- $password: String!
134
- ) {
135
- signIn (
136
- usernameOrEmail: $usernameOrEmail,
137
- password: $password
138
- ) {
139
- ${signInResultText}
140
- }
141
- }
142
- ${signInFragments}
143
- `;
144
-
145
- export const signInWithDiscordMtn = gql`
146
- mutation signInWithDiscord (
147
- $oauthToken: String!
148
- ) {
149
- signInWithDiscord (
150
- oauthToken: $oauthToken
151
- ) {
152
- ${signInResultText}
153
- }
154
- }
155
- ${signInFragments}
156
- `;
157
-
158
- export const changePasswordMtn = gql`
159
- mutation changePassword (
160
- $currentPassword: String!
161
- $password: String!
162
- $passwordRepeat: String!
163
- $token: Token
164
- ) {
165
- changePassword (
166
- currentPassword: $currentPassword
167
- password: $password
168
- passwordRepeat: $passwordRepeat
169
- token: $token
170
- )
171
- }`;
172
-
173
- export const requestTokenizedEmailMtn = gql`
174
- mutation requestTokenizedEmail (
175
- $email: String!
176
- $requestType: TokenType!
177
- ) {
178
- requestTokenizedEmail (
179
- email: $email
180
- requestType: $requestType
181
- )
182
- }`;
183
-
184
21
  export const consumeTokenMtn = gql`
185
22
  mutation consumeToken (
186
23
  $token: Token!
@@ -9,6 +9,7 @@ query aiChat (
9
9
  aiChat (
10
10
  aiChatId: $aiChatId
11
11
  ) {
12
+ cursor
12
13
  ...aiChatFragment
13
14
 
14
15
  messages (
@@ -3,7 +3,8 @@ import { gql } from 'graphql-tag';
3
3
  export const updateNoteQry = gql`
4
4
  query updateNote {
5
5
  updateNote {
6
- version
6
+ webVersion
7
+ mobileVersion
7
8
  emoji
8
9
  title
9
10
  at
@@ -0,0 +1,37 @@
1
+ import { gql } from 'graphql-tag';
2
+ import { accountFragment } from '../fragments/accountFragments';
3
+ import { logEntryFragment, logEntryArableFragment } from '../fragments/logFragments';
4
+
5
+ export const logEntriesQry = gql`
6
+ query logEntries (
7
+ $organizationId: GenericID!
8
+ $filter: LogEntriesFilter!
9
+ $cursor: Cursor
10
+ $after: Boolean!
11
+ $limit: Int!
12
+ ) {
13
+ logEntries (
14
+ organizationId: $organizationId
15
+ filter: $filter
16
+ cursor: $cursor
17
+ after: $after
18
+ limit: $limit
19
+ ) {
20
+ ...logEntryFragment
21
+
22
+ details {
23
+ ...on LogEntryArable {
24
+ ...logEntryArableFragment
25
+ }
26
+ }
27
+
28
+ account {
29
+ ...accountFragment
30
+ }
31
+ }
32
+ }
33
+
34
+ ${accountFragment}
35
+ ${logEntryFragment}
36
+ ${logEntryArableFragment}
37
+ `;
@@ -28,6 +28,7 @@ query organizationRelationship (
28
28
 
29
29
  organization {
30
30
  ...organizationFragment
31
+ membersCount
31
32
  }
32
33
  }
33
34
  }