@paris-ias/trees 1.8.56

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 (202) hide show
  1. package/LICENSE +679 -0
  2. package/dist/form/action.js +83 -0
  3. package/dist/form/affiliation.js +178 -0
  4. package/dist/form/apps.js +132 -0
  5. package/dist/form/disciplines.js +30 -0
  6. package/dist/form/events.js +836 -0
  7. package/dist/form/fellowships.js +1307 -0
  8. package/dist/form/files.js +30 -0
  9. package/dist/form/mailing.js +43 -0
  10. package/dist/form/news.js +252 -0
  11. package/dist/form/people.js +658 -0
  12. package/dist/form/projects.js +338 -0
  13. package/dist/form/publications.js +364 -0
  14. package/dist/form/tags.js +38 -0
  15. package/dist/form/users.js +576 -0
  16. package/dist/graphql/client/action/query.get.action.gql +22 -0
  17. package/dist/graphql/client/action/query.list.action.gql +32 -0
  18. package/dist/graphql/client/affiliation/query.get.affiliations.gql +37 -0
  19. package/dist/graphql/client/affiliation/query.list.affiliations.gql +43 -0
  20. package/dist/graphql/client/apps/query.get.apps.gql +33 -0
  21. package/dist/graphql/client/apps/query.list.apps.gql +43 -0
  22. package/dist/graphql/client/events/query.get.events.gql +119 -0
  23. package/dist/graphql/client/events/query.list.events.gql +40 -0
  24. package/dist/graphql/client/fellowships/query.get.fellowships.gql +163 -0
  25. package/dist/graphql/client/fellowships/query.list.fellowships.gql +49 -0
  26. package/dist/graphql/client/files/query.get.files.gql +24 -0
  27. package/dist/graphql/client/files/query.list.files.gql +37 -0
  28. package/dist/graphql/client/mailing/query.get.mailing.gql +24 -0
  29. package/dist/graphql/client/mailing/query.list.mailing.gql +23 -0
  30. package/dist/graphql/client/misc/apex.mutations.delete.gql +0 -0
  31. package/dist/graphql/client/misc/apex.mutations.upsert.gql +0 -0
  32. package/dist/graphql/client/misc/apex.queries.login.gql +0 -0
  33. package/dist/graphql/client/misc/query.get.disciplines.gql +17 -0
  34. package/dist/graphql/client/misc/query.get.tags.gql +13 -0
  35. package/dist/graphql/client/misc/query.list.disciplines.gql +23 -0
  36. package/dist/graphql/client/misc/query.list.tags.gql +23 -0
  37. package/dist/graphql/client/news/query.get.news.gql +128 -0
  38. package/dist/graphql/client/news/query.list.news.gql +35 -0
  39. package/dist/graphql/client/people/query.get.people.gql +173 -0
  40. package/dist/graphql/client/people/query.get.users.gql +0 -0
  41. package/dist/graphql/client/people/query.list.people.gql +55 -0
  42. package/dist/graphql/client/people/query.list.users.gql +31 -0
  43. package/dist/graphql/client/projects/query.get.projects.gql +166 -0
  44. package/dist/graphql/client/projects/query.list.projects.gql +33 -0
  45. package/dist/graphql/client/publications/query.get.publications.gql +169 -0
  46. package/dist/graphql/client/publications/query.list.publications.gql +35 -0
  47. package/dist/graphql/schemas/apex-resolvers-list.json +45 -0
  48. package/dist/graphql/schemas/schema.apex.graphql +946 -0
  49. package/dist/graphql/schemas/schema.website.graphql +794 -0
  50. package/dist/graphql/schemas/website-resolvers-list.json +22 -0
  51. package/dist/list/action.js +133 -0
  52. package/dist/list/affiliation.js +133 -0
  53. package/dist/list/apps.js +133 -0
  54. package/dist/list/disciplines.js +132 -0
  55. package/dist/list/events.js +186 -0
  56. package/dist/list/fellowships.js +149 -0
  57. package/dist/list/files.js +132 -0
  58. package/dist/list/mailing.js +132 -0
  59. package/dist/list/news.js +135 -0
  60. package/dist/list/people.js +176 -0
  61. package/dist/list/projects.js +135 -0
  62. package/dist/list/publications.js +152 -0
  63. package/dist/list/tags.js +133 -0
  64. package/dist/list/users.js +176 -0
  65. package/index.ts +63 -0
  66. package/lib/README.md +206 -0
  67. package/lib/buildClientGraphQL.ts +342 -0
  68. package/lib/buildDefaults.ts +0 -0
  69. package/lib/buildSchemas.ts +109 -0
  70. package/lib/generate.ts +505 -0
  71. package/lib/generateAll.ts +231 -0
  72. package/lib/utils.ts +24 -0
  73. package/package.json +34 -0
  74. package/readme.md +116 -0
  75. package/src/LICENSE +661 -0
  76. package/src/action/graphql/client/query.get.action.gql +22 -0
  77. package/src/action/graphql/client/query.list.action.gql +32 -0
  78. package/src/action/graphql/server/apex.types.action.graphql +15 -0
  79. package/src/action/models/action.ts +147 -0
  80. package/src/affiliation/graphql/client/query.get.affiliations.gql +37 -0
  81. package/src/affiliation/graphql/client/query.list.affiliations.gql +43 -0
  82. package/src/affiliation/graphql/server/shared.types.affiliations.graphql +20 -0
  83. package/src/affiliation/models/affiliation.ts +130 -0
  84. package/src/affiliation/models/member.ts +11 -0
  85. package/src/affiliation/models/partner.ts +9 -0
  86. package/src/apps/graphql/client/query.get.apps.gql +33 -0
  87. package/src/apps/graphql/client/query.list.apps.gql +43 -0
  88. package/src/apps/models/apps.ts +195 -0
  89. package/src/events/graphql/client/query.get.events.gql +119 -0
  90. package/src/events/graphql/client/query.list.events.gql +40 -0
  91. package/src/events/graphql/server/shared.inputs.events.graphql +24 -0
  92. package/src/events/models/eventSlot.ts +73 -0
  93. package/src/events/models/events.ts +569 -0
  94. package/src/fellowships/graphql/client/query.get.fellowships.gql +163 -0
  95. package/src/fellowships/graphql/client/query.list.fellowships.gql +49 -0
  96. package/src/fellowships/graphql/server/apex.inputs.fellowshipDetails.graphql +13 -0
  97. package/src/fellowships/graphql/server/shared.types.fellowshipDetails.graphql +13 -0
  98. package/src/fellowships/graphql/server/shared.types.fellowships.graphql +38 -0
  99. package/src/fellowships/models/fellowshipDetails.ts +145 -0
  100. package/src/fellowships/models/fellowships.ts +341 -0
  101. package/src/files/graphql/client/query.get.files.gql +24 -0
  102. package/src/files/graphql/client/query.list.files.gql +37 -0
  103. package/src/files/graphql/server/apex.inputs.files.graphql +7 -0
  104. package/src/files/graphql/server/apex.inputs.video.graphql +9 -0
  105. package/src/files/graphql/server/apex.types.files.graphql +4 -0
  106. package/src/files/graphql/server/shared.inputs.image.graphql +9 -0
  107. package/src/files/graphql/server/shared.types.files.graphql +15 -0
  108. package/src/files/graphql/server/shared.types.image.graphql +9 -0
  109. package/src/files/graphql/server/shared.types.video.graphql +9 -0
  110. package/src/files/models/files.ts +113 -0
  111. package/src/files/models/gallery.ts +11 -0
  112. package/src/files/models/image.ts +159 -0
  113. package/src/files/models/video.ts +166 -0
  114. package/src/form.ts +52 -0
  115. package/src/index.ts +98 -0
  116. package/src/list.ts +34 -0
  117. package/src/mailing/graphql/client/query.get.mailing.gql +24 -0
  118. package/src/mailing/graphql/client/query.list.mailing.gql +23 -0
  119. package/src/mailing/graphql/server/apex.types.mailing.graphql +13 -0
  120. package/src/mailing/models/mailing.ts +123 -0
  121. package/src/misc/graphql/client/apex.mutations.delete.gql +0 -0
  122. package/src/misc/graphql/client/apex.mutations.upsert.gql +0 -0
  123. package/src/misc/graphql/client/apex.queries.login.gql +0 -0
  124. package/src/misc/graphql/client/query.get.disciplines.gql +17 -0
  125. package/src/misc/graphql/client/query.get.tags.gql +13 -0
  126. package/src/misc/graphql/client/query.list.disciplines.gql +23 -0
  127. package/src/misc/graphql/client/query.list.tags.gql +23 -0
  128. package/src/misc/graphql/server/apex.inputs.misc.graphql +13 -0
  129. package/src/misc/graphql/server/apex.inputs.socials.graphql +12 -0
  130. package/src/misc/graphql/server/apex.mutations.graphql +23 -0
  131. package/src/misc/graphql/server/apex.queries.graphql +36 -0
  132. package/src/misc/graphql/server/apex.types.disciplines.graphql +4 -0
  133. package/src/misc/graphql/server/apex.types.tags.graphql +4 -0
  134. package/src/misc/graphql/server/shared.enums.graphql +112 -0
  135. package/src/misc/graphql/server/shared.inputs.misc.graphql +101 -0
  136. package/src/misc/graphql/server/shared.queries.graphql +35 -0
  137. package/src/misc/graphql/server/shared.types.disciplines.graphql +8 -0
  138. package/src/misc/graphql/server/shared.types.events.graphql +39 -0
  139. package/src/misc/graphql/server/shared.types.location.graphql +17 -0
  140. package/src/misc/graphql/server/shared.types.misc.graphql +120 -0
  141. package/src/misc/graphql/server/shared.types.related.graphql +10 -0
  142. package/src/misc/graphql/server/shared.types.relatedAffiliation.graphql +7 -0
  143. package/src/misc/graphql/server/shared.types.relatedEvent.graphql +7 -0
  144. package/src/misc/graphql/server/shared.types.relatedFellowships.graphql +7 -0
  145. package/src/misc/graphql/server/shared.types.relatedNews.graphql +7 -0
  146. package/src/misc/graphql/server/shared.types.relatedPeople.graphql +6 -0
  147. package/src/misc/graphql/server/shared.types.relatedProject.graphql +7 -0
  148. package/src/misc/graphql/server/shared.types.relatedPublications.graphql +6 -0
  149. package/src/misc/graphql/server/shared.types.socials.graphql +22 -0
  150. package/src/misc/graphql/server/shared.types.tags.graphql +11 -0
  151. package/src/misc/graphql/server/website.mutations.graphql +4 -0
  152. package/src/misc/models/disciplines.ts +116 -0
  153. package/src/misc/models/location.ts +136 -0
  154. package/src/misc/models/organizers.ts +13 -0
  155. package/src/misc/models/related.ts +123 -0
  156. package/src/misc/models/relatedEvents.ts +16 -0
  157. package/src/misc/models/relatedFellowships.ts +7 -0
  158. package/src/misc/models/relatedNews.ts +13 -0
  159. package/src/misc/models/relatedPeople.ts +8 -0
  160. package/src/misc/models/relatedProject.ts +14 -0
  161. package/src/misc/models/relatedPublications.ts +14 -0
  162. package/src/misc/models/socials.ts +133 -0
  163. package/src/misc/models/sponsor.ts +13 -0
  164. package/src/misc/models/tags.ts +116 -0
  165. package/src/misc/models/taxonomy.ts +1 -0
  166. package/src/model.ts +7 -0
  167. package/src/news/graphql/client/query.get.news.gql +128 -0
  168. package/src/news/graphql/client/query.list.news.gql +35 -0
  169. package/src/news/graphql/server/share.types.news.graphql +27 -0
  170. package/src/news/models/news.ts +257 -0
  171. package/src/people/graphql/client/query.get.people.gql +173 -0
  172. package/src/people/graphql/client/query.get.users.gql +0 -0
  173. package/src/people/graphql/client/query.list.people.gql +55 -0
  174. package/src/people/graphql/client/query.list.users.gql +31 -0
  175. package/src/people/graphql/server/apex.inputs.consent.graphql +9 -0
  176. package/src/people/graphql/server/apex.inputs.groups.graphql +8 -0
  177. package/src/people/graphql/server/apex.inputs.vintage.graphql +6 -0
  178. package/src/people/graphql/server/shared.types.consent.graphql +9 -0
  179. package/src/people/graphql/server/shared.types.groups.graphql +8 -0
  180. package/src/people/graphql/server/shared.types.people.graphql +29 -0
  181. package/src/people/graphql/server/shared.types.position.graphql +6 -0
  182. package/src/people/graphql/server/shared.types.users.graphql +17 -0
  183. package/src/people/graphql/server/shared.types.vintage.graphql +6 -0
  184. package/src/people/models/consent.ts +82 -0
  185. package/src/people/models/discussants.ts +9 -0
  186. package/src/people/models/experiences.ts +38 -0
  187. package/src/people/models/fellows.ts +12 -0
  188. package/src/people/models/groups.ts +58 -0
  189. package/src/people/models/people.ts +244 -0
  190. package/src/people/models/position.ts +62 -0
  191. package/src/people/models/speakers.ts +9 -0
  192. package/src/people/models/users.ts +252 -0
  193. package/src/people/models/vintage.ts +124 -0
  194. package/src/projects/graphql/client/query.get.projects.gql +166 -0
  195. package/src/projects/graphql/client/query.list.projects.gql +33 -0
  196. package/src/projects/graphql/server/shared.types.projects.graphql +29 -0
  197. package/src/projects/models/projects.ts +249 -0
  198. package/src/publications/graphql/client/query.get.publications.gql +169 -0
  199. package/src/publications/graphql/client/query.list.publications.gql +35 -0
  200. package/src/publications/graphql/server/shared.types.publications.graphql +34 -0
  201. package/src/publications/models/article.ts +262 -0
  202. package/src/publications/models/publications.ts +306 -0
@@ -0,0 +1,9 @@
1
+ type Image {
2
+ url: AWSURL
3
+ alt: String
4
+ caption: String
5
+ copyright: String
6
+ license: String
7
+ licenseUrl: String
8
+ backgroundColor: String
9
+ }
@@ -0,0 +1,9 @@
1
+ type Video {
2
+ url: AWSURL
3
+ alt: String
4
+ caption: String
5
+ copyright: String
6
+ license: String
7
+ licenseUrl: String
8
+ backgroundColor: String
9
+ }
@@ -0,0 +1,113 @@
1
+ import Model from "../../model"
2
+ import { Image } from "./image"
3
+ import { formType } from "../../form"
4
+
5
+ export interface Files {
6
+ name: string
7
+ url: URL
8
+ size: number
9
+ fileType: string
10
+ hash: string
11
+ path: string
12
+ file: string
13
+ image?: Image
14
+ thumb: URL
15
+ createdAt: Date
16
+ updatedAt: Date
17
+ id: string
18
+ }
19
+
20
+ const defautConfig: Model = {
21
+ list: {
22
+ create: true, // allow to create new items
23
+
24
+ filters: {
25
+ year: {
26
+ type: "Select",
27
+ },
28
+ },
29
+ sort: {
30
+ // sort options
31
+ nameasc: {
32
+ // by name from a to z
33
+ icon: "sort-alphabetical-ascending",
34
+ text: "by-name-from-a-to-z",
35
+ value: ["article_title", 1],
36
+ },
37
+ namedesc: {
38
+ // by name from z to a
39
+ icon: "sort-alphabetical-descending",
40
+ text: "by-name-from-z-to-a",
41
+ value: ["article_title", -1],
42
+ },
43
+ dateasc: {
44
+ // by date from most recent to oldest
45
+ icon: "sort-calendar-descending",
46
+ text: "by-date-most-recent-first",
47
+ value: ["date", -1],
48
+ default: true,
49
+ },
50
+ datedesc: {
51
+ // by date from oldest to most recent
52
+ icon: "sort-calendar-ascending",
53
+ text: "by-date-oldest-first",
54
+ value: ["date", 1],
55
+ },
56
+ },
57
+ views: {
58
+ rows: {
59
+ name: "rows",
60
+ icon: "view-list",
61
+ perPage: {
62
+ options: [9, 12, 16],
63
+ default: 9,
64
+ },
65
+ },
66
+ dense: {
67
+ default: true,
68
+ name: "dense",
69
+ icon: "land-rows-horizontal",
70
+ perPage: {
71
+ options: [20, 40, 60, 80, 100],
72
+ default: 20,
73
+ },
74
+ },
75
+ tiles: {
76
+ name: "tiles",
77
+ icon: "view-quilt",
78
+ },
79
+ grid: {
80
+ name: "grid",
81
+ icon: "view-day",
82
+ },
83
+ },
84
+ },
85
+ form: {
86
+ name: {
87
+ label: "name",
88
+ component: "TextField",
89
+ type: formType.Primitive,
90
+
91
+ rules: {
92
+ required: true,
93
+ min: 5,
94
+ max: 200,
95
+ },
96
+ meta: "name",
97
+ },
98
+ file: {
99
+ label: "file",
100
+ component: "TextField",
101
+ type: formType.Primitive,
102
+
103
+ rules: {
104
+ required: true,
105
+ min: 5,
106
+ max: 200,
107
+ },
108
+ meta: "file",
109
+ },
110
+ },
111
+ }
112
+
113
+ export default defautConfig
@@ -0,0 +1,11 @@
1
+ import Model from "../../model"
2
+ import configImage, { Image } from "./image"
3
+
4
+ export interface Gallery extends Image {}
5
+
6
+ const defaultConfig: Model = {
7
+ aliases: ["image"],
8
+ ...configImage,
9
+ }
10
+
11
+ export default defaultConfig
@@ -0,0 +1,159 @@
1
+ import Model from "../../model"
2
+ import { formType } from "../../form"
3
+
4
+ export interface Image {
5
+ url: URL
6
+ alt?: string
7
+ caption?: string
8
+ copyright?: string
9
+ license?: string
10
+ licenseUrl?: string
11
+ backgroundColor?: string
12
+ }
13
+ const defaultConfig: Model = {
14
+ // markdown related keys
15
+
16
+ //Features related keys
17
+ list: {
18
+ create: true, // allow to create new items
19
+
20
+ filters: {
21
+ year: {
22
+ type: "Select",
23
+ },
24
+ },
25
+ sort: {
26
+ // sort options
27
+ nameasc: {
28
+ // by name from a to z
29
+ icon: "sort-alphabetical-ascending",
30
+ text: "by-name-from-a-to-z",
31
+ value: ["article_title", 1],
32
+ },
33
+ namedesc: {
34
+ // by name from z to a
35
+ icon: "sort-alphabetical-descending",
36
+ text: "by-name-from-z-to-a",
37
+ value: ["article_title", -1],
38
+ },
39
+ dateasc: {
40
+ // by date from most recent to oldest
41
+ icon: "sort-calendar-descending",
42
+ text: "by-date-most-recent-first",
43
+ value: ["date", -1],
44
+ default: true,
45
+ },
46
+ datedesc: {
47
+ // by date from oldest to most recent
48
+ icon: "sort-calendar-ascending",
49
+ text: "by-date-oldest-first",
50
+ value: ["date", 1],
51
+ },
52
+ },
53
+ views: {
54
+ rows: {
55
+ name: "rows",
56
+ icon: "view-list",
57
+ perPage: {
58
+ options: [9, 12, 16],
59
+ default: 9,
60
+ },
61
+ },
62
+ dense: {
63
+ default: true,
64
+ name: "dense",
65
+ icon: "land-rows-horizontal",
66
+ perPage: {
67
+ options: [20, 40, 60, 80, 100],
68
+ default: 20,
69
+ },
70
+ },
71
+ tiles: {
72
+ name: "tiles",
73
+ icon: "view-quilt",
74
+ },
75
+ grid: {
76
+ name: "grid",
77
+ icon: "view-day",
78
+ },
79
+ },
80
+ },
81
+ form: {
82
+ caption: {
83
+ label: "caption",
84
+ component: "TextArea",
85
+ type: formType.Primitive,
86
+ i18n: true,
87
+ rules: {
88
+ required: true,
89
+ },
90
+ meta: "caption", // item type on schema.org
91
+ },
92
+ alt: {
93
+ label: "alt",
94
+ type: formType.Primitive,
95
+ component: "TextArea",
96
+ description: "Displayed if the image cannot be loaded",
97
+ rules: {
98
+ required: true,
99
+ min: 2,
100
+ max: 100,
101
+ },
102
+ meta: "alt", // item type on schema.org
103
+ },
104
+ copyright: {
105
+ label: "copyright",
106
+ type: formType.Primitive,
107
+ component: "TextField",
108
+ default: "Free of rights",
109
+ description: "Owner of the image copyright",
110
+ rules: {
111
+ required: true,
112
+ min: 2,
113
+ max: 100,
114
+ },
115
+ meta: "copyright", // item type on schema.org
116
+ },
117
+ licence: {
118
+ label: "licence",
119
+ type: formType.Primitive,
120
+ component: "AutoComplete", // TODO change for an autocomplete
121
+ default: null,
122
+ description: "The licence of the image",
123
+ rules: {
124
+ required: true,
125
+ min: 2,
126
+ max: 100,
127
+ }, // meta: 'name', // item type on schema.org
128
+ },
129
+ licenseUrl: {
130
+ label: "licenseUrl",
131
+ type: formType.Primitive,
132
+ component: "TextField", // TODO change for an autocomplete
133
+ default: null,
134
+ description: "The caption of the image",
135
+ rules: {
136
+ required: true,
137
+ url: true,
138
+ },
139
+ show: {
140
+ default: false, // "default: true" is the same than "hidden = false"
141
+ switchIf: [], // array of conditions to switch the show, each condition will be assessed as a boolean
142
+ disjonctive: false, //TODO: implement. if true, show only if one of the if is true, if false, show only if all of the if are true
143
+ },
144
+ meta: "licenseUrl", // item type on schema.org
145
+ },
146
+ backgroundColor: {
147
+ label: "backgroundColor",
148
+ component: "ColorPicker", // TODO create component
149
+ type: formType.Primitive,
150
+ rules: {
151
+ required: true,
152
+ color: true,
153
+ },
154
+ meta: "backgroundColor",
155
+ },
156
+ },
157
+ }
158
+
159
+ export default defaultConfig
@@ -0,0 +1,166 @@
1
+ import Model from "../../model"
2
+ import { formType } from "../../form"
3
+
4
+ export interface Video {
5
+ url: URL
6
+ alt?: string
7
+ caption?: string
8
+ copyright?: string
9
+ license?: string
10
+ licenseUrl?: string
11
+ backgroundColor?: string
12
+ }
13
+ const defaultConfig: Model = {
14
+ list: {
15
+ create: true, // allow to create new items
16
+ filters: {
17
+ year: {
18
+ type: "Select",
19
+ },
20
+ },
21
+ sort: {
22
+ // sort options
23
+ nameasc: {
24
+ // by name from a to z
25
+ icon: "sort-alphabetical-ascending",
26
+ text: "by-name-from-a-to-z",
27
+ value: ["article_title", 1],
28
+ },
29
+ namedesc: {
30
+ // by name from z to a
31
+ icon: "sort-alphabetical-descending",
32
+ text: "by-name-from-z-to-a",
33
+ value: ["article_title", -1],
34
+ },
35
+ dateasc: {
36
+ // by date from most recent to oldest
37
+ icon: "sort-calendar-descending",
38
+ text: "by-date-most-recent-first",
39
+ value: ["date", -1],
40
+ default: true,
41
+ },
42
+ datedesc: {
43
+ // by date from oldest to most recent
44
+ icon: "sort-calendar-ascending",
45
+ text: "by-date-oldest-first",
46
+ value: ["date", 1],
47
+ },
48
+ },
49
+ views: {
50
+ rows: {
51
+ name: "rows",
52
+ icon: "view-list",
53
+ perPage: {
54
+ options: [9, 12, 16],
55
+ default: 9,
56
+ },
57
+ },
58
+ dense: {
59
+ default: true,
60
+ name: "dense",
61
+ icon: "land-rows-horizontal",
62
+ perPage: {
63
+ options: [20, 40, 60, 80, 100],
64
+ default: 20,
65
+ },
66
+ },
67
+ tiles: {
68
+ name: "tiles",
69
+ icon: "view-quilt",
70
+ },
71
+ grid: {
72
+ name: "grid",
73
+ icon: "view-day",
74
+ },
75
+ },
76
+ },
77
+ form: {
78
+ url: {
79
+ type: formType.Primitive,
80
+ component: "TextField",
81
+ label: "url",
82
+
83
+ description: "The url where the image is fetched from",
84
+ rules: {
85
+ required: true,
86
+ url: true,
87
+ max: 2048,
88
+ },
89
+
90
+ meta: "url", // item type on schema.org
91
+ },
92
+ caption: {
93
+ label: "caption",
94
+ type: formType.Primitive,
95
+ component: "TextField",
96
+ i18n: true,
97
+ rules: {
98
+ required: true,
99
+ min: 2,
100
+ max: 100,
101
+ },
102
+ meta: "caption", // item type on schema.org
103
+ },
104
+ alt: {
105
+ label: "alt",
106
+ type: formType.Primitive,
107
+ i18n: true,
108
+ component: "TextField",
109
+ description: "Displayed if the image cannot be loaded",
110
+ rules: {
111
+ max: 200,
112
+ },
113
+ meta: "alt", // item type on schema.org
114
+ },
115
+
116
+ copyright: {
117
+ label: "copyright",
118
+ type: formType.Primitive,
119
+ component: "TextField",
120
+ default: "Free of rights",
121
+ description: "Owner of the image copyright",
122
+ meta: "copyright", // item type on schema.org
123
+ },
124
+ licence: {
125
+ label: "licence",
126
+ type: formType.Primitive,
127
+ component: "TextField", // TODO change for an autocomplete/add and enum
128
+ default: null,
129
+ description: "The licence of the video",
130
+ meta: "licence", // item type on schema.org
131
+ },
132
+ licenseUrl: {
133
+ label: "licenseUrl",
134
+ type: formType.Primitive,
135
+ component: "TextField", // TODO bind to the licence selection, change for an autocomplete/add and enum
136
+ default: null,
137
+ description: "The caption of the video",
138
+ rules: {
139
+ url: true,
140
+ },
141
+ show: {
142
+ default: false, // "default: true" is the same than "hidden = false"
143
+ switchIf: [], // array of conditions to switch the show, each condition will be assessed as a boolean
144
+ disjonctive: false, //TODO: implement. if true, show only if one of the if is true, if false, show only if all of the if are true
145
+ },
146
+ meta: "licenseUrl", // item type on schema.org
147
+ },
148
+ backgroundColor: {
149
+ label: "backgroundColor",
150
+ type: formType.Primitive,
151
+ component: "ColorPicker",
152
+ default: null,
153
+ rules: {
154
+ color: true,
155
+ },
156
+ show: {
157
+ default: false, // "default: true" is the same than "hidden = false"
158
+ switchIf: [], // array of conditions to switch the show, each condition will be assessed as a boolean
159
+ disjonctive: false, //TODO: implement. if true, show only if one of the if is true, if false, show only if all of the if are true
160
+ },
161
+ meta: "backgroundColor", // item type on schema.org
162
+ },
163
+ },
164
+ }
165
+
166
+ export default defaultConfig
package/src/form.ts ADDED
@@ -0,0 +1,52 @@
1
+ import { userRole } from "./people/models/users"
2
+
3
+ interface Rules {
4
+ required?: boolean
5
+ min?: number
6
+ max?: number
7
+ url?: boolean
8
+ color?: boolean
9
+ ror?: boolean
10
+ DOI?: boolean
11
+ date?: boolean
12
+ email?: boolean
13
+ digit?: boolean
14
+ orcid?: boolean
15
+ }
16
+ export enum formType {
17
+ Primitive = "PRIMITIVE",
18
+ Object = "OBJECT",
19
+ Array = "ARRAY",
20
+ Template = "TEMPLATE",
21
+ Document = "DOCUMENT",
22
+ }
23
+ export interface Conditional {
24
+ default?: boolean
25
+ switchIf?: any[]
26
+ disjonctive?: boolean
27
+ }
28
+
29
+ export enum Transformers { // only for primitive strings
30
+ Options = "OPTIONS", // will use the field as source for options
31
+ Trim = "TRIM", // remove trailing spaces
32
+ Capitalize = "CAPITALIZE",
33
+ ToUpperCase = "TO_UPPERCASE",
34
+ ToLowerCase = "TO_LOWERCASE",
35
+ }
36
+ export interface Form {
37
+ type: formType // Primitive, Object, Array, Template, Document
38
+ component?: string | boolean // short name component to load dynamically
39
+ label: string
40
+ groups?: userRole[] // restrict to some groups
41
+ i18n?: boolean
42
+ default?: any
43
+ description?: string
44
+ hint?: string | boolean
45
+ rules?: Rules // used for field validation (rely on vuetify for objects and primitives, custom for arrays)
46
+ show?: Conditional
47
+ enabled?: Conditional
48
+ transformers?: Transformers[] // used to format the field on blur (primitves strings only)
49
+ meta?: string // for SEO
50
+ items?: any
51
+ multiple?: boolean
52
+ }
package/src/index.ts ADDED
@@ -0,0 +1,98 @@
1
+ import { ModuleType } from "../lib/generate"
2
+ import Model from "./model"
3
+ import { Sort, Views } from "./list"
4
+ import { Form, formType } from "./form"
5
+ import defaultConfigAction from "./action/models/action"
6
+ import defaultConfigAffilation from "./affiliation/models/affiliation"
7
+ import defaultConfigArticle from "./publications/models/article"
8
+ import defaultConfigExperiences, {
9
+ ExperiencesForm,
10
+ } from "./people/models/experiences"
11
+ import defautConfigApp from "./apps/models/apps"
12
+ import defaultConfigConsent, { ConsentForm } from "./people/models/consent"
13
+ import defaultConfigDisciplines from "./misc/models/disciplines"
14
+ import defaultConfigDiscussants from "./people/models/discussants"
15
+ import defaultConfigEvents from "./events/models/events"
16
+ import defaultConfigEventSlot, {
17
+ EventSlotForm,
18
+ } from "./events/models/eventSlot"
19
+ import defaultConfigFellows from "./people/models/fellows"
20
+ import defaultConfigFellowship from "./fellowships/models/fellowships"
21
+ import defaultConfigPublications from "./publications/models/publications"
22
+ import defaultConfigFellowshipDetails, {
23
+ FellowshipDetailsForm,
24
+ } from "./fellowships/models/fellowshipDetails"
25
+ import defaultConfigFiles from "./files/models/files"
26
+ import defaultConfigGallery from "./files/models/gallery"
27
+ import defaultConfigGroup, { GroupsForm } from "./people/models/groups"
28
+ import defaultConfigImage from "./files/models/image"
29
+ import defaultConfigLocation, { LocationForm } from "./misc/models/location"
30
+ import defaultConfigMailing from "./mailing/models/mailing"
31
+ import defaultConfigMember from "./affiliation/models/member"
32
+ import defaultConfigNews from "./news/models/news"
33
+ import defaultConfigOrganizers from "./misc/models/organizers"
34
+ import defaultConfigPartner from "./affiliation/models/partner"
35
+ import defaultConfigPeople from "./people/models/people"
36
+ import defaultConfigPosition, { PositionForm } from "./people/models/position"
37
+ import defaultConfigProject from "./projects/models/projects"
38
+ import defaultConfigRelated from "./misc/models/related"
39
+ import defaultConfigSocials, { SocialsForm } from "./misc/models/socials"
40
+ import defaultConfigSpeakers from "./people/models/speakers"
41
+ import defaultConfigSponsor from "./misc/models/sponsor"
42
+ import defaultConfigTags from "./misc/models/tags"
43
+ import defaultConfigVideo from "./files/models/video"
44
+ import defaultConfigVintage from "./people/models/vintage"
45
+ import defaultConfigUsers from "./people/models/users"
46
+ type ConfigValue =
47
+ | Model
48
+ | ExperiencesForm
49
+ | ConsentForm
50
+ | EventSlotForm
51
+ | FellowshipDetailsForm
52
+ | GroupsForm
53
+ | LocationForm
54
+ | PositionForm
55
+ | SocialsForm
56
+
57
+ const templates: Record<string, ConfigValue> = {
58
+ action: defaultConfigAction,
59
+ workExperience: defaultConfigExperiences,
60
+ affiliation: defaultConfigAffilation,
61
+ apps: defautConfigApp,
62
+ article: defaultConfigArticle,
63
+ consent: defaultConfigConsent,
64
+ disciplines: defaultConfigDisciplines,
65
+ discussants: defaultConfigDiscussants,
66
+ events: defaultConfigEvents,
67
+ eventSlot: defaultConfigEventSlot,
68
+ experiences: defaultConfigExperiences,
69
+ fellows: defaultConfigFellows,
70
+ fellowships: defaultConfigFellowship,
71
+ fellowshipDetails: defaultConfigFellowshipDetails,
72
+ files: defaultConfigFiles,
73
+ gallery: defaultConfigGallery,
74
+ groups: defaultConfigGroup,
75
+ image: defaultConfigImage,
76
+ location: defaultConfigLocation,
77
+ mailing: defaultConfigMailing,
78
+ member: defaultConfigMember,
79
+ news: defaultConfigNews,
80
+ organizers: defaultConfigOrganizers,
81
+ partner: defaultConfigPartner,
82
+ people: defaultConfigPeople,
83
+ positions: defaultConfigPosition,
84
+ projects: defaultConfigProject,
85
+ publications: defaultConfigPublications,
86
+ related: defaultConfigRelated,
87
+ socials: defaultConfigSocials,
88
+ speakers: defaultConfigSpeakers,
89
+ sponsor: defaultConfigSponsor,
90
+ tags: defaultConfigTags,
91
+ users: defaultConfigUsers,
92
+ video: defaultConfigVideo,
93
+ vintage: defaultConfigVintage,
94
+ }
95
+
96
+ export { templates }
97
+
98
+ export type { Form, Sort, Views, ConfigValue, Model, ModuleType, formType }
package/src/list.ts ADDED
@@ -0,0 +1,34 @@
1
+ import { Conditional } from "./form"
2
+ export interface PerPage {
3
+ options: number[]
4
+ default: number
5
+ }
6
+ interface Filters {
7
+ type: string
8
+ rules?: Record<string, any>
9
+ items?: any
10
+ show?: Conditional
11
+ multiple?: boolean
12
+ }
13
+
14
+ export interface Sort {
15
+ icon: string
16
+ text: string
17
+ value: [string, number]
18
+ default?: boolean
19
+ }
20
+
21
+ export interface Views {
22
+ icon: string
23
+ default?: boolean
24
+ name?: string
25
+ perPage?: PerPage
26
+ }
27
+
28
+ export interface List {
29
+ create: boolean
30
+ // perPage: PerPage
31
+ filters: Record<string, Filters>
32
+ sort: Record<string, Sort>
33
+ views: Record<string, Views>
34
+ }
@@ -0,0 +1,24 @@
1
+ query getFile($appId: ID = "iea", $itemId: ID = "", $lang: String = "en") {
2
+ getFile(appId: $appId, itemId: $itemId, lang: $lang) {
3
+ createdAt
4
+ file
5
+ fileType
6
+ hash
7
+ image {
8
+ alt
9
+ backgroundColor
10
+ caption
11
+ copyright
12
+ license
13
+ licenseUrl
14
+ url
15
+ }
16
+ name
17
+ path
18
+ size
19
+ thumb
20
+ updatedAt
21
+ url
22
+ slug
23
+ }
24
+ }
@@ -0,0 +1,23 @@
1
+ query listMailing(
2
+ $appId: ID = "iea"
3
+ $lang: String = "en"
4
+ $options: ListInput = {
5
+ skip: 0
6
+ limit: 9
7
+ sortBy: ["start"]
8
+ sortDesc: false
9
+ filters: "{}"
10
+ }
11
+ ) {
12
+ listMailing(options: $options, appId: $appId, lang: $lang) {
13
+ items {
14
+ createdAt
15
+ date
16
+ description
17
+ name
18
+ updatedAt
19
+ slug
20
+ }
21
+ total
22
+ }
23
+ }