@kekkle/shared 0.0.5 → 0.0.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/constants/collections.js +9 -0
- package/dist/cjs/constants/index.js +17 -0
- package/dist/cjs/enums/group-permission.js +9 -0
- package/dist/{enums → cjs/enums}/index.d.ts +1 -1
- package/dist/cjs/enums/index.js +18 -0
- package/dist/cjs/enums/push-settings-options.js +13 -0
- package/dist/cjs/index.js +39 -0
- package/dist/cjs/types/comment.js +2 -0
- package/dist/cjs/types/fcm-token.js +2 -0
- package/dist/cjs/types/group-general-data.js +2 -0
- package/dist/{types → cjs/types}/group-member.d.ts +1 -1
- package/dist/cjs/types/group-member.js +2 -0
- package/dist/cjs/types/group.js +2 -0
- package/dist/cjs/types/index.js +32 -0
- package/dist/cjs/types/match-tries.js +2 -0
- package/dist/cjs/types/push-document.js +2 -0
- package/dist/cjs/types/quote.js +2 -0
- package/dist/cjs/types/uid.js +2 -0
- package/dist/cjs/types/user.js +2 -0
- package/dist/cjs/types/wordle-game-state.js +2 -0
- package/dist/cjs/types/wordle-game.js +2 -0
- package/dist/cjs/types/wordle-leaderboard.js +2 -0
- package/dist/cjs/types/wordle-monthly-score.js +2 -0
- package/dist/cjs/types/wordle-score.d.ts +16 -0
- package/dist/cjs/types/wordle-score.js +2 -0
- package/dist/cjs/types/worlde-game-state-document.js +2 -0
- package/dist/esm/constants/collections.d.ts +6 -0
- package/dist/esm/constants/index.js +1 -0
- package/dist/esm/enums/group-permission.d.ts +5 -0
- package/dist/esm/enums/index.d.ts +2 -0
- package/dist/{enums → esm/enums}/index.js +1 -1
- package/dist/esm/enums/push-settings-options.d.ts +9 -0
- package/dist/esm/index.js +3 -0
- package/dist/esm/types/comment.d.ts +9 -0
- package/dist/esm/types/fcm-token.d.ts +1 -0
- package/dist/esm/types/group-general-data.d.ts +6 -0
- package/dist/esm/types/group-member.d.ts +8 -0
- package/dist/esm/types/group.d.ts +20 -0
- package/dist/esm/types/index.js +16 -0
- package/dist/esm/types/match-tries.d.ts +9 -0
- package/dist/esm/types/push-document.d.ts +20 -0
- package/dist/esm/types/quote.d.ts +12 -0
- package/dist/esm/types/uid.d.ts +1 -0
- package/dist/esm/types/user.d.ts +13 -0
- package/dist/esm/types/wordle-game-state.d.ts +8 -0
- package/dist/esm/types/wordle-game.d.ts +18 -0
- package/dist/esm/types/wordle-leaderboard.d.ts +28 -0
- package/dist/esm/types/wordle-monthly-score.d.ts +32 -0
- package/dist/esm/types/wordle-score.d.ts +16 -0
- package/dist/esm/types/worlde-game-state-document.d.ts +12 -0
- package/dist/esm/types/worlde-game-state-document.js +1 -0
- package/package.json +12 -6
- /package/dist/{constants → cjs/constants}/collections.d.ts +0 -0
- /package/dist/{constants → cjs/constants}/index.d.ts +0 -0
- /package/dist/{enums/permissions.d.ts → cjs/enums/group-permission.d.ts} +0 -0
- /package/dist/{enums → cjs/enums}/push-settings-options.d.ts +0 -0
- /package/dist/{index.d.ts → cjs/index.d.ts} +0 -0
- /package/dist/{types → cjs/types}/comment.d.ts +0 -0
- /package/dist/{types → cjs/types}/fcm-token.d.ts +0 -0
- /package/dist/{types → cjs/types}/group-general-data.d.ts +0 -0
- /package/dist/{types → cjs/types}/group.d.ts +0 -0
- /package/dist/{types → cjs/types}/index.d.ts +0 -0
- /package/dist/{types → cjs/types}/match-tries.d.ts +0 -0
- /package/dist/{types → cjs/types}/push-document.d.ts +0 -0
- /package/dist/{types → cjs/types}/quote.d.ts +0 -0
- /package/dist/{types → cjs/types}/uid.d.ts +0 -0
- /package/dist/{types → cjs/types}/user.d.ts +0 -0
- /package/dist/{types → cjs/types}/wordle-game-state.d.ts +0 -0
- /package/dist/{types → cjs/types}/wordle-game.d.ts +0 -0
- /package/dist/{types → cjs/types}/wordle-leaderboard.d.ts +0 -0
- /package/dist/{types → cjs/types}/wordle-monthly-score.d.ts +0 -0
- /package/dist/{types → cjs/types}/worlde-game-state-document.d.ts +0 -0
- /package/dist/{constants → esm/constants}/collections.js +0 -0
- /package/dist/{constants/index.js → esm/constants/index.d.ts} +0 -0
- /package/dist/{enums/permissions.js → esm/enums/group-permission.js} +0 -0
- /package/dist/{enums → esm/enums}/push-settings-options.js +0 -0
- /package/dist/{index.js → esm/index.d.ts} +0 -0
- /package/dist/{types → esm/types}/comment.js +0 -0
- /package/dist/{types → esm/types}/fcm-token.js +0 -0
- /package/dist/{types → esm/types}/group-general-data.js +0 -0
- /package/dist/{types → esm/types}/group-member.js +0 -0
- /package/dist/{types → esm/types}/group.js +0 -0
- /package/dist/{types/index.js → esm/types/index.d.ts} +0 -0
- /package/dist/{types → esm/types}/match-tries.js +0 -0
- /package/dist/{types → esm/types}/push-document.js +0 -0
- /package/dist/{types → esm/types}/quote.js +0 -0
- /package/dist/{types → esm/types}/uid.js +0 -0
- /package/dist/{types → esm/types}/user.js +0 -0
- /package/dist/{types → esm/types}/wordle-game-state.js +0 -0
- /package/dist/{types → esm/types}/wordle-game.js +0 -0
- /package/dist/{types → esm/types}/wordle-leaderboard.js +0 -0
- /package/dist/{types → esm/types}/wordle-monthly-score.js +0 -0
- /package/dist/{types/worlde-game-state-document.js → esm/types/wordle-score.js} +0 -0
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.WORDLE_SCORES_COLLECTION_PATH = exports.WORDLE_MONTHLY_SCORES_COLLECTION_PATH = exports.WORDLE_LEADERBOARD_COLLECTION_PATH = exports.WORDLE_GAMES_COLLECTION_PATH = exports.GROUP_COLLECTION_PATH = exports.USER_COLLECTION_PATH = void 0;
|
|
4
|
+
exports.USER_COLLECTION_PATH = "users";
|
|
5
|
+
exports.GROUP_COLLECTION_PATH = "groups";
|
|
6
|
+
exports.WORDLE_GAMES_COLLECTION_PATH = "wordle_games";
|
|
7
|
+
exports.WORDLE_LEADERBOARD_COLLECTION_PATH = "wordle_leaderboard";
|
|
8
|
+
exports.WORDLE_MONTHLY_SCORES_COLLECTION_PATH = "wordle_monthly_scores";
|
|
9
|
+
exports.WORDLE_SCORES_COLLECTION_PATH = "wordle_scores";
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./collections"), exports);
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.GroupPermission = void 0;
|
|
4
|
+
var GroupPermission;
|
|
5
|
+
(function (GroupPermission) {
|
|
6
|
+
GroupPermission["ADMIN"] = "admin";
|
|
7
|
+
GroupPermission["ORGANISER"] = "organiser";
|
|
8
|
+
GroupPermission["MEMBER"] = "member";
|
|
9
|
+
})(GroupPermission || (exports.GroupPermission = GroupPermission = {}));
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export * from "./
|
|
1
|
+
export * from "./group-permission";
|
|
2
2
|
export * from "./push-settings-options";
|
|
@@ -0,0 +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
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./group-permission"), exports);
|
|
18
|
+
__exportStar(require("./push-settings-options"), exports);
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.PushSettingsOptions = void 0;
|
|
4
|
+
var PushSettingsOptions;
|
|
5
|
+
(function (PushSettingsOptions) {
|
|
6
|
+
PushSettingsOptions["EVENT_CREATE"] = "event_create";
|
|
7
|
+
PushSettingsOptions["GROUP_MEMBER_JOINED"] = "group_member_joined";
|
|
8
|
+
PushSettingsOptions["QUOTE_CREATE"] = "quote_create";
|
|
9
|
+
PushSettingsOptions["QUOTE_COMMENT"] = "quote_comment";
|
|
10
|
+
PushSettingsOptions["EVENT_COMMENT"] = "event_comment";
|
|
11
|
+
PushSettingsOptions["PHOTO_CREATE"] = "photo_create";
|
|
12
|
+
PushSettingsOptions["PHOTO_COMMENT"] = "photo_comment";
|
|
13
|
+
})(PushSettingsOptions || (exports.PushSettingsOptions = PushSettingsOptions = {}));
|
|
@@ -0,0 +1,39 @@
|
|
|
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 __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
+
exports.constants = exports.enums = exports.types = void 0;
|
|
37
|
+
exports.types = __importStar(require("./types"));
|
|
38
|
+
exports.enums = __importStar(require("./enums"));
|
|
39
|
+
exports.constants = __importStar(require("./constants"));
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./comment"), exports);
|
|
18
|
+
__exportStar(require("./fcm-token"), exports);
|
|
19
|
+
__exportStar(require("./group-general-data"), exports);
|
|
20
|
+
__exportStar(require("./group-member"), exports);
|
|
21
|
+
__exportStar(require("./group"), exports);
|
|
22
|
+
__exportStar(require("./match-tries"), exports);
|
|
23
|
+
__exportStar(require("./push-document"), exports);
|
|
24
|
+
__exportStar(require("./quote"), exports);
|
|
25
|
+
__exportStar(require("./uid"), exports);
|
|
26
|
+
__exportStar(require("./user"), exports);
|
|
27
|
+
__exportStar(require("./wordle-game-state"), exports);
|
|
28
|
+
__exportStar(require("./wordle-game"), exports);
|
|
29
|
+
__exportStar(require("./wordle-leaderboard"), exports);
|
|
30
|
+
__exportStar(require("./wordle-monthly-score"), exports);
|
|
31
|
+
__exportStar(require("./wordle-monthly-score"), exports);
|
|
32
|
+
__exportStar(require("./worlde-game-state-document"), exports);
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { Timestamp } from "firebase-admin/firestore";
|
|
2
|
+
import type { StringifiedWordleGameState } from "./wordle-game-state";
|
|
3
|
+
export type WordleScore = {
|
|
4
|
+
created_at: Timestamp;
|
|
5
|
+
game_id: string;
|
|
6
|
+
game_state: StringifiedWordleGameState;
|
|
7
|
+
has_lost: boolean;
|
|
8
|
+
has_won: boolean;
|
|
9
|
+
language: string;
|
|
10
|
+
new_score: number | null;
|
|
11
|
+
score: number;
|
|
12
|
+
number_of_tries_needed: number;
|
|
13
|
+
updated_at: Timestamp;
|
|
14
|
+
user_id: string;
|
|
15
|
+
username: string;
|
|
16
|
+
};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export declare const USER_COLLECTION_PATH = "users";
|
|
2
|
+
export declare const GROUP_COLLECTION_PATH = "groups";
|
|
3
|
+
export declare const WORDLE_GAMES_COLLECTION_PATH = "wordle_games";
|
|
4
|
+
export declare const WORDLE_LEADERBOARD_COLLECTION_PATH = "wordle_leaderboard";
|
|
5
|
+
export declare const WORDLE_MONTHLY_SCORES_COLLECTION_PATH = "wordle_monthly_scores";
|
|
6
|
+
export declare const WORDLE_SCORES_COLLECTION_PATH = "wordle_scores";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./collections";
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export * from "./
|
|
1
|
+
export * from "./group-permission";
|
|
2
2
|
export * from "./push-settings-options";
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export declare enum PushSettingsOptions {
|
|
2
|
+
EVENT_CREATE = "event_create",
|
|
3
|
+
GROUP_MEMBER_JOINED = "group_member_joined",
|
|
4
|
+
QUOTE_CREATE = "quote_create",
|
|
5
|
+
QUOTE_COMMENT = "quote_comment",
|
|
6
|
+
EVENT_COMMENT = "event_comment",
|
|
7
|
+
PHOTO_CREATE = "photo_create",
|
|
8
|
+
PHOTO_COMMENT = "photo_comment"
|
|
9
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export type FcmToken = string;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { Timestamp } from "firebase-admin/firestore";
|
|
2
|
+
import type { GroupGeneralData } from "./group-general-data";
|
|
3
|
+
import type { GroupMember } from "./group-member";
|
|
4
|
+
import type { Uid } from "./uid";
|
|
5
|
+
export type Group = {
|
|
6
|
+
created_at: Timestamp;
|
|
7
|
+
updated_at: Timestamp;
|
|
8
|
+
description: string | undefined;
|
|
9
|
+
general_data: GroupGeneralData;
|
|
10
|
+
ical_token: string;
|
|
11
|
+
join_token: string | null | undefined;
|
|
12
|
+
join_token_timestamp: Timestamp | null | undefined;
|
|
13
|
+
members: {
|
|
14
|
+
[key: Uid]: GroupMember;
|
|
15
|
+
};
|
|
16
|
+
members_uuids: string[];
|
|
17
|
+
name: string;
|
|
18
|
+
premium: boolean | null | undefined;
|
|
19
|
+
premium_till: Timestamp | null | undefined;
|
|
20
|
+
};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export * from "./comment";
|
|
2
|
+
export * from "./fcm-token";
|
|
3
|
+
export * from "./group-general-data";
|
|
4
|
+
export * from "./group-member";
|
|
5
|
+
export * from "./group";
|
|
6
|
+
export * from "./match-tries";
|
|
7
|
+
export * from "./push-document";
|
|
8
|
+
export * from "./quote";
|
|
9
|
+
export * from "./uid";
|
|
10
|
+
export * from "./user";
|
|
11
|
+
export * from "./wordle-game-state";
|
|
12
|
+
export * from "./wordle-game";
|
|
13
|
+
export * from "./wordle-leaderboard";
|
|
14
|
+
export * from "./wordle-monthly-score";
|
|
15
|
+
export * from "./wordle-monthly-score";
|
|
16
|
+
export * from "./worlde-game-state-document";
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { Timestamp } from "firebase-admin/firestore";
|
|
2
|
+
import type { PushSettingsOptions } from "../enums/push-settings-options";
|
|
3
|
+
import type { Uid } from "./uid";
|
|
4
|
+
export type AllPushSettings = {
|
|
5
|
+
[key in PushSettingsOptions]: boolean | null;
|
|
6
|
+
};
|
|
7
|
+
export type GroupPushDocumentSettings = {
|
|
8
|
+
[key: Uid]: AllPushSettings;
|
|
9
|
+
};
|
|
10
|
+
export type GroupPushDocumentTokens = {
|
|
11
|
+
[key: Uid]: Array<PushTokenObject>;
|
|
12
|
+
};
|
|
13
|
+
export type PushTokenObject = {
|
|
14
|
+
token: string | null;
|
|
15
|
+
updated_at: Timestamp | string;
|
|
16
|
+
};
|
|
17
|
+
export type GroupPushDocument = {
|
|
18
|
+
settings: GroupPushDocumentSettings;
|
|
19
|
+
tokens: GroupPushDocumentTokens;
|
|
20
|
+
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { Timestamp } from "firebase-admin/firestore";
|
|
2
|
+
export type Quote = {
|
|
3
|
+
authors: Array<string> | null;
|
|
4
|
+
quote: string;
|
|
5
|
+
context: string | null;
|
|
6
|
+
created_by: string;
|
|
7
|
+
custom_author: string | null;
|
|
8
|
+
timestamp: Date | Timestamp;
|
|
9
|
+
trigrams: {
|
|
10
|
+
[key: string]: string;
|
|
11
|
+
} | null;
|
|
12
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export type Uid = string;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { Timestamp } from "firebase-admin/firestore";
|
|
2
|
+
import type { PushTokenObject, AllPushSettings } from "./push-document";
|
|
3
|
+
export type User = {
|
|
4
|
+
active_group: "";
|
|
5
|
+
birthdate: Timestamp;
|
|
6
|
+
groups: string[];
|
|
7
|
+
message_tokens?: Array<PushTokenObject>;
|
|
8
|
+
push_settings?: AllPushSettings;
|
|
9
|
+
language?: string;
|
|
10
|
+
name: string;
|
|
11
|
+
new_auth_claim: boolean;
|
|
12
|
+
profile_picture: string;
|
|
13
|
+
};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { Timestamp } from "firebase-admin/firestore";
|
|
2
|
+
export type WordleGame = {
|
|
3
|
+
language: string;
|
|
4
|
+
word: string;
|
|
5
|
+
locked: boolean;
|
|
6
|
+
date: Timestamp;
|
|
7
|
+
created_at: Timestamp;
|
|
8
|
+
updated_at: Timestamp;
|
|
9
|
+
game_number: number;
|
|
10
|
+
year?: number;
|
|
11
|
+
month?: number;
|
|
12
|
+
date_number?: number;
|
|
13
|
+
day?: number;
|
|
14
|
+
year_utc?: number;
|
|
15
|
+
month_utc?: number;
|
|
16
|
+
date_number_utc?: number;
|
|
17
|
+
day_utc?: number;
|
|
18
|
+
};
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import type { Timestamp } from "firebase-admin/firestore";
|
|
2
|
+
import type { MatchTries } from "./match-tries";
|
|
3
|
+
export type WordleLeaderboard = {
|
|
4
|
+
created_at: Timestamp;
|
|
5
|
+
has_lost: number;
|
|
6
|
+
has_won: number;
|
|
7
|
+
language: string;
|
|
8
|
+
match_tries: MatchTries;
|
|
9
|
+
matches_played: string[];
|
|
10
|
+
new_score: number | null;
|
|
11
|
+
score: number;
|
|
12
|
+
updated_at: Timestamp;
|
|
13
|
+
username: string;
|
|
14
|
+
user_id: string;
|
|
15
|
+
};
|
|
16
|
+
export type PartialWordleLeaderboard = Partial<{
|
|
17
|
+
created_at: Timestamp;
|
|
18
|
+
has_lost: number;
|
|
19
|
+
has_won: number;
|
|
20
|
+
language: string;
|
|
21
|
+
match_tries: MatchTries;
|
|
22
|
+
matches_played: string[];
|
|
23
|
+
new_score: number | null;
|
|
24
|
+
score: number;
|
|
25
|
+
updated_at: Timestamp;
|
|
26
|
+
username: string;
|
|
27
|
+
user_id: string;
|
|
28
|
+
}>;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import type { Timestamp } from "firebase-admin/firestore";
|
|
2
|
+
import type { MatchTries } from "./match-tries";
|
|
3
|
+
export type WordleMonthlyScore = {
|
|
4
|
+
created_at: Timestamp;
|
|
5
|
+
has_lost: number;
|
|
6
|
+
has_won: number;
|
|
7
|
+
language: string;
|
|
8
|
+
match_tries: MatchTries;
|
|
9
|
+
matches_played: string[];
|
|
10
|
+
month: number;
|
|
11
|
+
new_score: number;
|
|
12
|
+
score: number;
|
|
13
|
+
updated_at: Timestamp;
|
|
14
|
+
user_id: string;
|
|
15
|
+
username: string;
|
|
16
|
+
year: number;
|
|
17
|
+
};
|
|
18
|
+
export type PartialWordleMonthlyScore = Partial<{
|
|
19
|
+
created_at: Timestamp;
|
|
20
|
+
has_lost: number;
|
|
21
|
+
has_won: number;
|
|
22
|
+
language: string;
|
|
23
|
+
match_tries: MatchTries;
|
|
24
|
+
matches_played: string[];
|
|
25
|
+
month: number;
|
|
26
|
+
new_score: number;
|
|
27
|
+
score: number;
|
|
28
|
+
updated_at: Timestamp;
|
|
29
|
+
user_id: string;
|
|
30
|
+
username: string;
|
|
31
|
+
year: number;
|
|
32
|
+
}>;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { Timestamp } from "firebase-admin/firestore";
|
|
2
|
+
import type { StringifiedWordleGameState } from "./wordle-game-state";
|
|
3
|
+
export type WordleScore = {
|
|
4
|
+
created_at: Timestamp;
|
|
5
|
+
game_id: string;
|
|
6
|
+
game_state: StringifiedWordleGameState;
|
|
7
|
+
has_lost: boolean;
|
|
8
|
+
has_won: boolean;
|
|
9
|
+
language: string;
|
|
10
|
+
new_score: number | null;
|
|
11
|
+
score: number;
|
|
12
|
+
number_of_tries_needed: number;
|
|
13
|
+
updated_at: Timestamp;
|
|
14
|
+
user_id: string;
|
|
15
|
+
username: string;
|
|
16
|
+
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { StringifiedWordleGameState } from "./wordle-game-state";
|
|
2
|
+
import type { Timestamp } from "firebase-admin/firestore";
|
|
3
|
+
export type WorldeGameStateDocument = {
|
|
4
|
+
calculated_score: number;
|
|
5
|
+
game_state: StringifiedWordleGameState;
|
|
6
|
+
has_finished: boolean;
|
|
7
|
+
has_lost: boolean;
|
|
8
|
+
has_won: boolean;
|
|
9
|
+
number_of_tries_needed: number;
|
|
10
|
+
updated_at: Timestamp;
|
|
11
|
+
user_id: string;
|
|
12
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/package.json
CHANGED
|
@@ -1,24 +1,28 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kekkle/shared",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.6",
|
|
4
4
|
"description": "Shared logic and types for Kekkle frontend and functions",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"exports": {
|
|
7
7
|
".": {
|
|
8
8
|
"types": "./dist/index.d.ts",
|
|
9
|
-
"import": "./dist/index.js"
|
|
9
|
+
"import": "./dist/esm/index.js",
|
|
10
|
+
"require": "./dist/cjs/index.js"
|
|
10
11
|
},
|
|
11
12
|
"./types": {
|
|
12
13
|
"types": "./dist/types/index.d.ts",
|
|
13
|
-
"import": "./dist/types/index.js"
|
|
14
|
+
"import": "./dist/esm/types/index.js",
|
|
15
|
+
"require": "./dist/cjs/types/index.js"
|
|
14
16
|
},
|
|
15
17
|
"./enums": {
|
|
16
18
|
"types": "./dist/enums/index.d.ts",
|
|
17
|
-
"import": "./dist/enums/index.js"
|
|
19
|
+
"import": "./dist/esm/enums/index.js",
|
|
20
|
+
"require": "./dist/cjs/enums/index.js"
|
|
18
21
|
},
|
|
19
22
|
"./constants": {
|
|
20
23
|
"types": "./dist/constants/index.d.ts",
|
|
21
|
-
"import": "./dist/constants/index.js"
|
|
24
|
+
"import": "./dist/esm/constants/index.js",
|
|
25
|
+
"require": "./dist/cjs/constants/index.js"
|
|
22
26
|
}
|
|
23
27
|
},
|
|
24
28
|
"files": [
|
|
@@ -26,7 +30,9 @@
|
|
|
26
30
|
],
|
|
27
31
|
"scripts": {
|
|
28
32
|
"test": "echo \"Error: no test specified\" && exit 1",
|
|
29
|
-
"build": "
|
|
33
|
+
"build": "npm run build:esm && npm run build:cjs",
|
|
34
|
+
"build:esm": "tsc -p tsconfig.esm.json",
|
|
35
|
+
"build:cjs": "tsc -p tsconfig.cjs.json",
|
|
30
36
|
"prepublishOnly": "npm run build",
|
|
31
37
|
"lint": "eslint .",
|
|
32
38
|
"lint:fix": "eslint . --fix"
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|