@stevenkellner/team-conduct-api 1.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/.mocharc.js +22 -0
- package/.nyc_output/07911218-95ea-4964-b03a-325e6bcd9245.json +1 -0
- package/.nyc_output/ec4857fa-9793-4945-8be7-1f74d84b155e.json +1 -0
- package/.nyc_output/processinfo/07911218-95ea-4964-b03a-325e6bcd9245.json +131 -0
- package/.nyc_output/processinfo/ec4857fa-9793-4945-8be7-1f74d84b155e.json +131 -0
- package/.nyc_output/processinfo/index.json +131 -0
- package/.vscode/launch.json +14 -0
- package/LICENSE +21 -0
- package/coverage/base.css +224 -0
- package/coverage/block-navigation.js +87 -0
- package/coverage/favicon.png +0 -0
- package/coverage/index.html +251 -0
- package/coverage/prettify.css +1 -0
- package/coverage/prettify.js +2 -0
- package/coverage/sort-arrow-sprite.png +0 -0
- package/coverage/sorter.js +196 -0
- package/coverage/src/Firestore.ts.html +273 -0
- package/coverage/src/FirestoreScheme.ts.html +156 -0
- package/coverage/src/checkAuthentication.ts.html +192 -0
- package/coverage/src/firebaseFunctions.ts.html +252 -0
- package/coverage/src/functions/fine/add.ts.html +255 -0
- package/coverage/src/functions/fine/delete.ts.html +255 -0
- package/coverage/src/functions/fine/index.html +146 -0
- package/coverage/src/functions/fine/update.ts.html +258 -0
- package/coverage/src/functions/fineTemplate/add.ts.html +195 -0
- package/coverage/src/functions/fineTemplate/delete.ts.html +195 -0
- package/coverage/src/functions/fineTemplate/index.html +146 -0
- package/coverage/src/functions/fineTemplate/update.ts.html +195 -0
- package/coverage/src/functions/invitation/index.html +146 -0
- package/coverage/src/functions/invitation/invite.ts.html +177 -0
- package/coverage/src/functions/invitation/register.ts.html +258 -0
- package/coverage/src/functions/invitation/withdraw.ts.html +165 -0
- package/coverage/src/functions/notification/index.html +131 -0
- package/coverage/src/functions/notification/register.ts.html +210 -0
- package/coverage/src/functions/notification/subscribe.ts.html +207 -0
- package/coverage/src/functions/paypalMe/edit.ts.html +201 -0
- package/coverage/src/functions/paypalMe/index.html +116 -0
- package/coverage/src/functions/person/add.ts.html +201 -0
- package/coverage/src/functions/person/delete.ts.html +204 -0
- package/coverage/src/functions/person/index.html +146 -0
- package/coverage/src/functions/person/update.ts.html +204 -0
- package/coverage/src/functions/team/index.html +116 -0
- package/coverage/src/functions/team/new.ts.html +255 -0
- package/coverage/src/functions/user/index.html +131 -0
- package/coverage/src/functions/user/login.ts.html +165 -0
- package/coverage/src/functions/user/roleEdit.ts.html +225 -0
- package/coverage/src/index.html +191 -0
- package/coverage/src/index.ts.html +156 -0
- package/coverage/src/pushNotification.ts.html +199 -0
- package/coverage/src/types/Configuration.ts.html +220 -0
- package/coverage/src/types/Fine.ts.html +262 -0
- package/coverage/src/types/FineAmount.ts.html +457 -0
- package/coverage/src/types/FineTemplate.ts.html +250 -0
- package/coverage/src/types/FineTemplateRepetition.ts.html +241 -0
- package/coverage/src/types/Invitation.ts.html +253 -0
- package/coverage/src/types/MoneyAmount.ts.html +196 -0
- package/coverage/src/types/NotificationProperties.ts.html +280 -0
- package/coverage/src/types/PayedState.ts.html +121 -0
- package/coverage/src/types/Person.ts.html +253 -0
- package/coverage/src/types/PersonPrivateProperties.ts.html +196 -0
- package/coverage/src/types/PersonSignInProperties.ts.html +211 -0
- package/coverage/src/types/Team.ts.html +232 -0
- package/coverage/src/types/User.ts.html +313 -0
- package/coverage/src/types/UserRole.ts.html +142 -0
- package/coverage/src/types/index.html +341 -0
- package/coverage/src/types/index.ts.html +130 -0
- package/eslint.config.js +72 -0
- package/firestore-debug.log +0 -0
- package/index.ts +3 -0
- package/package.json +62 -0
- package/src/.env +1 -0
- package/src/Firestore.ts +63 -0
- package/src/FirestoreScheme.ts +24 -0
- package/src/checkAuthentication.ts +36 -0
- package/src/firebaseFunctionCreators.ts +56 -0
- package/src/functions/fine/add.ts +54 -0
- package/src/functions/fine/delete.ts +54 -0
- package/src/functions/fine/update.ts +55 -0
- package/src/functions/fineTemplate/add.ts +34 -0
- package/src/functions/fineTemplate/delete.ts +34 -0
- package/src/functions/fineTemplate/update.ts +34 -0
- package/src/functions/invitation/invite.ts +28 -0
- package/src/functions/invitation/register.ts +54 -0
- package/src/functions/invitation/withdraw.ts +24 -0
- package/src/functions/notification/register.ts +39 -0
- package/src/functions/notification/subscribe.ts +38 -0
- package/src/functions/paypalMe/edit.ts +36 -0
- package/src/functions/person/add.ts +36 -0
- package/src/functions/person/delete.ts +37 -0
- package/src/functions/person/update.ts +37 -0
- package/src/functions/team/new.ts +54 -0
- package/src/functions/user/login.ts +25 -0
- package/src/functions/user/roleEdit.ts +44 -0
- package/src/index.ts +24 -0
- package/src/locales/de.json +30 -0
- package/src/locales/en.json +30 -0
- package/src/pushNotification.ts +38 -0
- package/src/types/Configuration.ts +54 -0
- package/src/types/Fine.ts +59 -0
- package/src/types/FineAmount.ts +123 -0
- package/src/types/FineTemplate.ts +55 -0
- package/src/types/FineTemplateRepetition.ts +54 -0
- package/src/types/Invitation.ts +56 -0
- package/src/types/MoneyAmount.ts +37 -0
- package/src/types/NotificationProperties.ts +67 -0
- package/src/types/PayedState.ts +12 -0
- package/src/types/Person.ts +56 -0
- package/src/types/PersonPrivateProperties.ts +37 -0
- package/src/types/PersonSignInProperties.ts +42 -0
- package/src/types/Team.ts +49 -0
- package/src/types/User.ts +76 -0
- package/src/types/UserRole.ts +19 -0
- package/src/types/index.ts +15 -0
- package/test/FirebaseApp.ts +64 -0
- package/test/FirebaseAuth.ts +26 -0
- package/test/FirebaseFirestore.ts +20 -0
- package/test/FirebaseFunctions.ts +17 -0
- package/test/RandomData.ts +120 -0
- package/test/createTestTeam.ts +43 -0
- package/test/firebase-rules.test.ts +125 -0
- package/test/functions/fine/add.test.ts +52 -0
- package/test/functions/fine/delete.test.ts +50 -0
- package/test/functions/fine/update.test.ts +39 -0
- package/test/functions/fineTemplate/add.test.ts +35 -0
- package/test/functions/fineTemplate/delete.test.ts +33 -0
- package/test/functions/fineTemplate/update.test.ts +35 -0
- package/test/functions/invitation/invite.test.ts +48 -0
- package/test/functions/invitation/register.test.ts +137 -0
- package/test/functions/invitation/withdraw.test.ts +33 -0
- package/test/functions/notifcation/register.test.ts +47 -0
- package/test/functions/notifcation/subscribe.test.ts +46 -0
- package/test/functions/paypalMe/edit.test.ts +42 -0
- package/test/functions/person/add.test.ts +39 -0
- package/test/functions/person/delete.test.ts +41 -0
- package/test/functions/person/update.test.ts +39 -0
- package/test/functions/team/new.test.ts +139 -0
- package/test/functions/user/login.test.ts +37 -0
- package/test/functions/user/roleEdit.test.ts +47 -0
- package/test/testTeams/testTeam1.ts +63 -0
- package/test/waitForEmulator.ts +11 -0
- package/tsconfig.dev.json +5 -0
- package/tsconfig.json +21 -0
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import { Tagged, UtcDate } from '@stevenkellner/typescript-common-functionality';
|
|
2
|
+
import { MoneyAmount, Fine, FineAmount, Person, PersonPrivateProperties, FineTemplate, FineTemplateRepetition } from '../../src/types';
|
|
3
|
+
import { TestTeam } from '../createTestTeam';
|
|
4
|
+
|
|
5
|
+
const fineIds: [Fine.Id, Fine.Id, Fine.Id] = [
|
|
6
|
+
Tagged.generate('fine'),
|
|
7
|
+
Tagged.generate('fine'),
|
|
8
|
+
Tagged.generate('fine')
|
|
9
|
+
];
|
|
10
|
+
|
|
11
|
+
export const testTeam1: TestTeam = {
|
|
12
|
+
id: Tagged.generate('team'),
|
|
13
|
+
name: 'Test Team 1',
|
|
14
|
+
persons: [
|
|
15
|
+
new Person(
|
|
16
|
+
Tagged.generate('person'),
|
|
17
|
+
new PersonPrivateProperties('John', 'Doe'),
|
|
18
|
+
[fineIds[0], fineIds[1]]
|
|
19
|
+
),
|
|
20
|
+
new Person(
|
|
21
|
+
Tagged.generate('person'),
|
|
22
|
+
new PersonPrivateProperties('Max', 'Mustermann'),
|
|
23
|
+
[fineIds[2]]
|
|
24
|
+
)
|
|
25
|
+
],
|
|
26
|
+
fineTemplates: [
|
|
27
|
+
new FineTemplate(
|
|
28
|
+
Tagged.generate('fineTemplate'),
|
|
29
|
+
'Fine Template 1',
|
|
30
|
+
FineAmount.money(new MoneyAmount(10, 50)),
|
|
31
|
+
null
|
|
32
|
+
),
|
|
33
|
+
new FineTemplate(
|
|
34
|
+
Tagged.generate('fineTemplate'),
|
|
35
|
+
'Fine Template 2',
|
|
36
|
+
FineAmount.item('crateOfBeer', 1),
|
|
37
|
+
new FineTemplateRepetition('day', 3)
|
|
38
|
+
)
|
|
39
|
+
],
|
|
40
|
+
fines: [
|
|
41
|
+
new Fine(
|
|
42
|
+
fineIds[0],
|
|
43
|
+
'notPayed',
|
|
44
|
+
UtcDate.now,
|
|
45
|
+
'Fine 1',
|
|
46
|
+
FineAmount.money(new MoneyAmount(10, 50))
|
|
47
|
+
),
|
|
48
|
+
new Fine(
|
|
49
|
+
fineIds[1],
|
|
50
|
+
'payed',
|
|
51
|
+
UtcDate.now,
|
|
52
|
+
'Fine 2',
|
|
53
|
+
FineAmount.item('crateOfBeer', 2)
|
|
54
|
+
),
|
|
55
|
+
new Fine(
|
|
56
|
+
fineIds[2],
|
|
57
|
+
'notPayed',
|
|
58
|
+
UtcDate.now,
|
|
59
|
+
'Fine 3',
|
|
60
|
+
FineAmount.money(new MoneyAmount(5, 0))
|
|
61
|
+
)
|
|
62
|
+
]
|
|
63
|
+
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { waitUntilUsed } from 'tcp-port-used';
|
|
2
|
+
|
|
3
|
+
async function waitForEmulators(): Promise<void> {
|
|
4
|
+
await waitUntilUsed(5001, 500, 60000);
|
|
5
|
+
await waitUntilUsed(8080, 500, 60000);
|
|
6
|
+
await new Promise(resolve => {
|
|
7
|
+
setTimeout(resolve, 5000);
|
|
8
|
+
});
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
void waitForEmulators();
|
package/tsconfig.json
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
{
|
|
2
|
+
"compilerOptions": {
|
|
3
|
+
"module": "CommonJS",
|
|
4
|
+
"esModuleInterop": true,
|
|
5
|
+
"noImplicitReturns": true,
|
|
6
|
+
"noUnusedLocals": true,
|
|
7
|
+
"outDir": "./lib",
|
|
8
|
+
"sourceMap": true,
|
|
9
|
+
"strict": true,
|
|
10
|
+
"target": "ESNext",
|
|
11
|
+
"resolveJsonModule": true,
|
|
12
|
+
"skipLibCheck": true,
|
|
13
|
+
"declaration": true
|
|
14
|
+
},
|
|
15
|
+
"compileOnSave": true,
|
|
16
|
+
"include": [
|
|
17
|
+
"index.ts",
|
|
18
|
+
"src/**/*.ts",
|
|
19
|
+
"test/**/*.ts",
|
|
20
|
+
]
|
|
21
|
+
}
|