@tietokilta/ilmomasiina-models 2.0.0-alpha4 → 2.0.0-alpha41
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 +0 -2
- package/dist/attrs/event.d.ts +17 -0
- package/dist/attrs/event.d.ts.map +1 -0
- package/dist/attrs/event.js +61 -0
- package/dist/enum.d.ts +54 -0
- package/dist/enum.d.ts.map +1 -0
- package/dist/enum.js +61 -0
- package/dist/index.d.ts +2 -8
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +16 -0
- package/dist/models/answer.d.ts +5 -5
- package/dist/models/answer.d.ts.map +1 -1
- package/dist/models/auditlog.d.ts +2 -1
- package/dist/models/auditlog.d.ts.map +1 -1
- package/dist/models/index.d.ts +8 -0
- package/dist/models/index.d.ts.map +1 -0
- package/dist/models/question.d.ts +4 -5
- package/dist/models/question.d.ts.map +1 -1
- package/dist/models/question.js +0 -2
- package/dist/models/quota.d.ts +2 -2
- package/dist/models/signup.d.ts +4 -4
- package/dist/models/signup.d.ts.map +1 -1
- package/dist/models/signup.js +0 -2
- 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 +42 -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 +41 -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 +55 -0
- package/dist/schema/errors/index.d.ts.map +1 -0
- package/dist/schema/errors/index.js +54 -0
- package/dist/schema/event/attributes.d.ts +90 -0
- package/dist/schema/event/attributes.d.ts.map +1 -0
- package/dist/schema/event/attributes.js +113 -0
- package/dist/schema/event/index.d.ts +233 -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 +118 -0
- package/dist/schema/eventList/index.d.ts.map +1 -0
- package/dist/schema/eventList/index.js +39 -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 +16 -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 +37 -0
- package/dist/schema/question/index.d.ts +36 -0
- package/dist/schema/question/index.d.ts.map +1 -0
- package/dist/schema/question/index.js +15 -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 +25 -0
- package/dist/schema/quota/index.d.ts +25 -0
- package/dist/schema/quota/index.d.ts.map +1 -0
- package/dist/schema/quota/index.js +15 -0
- package/dist/schema/quotaWithSignups/index.d.ts +57 -0
- package/dist/schema/quotaWithSignups/index.d.ts.map +1 -0
- package/dist/schema/quotaWithSignups/index.js +33 -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 +83 -0
- package/dist/schema/signup/index.d.ts +112 -0
- package/dist/schema/signup/index.d.ts.map +1 -0
- package/dist/schema/signup/index.js +45 -0
- package/dist/schema/signupForEdit/index.d.ts +81 -0
- package/dist/schema/signupForEdit/index.d.ts.map +1 -0
- package/dist/schema/signupForEdit/index.js +28 -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 +19 -0
- package/dist/schema/user/attributes.d.ts +14 -0
- package/dist/schema/user/attributes.d.ts.map +1 -0
- package/dist/schema/user/attributes.js +27 -0
- package/dist/schema/user/index.d.ts +45 -0
- package/dist/schema/user/index.d.ts.map +1 -0
- package/dist/schema/user/index.js +27 -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 +6 -3
- package/dist/services/admin/categories/index.d.ts +0 -7
- package/dist/services/admin/categories/index.d.ts.map +0 -1
- package/dist/services/admin/categories/list.d.ts +0 -2
- package/dist/services/admin/categories/list.d.ts.map +0 -1
- package/dist/services/admin/categories/list.js +0 -2
- package/dist/services/admin/events/create.d.ts +0 -15
- package/dist/services/admin/events/create.d.ts.map +0 -1
- package/dist/services/admin/events/create.js +0 -38
- package/dist/services/admin/events/index.d.ts +0 -32
- package/dist/services/admin/events/index.d.ts.map +0 -1
- package/dist/services/admin/events/index.js +0 -2
- package/dist/services/admin/events/update.d.ts +0 -17
- package/dist/services/admin/events/update.d.ts.map +0 -1
- package/dist/services/admin/events/update.js +0 -2
- package/dist/services/admin/slug/get.d.ts +0 -6
- package/dist/services/admin/slug/get.d.ts.map +0 -1
- package/dist/services/admin/slug/get.js +0 -2
- package/dist/services/admin/slug/index.d.ts +0 -7
- package/dist/services/admin/slug/index.d.ts.map +0 -1
- package/dist/services/admin/slug/index.js +0 -2
- package/dist/services/auditlog/index.d.ts +0 -26
- package/dist/services/auditlog/index.d.ts.map +0 -1
- package/dist/services/auditlog/index.js +0 -2
- package/dist/services/auth/index.d.ts +0 -18
- package/dist/services/auth/index.d.ts.map +0 -1
- package/dist/services/auth/index.js +0 -2
- package/dist/services/events/details.d.ts +0 -45
- package/dist/services/events/details.d.ts.map +0 -1
- package/dist/services/events/details.js +0 -67
- package/dist/services/events/index.d.ts +0 -26
- package/dist/services/events/index.d.ts.map +0 -1
- package/dist/services/events/index.js +0 -2
- package/dist/services/events/list.d.ts +0 -18
- package/dist/services/events/list.d.ts.map +0 -1
- package/dist/services/events/list.js +0 -26
- package/dist/services/signups/create.d.ts +0 -10
- package/dist/services/signups/create.d.ts.map +0 -1
- package/dist/services/signups/create.js +0 -2
- package/dist/services/signups/getForEdit.d.ts +0 -29
- package/dist/services/signups/getForEdit.d.ts.map +0 -1
- package/dist/services/signups/getForEdit.js +0 -29
- package/dist/services/signups/index.d.ts +0 -28
- package/dist/services/signups/index.d.ts.map +0 -1
- package/dist/services/signups/index.js +0 -2
- package/dist/services/signups/update.d.ts +0 -19
- package/dist/services/signups/update.d.ts.map +0 -1
- package/dist/services/signups/update.js +0 -2
- package/dist/services/users/details.d.ts +0 -10
- package/dist/services/users/details.d.ts.map +0 -1
- package/dist/services/users/details.js +0 -5
- package/dist/services/users/index.d.ts +0 -13
- package/dist/services/users/index.d.ts.map +0 -1
- package/dist/services/users/index.js +0 -2
- package/dist/utils.d.ts +0 -5
- package/dist/utils.d.ts.map +0 -1
- package/dist/utils.js +0 -2
- /package/dist/{services/admin/categories → models}/index.js +0 -0
package/README.md
CHANGED
|
@@ -4,8 +4,6 @@ This package provides type definitions for the [Ilmomasiina](https://github.com/
|
|
|
4
4
|
|
|
5
5
|
Frontend developers should import the supported types directly from `@tietokilta/ilmomasiina-models`. The files in
|
|
6
6
|
`dist` are not part of the public interface and are only to be used by the backend.
|
|
7
|
-
(The frontend code in this repository deviates from this rule due to our monorepo setup – please update your
|
|
8
|
-
imports if you fork our frontend without the backend.)
|
|
9
7
|
|
|
10
8
|
**Note:** This package follows the versioning of Ilmomasiina. We will avoid breaking changes in the API, but minor
|
|
11
9
|
versions may occasionally be incompatible with each other. If writing custom frontends, we recommend fixing the
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/** Attributes included in GET /api/events/ID for Event instances. */
|
|
2
|
+
export declare const eventGetEventAttrs: string[];
|
|
3
|
+
/** Attributes included in GET /api/admin/events/ID for Event instances. */
|
|
4
|
+
export declare const adminEventGetEventAttrs: string[];
|
|
5
|
+
/** Attributes included in results for Question instances. */
|
|
6
|
+
export declare const eventGetQuestionAttrs: string[];
|
|
7
|
+
/** Attributes included in results for Quota instances. */
|
|
8
|
+
export declare const eventGetQuotaAttrs: string[];
|
|
9
|
+
/** Attributes included in GET /api/events/ID for Signup instances. */
|
|
10
|
+
export declare const eventGetSignupAttrs: string[];
|
|
11
|
+
/** Attributes included in results for Answer instances. */
|
|
12
|
+
export declare const eventGetAnswerAttrs: string[];
|
|
13
|
+
/** Attributes included in GET /api/events for Event instances. */
|
|
14
|
+
export declare const eventListEventAttrs: string[];
|
|
15
|
+
/** Attributes included in GET /api/admin/events for Event instances. */
|
|
16
|
+
export declare const adminEventListEventAttrs: string[];
|
|
17
|
+
//# sourceMappingURL=event.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"event.d.ts","sourceRoot":"","sources":["../../src/attrs/event.ts"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,eAAO,MAAM,kBAAkB,UAkB9B,CAAC;AAEF,2EAA2E;AAC3E,eAAO,MAAM,uBAAuB,UAA+E,CAAC;AAEpH,6DAA6D;AAC7D,eAAO,MAAM,qBAAqB,UAA8D,CAAC;AAEjG,0DAA0D;AAC1D,eAAO,MAAM,kBAAkB,UAA0B,CAAC;AAE1D,sEAAsE;AACtE,eAAO,MAAM,mBAAmB,UAQ/B,CAAC;AAEF,2DAA2D;AAC3D,eAAO,MAAM,mBAAmB,UAA2B,CAAC;AAE5D,kEAAkE;AAClE,eAAO,MAAM,mBAAmB,UAgB/B,CAAC;AAEF,wEAAwE;AACxE,eAAO,MAAM,wBAAwB,UAA8C,CAAC"}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.adminEventListEventAttrs = exports.eventListEventAttrs = exports.eventGetAnswerAttrs = exports.eventGetSignupAttrs = exports.eventGetQuotaAttrs = exports.eventGetQuestionAttrs = exports.adminEventGetEventAttrs = exports.eventGetEventAttrs = void 0;
|
|
4
|
+
/** Attributes included in GET /api/events/ID for Event instances. */
|
|
5
|
+
exports.eventGetEventAttrs = [
|
|
6
|
+
"id",
|
|
7
|
+
"title",
|
|
8
|
+
"slug",
|
|
9
|
+
"date",
|
|
10
|
+
"endDate",
|
|
11
|
+
"registrationStartDate",
|
|
12
|
+
"registrationEndDate",
|
|
13
|
+
"openQuotaSize",
|
|
14
|
+
"description",
|
|
15
|
+
"price",
|
|
16
|
+
"location",
|
|
17
|
+
"webpageUrl",
|
|
18
|
+
"facebookUrl",
|
|
19
|
+
"category",
|
|
20
|
+
"signupsPublic",
|
|
21
|
+
"nameQuestion",
|
|
22
|
+
"emailQuestion",
|
|
23
|
+
];
|
|
24
|
+
/** Attributes included in GET /api/admin/events/ID for Event instances. */
|
|
25
|
+
exports.adminEventGetEventAttrs = [...exports.eventGetEventAttrs, "draft", "listed", "verificationEmail", "updatedAt"];
|
|
26
|
+
/** Attributes included in results for Question instances. */
|
|
27
|
+
exports.eventGetQuestionAttrs = ["id", "question", "type", "options", "required", "public"];
|
|
28
|
+
/** Attributes included in results for Quota instances. */
|
|
29
|
+
exports.eventGetQuotaAttrs = ["id", "title", "size"];
|
|
30
|
+
/** Attributes included in GET /api/events/ID for Signup instances. */
|
|
31
|
+
exports.eventGetSignupAttrs = [
|
|
32
|
+
"firstName",
|
|
33
|
+
"lastName",
|
|
34
|
+
"namePublic",
|
|
35
|
+
"status",
|
|
36
|
+
"position",
|
|
37
|
+
"createdAt",
|
|
38
|
+
"confirmedAt",
|
|
39
|
+
];
|
|
40
|
+
/** Attributes included in results for Answer instances. */
|
|
41
|
+
exports.eventGetAnswerAttrs = ["questionId", "answer"];
|
|
42
|
+
/** Attributes included in GET /api/events for Event instances. */
|
|
43
|
+
exports.eventListEventAttrs = [
|
|
44
|
+
"id",
|
|
45
|
+
"slug",
|
|
46
|
+
"title",
|
|
47
|
+
"date",
|
|
48
|
+
"endDate",
|
|
49
|
+
"registrationStartDate",
|
|
50
|
+
"registrationEndDate",
|
|
51
|
+
"openQuotaSize",
|
|
52
|
+
"description",
|
|
53
|
+
"price",
|
|
54
|
+
"location",
|
|
55
|
+
"webpageUrl",
|
|
56
|
+
"facebookUrl",
|
|
57
|
+
"category",
|
|
58
|
+
"signupsPublic",
|
|
59
|
+
];
|
|
60
|
+
/** Attributes included in GET /api/admin/events for Event instances. */
|
|
61
|
+
exports.adminEventListEventAttrs = [...exports.eventListEventAttrs, "draft", "listed"];
|
package/dist/enum.d.ts
ADDED
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
/** Possible statuses for a signup. */
|
|
2
|
+
export declare enum SignupStatus {
|
|
3
|
+
IN_QUOTA = "in-quota",
|
|
4
|
+
IN_OPEN_QUOTA = "in-open",
|
|
5
|
+
IN_QUEUE = "in-queue"
|
|
6
|
+
}
|
|
7
|
+
/** Possible question types. */
|
|
8
|
+
export declare enum QuestionType {
|
|
9
|
+
TEXT = "text",
|
|
10
|
+
TEXT_AREA = "textarea",
|
|
11
|
+
NUMBER = "number",
|
|
12
|
+
SELECT = "select",
|
|
13
|
+
CHECKBOX = "checkbox"
|
|
14
|
+
}
|
|
15
|
+
/** Event types that can be audit logged. */
|
|
16
|
+
export declare enum AuditEvent {
|
|
17
|
+
CREATE_EVENT = "event.create",
|
|
18
|
+
DELETE_EVENT = "event.delete",
|
|
19
|
+
PUBLISH_EVENT = "event.publish",
|
|
20
|
+
UNPUBLISH_EVENT = "event.unpublish",
|
|
21
|
+
EDIT_EVENT = "event.edit",
|
|
22
|
+
PROMOTE_SIGNUP = "signup.queuePromote",
|
|
23
|
+
CREATE_SIGNUP = "signup.create",
|
|
24
|
+
DELETE_SIGNUP = "signup.delete",
|
|
25
|
+
EDIT_SIGNUP = "signup.edit",
|
|
26
|
+
CREATE_USER = "user.create",
|
|
27
|
+
DELETE_USER = "user.delete",
|
|
28
|
+
RESET_PASSWORD = "user.resetpassword",
|
|
29
|
+
CHANGE_PASSWORD = "user.changepassword"
|
|
30
|
+
}
|
|
31
|
+
export declare enum ErrorCode {
|
|
32
|
+
BAD_SESSION = "BadSession",
|
|
33
|
+
EDIT_CONFLICT = "EditConflict",
|
|
34
|
+
WOULD_MOVE_SIGNUPS_TO_QUEUE = "WouldMoveSignupsToQueue",
|
|
35
|
+
WRONG_OLD_PASSWORD = "WrongOldPassword",
|
|
36
|
+
SIGNUPS_CLOSED = "SignupsClosed",
|
|
37
|
+
NO_SUCH_QUOTA = "NoSuchQuota",
|
|
38
|
+
NO_SUCH_SIGNUP = "NoSuchSignup",
|
|
39
|
+
BAD_EDIT_TOKEN = "BadEditToken",
|
|
40
|
+
CANNOT_DELETE_SELF = "CannotDeleteSelf",
|
|
41
|
+
INITIAL_SETUP_NEEDED = "InitialSetupNeeded",
|
|
42
|
+
INITIAL_SETUP_ALREADY_DONE = "InitialSetupAlreadyDone",
|
|
43
|
+
SIGNUP_VALIDATION_ERROR = "SignupValidationError",
|
|
44
|
+
VALIDATION_ERROR = "FST_ERR_VALIDATION"
|
|
45
|
+
}
|
|
46
|
+
export declare enum SignupFieldError {
|
|
47
|
+
MISSING = "missing",
|
|
48
|
+
WRONG_TYPE = "wrongType",
|
|
49
|
+
TOO_LONG = "tooLong",
|
|
50
|
+
INVALID_EMAIL = "invalidEmail",
|
|
51
|
+
NOT_A_NUMBER = "notANumber",
|
|
52
|
+
NOT_AN_OPTION = "notAnOption"
|
|
53
|
+
}
|
|
54
|
+
//# sourceMappingURL=enum.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"enum.d.ts","sourceRoot":"","sources":["../src/enum.ts"],"names":[],"mappings":"AAAA,sCAAsC;AACtC,oBAAY,YAAY;IACtB,QAAQ,aAAa;IACrB,aAAa,YAAY;IACzB,QAAQ,aAAa;CACtB;AAED,+BAA+B;AAC/B,oBAAY,YAAY;IACtB,IAAI,SAAS;IACb,SAAS,aAAa;IACtB,MAAM,WAAW;IACjB,MAAM,WAAW;IACjB,QAAQ,aAAa;CACtB;AAED,4CAA4C;AAC5C,oBAAY,UAAU;IACpB,YAAY,iBAAiB;IAC7B,YAAY,iBAAiB;IAC7B,aAAa,kBAAkB;IAC/B,eAAe,oBAAoB;IACnC,UAAU,eAAe;IACzB,cAAc,wBAAwB;IACtC,aAAa,kBAAkB;IAC/B,aAAa,kBAAkB;IAC/B,WAAW,gBAAgB;IAC3B,WAAW,gBAAgB;IAC3B,WAAW,gBAAgB;IAC3B,cAAc,uBAAuB;IACrC,eAAe,wBAAwB;CACxC;AAED,oBAAY,SAAS;IACnB,WAAW,eAAe;IAC1B,aAAa,iBAAiB;IAC9B,2BAA2B,4BAA4B;IACvD,kBAAkB,qBAAqB;IACvC,cAAc,kBAAkB;IAChC,aAAa,gBAAgB;IAC7B,cAAc,iBAAiB;IAC/B,cAAc,iBAAiB;IAC/B,kBAAkB,qBAAqB;IACvC,oBAAoB,uBAAuB;IAC3C,0BAA0B,4BAA4B;IACtD,uBAAuB,0BAA0B;IACjD,gBAAgB,uBAAuB;CACxC;AAED,oBAAY,gBAAgB;IAC1B,OAAO,YAAY;IACnB,UAAU,cAAc;IACxB,QAAQ,YAAY;IACpB,aAAa,iBAAiB;IAC9B,YAAY,eAAe;IAC3B,aAAa,gBAAgB;CAC9B"}
|
package/dist/enum.js
ADDED
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.SignupFieldError = exports.ErrorCode = exports.AuditEvent = exports.QuestionType = exports.SignupStatus = void 0;
|
|
4
|
+
/** Possible statuses for a signup. */
|
|
5
|
+
var SignupStatus;
|
|
6
|
+
(function (SignupStatus) {
|
|
7
|
+
SignupStatus["IN_QUOTA"] = "in-quota";
|
|
8
|
+
SignupStatus["IN_OPEN_QUOTA"] = "in-open";
|
|
9
|
+
SignupStatus["IN_QUEUE"] = "in-queue";
|
|
10
|
+
})(SignupStatus || (exports.SignupStatus = SignupStatus = {}));
|
|
11
|
+
/** Possible question types. */
|
|
12
|
+
var QuestionType;
|
|
13
|
+
(function (QuestionType) {
|
|
14
|
+
QuestionType["TEXT"] = "text";
|
|
15
|
+
QuestionType["TEXT_AREA"] = "textarea";
|
|
16
|
+
QuestionType["NUMBER"] = "number";
|
|
17
|
+
QuestionType["SELECT"] = "select";
|
|
18
|
+
QuestionType["CHECKBOX"] = "checkbox";
|
|
19
|
+
})(QuestionType || (exports.QuestionType = QuestionType = {}));
|
|
20
|
+
/** Event types that can be audit logged. */
|
|
21
|
+
var AuditEvent;
|
|
22
|
+
(function (AuditEvent) {
|
|
23
|
+
AuditEvent["CREATE_EVENT"] = "event.create";
|
|
24
|
+
AuditEvent["DELETE_EVENT"] = "event.delete";
|
|
25
|
+
AuditEvent["PUBLISH_EVENT"] = "event.publish";
|
|
26
|
+
AuditEvent["UNPUBLISH_EVENT"] = "event.unpublish";
|
|
27
|
+
AuditEvent["EDIT_EVENT"] = "event.edit";
|
|
28
|
+
AuditEvent["PROMOTE_SIGNUP"] = "signup.queuePromote";
|
|
29
|
+
AuditEvent["CREATE_SIGNUP"] = "signup.create";
|
|
30
|
+
AuditEvent["DELETE_SIGNUP"] = "signup.delete";
|
|
31
|
+
AuditEvent["EDIT_SIGNUP"] = "signup.edit";
|
|
32
|
+
AuditEvent["CREATE_USER"] = "user.create";
|
|
33
|
+
AuditEvent["DELETE_USER"] = "user.delete";
|
|
34
|
+
AuditEvent["RESET_PASSWORD"] = "user.resetpassword";
|
|
35
|
+
AuditEvent["CHANGE_PASSWORD"] = "user.changepassword";
|
|
36
|
+
})(AuditEvent || (exports.AuditEvent = AuditEvent = {}));
|
|
37
|
+
var ErrorCode;
|
|
38
|
+
(function (ErrorCode) {
|
|
39
|
+
ErrorCode["BAD_SESSION"] = "BadSession";
|
|
40
|
+
ErrorCode["EDIT_CONFLICT"] = "EditConflict";
|
|
41
|
+
ErrorCode["WOULD_MOVE_SIGNUPS_TO_QUEUE"] = "WouldMoveSignupsToQueue";
|
|
42
|
+
ErrorCode["WRONG_OLD_PASSWORD"] = "WrongOldPassword";
|
|
43
|
+
ErrorCode["SIGNUPS_CLOSED"] = "SignupsClosed";
|
|
44
|
+
ErrorCode["NO_SUCH_QUOTA"] = "NoSuchQuota";
|
|
45
|
+
ErrorCode["NO_SUCH_SIGNUP"] = "NoSuchSignup";
|
|
46
|
+
ErrorCode["BAD_EDIT_TOKEN"] = "BadEditToken";
|
|
47
|
+
ErrorCode["CANNOT_DELETE_SELF"] = "CannotDeleteSelf";
|
|
48
|
+
ErrorCode["INITIAL_SETUP_NEEDED"] = "InitialSetupNeeded";
|
|
49
|
+
ErrorCode["INITIAL_SETUP_ALREADY_DONE"] = "InitialSetupAlreadyDone";
|
|
50
|
+
ErrorCode["SIGNUP_VALIDATION_ERROR"] = "SignupValidationError";
|
|
51
|
+
ErrorCode["VALIDATION_ERROR"] = "FST_ERR_VALIDATION";
|
|
52
|
+
})(ErrorCode || (exports.ErrorCode = ErrorCode = {}));
|
|
53
|
+
var SignupFieldError;
|
|
54
|
+
(function (SignupFieldError) {
|
|
55
|
+
SignupFieldError["MISSING"] = "missing";
|
|
56
|
+
SignupFieldError["WRONG_TYPE"] = "wrongType";
|
|
57
|
+
SignupFieldError["TOO_LONG"] = "tooLong";
|
|
58
|
+
SignupFieldError["INVALID_EMAIL"] = "invalidEmail";
|
|
59
|
+
SignupFieldError["NOT_A_NUMBER"] = "notANumber";
|
|
60
|
+
SignupFieldError["NOT_AN_OPTION"] = "notAnOption";
|
|
61
|
+
})(SignupFieldError || (exports.SignupFieldError = SignupFieldError = {}));
|
package/dist/index.d.ts
CHANGED
|
@@ -1,9 +1,3 @@
|
|
|
1
|
-
export
|
|
2
|
-
export
|
|
3
|
-
export type { AdminSlug } from './services/admin/slug';
|
|
4
|
-
export type { Auth } from './services/auth';
|
|
5
|
-
export type { AuditLog } from './services/auditlog';
|
|
6
|
-
export type { Event, Question, Quota } from './services/events';
|
|
7
|
-
export type { Signup } from './services/signups';
|
|
8
|
-
export type { User } from './services/users';
|
|
1
|
+
export * from "./enum";
|
|
2
|
+
export * from "./schema";
|
|
9
3
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,QAAQ,CAAC;AACvB,cAAc,UAAU,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -1,2 +1,18 @@
|
|
|
1
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
|
+
};
|
|
2
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./enum"), exports);
|
|
18
|
+
__exportStar(require("./schema"), exports);
|
package/dist/models/answer.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import QuestionAttributes from
|
|
2
|
-
import SignupAttributes from
|
|
1
|
+
import QuestionAttributes from "./question";
|
|
2
|
+
import SignupAttributes from "./signup";
|
|
3
3
|
export default interface AnswerAttributes {
|
|
4
4
|
id: string;
|
|
5
|
-
answer: string;
|
|
6
|
-
questionId: QuestionAttributes[
|
|
7
|
-
signupId: SignupAttributes[
|
|
5
|
+
answer: string | string[];
|
|
6
|
+
questionId: QuestionAttributes["id"];
|
|
7
|
+
signupId: SignupAttributes["id"];
|
|
8
8
|
}
|
|
9
9
|
//# sourceMappingURL=answer.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"answer.d.ts","sourceRoot":"","sources":["../../src/models/answer.ts"],"names":[],"mappings":"AAAA,OAAO,kBAAkB,MAAM,YAAY,CAAC;AAC5C,OAAO,gBAAgB,MAAM,UAAU,CAAC;AAExC,MAAM,CAAC,OAAO,WAAW,gBAAgB;IACvC,EAAE,EAAE,MAAM,CAAC;IACX,MAAM,EAAE,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"answer.d.ts","sourceRoot":"","sources":["../../src/models/answer.ts"],"names":[],"mappings":"AAAA,OAAO,kBAAkB,MAAM,YAAY,CAAC;AAC5C,OAAO,gBAAgB,MAAM,UAAU,CAAC;AAExC,MAAM,CAAC,OAAO,WAAW,gBAAgB;IACvC,EAAE,EAAE,MAAM,CAAC;IACX,MAAM,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC;IAC1B,UAAU,EAAE,kBAAkB,CAAC,IAAI,CAAC,CAAC;IACrC,QAAQ,EAAE,gBAAgB,CAAC,IAAI,CAAC,CAAC;CAClC"}
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
+
import { AuditEvent } from "../enum";
|
|
1
2
|
export default interface AuditLogAttributes {
|
|
2
3
|
id: number;
|
|
3
4
|
user: string | null;
|
|
4
5
|
ipAddress: string;
|
|
5
|
-
action:
|
|
6
|
+
action: AuditEvent;
|
|
6
7
|
eventId: string | null;
|
|
7
8
|
eventName: string | null;
|
|
8
9
|
signupId: string | null;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"auditlog.d.ts","sourceRoot":"","sources":["../../src/models/auditlog.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,OAAO,WAAW,kBAAkB;IACzC,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;IACpB,SAAS,EAAE,MAAM,CAAC;IAClB,MAAM,EAAE,
|
|
1
|
+
{"version":3,"file":"auditlog.d.ts","sourceRoot":"","sources":["../../src/models/auditlog.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAErC,MAAM,CAAC,OAAO,WAAW,kBAAkB;IACzC,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;IACpB,SAAS,EAAE,MAAM,CAAC;IAClB,MAAM,EAAE,UAAU,CAAC;IACnB,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;IACvB,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;IACxB,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1B,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;CACtB"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export type { default as AnswerAttributes } from "./answer";
|
|
2
|
+
export type { default as AuditLogAttributes } from "./auditlog";
|
|
3
|
+
export type { default as EventAttributes } from "./event";
|
|
4
|
+
export type { default as QuestionAttributes } from "./question";
|
|
5
|
+
export type { default as QuotaAttributes } from "./quota";
|
|
6
|
+
export type { default as SignupAttributes } from "./signup";
|
|
7
|
+
export type { default as UserAttributes } from "./user";
|
|
8
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/models/index.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,OAAO,IAAI,gBAAgB,EAAE,MAAM,UAAU,CAAC;AAC5D,YAAY,EAAE,OAAO,IAAI,kBAAkB,EAAE,MAAM,YAAY,CAAC;AAChE,YAAY,EAAE,OAAO,IAAI,eAAe,EAAE,MAAM,SAAS,CAAC;AAC1D,YAAY,EAAE,OAAO,IAAI,kBAAkB,EAAE,MAAM,YAAY,CAAC;AAChE,YAAY,EAAE,OAAO,IAAI,eAAe,EAAE,MAAM,SAAS,CAAC;AAC1D,YAAY,EAAE,OAAO,IAAI,gBAAgB,EAAE,MAAM,UAAU,CAAC;AAC5D,YAAY,EAAE,OAAO,IAAI,cAAc,EAAE,MAAM,QAAQ,CAAC"}
|
|
@@ -1,14 +1,13 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
export declare type QuestionType = typeof questionTypes[number];
|
|
1
|
+
import { QuestionType } from "../enum";
|
|
2
|
+
import EventAttributes from "./event";
|
|
4
3
|
export default interface QuestionAttributes {
|
|
5
4
|
id: string;
|
|
6
5
|
order: number;
|
|
7
6
|
question: string;
|
|
8
7
|
type: QuestionType;
|
|
9
|
-
options: string | null;
|
|
8
|
+
options: string[] | null;
|
|
10
9
|
required: boolean;
|
|
11
10
|
public: boolean;
|
|
12
|
-
eventId: EventAttributes[
|
|
11
|
+
eventId: EventAttributes["id"];
|
|
13
12
|
}
|
|
14
13
|
//# sourceMappingURL=question.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"question.d.ts","sourceRoot":"","sources":["../../src/models/question.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"question.d.ts","sourceRoot":"","sources":["../../src/models/question.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACvC,OAAO,eAAe,MAAM,SAAS,CAAC;AAEtC,MAAM,CAAC,OAAO,WAAW,kBAAkB;IACzC,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,MAAM,CAAC;IACjB,IAAI,EAAE,YAAY,CAAC;IACnB,OAAO,EAAE,MAAM,EAAE,GAAG,IAAI,CAAC;IACzB,QAAQ,EAAE,OAAO,CAAC;IAClB,MAAM,EAAE,OAAO,CAAC;IAChB,OAAO,EAAE,eAAe,CAAC,IAAI,CAAC,CAAC;CAChC"}
|
package/dist/models/question.js
CHANGED
package/dist/models/quota.d.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import EventAttributes from
|
|
1
|
+
import EventAttributes from "./event";
|
|
2
2
|
export default interface QuotaAttributes {
|
|
3
3
|
id: string;
|
|
4
4
|
order: number;
|
|
5
5
|
title: string;
|
|
6
6
|
size: number | null;
|
|
7
|
-
eventId: EventAttributes[
|
|
7
|
+
eventId: EventAttributes["id"];
|
|
8
8
|
signupCount?: number;
|
|
9
9
|
}
|
|
10
10
|
//# sourceMappingURL=quota.d.ts.map
|
package/dist/models/signup.d.ts
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
export declare type SignupStatus = typeof signupStatuses[number];
|
|
1
|
+
import { SignupStatus } from "../enum";
|
|
2
|
+
import QuotaAttributes from "./quota";
|
|
4
3
|
export default interface SignupAttributes {
|
|
5
4
|
id: string;
|
|
6
5
|
firstName: string | null;
|
|
7
6
|
lastName: string | null;
|
|
8
7
|
namePublic: boolean;
|
|
9
8
|
email: string | null;
|
|
9
|
+
language: string | null;
|
|
10
10
|
confirmedAt: Date | null;
|
|
11
11
|
status: SignupStatus | null;
|
|
12
12
|
position: number | null;
|
|
13
13
|
createdAt: Date;
|
|
14
|
-
quotaId: QuotaAttributes[
|
|
14
|
+
quotaId: QuotaAttributes["id"];
|
|
15
15
|
}
|
|
16
16
|
//# sourceMappingURL=signup.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"signup.d.ts","sourceRoot":"","sources":["../../src/models/signup.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"signup.d.ts","sourceRoot":"","sources":["../../src/models/signup.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACvC,OAAO,eAAe,MAAM,SAAS,CAAC;AAEtC,MAAM,CAAC,OAAO,WAAW,gBAAgB;IACvC,EAAE,EAAE,MAAM,CAAC;IACX,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;IACxB,UAAU,EAAE,OAAO,CAAC;IACpB,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;IACxB,WAAW,EAAE,IAAI,GAAG,IAAI,CAAC;IACzB,MAAM,EAAE,YAAY,GAAG,IAAI,CAAC;IAC5B,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;IACxB,SAAS,EAAE,IAAI,CAAC;IAChB,OAAO,EAAE,eAAe,CAAC,IAAI,CAAC,CAAC;CAChC"}
|
package/dist/models/signup.js
CHANGED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { AuditEvent } from "../../enum";
|
|
2
|
+
/** Schema for an audit log item. */
|
|
3
|
+
export declare const auditLogItemAttributes: import("@sinclair/typebox").TObject<{
|
|
4
|
+
id: import("@sinclair/typebox").TInteger;
|
|
5
|
+
user: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TString, import("@sinclair/typebox").TNull]>;
|
|
6
|
+
ipAddress: import("@sinclair/typebox").TString;
|
|
7
|
+
action: import("@sinclair/typebox").TEnum<typeof AuditEvent>;
|
|
8
|
+
eventId: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TString, import("@sinclair/typebox").TNull]>;
|
|
9
|
+
eventName: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TString, import("@sinclair/typebox").TNull]>;
|
|
10
|
+
signupId: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TString, import("@sinclair/typebox").TNull]>;
|
|
11
|
+
signupName: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TString, import("@sinclair/typebox").TNull]>;
|
|
12
|
+
extra: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TString, import("@sinclair/typebox").TNull]>;
|
|
13
|
+
createdAt: import("@sinclair/typebox").TString;
|
|
14
|
+
}>;
|
|
15
|
+
//# sourceMappingURL=attributes.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"attributes.d.ts","sourceRoot":"","sources":["../../../src/schema/auditLog/attributes.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAKxC,oCAAoC;AACpC,eAAO,MAAM,sBAAsB;;;;;;;;;;;EAiCjC,CAAC"}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.auditLogItemAttributes = void 0;
|
|
4
|
+
const typebox_1 = require("@sinclair/typebox");
|
|
5
|
+
const enum_1 = require("../../enum");
|
|
6
|
+
const utils_1 = require("../utils");
|
|
7
|
+
/* eslint-disable import/prefer-default-export */
|
|
8
|
+
/** Schema for an audit log item. */
|
|
9
|
+
exports.auditLogItemAttributes = typebox_1.Type.Object({
|
|
10
|
+
id: typebox_1.Type.Integer({
|
|
11
|
+
title: "audit log event ID",
|
|
12
|
+
}),
|
|
13
|
+
user: (0, utils_1.Nullable)(typebox_1.Type.String(), {
|
|
14
|
+
description: "Email of the user causing the log event.",
|
|
15
|
+
}),
|
|
16
|
+
ipAddress: typebox_1.Type.String({
|
|
17
|
+
description: "IP address causing the log event.",
|
|
18
|
+
}),
|
|
19
|
+
action: typebox_1.Type.Enum(enum_1.AuditEvent, {
|
|
20
|
+
title: "AuditEvent",
|
|
21
|
+
description: "The type of action logged.",
|
|
22
|
+
}),
|
|
23
|
+
eventId: (0, utils_1.Nullable)(typebox_1.Type.String(), {
|
|
24
|
+
description: "ID of the event related to this log event.",
|
|
25
|
+
}),
|
|
26
|
+
eventName: (0, utils_1.Nullable)(typebox_1.Type.String(), {
|
|
27
|
+
description: "Title of the event related to this log event.",
|
|
28
|
+
}),
|
|
29
|
+
signupId: (0, utils_1.Nullable)(typebox_1.Type.String(), {
|
|
30
|
+
description: "ID of the signup related to this log event.",
|
|
31
|
+
}),
|
|
32
|
+
signupName: (0, utils_1.Nullable)(typebox_1.Type.String(), {
|
|
33
|
+
description: "Name of the signup related to this log event.",
|
|
34
|
+
}),
|
|
35
|
+
extra: (0, utils_1.Nullable)(typebox_1.Type.String(), {
|
|
36
|
+
description: "Additional information related to this log event as JSON.",
|
|
37
|
+
}),
|
|
38
|
+
createdAt: typebox_1.Type.String({
|
|
39
|
+
format: "date-time",
|
|
40
|
+
description: "Timestamp for the log event.",
|
|
41
|
+
}),
|
|
42
|
+
});
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { Static } from "@sinclair/typebox";
|
|
2
|
+
import { AuditEvent } from "../../enum";
|
|
3
|
+
import { auditLogItemAttributes } from "./attributes";
|
|
4
|
+
/** Query parameters applicable to the audit log API. */
|
|
5
|
+
export declare const auditLoqQuery: import("@sinclair/typebox").TObject<{
|
|
6
|
+
user: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
|
7
|
+
ip: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
|
8
|
+
action: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TArray<import("@sinclair/typebox").TEnum<typeof AuditEvent>>>;
|
|
9
|
+
event: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
|
10
|
+
signup: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
|
11
|
+
limit: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TInteger>;
|
|
12
|
+
offset: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TInteger>;
|
|
13
|
+
}>;
|
|
14
|
+
/** Response schema for fetching audit logs. */
|
|
15
|
+
export declare const auditLogResponse: import("@sinclair/typebox").TObject<{
|
|
16
|
+
rows: import("@sinclair/typebox").TArray<import("@sinclair/typebox").TObject<{
|
|
17
|
+
id: import("@sinclair/typebox").TInteger;
|
|
18
|
+
user: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TString, import("@sinclair/typebox").TNull]>;
|
|
19
|
+
ipAddress: import("@sinclair/typebox").TString;
|
|
20
|
+
action: import("@sinclair/typebox").TEnum<typeof AuditEvent>;
|
|
21
|
+
eventId: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TString, import("@sinclair/typebox").TNull]>;
|
|
22
|
+
eventName: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TString, import("@sinclair/typebox").TNull]>;
|
|
23
|
+
signupId: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TString, import("@sinclair/typebox").TNull]>;
|
|
24
|
+
signupName: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TString, import("@sinclair/typebox").TNull]>;
|
|
25
|
+
extra: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TString, import("@sinclair/typebox").TNull]>;
|
|
26
|
+
createdAt: import("@sinclair/typebox").TString;
|
|
27
|
+
}>>;
|
|
28
|
+
count: import("@sinclair/typebox").TInteger;
|
|
29
|
+
}>;
|
|
30
|
+
/** Query parameters applicable to the audit log API. */
|
|
31
|
+
export type AuditLoqQuery = Static<typeof auditLoqQuery>;
|
|
32
|
+
/** Schema for an audit log event. */
|
|
33
|
+
export type AuditLogItemSchema = Static<typeof auditLogItemAttributes>;
|
|
34
|
+
/** Response schema for fetching a audit logs. */
|
|
35
|
+
export type AuditLogResponse = Static<typeof auditLogResponse>;
|
|
36
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/schema/auditLog/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAQ,MAAM,mBAAmB,CAAC;AAEjD,OAAO,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AACxC,OAAO,EAAE,sBAAsB,EAAE,MAAM,cAAc,CAAC;AAEtD,wDAAwD;AACxD,eAAO,MAAM,aAAa;;;;;;;;EAyCxB,CAAC;AAEH,+CAA+C;AAC/C,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;EAK3B,CAAC;AAEH,wDAAwD;AACxD,MAAM,MAAM,aAAa,GAAG,MAAM,CAAC,OAAO,aAAa,CAAC,CAAC;AACzD,qCAAqC;AACrC,MAAM,MAAM,kBAAkB,GAAG,MAAM,CAAC,OAAO,sBAAsB,CAAC,CAAC;AACvE,iDAAiD;AACjD,MAAM,MAAM,gBAAgB,GAAG,MAAM,CAAC,OAAO,gBAAgB,CAAC,CAAC"}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.auditLogResponse = exports.auditLoqQuery = void 0;
|
|
4
|
+
const typebox_1 = require("@sinclair/typebox");
|
|
5
|
+
const enum_1 = require("../../enum");
|
|
6
|
+
const attributes_1 = require("./attributes");
|
|
7
|
+
/** Query parameters applicable to the audit log API. */
|
|
8
|
+
exports.auditLoqQuery = typebox_1.Type.Object({
|
|
9
|
+
user: typebox_1.Type.Optional(typebox_1.Type.String({
|
|
10
|
+
description: "Filter events by username.",
|
|
11
|
+
})),
|
|
12
|
+
ip: typebox_1.Type.Optional(typebox_1.Type.String({
|
|
13
|
+
description: "Filter events by IP address.",
|
|
14
|
+
})),
|
|
15
|
+
action: typebox_1.Type.Optional(typebox_1.Type.Array(
|
|
16
|
+
// TODO: Requires Ajv to be in coerce array mode
|
|
17
|
+
typebox_1.Type.Enum(enum_1.AuditEvent, { description: "Filter events by actions." }))),
|
|
18
|
+
event: typebox_1.Type.Optional(typebox_1.Type.String({
|
|
19
|
+
description: "Filter events by event name or ID.",
|
|
20
|
+
})),
|
|
21
|
+
signup: typebox_1.Type.Optional(typebox_1.Type.String({
|
|
22
|
+
description: "Filter events by signup name or ID.",
|
|
23
|
+
})),
|
|
24
|
+
limit: typebox_1.Type.Optional(typebox_1.Type.Integer({
|
|
25
|
+
minimum: 0,
|
|
26
|
+
default: Number.MAX_SAFE_INTEGER,
|
|
27
|
+
description: "Maximum number of log events to return.",
|
|
28
|
+
})),
|
|
29
|
+
offset: typebox_1.Type.Optional(typebox_1.Type.Integer({
|
|
30
|
+
minimum: 0,
|
|
31
|
+
default: 0,
|
|
32
|
+
description: "Number of log events to skip at the start of results.",
|
|
33
|
+
})),
|
|
34
|
+
});
|
|
35
|
+
/** Response schema for fetching audit logs. */
|
|
36
|
+
exports.auditLogResponse = typebox_1.Type.Object({
|
|
37
|
+
rows: typebox_1.Type.Array(attributes_1.auditLogItemAttributes),
|
|
38
|
+
count: typebox_1.Type.Integer({
|
|
39
|
+
description: "Total number of log events found, including those omitted due to the offset/limit parameters.",
|
|
40
|
+
}),
|
|
41
|
+
});
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { Static } from "@sinclair/typebox";
|
|
2
|
+
/** Type of an event category. */
|
|
3
|
+
export declare const eventCategory: import("@sinclair/typebox").TString;
|
|
4
|
+
/** Response schema for fetching event categories. */
|
|
5
|
+
export declare const categoriesResponse: import("@sinclair/typebox").TArray<import("@sinclair/typebox").TString>;
|
|
6
|
+
/** Type of an event category. */
|
|
7
|
+
export type EventCategory = Static<typeof eventCategory>;
|
|
8
|
+
/** Response schema for fetching event categories. */
|
|
9
|
+
export type CategoriesResponse = Static<typeof categoriesResponse>;
|
|
10
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/schema/category/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAQ,MAAM,mBAAmB,CAAC;AAEjD,iCAAiC;AACjC,eAAO,MAAM,aAAa,qCAExB,CAAC;AAEH,qDAAqD;AACrD,eAAO,MAAM,kBAAkB,yEAA4B,CAAC;AAE5D,iCAAiC;AACjC,MAAM,MAAM,aAAa,GAAG,MAAM,CAAC,OAAO,aAAa,CAAC,CAAC;AACzD,qDAAqD;AACrD,MAAM,MAAM,kBAAkB,GAAG,MAAM,CAAC,OAAO,kBAAkB,CAAC,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.categoriesResponse = exports.eventCategory = void 0;
|
|
4
|
+
const typebox_1 = require("@sinclair/typebox");
|
|
5
|
+
/** Type of an event category. */
|
|
6
|
+
exports.eventCategory = typebox_1.Type.String({
|
|
7
|
+
description: "Category tag for events.",
|
|
8
|
+
});
|
|
9
|
+
/** Response schema for fetching event categories. */
|
|
10
|
+
exports.categoriesResponse = typebox_1.Type.Array(exports.eventCategory);
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { Static } from "@sinclair/typebox";
|
|
2
|
+
import { ErrorCode, SignupFieldError } from "../../enum";
|
|
3
|
+
/** Response schema for a generic error. */
|
|
4
|
+
export declare const errorResponse: import("@sinclair/typebox").TObject<{
|
|
5
|
+
statusCode: import("@sinclair/typebox").TNumber;
|
|
6
|
+
code: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TEnum<typeof ErrorCode>>;
|
|
7
|
+
message: import("@sinclair/typebox").TString;
|
|
8
|
+
}>;
|
|
9
|
+
/** Response schema for an edit conflicting with another edit on the server. */
|
|
10
|
+
export declare const editConflictError: import("@sinclair/typebox").TObject<{
|
|
11
|
+
statusCode: import("@sinclair/typebox").TNumber;
|
|
12
|
+
code: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TEnum<typeof ErrorCode>>;
|
|
13
|
+
message: import("@sinclair/typebox").TString;
|
|
14
|
+
updatedAt: import("@sinclair/typebox").TString;
|
|
15
|
+
deletedQuotas: import("@sinclair/typebox").TArray<import("@sinclair/typebox").TString>;
|
|
16
|
+
deletedQuestions: import("@sinclair/typebox").TArray<import("@sinclair/typebox").TString>;
|
|
17
|
+
}>;
|
|
18
|
+
/** Response schema for an edit that would move some signups back to the queue. */
|
|
19
|
+
export declare const wouldMoveSignupsToQueueError: import("@sinclair/typebox").TObject<{
|
|
20
|
+
statusCode: import("@sinclair/typebox").TNumber;
|
|
21
|
+
code: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TEnum<typeof ErrorCode>>;
|
|
22
|
+
message: import("@sinclair/typebox").TString;
|
|
23
|
+
count: import("@sinclair/typebox").TInteger;
|
|
24
|
+
}>;
|
|
25
|
+
/** Schema for validation errors on a signup. */
|
|
26
|
+
declare const signupValidationErrors: import("@sinclair/typebox").TObject<{
|
|
27
|
+
firstName: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TEnum<typeof SignupFieldError>>;
|
|
28
|
+
lastName: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TEnum<typeof SignupFieldError>>;
|
|
29
|
+
email: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TEnum<typeof SignupFieldError>>;
|
|
30
|
+
answers: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TRecord<import("@sinclair/typebox").TString, import("@sinclair/typebox").TEnum<typeof SignupFieldError>>>;
|
|
31
|
+
}>;
|
|
32
|
+
/** Schema for validation errors on a signup. */
|
|
33
|
+
export type SignupValidationErrors = Static<typeof signupValidationErrors>;
|
|
34
|
+
/** Response schema for an invalid signup edit. */
|
|
35
|
+
export declare const signupValidationError: import("@sinclair/typebox").TObject<{
|
|
36
|
+
statusCode: import("@sinclair/typebox").TNumber;
|
|
37
|
+
code: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TEnum<typeof ErrorCode>>;
|
|
38
|
+
message: import("@sinclair/typebox").TString;
|
|
39
|
+
errors: import("@sinclair/typebox").TObject<{
|
|
40
|
+
firstName: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TEnum<typeof SignupFieldError>>;
|
|
41
|
+
lastName: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TEnum<typeof SignupFieldError>>;
|
|
42
|
+
email: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TEnum<typeof SignupFieldError>>;
|
|
43
|
+
answers: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TRecord<import("@sinclair/typebox").TString, import("@sinclair/typebox").TEnum<typeof SignupFieldError>>>;
|
|
44
|
+
}>;
|
|
45
|
+
}>;
|
|
46
|
+
/** Response schema for a generic error. */
|
|
47
|
+
export type ErrorResponse = Static<typeof errorResponse>;
|
|
48
|
+
/** Response schema for an edit conflicting with another edit on the server. */
|
|
49
|
+
export type EditConflictError = Static<typeof editConflictError>;
|
|
50
|
+
/** Response schema for an edit that would move some signups back to the queue. */
|
|
51
|
+
export type WouldMoveSignupsToQueueError = Static<typeof wouldMoveSignupsToQueueError>;
|
|
52
|
+
/** Response schema for an invalid signup edit. */
|
|
53
|
+
export type SignupValidationError = Static<typeof signupValidationError>;
|
|
54
|
+
export {};
|
|
55
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/schema/errors/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAQ,MAAM,mBAAmB,CAAC;AAEjD,OAAO,EAAE,SAAS,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AAIzD,2CAA2C;AAC3C,eAAO,MAAM,aAAa;;;;EAIxB,CAAC;AAEH,+EAA+E;AAC/E,eAAO,MAAM,iBAAiB;;;;;;;EAc5B,CAAC;AAEH,kFAAkF;AAClF,eAAO,MAAM,4BAA4B;;;;;EAOvC,CAAC;AAEH,gDAAgD;AAChD,QAAA,MAAM,sBAAsB;;;;;EAS1B,CAAC;AAEH,gDAAgD;AAChD,MAAM,MAAM,sBAAsB,GAAG,MAAM,CAAC,OAAO,sBAAsB,CAAC,CAAC;AAE3E,kDAAkD;AAClD,eAAO,MAAM,qBAAqB;;;;;;;;;;EAKhC,CAAC;AAEH,2CAA2C;AAC3C,MAAM,MAAM,aAAa,GAAG,MAAM,CAAC,OAAO,aAAa,CAAC,CAAC;AACzD,+EAA+E;AAC/E,MAAM,MAAM,iBAAiB,GAAG,MAAM,CAAC,OAAO,iBAAiB,CAAC,CAAC;AACjE,kFAAkF;AAClF,MAAM,MAAM,4BAA4B,GAAG,MAAM,CAAC,OAAO,4BAA4B,CAAC,CAAC;AACvF,kDAAkD;AAClD,MAAM,MAAM,qBAAqB,GAAG,MAAM,CAAC,OAAO,qBAAqB,CAAC,CAAC"}
|