@nlabs/reaktor 1.6.2 → 1.7.0

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 (275) hide show
  1. package/LICENSE +74 -201
  2. package/README.md +62 -15
  3. package/lib/actions/analytics.d.ts +10 -0
  4. package/lib/actions/analytics.js +539 -0
  5. package/lib/actions/apps.js +2 -2
  6. package/lib/actions/connections.js +1 -1
  7. package/lib/actions/content.js +2 -2
  8. package/lib/actions/conversations.js +2 -2
  9. package/lib/actions/crm.d.ts +5 -1
  10. package/lib/actions/crm.js +226 -3
  11. package/lib/actions/crud.js +2 -2
  12. package/lib/actions/dynamodb.d.ts +1 -1
  13. package/lib/actions/dynamodb.js +2 -2
  14. package/lib/actions/email.d.ts +1 -1
  15. package/lib/actions/email.js +2 -2
  16. package/lib/actions/files.js +2 -2
  17. package/lib/actions/flags.d.ts +6 -0
  18. package/lib/actions/flags.js +147 -0
  19. package/lib/actions/groups.js +2 -2
  20. package/lib/actions/images.d.ts +1 -1
  21. package/lib/actions/images.js +2 -2
  22. package/lib/actions/index.d.ts +3 -2
  23. package/lib/actions/index.js +4 -3
  24. package/lib/actions/ios.js +1 -1
  25. package/lib/actions/locations.js +2 -2
  26. package/lib/actions/messages.js +2 -2
  27. package/lib/actions/notifications.d.ts +1 -1
  28. package/lib/actions/notifications.js +2 -2
  29. package/lib/actions/payments.d.ts +3 -3
  30. package/lib/actions/payments.js +144 -189
  31. package/lib/actions/personas.js +1 -1
  32. package/lib/actions/posts.d.ts +0 -4
  33. package/lib/actions/posts.js +2 -4
  34. package/lib/actions/query.js +2 -2
  35. package/lib/actions/reactions.js +2 -2
  36. package/lib/actions/rum.js +303 -25
  37. package/lib/actions/s3.d.ts +1 -1
  38. package/lib/actions/s3.js +2 -2
  39. package/lib/actions/search.js +2 -2
  40. package/lib/actions/sms.js +2 -2
  41. package/lib/actions/statistics.js +2 -2
  42. package/lib/actions/subscriptions.js +2 -2
  43. package/lib/actions/tags.js +2 -2
  44. package/lib/actions/users.js +59 -6
  45. package/lib/actions/videos.js +2 -2
  46. package/lib/adapters/arangoAdapter.js +1 -1
  47. package/lib/adapters/contentAdapter.js +2 -2
  48. package/lib/adapters/fileAdapter.js +1 -1
  49. package/lib/adapters/imageAdapter.js +1 -1
  50. package/lib/adapters/index.js +1 -1
  51. package/lib/adapters/messageAdapter.js +1 -1
  52. package/lib/adapters/postAdapter.js +1 -1
  53. package/lib/adapters/reaktorAdapter.js +1 -1
  54. package/lib/adapters/tagAdapter.d.ts +0 -1
  55. package/lib/adapters/tagAdapter.js +1 -2
  56. package/lib/adapters/userAdapter.d.ts +0 -1
  57. package/lib/adapters/userAdapter.js +1 -2
  58. package/lib/config.d.ts +10 -0
  59. package/lib/config.js +8 -2
  60. package/lib/constants/collections.d.ts +6 -3
  61. package/lib/constants/collections.js +7 -4
  62. package/lib/handlers/graphqlHandler.d.ts +2 -2
  63. package/lib/handlers/graphqlHandler.js +2 -19
  64. package/lib/index.d.ts +1 -1
  65. package/lib/index.js +2 -2
  66. package/lib/lambdas/actions/websockets.js +2 -2
  67. package/lib/lambdas/authorizer.js +2 -2
  68. package/lib/lambdas/connection.js +2 -2
  69. package/lib/lambdas/utils/message.js +2 -2
  70. package/lib/lambdas/utils/websocket.d.ts +1 -1
  71. package/lib/lambdas/utils/websocket.js +2 -2
  72. package/lib/mocks/conversation.js +1 -1
  73. package/lib/mocks/file.js +1 -1
  74. package/lib/mocks/group.js +1 -1
  75. package/lib/mocks/image.js +1 -1
  76. package/lib/mocks/post.js +1 -1
  77. package/lib/mocks/tag.js +1 -1
  78. package/lib/mocks/user.js +1 -1
  79. package/lib/mocks/video.js +1 -1
  80. package/lib/mutations/analytics/analytics.d.ts +1 -0
  81. package/lib/mutations/analytics/analytics.js +35 -0
  82. package/lib/mutations/content/content.js +2 -2
  83. package/lib/mutations/crm/crm.js +18 -4
  84. package/lib/mutations/events/events.js +2 -2
  85. package/lib/mutations/flags/flags.d.ts +1 -0
  86. package/lib/mutations/flags/flags.js +33 -0
  87. package/lib/mutations/groups/groups.js +2 -2
  88. package/lib/mutations/images/images.js +2 -2
  89. package/lib/mutations/index.d.ts +3 -1
  90. package/lib/mutations/index.js +13 -3
  91. package/lib/mutations/locations/locations.js +2 -2
  92. package/lib/mutations/messages/messages.js +2 -2
  93. package/lib/mutations/personas/personas.js +2 -2
  94. package/lib/mutations/posts/posts.js +2 -2
  95. package/lib/mutations/reactions/reactions.js +2 -2
  96. package/lib/mutations/rum/rum.js +2 -2
  97. package/lib/mutations/statistics/statistics.js +2 -2
  98. package/lib/mutations/subscriptions/subscriptions.js +2 -2
  99. package/lib/mutations/tags/tags.js +2 -2
  100. package/lib/mutations/users/users.js +30 -17
  101. package/lib/mutations/videos/videos.js +2 -2
  102. package/lib/objectTypes/analytics.d.ts +8 -0
  103. package/lib/objectTypes/analytics.js +147 -0
  104. package/lib/objectTypes/app.js +2 -2
  105. package/lib/objectTypes/bankAccount.js +2 -2
  106. package/lib/objectTypes/connection.js +2 -2
  107. package/lib/objectTypes/content.js +2 -2
  108. package/lib/objectTypes/conversation.js +2 -2
  109. package/lib/objectTypes/creditCard.js +2 -2
  110. package/lib/objectTypes/crm.d.ts +5 -0
  111. package/lib/objectTypes/crm.js +64 -2
  112. package/lib/objectTypes/document.js +1 -1
  113. package/lib/objectTypes/error.js +2 -2
  114. package/lib/objectTypes/event.js +2 -2
  115. package/lib/objectTypes/external.js +2 -2
  116. package/lib/objectTypes/file.js +2 -2
  117. package/lib/objectTypes/filter.js +2 -2
  118. package/lib/objectTypes/flag.d.ts +1 -0
  119. package/lib/objectTypes/flag.js +32 -0
  120. package/lib/objectTypes/group.js +2 -2
  121. package/lib/objectTypes/iapSubscription.js +2 -2
  122. package/lib/objectTypes/image.d.ts +1 -1
  123. package/lib/objectTypes/image.js +2 -2
  124. package/lib/objectTypes/index.d.ts +2 -0
  125. package/lib/objectTypes/index.js +3 -1
  126. package/lib/objectTypes/location.js +2 -2
  127. package/lib/objectTypes/message.js +2 -2
  128. package/lib/objectTypes/passcode.js +2 -2
  129. package/lib/objectTypes/persona.js +2 -2
  130. package/lib/objectTypes/plan.js +2 -2
  131. package/lib/objectTypes/post.js +2 -2
  132. package/lib/objectTypes/query.js +2 -2
  133. package/lib/objectTypes/reaction.js +2 -2
  134. package/lib/objectTypes/relation.js +2 -2
  135. package/lib/objectTypes/rum.js +4 -4
  136. package/lib/objectTypes/search.js +2 -2
  137. package/lib/objectTypes/statistics.js +2 -2
  138. package/lib/objectTypes/subscription.js +2 -2
  139. package/lib/objectTypes/tag.js +2 -2
  140. package/lib/objectTypes/user.js +2 -2
  141. package/lib/objectTypes/video.d.ts +1 -1
  142. package/lib/objectTypes/video.js +2 -2
  143. package/lib/queries/analytics/analytics.d.ts +1 -0
  144. package/lib/queries/analytics/analytics.js +41 -0
  145. package/lib/queries/content/content.js +2 -2
  146. package/lib/queries/crm/crm.js +15 -4
  147. package/lib/queries/events/events.js +2 -2
  148. package/lib/queries/flags/flags.d.ts +1 -0
  149. package/lib/queries/flags/flags.js +16 -0
  150. package/lib/queries/groups/groups.js +2 -2
  151. package/lib/queries/images/images.js +2 -2
  152. package/lib/queries/index.d.ts +3 -1
  153. package/lib/queries/index.js +13 -3
  154. package/lib/queries/locations/locations.js +2 -2
  155. package/lib/queries/messages/messages.js +1 -1
  156. package/lib/queries/personas/personas.js +2 -2
  157. package/lib/queries/posts/posts.js +2 -2
  158. package/lib/queries/query/query.js +2 -2
  159. package/lib/queries/reactions/reactions.js +2 -2
  160. package/lib/queries/statistics/statistics.js +2 -2
  161. package/lib/queries/subscriptions/subscriptions.js +1 -1
  162. package/lib/queries/tags/tags.js +2 -2
  163. package/lib/queries/users/users.js +2 -2
  164. package/lib/queries/videos/videos.js +2 -2
  165. package/lib/templates/email/layout.js +1 -1
  166. package/lib/templates/email/passwordForgot.js +1 -1
  167. package/lib/templates/email/passwordRecovery.js +1 -1
  168. package/lib/templates/email/verifyEmail.js +1 -1
  169. package/lib/templates/email/welcome.js +1 -1
  170. package/lib/templates/sms/passwordForgot.js +1 -1
  171. package/lib/templates/sms/passwordRecovery.js +1 -1
  172. package/lib/templates/sms/verifyEmail.js +1 -1
  173. package/lib/templates/sms/verifyPhone.js +1 -1
  174. package/lib/templates/sms/welcome.js +1 -1
  175. package/lib/types/analytics.types.d.ts +92 -0
  176. package/lib/types/analytics.types.js +6 -0
  177. package/lib/types/apps.types.d.ts +1 -1
  178. package/lib/types/apps.types.js +2 -2
  179. package/lib/types/arangodb.types.d.ts +2 -2
  180. package/lib/types/arangodb.types.js +2 -2
  181. package/lib/types/auth.types.d.ts +3 -1
  182. package/lib/types/auth.types.js +2 -2
  183. package/lib/types/connections.types.d.ts +1 -1
  184. package/lib/types/connections.types.js +2 -2
  185. package/lib/types/content.types.d.ts +1 -1
  186. package/lib/types/content.types.js +2 -2
  187. package/lib/types/conversations.types.d.ts +1 -1
  188. package/lib/types/conversations.types.js +2 -2
  189. package/lib/types/crm.types.d.ts +38 -1
  190. package/lib/types/crm.types.js +2 -2
  191. package/lib/types/email.types.d.ts +1 -1
  192. package/lib/types/email.types.js +2 -2
  193. package/lib/types/error.types.js +1 -1
  194. package/lib/types/files.types.d.ts +1 -1
  195. package/lib/types/files.types.js +2 -2
  196. package/lib/types/flags.types.d.ts +28 -0
  197. package/lib/types/flags.types.js +3 -0
  198. package/lib/types/google.types.d.ts +1 -1
  199. package/lib/types/google.types.js +2 -2
  200. package/lib/types/groups.types.d.ts +1 -1
  201. package/lib/types/groups.types.js +2 -2
  202. package/lib/types/images.types.d.ts +1 -1
  203. package/lib/types/images.types.js +2 -2
  204. package/lib/types/index.d.ts +3 -1
  205. package/lib/types/index.js +4 -2
  206. package/lib/types/locations.types.d.ts +1 -1
  207. package/lib/types/locations.types.js +2 -2
  208. package/lib/types/messages.types.d.ts +1 -1
  209. package/lib/types/messages.types.js +2 -2
  210. package/lib/types/notifications.types.d.ts +1 -1
  211. package/lib/types/notifications.types.js +2 -2
  212. package/lib/types/payments.types.d.ts +4 -1
  213. package/lib/types/payments.types.js +2 -2
  214. package/lib/types/personas.types.js +1 -1
  215. package/lib/types/posts.types.d.ts +1 -1
  216. package/lib/types/posts.types.js +2 -2
  217. package/lib/types/rum.types.d.ts +3 -3
  218. package/lib/types/rum.types.js +2 -2
  219. package/lib/types/statistics.types.js +1 -1
  220. package/lib/types/tags.types.d.ts +1 -1
  221. package/lib/types/tags.types.js +2 -2
  222. package/lib/types/users.types.d.ts +1 -1
  223. package/lib/types/users.types.js +2 -2
  224. package/lib/types/videos.types.d.ts +1 -1
  225. package/lib/types/videos.types.js +2 -2
  226. package/lib/types/websockets.types.d.ts +1 -1
  227. package/lib/types/websockets.types.js +2 -2
  228. package/lib/upload.js +4 -9
  229. package/lib/utils/adapterUtils.d.ts +1 -1
  230. package/lib/utils/adapterUtils.js +2 -2
  231. package/lib/utils/analyticsUtils.d.ts +1 -1
  232. package/lib/utils/analyticsUtils.js +2 -2
  233. package/lib/utils/aqlHelpers.d.ts +1 -1
  234. package/lib/utils/aqlHelpers.js +2 -2
  235. package/lib/utils/arangodbUtils.d.ts +9 -1
  236. package/lib/utils/arangodbUtils.js +10 -2
  237. package/lib/utils/authUtils.js +2 -2
  238. package/lib/utils/awsUtils.js +2 -2
  239. package/lib/utils/collectionRegistry.d.ts +1 -1
  240. package/lib/utils/collectionRegistry.js +17 -2
  241. package/lib/utils/contextUtils.d.ts +2 -2
  242. package/lib/utils/contextUtils.js +2 -2
  243. package/lib/utils/dbI18n.example.d.ts +1 -1
  244. package/lib/utils/dbI18n.example.js +2 -2
  245. package/lib/utils/dbI18n.js +2 -2
  246. package/lib/utils/googleTranslate.d.ts +1 -1
  247. package/lib/utils/googleTranslate.js +2 -2
  248. package/lib/utils/graphqlUtils.d.ts +1 -0
  249. package/lib/utils/graphqlUtils.js +1 -1
  250. package/lib/utils/imageUtils.js +1 -1
  251. package/lib/utils/index.d.ts +1 -1
  252. package/lib/utils/index.js +2 -2
  253. package/lib/utils/languageDetection.js +1 -1
  254. package/lib/utils/localeUtils.d.ts +1 -1
  255. package/lib/utils/localeUtils.example.d.ts +1 -1
  256. package/lib/utils/localeUtils.example.js +2 -2
  257. package/lib/utils/localeUtils.js +2 -2
  258. package/lib/utils/middlewareUtils.js +1 -1
  259. package/lib/utils/queryBuilder.d.ts +1 -1
  260. package/lib/utils/queryBuilder.js +2 -2
  261. package/lib/utils/schemaUtils.js +1 -1
  262. package/lib/utils/sessionUtils.js +2 -2
  263. package/lib/utils/stripeUtils.d.ts +1 -1
  264. package/lib/utils/stripeUtils.js +2 -2
  265. package/lib/utils/templateUtils.js +1 -1
  266. package/lib/utils/testUtils.js +2 -2
  267. package/lib/utils/translationQueue.d.ts +1 -1
  268. package/lib/utils/translationQueue.example.d.ts +1 -1
  269. package/lib/utils/translationQueue.example.js +2 -2
  270. package/lib/utils/translationQueue.js +2 -2
  271. package/lib/videoProcessing.js +1 -1
  272. package/package.json +43 -79
  273. package/lib/actions/websockets.d.ts +0 -20
  274. package/lib/actions/websockets.js +0 -164
  275. package/lib/mocks/nlabs.png +0 -0
package/LICENSE CHANGED
@@ -1,201 +1,74 @@
1
- Apache License
2
- Version 2.0, January 2004
3
- http://www.apache.org/licenses/
4
-
5
- TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6
-
7
- 1. Definitions.
8
-
9
- "License" shall mean the terms and conditions for use, reproduction,
10
- and distribution as defined by Sections 1 through 9 of this document.
11
-
12
- "Licensor" shall mean the copyright owner or entity authorized by
13
- the copyright owner that is granting the License.
14
-
15
- "Legal Entity" shall mean the union of the acting entity and all
16
- other entities that control, are controlled by, or are under common
17
- control with that entity. For the purposes of this definition,
18
- "control" means (i) the power, direct or indirect, to cause the
19
- direction or management of such entity, whether by contract or
20
- otherwise, or (ii) ownership of fifty percent (50%) or more of the
21
- outstanding shares, or (iii) beneficial ownership of such entity.
22
-
23
- "You" (or "Your") shall mean an individual or Legal Entity
24
- exercising permissions granted by this License.
25
-
26
- "Source" form shall mean the preferred form for making modifications,
27
- including but not limited to software source code, documentation
28
- source, and configuration files.
29
-
30
- "Object" form shall mean any form resulting from mechanical
31
- transformation or translation of a Source form, including but
32
- not limited to compiled object code, generated documentation,
33
- and conversions to other media types.
34
-
35
- "Work" shall mean the work of authorship, whether in Source or
36
- Object form, made available under the License, as indicated by a
37
- copyright notice that is included in or attached to the work
38
- (an example is provided in the Appendix below).
39
-
40
- "Derivative Works" shall mean any work, whether in Source or Object
41
- form, that is based on (or derived from) the Work and for which the
42
- editorial revisions, annotations, elaborations, or other modifications
43
- represent, as a whole, an original work of authorship. For the purposes
44
- of this License, Derivative Works shall not include works that remain
45
- separable from, or merely link (or bind by name) to the interfaces of,
46
- the Work and Derivative Works thereof.
47
-
48
- "Contribution" shall mean any work of authorship, including
49
- the original version of the Work and any modifications or additions
50
- to that Work or Derivative Works thereof, that is intentionally
51
- submitted to Licensor for inclusion in the Work by the copyright owner
52
- or by an individual or Legal Entity authorized to submit on behalf of
53
- the copyright owner. For the purposes of this definition, "submitted"
54
- means any form of electronic, verbal, or written communication sent
55
- to the Licensor or its representatives, including but not limited to
56
- communication on electronic mailing lists, source code control systems,
57
- and issue tracking systems that are managed by, or on behalf of, the
58
- Licensor for the purpose of discussing and improving the Work, but
59
- excluding communication that is conspicuously marked or otherwise
60
- designated in writing by the copyright owner as "Not a Contribution."
61
-
62
- "Contributor" shall mean Licensor and any individual or Legal Entity
63
- on behalf of whom a Contribution has been received by Licensor and
64
- subsequently incorporated within the Work.
65
-
66
- 2. Grant of Copyright License. Subject to the terms and conditions of
67
- this License, each Contributor hereby grants to You a perpetual,
68
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69
- copyright license to reproduce, prepare Derivative Works of,
70
- publicly display, publicly perform, sublicense, and distribute the
71
- Work and such Derivative Works in Source or Object form.
72
-
73
- 3. Grant of Patent License. Subject to the terms and conditions of
74
- this License, each Contributor hereby grants to You a perpetual,
75
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76
- (except as stated in this section) patent license to make, have made,
77
- use, offer to sell, sell, import, and otherwise transfer the Work,
78
- where such license applies only to those patent claims licensable
79
- by such Contributor that are necessarily infringed by their
80
- Contribution(s) alone or by combination of their Contribution(s)
81
- with the Work to which such Contribution(s) was submitted. If You
82
- institute patent litigation against any entity (including a
83
- cross-claim or counterclaim in a lawsuit) alleging that the Work
84
- or a Contribution incorporated within the Work constitutes direct
85
- or contributory patent infringement, then any patent licenses
86
- granted to You under this License for that Work shall terminate
87
- as of the date such litigation is filed.
88
-
89
- 4. Redistribution. You may reproduce and distribute copies of the
90
- Work or Derivative Works thereof in any medium, with or without
91
- modifications, and in Source or Object form, provided that You
92
- meet the following conditions:
93
-
94
- (a) You must give any other recipients of the Work or
95
- Derivative Works a copy of this License; and
96
-
97
- (b) You must cause any modified files to carry prominent notices
98
- stating that You changed the files; and
99
-
100
- (c) You must retain, in the Source form of any Derivative Works
101
- that You distribute, all copyright, patent, trademark, and
102
- attribution notices from the Source form of the Work,
103
- excluding those notices that do not pertain to any part of
104
- the Derivative Works; and
105
-
106
- (d) If the Work includes a "NOTICE" text file as part of its
107
- distribution, then any Derivative Works that You distribute must
108
- include a readable copy of the attribution notices contained
109
- within such NOTICE file, excluding those notices that do not
110
- pertain to any part of the Derivative Works, in at least one
111
- of the following places: within a NOTICE text file distributed
112
- as part of the Derivative Works; within the Source form or
113
- documentation, if provided along with the Derivative Works; or,
114
- within a display generated by the Derivative Works, if and
115
- wherever such third-party notices normally appear. The contents
116
- of the NOTICE file are for informational purposes only and
117
- do not modify the License. You may add Your own attribution
118
- notices within Derivative Works that You distribute, alongside
119
- or as an addendum to the NOTICE text from the Work, provided
120
- that such additional attribution notices cannot be construed
121
- as modifying the License.
122
-
123
- You may add Your own copyright statement to Your modifications and
124
- may provide additional or different license terms and conditions
125
- for use, reproduction, or distribution of Your modifications, or
126
- for any such Derivative Works as a whole, provided Your use,
127
- reproduction, and distribution of the Work otherwise complies with
128
- the conditions stated in this License.
129
-
130
- 5. Submission of Contributions. Unless You explicitly state otherwise,
131
- any Contribution intentionally submitted for inclusion in the Work
132
- by You to the Licensor shall be under the terms and conditions of
133
- this License, without any additional terms or conditions.
134
- Notwithstanding the above, nothing herein shall supersede or modify
135
- the terms of any separate license agreement you may have executed
136
- with Licensor regarding such Contributions.
137
-
138
- 6. Trademarks. This License does not grant permission to use the trade
139
- names, trademarks, service marks, or product names of the Licensor,
140
- except as required for reasonable and customary use in describing the
141
- origin of the Work and reproducing the content of the NOTICE file.
142
-
143
- 7. Disclaimer of Warranty. Unless required by applicable law or
144
- agreed to in writing, Licensor provides the Work (and each
145
- Contributor provides its Contributions) on an "AS IS" BASIS,
146
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147
- implied, including, without limitation, any warranties or conditions
148
- of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149
- PARTICULAR PURPOSE. You are solely responsible for determining the
150
- appropriateness of using or redistributing the Work and assume any
151
- risks associated with Your exercise of permissions under this License.
152
-
153
- 8. Limitation of Liability. In no event and under no legal theory,
154
- whether in tort (including negligence), contract, or otherwise,
155
- unless required by applicable law (such as deliberate and grossly
156
- negligent acts) or agreed to in writing, shall any Contributor be
157
- liable to You for damages, including any direct, indirect, special,
158
- incidental, or consequential damages of any character arising as a
159
- result of this License or out of the use or inability to use the
160
- Work (including but not limited to damages for loss of goodwill,
161
- work stoppage, computer failure or malfunction, or any and all
162
- other commercial damages or losses), even if such Contributor
163
- has been advised of the possibility of such damages.
164
-
165
- 9. Accepting Warranty or Additional Liability. While redistributing
166
- the Work or Derivative Works thereof, You may choose to offer,
167
- and charge a fee for, acceptance of support, warranty, indemnity,
168
- or other liability obligations and/or rights consistent with this
169
- License. However, in accepting such obligations, You may act only
170
- on Your own behalf and on Your sole responsibility, not on behalf
171
- of any other Contributor, and only if You agree to indemnify,
172
- defend, and hold each Contributor harmless for any liability
173
- incurred by, or claims asserted against, such Contributor by reason
174
- of your accepting any such warranty or additional liability.
175
-
176
- END OF TERMS AND CONDITIONS
177
-
178
- APPENDIX: How to apply the Apache License to your work.
179
-
180
- To apply the Apache License to your work, attach the following
181
- boilerplate notice, with the fields enclosed by brackets "[]"
182
- replaced with your own identifying information. (Don't include
183
- the brackets!) The text should be enclosed in the appropriate
184
- comment syntax for the file format. We also recommend that a
185
- file or class name and description of purpose be included on the
186
- same "printed page" as the copyright notice for easier
187
- identification within third-party archives.
188
-
189
- Copyright [yyyy] [name of copyright owner]
190
-
191
- Licensed under the Apache License, Version 2.0 (the "License");
192
- you may not use this file except in compliance with the License.
193
- You may obtain a copy of the License at
194
-
195
- http://www.apache.org/licenses/LICENSE-2.0
196
-
197
- Unless required by applicable law or agreed to in writing, software
198
- distributed under the License is distributed on an "AS IS" BASIS,
199
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
200
- See the License for the specific language governing permissions and
201
- limitations under the License.
1
+ REAKTOR COMMERCIAL LICENSE
2
+
3
+ Copyright (c) 2019-Present Nitrogen Labs, Inc. All rights reserved.
4
+
5
+ This software and its associated source code, object code, documentation, and
6
+ other materials (collectively, the "Software") are proprietary to Nitrogen
7
+ Labs, Inc. ("Nitrogen Labs").
8
+
9
+ 1. COMMERCIAL AGREEMENT REQUIRED
10
+
11
+ Use of the Software requires a valid written commercial license, subscription,
12
+ order form, or other agreement with Nitrogen Labs (the "Commercial
13
+ Agreement"). Possession of or access to the Software does not itself grant any
14
+ license or other rights.
15
+
16
+ 2. LICENSE GRANT
17
+
18
+ Subject to payment of all applicable fees and continued compliance with the
19
+ Commercial Agreement, Nitrogen Labs grants the licensee a limited,
20
+ non-exclusive, non-transferable, non-sublicensable right, during the term of
21
+ the Commercial Agreement, to install and use the Software internally only for
22
+ the purposes and within the scope expressly authorized by that agreement.
23
+
24
+ 3. RESTRICTIONS
25
+
26
+ Except where expressly authorized by the Commercial Agreement or required by
27
+ applicable law, the licensee may not copy, modify, adapt, translate, publish,
28
+ distribute, sublicense, sell, rent, lease, provide as a service, reverse
29
+ engineer, decompile, disassemble, or otherwise attempt to derive the source or
30
+ underlying ideas of the Software. The licensee may not remove or alter any
31
+ copyright, trademark, or proprietary notice.
32
+
33
+ 4. OWNERSHIP
34
+
35
+ Nitrogen Labs and its licensors retain all right, title, and interest in and to
36
+ the Software, including all intellectual-property rights. No rights are granted
37
+ except those expressly stated in the Commercial Agreement and this license.
38
+
39
+ 5. THIRD-PARTY SOFTWARE
40
+
41
+ Third-party components included with or used by the Software remain subject to
42
+ their respective license terms. Those terms apply only to the corresponding
43
+ third-party components and do not license the Software as a whole.
44
+
45
+ 6. TERMINATION
46
+
47
+ The license terminates automatically when the Commercial Agreement expires or
48
+ terminates, or upon a material breach of these terms. Upon termination, the
49
+ licensee must stop using and destroy all copies of the Software, except where
50
+ retention is required by law.
51
+
52
+ 7. DISCLAIMER
53
+
54
+ EXCEPT AS EXPRESSLY PROVIDED IN THE COMMERCIAL AGREEMENT, THE SOFTWARE IS
55
+ PROVIDED "AS IS" WITHOUT WARRANTIES OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING
56
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, TITLE, AND
57
+ NON-INFRINGEMENT.
58
+
59
+ 8. LIMITATION OF LIABILITY
60
+
61
+ TO THE MAXIMUM EXTENT PERMITTED BY LAW, NITROGEN LABS WILL NOT BE LIABLE FOR
62
+ INDIRECT, INCIDENTAL, SPECIAL, CONSEQUENTIAL, EXEMPLARY, OR PUNITIVE DAMAGES,
63
+ OR FOR LOST PROFITS, REVENUE, DATA, OR BUSINESS OPPORTUNITIES, ARISING FROM OR
64
+ RELATED TO THE SOFTWARE. ANY ADDITIONAL LIMITATIONS OR REMEDIES ARE GOVERNED BY
65
+ THE COMMERCIAL AGREEMENT.
66
+
67
+ 9. ORDER OF PRECEDENCE
68
+
69
+ If these terms conflict with a signed Commercial Agreement, the signed
70
+ Commercial Agreement controls. No purchase order or other unilateral terms
71
+ modify this license unless expressly accepted in writing by Nitrogen Labs.
72
+
73
+ Use without a valid Commercial Agreement is prohibited. Contact Nitrogen Labs
74
+ through https://nitrogenlabs.com to obtain commercial licensing rights.
package/README.md CHANGED
@@ -3,6 +3,11 @@ Reaktor
3
3
 
4
4
  A powerful GraphQL API framework built with TypeScript, ArangoDB, and AWS Lambda. Reaktor provides a complete backend solution for social platforms with user management, posts, messaging, reactions, and more.
5
5
 
6
+ [![npm version](https://img.shields.io/npm/v/@nlabs/reaktor.svg?style=flat-square)](https://www.npmjs.com/package/@nlabs/reaktor)
7
+ [![npm downloads](https://img.shields.io/npm/dm/@nlabs/reaktor.svg?style=flat-square)](https://www.npmjs.com/package/@nlabs/reaktor)
8
+ [![Documentation](https://img.shields.io/badge/docs-reaktor.nitrogenx.co-6d28d9?style=flat-square)](https://reaktor.nitrogenx.co)
9
+ [![Platform](https://img.shields.io/badge/platform-reaktor.io-080832?style=flat-square)](https://reaktor.io)
10
+
6
11
  ## Features
7
12
 
8
13
  - **GraphQL API** - Built with graphql-compose for type-safe schema composition
@@ -14,6 +19,8 @@ A powerful GraphQL API framework built with TypeScript, ArangoDB, and AWS Lambda
14
19
  - **AWS Lambda Ready** - Serverless deployment support
15
20
  - **Comprehensive Testing** - Jest-based testing with utilities
16
21
  - **Internationalization** - Database-driven i18n system
22
+ - **Feature flags** - Code-owned boolean and fixed-choice flags with database overrides ([guide](./docs/FEATURE_FLAGS.md))
23
+ - **Secure billing setup** - Stripe-hosted card collection without raw card data passing through Reaktor ([guide](./docs/BILLING.md))
17
24
 
18
25
  Peer Dependencies
19
26
  ----------------
@@ -177,6 +184,21 @@ export ARANGODB_PASSWORD="mypassword"
177
184
 
178
185
  The configuration is environment-aware and supports `local`, `development`, `test`, and `production` environments. The active environment is determined by the `NODE_ENV` or `stage` environment variable.
179
186
 
187
+ #### Anonymous RUM Configuration
188
+
189
+ The public `rum.track` mutation sanitizes GothamJS journey events and sends them to Amazon CloudWatch RUM with `PutRumEvents`. Reaktor does not persist RUM events in ArangoDB.
190
+
191
+ - `AWS_REGION` - AWS region containing the CloudWatch RUM app monitors.
192
+ - `AWS_RUM_APP_MONITORS` - JSON object mapping each public application ID to its CloudWatch RUM app-monitor UUID. Values may also be objects with `id`, `name`, `version`, `domain`, and optional resource-policy `alias` fields.
193
+
194
+ The Lambda or server role must allow `rum:PutRumEvents` for the configured app monitors. APIs that create tagged monitors must also allow `rum:CreateAppMonitor`, `rum:GetAppMonitor`, `rum:GetAppMonitorData`, and `rum:TagResource`. The same mapping can be supplied programmatically at `aws.rum.appMonitors` using `Config.set()`.
195
+
196
+ Each event includes its sanitized public `appId` in the event details and as the `applicationId` metadata attribute so CloudWatch RUM filters, Logs Insights, and custom dashboards can filter shared-monitor data. Use a separate app monitor per application when AWS-native metrics and access boundaries must remain isolated.
197
+
198
+ When supplied as event properties, Reaktor promotes `browserName`, `browserVersion`, `browserLanguage`, `pageId`/`pageID`, `parentPageId`/`parentPage`, `interaction`, `deviceType`, `osName`, and `osVersion` into canonical AWS RUM metadata fields.
199
+
200
+ Reaktor does not send authentication state, cookies, IP addresses, user agents, referrers, form values, common identity fields, or client-supplied geolocation. AWS can enrich accepted RUM events with coarse location metadata such as country, subdivision, and locality. Journey IDs remain memory-only in the browser and reset when the application runtime restarts.
201
+
180
202
  #### Programmatic Configuration
181
203
 
182
204
  You can also override configuration programmatically using the `Config.set()` method:
@@ -445,13 +467,9 @@ export const addPost = async (context: ApiContext, input: PostInputType): Promis
445
467
  };
446
468
  ```
447
469
 
448
- ## Migration Guide
449
-
450
- ### From Old to New Structure
470
+ ## Query Guidelines
451
471
 
452
- The refactoring maintains backward compatibility while introducing better patterns and utilities.
453
-
454
- **Old way (manual query building):**
472
+ **Avoid manual query building:**
455
473
  ```typescript
456
474
  // Manual string concatenation (avoid this)
457
475
  const aqlQry = `FOR p IN posts
@@ -459,7 +477,7 @@ const aqlQry = `FOR p IN posts
459
477
  RETURN p`;
460
478
  ```
461
479
 
462
- **New way (parameterized queries):**
480
+ **Use parameterized queries:**
463
481
  ```typescript
464
482
  // Use AQL template literals for safety
465
483
  import {aql} from 'arangojs';
@@ -485,10 +503,6 @@ const results = await getPostsByLatest(context, {
485
503
  });
486
504
  ```
487
505
 
488
- ### Breaking Changes
489
-
490
- **None!** All existing functions maintain backward compatibility. The refactoring improves internal structure without changing public APIs.
491
-
492
506
  ### Best Practices
493
507
 
494
508
  1. **Use parameterized queries**: Always use `aql` template literals
@@ -561,10 +575,36 @@ describe('User Actions', () => {
561
575
 
562
576
  See [Test Utilities Guide](./TEST_UTILITIES_GUIDE.md) for detailed documentation on test helpers.
563
577
 
578
+ ## Releases
579
+
580
+ Releases are automated from Conventional Commit messages when files under
581
+ `packages/reaktor` change on `main`:
582
+
583
+ - `fix:` creates a patch release.
584
+ - `feat:` creates a minor release.
585
+ - `feat!:` or a `BREAKING CHANGE:` footer creates a major release.
586
+ - Other commit types do not create a release by default.
587
+
588
+ Release Please opens a version and changelog pull request. Merging that pull
589
+ request creates the GitHub release and publishes `@nlabs/reaktor` to npm after
590
+ the package test, lint, build, and declaration checks pass. The repository must
591
+ provide an `NPM_TOKEN` Actions secret with publish access to the private package.
592
+
564
593
  ## Available Action Functions
565
594
 
566
595
  All action functions have been refactored for better modularity and maintainability. Common patterns are now extracted into shared utilities.
567
596
 
597
+ ### Secure billing
598
+
599
+ Use Stripe Checkout to save a card without sending its number, expiration date, or security code through Reaktor. The signed-in user's flow is:
600
+
601
+ 1. Call `users.createBillingSetupSession(returnUrl)`.
602
+ 2. Redirect the browser to the returned Stripe Checkout URL.
603
+ 3. After Stripe returns with `billing=success`, call `users.completeBillingSetupSession(sessionId)` using the returned `session_id`.
604
+ 4. Use `users.deleteBillingCard` if the customer removes the saved card.
605
+
606
+ Set `STRIPE_RETURN_URL_ORIGINS` to the comma-separated HTTPS origins allowed to receive Stripe redirects. See the [secure billing guide](./docs/BILLING.md) for complete GraphQL examples, local-development rules, errors, and migration instructions for the removed `addCreditCard` and `saveUserBillingCard` APIs.
607
+
568
608
  ### Posts
569
609
 
570
610
  ```typescript
@@ -865,7 +905,7 @@ const handler = createGraphqlHandler({
865
905
  context: {}
866
906
  });
867
907
 
868
- // Use in an AWS Lambda or Express route
908
+ // Use in an AWS Lambda connected to API Gateway HTTP API (payload v2)
869
909
  export const lambdaHandler = async (event) => {
870
910
  return await handler(event);
871
911
  };
@@ -899,8 +939,7 @@ const handler = createGraphqlHandler({
899
939
  - You can customize context by passing initial values with `createGraphqlHandler({context})`.
900
940
 
901
941
  #### Typical Integration
902
- - For AWS Lambda: export the handler and wire it to API Gateway events.
903
- - For Express: call the handler with the request event object.
942
+ - Export the handler from AWS Lambda and wire it to API Gateway HTTP API payload v2 events.
904
943
 
905
944
  See [`src/handlers/graphqlHandler.ts`](./src/handlers/graphqlHandler.ts) for implementation details.
906
945
 
@@ -933,6 +972,12 @@ Below is a list of available functions for each main action group. These can be
933
972
  - getActiveUserCount
934
973
  - getUserByToken
935
974
 
975
+ ### Payments
976
+ - completeBillingSetupSession
977
+ - createBillingSetupSession
978
+ - deleteUserBillingCard
979
+ - upgradeUserToPlus
980
+
936
981
  ### Groups
937
982
  - getGroupList
938
983
  - getGroupListByUser
@@ -1403,4 +1448,6 @@ For comprehensive guides and detailed documentation, see:
1403
1448
 
1404
1449
  ## License
1405
1450
 
1406
- See the LICENSE file for license rights and limitations (Apache-2.0).
1451
+ Reaktor is proprietary commercial software. A valid commercial agreement with
1452
+ Nitrogen Labs, Inc. is required to use, copy, modify, or distribute this
1453
+ package. See [LICENSE](./LICENSE) for the governing terms.
@@ -0,0 +1,10 @@
1
+ import type { AnalyticsConfigurationType, AnalyticsDashboardType, AnalyticsType, CreateAnalyticsMonitorInputType } from '../types/analytics.types.js';
2
+ import type { ApiContext } from '../types/auth.types.js';
3
+ export declare const getAnalyticsByAppId: (context: ApiContext, appIdInput: string) => Promise<AnalyticsType | null>;
4
+ export declare const getAnalyticsConfiguration: (context: ApiContext, appIdInput: string) => Promise<AnalyticsConfigurationType | null>;
5
+ export declare const getAnalyticsById: (context: ApiContext, analyticsIdInput: string) => Promise<AnalyticsType | null>;
6
+ export declare const createAnalyticsMonitor: (context: ApiContext, input: CreateAnalyticsMonitorInputType) => Promise<AnalyticsType>;
7
+ export declare const regenerateAnalyticsId: (context: ApiContext, analyticsIdInput: string) => Promise<AnalyticsType>;
8
+ export declare const getAvailableAnalytics: (context: ApiContext) => Promise<AnalyticsType[]>;
9
+ export declare const setAnalyticsAccess: (context: ApiContext, analyticsIdInput: string, userIdsInput: readonly string[]) => Promise<AnalyticsType>;
10
+ export declare const getAnalyticsDashboard: (context: ApiContext, analyticsIdInput: string, rangeDaysInput: number) => Promise<AnalyticsDashboardType>;