chelys 1.5.1 → 2.0.0

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 CHANGED
@@ -1,2 +1,2 @@
1
- # Hang
2
- Common code between Yatga and Kalimba
1
+ # Hang
2
+ Common code between Yatga and Kalimba
package/dist/client.d.ts CHANGED
@@ -1,10 +1,10 @@
1
- export interface ResponseStatus {
2
- success: boolean;
3
- status: string;
4
- }
5
- export interface CltReqAuthenticate {
6
- idToken: string;
7
- }
8
- export interface CltReqPing {
9
- data: string;
10
- }
1
+ export interface ResponseStatus {
2
+ success: boolean;
3
+ status: string;
4
+ }
5
+ export interface CltReqAuthenticate {
6
+ idToken: string;
7
+ }
8
+ export interface CltReqPing {
9
+ data: string;
10
+ }
package/dist/client.js CHANGED
@@ -1,3 +1,3 @@
1
- "use strict";
2
- // TYPE / CONST
3
- Object.defineProperty(exports, "__esModule", { value: true });
1
+ "use strict";
2
+ // TYPE / CONST
3
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,43 +1,43 @@
1
- export declare const OWNER_INDEX = 0;
2
- export declare enum ConstitutionType {
3
- GRADE = 0,
4
- LENGTH = 1
5
- }
6
- export declare enum AnonymousLevel {
7
- PUBLIC = 0,
8
- NO_USERNAME = 1,
9
- SOUND_ONLY = 2
10
- }
11
- export interface Constitution {
12
- id: string;
13
- season: number;
14
- part: number;
15
- name: string;
16
- isPublic: boolean;
17
- anonymousLevel: AnonymousLevel;
18
- type: ConstitutionType;
19
- state: number;
20
- playlistLink: string;
21
- users: string[];
22
- maxUserCount: number;
23
- numberOfSongsPerUser: number;
24
- }
25
- export declare const EMPTY_CONSTITUTION: Constitution;
26
- export declare function canModifySongs(constitution: Constitution): boolean;
27
- export declare function canModifyVotes(constitution: Constitution): boolean;
28
- export interface CstReqGet {
29
- ids: string[];
30
- }
31
- export interface CstReqCreate {
32
- cstData: Constitution;
33
- }
34
- export interface CstReqJoin {
35
- id: string;
36
- }
37
- export interface CstReqUnsubscribe {
38
- ids: string[];
39
- }
40
- export interface CstResUpdate {
41
- cstInfo: Constitution;
42
- }
43
- export declare type CstReqGetFromUser = {};
1
+ export declare const OWNER_INDEX = 0;
2
+ export declare enum ConstitutionType {
3
+ GRADE = 0,
4
+ LENGTH = 1
5
+ }
6
+ export declare enum AnonymousLevel {
7
+ PUBLIC = 0,
8
+ NO_USERNAME = 1,
9
+ SOUND_ONLY = 2
10
+ }
11
+ export interface Constitution {
12
+ id: string;
13
+ season: number;
14
+ part: number;
15
+ name: string;
16
+ isPublic: boolean;
17
+ anonymousLevel: AnonymousLevel;
18
+ type: ConstitutionType;
19
+ state: number;
20
+ playlistLink: string;
21
+ users: string[];
22
+ maxUserCount: number;
23
+ numberOfSongsPerUser: number;
24
+ }
25
+ export declare const EMPTY_CONSTITUTION: Constitution;
26
+ export declare function canModifySongs(constitution: Constitution): boolean;
27
+ export declare function canModifyVotes(constitution: Constitution): boolean;
28
+ export interface CstReqGet {
29
+ ids: string[];
30
+ }
31
+ export interface CstReqCreate {
32
+ cstData: Constitution;
33
+ }
34
+ export interface CstReqJoin {
35
+ id: string;
36
+ }
37
+ export interface CstReqUnsubscribe {
38
+ ids: string[];
39
+ }
40
+ export interface CstResUpdate {
41
+ cstInfo: Constitution;
42
+ }
43
+ export declare type CstReqGetFromUser = {};
@@ -1,47 +1,47 @@
1
- "use strict";
2
- // TYPE / CONST
3
- Object.defineProperty(exports, "__esModule", { value: true });
4
- exports.canModifyVotes = exports.canModifySongs = exports.EMPTY_CONSTITUTION = exports.AnonymousLevel = exports.ConstitutionType = exports.OWNER_INDEX = void 0;
5
- exports.OWNER_INDEX = 0;
6
- var ConstitutionType;
7
- (function (ConstitutionType) {
8
- ConstitutionType[ConstitutionType["GRADE"] = 0] = "GRADE";
9
- ConstitutionType[ConstitutionType["LENGTH"] = 1] = "LENGTH";
10
- })(ConstitutionType = exports.ConstitutionType || (exports.ConstitutionType = {}));
11
- var AnonymousLevel;
12
- (function (AnonymousLevel) {
13
- AnonymousLevel[AnonymousLevel["PUBLIC"] = 0] = "PUBLIC";
14
- AnonymousLevel[AnonymousLevel["NO_USERNAME"] = 1] = "NO_USERNAME";
15
- AnonymousLevel[AnonymousLevel["SOUND_ONLY"] = 2] = "SOUND_ONLY";
16
- })(AnonymousLevel = exports.AnonymousLevel || (exports.AnonymousLevel = {}));
17
- exports.EMPTY_CONSTITUTION = {
18
- id: '',
19
- name: '',
20
- season: -1,
21
- part: -1,
22
- isPublic: false,
23
- anonymousLevel: -1,
24
- maxUserCount: -1,
25
- type: -1,
26
- state: -1,
27
- numberOfSongsPerUser: -1,
28
- playlistLink: '',
29
- users: []
30
- };
31
- // FUNCTION
32
- function canModifySongs(constitution) {
33
- switch (constitution.type) {
34
- case ConstitutionType.GRADE: return constitution.state === 0; // TODO : Magic Number
35
- default:
36
- return false;
37
- }
38
- }
39
- exports.canModifySongs = canModifySongs;
40
- function canModifyVotes(constitution) {
41
- switch (constitution.type) {
42
- case ConstitutionType.GRADE: return constitution.state < 1; // TODO : Magic Number
43
- default:
44
- return false;
45
- }
46
- }
47
- exports.canModifyVotes = canModifyVotes;
1
+ "use strict";
2
+ // TYPE / CONST
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ exports.canModifyVotes = exports.canModifySongs = exports.EMPTY_CONSTITUTION = exports.AnonymousLevel = exports.ConstitutionType = exports.OWNER_INDEX = void 0;
5
+ exports.OWNER_INDEX = 0;
6
+ var ConstitutionType;
7
+ (function (ConstitutionType) {
8
+ ConstitutionType[ConstitutionType["GRADE"] = 0] = "GRADE";
9
+ ConstitutionType[ConstitutionType["LENGTH"] = 1] = "LENGTH";
10
+ })(ConstitutionType = exports.ConstitutionType || (exports.ConstitutionType = {}));
11
+ var AnonymousLevel;
12
+ (function (AnonymousLevel) {
13
+ AnonymousLevel[AnonymousLevel["PUBLIC"] = 0] = "PUBLIC";
14
+ AnonymousLevel[AnonymousLevel["NO_USERNAME"] = 1] = "NO_USERNAME";
15
+ AnonymousLevel[AnonymousLevel["SOUND_ONLY"] = 2] = "SOUND_ONLY";
16
+ })(AnonymousLevel = exports.AnonymousLevel || (exports.AnonymousLevel = {}));
17
+ exports.EMPTY_CONSTITUTION = {
18
+ id: '',
19
+ name: '',
20
+ season: -1,
21
+ part: -1,
22
+ isPublic: false,
23
+ anonymousLevel: -1,
24
+ maxUserCount: -1,
25
+ type: -1,
26
+ state: -1,
27
+ numberOfSongsPerUser: -1,
28
+ playlistLink: '',
29
+ users: []
30
+ };
31
+ // FUNCTION
32
+ function canModifySongs(constitution) {
33
+ switch (constitution.type) {
34
+ case ConstitutionType.GRADE: return constitution.state === 0; // TODO : Magic Number
35
+ default:
36
+ return false;
37
+ }
38
+ }
39
+ exports.canModifySongs = canModifySongs;
40
+ function canModifyVotes(constitution) {
41
+ switch (constitution.type) {
42
+ case ConstitutionType.GRADE: return constitution.state < 1; // TODO : Magic Number
43
+ default:
44
+ return false;
45
+ }
46
+ }
47
+ exports.canModifyVotes = canModifyVotes;
package/dist/index.d.ts CHANGED
@@ -1,6 +1,6 @@
1
- export * from './client';
2
- export * from './constitution';
3
- export * from './message';
4
- export * from './song';
5
- export * from './user';
6
- export * from './vote';
1
+ export * from './client';
2
+ export * from './constitution';
3
+ export * from './message';
4
+ export * from './song';
5
+ export * from './user';
6
+ export * from './vote';
package/dist/index.js CHANGED
@@ -1,18 +1,18 @@
1
- "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
5
- }) : (function(o, m, k, k2) {
6
- if (k2 === undefined) k2 = k;
7
- o[k2] = m[k];
8
- }));
9
- var __exportStar = (this && this.__exportStar) || function(m, exports) {
10
- for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
11
- };
12
- Object.defineProperty(exports, "__esModule", { value: true });
13
- __exportStar(require("./client"), exports);
14
- __exportStar(require("./constitution"), exports);
15
- __exportStar(require("./message"), exports);
16
- __exportStar(require("./song"), exports);
17
- __exportStar(require("./user"), exports);
18
- __exportStar(require("./vote"), exports);
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
5
+ }) : (function(o, m, k, k2) {
6
+ if (k2 === undefined) k2 = k;
7
+ o[k2] = m[k];
8
+ }));
9
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
10
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
11
+ };
12
+ Object.defineProperty(exports, "__esModule", { value: true });
13
+ __exportStar(require("./client"), exports);
14
+ __exportStar(require("./constitution"), exports);
15
+ __exportStar(require("./message"), exports);
16
+ __exportStar(require("./song"), exports);
17
+ __exportStar(require("./user"), exports);
18
+ __exportStar(require("./vote"), exports);
package/dist/message.d.ts CHANGED
@@ -1,33 +1,33 @@
1
- export interface Message<T> {
2
- event: string;
3
- data: T;
4
- }
5
- export declare enum EventType {
6
- CLIENT_authenticate = "CLIENT-authenticate",
7
- CLIENT_ping = "CLIENT-ping",
8
- CST_create = "CST-create",
9
- CST_get = "CST-get",
10
- CST_get_from_user = "CST-get-from-user",
11
- CST_join = "CST-join",
12
- CST_unsubscribe = "CST-unsubscribe",
13
- CST_GRADE_edit = "CST-GRADE-edit",
14
- CST_GRADE_get_all = "CST-GRADE-get-all",
15
- CST_GRADE_get_user = "CST-GRADE-get-user",
16
- CST_GRADE_get_summary = "CST-GRADE-get-summary",
17
- CST_GRADE_unsubscribe = "CST-GRADE-unsubscribe",
18
- CST_SONG_add = "CST-SONG-add",
19
- CST_SONG_get_all = "CST-SONG-get-all",
20
- CST_SONG_remove = "CST-SONG-remove",
21
- CST_SONG_unsubscribe = "CST-SONG-unsubscribe",
22
- USER_create = "USER-create",
23
- USER_edit = "USER-edit",
24
- USER_get = "USER-get",
25
- USER_get_all = "USER-get-all",
26
- USER_unsubscribe = "USER-unsubscribe",
27
- CST_update = "CST-update",
28
- CST_GRADE_update = "CST-GRADE-update",
29
- CST_SONG_update = "CST-SONG-update",
30
- USER_update = "USER-update"
31
- }
32
- export declare function createMessage<T>(event: string, data: T): string;
33
- export declare function extractMessageData<T>(message: Message<unknown>): T;
1
+ export interface Message<T> {
2
+ event: string;
3
+ data: T;
4
+ }
5
+ export declare enum EventType {
6
+ CLIENT_authenticate = "CLIENT-authenticate",
7
+ CLIENT_ping = "CLIENT-ping",
8
+ CST_create = "CST-create",
9
+ CST_get = "CST-get",
10
+ CST_get_from_user = "CST-get-from-user",
11
+ CST_join = "CST-join",
12
+ CST_unsubscribe = "CST-unsubscribe",
13
+ CST_GRADE_edit = "CST-GRADE-edit",
14
+ CST_GRADE_get_all = "CST-GRADE-get-all",
15
+ CST_GRADE_get_user = "CST-GRADE-get-user",
16
+ CST_GRADE_get_summary = "CST-GRADE-get-summary",
17
+ CST_GRADE_unsubscribe = "CST-GRADE-unsubscribe",
18
+ CST_SONG_add = "CST-SONG-add",
19
+ CST_SONG_get_all = "CST-SONG-get-all",
20
+ CST_SONG_remove = "CST-SONG-remove",
21
+ CST_SONG_unsubscribe = "CST-SONG-unsubscribe",
22
+ USER_create = "USER-create",
23
+ USER_edit = "USER-edit",
24
+ USER_get = "USER-get",
25
+ USER_get_all = "USER-get-all",
26
+ USER_unsubscribe = "USER-unsubscribe",
27
+ CST_update = "CST-update",
28
+ CST_GRADE_update = "CST-GRADE-update",
29
+ CST_SONG_update = "CST-SONG-update",
30
+ USER_update = "USER-update"
31
+ }
32
+ export declare function createMessage<T>(event: string, data: T): string;
33
+ export declare function extractMessageData<T>(message: Message<unknown>): T;
package/dist/message.js CHANGED
@@ -1,43 +1,43 @@
1
- "use strict";
2
- // TYPE / CONST
3
- Object.defineProperty(exports, "__esModule", { value: true });
4
- exports.extractMessageData = exports.createMessage = exports.EventType = void 0;
5
- var EventType;
6
- (function (EventType) {
7
- // From client
8
- EventType["CLIENT_authenticate"] = "CLIENT-authenticate";
9
- EventType["CLIENT_ping"] = "CLIENT-ping";
10
- EventType["CST_create"] = "CST-create";
11
- EventType["CST_get"] = "CST-get";
12
- EventType["CST_get_from_user"] = "CST-get-from-user";
13
- EventType["CST_join"] = "CST-join";
14
- EventType["CST_unsubscribe"] = "CST-unsubscribe";
15
- EventType["CST_GRADE_edit"] = "CST-GRADE-edit";
16
- EventType["CST_GRADE_get_all"] = "CST-GRADE-get-all";
17
- EventType["CST_GRADE_get_user"] = "CST-GRADE-get-user";
18
- EventType["CST_GRADE_get_summary"] = "CST-GRADE-get-summary";
19
- EventType["CST_GRADE_unsubscribe"] = "CST-GRADE-unsubscribe";
20
- EventType["CST_SONG_add"] = "CST-SONG-add";
21
- EventType["CST_SONG_get_all"] = "CST-SONG-get-all";
22
- EventType["CST_SONG_remove"] = "CST-SONG-remove";
23
- EventType["CST_SONG_unsubscribe"] = "CST-SONG-unsubscribe";
24
- EventType["USER_create"] = "USER-create";
25
- EventType["USER_edit"] = "USER-edit";
26
- EventType["USER_get"] = "USER-get";
27
- EventType["USER_get_all"] = "USER-get-all";
28
- EventType["USER_unsubscribe"] = "USER-unsubscribe";
29
- // From server
30
- EventType["CST_update"] = "CST-update";
31
- EventType["CST_GRADE_update"] = "CST-GRADE-update";
32
- EventType["CST_SONG_update"] = "CST-SONG-update";
33
- EventType["USER_update"] = "USER-update";
34
- })(EventType = exports.EventType || (exports.EventType = {}));
35
- // FUNCTION
36
- function createMessage(event, data) {
37
- return JSON.stringify({ event: event, data: data });
38
- }
39
- exports.createMessage = createMessage;
40
- function extractMessageData(message) {
41
- return message.data;
42
- }
43
- exports.extractMessageData = extractMessageData;
1
+ "use strict";
2
+ // TYPE / CONST
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ exports.extractMessageData = exports.createMessage = exports.EventType = void 0;
5
+ var EventType;
6
+ (function (EventType) {
7
+ // From client
8
+ EventType["CLIENT_authenticate"] = "CLIENT-authenticate";
9
+ EventType["CLIENT_ping"] = "CLIENT-ping";
10
+ EventType["CST_create"] = "CST-create";
11
+ EventType["CST_get"] = "CST-get";
12
+ EventType["CST_get_from_user"] = "CST-get-from-user";
13
+ EventType["CST_join"] = "CST-join";
14
+ EventType["CST_unsubscribe"] = "CST-unsubscribe";
15
+ EventType["CST_GRADE_edit"] = "CST-GRADE-edit";
16
+ EventType["CST_GRADE_get_all"] = "CST-GRADE-get-all";
17
+ EventType["CST_GRADE_get_user"] = "CST-GRADE-get-user";
18
+ EventType["CST_GRADE_get_summary"] = "CST-GRADE-get-summary";
19
+ EventType["CST_GRADE_unsubscribe"] = "CST-GRADE-unsubscribe";
20
+ EventType["CST_SONG_add"] = "CST-SONG-add";
21
+ EventType["CST_SONG_get_all"] = "CST-SONG-get-all";
22
+ EventType["CST_SONG_remove"] = "CST-SONG-remove";
23
+ EventType["CST_SONG_unsubscribe"] = "CST-SONG-unsubscribe";
24
+ EventType["USER_create"] = "USER-create";
25
+ EventType["USER_edit"] = "USER-edit";
26
+ EventType["USER_get"] = "USER-get";
27
+ EventType["USER_get_all"] = "USER-get-all";
28
+ EventType["USER_unsubscribe"] = "USER-unsubscribe";
29
+ // From server
30
+ EventType["CST_update"] = "CST-update";
31
+ EventType["CST_GRADE_update"] = "CST-GRADE-update";
32
+ EventType["CST_SONG_update"] = "CST-SONG-update";
33
+ EventType["USER_update"] = "USER-update";
34
+ })(EventType = exports.EventType || (exports.EventType = {}));
35
+ // FUNCTION
36
+ function createMessage(event, data) {
37
+ return JSON.stringify({ event: event, data: data });
38
+ }
39
+ exports.createMessage = createMessage;
40
+ function extractMessageData(message) {
41
+ return message.data;
42
+ }
43
+ exports.extractMessageData = extractMessageData;
package/dist/song.d.ts CHANGED
@@ -1,30 +1,30 @@
1
- export declare enum SongPlatform {
2
- YOUTUBE = 0
3
- }
4
- export interface Song {
5
- id: number;
6
- title: string;
7
- platform: SongPlatform;
8
- url: string;
9
- user: string;
10
- author: string;
11
- }
12
- export declare const EMPTY_SONG: Song;
13
- export interface CstSongReqAdd {
14
- cstId: string;
15
- songData: Song;
16
- }
17
- export interface CstSongReqRemove {
18
- cstId: string;
19
- songId: number;
20
- }
21
- export interface CstSongReqGetAll {
22
- cstId: string;
23
- }
24
- export interface CstSongResUpdate {
25
- songInfo: Song;
26
- status: "added" | "modified" | "removed";
27
- }
28
- export interface CstSongReqUnsubscribe {
29
- cstId: string;
30
- }
1
+ export declare enum SongPlatform {
2
+ YOUTUBE = 0
3
+ }
4
+ export interface Song {
5
+ id: number;
6
+ title: string;
7
+ platform: SongPlatform;
8
+ url: string;
9
+ user: string;
10
+ author: string;
11
+ }
12
+ export declare const EMPTY_SONG: Song;
13
+ export interface CstSongReqAdd {
14
+ cstId: string;
15
+ songData: Song;
16
+ }
17
+ export interface CstSongReqRemove {
18
+ cstId: string;
19
+ songId: number;
20
+ }
21
+ export interface CstSongReqGetAll {
22
+ cstId: string;
23
+ }
24
+ export interface CstSongResUpdate {
25
+ songInfo: Song;
26
+ status: "added" | "modified" | "removed";
27
+ }
28
+ export interface CstSongReqUnsubscribe {
29
+ cstId: string;
30
+ }
package/dist/song.js CHANGED
@@ -1,16 +1,16 @@
1
- "use strict";
2
- // TYPE / CONST
3
- Object.defineProperty(exports, "__esModule", { value: true });
4
- exports.EMPTY_SONG = exports.SongPlatform = void 0;
5
- var SongPlatform;
6
- (function (SongPlatform) {
7
- SongPlatform[SongPlatform["YOUTUBE"] = 0] = "YOUTUBE";
8
- })(SongPlatform = exports.SongPlatform || (exports.SongPlatform = {}));
9
- exports.EMPTY_SONG = {
10
- id: -1,
11
- title: '',
12
- platform: -1,
13
- url: '',
14
- user: '',
15
- author: '',
16
- };
1
+ "use strict";
2
+ // TYPE / CONST
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ exports.EMPTY_SONG = exports.SongPlatform = void 0;
5
+ var SongPlatform;
6
+ (function (SongPlatform) {
7
+ SongPlatform[SongPlatform["YOUTUBE"] = 0] = "YOUTUBE";
8
+ })(SongPlatform = exports.SongPlatform || (exports.SongPlatform = {}));
9
+ exports.EMPTY_SONG = {
10
+ id: -1,
11
+ title: '',
12
+ platform: -1,
13
+ url: '',
14
+ user: '',
15
+ author: '',
16
+ };
package/dist/user.d.ts CHANGED
@@ -1,27 +1,27 @@
1
- export declare enum Role {
2
- ADMIN = "admin",
3
- DEV = "dev",
4
- MEMBER = "member",
5
- TEST = "test"
6
- }
7
- export interface User {
8
- uid: string;
9
- email: string;
10
- displayName: string;
11
- photoURL: string;
12
- roles: Role[];
13
- description: string;
14
- }
15
- export declare const EMPTY_USER: User;
16
- export interface UsrReqGet {
17
- uids: string[];
18
- }
19
- export interface UsrReqEdit {
20
- userData: User;
21
- }
22
- export interface UsrReqUnsubscribe {
23
- uids: string[];
24
- }
25
- export interface UsrResUpdate {
26
- userInfo: User;
27
- }
1
+ export declare enum Role {
2
+ ADMIN = "admin",
3
+ DEV = "dev",
4
+ MEMBER = "member",
5
+ TEST = "test"
6
+ }
7
+ export interface User {
8
+ uid: string;
9
+ email: string;
10
+ displayName: string;
11
+ photoURL: string;
12
+ roles: Role[];
13
+ description: string;
14
+ }
15
+ export declare const EMPTY_USER: User;
16
+ export interface UsrReqGet {
17
+ uids: string[];
18
+ }
19
+ export interface UsrReqEdit {
20
+ userData: User;
21
+ }
22
+ export interface UsrReqUnsubscribe {
23
+ uids: string[];
24
+ }
25
+ export interface UsrResUpdate {
26
+ userInfo: User;
27
+ }
package/dist/user.js CHANGED
@@ -1,19 +1,19 @@
1
- "use strict";
2
- // TYPE / CONST
3
- Object.defineProperty(exports, "__esModule", { value: true });
4
- exports.EMPTY_USER = exports.Role = void 0;
5
- var Role;
6
- (function (Role) {
7
- Role["ADMIN"] = "admin";
8
- Role["DEV"] = "dev";
9
- Role["MEMBER"] = "member";
10
- Role["TEST"] = "test";
11
- })(Role = exports.Role || (exports.Role = {}));
12
- exports.EMPTY_USER = {
13
- uid: '',
14
- email: '',
15
- displayName: '',
16
- photoURL: '',
17
- roles: [],
18
- description: '',
19
- };
1
+ "use strict";
2
+ // TYPE / CONST
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ exports.EMPTY_USER = exports.Role = void 0;
5
+ var Role;
6
+ (function (Role) {
7
+ Role["ADMIN"] = "admin";
8
+ Role["DEV"] = "dev";
9
+ Role["MEMBER"] = "member";
10
+ Role["TEST"] = "test";
11
+ })(Role = exports.Role || (exports.Role = {}));
12
+ exports.EMPTY_USER = {
13
+ uid: '',
14
+ email: '',
15
+ displayName: '',
16
+ photoURL: '',
17
+ roles: [],
18
+ description: '',
19
+ };
package/dist/vote.d.ts CHANGED
@@ -1,30 +1,30 @@
1
- export interface GradeVote {
2
- songId: number;
3
- grade: number;
4
- }
5
- export interface GradeUserData {
6
- uid: string;
7
- values: Map<number, number>;
8
- }
9
- export interface GradeSummary {
10
- voteCount: number;
11
- }
12
- export interface CstGradeReqEdit {
13
- cstId: string;
14
- voteData: GradeVote;
15
- }
16
- export interface CstGradeReqGetAll {
17
- cstId: string;
18
- }
19
- export interface CstGradeReqGetUser {
20
- cstId: string;
21
- }
22
- export interface CstGradeReqGetSummary {
23
- cstId: string;
24
- }
25
- export interface CstGradeReqUnsubscribe {
26
- cstId: string;
27
- }
28
- export interface CstGradeResUpdate {
29
- summary: GradeSummary;
30
- }
1
+ export interface GradeVote {
2
+ songId: number;
3
+ grade: number;
4
+ }
5
+ export interface GradeUserData {
6
+ uid: string;
7
+ values: Map<number, number>;
8
+ }
9
+ export interface GradeSummary {
10
+ voteCount: number;
11
+ }
12
+ export interface CstGradeReqEdit {
13
+ cstId: string;
14
+ voteData: GradeVote;
15
+ }
16
+ export interface CstGradeReqGetAll {
17
+ cstId: string;
18
+ }
19
+ export interface CstGradeReqGetUser {
20
+ cstId: string;
21
+ }
22
+ export interface CstGradeReqGetSummary {
23
+ cstId: string;
24
+ }
25
+ export interface CstGradeReqUnsubscribe {
26
+ cstId: string;
27
+ }
28
+ export interface CstGradeResUpdate {
29
+ summary: GradeSummary;
30
+ }
package/dist/vote.js CHANGED
@@ -1,3 +1,3 @@
1
- "use strict";
2
- // TYPE / CONST
3
- Object.defineProperty(exports, "__esModule", { value: true });
1
+ "use strict";
2
+ // TYPE / CONST
3
+ Object.defineProperty(exports, "__esModule", { value: true });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "chelys",
3
- "version": "1.5.1",
3
+ "version": "2.0.0",
4
4
  "description": "Common code between Yatga and Kalimba",
5
5
  "main": "dist/index.js",
6
6
  "scripts": {
@@ -20,13 +20,14 @@
20
20
  "url": "https://github.com/TableauBits/Chelys/issues"
21
21
  },
22
22
  "homepage": "https://github.com/TableauBits/Chelys#readme",
23
- "dependencies": {
24
- "@types/node": "^16.10.1",
25
- "eslint": "^7.32.0",
26
- "typescript": "^4.4.3"
27
- },
23
+ "dependencies": {},
28
24
  "files": [
29
25
  "dist/"
30
26
  ],
31
- "types": "dist/index.d.ts"
27
+ "types": "dist/index.d.ts",
28
+ "devDependencies": {
29
+ "@types/node": "^16.10.1",
30
+ "eslint": "^7.32.0",
31
+ "typescript": "^4.4.3"
32
+ }
32
33
  }
package/dist/utility.d.ts DELETED
@@ -1,2 +0,0 @@
1
- export declare function removeFromArray<T>(element: T, array: T[]): void;
2
- export declare function cleanupString(str: string, length: number, removeNewLines?: boolean): string;
package/dist/utility.js DELETED
@@ -1,17 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.cleanupString = exports.removeFromArray = void 0;
4
- function removeFromArray(element, array) {
5
- var index = array.findIndex(function (e) { return e === element; });
6
- if (index >= 0)
7
- array.splice(index, 1);
8
- }
9
- exports.removeFromArray = removeFromArray;
10
- function cleanupString(str, length, removeNewLines) {
11
- if (removeNewLines === void 0) { removeNewLines = true; }
12
- var cleanString = str;
13
- if (removeNewLines)
14
- cleanString.replace(/^\s*\n/gm, "");
15
- return cleanString.substring(0, Math.min(cleanString.length, length));
16
- }
17
- exports.cleanupString = cleanupString;