@dev-crew-berlin/enter-js-utils 0.17.0 → 0.19.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.
|
@@ -23,6 +23,7 @@ export declare type AttendeeJSON = {
|
|
|
23
23
|
amount: number;
|
|
24
24
|
testmode: boolean;
|
|
25
25
|
} | null;
|
|
26
|
+
deleted: boolean;
|
|
26
27
|
};
|
|
27
28
|
export declare class Attendee {
|
|
28
29
|
id: string;
|
|
@@ -45,6 +46,7 @@ export declare class Attendee {
|
|
|
45
46
|
amount: number;
|
|
46
47
|
testmode: boolean;
|
|
47
48
|
} | null;
|
|
49
|
+
deleted: boolean;
|
|
48
50
|
constructor(rawAttendee: RawAttendee);
|
|
49
51
|
getRsvpCountForTag(checkinTag: string): number;
|
|
50
52
|
getResponseForTag(checkinTag: string): 'no-response' | 'negative-repsone' | 'positive-response';
|
|
@@ -83,6 +85,7 @@ export declare const rawAttendee: import("fefe").Validator<import("fefe").Object
|
|
|
83
85
|
amount: import("fefe").Validator<number, import("fefe").LeafError>;
|
|
84
86
|
testmode: import("fefe").Validator<boolean, import("fefe").LeafError>;
|
|
85
87
|
}> | null, import("fefe").FefeError>;
|
|
88
|
+
deleted: import("fefe").Validator<boolean, import("fefe").FefeError>;
|
|
86
89
|
}>, import("fefe").FefeError>;
|
|
87
90
|
declare type RawAttendee = ValidatorReturnType<typeof rawAttendee>;
|
|
88
91
|
export declare const parseAttendee: (value: unknown) => APIResult<Attendee>;
|
package/dist/models/attendee.js
CHANGED
|
@@ -15,6 +15,7 @@ export class Attendee {
|
|
|
15
15
|
this.checkin = rawAttendee.checkin;
|
|
16
16
|
this.companions = rawAttendee.companions;
|
|
17
17
|
this.payment = rawAttendee.payment;
|
|
18
|
+
this.deleted = rawAttendee.deleted;
|
|
18
19
|
}
|
|
19
20
|
|
|
20
21
|
getRsvpCountForTag(checkinTag) {
|
|
@@ -99,7 +100,8 @@ export const rawAttendee = object({
|
|
|
99
100
|
integer: true
|
|
100
101
|
}),
|
|
101
102
|
testmode: boolean()
|
|
102
|
-
})), null)
|
|
103
|
+
})), null),
|
|
104
|
+
deleted: defaultTo(boolean(), false)
|
|
103
105
|
}, {
|
|
104
106
|
allowExcessProperties: true
|
|
105
107
|
});
|
|
@@ -11,10 +11,10 @@ export declare class FieldGroups {
|
|
|
11
11
|
getLabelForField(fieldKey: string, language: string): string;
|
|
12
12
|
}
|
|
13
13
|
export declare const fieldGroup: import("fefe").Validator<import("fefe").ObjectResult<{
|
|
14
|
-
title: import("fefe").Validator<string | Dictionary<string
|
|
14
|
+
title: import("fefe").Validator<string | Dictionary<string> | null, import("fefe").FefeError> & {
|
|
15
15
|
optional: true;
|
|
16
16
|
};
|
|
17
|
-
class: import("fefe").Validator<string, import("fefe").FefeError> & {
|
|
17
|
+
class: import("fefe").Validator<string | null, import("fefe").FefeError> & {
|
|
18
18
|
optional: true;
|
|
19
19
|
};
|
|
20
20
|
questions: import("fefe").Validator<(import("fefe").ObjectResult<{
|
|
@@ -112,19 +112,19 @@ export declare const fieldGroup: import("fefe").Validator<import("fefe").ObjectR
|
|
|
112
112
|
class: import("fefe").Validator<string | null, import("fefe").FefeError>;
|
|
113
113
|
type: import("fefe").Validator<"dropdown", import("fefe").LeafError>;
|
|
114
114
|
}>)[], import("fefe").FefeError>;
|
|
115
|
-
info: import("fefe").Validator<string | Dictionary<string
|
|
115
|
+
info: import("fefe").Validator<string | Dictionary<string> | null, import("fefe").FefeError> & {
|
|
116
116
|
optional: true;
|
|
117
117
|
};
|
|
118
|
-
if: import("fefe").Validator<string, import("fefe").FefeError> & {
|
|
118
|
+
if: import("fefe").Validator<string | null, import("fefe").FefeError> & {
|
|
119
119
|
optional: true;
|
|
120
120
|
};
|
|
121
121
|
isMetaGroup: import("fefe").Validator<boolean, import("fefe").LeafError>;
|
|
122
122
|
}>, import("fefe").FefeError>;
|
|
123
123
|
declare const rawFieldGroupList: import("fefe").Validator<import("fefe").ObjectResult<{
|
|
124
|
-
title: import("fefe").Validator<string | Dictionary<string
|
|
124
|
+
title: import("fefe").Validator<string | Dictionary<string> | null, import("fefe").FefeError> & {
|
|
125
125
|
optional: true;
|
|
126
126
|
};
|
|
127
|
-
class: import("fefe").Validator<string, import("fefe").FefeError> & {
|
|
127
|
+
class: import("fefe").Validator<string | null, import("fefe").FefeError> & {
|
|
128
128
|
optional: true;
|
|
129
129
|
};
|
|
130
130
|
questions: import("fefe").Validator<(import("fefe").ObjectResult<{
|
|
@@ -222,19 +222,19 @@ declare const rawFieldGroupList: import("fefe").Validator<import("fefe").ObjectR
|
|
|
222
222
|
class: import("fefe").Validator<string | null, import("fefe").FefeError>;
|
|
223
223
|
type: import("fefe").Validator<"dropdown", import("fefe").LeafError>;
|
|
224
224
|
}>)[], import("fefe").FefeError>;
|
|
225
|
-
info: import("fefe").Validator<string | Dictionary<string
|
|
225
|
+
info: import("fefe").Validator<string | Dictionary<string> | null, import("fefe").FefeError> & {
|
|
226
226
|
optional: true;
|
|
227
227
|
};
|
|
228
|
-
if: import("fefe").Validator<string, import("fefe").FefeError> & {
|
|
228
|
+
if: import("fefe").Validator<string | null, import("fefe").FefeError> & {
|
|
229
229
|
optional: true;
|
|
230
230
|
};
|
|
231
231
|
isMetaGroup: import("fefe").Validator<boolean, import("fefe").LeafError>;
|
|
232
232
|
}>[], import("fefe").FefeError>;
|
|
233
233
|
export declare const parseFieldGroup: import("../lib").APIValidator<import("fefe").ObjectResult<{
|
|
234
|
-
title: import("fefe").Validator<string | Dictionary<string
|
|
234
|
+
title: import("fefe").Validator<string | Dictionary<string> | null, import("fefe").FefeError> & {
|
|
235
235
|
optional: true;
|
|
236
236
|
};
|
|
237
|
-
class: import("fefe").Validator<string, import("fefe").FefeError> & {
|
|
237
|
+
class: import("fefe").Validator<string | null, import("fefe").FefeError> & {
|
|
238
238
|
optional: true;
|
|
239
239
|
};
|
|
240
240
|
questions: import("fefe").Validator<(import("fefe").ObjectResult<{
|
|
@@ -332,19 +332,19 @@ export declare const parseFieldGroup: import("../lib").APIValidator<import("fefe
|
|
|
332
332
|
class: import("fefe").Validator<string | null, import("fefe").FefeError>;
|
|
333
333
|
type: import("fefe").Validator<"dropdown", import("fefe").LeafError>;
|
|
334
334
|
}>)[], import("fefe").FefeError>;
|
|
335
|
-
info: import("fefe").Validator<string | Dictionary<string
|
|
335
|
+
info: import("fefe").Validator<string | Dictionary<string> | null, import("fefe").FefeError> & {
|
|
336
336
|
optional: true;
|
|
337
337
|
};
|
|
338
|
-
if: import("fefe").Validator<string, import("fefe").FefeError> & {
|
|
338
|
+
if: import("fefe").Validator<string | null, import("fefe").FefeError> & {
|
|
339
339
|
optional: true;
|
|
340
340
|
};
|
|
341
341
|
isMetaGroup: import("fefe").Validator<boolean, import("fefe").LeafError>;
|
|
342
342
|
}>>;
|
|
343
343
|
export declare const parseRawFieldGroupList: import("../lib").APIValidator<import("fefe").ObjectResult<{
|
|
344
|
-
title: import("fefe").Validator<string | Dictionary<string
|
|
344
|
+
title: import("fefe").Validator<string | Dictionary<string> | null, import("fefe").FefeError> & {
|
|
345
345
|
optional: true;
|
|
346
346
|
};
|
|
347
|
-
class: import("fefe").Validator<string, import("fefe").FefeError> & {
|
|
347
|
+
class: import("fefe").Validator<string | null, import("fefe").FefeError> & {
|
|
348
348
|
optional: true;
|
|
349
349
|
};
|
|
350
350
|
questions: import("fefe").Validator<(import("fefe").ObjectResult<{
|
|
@@ -442,10 +442,10 @@ export declare const parseRawFieldGroupList: import("../lib").APIValidator<impor
|
|
|
442
442
|
class: import("fefe").Validator<string | null, import("fefe").FefeError>;
|
|
443
443
|
type: import("fefe").Validator<"dropdown", import("fefe").LeafError>;
|
|
444
444
|
}>)[], import("fefe").FefeError>;
|
|
445
|
-
info: import("fefe").Validator<string | Dictionary<string
|
|
445
|
+
info: import("fefe").Validator<string | Dictionary<string> | null, import("fefe").FefeError> & {
|
|
446
446
|
optional: true;
|
|
447
447
|
};
|
|
448
|
-
if: import("fefe").Validator<string, import("fefe").FefeError> & {
|
|
448
|
+
if: import("fefe").Validator<string | null, import("fefe").FefeError> & {
|
|
449
449
|
optional: true;
|
|
450
450
|
};
|
|
451
451
|
isMetaGroup: import("fefe").Validator<boolean, import("fefe").LeafError>;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { array, object, string, optional, union, boolean } from 'fefe';
|
|
2
2
|
import { apiValidator, success } from '../lib';
|
|
3
3
|
import { field } from './field';
|
|
4
|
-
import { dictionary } from './_helpers';
|
|
4
|
+
import { dictionary, maybe } from './_helpers';
|
|
5
5
|
export class FieldGroups {
|
|
6
6
|
constructor(rawFieldGroupList) {
|
|
7
7
|
this.groups = rawFieldGroupList;
|
|
@@ -28,11 +28,11 @@ export class FieldGroups {
|
|
|
28
28
|
|
|
29
29
|
}
|
|
30
30
|
export const fieldGroup = object({
|
|
31
|
-
title: optional(union(string(), dictionary(string()))),
|
|
32
|
-
class: optional(string()),
|
|
31
|
+
title: optional(maybe(union(string(), dictionary(string())))),
|
|
32
|
+
class: optional(maybe(string())),
|
|
33
33
|
questions: array(field),
|
|
34
|
-
info: optional(union(string(), dictionary(string()))),
|
|
35
|
-
if: optional(string()),
|
|
34
|
+
info: optional(maybe(union(string(), dictionary(string())))),
|
|
35
|
+
if: optional(maybe(string())),
|
|
36
36
|
isMetaGroup: boolean()
|
|
37
37
|
}, {
|
|
38
38
|
allowExcessProperties: true
|
|
@@ -27,7 +27,8 @@ const attendee = new Attendee({
|
|
|
27
27
|
},
|
|
28
28
|
userdata: {
|
|
29
29
|
name: 'Max Mustermann'
|
|
30
|
-
}
|
|
30
|
+
},
|
|
31
|
+
deleted: false
|
|
31
32
|
});
|
|
32
33
|
const companion = new Attendee({
|
|
33
34
|
id: 'my-companion',
|
|
@@ -46,7 +47,8 @@ const companion = new Attendee({
|
|
|
46
47
|
},
|
|
47
48
|
userdata: {
|
|
48
49
|
name: 'Jhon Doe'
|
|
49
|
-
}
|
|
50
|
+
},
|
|
51
|
+
deleted: false
|
|
50
52
|
});
|
|
51
53
|
|
|
52
54
|
const Template = args => /*#__PURE__*/React.createElement(GuestCard, args);
|