jourycms-sdk 1.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (235) hide show
  1. package/dist/base.app-container.d.ts +7 -0
  2. package/dist/base.app-container.d.ts.map +1 -0
  3. package/dist/base.app-container.js +10 -0
  4. package/dist/base.client.d.ts +10 -0
  5. package/dist/base.client.d.ts.map +1 -0
  6. package/dist/base.client.js +16 -0
  7. package/dist/base.service-container.d.ts +8 -0
  8. package/dist/base.service-container.d.ts.map +1 -0
  9. package/dist/base.service-container.js +12 -0
  10. package/dist/containers/auth/clients/api-keys.client.d.ts +13 -0
  11. package/dist/containers/auth/clients/api-keys.client.d.ts.map +1 -0
  12. package/dist/containers/auth/clients/api-keys.client.js +48 -0
  13. package/dist/containers/auth/clients/auth.client.d.ts +12 -0
  14. package/dist/containers/auth/clients/auth.client.d.ts.map +1 -0
  15. package/dist/containers/auth/clients/auth.client.js +39 -0
  16. package/dist/containers/auth/clients/permission-groups.client.d.ts +12 -0
  17. package/dist/containers/auth/clients/permission-groups.client.d.ts.map +1 -0
  18. package/dist/containers/auth/clients/permission-groups.client.js +42 -0
  19. package/dist/containers/auth/clients/permissions.client.d.ts +13 -0
  20. package/dist/containers/auth/clients/permissions.client.d.ts.map +1 -0
  21. package/dist/containers/auth/clients/permissions.client.js +48 -0
  22. package/dist/containers/auth/clients/roles.client.d.ts +17 -0
  23. package/dist/containers/auth/clients/roles.client.d.ts.map +1 -0
  24. package/dist/containers/auth/clients/roles.client.js +72 -0
  25. package/dist/containers/auth/clients/users.client.d.ts +26 -0
  26. package/dist/containers/auth/clients/users.client.d.ts.map +1 -0
  27. package/dist/containers/auth/clients/users.client.js +128 -0
  28. package/dist/containers/auth/service-container.d.ts +23 -0
  29. package/dist/containers/auth/service-container.d.ts.map +1 -0
  30. package/dist/containers/auth/service-container.js +48 -0
  31. package/dist/containers/content/clients/article-types.client.d.ts +15 -0
  32. package/dist/containers/content/clients/article-types.client.d.ts.map +1 -0
  33. package/dist/containers/content/clients/article-types.client.js +60 -0
  34. package/dist/containers/content/clients/articles.client.d.ts +15 -0
  35. package/dist/containers/content/clients/articles.client.d.ts.map +1 -0
  36. package/dist/containers/content/clients/articles.client.js +60 -0
  37. package/dist/containers/content/clients/comments.client.d.ts +15 -0
  38. package/dist/containers/content/clients/comments.client.d.ts.map +1 -0
  39. package/dist/containers/content/clients/comments.client.js +60 -0
  40. package/dist/containers/content/clients/reviews.client.d.ts +15 -0
  41. package/dist/containers/content/clients/reviews.client.d.ts.map +1 -0
  42. package/dist/containers/content/clients/reviews.client.js +60 -0
  43. package/dist/containers/content/clients/taxonomies.client.d.ts +15 -0
  44. package/dist/containers/content/clients/taxonomies.client.d.ts.map +1 -0
  45. package/dist/containers/content/clients/taxonomies.client.js +60 -0
  46. package/dist/containers/content/clients/terms.client.d.ts +15 -0
  47. package/dist/containers/content/clients/terms.client.d.ts.map +1 -0
  48. package/dist/containers/content/clients/terms.client.js +60 -0
  49. package/dist/containers/content/clients/translation.items.client.d.ts +16 -0
  50. package/dist/containers/content/clients/translation.items.client.d.ts.map +1 -0
  51. package/dist/containers/content/clients/translation.items.client.js +66 -0
  52. package/dist/containers/content/clients/translation.namespaces.client.d.ts +16 -0
  53. package/dist/containers/content/clients/translation.namespaces.client.d.ts.map +1 -0
  54. package/dist/containers/content/clients/translation.namespaces.client.js +66 -0
  55. package/dist/containers/content/clients/translation.projects.client.d.ts +16 -0
  56. package/dist/containers/content/clients/translation.projects.client.d.ts.map +1 -0
  57. package/dist/containers/content/clients/translation.projects.client.js +66 -0
  58. package/dist/containers/content/service-container.d.ts +29 -0
  59. package/dist/containers/content/service-container.d.ts.map +1 -0
  60. package/dist/containers/content/service-container.js +66 -0
  61. package/dist/containers/storage/clients/files.client.d.ts +13 -0
  62. package/dist/containers/storage/clients/files.client.d.ts.map +1 -0
  63. package/dist/containers/storage/clients/files.client.js +48 -0
  64. package/dist/containers/storage/clients/uploader.client.d.ts +6 -0
  65. package/dist/containers/storage/clients/uploader.client.d.ts.map +1 -0
  66. package/dist/containers/storage/clients/uploader.client.js +12 -0
  67. package/dist/containers/storage/clients/utils.client.d.ts +15 -0
  68. package/dist/containers/storage/clients/utils.client.d.ts.map +1 -0
  69. package/dist/containers/storage/clients/utils.client.js +45 -0
  70. package/dist/containers/storage/service-container.d.ts +31 -0
  71. package/dist/containers/storage/service-container.d.ts.map +1 -0
  72. package/dist/containers/storage/service-container.js +63 -0
  73. package/dist/containers/system/clients/apps.client.d.ts +16 -0
  74. package/dist/containers/system/clients/apps.client.d.ts.map +1 -0
  75. package/dist/containers/system/clients/apps.client.js +66 -0
  76. package/dist/containers/system/service-container.d.ts +13 -0
  77. package/dist/containers/system/service-container.d.ts.map +1 -0
  78. package/dist/containers/system/service-container.js +18 -0
  79. package/dist/exceptions/api-response.exception.d.ts +15 -0
  80. package/dist/exceptions/api-response.exception.d.ts.map +1 -0
  81. package/dist/exceptions/api-response.exception.js +26 -0
  82. package/dist/http-client.d.ts +20 -0
  83. package/dist/http-client.d.ts.map +1 -0
  84. package/dist/http-client.js +187 -0
  85. package/dist/index.d.ts +37 -0
  86. package/dist/index.d.ts.map +1 -0
  87. package/dist/index.js +237 -0
  88. package/dist/init-sdk.d.ts +21 -0
  89. package/dist/init-sdk.d.ts.map +1 -0
  90. package/dist/init-sdk.js +17 -0
  91. package/dist/sdk.test.d.ts +1 -0
  92. package/dist/sdk.test.d.ts.map +1 -0
  93. package/dist/sdk.test.js +1 -0
  94. package/dist/utils/helpers.d.ts +5 -0
  95. package/dist/utils/helpers.d.ts.map +1 -0
  96. package/dist/utils/helpers.js +13 -0
  97. package/dist/utils/logger.d.ts +133 -0
  98. package/dist/utils/logger.d.ts.map +1 -0
  99. package/dist/utils/logger.js +176 -0
  100. package/package.json +49 -0
  101. package/typings/index.d.ts +1 -0
  102. package/typings/v1/cache-manager/class.d.ts +0 -0
  103. package/typings/v1/cache-manager/entity.d.ts +83 -0
  104. package/typings/v1/cache-manager/index.d.ts +5 -0
  105. package/typings/v1/cache-manager/store.d.ts +35 -0
  106. package/typings/v1/events/index.d.ts +3 -0
  107. package/typings/v1/events/payloads.d.ts +339 -0
  108. package/typings/v1/index.d.ts +8 -0
  109. package/typings/v1/lib/execution-scenario/index.d.ts +27 -0
  110. package/typings/v1/lib/index.d.ts +4 -0
  111. package/typings/v1/lib/logger/index.d.ts +3 -0
  112. package/typings/v1/lib/logger/logger.d.ts +53 -0
  113. package/typings/v1/modules/express/express.d.ts +40 -0
  114. package/typings/v1/modules/express/index.d.ts +3 -0
  115. package/typings/v1/modules/index.d.ts +4 -0
  116. package/typings/v1/modules/mongoose/index.d.ts +3 -0
  117. package/typings/v1/modules/mongoose/mongoose.d.ts +48 -0
  118. package/typings/v1/sdk/index.d.ts +3 -0
  119. package/typings/v1/sdk/sdk.d.ts +158 -0
  120. package/typings/v1/security/auth-data.d.ts +36 -0
  121. package/typings/v1/security/index.d.ts +4 -0
  122. package/typings/v1/security/jwt.d.ts +36 -0
  123. package/typings/v1/services/auth/api/api-key.d.ts +144 -0
  124. package/typings/v1/services/auth/api/auth.d.ts +168 -0
  125. package/typings/v1/services/auth/api/index.d.ts +9 -0
  126. package/typings/v1/services/auth/api/permission-group.d.ts +95 -0
  127. package/typings/v1/services/auth/api/permission.d.ts +128 -0
  128. package/typings/v1/services/auth/api/role.d.ts +193 -0
  129. package/typings/v1/services/auth/api/tools.d.ts +33 -0
  130. package/typings/v1/services/auth/api/user.d.ts +391 -0
  131. package/typings/v1/services/auth/entities/_shared.d.ts +11 -0
  132. package/typings/v1/services/auth/entities/api-key.d.ts +29 -0
  133. package/typings/v1/services/auth/entities/federated-credential.d.ts +22 -0
  134. package/typings/v1/services/auth/entities/index.d.ts +9 -0
  135. package/typings/v1/services/auth/entities/permission-group.d.ts +20 -0
  136. package/typings/v1/services/auth/entities/permission.d.ts +24 -0
  137. package/typings/v1/services/auth/entities/role.d.ts +25 -0
  138. package/typings/v1/services/auth/entities/user.d.ts +153 -0
  139. package/typings/v1/services/auth/index.d.ts +5 -0
  140. package/typings/v1/services/auth/models/.DS_Store +0 -0
  141. package/typings/v1/services/auth/models/api-key.d.ts +19 -0
  142. package/typings/v1/services/auth/models/api-key.model.d.ts +3 -0
  143. package/typings/v1/services/auth/models/federated-credential.d.ts +24 -0
  144. package/typings/v1/services/auth/models/index.d.ts +9 -0
  145. package/typings/v1/services/auth/models/permission-group.d.ts +24 -0
  146. package/typings/v1/services/auth/models/permission.d.ts +22 -0
  147. package/typings/v1/services/auth/models/role.d.ts +22 -0
  148. package/typings/v1/services/auth/models/user.d.ts +22 -0
  149. package/typings/v1/services/content/api/article-type.d.ts +160 -0
  150. package/typings/v1/services/content/api/article.d.ts +108 -0
  151. package/typings/v1/services/content/api/comment.d.ts +106 -0
  152. package/typings/v1/services/content/api/index.d.ts +12 -0
  153. package/typings/v1/services/content/api/review.d.ts +105 -0
  154. package/typings/v1/services/content/api/taxonomy.d.ts +101 -0
  155. package/typings/v1/services/content/api/term.d.ts +101 -0
  156. package/typings/v1/services/content/api/translation.item.d.ts +195 -0
  157. package/typings/v1/services/content/api/translation.namespace.d.ts +135 -0
  158. package/typings/v1/services/content/api/translation.project.d.ts +196 -0
  159. package/typings/v1/services/content/api/translation.tools.d.ts +85 -0
  160. package/typings/v1/services/content/entities/article-type.d.ts +51 -0
  161. package/typings/v1/services/content/entities/article.d.ts +53 -0
  162. package/typings/v1/services/content/entities/comment.d.ts +34 -0
  163. package/typings/v1/services/content/entities/index.d.ts +11 -0
  164. package/typings/v1/services/content/entities/review.d.ts +35 -0
  165. package/typings/v1/services/content/entities/taxonomy.d.ts +40 -0
  166. package/typings/v1/services/content/entities/term.d.ts +43 -0
  167. package/typings/v1/services/content/entities/translation.item.d.ts +48 -0
  168. package/typings/v1/services/content/entities/translation.namespace.d.ts +29 -0
  169. package/typings/v1/services/content/entities/translation.project.d.ts +98 -0
  170. package/typings/v1/services/content/index.d.ts +5 -0
  171. package/typings/v1/services/content/models/article-type.d.ts +19 -0
  172. package/typings/v1/services/content/models/article.d.ts +19 -0
  173. package/typings/v1/services/content/models/comment.d.ts +19 -0
  174. package/typings/v1/services/content/models/index.d.ts +11 -0
  175. package/typings/v1/services/content/models/review.d.ts +19 -0
  176. package/typings/v1/services/content/models/taxonomy.d.ts +19 -0
  177. package/typings/v1/services/content/models/term.d.ts +19 -0
  178. package/typings/v1/services/content/models/translation.item.d.ts +21 -0
  179. package/typings/v1/services/content/models/translation.namespace.d.ts +22 -0
  180. package/typings/v1/services/content/models/translation.project.d.ts +21 -0
  181. package/typings/v1/services/index.d.ts +4 -0
  182. package/typings/v1/services/storage/api/index.d.ts +3 -0
  183. package/typings/v1/services/storage/api/uploaded-file.d.ts +166 -0
  184. package/typings/v1/services/storage/entities/index.d.ts +3 -0
  185. package/typings/v1/services/storage/entities/uploaded-file.d.ts +49 -0
  186. package/typings/v1/services/storage/index.d.ts +5 -0
  187. package/typings/v1/services/storage/models/index.d.ts +3 -0
  188. package/typings/v1/services/storage/models/uploaded-file.d.ts +19 -0
  189. package/typings/v1/services/system/api/app.d.ts +130 -0
  190. package/typings/v1/services/system/api/index.d.ts +3 -0
  191. package/typings/v1/services/system/entities/app.d.ts +97 -0
  192. package/typings/v1/services/system/entities/index.d.ts +3 -0
  193. package/typings/v1/services/system/index.d.ts +5 -0
  194. package/typings/v1/services/system/models/app.d.ts +19 -0
  195. package/typings/v1/services/system/models/index.d.ts +3 -0
  196. package/typings/v1/ui/admin/index.d.ts +1 -0
  197. package/typings/v1/ui/forms/article/custom-fieds/custom-field.d.ts +189 -0
  198. package/typings/v1/ui/forms/article/custom-fieds/fields/article_object.custom-field.d.ts +29 -0
  199. package/typings/v1/ui/forms/article/custom-fieds/fields/boolean.custom-field.d.ts +24 -0
  200. package/typings/v1/ui/forms/article/custom-fieds/fields/checkbox.custom-field.d.ts +26 -0
  201. package/typings/v1/ui/forms/article/custom-fieds/fields/date.custom-field.d.ts +23 -0
  202. package/typings/v1/ui/forms/article/custom-fieds/fields/date_range.custom-field.d.ts +26 -0
  203. package/typings/v1/ui/forms/article/custom-fieds/fields/file.custom-field.d.ts +26 -0
  204. package/typings/v1/ui/forms/article/custom-fieds/fields/image.custom-field.d.ts +25 -0
  205. package/typings/v1/ui/forms/article/custom-fieds/fields/index.d.ts +11 -0
  206. package/typings/v1/ui/forms/article/custom-fieds/fields/number.custom-field.d.ts +26 -0
  207. package/typings/v1/ui/forms/article/custom-fieds/fields/radiobox.custom-field.d.ts +27 -0
  208. package/typings/v1/ui/forms/article/custom-fieds/fields/select.custom-field.d.ts +27 -0
  209. package/typings/v1/ui/forms/article/custom-fieds/fields/text.custom-field.d.ts +26 -0
  210. package/typings/v1/ui/forms/article/custom-fieds/fields/time.custom-field.d.ts +24 -0
  211. package/typings/v1/ui/forms/article/custom-fieds/index.d.ts +1 -0
  212. package/typings/v1/ui/forms/article/index.d.ts +1 -0
  213. package/typings/v1/ui/forms/index.d.ts +1 -0
  214. package/typings/v1/ui/index.d.ts +3 -0
  215. package/typings/v1/ui/routes/index.d.ts +1 -0
  216. package/typings/v1/ui/routes/routes.d.ts +73 -0
  217. package/typings/v1/utils/api/index.d.ts +4 -0
  218. package/typings/v1/utils/api/request.d.ts +215 -0
  219. package/typings/v1/utils/api/response.d.ts +188 -0
  220. package/typings/v1/utils/common/common.d.ts +53 -0
  221. package/typings/v1/utils/common/index.d.ts +3 -0
  222. package/typings/v1/utils/dev/config.d.ts +135 -0
  223. package/typings/v1/utils/dev/index.d.ts +4 -0
  224. package/typings/v1/utils/dev/instrumentation.d.ts +41 -0
  225. package/typings/v1/utils/entities/entities.d.ts +66 -0
  226. package/typings/v1/utils/entities/index.d.ts +4 -0
  227. package/typings/v1/utils/entities/snapshots.d.ts +69 -0
  228. package/typings/v1/utils/index.d.ts +10 -0
  229. package/typings/v1/utils/models/index.d.ts +3 -0
  230. package/typings/v1/utils/models/models.d.ts +50 -0
  231. package/typings/v1/utils/seed/index.d.ts +3 -0
  232. package/typings/v1/utils/seed/locations.d.ts +41 -0
  233. package/typings/v1/utils/system/microservice.d.ts +11 -0
  234. package/typings/v1/utils/system/models.d.ts +21 -0
  235. package/typings/v1/utils/utils.d.ts +171 -0
@@ -0,0 +1,391 @@
1
+ declare module Levelup {
2
+ namespace CMS {
3
+ namespace V1 {
4
+ namespace Users {
5
+ export namespace Api {
6
+ export namespace Users {
7
+ /**
8
+ * --------------------------------------------------------------------------
9
+ * Create
10
+ * --------------------------------------------------------------------------
11
+ * @link
12
+ * @fires UsersService.Create
13
+ * @param {Levelup.V2.Users.Api.Users.Create.Request} query
14
+ * @returns {Levelup.V2.Users.Api.Users.Create.Response}
15
+ * @method POST
16
+ *
17
+ */
18
+ export namespace Create {
19
+ export type Request =
20
+ Levelup.V2.Utils.Api.Request.BuildCreateRequest<Entity.User>;
21
+ export type Response =
22
+ Utils.Api.Response.BuildSingleItemResponse<Entity.ExposedUser>;
23
+ }
24
+
25
+ /**
26
+ * --------------------------------------------------------------------------
27
+ * Update
28
+ * --------------------------------------------------------------------------
29
+ * @link
30
+ * @fires UsersService.Update
31
+ * @param {Levelup.V2.Users.Api.Users.Update.Request} query
32
+ * @returns {Levelup.V2.Users.Api.Users.Update.Response}
33
+ * @method PUT
34
+ *
35
+ */
36
+ export namespace Update {
37
+ export type Request =
38
+ Levelup.V2.Utils.Api.Request.BuildUpdateRequest<Entity.User>;
39
+ export type Response =
40
+ Utils.Api.Response.BuildSingleItemResponse<Entity.ExposedUser>;
41
+ }
42
+
43
+ /**
44
+ * --------------------------------------------------------------------------
45
+ * UpdateProfile
46
+ * --------------------------------------------------------------------------
47
+ * @link
48
+ * @fires UsersService.UpdateProfile
49
+ * @param {Levelup.V2.Users.Api.Users.UpdateProfile.Request} query
50
+ * @returns {Levelup.V2.Users.Api.Users.UpdateProfile.Response}
51
+ * @method PUT
52
+ * @link /profile/:id
53
+ *
54
+ */
55
+ export namespace UpdateProfile {
56
+ export type Request =
57
+ Levelup.V2.Utils.Api.Request.BuildUpdateRequest<
58
+ Entity.User["profile"]
59
+ >;
60
+ export type Response =
61
+ Utils.Api.Response.BuildSingleItemResponse<Entity.ExposedUser>;
62
+ }
63
+
64
+ /**
65
+ * --------------------------------------------------------------------------
66
+ * UpdatePreferences
67
+ * --------------------------------------------------------------------------
68
+ * @link
69
+ * @fires UsersService.UpdatePreferences
70
+ * @param {Levelup.V2.Users.Api.Users.UpdatePreferences.Request} query
71
+ * @returns {Levelup.V2.Users.Api.Users.UpdatePreferences.Response}
72
+ * @method PUT
73
+ * @link /preferences/:id
74
+ *
75
+ */
76
+ export namespace UpdatePreferences {
77
+ export type Request =
78
+ Levelup.V2.Utils.Api.Request.BuildUpdateRequest<
79
+ Entity.User["preferences"]
80
+ >;
81
+ export type Response =
82
+ Utils.Api.Response.BuildSingleItemResponse<Entity.ExposedUser>;
83
+ }
84
+
85
+ /**
86
+ * --------------------------------------------------------------------------
87
+ * UpdateLoginInfo
88
+ * --------------------------------------------------------------------------
89
+ * @method PUT
90
+ * @link /api/v2/users/:id/update-login-info
91
+ * @fires UsersService.updateLoginInfo
92
+ * @param {Levelup.V2.Users.Api.Users.UpdateLoginInfo.Request} query
93
+ * @returns {Levelup.V2.Users.Api.Users.UpdateLoginInfo.Response}
94
+ *
95
+ */
96
+ export namespace UpdateLoginInfo {
97
+ export type Request =
98
+ Levelup.V2.Utils.Api.Request.BuildUpdateRequest<{
99
+ email: string | undefined;
100
+ password: string;
101
+ }>;
102
+ export type Response =
103
+ Utils.Api.Response.BuildSingleItemResponse<Entity.ExposedUser>;
104
+ }
105
+
106
+ /**
107
+ * --------------------------------------------------------------------------
108
+ * UpdateSettings
109
+ * --------------------------------------------------------------------------
110
+ * @link
111
+ * @fires UsersService.UpdateSettings
112
+ * @param {Levelup.V2.Users.Api.Users.UpdateSettings.Request} query
113
+ * @returns {Levelup.V2.Users.Api.Users.UpdateSettings.Response}
114
+ * @method PUT
115
+ *
116
+ */
117
+ export namespace UpdateSettings {
118
+ export type Request =
119
+ Levelup.V2.Utils.Api.Request.BuildUpdateRequest<{
120
+ userPreferences?: Partial<Entity.IUserPreferences>;
121
+ delivererSettings?: Entity.IDelivererSettings;
122
+ }>;
123
+ export type Response =
124
+ Utils.Api.Response.BuildSingleItemResponse<{
125
+ userPreferences?: Partial<Entity.IUserPreferences>;
126
+ delivererSettings?: Entity.IDelivererSettings;
127
+ }>;
128
+ }
129
+
130
+ /**
131
+ * --------------------------------------------------------------------------
132
+ * Delete
133
+ * --------------------------------------------------------------------------
134
+ * @link
135
+ * @fires UsersService.Delete
136
+ * @param {Levelup.V2.Users.Api.Users.Delete.Request} query
137
+ * @returns {Levelup.V2.Users.Api.Users.Delete.Response}
138
+ * @method DELETE
139
+ *
140
+ */
141
+ export namespace Delete {
142
+ export type Request = Levelup.V2.Utils.Api.Request.Build<
143
+ Record<string, never>
144
+ >;
145
+ export type Response = Utils.Api.Response.DefaultDeleteResponse;
146
+ }
147
+
148
+ /**
149
+ * --------------------------------------------------------------------------
150
+ * BulkDelete
151
+ * --------------------------------------------------------------------------
152
+ * @link
153
+ * @fires UsersService.BulkDelete
154
+ * @param {Levelup.V2.Users.Api.Users.BulkDelete.Request} query
155
+ * @returns {Levelup.V2.Users.Api.Users.BulkDelete.Response}
156
+ * @method DELETE
157
+ *
158
+ */
159
+ export namespace BulkDelete {
160
+ export type Request = Levelup.V2.Utils.Api.Request.Build<{
161
+ items: string[];
162
+ hard?: boolean;
163
+ }>;
164
+ export type Response = Utils.Api.Response.DefaultDeleteResponse;
165
+ }
166
+
167
+ /**
168
+ * --------------------------------------------------------------------------
169
+ * one
170
+ * --------------------------------------------------------------------------
171
+ * @method GET
172
+ * @link /api/v2/users/:id
173
+ * @fires UsersService.One
174
+ * @param {Levelup.V2.Users.Api.Users.GetOne.Request} query
175
+ * @returns {Levelup.V2.Users.Api.Users.GetOne.Response}
176
+ *
177
+ */
178
+ export namespace GetOne {
179
+ export type Scope = "autocomplete";
180
+
181
+ export type Request = Levelup.V2.Utils.Api.Request.Build<
182
+ Record<string, unknown>
183
+ >;
184
+ export type Response =
185
+ Utils.Api.Response.BuildSingleItemResponse<Entity.ExposedUser>;
186
+ }
187
+
188
+ /**
189
+ * --------------------------------------------------------------------------
190
+ * List
191
+ * --------------------------------------------------------------------------
192
+ * @link
193
+ * @fires UsersService.List
194
+ * @param {Levelup.V2.Users.Api.Users.List.Request} query
195
+ * @returns {Levelup.V2.Users.Api.Users.List.Response}
196
+ * @method GET
197
+ *
198
+ */
199
+ export namespace List {
200
+ export type Scope = "";
201
+
202
+ export type Request =
203
+ Levelup.V2.Utils.Api.Request.BuildSearchablePagedSortableFilterableProjectable<Entity.ExposedUser> & {
204
+ filters?: {
205
+ store?: Utils.Common.ID | Utils.Common.ID[];
206
+ office?: Utils.Common.ID | Utils.Common.ID[];
207
+ country?: Utils.Common.ID | Utils.Common.ID[];
208
+ state?: Utils.Common.ID | Utils.Common.ID[];
209
+ city?: Utils.Common.ID | Utils.Common.ID[];
210
+ };
211
+ };
212
+ export type Response = Utils.Api.Response.BuildListResponse<
213
+ Entity.ExposedUser,
214
+ "companies" | "stores"
215
+ >;
216
+ }
217
+
218
+ /**
219
+ * --------------------------------------------------------------------------
220
+ * ChangeRole
221
+ * --------------------------------------------------------------------------
222
+ * @method PUT
223
+ * @link /api/v2/users/:id/change-role
224
+ * @fires UsersService.ChangeRole
225
+ * @param {Levelup.V2.Users.Api.Users.ChangeRole.Request} query
226
+ * @returns {Levelup.V2.Users.Api.Users.ChangeRole.Response}
227
+ *
228
+ */
229
+ export namespace ChangeRole {
230
+ export type Request =
231
+ Levelup.V2.Utils.Api.Request.BuildUpdateRequest<{
232
+ user_id?: Utils.Common.ID;
233
+ /**
234
+ * Role name or ID
235
+ */
236
+ role: string;
237
+ }>;
238
+ export type Response =
239
+ Utils.Api.Response.BuildSingleItemResponse<Entity.ExposedUser>;
240
+ }
241
+
242
+ /**
243
+ * --------------------------------------------------------------------------
244
+ * ChangePermissions
245
+ * --------------------------------------------------------------------------
246
+ * @method PUT
247
+ * @link /api/v2/users/:id/change-permissions
248
+ * @fires Service.ChangePermissions
249
+ * @param {Levelup.V2.Users.Api.Users.ChangePermissions.Request} query
250
+ * @returns {Levelup.V2.Users.Api.Users.ChangePermissions.Response}
251
+ *
252
+ */
253
+ export namespace ChangePermissions {
254
+ export type Request =
255
+ Levelup.V2.Utils.Api.Request.BuildUpdateRequest<{
256
+ user_id?: Utils.Common.ID;
257
+ permissions: Utils.Common.ID[];
258
+ }>;
259
+ export type Response =
260
+ Utils.Api.Response.BuildSingleItemResponse<Entity.ExposedUser>;
261
+ }
262
+
263
+ /**
264
+ * --------------------------------------------------------------------------
265
+ * ChangeSuspendStatus
266
+ * --------------------------------------------------------------------------
267
+ * @method PUT
268
+ * @link /api/v2/users/:id/change-suspend-status
269
+ * @fires Service.ChangeSuspendStatus
270
+ * @param {Levelup.V2.Users.Api.Users.ChangeSuspendStatus.Request} query
271
+ * @returns {Levelup.V2.Users.Api.Users.ChangeSuspendStatus.Response}
272
+ *
273
+ */
274
+ export namespace ChangeSuspendStatus {
275
+ export type Request =
276
+ Levelup.V2.Utils.Api.Request.BuildUpdateRequest<never>;
277
+ export type Response =
278
+ Utils.Api.Response.BuildSingleItemResponse<Entity.ExposedUser>;
279
+ }
280
+
281
+ /**
282
+ * --------------------------------------------------------------------------
283
+ * SetLastManagedStore
284
+ * --------------------------------------------------------------------------
285
+ * @method PUT
286
+ * @link /api/v2/users/set-last-managed-store
287
+ * @fires Service.SetLastManagedStore
288
+ * @param {Levelup.V2.Users.Api.Users.SetLastManagedStore.Request} query
289
+ * @returns {Levelup.V2.Users.Api.Users.SetLastManagedStore.Response}
290
+ *
291
+ */
292
+ export namespace SetLastManagedStore {
293
+ export type Request =
294
+ Levelup.V2.Utils.Api.Request.BuildUpdateRequest<{
295
+ store_id: Utils.Common.ID;
296
+ }>;
297
+ export type Response =
298
+ Utils.Api.Response.BuildSingleItemResponse<{}>;
299
+ }
300
+
301
+ /**
302
+ * --------------------------------------------------------------------------
303
+ * SetLastManagedOffice
304
+ * --------------------------------------------------------------------------
305
+ * @method PUT
306
+ * @link /api/v2/users/set-last-managed-office
307
+ * @fires Service.SetLastManagedOffice
308
+ * @param {Levelup.V2.Users.Api.Users.SetLastManagedOffice.Request} query
309
+ * @returns {Levelup.V2.Users.Api.Users.SetLastManagedOffice.Response}
310
+ *
311
+ */
312
+ export namespace SetLastManagedOffice {
313
+ export type Request =
314
+ Levelup.V2.Utils.Api.Request.BuildUpdateRequest<{
315
+ office1_id: Utils.Common.ID;
316
+ }>;
317
+ export type Response =
318
+ Utils.Api.Response.BuildSingleItemResponse<{}>;
319
+ }
320
+
321
+ /**
322
+ * --------------------------------------------------------------------------
323
+ * ListUserPermissions
324
+ * --------------------------------------------------------------------------
325
+ * @method GET
326
+ * @link /api/v2/users/:id/permissions
327
+ * @fires UsersService.listUserPermissions
328
+ * @param {Levelup.V2.Users.Api.Users.ListUserPermissions.Request} query
329
+ * @returns {Levelup.V2.Users.Api.Users.ListUserPermissions.Response}
330
+ *
331
+ */
332
+ export namespace ListUserPermissions {
333
+ export type Request = Levelup.V2.Utils.Api.Request.Build<
334
+ Record<string, unknown>
335
+ >;
336
+ export type Response =
337
+ Utils.Api.Response.BuildSingleItemResponse<{
338
+ /**
339
+ * List of permission names
340
+ */
341
+ permissions: {
342
+ _id: Utils.Common.ID;
343
+ group: Utils.Common.ID;
344
+ name: string;
345
+ }[];
346
+ user: Entity.ExposedUser;
347
+ }>;
348
+ }
349
+
350
+ /**
351
+ * --------------------------------------------------------------------------
352
+ * GetInsightsHierarchySnapshotList
353
+ * --------------------------------------------------------------------------
354
+ * @link
355
+ * @fires UsersService.GetInsightsHierarchySnapshotList
356
+ * @param {Levelup.V2.Users.Api.Users.GetInsightsHierarchySnapshotList.Request}
357
+ * @returns {Levelup.V2.Users.Api.Users.GetInsightsHierarchySnapshotList.Response}
358
+ */
359
+ export namespace GetInsightsHierarchySnapshotList {
360
+ export type Request = Levelup.V2.Utils.Api.Request.Build<
361
+ Record<string, unknown>
362
+ >;
363
+ type ItemDatum = {
364
+ _id: Utils.Common.ID;
365
+ tr: string;
366
+ dl: boolean;
367
+ usr: string | null;
368
+ cr: Date;
369
+ fst: string | null;
370
+ fml: string | null;
371
+ r: string;
372
+ p: string | null;
373
+ c?: string | null;
374
+ sn?: string | null;
375
+ st?: string | null;
376
+ };
377
+ export type Response = Utils.Api.Response.DefaultResponse & {
378
+ data?: {
379
+ data?: ItemDatum[];
380
+ last_update?: Date;
381
+ found: boolean;
382
+ expired: boolean;
383
+ };
384
+ };
385
+ }
386
+ }
387
+ }
388
+ }
389
+ }
390
+ }
391
+ }
@@ -0,0 +1,11 @@
1
+ declare module Levelup {
2
+ namespace CMS {
3
+ namespace V1 {
4
+ namespace Auth {
5
+ export namespace Entity {
6
+ export type TJWTTokenSpace = "default" | "payment";
7
+ }
8
+ }
9
+ }
10
+ }
11
+ }
@@ -0,0 +1,29 @@
1
+ declare module Levelup {
2
+ namespace CMS {
3
+ namespace V1 {
4
+ namespace Auth {
5
+ export namespace Entity {
6
+ export type ApiKey = Utils.Entity.General.ICreatable &
7
+ Utils.Entity.General.IHasSearchMeta & {
8
+ _id: Utils.Common.ID;
9
+ name: string;
10
+ related_to: ("company" | "app" | "store")[];
11
+ app: string | null;
12
+ company: string | null;
13
+ store: string | null;
14
+ last_use: Date;
15
+ token: string;
16
+ encryptedKey: string;
17
+ salt: string;
18
+ permissions: string[];
19
+ };
20
+
21
+ export type ExposedApiKey = Omit<
22
+ Entity.ApiKey,
23
+ "salt" | "encryptedKey"
24
+ >;
25
+ }
26
+ }
27
+ }
28
+ }
29
+ }
@@ -0,0 +1,22 @@
1
+ declare module Levelup {
2
+ namespace CMS {
3
+ namespace V1 {
4
+ namespace Auth {
5
+ export namespace Entity {
6
+ export interface FederatedCredential {
7
+ created_at?: Date;
8
+ updated_at?: Date;
9
+ is_deleted?: boolean;
10
+ deleted_at?: Date | null;
11
+ _id: Utils.Common.ID;
12
+ //
13
+ user_id: Utils.Common.ID;
14
+ provider: string;
15
+ issuer: string;
16
+ id: Utils.Common.ID;
17
+ }
18
+ }
19
+ }
20
+ }
21
+ }
22
+ }
@@ -0,0 +1,9 @@
1
+ 'generated by levelup';
2
+
3
+ export * from "./user.d.ts";
4
+ export * from "./role.d.ts";
5
+ export * from "./permission.d.ts";
6
+ export * from "./permission-group.d.ts";
7
+ export * from "./api-key.d.ts";
8
+ export * from "./_shared.d.ts";
9
+ export * from "./federated-credential.d.ts";
@@ -0,0 +1,20 @@
1
+ declare module Levelup {
2
+ namespace CMS {
3
+ namespace V1 {
4
+ namespace Auth {
5
+ export namespace Entity {
6
+ export interface PermissionGroup
7
+ extends Utils.Entity.General.ICreatable,
8
+ Utils.Entity.General.IHasSearchMeta {
9
+ _id: Utils.Common.ID;
10
+ is_system: boolean;
11
+ service: string | null;
12
+ name: string;
13
+ description: string;
14
+ permissions: Utils.Common.ID[];
15
+ }
16
+ }
17
+ }
18
+ }
19
+ }
20
+ }
@@ -0,0 +1,24 @@
1
+ declare module Levelup {
2
+ namespace CMS {
3
+ namespace V1 {
4
+ namespace Auth {
5
+ export namespace Entity {
6
+ export interface Permission
7
+ extends Utils.Entity.General.ICreatable,
8
+ Utils.Entity.General.IHasSearchMeta {
9
+ _id: Utils.Common.ID;
10
+ is_system: boolean;
11
+ service: string | null;
12
+ group: Utils.Common.ID | null | PermissionGroup;
13
+ name: string;
14
+ description: string;
15
+ roles: Utils.Common.ID[];
16
+ insights?: {
17
+ user_count?: number;
18
+ };
19
+ }
20
+ }
21
+ }
22
+ }
23
+ }
24
+ }
@@ -0,0 +1,25 @@
1
+ declare module Levelup {
2
+ namespace CMS {
3
+ namespace V1 {
4
+ namespace Auth {
5
+ export namespace Entity {
6
+ export interface Role
7
+ extends Utils.Entity.General.ICreatable,
8
+ Utils.Entity.General.IHasSearchMeta {
9
+ _id: Utils.Common.ID;
10
+ is_system: boolean;
11
+ is_company_related: boolean;
12
+ name: string;
13
+ description: string;
14
+ has_all_permissions?: boolean;
15
+ permissions?: Utils.Common.ID[];
16
+
17
+ insights?: {
18
+ user_count?: number;
19
+ };
20
+ }
21
+ }
22
+ }
23
+ }
24
+ }
25
+ }
@@ -0,0 +1,153 @@
1
+ declare module Levelup {
2
+ namespace CMS {
3
+ namespace V1 {
4
+ namespace Users {
5
+ export namespace Entity {
6
+ export type Sex = "male" | "female";
7
+
8
+ export interface IUserProfile {
9
+ full_name?: string;
10
+ first_name: string;
11
+ family_name: string;
12
+ sex: Sex | null;
13
+ photo: Utils.Common.FileAttribute;
14
+ phones: string[];
15
+ website: string | null;
16
+ address: Utils.Entity.Snapshots.Locations.Address;
17
+ has_work_address: boolean;
18
+ work_address: Utils.Entity.Snapshots.Locations.Address | null;
19
+ social_links?: {
20
+ network: Utils.Common.SocialNetworks;
21
+ url: string;
22
+ }[];
23
+ }
24
+
25
+ export interface IUserPreferences {
26
+ ui_mode?: UI.Mode;
27
+ ui_language?: Levelup.V2.Cm.Translation.Entity.TLanguageCode;
28
+ printer_format?: Reports.Settings.PrinterFormat;
29
+ }
30
+ export interface IDelivererData {
31
+ today_total_parcels?: {
32
+ tracking_id: Utils.Common.TrackingID;
33
+ amount: number;
34
+ }[];
35
+ today_delivered_parcels?: {
36
+ tracking_id: Utils.Common.TrackingID;
37
+ amount: number;
38
+ }[];
39
+ today_failed_parcels?: {
40
+ tracking_id: Utils.Common.TrackingID;
41
+ amount: number;
42
+ }[];
43
+ }
44
+
45
+ export interface IUserInsights {
46
+ last_updated: Date | null;
47
+ rating: number;
48
+ parcel_count: number;
49
+ delivered_parcel_count: number;
50
+ returned_parcel_count: number;
51
+ delivered_parcel_percentage: number;
52
+ returned_parcel_percentage: number;
53
+ complaint_count: number;
54
+ resolved_complaint_count: number;
55
+ resolved_complaint_percentage: number;
56
+ balance: number;
57
+ }
58
+
59
+ export interface IUserAttributes {
60
+ is_suspended?: boolean;
61
+ is_approved?: boolean;
62
+ is_active?: boolean;
63
+ inactive_since?: Date | null;
64
+
65
+ nid?: string | null;
66
+ driving_license_id?: string | null;
67
+ started_at?: Date | null;
68
+
69
+ multi_office_user?: {
70
+ is_related_to_offices?: boolean;
71
+ can_manage_all_offices?: boolean;
72
+ subscribed_at_office?: Utils.Common.ID | null;
73
+ managed_offices?: Utils.Common.ID[];
74
+ last_managed_office?: Utils.Common.ID | null;
75
+ } | null;
76
+
77
+ seller?: {
78
+ stores: Utils.Common.ID[];
79
+ last_managed_store?: Utils.Common.ID;
80
+ } | null;
81
+
82
+ deliverer?: {
83
+ countries?: Utils.Common.LocationAdministrativeCode[];
84
+ states?: Utils.Common.LocationAdministrativeCode[];
85
+ cities?: Utils.Common.LocationAdministrativeCode[];
86
+ is_freelancer?: boolean;
87
+ default_delivery_fees?: number;
88
+ delivery_fees?: {
89
+ city: {
90
+ country: Utils.Common.LocationAdministrativeCode;
91
+ state: Utils.Common.LocationAdministrativeCode;
92
+ city: Utils.Common.LocationAdministrativeCode;
93
+ };
94
+ is_default: boolean;
95
+ fees: number;
96
+ }[];
97
+ } | null;
98
+
99
+ team?: {
100
+ has_team: boolean;
101
+ team?: {
102
+ leader: string;
103
+ members: string[];
104
+ };
105
+ };
106
+ }
107
+
108
+ export interface IUserSnapshots {
109
+ stores?: Utils.Entity.Snapshots.Accounts.Store[];
110
+ company?: Utils.Entity.Snapshots.Accounts.Company;
111
+ offices?: Utils.Entity.Snapshots.Logistics.Office[];
112
+ team_leader?: Utils.Entity.Snapshots.Auth.User;
113
+ team_members?: Utils.Entity.Snapshots.Auth.User[];
114
+ }
115
+
116
+ export interface User
117
+ extends Utils.Entity.General.ICreatable,
118
+ Utils.Entity.General.IHasSearchMeta {
119
+ _id: Utils.Common.ID;
120
+ tracking_id: Utils.Common.TrackingID;
121
+ //
122
+ email: string;
123
+ password?: string;
124
+ salt?: string;
125
+ role: Auth.Entity.TDefaultUserRoles | string;
126
+ permissions: Utils.Common.ID[];
127
+ permissions_other_than_role?: boolean;
128
+
129
+ profile: IUserProfile;
130
+ preferences?: IUserPreferences;
131
+ deliverer_data?: IDelivererData;
132
+ attributes: IUserAttributes;
133
+ snapshots?: IUserSnapshots;
134
+ insights?: IUserInsights;
135
+ auth_meta?: {
136
+ last_login: Date | null;
137
+ last_logout: Date | null;
138
+ last_password_change: Date | null;
139
+ last_password_reset: Date | null;
140
+ last_password_reset_request: Date | null;
141
+ password_reset_token: string | null;
142
+ password_reset_token_expiration: Date | null;
143
+ password_reset_token_used: boolean;
144
+ password_reset_token_used_at: Date | null;
145
+ } | null;
146
+ }
147
+
148
+ export type ExposedUser = Omit<User, "password" | "salt">;
149
+ }
150
+ }
151
+ }
152
+ }
153
+ }