@stevenkellner/team-conduct-api 2.0.2 → 2.0.4
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/lib/src/functions/fine/add.d.ts +10 -8
- package/lib/src/functions/fine/add.js +3 -4
- package/lib/src/functions/fine/delete.d.ts +10 -8
- package/lib/src/functions/fine/delete.js +3 -4
- package/lib/src/functions/fine/update.d.ts +10 -8
- package/lib/src/functions/fine/update.js +3 -4
- package/lib/src/functions/fineTemplate/add.d.ts +8 -6
- package/lib/src/functions/fineTemplate/add.js +3 -4
- package/lib/src/functions/fineTemplate/delete.d.ts +8 -6
- package/lib/src/functions/fineTemplate/delete.js +3 -4
- package/lib/src/functions/fineTemplate/update.d.ts +8 -6
- package/lib/src/functions/fineTemplate/update.js +3 -4
- package/lib/src/functions/firebaseFunctionsContext.d.ts +39 -0
- package/lib/src/functions/firebaseFunctionsContext.js +43 -0
- package/lib/src/functions/index.d.ts +1 -0
- package/lib/src/functions/index.js +1 -0
- package/lib/src/functions/invitation/getInvitation.d.ts +42 -40
- package/lib/src/functions/invitation/getInvitation.js +59 -58
- package/lib/src/functions/invitation/invite.d.ts +1 -1
- package/lib/src/functions/invitation/invite.js +3 -4
- package/lib/src/functions/invitation/register.d.ts +8 -6
- package/lib/src/functions/invitation/register.js +3 -4
- package/lib/src/functions/invitation/withdraw.d.ts +1 -1
- package/lib/src/functions/invitation/withdraw.js +3 -4
- package/lib/src/functions/notification/register.d.ts +9 -7
- package/lib/src/functions/notification/register.js +3 -4
- package/lib/src/functions/notification/subscribe.d.ts +9 -7
- package/lib/src/functions/notification/subscribe.js +3 -4
- package/lib/src/functions/paypalMe/edit.d.ts +8 -6
- package/lib/src/functions/paypalMe/edit.js +3 -4
- package/lib/src/functions/person/add.d.ts +9 -7
- package/lib/src/functions/person/add.js +3 -4
- package/lib/src/functions/person/delete.d.ts +8 -6
- package/lib/src/functions/person/delete.js +3 -4
- package/lib/src/functions/person/update.d.ts +9 -7
- package/lib/src/functions/person/update.js +3 -4
- package/lib/src/functions/team/new.d.ts +11 -9
- package/lib/src/functions/team/new.js +3 -4
- package/lib/src/functions/user/kickout.d.ts +8 -6
- package/lib/src/functions/user/kickout.js +3 -4
- package/lib/src/functions/user/login.d.ts +1 -1
- package/lib/src/functions/user/login.js +3 -4
- package/lib/src/functions/user/roleEdit.d.ts +9 -7
- package/lib/src/functions/user/roleEdit.js +3 -4
- package/lib/src/types/PayedState.d.ts +7 -0
- package/lib/src/types/PayedState.js +15 -0
- package/lib/test/types/PayedState.test.js +31 -0
- package/lib/tsconfig.tsbuildinfo +1 -1
- package/package.json +2 -2
- package/src/functions/fine/add.ts +10 -8
- package/src/functions/fine/delete.ts +10 -7
- package/src/functions/fine/update.ts +11 -8
- package/src/functions/fineTemplate/add.ts +9 -6
- package/src/functions/fineTemplate/delete.ts +9 -6
- package/src/functions/fineTemplate/update.ts +9 -5
- package/src/functions/firebaseFunctionsContext.ts +48 -0
- package/src/functions/index.ts +1 -0
- package/src/functions/invitation/getInvitation.ts +82 -79
- package/src/functions/invitation/invite.ts +1 -1
- package/src/functions/invitation/register.ts +9 -6
- package/src/functions/invitation/withdraw.ts +1 -1
- package/src/functions/notification/register.ts +9 -6
- package/src/functions/notification/subscribe.ts +10 -7
- package/src/functions/paypalMe/edit.ts +9 -6
- package/src/functions/person/add.ts +10 -7
- package/src/functions/person/delete.ts +8 -5
- package/src/functions/person/update.ts +10 -7
- package/src/functions/team/new.ts +12 -9
- package/src/functions/user/kickout.ts +8 -6
- package/src/functions/user/login.ts +1 -1
- package/src/functions/user/roleEdit.ts +10 -7
- package/src/types/PayedState.ts +15 -0
|
@@ -2,17 +2,20 @@ import { Flattable, ObjectTypeBuilder, ValueTypeBuilder } from '@stevenkellner/t
|
|
|
2
2
|
import { FirebaseFunction } from '@stevenkellner/firebase-function';
|
|
3
3
|
import { Person, PersonPrivateProperties, User, Team } from '../../types';
|
|
4
4
|
|
|
5
|
-
export
|
|
6
|
-
id: Team.Id
|
|
7
|
-
name: string
|
|
8
|
-
paypalMeLink: string | null
|
|
9
|
-
personId: Person.Id
|
|
10
|
-
personProperties: PersonPrivateProperties
|
|
11
|
-
};
|
|
5
|
+
export namespace TeamNewFunction {
|
|
12
6
|
|
|
13
|
-
export
|
|
7
|
+
export type Parameters = {
|
|
8
|
+
id: Team.Id
|
|
9
|
+
name: string
|
|
10
|
+
paypalMeLink: string | null
|
|
11
|
+
personId: Person.Id
|
|
12
|
+
personProperties: PersonPrivateProperties
|
|
13
|
+
};
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export class TeamNewFunction implements FirebaseFunction<TeamNewFunction.Parameters, User> {
|
|
14
17
|
|
|
15
|
-
public parametersBuilder = new ObjectTypeBuilder<Flattable.Flatten<
|
|
18
|
+
public parametersBuilder = new ObjectTypeBuilder<Flattable.Flatten<TeamNewFunction.Parameters>, TeamNewFunction.Parameters>({
|
|
16
19
|
id: Team.Id.builder,
|
|
17
20
|
name: new ValueTypeBuilder(),
|
|
18
21
|
paypalMeLink: new ValueTypeBuilder(),
|
|
@@ -2,14 +2,16 @@ import { FirebaseFunction } from '@stevenkellner/firebase-function';
|
|
|
2
2
|
import { Team, User } from '../../types';
|
|
3
3
|
import { Flattable, ObjectTypeBuilder, ValueTypeBuilder } from '@stevenkellner/typescript-common-functionality';
|
|
4
4
|
|
|
5
|
-
export
|
|
6
|
-
teamId: Team.Id
|
|
7
|
-
userId: User.Id
|
|
8
|
-
};
|
|
5
|
+
export namespace UserKickoutFunction {
|
|
9
6
|
|
|
10
|
-
export
|
|
7
|
+
export type Parameters = {
|
|
8
|
+
teamId: Team.Id
|
|
9
|
+
userId: User.Id
|
|
10
|
+
};
|
|
11
|
+
}
|
|
12
|
+
export class UserKickoutFunction implements FirebaseFunction<UserKickoutFunction.Parameters, void> {
|
|
11
13
|
|
|
12
|
-
public parametersBuilder = new ObjectTypeBuilder<Flattable.Flatten<
|
|
14
|
+
public parametersBuilder = new ObjectTypeBuilder<Flattable.Flatten<UserKickoutFunction.Parameters>, UserKickoutFunction.Parameters>({
|
|
13
15
|
teamId: Team.Id.builder,
|
|
14
16
|
userId: User.Id.builder
|
|
15
17
|
});
|
|
@@ -2,7 +2,7 @@ import { FirebaseFunction } from '@stevenkellner/firebase-function';
|
|
|
2
2
|
import { User } from '../../types';
|
|
3
3
|
import { ValueTypeBuilder } from '@stevenkellner/typescript-common-functionality';
|
|
4
4
|
|
|
5
|
-
export
|
|
5
|
+
export class UserLoginFunction implements FirebaseFunction<null, User> {
|
|
6
6
|
|
|
7
7
|
public parametersBuilder = new ValueTypeBuilder<null>();
|
|
8
8
|
|
|
@@ -2,15 +2,18 @@ import { FirebaseFunction } from '@stevenkellner/firebase-function';
|
|
|
2
2
|
import { Person, Team, UserRole } from '../../types';
|
|
3
3
|
import { ArrayTypeBuilder, Flattable, ObjectTypeBuilder, ValueTypeBuilder } from '@stevenkellner/typescript-common-functionality';
|
|
4
4
|
|
|
5
|
-
export
|
|
6
|
-
teamId: Team.Id
|
|
7
|
-
personId: Person.Id
|
|
8
|
-
roles: UserRole[]
|
|
9
|
-
};
|
|
5
|
+
export namespace UserRoleEditFunction {
|
|
10
6
|
|
|
11
|
-
export
|
|
7
|
+
export type Parameters = {
|
|
8
|
+
teamId: Team.Id
|
|
9
|
+
personId: Person.Id
|
|
10
|
+
roles: UserRole[]
|
|
11
|
+
};
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export class UserRoleEditFunction implements FirebaseFunction<UserRoleEditFunction.Parameters, void> {
|
|
12
15
|
|
|
13
|
-
public parametersBuilder = new ObjectTypeBuilder<Flattable.Flatten<
|
|
16
|
+
public parametersBuilder = new ObjectTypeBuilder<Flattable.Flatten<UserRoleEditFunction.Parameters>, UserRoleEditFunction.Parameters>({
|
|
14
17
|
teamId: Team.Id.builder,
|
|
15
18
|
personId: Person.Id.builder,
|
|
16
19
|
roles: new ArrayTypeBuilder(new ValueTypeBuilder())
|
package/src/types/PayedState.ts
CHANGED
|
@@ -29,6 +29,21 @@ export namespace PayedState {
|
|
|
29
29
|
return Localization.shared(locale).payedState[state].value();
|
|
30
30
|
}
|
|
31
31
|
|
|
32
|
+
/**
|
|
33
|
+
* Toggles the payment state between 'payed' and 'notPayed'.
|
|
34
|
+
*
|
|
35
|
+
* @param state - The current payment state
|
|
36
|
+
* @returns The toggled payment state
|
|
37
|
+
*/
|
|
38
|
+
export function toggled(state: PayedState): PayedState {
|
|
39
|
+
switch (state) {
|
|
40
|
+
case 'payed':
|
|
41
|
+
return 'notPayed';
|
|
42
|
+
case 'notPayed':
|
|
43
|
+
return 'payed';
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
|
|
32
47
|
/**
|
|
33
48
|
* Type builder for PayedState serialization/deserialization.
|
|
34
49
|
*/
|