@tietokilta/ilmomasiina-models 2.0.0-alpha2.5 → 2.0.0-alpha21
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/README.md +1 -3
- package/dist/attrs/event.d.ts +17 -0
- package/dist/attrs/event.d.ts.map +1 -0
- package/dist/attrs/event.js +85 -0
- package/dist/enum.d.ts +44 -0
- package/dist/enum.d.ts.map +1 -0
- package/dist/enum.js +50 -0
- package/dist/index.d.ts +3 -8
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +16 -0
- package/dist/models/answer.d.ts +2 -1
- package/dist/models/answer.d.ts.map +1 -0
- package/dist/models/auditlog.d.ts +3 -1
- package/dist/models/auditlog.d.ts.map +1 -0
- package/dist/models/event.d.ts +1 -0
- package/dist/models/event.d.ts.map +1 -0
- package/dist/models/index.d.ts +8 -0
- package/dist/models/index.d.ts.map +1 -0
- package/dist/models/question.d.ts +3 -3
- package/dist/models/question.d.ts.map +1 -0
- package/dist/models/question.js +0 -2
- package/dist/models/quota.d.ts +1 -0
- package/dist/models/quota.d.ts.map +1 -0
- package/dist/models/signup.d.ts +3 -2
- package/dist/models/signup.d.ts.map +1 -0
- package/dist/models/signup.js +0 -2
- package/dist/models/user.d.ts +1 -0
- package/dist/models/user.d.ts.map +1 -0
- package/dist/schema/auditLog/attributes.d.ts +15 -0
- package/dist/schema/auditLog/attributes.d.ts.map +1 -0
- package/dist/schema/auditLog/attributes.js +30 -0
- package/dist/schema/auditLog/index.d.ts +36 -0
- package/dist/schema/auditLog/index.d.ts.map +1 -0
- package/dist/schema/auditLog/index.js +40 -0
- package/dist/schema/category/index.d.ts +10 -0
- package/dist/schema/category/index.d.ts.map +1 -0
- package/dist/schema/category/index.js +10 -0
- package/dist/schema/errors/index.d.ts +33 -0
- package/dist/schema/errors/index.d.ts.map +1 -0
- package/dist/schema/errors/index.js +34 -0
- package/dist/schema/event/attributes.d.ts +110 -0
- package/dist/schema/event/attributes.d.ts.map +1 -0
- package/dist/schema/event/attributes.js +85 -0
- package/dist/schema/event/index.d.ts +306 -0
- package/dist/schema/event/index.d.ts.map +1 -0
- package/dist/schema/event/index.js +72 -0
- package/dist/schema/eventList/index.d.ts +135 -0
- package/dist/schema/eventList/index.d.ts.map +1 -0
- package/dist/schema/eventList/index.js +32 -0
- package/dist/schema/headers.d.ts +3 -0
- package/dist/schema/headers.d.ts.map +1 -0
- package/dist/schema/headers.js +6 -0
- package/dist/schema/index.d.ts +15 -0
- package/dist/schema/index.d.ts.map +1 -0
- package/dist/schema/index.js +30 -0
- package/dist/schema/login/index.d.ts +15 -0
- package/dist/schema/login/index.d.ts.map +1 -0
- package/dist/schema/login/index.js +19 -0
- package/dist/schema/question/attributes.d.ts +15 -0
- package/dist/schema/question/attributes.d.ts.map +1 -0
- package/dist/schema/question/attributes.js +31 -0
- package/dist/schema/question/index.d.ts +38 -0
- package/dist/schema/question/index.d.ts.map +1 -0
- package/dist/schema/question/index.js +19 -0
- package/dist/schema/quota/attributes.d.ts +11 -0
- package/dist/schema/quota/attributes.d.ts.map +1 -0
- package/dist/schema/quota/attributes.js +21 -0
- package/dist/schema/quota/index.d.ts +27 -0
- package/dist/schema/quota/index.d.ts.map +1 -0
- package/dist/schema/quota/index.js +19 -0
- package/dist/schema/quotaWithSignups/index.d.ts +68 -0
- package/dist/schema/quotaWithSignups/index.d.ts.map +1 -0
- package/dist/schema/quotaWithSignups/index.js +29 -0
- package/dist/schema/signup/attributes.d.ts +40 -0
- package/dist/schema/signup/attributes.d.ts.map +1 -0
- package/dist/schema/signup/attributes.js +56 -0
- package/dist/schema/signup/index.d.ts +84 -0
- package/dist/schema/signup/index.d.ts.map +1 -0
- package/dist/schema/signup/index.js +42 -0
- package/dist/schema/signupForEdit/index.d.ts +89 -0
- package/dist/schema/signupForEdit/index.d.ts.map +1 -0
- package/dist/schema/signupForEdit/index.js +22 -0
- package/dist/schema/slug/index.d.ts +15 -0
- package/dist/schema/slug/index.d.ts.map +1 -0
- package/dist/schema/slug/index.js +15 -0
- package/dist/schema/user/attributes.d.ts +12 -0
- package/dist/schema/user/attributes.d.ts.map +1 -0
- package/dist/schema/user/attributes.js +24 -0
- package/dist/schema/user/index.d.ts +48 -0
- package/dist/schema/user/index.d.ts.map +1 -0
- package/dist/schema/user/index.js +32 -0
- package/dist/schema/utils.d.ts +3 -0
- package/dist/schema/utils.d.ts.map +1 -0
- package/dist/schema/utils.js +7 -0
- package/package.json +22 -5
- package/dist/services/admin/categories/index.d.ts +0 -6
- package/dist/services/admin/categories/list.d.ts +0 -1
- package/dist/services/admin/categories/list.js +0 -2
- package/dist/services/admin/events/create.d.ts +0 -14
- package/dist/services/admin/events/create.js +0 -38
- package/dist/services/admin/events/index.d.ts +0 -31
- package/dist/services/admin/events/index.js +0 -2
- package/dist/services/admin/events/update.d.ts +0 -16
- package/dist/services/admin/events/update.js +0 -2
- package/dist/services/admin/slug/get.d.ts +0 -5
- package/dist/services/admin/slug/get.js +0 -2
- package/dist/services/admin/slug/index.d.ts +0 -6
- package/dist/services/admin/slug/index.js +0 -2
- package/dist/services/auditlog/index.d.ts +0 -25
- package/dist/services/auditlog/index.js +0 -2
- package/dist/services/auth/index.d.ts +0 -17
- package/dist/services/auth/index.js +0 -2
- package/dist/services/events/details.d.ts +0 -44
- package/dist/services/events/details.js +0 -67
- package/dist/services/events/index.d.ts +0 -25
- package/dist/services/events/index.js +0 -2
- package/dist/services/events/list.d.ts +0 -17
- package/dist/services/events/list.js +0 -26
- package/dist/services/signups/create.d.ts +0 -9
- package/dist/services/signups/create.js +0 -2
- package/dist/services/signups/getForEdit.d.ts +0 -28
- package/dist/services/signups/getForEdit.js +0 -29
- package/dist/services/signups/index.d.ts +0 -27
- package/dist/services/signups/index.js +0 -2
- package/dist/services/signups/update.d.ts +0 -18
- package/dist/services/signups/update.js +0 -2
- package/dist/services/users/details.d.ts +0 -9
- package/dist/services/users/details.js +0 -5
- package/dist/services/users/index.d.ts +0 -12
- package/dist/services/users/index.js +0 -2
- package/dist/utils.d.ts +0 -4
- package/dist/utils.js +0 -2
- /package/dist/{services/admin/categories → models}/index.js +0 -0
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.userEventPathParams = exports.adminEventPathParams = exports.userEventForSignup = exports.eventUpdateBody = exports.eventCreateBody = exports.userEventResponse = exports.adminEventResponse = void 0;
|
|
4
|
+
const typebox_1 = require("@sinclair/typebox");
|
|
5
|
+
const question_1 = require("../question");
|
|
6
|
+
const quota_1 = require("../quota");
|
|
7
|
+
const quotaWithSignups_1 = require("../quotaWithSignups");
|
|
8
|
+
const attributes_1 = require("./attributes");
|
|
9
|
+
/** Response schema for fetching or modifying an event in the admin API. */
|
|
10
|
+
exports.adminEventResponse = typebox_1.Type.Intersect([
|
|
11
|
+
attributes_1.eventIdentity,
|
|
12
|
+
attributes_1.adminFullEventAttributes,
|
|
13
|
+
typebox_1.Type.Object({
|
|
14
|
+
questions: typebox_1.Type.Array(question_1.question),
|
|
15
|
+
quotas: typebox_1.Type.Array(quotaWithSignups_1.adminQuotaWithSignups),
|
|
16
|
+
updatedAt: typebox_1.Type.String({
|
|
17
|
+
description: 'Last update time of the event. Used for edit conflict handling.',
|
|
18
|
+
format: 'date-time',
|
|
19
|
+
}),
|
|
20
|
+
}),
|
|
21
|
+
]);
|
|
22
|
+
/** Response schema for fetching an event from the public API. */
|
|
23
|
+
exports.userEventResponse = typebox_1.Type.Intersect([
|
|
24
|
+
attributes_1.eventIdentity,
|
|
25
|
+
attributes_1.userFullEventAttributes,
|
|
26
|
+
typebox_1.Type.Object({
|
|
27
|
+
questions: typebox_1.Type.Array(question_1.question),
|
|
28
|
+
quotas: typebox_1.Type.Array(quotaWithSignups_1.userQuotaWithSignups),
|
|
29
|
+
}),
|
|
30
|
+
attributes_1.eventDynamicAttributes,
|
|
31
|
+
]);
|
|
32
|
+
/** Request body for creating an event. */
|
|
33
|
+
exports.eventCreateBody = typebox_1.Type.Intersect([
|
|
34
|
+
attributes_1.adminFullEventAttributes,
|
|
35
|
+
typebox_1.Type.Object({
|
|
36
|
+
quotas: typebox_1.Type.Array(quota_1.quotaCreate),
|
|
37
|
+
questions: typebox_1.Type.Array(question_1.questionCreate),
|
|
38
|
+
}),
|
|
39
|
+
]);
|
|
40
|
+
/** Request body for editing an existing event. */
|
|
41
|
+
exports.eventUpdateBody = typebox_1.Type.Partial(typebox_1.Type.Intersect([
|
|
42
|
+
attributes_1.adminFullEventAttributes,
|
|
43
|
+
typebox_1.Type.Object({
|
|
44
|
+
quotas: typebox_1.Type.Array(quota_1.quotaUpdate),
|
|
45
|
+
questions: typebox_1.Type.Array(question_1.questionUpdate),
|
|
46
|
+
moveSignupsToQueue: typebox_1.Type.Boolean({
|
|
47
|
+
default: false,
|
|
48
|
+
description: 'Whether to allow moving signups to the queue, if caused by quota changes.',
|
|
49
|
+
}),
|
|
50
|
+
updatedAt: typebox_1.Type.String({
|
|
51
|
+
format: 'date-time',
|
|
52
|
+
description: 'Last update time of the event. An edit conflict is detected if this does not match the update '
|
|
53
|
+
+ 'date on the server.',
|
|
54
|
+
}),
|
|
55
|
+
}),
|
|
56
|
+
]));
|
|
57
|
+
/** Response schema when an event is fetched as part of an editable signup. */
|
|
58
|
+
exports.userEventForSignup = typebox_1.Type.Intersect([
|
|
59
|
+
attributes_1.eventIdentity,
|
|
60
|
+
attributes_1.userFullEventAttributes,
|
|
61
|
+
typebox_1.Type.Object({
|
|
62
|
+
questions: typebox_1.Type.Array(question_1.question),
|
|
63
|
+
}),
|
|
64
|
+
]);
|
|
65
|
+
/** Path parameters necessary to fetch an event from the admin API. */
|
|
66
|
+
exports.adminEventPathParams = typebox_1.Type.Object({
|
|
67
|
+
id: attributes_1.eventID,
|
|
68
|
+
});
|
|
69
|
+
/** Path parameters necessary to fetch an event from the public API. */
|
|
70
|
+
exports.userEventPathParams = typebox_1.Type.Object({
|
|
71
|
+
slug: attributes_1.eventSlug,
|
|
72
|
+
});
|
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
import { Static } from '@sinclair/typebox';
|
|
2
|
+
/** Schema for an item of an event list from the admin API. */
|
|
3
|
+
declare const adminEventListItemSchema: import("@sinclair/typebox").TIntersect<[import("@sinclair/typebox").TObject<{
|
|
4
|
+
id: import("@sinclair/typebox").TString;
|
|
5
|
+
}>, import("@sinclair/typebox").TIntersect<[import("@sinclair/typebox").TObject<{
|
|
6
|
+
title: import("@sinclair/typebox").TString;
|
|
7
|
+
slug: import("@sinclair/typebox").TString;
|
|
8
|
+
date: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TString, import("@sinclair/typebox").TNull]>;
|
|
9
|
+
endDate: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TString, import("@sinclair/typebox").TNull]>;
|
|
10
|
+
registrationStartDate: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TString, import("@sinclair/typebox").TNull]>;
|
|
11
|
+
registrationEndDate: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TString, import("@sinclair/typebox").TNull]>;
|
|
12
|
+
openQuotaSize: import("@sinclair/typebox").TInteger;
|
|
13
|
+
category: import("@sinclair/typebox").TString;
|
|
14
|
+
description: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TString, import("@sinclair/typebox").TNull]>;
|
|
15
|
+
price: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TString, import("@sinclair/typebox").TNull]>;
|
|
16
|
+
location: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TString, import("@sinclair/typebox").TNull]>;
|
|
17
|
+
webpageUrl: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TString, import("@sinclair/typebox").TNull]>;
|
|
18
|
+
facebookUrl: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TString, import("@sinclair/typebox").TNull]>;
|
|
19
|
+
signupsPublic: import("@sinclair/typebox").TBoolean;
|
|
20
|
+
}>, import("@sinclair/typebox").TObject<{
|
|
21
|
+
draft: import("@sinclair/typebox").TBoolean;
|
|
22
|
+
listed: import("@sinclair/typebox").TBoolean;
|
|
23
|
+
}>]>, import("@sinclair/typebox").TObject<{
|
|
24
|
+
quotas: import("@sinclair/typebox").TArray<import("@sinclair/typebox").TIntersect<[import("@sinclair/typebox").TIntersect<[import("@sinclair/typebox").TObject<{
|
|
25
|
+
id: import("@sinclair/typebox").TString;
|
|
26
|
+
}>, import("@sinclair/typebox").TObject<{
|
|
27
|
+
title: import("@sinclair/typebox").TString;
|
|
28
|
+
size: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TInteger, import("@sinclair/typebox").TNull]>;
|
|
29
|
+
}>]>, import("@sinclair/typebox").TObject<{
|
|
30
|
+
signupCount: import("@sinclair/typebox").TInteger;
|
|
31
|
+
}>]>>;
|
|
32
|
+
}>]>;
|
|
33
|
+
/** Response schema for fetching a list of events from the admin API. */
|
|
34
|
+
export declare const adminEventListResponse: import("@sinclair/typebox").TArray<import("@sinclair/typebox").TIntersect<[import("@sinclair/typebox").TObject<{
|
|
35
|
+
id: import("@sinclair/typebox").TString;
|
|
36
|
+
}>, import("@sinclair/typebox").TIntersect<[import("@sinclair/typebox").TObject<{
|
|
37
|
+
title: import("@sinclair/typebox").TString;
|
|
38
|
+
slug: import("@sinclair/typebox").TString;
|
|
39
|
+
date: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TString, import("@sinclair/typebox").TNull]>;
|
|
40
|
+
endDate: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TString, import("@sinclair/typebox").TNull]>;
|
|
41
|
+
registrationStartDate: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TString, import("@sinclair/typebox").TNull]>;
|
|
42
|
+
registrationEndDate: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TString, import("@sinclair/typebox").TNull]>;
|
|
43
|
+
openQuotaSize: import("@sinclair/typebox").TInteger;
|
|
44
|
+
category: import("@sinclair/typebox").TString;
|
|
45
|
+
description: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TString, import("@sinclair/typebox").TNull]>;
|
|
46
|
+
price: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TString, import("@sinclair/typebox").TNull]>;
|
|
47
|
+
location: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TString, import("@sinclair/typebox").TNull]>;
|
|
48
|
+
webpageUrl: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TString, import("@sinclair/typebox").TNull]>;
|
|
49
|
+
facebookUrl: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TString, import("@sinclair/typebox").TNull]>;
|
|
50
|
+
signupsPublic: import("@sinclair/typebox").TBoolean;
|
|
51
|
+
}>, import("@sinclair/typebox").TObject<{
|
|
52
|
+
draft: import("@sinclair/typebox").TBoolean;
|
|
53
|
+
listed: import("@sinclair/typebox").TBoolean;
|
|
54
|
+
}>]>, import("@sinclair/typebox").TObject<{
|
|
55
|
+
quotas: import("@sinclair/typebox").TArray<import("@sinclair/typebox").TIntersect<[import("@sinclair/typebox").TIntersect<[import("@sinclair/typebox").TObject<{
|
|
56
|
+
id: import("@sinclair/typebox").TString;
|
|
57
|
+
}>, import("@sinclair/typebox").TObject<{
|
|
58
|
+
title: import("@sinclair/typebox").TString;
|
|
59
|
+
size: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TInteger, import("@sinclair/typebox").TNull]>;
|
|
60
|
+
}>]>, import("@sinclair/typebox").TObject<{
|
|
61
|
+
signupCount: import("@sinclair/typebox").TInteger;
|
|
62
|
+
}>]>>;
|
|
63
|
+
}>]>>;
|
|
64
|
+
/** Schema for an item of an event list from the public API. */
|
|
65
|
+
declare const userEventListItemSchema: import("@sinclair/typebox").TIntersect<[import("@sinclair/typebox").TObject<{
|
|
66
|
+
id: import("@sinclair/typebox").TString;
|
|
67
|
+
}>, import("@sinclair/typebox").TObject<{
|
|
68
|
+
title: import("@sinclair/typebox").TString;
|
|
69
|
+
slug: import("@sinclair/typebox").TString;
|
|
70
|
+
date: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TString, import("@sinclair/typebox").TNull]>;
|
|
71
|
+
endDate: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TString, import("@sinclair/typebox").TNull]>;
|
|
72
|
+
registrationStartDate: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TString, import("@sinclair/typebox").TNull]>;
|
|
73
|
+
registrationEndDate: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TString, import("@sinclair/typebox").TNull]>;
|
|
74
|
+
openQuotaSize: import("@sinclair/typebox").TInteger;
|
|
75
|
+
category: import("@sinclair/typebox").TString;
|
|
76
|
+
description: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TString, import("@sinclair/typebox").TNull]>;
|
|
77
|
+
price: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TString, import("@sinclair/typebox").TNull]>;
|
|
78
|
+
location: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TString, import("@sinclair/typebox").TNull]>;
|
|
79
|
+
webpageUrl: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TString, import("@sinclair/typebox").TNull]>;
|
|
80
|
+
facebookUrl: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TString, import("@sinclair/typebox").TNull]>;
|
|
81
|
+
signupsPublic: import("@sinclair/typebox").TBoolean;
|
|
82
|
+
}>, import("@sinclair/typebox").TObject<{
|
|
83
|
+
quotas: import("@sinclair/typebox").TArray<import("@sinclair/typebox").TIntersect<[import("@sinclair/typebox").TIntersect<[import("@sinclair/typebox").TObject<{
|
|
84
|
+
id: import("@sinclair/typebox").TString;
|
|
85
|
+
}>, import("@sinclair/typebox").TObject<{
|
|
86
|
+
title: import("@sinclair/typebox").TString;
|
|
87
|
+
size: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TInteger, import("@sinclair/typebox").TNull]>;
|
|
88
|
+
}>]>, import("@sinclair/typebox").TObject<{
|
|
89
|
+
signupCount: import("@sinclair/typebox").TInteger;
|
|
90
|
+
}>]>>;
|
|
91
|
+
}>]>;
|
|
92
|
+
/** Response schema for fetching a list of events from the public API. */
|
|
93
|
+
export declare const userEventListResponse: import("@sinclair/typebox").TArray<import("@sinclair/typebox").TIntersect<[import("@sinclair/typebox").TObject<{
|
|
94
|
+
id: import("@sinclair/typebox").TString;
|
|
95
|
+
}>, import("@sinclair/typebox").TObject<{
|
|
96
|
+
title: import("@sinclair/typebox").TString;
|
|
97
|
+
slug: import("@sinclair/typebox").TString;
|
|
98
|
+
date: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TString, import("@sinclair/typebox").TNull]>;
|
|
99
|
+
endDate: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TString, import("@sinclair/typebox").TNull]>;
|
|
100
|
+
registrationStartDate: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TString, import("@sinclair/typebox").TNull]>;
|
|
101
|
+
registrationEndDate: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TString, import("@sinclair/typebox").TNull]>;
|
|
102
|
+
openQuotaSize: import("@sinclair/typebox").TInteger;
|
|
103
|
+
category: import("@sinclair/typebox").TString;
|
|
104
|
+
description: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TString, import("@sinclair/typebox").TNull]>;
|
|
105
|
+
price: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TString, import("@sinclair/typebox").TNull]>;
|
|
106
|
+
location: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TString, import("@sinclair/typebox").TNull]>;
|
|
107
|
+
webpageUrl: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TString, import("@sinclair/typebox").TNull]>;
|
|
108
|
+
facebookUrl: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TString, import("@sinclair/typebox").TNull]>;
|
|
109
|
+
signupsPublic: import("@sinclair/typebox").TBoolean;
|
|
110
|
+
}>, import("@sinclair/typebox").TObject<{
|
|
111
|
+
quotas: import("@sinclair/typebox").TArray<import("@sinclair/typebox").TIntersect<[import("@sinclair/typebox").TIntersect<[import("@sinclair/typebox").TObject<{
|
|
112
|
+
id: import("@sinclair/typebox").TString;
|
|
113
|
+
}>, import("@sinclair/typebox").TObject<{
|
|
114
|
+
title: import("@sinclair/typebox").TString;
|
|
115
|
+
size: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TInteger, import("@sinclair/typebox").TNull]>;
|
|
116
|
+
}>]>, import("@sinclair/typebox").TObject<{
|
|
117
|
+
signupCount: import("@sinclair/typebox").TInteger;
|
|
118
|
+
}>]>>;
|
|
119
|
+
}>]>>;
|
|
120
|
+
/** Query parameters applicable to the public event list API. */
|
|
121
|
+
export declare const eventListQuery: import("@sinclair/typebox").TObject<{
|
|
122
|
+
category: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
|
123
|
+
}>;
|
|
124
|
+
/** Query parameters applicable to the public event list API. */
|
|
125
|
+
export type EventListQuery = Static<typeof eventListQuery>;
|
|
126
|
+
/** Response schema for fetching a list of events from the public API. */
|
|
127
|
+
export type UserEventListResponse = Static<typeof userEventListResponse>;
|
|
128
|
+
/** Schema for an item of an event list from the public API. */
|
|
129
|
+
export type UserEventListItem = Static<typeof userEventListItemSchema>;
|
|
130
|
+
/** Response schema for fetching a list of events from the admin API. */
|
|
131
|
+
export type AdminEventListResponse = Static<typeof adminEventListResponse>;
|
|
132
|
+
/** Schema for an item of an event list from the admin API. */
|
|
133
|
+
export type AdminEventListItem = Static<typeof adminEventListItemSchema>;
|
|
134
|
+
export {};
|
|
135
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/schema/eventList/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAQ,MAAM,mBAAmB,CAAC;AAKjD,8DAA8D;AAC9D,QAAA,MAAM,wBAAwB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAS5B,CAAC;AAEH,wEAAwE;AACxE,eAAO,MAAM,sBAAsB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KAAuC,CAAC;AAE3E,+DAA+D;AAC/D,QAAA,MAAM,uBAAuB;;;;;;;;;;;;;;;;;;;;;;;;;;IAS3B,CAAC;AAEH,yEAAyE;AACzE,eAAO,MAAM,qBAAqB;;;;;;;;;;;;;;;;;;;;;;;;;;KAAsC,CAAC;AAEzE,gEAAgE;AAChE,eAAO,MAAM,cAAc;;EAIzB,CAAC;AAEH,gEAAgE;AAChE,MAAM,MAAM,cAAc,GAAG,MAAM,CAAC,OAAO,cAAc,CAAC,CAAC;AAE3D,yEAAyE;AACzE,MAAM,MAAM,qBAAqB,GAAG,MAAM,CAAC,OAAO,qBAAqB,CAAC,CAAC;AACzE,+DAA+D;AAC/D,MAAM,MAAM,iBAAiB,GAAG,MAAM,CAAC,OAAO,uBAAuB,CAAC,CAAC;AACvE,wEAAwE;AACxE,MAAM,MAAM,sBAAsB,GAAG,MAAM,CAAC,OAAO,sBAAsB,CAAC,CAAC;AAC3E,8DAA8D;AAC9D,MAAM,MAAM,kBAAkB,GAAG,MAAM,CAAC,OAAO,wBAAwB,CAAC,CAAC"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.eventListQuery = exports.userEventListResponse = exports.adminEventListResponse = void 0;
|
|
4
|
+
const typebox_1 = require("@sinclair/typebox");
|
|
5
|
+
const attributes_1 = require("../event/attributes");
|
|
6
|
+
const quotaWithSignups_1 = require("../quotaWithSignups");
|
|
7
|
+
/** Schema for an item of an event list from the admin API. */
|
|
8
|
+
const adminEventListItemSchema = typebox_1.Type.Intersect([
|
|
9
|
+
attributes_1.eventIdentity,
|
|
10
|
+
attributes_1.adminListEventAttributes,
|
|
11
|
+
typebox_1.Type.Object({
|
|
12
|
+
quotas: typebox_1.Type.Array(quotaWithSignups_1.quotaWithSignupCount, { description: 'The quotas in this event, with signup counts.' }),
|
|
13
|
+
}),
|
|
14
|
+
]);
|
|
15
|
+
/** Response schema for fetching a list of events from the admin API. */
|
|
16
|
+
exports.adminEventListResponse = typebox_1.Type.Array(adminEventListItemSchema);
|
|
17
|
+
/** Schema for an item of an event list from the public API. */
|
|
18
|
+
const userEventListItemSchema = typebox_1.Type.Intersect([
|
|
19
|
+
attributes_1.eventIdentity,
|
|
20
|
+
attributes_1.userListEventAttributes,
|
|
21
|
+
typebox_1.Type.Object({
|
|
22
|
+
quotas: typebox_1.Type.Array(quotaWithSignups_1.quotaWithSignupCount, { description: 'The quotas in this event, with signup counts.' }),
|
|
23
|
+
}),
|
|
24
|
+
]);
|
|
25
|
+
/** Response schema for fetching a list of events from the public API. */
|
|
26
|
+
exports.userEventListResponse = typebox_1.Type.Array(userEventListItemSchema);
|
|
27
|
+
/** Query parameters applicable to the public event list API. */
|
|
28
|
+
exports.eventListQuery = typebox_1.Type.Object({
|
|
29
|
+
category: typebox_1.Type.Optional(typebox_1.Type.String({
|
|
30
|
+
description: 'If set, only events with the provided category are included.',
|
|
31
|
+
})),
|
|
32
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"headers.d.ts","sourceRoot":"","sources":["../../src/schema/headers.ts"],"names":[],"mappings":"AAAA,iFAAiF;AAEjF,eAAO,MAAM,iBAAiB,EAAE,MAAuB,CAAC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.EDIT_TOKEN_HEADER = void 0;
|
|
4
|
+
/** Name of the header used to authenticate requests using a signup edit token */
|
|
5
|
+
// eslint-disable-next-line import/prefer-default-export
|
|
6
|
+
exports.EDIT_TOKEN_HEADER = 'X-Edit-Token';
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export * from './auditLog';
|
|
2
|
+
export * from './category';
|
|
3
|
+
export * from './errors';
|
|
4
|
+
export * from './event';
|
|
5
|
+
export * from './eventList';
|
|
6
|
+
export * from './headers';
|
|
7
|
+
export * from './login';
|
|
8
|
+
export * from './question';
|
|
9
|
+
export * from './quota';
|
|
10
|
+
export * from './quotaWithSignups';
|
|
11
|
+
export * from './signup';
|
|
12
|
+
export * from './signupForEdit';
|
|
13
|
+
export * from './slug';
|
|
14
|
+
export * from './user';
|
|
15
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/schema/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAC;AAC3B,cAAc,YAAY,CAAC;AAC3B,cAAc,UAAU,CAAC;AACzB,cAAc,SAAS,CAAC;AACxB,cAAc,aAAa,CAAC;AAC5B,cAAc,WAAW,CAAC;AAC1B,cAAc,SAAS,CAAC;AACxB,cAAc,YAAY,CAAC;AAC3B,cAAc,SAAS,CAAC;AACxB,cAAc,oBAAoB,CAAC;AACnC,cAAc,UAAU,CAAC;AACzB,cAAc,iBAAiB,CAAC;AAChC,cAAc,QAAQ,CAAC;AACvB,cAAc,QAAQ,CAAC"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./auditLog"), exports);
|
|
18
|
+
__exportStar(require("./category"), exports);
|
|
19
|
+
__exportStar(require("./errors"), exports);
|
|
20
|
+
__exportStar(require("./event"), exports);
|
|
21
|
+
__exportStar(require("./eventList"), exports);
|
|
22
|
+
__exportStar(require("./headers"), exports);
|
|
23
|
+
__exportStar(require("./login"), exports);
|
|
24
|
+
__exportStar(require("./question"), exports);
|
|
25
|
+
__exportStar(require("./quota"), exports);
|
|
26
|
+
__exportStar(require("./quotaWithSignups"), exports);
|
|
27
|
+
__exportStar(require("./signup"), exports);
|
|
28
|
+
__exportStar(require("./signupForEdit"), exports);
|
|
29
|
+
__exportStar(require("./slug"), exports);
|
|
30
|
+
__exportStar(require("./user"), exports);
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { Static } from '@sinclair/typebox';
|
|
2
|
+
/** Request body for login. */
|
|
3
|
+
export declare const adminLoginBody: import("@sinclair/typebox").TObject<{
|
|
4
|
+
email: import("@sinclair/typebox").TString;
|
|
5
|
+
password: import("@sinclair/typebox").TString;
|
|
6
|
+
}>;
|
|
7
|
+
/** Response schema for a successful login. */
|
|
8
|
+
export declare const adminLoginResponse: import("@sinclair/typebox").TObject<{
|
|
9
|
+
accessToken: import("@sinclair/typebox").TString;
|
|
10
|
+
}>;
|
|
11
|
+
/** Request body for login. */
|
|
12
|
+
export type AdminLoginBody = Static<typeof adminLoginBody>;
|
|
13
|
+
/** Response schema for a successful login. */
|
|
14
|
+
export type AdminLoginResponse = Static<typeof adminLoginResponse>;
|
|
15
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/schema/login/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAQ,MAAM,mBAAmB,CAAC;AAEjD,8BAA8B;AAC9B,eAAO,MAAM,cAAc;;;EAOzB,CAAC;AACH,8CAA8C;AAC9C,eAAO,MAAM,kBAAkB;;EAI7B,CAAC;AAEH,8BAA8B;AAC9B,MAAM,MAAM,cAAc,GAAG,MAAM,CAAC,OAAO,cAAc,CAAC,CAAC;AAC3D,8CAA8C;AAC9C,MAAM,MAAM,kBAAkB,GAAG,MAAM,CAAC,OAAO,kBAAkB,CAAC,CAAC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.adminLoginResponse = exports.adminLoginBody = void 0;
|
|
4
|
+
const typebox_1 = require("@sinclair/typebox");
|
|
5
|
+
/** Request body for login. */
|
|
6
|
+
exports.adminLoginBody = typebox_1.Type.Object({
|
|
7
|
+
email: typebox_1.Type.String({
|
|
8
|
+
description: 'Email address.',
|
|
9
|
+
}),
|
|
10
|
+
password: typebox_1.Type.String({
|
|
11
|
+
description: 'Plaintext password.',
|
|
12
|
+
}),
|
|
13
|
+
});
|
|
14
|
+
/** Response schema for a successful login. */
|
|
15
|
+
exports.adminLoginResponse = typebox_1.Type.Object({
|
|
16
|
+
accessToken: typebox_1.Type.String({
|
|
17
|
+
description: 'JWT access token. Used in `Authorization` header to authorize requests.',
|
|
18
|
+
}),
|
|
19
|
+
});
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { QuestionType } from '../../enum';
|
|
2
|
+
export declare const questionID: import("@sinclair/typebox").TString;
|
|
3
|
+
/** Non-editable identity attributes of a question. */
|
|
4
|
+
export declare const questionIdentity: import("@sinclair/typebox").TObject<{
|
|
5
|
+
id: import("@sinclair/typebox").TString;
|
|
6
|
+
}>;
|
|
7
|
+
/** Editable attributes of a question. */
|
|
8
|
+
export declare const questionAttributes: import("@sinclair/typebox").TObject<{
|
|
9
|
+
question: import("@sinclair/typebox").TString;
|
|
10
|
+
type: import("@sinclair/typebox").TEnum<typeof QuestionType>;
|
|
11
|
+
options: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TArray<import("@sinclair/typebox").TString>, import("@sinclair/typebox").TNull]>;
|
|
12
|
+
required: import("@sinclair/typebox").TBoolean;
|
|
13
|
+
public: import("@sinclair/typebox").TBoolean;
|
|
14
|
+
}>;
|
|
15
|
+
//# sourceMappingURL=attributes.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"attributes.d.ts","sourceRoot":"","sources":["../../../src/schema/question/attributes.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAG1C,eAAO,MAAM,UAAU,qCAGrB,CAAC;AAEH,sDAAsD;AACtD,eAAO,MAAM,gBAAgB;;EAE3B,CAAC;AAEH,yCAAyC;AACzC,eAAO,MAAM,kBAAkB;;;;;;EAkB7B,CAAC"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.questionAttributes = exports.questionIdentity = exports.questionID = void 0;
|
|
4
|
+
const typebox_1 = require("@sinclair/typebox");
|
|
5
|
+
const enum_1 = require("../../enum");
|
|
6
|
+
const utils_1 = require("../utils");
|
|
7
|
+
exports.questionID = typebox_1.Type.String({
|
|
8
|
+
title: 'QuestionID',
|
|
9
|
+
description: 'Question ID. Randomly generated alphanumeric string.',
|
|
10
|
+
});
|
|
11
|
+
/** Non-editable identity attributes of a question. */
|
|
12
|
+
exports.questionIdentity = typebox_1.Type.Object({
|
|
13
|
+
id: exports.questionID,
|
|
14
|
+
});
|
|
15
|
+
/** Editable attributes of a question. */
|
|
16
|
+
exports.questionAttributes = typebox_1.Type.Object({
|
|
17
|
+
question: typebox_1.Type.String({
|
|
18
|
+
description: 'The question shown to attendees.',
|
|
19
|
+
}),
|
|
20
|
+
type: typebox_1.Type.Enum(enum_1.QuestionType, {
|
|
21
|
+
title: 'QuestionType',
|
|
22
|
+
description: 'The type of answer expected.',
|
|
23
|
+
}),
|
|
24
|
+
options: (0, utils_1.Nullable)(typebox_1.Type.Array(typebox_1.Type.String()), { description: 'For select or checkbox questions, the options available.' }),
|
|
25
|
+
required: typebox_1.Type.Boolean({
|
|
26
|
+
description: 'Whether to require an answer to this question from all attendees.',
|
|
27
|
+
}),
|
|
28
|
+
public: typebox_1.Type.Boolean({
|
|
29
|
+
description: 'Whether to show the answers to this question publicly.',
|
|
30
|
+
}),
|
|
31
|
+
});
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { Static } from '@sinclair/typebox';
|
|
2
|
+
import { questionID } from './attributes';
|
|
3
|
+
export { questionID } from './attributes';
|
|
4
|
+
/** Schema for a question. */
|
|
5
|
+
export declare const question: import("@sinclair/typebox").TIntersect<[import("@sinclair/typebox").TObject<{
|
|
6
|
+
id: import("@sinclair/typebox").TString;
|
|
7
|
+
}>, import("@sinclair/typebox").TObject<{
|
|
8
|
+
question: import("@sinclair/typebox").TString;
|
|
9
|
+
type: import("@sinclair/typebox").TEnum<typeof import("../..").QuestionType>;
|
|
10
|
+
options: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TArray<import("@sinclair/typebox").TString>, import("@sinclair/typebox").TNull]>;
|
|
11
|
+
required: import("@sinclair/typebox").TBoolean;
|
|
12
|
+
public: import("@sinclair/typebox").TBoolean;
|
|
13
|
+
}>]>;
|
|
14
|
+
/** Schema for creating a question. */
|
|
15
|
+
export declare const questionCreate: import("@sinclair/typebox").TObject<{
|
|
16
|
+
question: import("@sinclair/typebox").TString;
|
|
17
|
+
type: import("@sinclair/typebox").TEnum<typeof import("../..").QuestionType>;
|
|
18
|
+
options: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TArray<import("@sinclair/typebox").TString>, import("@sinclair/typebox").TNull]>;
|
|
19
|
+
required: import("@sinclair/typebox").TBoolean;
|
|
20
|
+
public: import("@sinclair/typebox").TBoolean;
|
|
21
|
+
}>;
|
|
22
|
+
/** Schema for updating a question. */
|
|
23
|
+
export declare const questionUpdate: import("@sinclair/typebox").TIntersect<[import("@sinclair/typebox").TObject<{
|
|
24
|
+
id: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
|
25
|
+
}>, import("@sinclair/typebox").TObject<{
|
|
26
|
+
question: import("@sinclair/typebox").TString;
|
|
27
|
+
type: import("@sinclair/typebox").TEnum<typeof import("../..").QuestionType>;
|
|
28
|
+
options: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TArray<import("@sinclair/typebox").TString>, import("@sinclair/typebox").TNull]>;
|
|
29
|
+
required: import("@sinclair/typebox").TBoolean;
|
|
30
|
+
public: import("@sinclair/typebox").TBoolean;
|
|
31
|
+
}>]>;
|
|
32
|
+
/** Question ID type. Randomly generated alphanumeric string. */
|
|
33
|
+
export type QuestionID = Static<typeof questionID>;
|
|
34
|
+
/** Schema for a question. */
|
|
35
|
+
export type Question = Static<typeof question>;
|
|
36
|
+
/** Schema for updating a question. */
|
|
37
|
+
export type QuestionUpdate = Static<typeof questionUpdate>;
|
|
38
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/schema/question/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAQ,MAAM,mBAAmB,CAAC;AAEjD,OAAO,EAAsB,UAAU,EAAoB,MAAM,cAAc,CAAC;AAEhF,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAE1C,6BAA6B;AAC7B,eAAO,MAAM,QAAQ;;;;;;;;IAGnB,CAAC;AAEH,sCAAsC;AACtC,eAAO,MAAM,cAAc;;;;;;EAAqB,CAAC;AAEjD,sCAAsC;AACtC,eAAO,MAAM,cAAc;;;;;;;;IAM1B,CAAC;AAEF,gEAAgE;AAChE,MAAM,MAAM,UAAU,GAAG,MAAM,CAAC,OAAO,UAAU,CAAC,CAAC;AACnD,6BAA6B;AAC7B,MAAM,MAAM,QAAQ,GAAG,MAAM,CAAC,OAAO,QAAQ,CAAC,CAAC;AAC/C,sCAAsC;AACtC,MAAM,MAAM,cAAc,GAAG,MAAM,CAAC,OAAO,cAAc,CAAC,CAAC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.questionUpdate = exports.questionCreate = exports.question = exports.questionID = void 0;
|
|
4
|
+
const typebox_1 = require("@sinclair/typebox");
|
|
5
|
+
const attributes_1 = require("./attributes");
|
|
6
|
+
var attributes_2 = require("./attributes");
|
|
7
|
+
Object.defineProperty(exports, "questionID", { enumerable: true, get: function () { return attributes_2.questionID; } });
|
|
8
|
+
/** Schema for a question. */
|
|
9
|
+
exports.question = typebox_1.Type.Intersect([
|
|
10
|
+
attributes_1.questionIdentity,
|
|
11
|
+
attributes_1.questionAttributes,
|
|
12
|
+
]);
|
|
13
|
+
/** Schema for creating a question. */
|
|
14
|
+
exports.questionCreate = attributes_1.questionAttributes;
|
|
15
|
+
/** Schema for updating a question. */
|
|
16
|
+
exports.questionUpdate = typebox_1.Type.Intersect([
|
|
17
|
+
typebox_1.Type.Partial(attributes_1.questionIdentity),
|
|
18
|
+
exports.questionCreate,
|
|
19
|
+
], { description: 'Set id to reuse an existing question, or leave it empty to create a new one.' });
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export declare const quotaID: import("@sinclair/typebox").TString;
|
|
2
|
+
/** Non-editable identity attributes of a quota. */
|
|
3
|
+
export declare const quotaIdentity: import("@sinclair/typebox").TObject<{
|
|
4
|
+
id: import("@sinclair/typebox").TString;
|
|
5
|
+
}>;
|
|
6
|
+
/** Editable attributes of a quota. */
|
|
7
|
+
export declare const quotaAttributes: import("@sinclair/typebox").TObject<{
|
|
8
|
+
title: import("@sinclair/typebox").TString;
|
|
9
|
+
size: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TInteger, import("@sinclair/typebox").TNull]>;
|
|
10
|
+
}>;
|
|
11
|
+
//# sourceMappingURL=attributes.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"attributes.d.ts","sourceRoot":"","sources":["../../../src/schema/quota/attributes.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,OAAO,qCAIlB,CAAC;AAEH,mDAAmD;AACnD,eAAO,MAAM,aAAa;;EAExB,CAAC;AAEH,sCAAsC;AACtC,eAAO,MAAM,eAAe;;;EAQ1B,CAAC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.quotaAttributes = exports.quotaIdentity = exports.quotaID = void 0;
|
|
4
|
+
const typebox_1 = require("@sinclair/typebox");
|
|
5
|
+
const utils_1 = require("../utils");
|
|
6
|
+
exports.quotaID = typebox_1.Type.String({
|
|
7
|
+
title: 'QuotaID',
|
|
8
|
+
description: 'Quota ID. Randomly generated alphanumeric string.',
|
|
9
|
+
// TODO: Add validation? max-length?
|
|
10
|
+
});
|
|
11
|
+
/** Non-editable identity attributes of a quota. */
|
|
12
|
+
exports.quotaIdentity = typebox_1.Type.Object({
|
|
13
|
+
id: exports.quotaID,
|
|
14
|
+
});
|
|
15
|
+
/** Editable attributes of a quota. */
|
|
16
|
+
exports.quotaAttributes = typebox_1.Type.Object({
|
|
17
|
+
title: typebox_1.Type.String({
|
|
18
|
+
description: 'Quota name.',
|
|
19
|
+
}),
|
|
20
|
+
size: (0, utils_1.Nullable)(typebox_1.Type.Integer({ minimum: 1 }), { description: 'Maximum number of signups in the quota. If null, the size is unlimited.' }),
|
|
21
|
+
});
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { Static } from '@sinclair/typebox';
|
|
2
|
+
import { quotaID } from './attributes';
|
|
3
|
+
export { quotaID } from './attributes';
|
|
4
|
+
/** Schema for a quota. */
|
|
5
|
+
export declare const quota: import("@sinclair/typebox").TIntersect<[import("@sinclair/typebox").TObject<{
|
|
6
|
+
id: import("@sinclair/typebox").TString;
|
|
7
|
+
}>, import("@sinclair/typebox").TObject<{
|
|
8
|
+
title: import("@sinclair/typebox").TString;
|
|
9
|
+
size: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TInteger, import("@sinclair/typebox").TNull]>;
|
|
10
|
+
}>]>;
|
|
11
|
+
/** Schema for creating a quota. */
|
|
12
|
+
export declare const quotaCreate: import("@sinclair/typebox").TObject<{
|
|
13
|
+
title: import("@sinclair/typebox").TString;
|
|
14
|
+
size: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TInteger, import("@sinclair/typebox").TNull]>;
|
|
15
|
+
}>;
|
|
16
|
+
/** Schema for updating a quota. */
|
|
17
|
+
export declare const quotaUpdate: import("@sinclair/typebox").TIntersect<[import("@sinclair/typebox").TObject<{
|
|
18
|
+
id: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
|
19
|
+
}>, import("@sinclair/typebox").TObject<{
|
|
20
|
+
title: import("@sinclair/typebox").TString;
|
|
21
|
+
size: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TInteger, import("@sinclair/typebox").TNull]>;
|
|
22
|
+
}>]>;
|
|
23
|
+
/** Quota ID type. Randomly generated alphanumeric string. */
|
|
24
|
+
export type QuotaID = Static<typeof quotaID>;
|
|
25
|
+
/** Schema for updating a quota. */
|
|
26
|
+
export type QuotaUpdate = Static<typeof quotaUpdate>;
|
|
27
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/schema/quota/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAQ,MAAM,mBAAmB,CAAC;AAEjD,OAAO,EAAmB,OAAO,EAAiB,MAAM,cAAc,CAAC;AAEvE,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAEvC,0BAA0B;AAC1B,eAAO,MAAM,KAAK;;;;;IAGhB,CAAC;AAEH,mCAAmC;AACnC,eAAO,MAAM,WAAW;;;EAAkB,CAAC;AAE3C,mCAAmC;AACnC,eAAO,MAAM,WAAW;;;;;IAMvB,CAAC;AAEF,6DAA6D;AAC7D,MAAM,MAAM,OAAO,GAAG,MAAM,CAAC,OAAO,OAAO,CAAC,CAAC;AAE7C,mCAAmC;AACnC,MAAM,MAAM,WAAW,GAAG,MAAM,CAAC,OAAO,WAAW,CAAC,CAAC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.quotaUpdate = exports.quotaCreate = exports.quota = exports.quotaID = void 0;
|
|
4
|
+
const typebox_1 = require("@sinclair/typebox");
|
|
5
|
+
const attributes_1 = require("./attributes");
|
|
6
|
+
var attributes_2 = require("./attributes");
|
|
7
|
+
Object.defineProperty(exports, "quotaID", { enumerable: true, get: function () { return attributes_2.quotaID; } });
|
|
8
|
+
/** Schema for a quota. */
|
|
9
|
+
exports.quota = typebox_1.Type.Intersect([
|
|
10
|
+
attributes_1.quotaIdentity,
|
|
11
|
+
attributes_1.quotaAttributes,
|
|
12
|
+
]);
|
|
13
|
+
/** Schema for creating a quota. */
|
|
14
|
+
exports.quotaCreate = attributes_1.quotaAttributes;
|
|
15
|
+
/** Schema for updating a quota. */
|
|
16
|
+
exports.quotaUpdate = typebox_1.Type.Intersect([
|
|
17
|
+
typebox_1.Type.Partial(attributes_1.quotaIdentity),
|
|
18
|
+
exports.quotaCreate,
|
|
19
|
+
], { description: 'Set id to reuse an existing quota, or leave it empty to create a new one.' });
|