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,27 @@
1
+ declare module Levelup {
2
+
3
+ namespace CMS {
4
+ namespace V1 {
5
+ export namespace UI {
6
+ export namespace Forms {
7
+ export namespace CustomFields {
8
+ export namespace RadioboxField {
9
+
10
+
11
+ export type Key = "radiobox";
12
+
13
+ export type Input = SingleValue<string>;
14
+
15
+ export type Output = SingleValue<Utils.Common.TLabelValue>;
16
+
17
+ export type Options = BaseFieldOption<Input, false> & {
18
+ choices: MultiValue<Utils.Common.TLabelValue>
19
+
20
+ }
21
+ }
22
+ }
23
+ }
24
+ }
25
+ }
26
+ }
27
+ }
@@ -0,0 +1,27 @@
1
+ declare module Levelup {
2
+
3
+ namespace CMS {
4
+ namespace V1 {
5
+ export namespace UI {
6
+ export namespace Forms {
7
+ export namespace CustomFields {
8
+ export namespace SelectField {
9
+
10
+
11
+ export type Key = "select";
12
+
13
+ export type Input<IsMulti extends boolean = false> = IsMulti extends true ? string[] : string | null;
14
+
15
+ export type Output<IsMulti extends boolean = false> = IsMulti extends true ? Utils.Common.TLabelValue[] : Utils.Common.TLabelValue | null;
16
+
17
+ export type Options<IsMulti extends boolean = false> = BaseFieldOption<Input<IsMulti>, IsMulti> & {
18
+ multiple?: IsMulti;
19
+ choices: MultiValue<Utils.Common.TLabelValue>
20
+ }
21
+ }
22
+ }
23
+ }
24
+ }
25
+ }
26
+ }
27
+ }
@@ -0,0 +1,26 @@
1
+ declare module Levelup {
2
+
3
+ namespace CMS {
4
+ namespace V1 {
5
+ export namespace UI {
6
+ export namespace Forms {
7
+ export namespace CustomFields {
8
+ export namespace TextField {
9
+
10
+ export type Key = "text";
11
+
12
+ export type Input = string | null;
13
+
14
+ export type Output = Input;
15
+
16
+ export type Options = BaseFieldOption<Input, false> & {
17
+ min: number;
18
+ max: number;
19
+ }
20
+ }
21
+ }
22
+ }
23
+ }
24
+ }
25
+ }
26
+ }
@@ -0,0 +1,24 @@
1
+ declare module Levelup {
2
+
3
+ namespace CMS {
4
+ namespace V1 {
5
+ export namespace UI {
6
+ export namespace Forms {
7
+ export namespace CustomFields {
8
+ export namespace TimeField {
9
+
10
+ export type Key = "time";
11
+
12
+ export type Input = SingleValue<Utils.Common.Time>;
13
+
14
+ export type Output = Input;
15
+
16
+ export type Options = BaseFieldOption<Input> & {
17
+ }
18
+ }
19
+ }
20
+ }
21
+ }
22
+ }
23
+ }
24
+ }
@@ -0,0 +1 @@
1
+ export * from "./fields/index..d.ts";
@@ -0,0 +1 @@
1
+ export * from "./custom-fields/index..d.ts";
@@ -0,0 +1 @@
1
+ export * from "./article/index.d.ts";
@@ -0,0 +1,3 @@
1
+ export * from "./admin/index.d.ts";
2
+ export * from "./forms/index.d.ts";
3
+ export * from "./routes/index.d.ts";
@@ -0,0 +1 @@
1
+ export * from "./routes.d.ts";
@@ -0,0 +1,73 @@
1
+ declare module Levelup {
2
+ namespace CMS {
3
+ namespace V1 {
4
+ export namespace UI {
5
+ export namespace Routes {
6
+ type IconType = (props: {
7
+ className?: string | undefined;
8
+ height?: number | string | undefined;
9
+ id?: string | undefined;
10
+ lang?: string | undefined;
11
+ max?: number | string | undefined;
12
+ media?: string | undefined;
13
+ method?: string | undefined;
14
+ min?: number | string | undefined;
15
+ name?: string | undefined;
16
+ style?: CSSProperties | undefined;
17
+ target?: string | undefined;
18
+ type?: string | undefined;
19
+ width?: number | string | undefined;
20
+ children?: React.ReactNode;
21
+ size?: string | number;
22
+ color?: string;
23
+ title?: string;
24
+ }) => JSX.Element;
25
+
26
+ type TACAction = "read" | "create" | "update" | "delete" | "manage";
27
+
28
+ type TMenuSlotName = "articleTypes";
29
+ type TMenuSlotResultReturnType = {
30
+ [id: string]: Levelup.CMS.V1.UI.Routes.RouteItem;
31
+ };
32
+ type TMenuSlotResultFunction<T extends TMenuSlotName> =
33
+ T extends "articleTypes"
34
+ ? (
35
+ types: Levelup.CMS.V1.Content.Entity.ArticleType[],
36
+ ) => Promise<TMenuSlotResultReturnType>
37
+ : () => Promise<TMenuSlotResultReturnType>;
38
+
39
+ type TMenuSlot<T extends TMenuSlotName> = () => {
40
+ slot: T;
41
+ result: TMenuSlotResultFunction<T>;
42
+ };
43
+
44
+ type RouteItem = {
45
+ path: `/${string}`;
46
+ title: string;
47
+ menuTitle?: string;
48
+ icon?: IconType;
49
+ ac: (
50
+ | `${string}.${TACAction}`
51
+ | ((config: { extensions: string[] }) => boolean)
52
+ )[];
53
+ tutorialLink?: string;
54
+ description?: string;
55
+ hideOnMenu?: boolean;
56
+ isNew?: boolean;
57
+ isUpdated?: boolean;
58
+ _?: {
59
+ [Key: string]: RouteItem;
60
+ };
61
+ // placeholder?: SubroutesPlaceholder;
62
+ };
63
+
64
+ // type RouteSlot = (entity: string) =>
65
+
66
+ type RouteItems = {
67
+ [id: string]: RouteItem | TMenuSlot<TMenuSlotName>;
68
+ };
69
+ }
70
+ }
71
+ }
72
+ }
73
+ }
@@ -0,0 +1,4 @@
1
+ 'generated by levelup';
2
+
3
+ export * from "./response.d.ts";
4
+ export * from "./request.d.ts";
@@ -0,0 +1,215 @@
1
+ declare module Levelup {
2
+ namespace CMS {
3
+ namespace V1 {
4
+ export namespace Utils {
5
+
6
+ export namespace Api {
7
+ export namespace Request {
8
+ type Request<T> = T & {
9
+ cancelToken?: any;
10
+ };
11
+ type PagedRequestFields = {
12
+ count?: number;
13
+ page?: number;
14
+ };
15
+ type Paged = {
16
+ count?: number;
17
+ page?: number;
18
+ };
19
+ type SortableRequestFields<T extends object> = {
20
+ sort_by: Levelup.V2.Utils.DocumentProperties<T>;
21
+ sort: "desc" | "asc";
22
+ };
23
+ type Sortable<T extends object> = {
24
+ sort_by?: Levelup.V2.Utils.DocumentProperties<T>;
25
+ sort?: "desc" | "asc";
26
+ };
27
+ type Searchable = {
28
+ search?: string;
29
+ };
30
+
31
+ type FilterableDeliverable<T extends string> = {
32
+ [K in T]?: any;
33
+ } & {
34
+ city?: string | string[];
35
+ state?: string | string[];
36
+ country?: string | string[];
37
+ starting_city?: string | string[];
38
+ starting_state?: string | string[];
39
+ starting_country?: string | string[];
40
+ current_city?: string | string[];
41
+ current_state?: string | string[];
42
+ current_country?: string | string[];
43
+ intermediate_city?: string | string[];
44
+ intermediate_state?: string | string[];
45
+ intermediate_country?: string | string[];
46
+ destination_city?: string | string[];
47
+ destination_state?: string | string[];
48
+ destination_country?: string | string[];
49
+ office?: string | string[];
50
+ starting_office?: string | string[];
51
+ current_office?: string | string[];
52
+ intermediate_office?: string | string[];
53
+ destination_office?: string | string[];
54
+ office_tracking?: string | string[];
55
+ starting_office_tracking?: string | string[];
56
+ current_office_tracking?: string | string[];
57
+ intermediate_office_tracking?: string | string[];
58
+ destination_office_tracking?: string | string[];
59
+ not?: { [K in T]?: any } & {
60
+ city?: string | string[];
61
+ state?: string | string[];
62
+ country?: string | string[];
63
+ starting_city?: string | string[];
64
+ starting_state?: string | string[];
65
+ starting_country?: string | string[];
66
+ current_city?: string | string[];
67
+ current_state?: string | string[];
68
+ current_country?: string | string[];
69
+ intermediate_city?: string | string[];
70
+ intermediate_state?: string | string[];
71
+ intermediate_country?: string | string[];
72
+ destination_city?: string | string[];
73
+ destination_state?: string | string[];
74
+ destination_country?: string | string[];
75
+ office?: string | string[];
76
+ starting_office?: string | string[];
77
+ current_office?: string | string[];
78
+ intermediate_office?: string | string[];
79
+ destination_office?: string | string[];
80
+ office_tracking?: string | string[];
81
+ starting_office_tracking?: string | string[];
82
+ current_office_tracking?: string | string[];
83
+ intermediate_office_tracking?: string | string[];
84
+ destination_office_tracking?: string | string[];
85
+ };
86
+ };
87
+ type Filterable<T extends string> = {
88
+ [K in T]?: unknown;
89
+ } & {
90
+ load_deleted?: boolean;
91
+ not?: { [K in T]?: unknown };
92
+ } & {
93
+ filters?: { [K in T]?: unknown } & {
94
+ not?: {
95
+ [K in T]?: unknown;
96
+ };
97
+ };
98
+ };
99
+
100
+ type Projectable<T extends object> = {
101
+ fields?: (
102
+ | Utils.DocumentProperties<T>
103
+ | Utils.ExcludeDocumentProperties<T>
104
+ )[];
105
+ };
106
+
107
+ type Build<T> = Request<T>;
108
+ type BuildSearchable = Request<Searchable>;
109
+ type BuildPaged = Request<Paged>;
110
+ type BuildSortable<T extends object> = Request<Sortable<T>>;
111
+ type BuildProjectable<T extends object> = Request<Projectable<T>>;
112
+ type BuildSearchablePaged = Request<Searchable & Paged>;
113
+ type BuildSearchablePagedProjectable<T extends object> = Request<
114
+ Searchable & Paged & Projectable<T>
115
+ >;
116
+ type BuildSearchablePagedSortable<T extends object> = Request<
117
+ Searchable & Paged & Sortable<T>
118
+ >;
119
+ type BuildSearchablePagedSortableProjectable<T extends object> =
120
+ Request<Searchable & Paged & Sortable<T> & Projectable<T>>;
121
+ type BuildSearchablePagedFilterable<T> = Request<
122
+ Searchable &
123
+ Paged &
124
+ Filterable<Levelup.V2.Utils.DocumentProperties<T>>
125
+ >;
126
+ type BuildSearchablePagedFilterableProjectable<T extends object> =
127
+ Request<
128
+ Searchable &
129
+ Paged &
130
+ Filterable<Levelup.V2.Utils.DocumentProperties<T>> &
131
+ Projectable<T>
132
+ >;
133
+ type BuildSearchablePagedSortableFilterable<T extends object> =
134
+ Request<
135
+ Searchable &
136
+ Paged &
137
+ Filterable<Levelup.V2.Utils.DocumentProperties<T>> &
138
+ Sortable<T>
139
+ >;
140
+ type BuildSearchablePagedSortableFilterableProjectable<
141
+ T extends object,
142
+ > = Request<
143
+ Searchable &
144
+ Paged &
145
+ Filterable<Levelup.V2.Utils.DocumentProperties<T>> &
146
+ Filterable<Levelup.V2.Utils.DocumentProperties<T>> &
147
+ Sortable<T> &
148
+ Projectable<T>
149
+ >;
150
+ type BuildSortableFilterable<T extends object> = Request<
151
+ Filterable<Levelup.V2.Utils.DocumentProperties<T>> & Sortable<T>
152
+ >;
153
+ type BuildSortableFilterableProjectable<T extends object> = Request<
154
+ Filterable<Levelup.V2.Utils.DocumentProperties<T>> &
155
+ Sortable<T> &
156
+ Projectable<T>
157
+ >;
158
+ type BuildSearchablePagedFilterableDeliverable<T extends object> =
159
+ Request<
160
+ Searchable &
161
+ Paged &
162
+ FilterableDeliverable<Levelup.V2.Utils.DocumentProperties<T>>
163
+ >;
164
+ type BuildSearchablePagedFilterableDeliverableProjectable<
165
+ T extends object,
166
+ > = Request<
167
+ Searchable &
168
+ Paged &
169
+ FilterableDeliverable<Levelup.V2.Utils.DocumentProperties<T>> &
170
+ Projectable<T>
171
+ >;
172
+ type BuildSearchablePagedSortableFilterableDeliverable<
173
+ T extends object,
174
+ > = Request<
175
+ Searchable &
176
+ Paged &
177
+ FilterableDeliverable<Levelup.V2.Utils.DocumentProperties<T>> &
178
+ Sortable<T>
179
+ >;
180
+ type BuildSearchablePagedSortableFilterableDeliverableProjectable<
181
+ T extends object,
182
+ > = Request<
183
+ Searchable &
184
+ Paged &
185
+ FilterableDeliverable<Levelup.V2.Utils.DocumentProperties<T>> &
186
+ Sortable<T> &
187
+ Projectable<T>
188
+ >;
189
+
190
+ // create
191
+
192
+ type TOmittedFieldsFromCreateRequestData =
193
+ | "_id"
194
+ | "createdAt"
195
+ | "updatedAt"
196
+ | "user"
197
+ | "tracking_id";
198
+ type BuildCreateRequest<T extends object> = Build<{
199
+ data: Partial<Omit<T, TOmittedFieldsFromCreateRequestData>>;
200
+ }>;
201
+
202
+ type TOmittedFieldsFromUpdateRequestData =
203
+ | "createdAt"
204
+ | "updatedAt"
205
+ | "user"
206
+ | "tracking_id";
207
+ type BuildUpdateRequest<T extends object> = Build<{
208
+ data: Partial<Omit<T, TOmittedFieldsFromUpdateRequestData>>;
209
+ }>;
210
+ }
211
+ }
212
+ }
213
+ }
214
+ }
215
+ }
@@ -0,0 +1,188 @@
1
+ /**
2
+ * @description project levelup
3
+ */
4
+ declare module Levelup {
5
+ namespace CMS {
6
+ namespace V1 {
7
+ namespace Utils {
8
+
9
+ export namespace Api {
10
+ export namespace Response {
11
+ type ErrorObject = {
12
+ is_axios?: boolean;
13
+ is_joi?: boolean;
14
+ is_mongoose?: boolean;
15
+ is_celebrate?: boolean;
16
+ name: string;
17
+ message: string;
18
+ status: number | string;
19
+ code: number | string;
20
+ headers?: any;
21
+ params?: any;
22
+ body?: any;
23
+ data?: any;
24
+ baseURL?: string;
25
+ url?: string;
26
+ method?: string;
27
+ errors?: any;
28
+ fields?: any;
29
+ stack: string | string[];
30
+ };
31
+
32
+ type ErrorFields<F extends string | number | symbol = string> = {
33
+ [key in F]?: {
34
+ value: any;
35
+ message: string;
36
+ label?: string;
37
+ meta?: any;
38
+ };
39
+ };
40
+ type ErrorFieldsInObjectProperties<
41
+ Obj extends object,
42
+ F extends Levelup.V2.Utils.DocumentRootProperties<Obj>,
43
+ > = {
44
+ [key in F]?: {
45
+ value: any;
46
+ message: string;
47
+ label?: string;
48
+ meta?: any;
49
+ };
50
+ };
51
+
52
+ type Error = {
53
+ message: string;
54
+ name: string;
55
+ status: number;
56
+ fields?: ErrorFields;
57
+ stack?: string[];
58
+ isAxios?: boolean;
59
+ };
60
+
61
+ type DefaultResponse = {
62
+ error?: Error;
63
+ request?: any;
64
+ token?: string;
65
+ };
66
+ type PagedResponse = {
67
+ pagination?: {
68
+ total: number;
69
+ pages: number;
70
+ };
71
+ links?: {
72
+ self?: string;
73
+ before?: string;
74
+ next?: string;
75
+ };
76
+ };
77
+
78
+ type TEdge<K extends keyof TResponseEdge> = {
79
+ [P in K]-?: NonNullable<TResponseEdge[P]>;
80
+ };
81
+
82
+ type BuildSingleItemResponse<
83
+ T,
84
+ Edges extends keyof TResponseEdge = undefined,
85
+ > = {
86
+ data?: T;
87
+ edge?: {
88
+ [P in Edges]-?: NonNullable<TResponseEdge[P]>;
89
+ };
90
+ } & DefaultResponse;
91
+
92
+ /**
93
+ * @param T
94
+ * @param Edges
95
+ */
96
+ type BuildListResponse<
97
+ T,
98
+ Edges extends keyof TResponseEdge = undefined,
99
+ > = {
100
+ data?: T[];
101
+ edge?: {
102
+ [P in Edges]-?: TResponseEdge[P];
103
+ };
104
+ } & PagedResponse &
105
+ DefaultResponse;
106
+
107
+ type DefaultDeleteResponse = {
108
+ data?: {
109
+ deleted?: boolean;
110
+ restored?: boolean;
111
+ };
112
+ } & DefaultResponse;
113
+
114
+ type DefaultBulkDeleteResponse = {
115
+ data?: {
116
+ [_id: string]: boolean;
117
+ };
118
+ } & DefaultResponse;
119
+
120
+ type TResponseEdge = {
121
+ companies: {
122
+ [ID: string]: Utils.Entity.Snapshots.Accounts.Company | null;
123
+ };
124
+ company:
125
+ | Utils.Entity.Snapshots.Accounts.Company
126
+ | Accounts.Entity.Company
127
+ | null;
128
+ stores: {
129
+ [ID: string]: Utils.Entity.Snapshots.Accounts.Store | null;
130
+ };
131
+ store:
132
+ | Utils.Entity.Snapshots.Accounts.Store
133
+ | Accounts.Entity.Store
134
+ | null;
135
+ users: {
136
+ [ID: string]: Utils.Entity.Snapshots.Auth.User | null;
137
+ };
138
+ user: Utils.Entity.Snapshots.Auth.User | Users.Entity.User | null;
139
+ offices: {
140
+ [ID: string]: Utils.Entity.Snapshots.Logistics.Office | null;
141
+ };
142
+ office:
143
+ | Utils.Entity.Snapshots.Logistics.Office
144
+ | Logistics.Entity.Office
145
+ | null;
146
+ regional_managements: {
147
+ [
148
+ ID: string
149
+ ]: Utils.Entity.Snapshots.Logistics.RegionalManagement | null;
150
+ };
151
+ warehouses: {
152
+ [ID: string]: Utils.Entity.Snapshots.Logistics.Warehouse | null;
153
+ };
154
+ product_categories: {
155
+ [
156
+ ID: string
157
+ ]: Utils.Entity.Snapshots.Products.ProductCategory | null;
158
+ };
159
+ products: {
160
+ [ID: string]: Products.Entity.Product | null;
161
+ };
162
+ product_snapshots: {
163
+ [
164
+ TrackingID: string
165
+ ]: Utils.Entity.Snapshots.Products.ProductCategory | null;
166
+ };
167
+ parcels: {
168
+ [ID: string]: Shipping.Entity.Parcel | null;
169
+ };
170
+
171
+ deposits: Payment.Entity.Deposit[];
172
+ payments: Payment.Entity.Payment[];
173
+ };
174
+
175
+ type BuildResponseEdge<K extends keyof TResponseEdge> = Pick<
176
+ TResponseEdge,
177
+ K
178
+ >;
179
+
180
+ type EdgedResponse<TRes, K extends keyof TResponseEdge> = TRes & {
181
+ edge?: Pick<TResponseEdge, K>;
182
+ };
183
+ }
184
+ }
185
+ }
186
+ }
187
+ }
188
+ }
@@ -0,0 +1,53 @@
1
+ declare module Levelup {
2
+ namespace CMS {
3
+ namespace V1 {
4
+ namespace Utils {
5
+ namespace Common {
6
+ type ID = string;
7
+ type TrackingID = string;
8
+ type Code = string;
9
+ type LetterCode = string;
10
+ type NumberCode = string;
11
+ type LocationAdministrativeCode = string;
12
+ type Slug = string;
13
+ type Name = string;
14
+ type Time = `${string}:${string}`;
15
+ /**
16
+ * @description Location [longitude, latitude]
17
+ */
18
+ type Location = [number, number];
19
+ type FileAttribute = {
20
+ id: string | null;
21
+ url: string | null;
22
+ } | null;
23
+
24
+ type TLabelValue<T = string> = {
25
+ value: T;
26
+ label: string;
27
+ }
28
+
29
+ type SocialNetworks =
30
+ | "facebook"
31
+ | "youtube"
32
+ | "linkedin"
33
+ | "instagram"
34
+ | "viber"
35
+ | "whatsapp"
36
+ | "twitter"
37
+ | "reddit"
38
+ | "tiktok"
39
+ | "snapchat";
40
+
41
+ export type TDay =
42
+ | "sunday"
43
+ | "monday"
44
+ | "tuesday"
45
+ | "wednesday"
46
+ | "thursday"
47
+ | "friday"
48
+ | "saturday";
49
+ }
50
+ }
51
+ }
52
+ }
53
+ }
@@ -0,0 +1,3 @@
1
+ 'generated by levelup';
2
+
3
+ export * from "./common.d.ts";