@stevenkellner/team-conduct-api 2.0.17 → 2.0.19
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 +3 -8
- package/lib/src/functions/fine/add.js +1 -2
- package/lib/src/functions/fine/delete.d.ts +1 -6
- package/lib/src/functions/fine/delete.js +2 -3
- package/lib/src/functions/fine/update.d.ts +2 -8
- package/lib/src/functions/fine/update.js +1 -3
- package/lib/src/functions/fineTemplate/add.d.ts +3 -3
- package/lib/src/functions/fineTemplate/update.d.ts +3 -3
- package/lib/src/functions/firebaseFunctionsContext.d.ts +34 -1
- package/lib/src/functions/firebaseFunctionsContext.js +33 -33
- package/lib/src/functions/index.d.ts +10 -8
- package/lib/src/functions/index.js +11 -8
- package/lib/src/functions/notification/markNotificationAsRead.d.ts +14 -0
- package/lib/src/functions/notification/{subscribe.js → markNotificationAsRead.js} +5 -7
- package/lib/src/functions/person/kickout.d.ts +6 -6
- package/lib/src/functions/person/kickout.js +4 -4
- package/lib/src/functions/person/roleEdit.d.ts +5 -5
- package/lib/src/functions/person/roleEdit.js +3 -3
- package/lib/src/functions/{paypalMe/edit.d.ts → team/delete.d.ts} +5 -7
- package/lib/src/functions/{paypalMe/edit.js → team/delete.js} +4 -5
- package/lib/src/functions/team/new.d.ts +18 -18
- package/lib/src/functions/team/new.js +8 -4
- package/lib/src/functions/team/update.d.ts +34 -0
- package/lib/src/functions/team/update.js +23 -0
- package/lib/src/functions/user/register.d.ts +4 -0
- package/lib/src/functions/user/register.js +3 -1
- package/lib/src/functions/user/update.d.ts +26 -0
- package/lib/src/functions/user/update.js +15 -0
- package/lib/src/index.d.ts +1 -1
- package/lib/src/index.js +1 -1
- package/lib/src/locales/de.d.ts +1 -1
- package/lib/src/locales/de.js +6 -2
- package/lib/src/locales/en.d.ts +6 -2
- package/lib/src/locales/en.js +6 -2
- package/lib/src/types/{MoneyAmount.d.ts → Money.d.ts} +23 -23
- package/lib/src/types/{MoneyAmount.js → Money.js} +25 -25
- package/lib/src/types/fine/Fine.d.ts +275 -0
- package/lib/src/types/fine/Fine.js +318 -0
- package/lib/src/types/fine/FineTemplate.d.ts +154 -0
- package/lib/src/types/fine/FineTemplate.js +170 -0
- package/lib/src/types/{PayedState.d.ts → fine/PayedState.d.ts} +1 -1
- package/lib/src/types/{PayedState.js → fine/PayedState.js} +1 -1
- package/lib/src/types/fine/index.d.ts +3 -0
- package/lib/src/{firebase → types/fine}/index.js +3 -6
- package/lib/src/types/index.d.ts +7 -18
- package/lib/src/types/index.js +7 -18
- package/lib/src/types/{Localization.d.ts → localization/Localization.d.ts} +15 -43
- package/lib/src/types/localization/Localization.js +54 -0
- package/lib/src/types/localization/PluralLocalization.d.ts +23 -0
- package/lib/src/types/localization/PluralLocalization.js +35 -0
- package/lib/src/types/{Pluralization.d.ts → localization/Pluralization.d.ts} +1 -0
- package/lib/src/types/{Pluralization.js → localization/Pluralization.js} +1 -0
- package/lib/src/types/localization/ValueLocalization.d.ts +22 -0
- package/lib/src/types/localization/ValueLocalization.js +41 -0
- package/lib/src/types/localization/index.d.ts +5 -0
- package/lib/src/types/localization/index.js +21 -0
- package/lib/src/types/notification/InAppNotification.d.ts +152 -0
- package/lib/src/types/notification/InAppNotification.js +136 -0
- package/lib/src/types/notification/index.d.ts +1 -0
- package/lib/src/types/notification/index.js +17 -0
- package/lib/src/types/{Person.d.ts → person/Person.d.ts} +3 -3
- package/lib/src/types/{Person.js → person/Person.js} +3 -3
- package/lib/src/types/{PersonProperties.d.ts → person/PersonProperties.d.ts} +8 -7
- package/lib/src/types/{PersonProperties.js → person/PersonProperties.js} +7 -6
- package/lib/src/types/{PersonSignInProperties.d.ts → person/PersonSignInProperties.d.ts} +9 -11
- package/lib/src/types/{PersonSignInProperties.js → person/PersonSignInProperties.js} +7 -10
- package/lib/src/types/person/index.d.ts +3 -0
- package/lib/src/types/person/index.js +19 -0
- package/lib/src/types/{Invitation.d.ts → team/Invitation.d.ts} +1 -1
- package/lib/src/types/{Invitation.js → team/Invitation.js} +1 -1
- package/lib/src/types/team/Team.d.ts +144 -0
- package/lib/src/types/team/Team.js +141 -0
- package/lib/src/types/team/TeamRole.d.ts +30 -0
- package/lib/src/types/{UserRole.js → team/TeamRole.js} +16 -15
- package/lib/src/types/team/index.d.ts +3 -0
- package/lib/src/types/team/index.js +19 -0
- package/lib/src/types/{NotificationProperties.d.ts → user/NotificationProperties.d.ts} +8 -3
- package/lib/src/types/{NotificationProperties.js → user/NotificationProperties.js} +4 -0
- package/lib/src/types/user/User.d.ts +328 -0
- package/lib/src/types/user/User.js +355 -0
- package/lib/src/types/user/index.d.ts +2 -0
- package/lib/src/types/user/index.js +18 -0
- package/lib/src/utils/StaticUnionTypeBuilder.d.ts +9 -0
- package/lib/src/utils/StaticUnionTypeBuilder.js +23 -0
- package/lib/src/utils/index.d.ts +1 -0
- package/lib/src/utils/index.js +17 -0
- package/lib/tsconfig.tsbuildinfo +1 -1
- package/package.json +7 -6
- package/src/functions/fine/add.ts +3 -5
- package/src/functions/fine/delete.ts +3 -5
- package/src/functions/fine/update.ts +2 -5
- package/src/functions/firebaseFunctionsContext.ts +40 -40
- package/src/functions/index.ts +11 -9
- package/src/functions/notification/markNotificationAsRead.ts +19 -0
- package/src/functions/person/add.ts +1 -1
- package/src/functions/person/kickout.ts +6 -6
- package/src/functions/person/roleEdit.ts +5 -5
- package/src/functions/{paypalMe/edit.ts → team/delete.ts} +5 -7
- package/src/functions/team/new.ts +19 -11
- package/src/functions/team/update.ts +40 -0
- package/src/functions/user/register.ts +7 -3
- package/src/functions/user/update.ts +29 -0
- package/src/index.ts +1 -1
- package/src/locales/de.ts +7 -3
- package/src/locales/en.ts +7 -3
- package/src/types/{MoneyAmount.ts → Money.ts} +29 -29
- package/src/types/fine/Fine.ts +399 -0
- package/src/types/fine/FineTemplate.ts +219 -0
- package/src/types/{PayedState.ts → fine/PayedState.ts} +2 -2
- package/src/types/fine/index.ts +3 -0
- package/src/types/index.ts +7 -18
- package/src/types/{Localization.ts → localization/Localization.ts} +7 -64
- package/src/types/localization/PluralLocalization.ts +32 -0
- package/src/types/{Pluralization.ts → localization/Pluralization.ts} +1 -0
- package/src/types/localization/ValueLocalization.ts +36 -0
- package/src/types/localization/index.ts +5 -0
- package/src/types/notification/InAppNotification.ts +184 -0
- package/src/types/notification/index.ts +1 -0
- package/src/types/{Person.ts → person/Person.ts} +3 -3
- package/src/types/{PersonProperties.ts → person/PersonProperties.ts} +8 -7
- package/src/types/{PersonSignInProperties.ts → person/PersonSignInProperties.ts} +13 -12
- package/src/types/person/index.ts +3 -0
- package/src/types/{Invitation.ts → team/Invitation.ts} +1 -1
- package/src/types/team/Team.ts +204 -0
- package/src/types/{UserRole.ts → team/TeamRole.ts} +19 -17
- package/src/types/team/index.ts +3 -0
- package/src/types/{NotificationProperties.ts → user/NotificationProperties.ts} +12 -3
- package/src/types/user/User.ts +451 -0
- package/src/types/user/index.ts +2 -0
- package/src/utils/StaticUnionTypeBuilder.ts +23 -0
- package/src/utils/index.ts +1 -0
- package/lib/src/firebase/FirebaseConfiguration.d.ts +0 -64
- package/lib/src/firebase/FirebaseConfiguration.js +0 -79
- package/lib/src/firebase/Firestore.d.ts +0 -201
- package/lib/src/firebase/Firestore.js +0 -244
- package/lib/src/firebase/FirestoreScheme.d.ts +0 -42
- package/lib/src/firebase/FirestoreScheme.js +0 -2
- package/lib/src/firebase/Messaging.d.ts +0 -90
- package/lib/src/firebase/Messaging.js +0 -2
- package/lib/src/firebase/checkAuthentication.d.ts +0 -38
- package/lib/src/firebase/checkAuthentication.js +0 -64
- package/lib/src/firebase/index.d.ts +0 -6
- package/lib/src/firebase/pushNotification.d.ts +0 -39
- package/lib/src/firebase/pushNotification.js +0 -88
- package/lib/src/functions/notification/subscribe.d.ts +0 -18
- package/lib/src/types/Configuration.d.ts +0 -46
- package/lib/src/types/Configuration.js +0 -51
- package/lib/src/types/Fine.d.ts +0 -71
- package/lib/src/types/Fine.js +0 -74
- package/lib/src/types/FineAmount.d.ts +0 -207
- package/lib/src/types/FineAmount.js +0 -238
- package/lib/src/types/FineTemplate.d.ts +0 -69
- package/lib/src/types/FineTemplate.js +0 -72
- package/lib/src/types/FineTemplateRepetition.d.ts +0 -87
- package/lib/src/types/FineTemplateRepetition.js +0 -103
- package/lib/src/types/Localization.js +0 -115
- package/lib/src/types/Team.d.ts +0 -62
- package/lib/src/types/Team.js +0 -64
- package/lib/src/types/User.d.ts +0 -221
- package/lib/src/types/User.js +0 -235
- package/lib/src/types/UserRole.d.ts +0 -29
- package/lib/test/firebase/FirebaseConfiguration.test.d.ts +0 -1
- package/lib/test/firebase/FirebaseConfiguration.test.js +0 -158
- package/lib/test/firebase/Firestore.test.d.ts +0 -1
- package/lib/test/firebase/Firestore.test.js +0 -46
- package/lib/test/firebase/checkAuthentication.test.d.ts +0 -1
- package/lib/test/firebase/checkAuthentication.test.js +0 -356
- package/lib/test/firebase/firebase-utils.d.ts +0 -32
- package/lib/test/firebase/firebase-utils.js +0 -134
- package/lib/test/firebase/pushNotification.test.d.ts +0 -1
- package/lib/test/firebase/pushNotification.test.js +0 -300
- package/lib/test/locales/localization.de.test.d.ts +0 -1
- package/lib/test/locales/localization.de.test.js +0 -144
- package/lib/test/locales/localization.en.test.d.ts +0 -1
- package/lib/test/locales/localization.en.test.js +0 -144
- package/lib/test/types/Configuration.test.d.ts +0 -1
- package/lib/test/types/Configuration.test.js +0 -84
- package/lib/test/types/Currency.test.d.ts +0 -1
- package/lib/test/types/Currency.test.js +0 -41
- package/lib/test/types/Fine.test.d.ts +0 -1
- package/lib/test/types/Fine.test.js +0 -265
- package/lib/test/types/FineAmount.test.d.ts +0 -1
- package/lib/test/types/FineAmount.test.js +0 -445
- package/lib/test/types/FineTemplate.test.d.ts +0 -1
- package/lib/test/types/FineTemplate.test.js +0 -271
- package/lib/test/types/FineTemplateRepetition.test.d.ts +0 -1
- package/lib/test/types/FineTemplateRepetition.test.js +0 -361
- package/lib/test/types/Invitation.test.d.ts +0 -1
- package/lib/test/types/Invitation.test.js +0 -269
- package/lib/test/types/Locale.test.d.ts +0 -1
- package/lib/test/types/Locale.test.js +0 -46
- package/lib/test/types/Localization.test.d.ts +0 -1
- package/lib/test/types/Localization.test.js +0 -241
- package/lib/test/types/MoneyAmount.test.d.ts +0 -1
- package/lib/test/types/MoneyAmount.test.js +0 -276
- package/lib/test/types/NotificationProperties.test.d.ts +0 -1
- package/lib/test/types/NotificationProperties.test.js +0 -258
- package/lib/test/types/PayedState.test.d.ts +0 -1
- package/lib/test/types/PayedState.test.js +0 -136
- package/lib/test/types/Person.test.d.ts +0 -1
- package/lib/test/types/Person.test.js +0 -266
- package/lib/test/types/PersonProperties.test.d.ts +0 -1
- package/lib/test/types/PersonProperties.test.js +0 -155
- package/lib/test/types/PersonSignInProperties.test.d.ts +0 -1
- package/lib/test/types/PersonSignInProperties.test.js +0 -208
- package/lib/test/types/Pluralization.test.d.ts +0 -1
- package/lib/test/types/Pluralization.test.js +0 -206
- package/lib/test/types/Team.test.d.ts +0 -1
- package/lib/test/types/Team.test.js +0 -145
- package/lib/test/types/User.test.d.ts +0 -1
- package/lib/test/types/User.test.js +0 -450
- package/lib/test/types/UserRole.test.d.ts +0 -1
- package/lib/test/types/UserRole.test.js +0 -140
- package/src/firebase/FirebaseConfiguration.ts +0 -99
- package/src/firebase/Firestore.ts +0 -258
- package/src/firebase/FirestoreScheme.ts +0 -41
- package/src/firebase/Messaging.ts +0 -93
- package/src/firebase/checkAuthentication.ts +0 -91
- package/src/firebase/index.ts +0 -7
- package/src/firebase/pushNotification.ts +0 -90
- package/src/functions/notification/subscribe.ts +0 -23
- package/src/types/Configuration.ts +0 -65
- package/src/types/Fine.ts +0 -100
- package/src/types/FineAmount.ts +0 -303
- package/src/types/FineTemplate.ts +0 -96
- package/src/types/FineTemplateRepetition.ts +0 -125
- package/src/types/Team.ts +0 -87
- package/src/types/User.ts +0 -302
- /package/lib/src/types/{Locale.d.ts → localization/Locale.d.ts} +0 -0
- /package/lib/src/types/{Locale.js → localization/Locale.js} +0 -0
- /package/src/types/{Locale.ts → localization/Locale.ts} +0 -0
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { ITypeBuilder } from '@stevenkellner/typescript-common-functionality';
|
|
2
|
+
export declare class StaticUnionTypeBuilder<UnionT, Raw, T> implements ITypeBuilder<Raw | UnionT, T | UnionT> {
|
|
3
|
+
private readonly isUnionType;
|
|
4
|
+
private readonly typeBuilder;
|
|
5
|
+
constructor(isUnionType: (raw: Raw | UnionT) => raw is UnionT, typeBuilder: ITypeBuilder<Raw, T>);
|
|
6
|
+
build(raw: Raw | UnionT): T | UnionT;
|
|
7
|
+
static doNotUpdate<Raw, T>(typeBuilder: ITypeBuilder<Raw, T>): StaticUnionTypeBuilder<'do-not-update', Raw, T>;
|
|
8
|
+
static doNotUpdateRemove<Raw, T>(typeBuilder: ITypeBuilder<Raw, T>): StaticUnionTypeBuilder<'do-not-update' | 'remove', Raw, T>;
|
|
9
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.StaticUnionTypeBuilder = void 0;
|
|
4
|
+
class StaticUnionTypeBuilder {
|
|
5
|
+
isUnionType;
|
|
6
|
+
typeBuilder;
|
|
7
|
+
constructor(isUnionType, typeBuilder) {
|
|
8
|
+
this.isUnionType = isUnionType;
|
|
9
|
+
this.typeBuilder = typeBuilder;
|
|
10
|
+
}
|
|
11
|
+
build(raw) {
|
|
12
|
+
if (this.isUnionType(raw))
|
|
13
|
+
return raw;
|
|
14
|
+
return this.typeBuilder.build(raw);
|
|
15
|
+
}
|
|
16
|
+
static doNotUpdate(typeBuilder) {
|
|
17
|
+
return new StaticUnionTypeBuilder((raw) => raw === 'do-not-update', typeBuilder);
|
|
18
|
+
}
|
|
19
|
+
static doNotUpdateRemove(typeBuilder) {
|
|
20
|
+
return new StaticUnionTypeBuilder((raw) => raw === 'do-not-update' || raw === 'remove', typeBuilder);
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
exports.StaticUnionTypeBuilder = StaticUnionTypeBuilder;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './StaticUnionTypeBuilder';
|
|
@@ -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("./StaticUnionTypeBuilder"), exports);
|
package/lib/tsconfig.tsbuildinfo
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"root":["../index.ts","../src/index.ts","../src/
|
|
1
|
+
{"root":["../index.ts","../src/index.ts","../src/functions/firebasefunctionscontext.ts","../src/functions/index.ts","../src/functions/fine/add.ts","../src/functions/fine/delete.ts","../src/functions/fine/update.ts","../src/functions/finetemplate/add.ts","../src/functions/finetemplate/delete.ts","../src/functions/finetemplate/update.ts","../src/functions/invitation/getinvitation.ts","../src/functions/invitation/invite.ts","../src/functions/invitation/register.ts","../src/functions/invitation/withdraw.ts","../src/functions/notification/marknotificationasread.ts","../src/functions/notification/register.ts","../src/functions/person/add.ts","../src/functions/person/delete.ts","../src/functions/person/kickout.ts","../src/functions/person/roleedit.ts","../src/functions/person/update.ts","../src/functions/team/delete.ts","../src/functions/team/new.ts","../src/functions/team/update.ts","../src/functions/user/login.ts","../src/functions/user/register.ts","../src/functions/user/update.ts","../src/locales/de.ts","../src/locales/en.ts","../src/types/currency.ts","../src/types/money.ts","../src/types/index.ts","../src/types/fine/fine.ts","../src/types/fine/finetemplate.ts","../src/types/fine/payedstate.ts","../src/types/fine/index.ts","../src/types/localization/locale.ts","../src/types/localization/localization.ts","../src/types/localization/plurallocalization.ts","../src/types/localization/pluralization.ts","../src/types/localization/valuelocalization.ts","../src/types/localization/index.ts","../src/types/notification/inappnotification.ts","../src/types/notification/index.ts","../src/types/person/person.ts","../src/types/person/personproperties.ts","../src/types/person/personsigninproperties.ts","../src/types/person/index.ts","../src/types/team/invitation.ts","../src/types/team/team.ts","../src/types/team/teamrole.ts","../src/types/team/index.ts","../src/types/user/notificationproperties.ts","../src/types/user/user.ts","../src/types/user/index.ts","../src/utils/staticuniontypebuilder.ts","../src/utils/index.ts"],"version":"5.9.3"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@stevenkellner/team-conduct-api",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.19",
|
|
4
4
|
"description": "Firebase API for Team Conduct",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "Steven Kellner",
|
|
@@ -22,8 +22,9 @@
|
|
|
22
22
|
"release": "npm run rebuild && npm run lint && npm version patch && git push --follow-tags"
|
|
23
23
|
},
|
|
24
24
|
"dependencies": {
|
|
25
|
-
"@stevenkellner/firebase-function": "^1.4.
|
|
26
|
-
"@stevenkellner/typescript-common-functionality": "^1.0.
|
|
25
|
+
"@stevenkellner/firebase-function": "^1.4.148",
|
|
26
|
+
"@stevenkellner/typescript-common-functionality": "^1.0.62",
|
|
27
|
+
"firebase-admin": "^13.6.0"
|
|
27
28
|
},
|
|
28
29
|
"devDependencies": {
|
|
29
30
|
"@assertive-ts/core": "^2.1.0",
|
|
@@ -31,13 +32,13 @@
|
|
|
31
32
|
"@eslint/eslintrc": "^3.3.3",
|
|
32
33
|
"@eslint/js": "^9.39.2",
|
|
33
34
|
"@types/mocha": "^10.0.10",
|
|
34
|
-
"@typescript-eslint/eslint-plugin": "^8.
|
|
35
|
-
"@typescript-eslint/parser": "^8.
|
|
35
|
+
"@typescript-eslint/eslint-plugin": "^8.51.0",
|
|
36
|
+
"@typescript-eslint/parser": "^8.51.0",
|
|
36
37
|
"eslint": "^9.39.2",
|
|
37
38
|
"eslint-config-google": "^0.14.0",
|
|
38
39
|
"eslint-plugin-import": "^2.32.0",
|
|
39
40
|
"mocha": "^11.7.5",
|
|
40
|
-
"npm-check-updates": "^19.2.
|
|
41
|
+
"npm-check-updates": "^19.2.1",
|
|
41
42
|
"ts-node": "^10.9.2",
|
|
42
43
|
"typescript": "^5.9.3"
|
|
43
44
|
}
|
|
@@ -1,14 +1,13 @@
|
|
|
1
1
|
import { FirebaseFunction } from '@stevenkellner/firebase-function';
|
|
2
2
|
import { Flattable, ObjectTypeBuilder, ValueTypeBuilder } from '@stevenkellner/typescript-common-functionality';
|
|
3
|
-
import {
|
|
3
|
+
import { Fine, Person, Team } from '../../types';
|
|
4
4
|
|
|
5
5
|
export namespace FineAddFunction {
|
|
6
6
|
|
|
7
7
|
export type Parameters = {
|
|
8
8
|
teamId: Team.Id,
|
|
9
9
|
personId: Person.Id,
|
|
10
|
-
fine: Fine
|
|
11
|
-
configuration: Configuration
|
|
10
|
+
fine: Fine
|
|
12
11
|
};
|
|
13
12
|
}
|
|
14
13
|
export class FineAddFunction implements FirebaseFunction<FineAddFunction.Parameters, void> {
|
|
@@ -16,8 +15,7 @@ export class FineAddFunction implements FirebaseFunction<FineAddFunction.Paramet
|
|
|
16
15
|
public parametersBuilder = new ObjectTypeBuilder<Flattable.Flatten<FineAddFunction.Parameters>, FineAddFunction.Parameters>({
|
|
17
16
|
teamId: Team.Id.builder,
|
|
18
17
|
personId: Person.Id.builder,
|
|
19
|
-
fine: Fine.builder
|
|
20
|
-
configuration: Configuration.builder
|
|
18
|
+
fine: Fine.builder
|
|
21
19
|
});
|
|
22
20
|
|
|
23
21
|
public returnTypeBuilder = new ValueTypeBuilder<void>();
|
|
@@ -1,14 +1,13 @@
|
|
|
1
1
|
import { FirebaseFunction } from '@stevenkellner/firebase-function';
|
|
2
|
-
import { Configuration, Fine, Person, Team } from '../../types';
|
|
3
2
|
import { Flattable, ObjectTypeBuilder, ValueTypeBuilder } from '@stevenkellner/typescript-common-functionality';
|
|
3
|
+
import { Team, Person, Fine } from '../../types';
|
|
4
4
|
|
|
5
5
|
export namespace FineDeleteFunction {
|
|
6
6
|
|
|
7
7
|
export type Parameters = {
|
|
8
8
|
teamId: Team.Id,
|
|
9
9
|
personId: Person.Id,
|
|
10
|
-
id: Fine.Id
|
|
11
|
-
configuration: Configuration
|
|
10
|
+
id: Fine.Id
|
|
12
11
|
}
|
|
13
12
|
}
|
|
14
13
|
|
|
@@ -17,8 +16,7 @@ export class FineDeleteFunction implements FirebaseFunction<FineDeleteFunction.P
|
|
|
17
16
|
public parametersBuilder = new ObjectTypeBuilder<Flattable.Flatten<FineDeleteFunction.Parameters>, FineDeleteFunction.Parameters>({
|
|
18
17
|
teamId: Team.Id.builder,
|
|
19
18
|
personId: Person.Id.builder,
|
|
20
|
-
id: Fine.Id.builder
|
|
21
|
-
configuration: Configuration.builder
|
|
19
|
+
id: Fine.Id.builder
|
|
22
20
|
});
|
|
23
21
|
|
|
24
22
|
public returnTypeBuilder = new ValueTypeBuilder<void>();
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { Configuration } from '../../types/Configuration';
|
|
2
1
|
import { FirebaseFunction } from '@stevenkellner/firebase-function';
|
|
3
2
|
import { Fine, Person, Team } from '../../types';
|
|
4
3
|
import { Flattable, ObjectTypeBuilder, ValueTypeBuilder } from '@stevenkellner/typescript-common-functionality';
|
|
@@ -8,8 +7,7 @@ export namespace FineUpdateFunction {
|
|
|
8
7
|
export type Parameters = {
|
|
9
8
|
teamId: Team.Id,
|
|
10
9
|
personId: Person.Id,
|
|
11
|
-
fine: Fine
|
|
12
|
-
configuration: Configuration
|
|
10
|
+
fine: Fine
|
|
13
11
|
};
|
|
14
12
|
}
|
|
15
13
|
|
|
@@ -18,8 +16,7 @@ export class FineUpdateFunction implements FirebaseFunction<FineUpdateFunction.P
|
|
|
18
16
|
public parametersBuilder = new ObjectTypeBuilder<Flattable.Flatten<FineUpdateFunction.Parameters>, FineUpdateFunction.Parameters>({
|
|
19
17
|
teamId: Team.Id.builder,
|
|
20
18
|
personId: Person.Id.builder,
|
|
21
|
-
fine: Fine.builder
|
|
22
|
-
configuration: Configuration.builder
|
|
19
|
+
fine: Fine.builder
|
|
23
20
|
});
|
|
24
21
|
|
|
25
22
|
public returnTypeBuilder = new ValueTypeBuilder<void>();
|
|
@@ -1,50 +1,50 @@
|
|
|
1
1
|
import { FirebaseFunctionsContext } from '@stevenkellner/firebase-function';
|
|
2
2
|
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
3
|
+
UserLoginFunction, UserUpdateFunction, UserRegisterFunction,
|
|
4
|
+
TeamNewFunction, TeamUpdateFunction, TeamDeleteFunction,
|
|
5
|
+
PersonAddFunction, PersonDeleteFunction, PersonUpdateFunction, PersonKickoutFunction, PersonRoleEditFunction,
|
|
6
|
+
FineTemplateAddFunction, FineTemplateDeleteFunction, FineTemplateUpdateFunction,
|
|
7
|
+
FineAddFunction, FineDeleteFunction, FineUpdateFunction,
|
|
8
|
+
NotificationRegisterFunction, NotificationMarkNotificationAsReadFunction,
|
|
9
|
+
InvitationInviteFunction, InvitationWithdrawFunction, InvitationGetInvitationFunction, InvitationRegisterFunction
|
|
10
10
|
} from '.';
|
|
11
11
|
|
|
12
12
|
export const firebaseFunctionsContext = FirebaseFunctionsContext.build(builder => ({
|
|
13
|
-
// team: {
|
|
14
|
-
// new: builder.function(TeamNewFunction)
|
|
15
|
-
// },
|
|
16
13
|
user: {
|
|
17
14
|
login: builder.function(UserLoginFunction),
|
|
15
|
+
update: builder.function(UserUpdateFunction),
|
|
18
16
|
register: builder.function(UserRegisterFunction)
|
|
17
|
+
},
|
|
18
|
+
team: {
|
|
19
|
+
new: builder.function(TeamNewFunction),
|
|
20
|
+
update: builder.function(TeamUpdateFunction),
|
|
21
|
+
delete: builder.function(TeamDeleteFunction)
|
|
22
|
+
},
|
|
23
|
+
person: {
|
|
24
|
+
add: builder.function(PersonAddFunction),
|
|
25
|
+
update: builder.function(PersonUpdateFunction),
|
|
26
|
+
delete: builder.function(PersonDeleteFunction),
|
|
27
|
+
kickout: builder.function(PersonKickoutFunction),
|
|
28
|
+
roleEdit: builder.function(PersonRoleEditFunction)
|
|
29
|
+
},
|
|
30
|
+
fineTemplate: {
|
|
31
|
+
add: builder.function(FineTemplateAddFunction),
|
|
32
|
+
update: builder.function(FineTemplateUpdateFunction),
|
|
33
|
+
delete: builder.function(FineTemplateDeleteFunction)
|
|
34
|
+
},
|
|
35
|
+
fine: {
|
|
36
|
+
add: builder.function(FineAddFunction),
|
|
37
|
+
update: builder.function(FineUpdateFunction),
|
|
38
|
+
delete: builder.function(FineDeleteFunction)
|
|
39
|
+
},
|
|
40
|
+
notification: {
|
|
41
|
+
register: builder.function(NotificationRegisterFunction),
|
|
42
|
+
markNotificationAsRead: builder.function(NotificationMarkNotificationAsReadFunction)
|
|
43
|
+
},
|
|
44
|
+
invitation: {
|
|
45
|
+
invite: builder.function(InvitationInviteFunction),
|
|
46
|
+
withdraw: builder.function(InvitationWithdrawFunction),
|
|
47
|
+
getInvitation: builder.function(InvitationGetInvitationFunction),
|
|
48
|
+
register: builder.function(InvitationRegisterFunction)
|
|
19
49
|
}
|
|
20
|
-
// paypalMe: {
|
|
21
|
-
// edit: builder.function(PaypalMeEditFunction)
|
|
22
|
-
// },
|
|
23
|
-
// notification: {
|
|
24
|
-
// register: builder.function(NotificationRegisterFunction),
|
|
25
|
-
// subscribe: builder.function(NotificationSubscribeFunction)
|
|
26
|
-
// },
|
|
27
|
-
// invitation: {
|
|
28
|
-
// invite: builder.function(InvitationInviteFunction),
|
|
29
|
-
// withdraw: builder.function(InvitationWithdrawFunction),
|
|
30
|
-
// getInvitation: builder.function(InvitationGetInvitationFunction),
|
|
31
|
-
// register: builder.function(InvitationRegisterFunction)
|
|
32
|
-
// },
|
|
33
|
-
// person: {
|
|
34
|
-
// add: builder.function(PersonAddFunction),
|
|
35
|
-
// update: builder.function(PersonUpdateFunction),
|
|
36
|
-
// delete: builder.function(PersonDeleteFunction),
|
|
37
|
-
// kickout: builder.function(UserKickoutFunction),
|
|
38
|
-
// roleEdit: builder.function(UserRoleEditFunction)
|
|
39
|
-
// },
|
|
40
|
-
// fineTemplate: {
|
|
41
|
-
// add: builder.function(FineTemplateAddFunction),
|
|
42
|
-
// update: builder.function(FineTemplateUpdateFunction),
|
|
43
|
-
// delete: builder.function(FineTemplateDeleteFunction)
|
|
44
|
-
// },
|
|
45
|
-
// fine: {
|
|
46
|
-
// add: builder.function(FineAddFunction),
|
|
47
|
-
// update: builder.function(FineUpdateFunction),
|
|
48
|
-
// delete: builder.function(FineDeleteFunction)
|
|
49
|
-
// }
|
|
50
50
|
}));
|
package/src/functions/index.ts
CHANGED
|
@@ -1,22 +1,24 @@
|
|
|
1
|
-
export * from './team/new';
|
|
2
1
|
export * from './user/login';
|
|
2
|
+
export * from './user/update';
|
|
3
3
|
export * from './user/register';
|
|
4
|
+
export * from './team/new';
|
|
5
|
+
export * from './team/update';
|
|
6
|
+
export * from './team/delete';
|
|
4
7
|
export * from './person/roleEdit';
|
|
5
8
|
export * from './person/kickout';
|
|
6
|
-
export * from './paypalMe/edit';
|
|
7
|
-
export * from './notification/register';
|
|
8
|
-
export * from './notification/subscribe';
|
|
9
|
-
export * from './invitation/invite';
|
|
10
|
-
export * from './invitation/withdraw';
|
|
11
|
-
export * from './invitation/getInvitation';
|
|
12
|
-
export * from './invitation/register';
|
|
13
9
|
export * from './person/add';
|
|
14
10
|
export * from './person/update';
|
|
15
|
-
export * from './person/delete'
|
|
11
|
+
export * from './person/delete';;
|
|
16
12
|
export * from './fine/add';
|
|
17
13
|
export * from './fine/update';
|
|
18
14
|
export * from './fine/delete';
|
|
19
15
|
export * from './fineTemplate/add';
|
|
20
16
|
export * from './fineTemplate/update';
|
|
21
17
|
export * from './fineTemplate/delete';
|
|
18
|
+
export * from './notification/register';
|
|
19
|
+
export * from './notification/markNotificationAsRead';
|
|
20
|
+
export * from './invitation/invite';
|
|
21
|
+
export * from './invitation/withdraw';
|
|
22
|
+
export * from './invitation/getInvitation';
|
|
23
|
+
export * from './invitation/register';
|
|
22
24
|
export * from './firebaseFunctionsContext'
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { FirebaseFunction } from '@stevenkellner/firebase-function';
|
|
2
|
+
import { Flattable, ObjectTypeBuilder, ValueTypeBuilder } from '@stevenkellner/typescript-common-functionality';
|
|
3
|
+
import { InAppNotification } from '../../types';
|
|
4
|
+
|
|
5
|
+
export namespace NotificationMarkNotificationAsReadFunction {
|
|
6
|
+
|
|
7
|
+
export type Parameters = {
|
|
8
|
+
notificationId: InAppNotification.Id;
|
|
9
|
+
};
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export class NotificationMarkNotificationAsReadFunction implements FirebaseFunction<NotificationMarkNotificationAsReadFunction.Parameters, void> {
|
|
13
|
+
|
|
14
|
+
public parametersBuilder = new ObjectTypeBuilder<Flattable.Flatten<NotificationMarkNotificationAsReadFunction.Parameters>, NotificationMarkNotificationAsReadFunction.Parameters>({
|
|
15
|
+
notificationId: InAppNotification.Id.builder
|
|
16
|
+
});
|
|
17
|
+
|
|
18
|
+
public returnTypeBuilder = new ValueTypeBuilder<void>();
|
|
19
|
+
}
|
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
import { FirebaseFunction } from '@stevenkellner/firebase-function';
|
|
2
|
-
import {
|
|
2
|
+
import { Person, Team } from '../../types';
|
|
3
3
|
import { Flattable, ObjectTypeBuilder, ValueTypeBuilder } from '@stevenkellner/typescript-common-functionality';
|
|
4
4
|
|
|
5
|
-
export namespace
|
|
5
|
+
export namespace PersonKickoutFunction {
|
|
6
6
|
|
|
7
7
|
export type Parameters = {
|
|
8
8
|
teamId: Team.Id
|
|
9
|
-
|
|
9
|
+
personId: Person.Id
|
|
10
10
|
};
|
|
11
11
|
}
|
|
12
|
-
export class
|
|
12
|
+
export class PersonKickoutFunction implements FirebaseFunction<PersonKickoutFunction.Parameters, void> {
|
|
13
13
|
|
|
14
|
-
public parametersBuilder = new ObjectTypeBuilder<Flattable.Flatten<
|
|
14
|
+
public parametersBuilder = new ObjectTypeBuilder<Flattable.Flatten<PersonKickoutFunction.Parameters>, PersonKickoutFunction.Parameters>({
|
|
15
15
|
teamId: Team.Id.builder,
|
|
16
|
-
|
|
16
|
+
personId: Person.Id.builder
|
|
17
17
|
});
|
|
18
18
|
|
|
19
19
|
public returnTypeBuilder = new ValueTypeBuilder<void>();
|
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
import { FirebaseFunction } from '@stevenkellner/firebase-function';
|
|
2
|
-
import { Person, Team,
|
|
2
|
+
import { Person, Team, TeamRole } from '../../types';
|
|
3
3
|
import { ArrayTypeBuilder, Flattable, ObjectTypeBuilder, ValueTypeBuilder } from '@stevenkellner/typescript-common-functionality';
|
|
4
4
|
|
|
5
|
-
export namespace
|
|
5
|
+
export namespace PersonRoleEditFunction {
|
|
6
6
|
|
|
7
7
|
export type Parameters = {
|
|
8
8
|
teamId: Team.Id
|
|
9
9
|
personId: Person.Id
|
|
10
|
-
roles:
|
|
10
|
+
roles: TeamRole[]
|
|
11
11
|
};
|
|
12
12
|
}
|
|
13
13
|
|
|
14
|
-
export class
|
|
14
|
+
export class PersonRoleEditFunction implements FirebaseFunction<PersonRoleEditFunction.Parameters, void> {
|
|
15
15
|
|
|
16
|
-
public parametersBuilder = new ObjectTypeBuilder<Flattable.Flatten<
|
|
16
|
+
public parametersBuilder = new ObjectTypeBuilder<Flattable.Flatten<PersonRoleEditFunction.Parameters>, PersonRoleEditFunction.Parameters>({
|
|
17
17
|
teamId: Team.Id.builder,
|
|
18
18
|
personId: Person.Id.builder,
|
|
19
19
|
roles: new ArrayTypeBuilder(new ValueTypeBuilder())
|
|
@@ -2,19 +2,17 @@ import { Flattable, ObjectTypeBuilder, ValueTypeBuilder } from '@stevenkellner/t
|
|
|
2
2
|
import { FirebaseFunction } from '@stevenkellner/firebase-function';
|
|
3
3
|
import { Team } from '../../types';
|
|
4
4
|
|
|
5
|
-
export namespace
|
|
5
|
+
export namespace TeamDeleteFunction {
|
|
6
6
|
|
|
7
7
|
export type Parameters = {
|
|
8
|
-
|
|
9
|
-
paypalMeLink: string | null;
|
|
8
|
+
id: Team.Id
|
|
10
9
|
};
|
|
11
10
|
}
|
|
12
11
|
|
|
13
|
-
export class
|
|
12
|
+
export class TeamDeleteFunction implements FirebaseFunction<TeamDeleteFunction.Parameters, void> {
|
|
14
13
|
|
|
15
|
-
public parametersBuilder = new ObjectTypeBuilder<Flattable.Flatten<
|
|
16
|
-
|
|
17
|
-
paypalMeLink: new ValueTypeBuilder()
|
|
14
|
+
public parametersBuilder = new ObjectTypeBuilder<Flattable.Flatten<TeamDeleteFunction.Parameters>, TeamDeleteFunction.Parameters>({
|
|
15
|
+
id: Team.Id.builder
|
|
18
16
|
});
|
|
19
17
|
|
|
20
18
|
public returnTypeBuilder = new ValueTypeBuilder<void>();
|
|
@@ -1,27 +1,35 @@
|
|
|
1
1
|
import { Flattable, ObjectTypeBuilder, ValueTypeBuilder } from '@stevenkellner/typescript-common-functionality';
|
|
2
2
|
import { FirebaseFunction } from '@stevenkellner/firebase-function';
|
|
3
|
-
import {
|
|
3
|
+
import { Team, Currency, Locale, Person } from '../../types';
|
|
4
4
|
|
|
5
5
|
export namespace TeamNewFunction {
|
|
6
6
|
|
|
7
7
|
export type Parameters = {
|
|
8
|
-
id: Team.Id
|
|
9
|
-
|
|
10
|
-
name: string
|
|
11
|
-
|
|
12
|
-
|
|
8
|
+
id: Team.Id,
|
|
9
|
+
teamPersonId: Person.Id,
|
|
10
|
+
name: string,
|
|
11
|
+
logoUrl: string | null,
|
|
12
|
+
sportCategory: string | null,
|
|
13
|
+
description: string | null,
|
|
14
|
+
paypalMeLink: string | null,
|
|
15
|
+
currency: Currency,
|
|
16
|
+
locale: Locale
|
|
13
17
|
};
|
|
14
18
|
}
|
|
15
19
|
|
|
16
|
-
export class TeamNewFunction implements FirebaseFunction<TeamNewFunction.Parameters,
|
|
20
|
+
export class TeamNewFunction implements FirebaseFunction<TeamNewFunction.Parameters, void> {
|
|
17
21
|
|
|
18
22
|
public parametersBuilder = new ObjectTypeBuilder<Flattable.Flatten<TeamNewFunction.Parameters>, TeamNewFunction.Parameters>({
|
|
19
23
|
id: Team.Id.builder,
|
|
20
|
-
|
|
24
|
+
teamPersonId: Person.Id.builder,
|
|
21
25
|
name: new ValueTypeBuilder(),
|
|
22
|
-
|
|
23
|
-
|
|
26
|
+
logoUrl: new ValueTypeBuilder(),
|
|
27
|
+
sportCategory: new ValueTypeBuilder(),
|
|
28
|
+
description: new ValueTypeBuilder(),
|
|
29
|
+
paypalMeLink: new ValueTypeBuilder(),
|
|
30
|
+
currency: Currency.builder,
|
|
31
|
+
locale: Locale.builder
|
|
24
32
|
});
|
|
25
33
|
|
|
26
|
-
public returnTypeBuilder =
|
|
34
|
+
public returnTypeBuilder = new ValueTypeBuilder<void>();
|
|
27
35
|
}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { Flattable, ObjectTypeBuilder, ValueTypeBuilder } from '@stevenkellner/typescript-common-functionality';
|
|
2
|
+
import { FirebaseFunction } from '@stevenkellner/firebase-function';
|
|
3
|
+
import { Team, Currency, Locale } from '../../types';
|
|
4
|
+
import { StaticUnionTypeBuilder } from '../../utils';
|
|
5
|
+
|
|
6
|
+
export namespace TeamUpdateFunction {
|
|
7
|
+
|
|
8
|
+
export type Parameters = {
|
|
9
|
+
id: Team.Id
|
|
10
|
+
name: string | 'do-not-update',
|
|
11
|
+
logoUrl: string | 'remove' | 'do-not-update',
|
|
12
|
+
sportCategory: string | 'remove' | 'do-not-update',
|
|
13
|
+
description: string | 'remove' | 'do-not-update',
|
|
14
|
+
paypalMeLink: string | 'remove' | 'do-not-update',
|
|
15
|
+
allowMembersToAddFines: boolean | 'do-not-update',
|
|
16
|
+
fineVisibility: Team.Settings.FineVisibility | 'do-not-update',
|
|
17
|
+
joinRequestType: Team.Settings.JoinRequestType | 'do-not-update',
|
|
18
|
+
currency: Currency | 'do-not-update',
|
|
19
|
+
locale: Locale | 'do-not-update'
|
|
20
|
+
};
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
export class TeamUpdateFunction implements FirebaseFunction<TeamUpdateFunction.Parameters, void> {
|
|
24
|
+
|
|
25
|
+
public parametersBuilder = new ObjectTypeBuilder<Flattable.Flatten<TeamUpdateFunction.Parameters>, TeamUpdateFunction.Parameters>({
|
|
26
|
+
id: Team.Id.builder,
|
|
27
|
+
name: StaticUnionTypeBuilder.doNotUpdate(new ValueTypeBuilder()),
|
|
28
|
+
logoUrl: StaticUnionTypeBuilder.doNotUpdateRemove(new ValueTypeBuilder()),
|
|
29
|
+
sportCategory: StaticUnionTypeBuilder.doNotUpdateRemove(new ValueTypeBuilder()),
|
|
30
|
+
description: StaticUnionTypeBuilder.doNotUpdateRemove(new ValueTypeBuilder()),
|
|
31
|
+
paypalMeLink: StaticUnionTypeBuilder.doNotUpdateRemove(new ValueTypeBuilder()),
|
|
32
|
+
allowMembersToAddFines: StaticUnionTypeBuilder.doNotUpdate(new ValueTypeBuilder()),
|
|
33
|
+
fineVisibility: StaticUnionTypeBuilder.doNotUpdate(new ValueTypeBuilder()),
|
|
34
|
+
joinRequestType: StaticUnionTypeBuilder.doNotUpdate(new ValueTypeBuilder()),
|
|
35
|
+
currency: StaticUnionTypeBuilder.doNotUpdate(Currency.builder),
|
|
36
|
+
locale: StaticUnionTypeBuilder.doNotUpdate(Locale.builder)
|
|
37
|
+
});
|
|
38
|
+
|
|
39
|
+
public returnTypeBuilder = new ValueTypeBuilder<void>();
|
|
40
|
+
}
|
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
import { FirebaseFunction } from '@stevenkellner/firebase-function';
|
|
2
2
|
import { User } from '../../types';
|
|
3
|
-
import { Flattable, ObjectTypeBuilder } from '@stevenkellner/typescript-common-functionality';
|
|
3
|
+
import { Flattable, ObjectTypeBuilder, ValueTypeBuilder } from '@stevenkellner/typescript-common-functionality';
|
|
4
4
|
|
|
5
5
|
export namespace UserRegisterFunction {
|
|
6
6
|
|
|
7
7
|
export type Parameters = {
|
|
8
8
|
userId: User.Id,
|
|
9
|
-
signInType: User.SignInType
|
|
9
|
+
signInType: User.SignInType,
|
|
10
|
+
firstName: string,
|
|
11
|
+
lastName: string
|
|
10
12
|
};
|
|
11
13
|
}
|
|
12
14
|
|
|
@@ -14,7 +16,9 @@ export class UserRegisterFunction implements FirebaseFunction<UserRegisterFuncti
|
|
|
14
16
|
|
|
15
17
|
public parametersBuilder = new ObjectTypeBuilder<Flattable.Flatten<UserRegisterFunction.Parameters>, UserRegisterFunction.Parameters>({
|
|
16
18
|
userId: User.Id.builder,
|
|
17
|
-
signInType: User.SignInType.builder
|
|
19
|
+
signInType: User.SignInType.builder,
|
|
20
|
+
firstName: new ValueTypeBuilder(),
|
|
21
|
+
lastName: new ValueTypeBuilder()
|
|
18
22
|
});
|
|
19
23
|
|
|
20
24
|
public returnTypeBuilder = User.builder;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { FirebaseFunction } from '@stevenkellner/firebase-function';
|
|
2
|
+
import { NotificationProperties } from '../../types';
|
|
3
|
+
import { ArrayTypeBuilder, Flattable, ObjectTypeBuilder, ValueTypeBuilder } from '@stevenkellner/typescript-common-functionality';
|
|
4
|
+
import { StaticUnionTypeBuilder } from '../../utils';
|
|
5
|
+
|
|
6
|
+
export namespace UserUpdateFunction {
|
|
7
|
+
|
|
8
|
+
export type Parameters = {
|
|
9
|
+
name: {
|
|
10
|
+
firstName: string,
|
|
11
|
+
lastName: string
|
|
12
|
+
} | 'do-not-update',
|
|
13
|
+
bio: string | 'remove' | 'do-not-update',
|
|
14
|
+
profilePictureUrl: string | 'remove' | 'do-not-update',
|
|
15
|
+
notificationSubscriptions: NotificationProperties.Subscription[] | 'do-not-update'
|
|
16
|
+
};
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export class UserUpdateFunction implements FirebaseFunction<UserUpdateFunction.Parameters, void> {
|
|
20
|
+
|
|
21
|
+
public parametersBuilder = new ObjectTypeBuilder<Flattable.Flatten<UserUpdateFunction.Parameters>, UserUpdateFunction.Parameters>({
|
|
22
|
+
name: StaticUnionTypeBuilder.doNotUpdate(new ValueTypeBuilder()),
|
|
23
|
+
bio: StaticUnionTypeBuilder.doNotUpdateRemove(new ValueTypeBuilder()),
|
|
24
|
+
profilePictureUrl: StaticUnionTypeBuilder.doNotUpdateRemove(new ValueTypeBuilder()),
|
|
25
|
+
notificationSubscriptions: StaticUnionTypeBuilder.doNotUpdate(new ArrayTypeBuilder(new ValueTypeBuilder()))
|
|
26
|
+
});
|
|
27
|
+
|
|
28
|
+
public returnTypeBuilder = new ValueTypeBuilder<void>();
|
|
29
|
+
}
|
package/src/index.ts
CHANGED
package/src/locales/de.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { Pluralization } from '../types/Pluralization';
|
|
2
|
-
import { LocalizationDict } from '../types/Localization';
|
|
1
|
+
import { Pluralization } from '../types/localization/Pluralization';
|
|
2
|
+
import { LocalizationDict } from '../types/localization/Localization';
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* German (de) localization strings for the application.
|
|
@@ -25,6 +25,10 @@ export const localizationDE: LocalizationDict = {
|
|
|
25
25
|
bodyPayed: 'Du hast eine Strafe von {{amount}} bezahlt ({{reason}}).',
|
|
26
26
|
bodyUnpayed: '{{reason}}, {{amount}} ist noch offen.',
|
|
27
27
|
bodyDeleted: '{{reason}}, {{amount}} wurde gelöscht.'
|
|
28
|
+
},
|
|
29
|
+
changed: {
|
|
30
|
+
title: '{{reason}}',
|
|
31
|
+
body: 'Deine Strafe für {{reason}} wurde aktualisiert.'
|
|
28
32
|
}
|
|
29
33
|
}
|
|
30
34
|
},
|
|
@@ -97,7 +101,7 @@ export const localizationDE: LocalizationDict = {
|
|
|
97
101
|
payed: 'Bezahlt',
|
|
98
102
|
notPayed: 'Offen'
|
|
99
103
|
},
|
|
100
|
-
|
|
104
|
+
teamRole: {
|
|
101
105
|
personManager: 'Personenmanager',
|
|
102
106
|
fineTemplateManager: 'Strafvorlagenmanager',
|
|
103
107
|
fineManager: 'Strafenmanager',
|
package/src/locales/en.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { Pluralization } from '../types/Pluralization';
|
|
2
|
-
import { SubLocalizationType } from '../types/Localization';
|
|
1
|
+
import { Pluralization } from '../types/localization/Pluralization';
|
|
2
|
+
import { SubLocalizationType } from '../types/localization/Localization';
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* Helper function to ensure a value satisfies the Localization structure
|
|
@@ -35,6 +35,10 @@ export const localizationEN = satisfiesLocalization({
|
|
|
35
35
|
bodyPayed: 'You have paid a fine of {{amount}} ({{reason}}).',
|
|
36
36
|
bodyUnpayed: '{{reason}}, {{amount}} is still outstanding.',
|
|
37
37
|
bodyDeleted: '{{reason}}, {{amount}} has been deleted.'
|
|
38
|
+
},
|
|
39
|
+
changed: {
|
|
40
|
+
title: '{{reason}}',
|
|
41
|
+
body: 'Your fine for {{reason}} has been updated.'
|
|
38
42
|
}
|
|
39
43
|
}
|
|
40
44
|
},
|
|
@@ -107,7 +111,7 @@ export const localizationEN = satisfiesLocalization({
|
|
|
107
111
|
payed: 'Paid',
|
|
108
112
|
notPayed: 'Outstanding'
|
|
109
113
|
},
|
|
110
|
-
|
|
114
|
+
teamRole: {
|
|
111
115
|
personManager: 'Person Manager',
|
|
112
116
|
fineTemplateManager: 'Fine Template Manager',
|
|
113
117
|
fineManager: 'Fine Manager',
|