@assemblis/contracts 0.0.13 → 0.1.1
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.
- package/dist/index.js +347 -1
- package/dist/schemas/api.d.ts +2450 -0
- package/dist/schemas/base.d.ts +363 -0
- package/dist/schemas/index.d.ts +2 -0
- package/dist/schemas/legacy.d.ts +1276 -0
- package/dist/schemas/utils.d.ts +11 -0
- package/dist/types/api.d.ts +57 -0
- package/dist/types/enums.d.ts +27 -0
- package/dist/types/index.d.ts +3 -0
- package/dist/types/types.d.ts +5 -0
- package/package.json +1 -1
- package/src/schemas/api.ts +43 -0
- package/src/schemas/base.ts +58 -0
- package/src/schemas/index.ts +2 -0
- package/src/{schemas.ts → schemas/legacy.ts} +59 -77
- package/src/schemas/utils.ts +5 -0
- package/src/{types.ts → types/api.ts} +10 -34
- package/src/types/enums.ts +30 -0
- package/src/types/index.ts +3 -0
- package/src/types/types.ts +12 -0
- package/dist/schemas.d.ts +0 -613
- package/dist/types.d.ts +0 -50
package/dist/index.js
CHANGED
|
@@ -1 +1,347 @@
|
|
|
1
|
-
import e from
|
|
1
|
+
import e from 'zod';
|
|
2
|
+
const t = e.iso.datetime(),
|
|
3
|
+
a = (e) => e.nullish().transform((e) => e ?? null),
|
|
4
|
+
r = e.object({
|
|
5
|
+
id: e.uuid(),
|
|
6
|
+
created_at: t,
|
|
7
|
+
updated_at: t,
|
|
8
|
+
uri: e.string(),
|
|
9
|
+
alt: e.string(),
|
|
10
|
+
src: e.string(),
|
|
11
|
+
sizes: e.string(),
|
|
12
|
+
srcset: e.string()
|
|
13
|
+
}),
|
|
14
|
+
n = e.object({ label: e.string(), value: e.coerce.number().int() }),
|
|
15
|
+
i = e.object({
|
|
16
|
+
published_at: a(t),
|
|
17
|
+
title: a(e.string()),
|
|
18
|
+
description: a(e.string()),
|
|
19
|
+
location: a(e.string()),
|
|
20
|
+
outputs: a(e.string().array()),
|
|
21
|
+
initiation_type: a(e.string()),
|
|
22
|
+
recruitment_method: a(e.string()),
|
|
23
|
+
recruitment_description: a(e.string()),
|
|
24
|
+
participant_count: a(e.int()),
|
|
25
|
+
organiser_reflections: a(e.string()),
|
|
26
|
+
organiser_report_url: a(e.string()),
|
|
27
|
+
location_details: a(e.string()),
|
|
28
|
+
date: a(e.string()),
|
|
29
|
+
duration: a(e.int()),
|
|
30
|
+
contact_information_url: a(e.string()),
|
|
31
|
+
cover_image_id: a(e.string())
|
|
32
|
+
}),
|
|
33
|
+
o = e.object({
|
|
34
|
+
id: e.uuid(),
|
|
35
|
+
created_at: t,
|
|
36
|
+
updated_at: t,
|
|
37
|
+
published_at: a(t),
|
|
38
|
+
viewer_password: e.string(),
|
|
39
|
+
draft_content: a(i),
|
|
40
|
+
published_content: a(i),
|
|
41
|
+
media: e.object({ images: r.array() })
|
|
42
|
+
});
|
|
43
|
+
e.object({
|
|
44
|
+
id: e.uuid(),
|
|
45
|
+
created_at: t,
|
|
46
|
+
updated_at: t,
|
|
47
|
+
sub: e.string(),
|
|
48
|
+
is_mutirao: e.boolean()
|
|
49
|
+
});
|
|
50
|
+
const s = { payload: e.never(), response: e.object({ reports: o.array() }) },
|
|
51
|
+
d = { payload: e.never(), response: o },
|
|
52
|
+
c = { payload: a(i.omit({ cover_image_id: !0 })), response: o },
|
|
53
|
+
p = { payload: i.omit({ cover_image_id: !0 }), response: o },
|
|
54
|
+
u = { payload: e.never(), response: a(o) },
|
|
55
|
+
_ = { payload: e.object({ published_at: t }), response: o },
|
|
56
|
+
l = { payload: e.never(), response: o },
|
|
57
|
+
b = { payload: r.pick({ alt: !0 }), response: o },
|
|
58
|
+
g = {
|
|
59
|
+
payload: e.object({
|
|
60
|
+
route: e.string(),
|
|
61
|
+
text: e.string(),
|
|
62
|
+
metadata: e.unknown()
|
|
63
|
+
}),
|
|
64
|
+
response: e.string()
|
|
65
|
+
},
|
|
66
|
+
m = {
|
|
67
|
+
payload: e.object({
|
|
68
|
+
message: e.string().optional(),
|
|
69
|
+
data: e.record(e.string(), e.string().optional()).optional(),
|
|
70
|
+
metadata: e.object({
|
|
71
|
+
origin: e.string(),
|
|
72
|
+
route: e.string(),
|
|
73
|
+
status: e.number()
|
|
74
|
+
})
|
|
75
|
+
}),
|
|
76
|
+
response: e.string()
|
|
77
|
+
},
|
|
78
|
+
y = {
|
|
79
|
+
payload: e.object({
|
|
80
|
+
type: e.literal('user.created'),
|
|
81
|
+
object: e.literal('event'),
|
|
82
|
+
data: e.object({
|
|
83
|
+
id: e.string(),
|
|
84
|
+
email_addresses: e.object({ email_address: e.string() }).array()
|
|
85
|
+
})
|
|
86
|
+
}),
|
|
87
|
+
response: e.string()
|
|
88
|
+
},
|
|
89
|
+
S = e.object({ id: e.uuid(), text: e.string() }),
|
|
90
|
+
f = {
|
|
91
|
+
payload: e.undefined(),
|
|
92
|
+
response: e.object({
|
|
93
|
+
id: e.uuid(),
|
|
94
|
+
created_at: t,
|
|
95
|
+
updated_at: t,
|
|
96
|
+
name: e.string(),
|
|
97
|
+
sections: e
|
|
98
|
+
.object({ primary: S, secondary: S.array(), options: n.array() })
|
|
99
|
+
.array()
|
|
100
|
+
})
|
|
101
|
+
},
|
|
102
|
+
j = {
|
|
103
|
+
payload: e.object({
|
|
104
|
+
answers: e
|
|
105
|
+
.object({
|
|
106
|
+
question_id: e.uuid(),
|
|
107
|
+
answer_value: e.coerce.number().int()
|
|
108
|
+
})
|
|
109
|
+
.array()
|
|
110
|
+
}),
|
|
111
|
+
response: e.object({ total: e.number().int() })
|
|
112
|
+
},
|
|
113
|
+
v = e.object({ visible_on_profile: e.boolean(), description: a(e.string()) }),
|
|
114
|
+
x = e.object({
|
|
115
|
+
text: e.string(),
|
|
116
|
+
agreed: a(e.coerce.number().int()),
|
|
117
|
+
against: a(e.coerce.number().int()),
|
|
118
|
+
abstained: a(e.coerce.number().int()),
|
|
119
|
+
include_in_action_plan: e.boolean().default(!0),
|
|
120
|
+
assembly_id: e.uuid()
|
|
121
|
+
}),
|
|
122
|
+
E = e.object({
|
|
123
|
+
text: e.string(),
|
|
124
|
+
complete: e.boolean().default(!1),
|
|
125
|
+
action_id: e.uuid(),
|
|
126
|
+
assembly_id: e.uuid()
|
|
127
|
+
}),
|
|
128
|
+
I = e.object({
|
|
129
|
+
published_at: a(t),
|
|
130
|
+
name: e.string(),
|
|
131
|
+
about: a(e.string()),
|
|
132
|
+
topics: e.string().array(),
|
|
133
|
+
country: a(e.string()),
|
|
134
|
+
hide: e.boolean().default(!1)
|
|
135
|
+
}),
|
|
136
|
+
O = {
|
|
137
|
+
payload: I,
|
|
138
|
+
response: I.extend({
|
|
139
|
+
id: e.uuid(),
|
|
140
|
+
created_at: t,
|
|
141
|
+
updated_at: t,
|
|
142
|
+
image_src: a(e.string()),
|
|
143
|
+
has_image: e.boolean().meta({ deprecated: !0 }),
|
|
144
|
+
user_id: e.uuid().meta({ deprecated: !0 })
|
|
145
|
+
})
|
|
146
|
+
},
|
|
147
|
+
T = {
|
|
148
|
+
payload: e.undefined(),
|
|
149
|
+
response: e.object({ assemblies: O.response.array() })
|
|
150
|
+
},
|
|
151
|
+
A = e.object({
|
|
152
|
+
visible_on_profile: e.boolean(),
|
|
153
|
+
name: a(e.string()),
|
|
154
|
+
description: a(e.string()),
|
|
155
|
+
type: a(e.string())
|
|
156
|
+
}),
|
|
157
|
+
h = e.object({
|
|
158
|
+
visible_on_profile: e.boolean(),
|
|
159
|
+
registration_link: a(e.string()),
|
|
160
|
+
start_date: a(t)
|
|
161
|
+
}),
|
|
162
|
+
P = e.object({ visible_on_profile: e.boolean(), background: a(e.string()) }),
|
|
163
|
+
k = e.object({
|
|
164
|
+
visible_on_profile: e.boolean(),
|
|
165
|
+
organisation_types: e.string().array(),
|
|
166
|
+
description: a(e.string())
|
|
167
|
+
}),
|
|
168
|
+
R = e.object({
|
|
169
|
+
visible_on_profile: e.boolean(),
|
|
170
|
+
organisation_types: e.string().array(),
|
|
171
|
+
description: a(e.string())
|
|
172
|
+
}),
|
|
173
|
+
w = e.object({
|
|
174
|
+
visible_on_profile: e.boolean(),
|
|
175
|
+
decision_method: a(e.string())
|
|
176
|
+
}),
|
|
177
|
+
M = e.object({
|
|
178
|
+
visible_on_profile: e.boolean(),
|
|
179
|
+
recruitment_method: a(e.string()),
|
|
180
|
+
community: a(e.string())
|
|
181
|
+
}),
|
|
182
|
+
N = e.object({
|
|
183
|
+
visible_on_profile: e.boolean(),
|
|
184
|
+
support_options: e.string().array()
|
|
185
|
+
}),
|
|
186
|
+
D = e.object({ visible_on_profile: e.boolean() }),
|
|
187
|
+
B = {
|
|
188
|
+
payload: O.payload.extend({
|
|
189
|
+
organisation: a(A.extend({ id: e.uuid().optional() })),
|
|
190
|
+
event_details: a(h),
|
|
191
|
+
story: a(P),
|
|
192
|
+
supporters: a(k),
|
|
193
|
+
funders: a(R),
|
|
194
|
+
facilitation: a(w),
|
|
195
|
+
participants: a(M),
|
|
196
|
+
support: a(N),
|
|
197
|
+
action_plan: a(
|
|
198
|
+
v.extend({
|
|
199
|
+
actions: x
|
|
200
|
+
.omit({ assembly_id: !0 })
|
|
201
|
+
.extend({
|
|
202
|
+
id: e.uuid().optional(),
|
|
203
|
+
tasks: E.omit({ action_id: !0, assembly_id: !0 })
|
|
204
|
+
.extend({ id: e.uuid().optional() })
|
|
205
|
+
.array(),
|
|
206
|
+
updates: e.unknown().array()
|
|
207
|
+
})
|
|
208
|
+
.array(),
|
|
209
|
+
updates: e.unknown().array()
|
|
210
|
+
})
|
|
211
|
+
),
|
|
212
|
+
surveys: a(D)
|
|
213
|
+
}),
|
|
214
|
+
response: O.response.omit({ user_id: !0 }).extend({
|
|
215
|
+
is_own: e.boolean(),
|
|
216
|
+
organisation: a(A.extend({ id: e.uuid(), created_at: t, updated_at: t })),
|
|
217
|
+
event_details: a(h.extend({ created_at: t, updated_at: t })),
|
|
218
|
+
story: a(P.extend({ created_at: t, updated_at: t })),
|
|
219
|
+
supporters: a(k.extend({ created_at: t, updated_at: t })),
|
|
220
|
+
funders: a(R.extend({ created_at: t, updated_at: t })),
|
|
221
|
+
facilitation: a(w.extend({ created_at: t, updated_at: t })),
|
|
222
|
+
participants: a(M.extend({ created_at: t, updated_at: t })),
|
|
223
|
+
support: a(N.extend({ created_at: t, updated_at: t })),
|
|
224
|
+
action_plan: a(
|
|
225
|
+
v
|
|
226
|
+
.extend({
|
|
227
|
+
actions: x
|
|
228
|
+
.omit({ assembly_id: !0 })
|
|
229
|
+
.extend({
|
|
230
|
+
id: e.uuid(),
|
|
231
|
+
created_at: t,
|
|
232
|
+
updated_at: e.coerce.date().transform((e) => e.toISOString()),
|
|
233
|
+
tasks: E.omit({ action_id: !0, assembly_id: !0 })
|
|
234
|
+
.extend({
|
|
235
|
+
id: e.uuid(),
|
|
236
|
+
created_at: e.coerce
|
|
237
|
+
.date()
|
|
238
|
+
.transform((e) => e.toISOString()),
|
|
239
|
+
updated_at: e.coerce
|
|
240
|
+
.date()
|
|
241
|
+
.transform((e) => e.toISOString())
|
|
242
|
+
})
|
|
243
|
+
.array(),
|
|
244
|
+
updates: e.unknown().array()
|
|
245
|
+
})
|
|
246
|
+
.extend({
|
|
247
|
+
created_at: e.coerce.date().transform((e) => e.toISOString()),
|
|
248
|
+
updated_at: e.coerce.date().transform((e) => e.toISOString())
|
|
249
|
+
})
|
|
250
|
+
.array(),
|
|
251
|
+
updates: e.unknown().array()
|
|
252
|
+
})
|
|
253
|
+
.and(
|
|
254
|
+
e.object({
|
|
255
|
+
created_at: e.coerce.date().transform((e) => e.toISOString()),
|
|
256
|
+
updated_at: e.coerce.date().transform((e) => e.toISOString())
|
|
257
|
+
})
|
|
258
|
+
)
|
|
259
|
+
),
|
|
260
|
+
surveys: a(
|
|
261
|
+
D.extend({
|
|
262
|
+
created_at: e.coerce.date().transform((e) => e.toISOString()),
|
|
263
|
+
updated_at: e.coerce.date().transform((e) => e.toISOString())
|
|
264
|
+
}).extend({
|
|
265
|
+
data: e.record(
|
|
266
|
+
e.string(),
|
|
267
|
+
e.object({
|
|
268
|
+
total: e.number().int(),
|
|
269
|
+
responses: e.record(e.string(), n.array())
|
|
270
|
+
})
|
|
271
|
+
)
|
|
272
|
+
})
|
|
273
|
+
)
|
|
274
|
+
})
|
|
275
|
+
},
|
|
276
|
+
C = {
|
|
277
|
+
payload: e.object({
|
|
278
|
+
country: e.string(),
|
|
279
|
+
email: e.string(),
|
|
280
|
+
text: a(e.string())
|
|
281
|
+
}),
|
|
282
|
+
response: e.object({
|
|
283
|
+
id: e.uuid(),
|
|
284
|
+
created_at: e.coerce.date().transform((e) => e.toISOString()),
|
|
285
|
+
updated_at: e.coerce.date().transform((e) => e.toISOString()),
|
|
286
|
+
country: e.string(),
|
|
287
|
+
text: a(e.string()),
|
|
288
|
+
hide: e.boolean(),
|
|
289
|
+
image_src: a(e.string()),
|
|
290
|
+
has_image: e.boolean().meta({ deprecated: !0 })
|
|
291
|
+
})
|
|
292
|
+
},
|
|
293
|
+
L = {
|
|
294
|
+
payload: e.undefined(),
|
|
295
|
+
response: e.object({
|
|
296
|
+
assemblies: O.response.array(),
|
|
297
|
+
pins: C.response.array()
|
|
298
|
+
})
|
|
299
|
+
};
|
|
300
|
+
var U, G, Y, H;
|
|
301
|
+
!(function (e) {
|
|
302
|
+
(e.GET = 'GET'), (e.POST = 'POST'), (e.PUT = 'PUT'), (e.PATCH = 'PATCH');
|
|
303
|
+
})(U || (U = {})),
|
|
304
|
+
(function (e) {
|
|
305
|
+
(e.ID = ':ID'), (e.NAME = ':NAME');
|
|
306
|
+
})(G || (G = {})),
|
|
307
|
+
(function (e) {
|
|
308
|
+
(e.ACCOUNT_REPORTS = '/account/reports'),
|
|
309
|
+
(e.ASSEMBLIES = '/assemblies'),
|
|
310
|
+
(e.FEEDBACK = '/feedback'),
|
|
311
|
+
(e.INTEREST_ASSEMBLIS = '/interest/assemblis'),
|
|
312
|
+
(e.INTEREST_MUTIRAO = '/interest/mutirao'),
|
|
313
|
+
(e.LOGS = '/logs'),
|
|
314
|
+
(e.PINS = '/pins'),
|
|
315
|
+
(e.SURVEYS = '/surveys'),
|
|
316
|
+
(e.SURVEY_RESPONSES = '/assemblies/:ID/survey-responses/:NAME');
|
|
317
|
+
})(Y || (Y = {})),
|
|
318
|
+
(function (e) {
|
|
319
|
+
(e.DELIBERATION = 'deliberation'),
|
|
320
|
+
(e.DEMOGRAPHIC_DATA = 'demographic-data'),
|
|
321
|
+
(e.PRE_ASSEMBLY = 'pre-assembly'),
|
|
322
|
+
(e.POST_ASSEMBLY = 'post-assembly');
|
|
323
|
+
})(H || (H = {}));
|
|
324
|
+
export {
|
|
325
|
+
Y as ApiEndpoint,
|
|
326
|
+
U as ApiRestMethod,
|
|
327
|
+
G as ApiRouteParameter,
|
|
328
|
+
T as AssembliesListSchema,
|
|
329
|
+
B as AssemblyDetailSchema,
|
|
330
|
+
O as AssemblyOverviewSchema,
|
|
331
|
+
g as FeedbackSchema,
|
|
332
|
+
d as GetAccountReportsIdSchema,
|
|
333
|
+
s as GetAccountReportsSchema,
|
|
334
|
+
m as LogSchema,
|
|
335
|
+
u as PatchAccountReportsIdDiscardSchema,
|
|
336
|
+
_ as PatchAccountReportsIdPublishSchema,
|
|
337
|
+
l as PatchAccountReportsIdUnpublishSchema,
|
|
338
|
+
L as PinListSchema,
|
|
339
|
+
C as PinSchema,
|
|
340
|
+
b as PostAccountReportsIdCoverImageSchema,
|
|
341
|
+
c as PostAccountReportsSchema,
|
|
342
|
+
p as PutAccountReportsIdContentSchema,
|
|
343
|
+
y as RegisterSchema,
|
|
344
|
+
H as SurveyName,
|
|
345
|
+
j as SurveyResponseSchema,
|
|
346
|
+
f as SurveySchema
|
|
347
|
+
};
|