@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,32 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.userPathParams = exports.userListResponse = exports.userSchema = exports.userChangePasswordSchema = exports.userInviteSchema = exports.userCreateSchema = void 0;
|
|
4
|
+
const typebox_1 = require("@sinclair/typebox");
|
|
5
|
+
const attributes_1 = require("./attributes");
|
|
6
|
+
/** Request body for creating an admin user. */
|
|
7
|
+
exports.userCreateSchema = typebox_1.Type.Intersect([
|
|
8
|
+
attributes_1.userAttributes,
|
|
9
|
+
typebox_1.Type.Object({
|
|
10
|
+
password: attributes_1.password,
|
|
11
|
+
}),
|
|
12
|
+
]);
|
|
13
|
+
/** Request body for inviting an admin user. */
|
|
14
|
+
exports.userInviteSchema = typebox_1.Type.Intersect([
|
|
15
|
+
attributes_1.userAttributes,
|
|
16
|
+
]);
|
|
17
|
+
/** Request body for changing the user's own password. */
|
|
18
|
+
exports.userChangePasswordSchema = typebox_1.Type.Object({
|
|
19
|
+
oldPassword: typebox_1.Type.String(),
|
|
20
|
+
newPassword: attributes_1.password,
|
|
21
|
+
});
|
|
22
|
+
/** Schema for a user. */
|
|
23
|
+
exports.userSchema = typebox_1.Type.Intersect([
|
|
24
|
+
attributes_1.userIdentity,
|
|
25
|
+
attributes_1.userAttributes,
|
|
26
|
+
]);
|
|
27
|
+
/** Response schema for fetching a list of users. */
|
|
28
|
+
exports.userListResponse = typebox_1.Type.Array(exports.userSchema);
|
|
29
|
+
/** Path parameters necessary to fetch and manipulate users. */
|
|
30
|
+
exports.userPathParams = typebox_1.Type.Object({
|
|
31
|
+
id: attributes_1.userID,
|
|
32
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/schema/utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,OAAO,EAAQ,MAAM,mBAAmB,CAAC;AAGjE,eAAO,MAAM,QAAQ,yCAA0C,aAAa,+EAE3E,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Nullable = void 0;
|
|
4
|
+
const typebox_1 = require("@sinclair/typebox");
|
|
5
|
+
// eslint-disable-next-line import/prefer-default-export
|
|
6
|
+
const Nullable = (type, options) => (typebox_1.Type.Union([type, typebox_1.Type.Null()], options));
|
|
7
|
+
exports.Nullable = Nullable;
|
package/package.json
CHANGED
|
@@ -1,19 +1,36 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tietokilta/ilmomasiina-models",
|
|
3
|
-
"version": "2.0.0-
|
|
3
|
+
"version": "2.0.0-alpha21",
|
|
4
4
|
"repository": {
|
|
5
5
|
"type": "git",
|
|
6
6
|
"url": "git+https://github.com/Tietokilta/ilmomasiina.git"
|
|
7
7
|
},
|
|
8
|
-
"types": "dist/index.d.ts",
|
|
9
8
|
"license": "MIT",
|
|
9
|
+
"main": "dist/index.js",
|
|
10
|
+
"types": "dist/index.d.ts",
|
|
11
|
+
"exports": {
|
|
12
|
+
".": {
|
|
13
|
+
"types": "./dist/index.d.ts",
|
|
14
|
+
"node": "./dist/index.js",
|
|
15
|
+
"import": "./dist/index.js"
|
|
16
|
+
},
|
|
17
|
+
"./dist/*": {
|
|
18
|
+
"types": "./dist/*.d.ts",
|
|
19
|
+
"import": "./dist/*.js",
|
|
20
|
+
"node": "./dist/*.js"
|
|
21
|
+
},
|
|
22
|
+
"./src/*": "./src/*.ts"
|
|
23
|
+
},
|
|
10
24
|
"devDependencies": {
|
|
11
|
-
"rimraf": "^
|
|
12
|
-
"typescript": "~
|
|
25
|
+
"rimraf": "^5.0.5",
|
|
26
|
+
"typescript": "~5.2.2"
|
|
27
|
+
},
|
|
28
|
+
"dependencies": {
|
|
29
|
+
"@sinclair/typebox": "^0.32.14"
|
|
13
30
|
},
|
|
14
31
|
"scripts": {
|
|
15
32
|
"build": "tsc --build",
|
|
16
33
|
"clean": "rimraf dist",
|
|
17
|
-
"typecheck": "tsc --
|
|
34
|
+
"typecheck": "tsc --build"
|
|
18
35
|
}
|
|
19
36
|
}
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import { StringifyApi } from '../../../utils';
|
|
2
|
-
import { AdminListCategoriesResponse } from './list';
|
|
3
|
-
export declare type AdminCategoriesServiceTypes = AdminListCategoriesResponse;
|
|
4
|
-
export declare namespace AdminCategory {
|
|
5
|
-
type List = StringifyApi<AdminListCategoriesResponse>;
|
|
6
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare type AdminListCategoriesResponse = string[];
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import EventAttributes from '../../../models/event';
|
|
2
|
-
import QuestionAttributes from '../../../models/question';
|
|
3
|
-
import QuotaAttributes from '../../../models/quota';
|
|
4
|
-
export declare const adminEventCreateEventAttrs: readonly ["title", "slug", "date", "endDate", "registrationStartDate", "registrationEndDate", "openQuotaSize", "description", "price", "location", "webpageUrl", "facebookUrl", "category", "draft", "listed", "signupsPublic", "nameQuestion", "emailQuestion", "verificationEmail"];
|
|
5
|
-
export declare const adminEventCreateQuestionAttrs: readonly ["question", "type", "options", "required", "public"];
|
|
6
|
-
export declare const adminEventCreateQuotaAttrs: readonly ["title", "size"];
|
|
7
|
-
export interface AdminEventCreateQuestion extends Pick<QuestionAttributes, typeof adminEventCreateQuestionAttrs[number]> {
|
|
8
|
-
}
|
|
9
|
-
export interface AdminEventCreateQuota extends Pick<QuotaAttributes, typeof adminEventCreateQuotaAttrs[number]> {
|
|
10
|
-
}
|
|
11
|
-
export interface AdminEventCreateBody extends Pick<EventAttributes, typeof adminEventCreateEventAttrs[number]> {
|
|
12
|
-
questions: AdminEventCreateQuestion[];
|
|
13
|
-
quotas: AdminEventCreateQuota[];
|
|
14
|
-
}
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.adminEventCreateQuotaAttrs = exports.adminEventCreateQuestionAttrs = exports.adminEventCreateEventAttrs = void 0;
|
|
4
|
-
// Attributes included in POST /api/events for Event instances.
|
|
5
|
-
exports.adminEventCreateEventAttrs = [
|
|
6
|
-
'title',
|
|
7
|
-
'slug',
|
|
8
|
-
'date',
|
|
9
|
-
'endDate',
|
|
10
|
-
'registrationStartDate',
|
|
11
|
-
'registrationEndDate',
|
|
12
|
-
'openQuotaSize',
|
|
13
|
-
'description',
|
|
14
|
-
'price',
|
|
15
|
-
'location',
|
|
16
|
-
'webpageUrl',
|
|
17
|
-
'facebookUrl',
|
|
18
|
-
'category',
|
|
19
|
-
'draft',
|
|
20
|
-
'listed',
|
|
21
|
-
'signupsPublic',
|
|
22
|
-
'nameQuestion',
|
|
23
|
-
'emailQuestion',
|
|
24
|
-
'verificationEmail',
|
|
25
|
-
];
|
|
26
|
-
// Attributes included in POST /api/events for Question instances.
|
|
27
|
-
exports.adminEventCreateQuestionAttrs = [
|
|
28
|
-
'question',
|
|
29
|
-
'type',
|
|
30
|
-
'options',
|
|
31
|
-
'required',
|
|
32
|
-
'public',
|
|
33
|
-
];
|
|
34
|
-
// Attributes included in POST /api/events for Quota instances.
|
|
35
|
-
exports.adminEventCreateQuotaAttrs = [
|
|
36
|
-
'title',
|
|
37
|
-
'size',
|
|
38
|
-
];
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
import { StringifyApi } from '../../../utils';
|
|
2
|
-
import { AdminEventGetAnswerItem, AdminEventGetQuestionItem, AdminEventGetQuotaItem, AdminEventGetResponse, AdminEventGetSignupItem } from '../../events/details';
|
|
3
|
-
import { AdminEventListItem, AdminEventListQuotaItem, AdminEventListResponse } from '../../events/list';
|
|
4
|
-
import { AdminEventCreateBody, AdminEventCreateQuestion, AdminEventCreateQuota } from './create';
|
|
5
|
-
import { AdminEventUpdateBody, AdminEventUpdateQuestion, AdminEventUpdateQuota } from './update';
|
|
6
|
-
export declare type AdminEventsServiceTypes = AdminEventListResponse | AdminEventGetResponse | AdminEventCreateBody | AdminEventGetResponse | AdminEventUpdateBody | AdminEventGetResponse | null;
|
|
7
|
-
export declare namespace AdminEvent {
|
|
8
|
-
type Id = Details['id'];
|
|
9
|
-
type List = StringifyApi<AdminEventListResponse>;
|
|
10
|
-
namespace List {
|
|
11
|
-
type Event = StringifyApi<AdminEventListItem>;
|
|
12
|
-
type Quota = StringifyApi<AdminEventListQuotaItem>;
|
|
13
|
-
}
|
|
14
|
-
type Details = StringifyApi<AdminEventGetResponse>;
|
|
15
|
-
namespace Details {
|
|
16
|
-
type Quota = StringifyApi<AdminEventGetQuotaItem>;
|
|
17
|
-
type Signup = StringifyApi<AdminEventGetSignupItem>;
|
|
18
|
-
type Question = StringifyApi<AdminEventGetQuestionItem>;
|
|
19
|
-
type Answer = StringifyApi<AdminEventGetAnswerItem>;
|
|
20
|
-
}
|
|
21
|
-
namespace Create {
|
|
22
|
-
type Body = StringifyApi<AdminEventCreateBody>;
|
|
23
|
-
type Question = StringifyApi<AdminEventCreateQuestion>;
|
|
24
|
-
type Quota = StringifyApi<AdminEventCreateQuota>;
|
|
25
|
-
}
|
|
26
|
-
namespace Update {
|
|
27
|
-
type Body = StringifyApi<AdminEventUpdateBody>;
|
|
28
|
-
type Question = StringifyApi<AdminEventUpdateQuestion>;
|
|
29
|
-
type Quota = StringifyApi<AdminEventUpdateQuota>;
|
|
30
|
-
}
|
|
31
|
-
}
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import EventAttributes from '../../../models/event';
|
|
2
|
-
import QuestionAttributes from '../../../models/question';
|
|
3
|
-
import QuotaAttributes from '../../../models/quota';
|
|
4
|
-
import { adminEventCreateEventAttrs, adminEventCreateQuestionAttrs, adminEventCreateQuotaAttrs } from './create';
|
|
5
|
-
export interface AdminEventUpdateQuestion extends Pick<QuestionAttributes, typeof adminEventCreateQuestionAttrs[number]> {
|
|
6
|
-
id?: QuestionAttributes['id'];
|
|
7
|
-
}
|
|
8
|
-
export interface AdminEventUpdateQuota extends Pick<QuotaAttributes, typeof adminEventCreateQuotaAttrs[number]> {
|
|
9
|
-
id?: QuotaAttributes['id'];
|
|
10
|
-
}
|
|
11
|
-
export interface AdminEventUpdateBody extends Pick<EventAttributes, typeof adminEventCreateEventAttrs[number]> {
|
|
12
|
-
questions: AdminEventUpdateQuestion[];
|
|
13
|
-
quotas: AdminEventUpdateQuota[];
|
|
14
|
-
moveSignupsToQueue?: boolean;
|
|
15
|
-
updatedAt: string;
|
|
16
|
-
}
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import AuditLogAttributes from '../../models/auditlog';
|
|
2
|
-
import { StringifyApi } from '../../utils';
|
|
3
|
-
export interface AuditLogQuery {
|
|
4
|
-
user?: string;
|
|
5
|
-
ip?: string;
|
|
6
|
-
action?: string;
|
|
7
|
-
event?: string;
|
|
8
|
-
signup?: string;
|
|
9
|
-
$offset?: number;
|
|
10
|
-
$limit?: number;
|
|
11
|
-
}
|
|
12
|
-
export interface AuditLogItem extends AuditLogAttributes {
|
|
13
|
-
createdAt: Date;
|
|
14
|
-
}
|
|
15
|
-
export interface AuditLogResponse {
|
|
16
|
-
rows: AuditLogItem[];
|
|
17
|
-
count: number;
|
|
18
|
-
}
|
|
19
|
-
export declare namespace AuditLog {
|
|
20
|
-
type List = StringifyApi<AuditLogResponse>;
|
|
21
|
-
namespace List {
|
|
22
|
-
type Query = AuditLogQuery;
|
|
23
|
-
type Item = StringifyApi<AuditLogItem>;
|
|
24
|
-
}
|
|
25
|
-
}
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { StringifyApi } from '../../utils';
|
|
2
|
-
import { UserDetails } from '../users/details';
|
|
3
|
-
export interface AuthResponse {
|
|
4
|
-
accessToken: string;
|
|
5
|
-
user: UserDetails;
|
|
6
|
-
authentication: {
|
|
7
|
-
strategy: string;
|
|
8
|
-
accessToken: string;
|
|
9
|
-
payload: {
|
|
10
|
-
iat: number;
|
|
11
|
-
exp: number;
|
|
12
|
-
};
|
|
13
|
-
};
|
|
14
|
-
}
|
|
15
|
-
export declare namespace Auth {
|
|
16
|
-
type Response = StringifyApi<AuthResponse>;
|
|
17
|
-
}
|
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
import AnswerAttributes from '../../models/answer';
|
|
2
|
-
import EventAttributes from '../../models/event';
|
|
3
|
-
import QuestionAttributes from '../../models/question';
|
|
4
|
-
import QuotaAttributes from '../../models/quota';
|
|
5
|
-
import SignupAttributes from '../../models/signup';
|
|
6
|
-
export declare const eventGetEventAttrs: readonly ["id", "title", "slug", "date", "endDate", "registrationStartDate", "registrationEndDate", "openQuotaSize", "description", "price", "location", "webpageUrl", "facebookUrl", "category", "signupsPublic", "nameQuestion", "emailQuestion"];
|
|
7
|
-
export declare const adminEventGetEventAttrs: readonly ["id", "title", "slug", "date", "endDate", "registrationStartDate", "registrationEndDate", "openQuotaSize", "description", "price", "location", "webpageUrl", "facebookUrl", "category", "signupsPublic", "nameQuestion", "emailQuestion", "draft", "listed", "verificationEmail", "updatedAt"];
|
|
8
|
-
export declare const eventGetQuestionAttrs: readonly ["id", "question", "type", "options", "required", "public"];
|
|
9
|
-
export declare const eventGetQuotaAttrs: readonly ["id", "title", "size"];
|
|
10
|
-
export declare const eventGetSignupAttrs: readonly ["firstName", "lastName", "namePublic", "status", "position", "createdAt"];
|
|
11
|
-
export declare const adminEventGetSignupAttrs: readonly ["firstName", "lastName", "namePublic", "status", "position", "createdAt", "id", "email", "confirmedAt"];
|
|
12
|
-
export declare const eventGetAnswerAttrs: readonly ["questionId", "answer"];
|
|
13
|
-
export interface EventGetQuestionItem extends Omit<Pick<QuestionAttributes, typeof eventGetQuestionAttrs[number]>, 'options'> {
|
|
14
|
-
options: string[] | null;
|
|
15
|
-
}
|
|
16
|
-
export interface EventGetAnswerItem extends Pick<AnswerAttributes, typeof eventGetAnswerAttrs[number]> {
|
|
17
|
-
}
|
|
18
|
-
export interface EventGetSignupItem extends Pick<SignupAttributes, typeof eventGetSignupAttrs[number]> {
|
|
19
|
-
answers: EventGetAnswerItem[];
|
|
20
|
-
confirmed: boolean;
|
|
21
|
-
}
|
|
22
|
-
export interface EventGetQuotaItem extends Pick<QuotaAttributes, typeof eventGetQuotaAttrs[number]> {
|
|
23
|
-
signups: EventGetSignupItem[] | null;
|
|
24
|
-
signupCount: number;
|
|
25
|
-
}
|
|
26
|
-
export interface EventGetResponse extends Pick<EventAttributes, typeof eventGetEventAttrs[number]> {
|
|
27
|
-
questions: EventGetQuestionItem[];
|
|
28
|
-
quotas: EventGetQuotaItem[];
|
|
29
|
-
millisTillOpening: number | null;
|
|
30
|
-
registrationClosed: boolean;
|
|
31
|
-
}
|
|
32
|
-
export declare type AdminEventGetQuestionItem = EventGetQuestionItem;
|
|
33
|
-
export declare type AdminEventGetAnswerItem = EventGetAnswerItem;
|
|
34
|
-
export interface AdminEventGetSignupItem extends Pick<SignupAttributes, typeof adminEventGetSignupAttrs[number]> {
|
|
35
|
-
answers: AdminEventGetAnswerItem[];
|
|
36
|
-
}
|
|
37
|
-
export interface AdminEventGetQuotaItem extends Pick<QuotaAttributes, typeof eventGetQuotaAttrs[number]> {
|
|
38
|
-
signups: AdminEventGetSignupItem[];
|
|
39
|
-
signupCount: number;
|
|
40
|
-
}
|
|
41
|
-
export interface AdminEventGetResponse extends Pick<EventAttributes, typeof adminEventGetEventAttrs[number]> {
|
|
42
|
-
questions: AdminEventGetQuestionItem[];
|
|
43
|
-
quotas: AdminEventGetQuotaItem[];
|
|
44
|
-
}
|
|
@@ -1,67 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.eventGetAnswerAttrs = exports.adminEventGetSignupAttrs = 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 = [
|
|
26
|
-
...exports.eventGetEventAttrs,
|
|
27
|
-
'draft',
|
|
28
|
-
'listed',
|
|
29
|
-
'verificationEmail',
|
|
30
|
-
'updatedAt',
|
|
31
|
-
];
|
|
32
|
-
// Attributes included in results for Question instances.
|
|
33
|
-
exports.eventGetQuestionAttrs = [
|
|
34
|
-
'id',
|
|
35
|
-
'question',
|
|
36
|
-
'type',
|
|
37
|
-
'options',
|
|
38
|
-
'required',
|
|
39
|
-
'public',
|
|
40
|
-
];
|
|
41
|
-
// Attributes included in results for Quota instances.
|
|
42
|
-
exports.eventGetQuotaAttrs = [
|
|
43
|
-
'id',
|
|
44
|
-
'title',
|
|
45
|
-
'size',
|
|
46
|
-
];
|
|
47
|
-
// Attributes included in GET /api/events/ID for Signup instances.
|
|
48
|
-
exports.eventGetSignupAttrs = [
|
|
49
|
-
'firstName',
|
|
50
|
-
'lastName',
|
|
51
|
-
'namePublic',
|
|
52
|
-
'status',
|
|
53
|
-
'position',
|
|
54
|
-
'createdAt',
|
|
55
|
-
];
|
|
56
|
-
// Attributes included in GET /api/admin/events/ID for Signup instances.
|
|
57
|
-
exports.adminEventGetSignupAttrs = [
|
|
58
|
-
...exports.eventGetSignupAttrs,
|
|
59
|
-
'id',
|
|
60
|
-
'email',
|
|
61
|
-
'confirmedAt',
|
|
62
|
-
];
|
|
63
|
-
// Attributes included in results for Answer instances.
|
|
64
|
-
exports.eventGetAnswerAttrs = [
|
|
65
|
-
'questionId',
|
|
66
|
-
'answer',
|
|
67
|
-
];
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import { StringifyApi } from '../../utils';
|
|
2
|
-
import { EventGetAnswerItem, EventGetQuestionItem, EventGetQuotaItem, EventGetResponse, EventGetSignupItem } from './details';
|
|
3
|
-
import { EventListItem, EventListQuotaItem, EventListResponse } from './list';
|
|
4
|
-
export declare type EventsServiceTypes = EventListResponse | EventGetResponse;
|
|
5
|
-
export declare namespace Event {
|
|
6
|
-
type Slug = Details['slug'];
|
|
7
|
-
type Details = StringifyApi<EventGetResponse>;
|
|
8
|
-
namespace Details {
|
|
9
|
-
type Quota = StringifyApi<EventGetQuotaItem>;
|
|
10
|
-
type Signup = StringifyApi<EventGetSignupItem>;
|
|
11
|
-
type Question = StringifyApi<EventGetQuestionItem>;
|
|
12
|
-
type Answer = StringifyApi<EventGetAnswerItem>;
|
|
13
|
-
}
|
|
14
|
-
type List = StringifyApi<EventListResponse>;
|
|
15
|
-
namespace List {
|
|
16
|
-
type Event = StringifyApi<EventListItem>;
|
|
17
|
-
type Quota = StringifyApi<EventListQuotaItem>;
|
|
18
|
-
}
|
|
19
|
-
}
|
|
20
|
-
export declare namespace Question {
|
|
21
|
-
type Id = Event.Details.Question['id'];
|
|
22
|
-
}
|
|
23
|
-
export declare namespace Quota {
|
|
24
|
-
type Id = Event.Details.Quota['id'];
|
|
25
|
-
}
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import EventAttributes from '../../models/event';
|
|
2
|
-
import QuotaAttributes from '../../models/quota';
|
|
3
|
-
export declare const eventListEventAttrs: readonly ["id", "slug", "title", "date", "endDate", "registrationStartDate", "registrationEndDate", "openQuotaSize", "signupsPublic"];
|
|
4
|
-
export declare const adminEventListEventAttrs: readonly ["id", "slug", "title", "date", "endDate", "registrationStartDate", "registrationEndDate", "openQuotaSize", "signupsPublic", "draft", "listed"];
|
|
5
|
-
export declare const eventListQuotaAttrs: readonly ["id", "title", "size"];
|
|
6
|
-
export interface EventListQuotaItem extends Pick<QuotaAttributes, typeof eventListQuotaAttrs[number]> {
|
|
7
|
-
signupCount: number;
|
|
8
|
-
}
|
|
9
|
-
export interface EventListItem extends Pick<EventAttributes, typeof eventListEventAttrs[number]> {
|
|
10
|
-
quotas: EventListQuotaItem[];
|
|
11
|
-
}
|
|
12
|
-
export declare type EventListResponse = EventListItem[];
|
|
13
|
-
export declare type AdminEventListQuotaItem = EventListQuotaItem;
|
|
14
|
-
export interface AdminEventListItem extends Pick<EventAttributes, typeof adminEventListEventAttrs[number]> {
|
|
15
|
-
quotas: AdminEventListQuotaItem[];
|
|
16
|
-
}
|
|
17
|
-
export declare type AdminEventListResponse = AdminEventListItem[];
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.eventListQuotaAttrs = exports.adminEventListEventAttrs = exports.eventListEventAttrs = void 0;
|
|
4
|
-
// Attributes included in GET /api/events for Event instances.
|
|
5
|
-
exports.eventListEventAttrs = [
|
|
6
|
-
'id',
|
|
7
|
-
'slug',
|
|
8
|
-
'title',
|
|
9
|
-
'date',
|
|
10
|
-
'endDate',
|
|
11
|
-
'registrationStartDate',
|
|
12
|
-
'registrationEndDate',
|
|
13
|
-
'openQuotaSize',
|
|
14
|
-
'signupsPublic',
|
|
15
|
-
];
|
|
16
|
-
// Attributes included in GET /api/admin/events for Event instances.
|
|
17
|
-
exports.adminEventListEventAttrs = [
|
|
18
|
-
...exports.eventListEventAttrs,
|
|
19
|
-
'draft',
|
|
20
|
-
'listed',
|
|
21
|
-
];
|
|
22
|
-
exports.eventListQuotaAttrs = [
|
|
23
|
-
'id',
|
|
24
|
-
'title',
|
|
25
|
-
'size',
|
|
26
|
-
];
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import QuotaAttributes from '../../models/quota';
|
|
2
|
-
import SignupAttributes from '../../models/signup';
|
|
3
|
-
export interface SignupCreateBody {
|
|
4
|
-
quotaId: QuotaAttributes['id'];
|
|
5
|
-
}
|
|
6
|
-
export interface SignupCreateResponse {
|
|
7
|
-
id: SignupAttributes['id'];
|
|
8
|
-
editToken: string;
|
|
9
|
-
}
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import AnswerAttributes from '../../models/answer';
|
|
2
|
-
import EventAttributes from '../../models/event';
|
|
3
|
-
import QuestionAttributes from '../../models/question';
|
|
4
|
-
import QuotaAttributes from '../../models/quota';
|
|
5
|
-
import SignupAttributes from '../../models/signup';
|
|
6
|
-
export declare const signupGetEventAttrs: readonly ["id", "title", "slug", "date", "endDate", "registrationStartDate", "registrationEndDate", "openQuotaSize", "description", "price", "location", "webpageUrl", "facebookUrl", "category", "signupsPublic", "nameQuestion", "emailQuestion"];
|
|
7
|
-
export declare const signupGetQuestionAttrs: readonly ["id", "question", "type", "options", "required", "public"];
|
|
8
|
-
export declare const signupGetAnswerAttrs: readonly ["questionId", "answer"];
|
|
9
|
-
export declare const signupGetQuotaAttrs: readonly ["id", "title", "size"];
|
|
10
|
-
export declare const signupGetSignupAttrs: readonly ["id", "firstName", "lastName", "namePublic", "email", "confirmedAt", "status", "position"];
|
|
11
|
-
export interface SignupGetAnswerItem extends Pick<AnswerAttributes, typeof signupGetAnswerAttrs[number]> {
|
|
12
|
-
}
|
|
13
|
-
export interface SignupGetQuotaItem extends Pick<QuotaAttributes, typeof signupGetQuotaAttrs[number]> {
|
|
14
|
-
}
|
|
15
|
-
export interface SignupGetSignupItem extends Pick<SignupAttributes, typeof signupGetSignupAttrs[number]> {
|
|
16
|
-
quota: SignupGetQuotaItem;
|
|
17
|
-
answers: SignupGetAnswerItem[];
|
|
18
|
-
}
|
|
19
|
-
export interface SignupGetQuestionItem extends Omit<Pick<QuestionAttributes, typeof signupGetQuestionAttrs[number]>, 'options'> {
|
|
20
|
-
options: string[] | null;
|
|
21
|
-
}
|
|
22
|
-
export interface SignupGetEventItem extends Pick<EventAttributes, typeof signupGetEventAttrs[number]> {
|
|
23
|
-
questions: SignupGetQuestionItem[];
|
|
24
|
-
}
|
|
25
|
-
export interface SignupGetResponse {
|
|
26
|
-
signup: SignupGetSignupItem;
|
|
27
|
-
event: SignupGetEventItem;
|
|
28
|
-
}
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.signupGetSignupAttrs = exports.signupGetQuotaAttrs = exports.signupGetAnswerAttrs = exports.signupGetQuestionAttrs = exports.signupGetEventAttrs = void 0;
|
|
4
|
-
const details_1 = require("../events/details");
|
|
5
|
-
// Include the same attributes from Event as /api/events.
|
|
6
|
-
exports.signupGetEventAttrs = details_1.eventGetEventAttrs;
|
|
7
|
-
exports.signupGetQuestionAttrs = details_1.eventGetQuestionAttrs;
|
|
8
|
-
// Attributes included from Answer.
|
|
9
|
-
exports.signupGetAnswerAttrs = [
|
|
10
|
-
'questionId',
|
|
11
|
-
'answer',
|
|
12
|
-
];
|
|
13
|
-
// Attributes included from Quota.
|
|
14
|
-
exports.signupGetQuotaAttrs = [
|
|
15
|
-
'id',
|
|
16
|
-
'title',
|
|
17
|
-
'size',
|
|
18
|
-
];
|
|
19
|
-
// Attributes included from Signup.
|
|
20
|
-
exports.signupGetSignupAttrs = [
|
|
21
|
-
'id',
|
|
22
|
-
'firstName',
|
|
23
|
-
'lastName',
|
|
24
|
-
'namePublic',
|
|
25
|
-
'email',
|
|
26
|
-
'confirmedAt',
|
|
27
|
-
'status',
|
|
28
|
-
'position',
|
|
29
|
-
];
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import { StringifyApi } from '../../utils';
|
|
2
|
-
import { SignupCreateBody, SignupCreateResponse } from './create';
|
|
3
|
-
import { SignupGetAnswerItem, SignupGetEventItem, SignupGetQuestionItem, SignupGetQuotaItem, SignupGetResponse, SignupGetSignupItem } from './getForEdit';
|
|
4
|
-
import { SignupUpdateBody, SignupUpdateBodyAnswer, SignupUpdateResponse } from './update';
|
|
5
|
-
export declare type SignupServiceTypes = SignupGetResponse | SignupCreateBody | SignupCreateResponse | SignupUpdateBody | SignupUpdateResponse | null;
|
|
6
|
-
export declare namespace Signup {
|
|
7
|
-
type Id = Details.Signup['id'];
|
|
8
|
-
type Details = StringifyApi<SignupGetResponse>;
|
|
9
|
-
namespace Details {
|
|
10
|
-
type Event = StringifyApi<SignupGetEventItem>;
|
|
11
|
-
type Question = StringifyApi<SignupGetQuestionItem>;
|
|
12
|
-
type Signup = StringifyApi<SignupGetSignupItem>;
|
|
13
|
-
type Quota = StringifyApi<SignupGetQuotaItem>;
|
|
14
|
-
type Answer = StringifyApi<SignupGetAnswerItem>;
|
|
15
|
-
}
|
|
16
|
-
namespace Create {
|
|
17
|
-
type Body = StringifyApi<SignupCreateBody>;
|
|
18
|
-
type Response = StringifyApi<SignupCreateResponse>;
|
|
19
|
-
}
|
|
20
|
-
namespace Update {
|
|
21
|
-
type Body = StringifyApi<SignupUpdateBody>;
|
|
22
|
-
namespace Body {
|
|
23
|
-
type Answer = StringifyApi<SignupUpdateBodyAnswer>;
|
|
24
|
-
}
|
|
25
|
-
type Response = StringifyApi<SignupUpdateResponse>;
|
|
26
|
-
}
|
|
27
|
-
}
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import QuestionAttributes from '../../models/question';
|
|
2
|
-
import SignupAttributes from '../../models/signup';
|
|
3
|
-
export interface SignupUpdateBodyAnswer {
|
|
4
|
-
questionId: QuestionAttributes['id'];
|
|
5
|
-
answer: string;
|
|
6
|
-
}
|
|
7
|
-
export interface SignupUpdateBody {
|
|
8
|
-
firstName: string;
|
|
9
|
-
lastName: string;
|
|
10
|
-
namePublic: boolean;
|
|
11
|
-
email: string;
|
|
12
|
-
answers: SignupUpdateBodyAnswer[];
|
|
13
|
-
editToken?: string;
|
|
14
|
-
}
|
|
15
|
-
export interface SignupUpdateResponse {
|
|
16
|
-
id: SignupAttributes['id'];
|
|
17
|
-
confirmedAt: Date;
|
|
18
|
-
}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import UserAttributes from '../../models/user';
|
|
2
|
-
export interface UserCreateBody {
|
|
3
|
-
email: string;
|
|
4
|
-
}
|
|
5
|
-
export declare const userGetAttributes: readonly ["id", "email"];
|
|
6
|
-
export interface UserDetails extends Pick<UserAttributes, typeof userGetAttributes[number]> {
|
|
7
|
-
}
|
|
8
|
-
export declare type UserListItem = UserDetails;
|
|
9
|
-
export declare type UserListResponse = UserListItem[];
|