@dev-crew-berlin/enter-js-utils 0.3.7 → 0.4.1
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/api-client.d.ts +1 -0
- package/api-client.js +1 -0
- package/dist/api-client/api-base.d.ts +30 -0
- package/dist/api-client/api-base.js +292 -0
- package/dist/api-client/api-base.js.map +1 -0
- package/dist/api-client/index.d.ts +75 -0
- package/dist/api-client/index.js +200 -0
- package/dist/api-client/index.js.map +1 -0
- package/dist/lib/api-result.d.ts +25 -0
- package/dist/lib/api-result.js +16 -0
- package/dist/lib/api-result.js.map +1 -0
- package/dist/lib/index.d.ts +2 -0
- package/dist/lib/index.js +2 -0
- package/dist/lib/index.js.map +1 -1
- package/dist/lib/not-undefined.d.ts +1 -0
- package/dist/lib/not-undefined.js +4 -0
- package/dist/lib/not-undefined.js.map +1 -0
- package/dist/models/_helpers.d.ts +23 -0
- package/dist/models/_helpers.js +90 -0
- package/dist/models/_helpers.js.map +1 -0
- package/dist/models/access-token.d.ts +11 -0
- package/dist/models/access-token.js +8 -0
- package/dist/models/access-token.js.map +1 -0
- package/dist/models/attendee.d.ts +90 -0
- package/dist/models/attendee.js +105 -0
- package/dist/models/attendee.js.map +1 -0
- package/dist/models/checkin-counts.d.ts +10 -0
- package/dist/models/checkin-counts.js +6 -0
- package/dist/models/checkin-counts.js.map +1 -0
- package/dist/models/checkins.d.ts +40 -0
- package/dist/models/checkins.js +71 -0
- package/dist/models/checkins.js.map +1 -0
- package/dist/models/event.d.ts +40 -0
- package/dist/models/event.js +2 -0
- package/dist/models/event.js.map +1 -0
- package/dist/models/field-group.d.ts +804 -0
- package/dist/models/field-group.js +51 -0
- package/dist/models/field-group.js.map +1 -0
- package/dist/models/field-value.d.ts +2 -0
- package/dist/models/field-value.js +4 -0
- package/dist/models/field-value.js.map +1 -0
- package/dist/models/field.d.ts +553 -0
- package/dist/models/field.js +44 -0
- package/dist/models/field.js.map +1 -0
- package/dist/models/index.d.ts +14 -0
- package/dist/models/index.js +4 -0
- package/dist/models/index.js.map +1 -0
- package/dist/models/instance.d.ts +78 -0
- package/dist/models/instance.js +104 -0
- package/dist/models/instance.js.map +1 -0
- package/dist/models/invite.d.ts +33 -0
- package/dist/models/invite.js +18 -0
- package/dist/models/invite.js.map +1 -0
- package/dist/models/meta-field.d.ts +7 -0
- package/dist/models/meta-field.js +8 -0
- package/dist/models/meta-field.js.map +1 -0
- package/dist/models/user.d.ts +18 -0
- package/dist/models/user.js +11 -0
- package/dist/models/user.js.map +1 -0
- package/dist/models/variable.d.ts +27 -0
- package/dist/models/variable.js +15 -0
- package/dist/models/variable.js.map +1 -0
- package/dist/ui/checkin-count-indicator.stories.d.ts +10 -10
- package/models.d.ts +1 -0
- package/models.js +1 -0
- package/package.json +22 -4
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
var __assign = (this && this.__assign) || function () {
|
|
2
|
+
__assign = Object.assign || function(t) {
|
|
3
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
4
|
+
s = arguments[i];
|
|
5
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
6
|
+
t[p] = s[p];
|
|
7
|
+
}
|
|
8
|
+
return t;
|
|
9
|
+
};
|
|
10
|
+
return __assign.apply(this, arguments);
|
|
11
|
+
};
|
|
12
|
+
import { array, object, string, optional, enumerate, boolean, defaultTo, union, number, } from 'fefe';
|
|
13
|
+
import { apiValidator } from '../lib';
|
|
14
|
+
import { dictionary } from './_helpers';
|
|
15
|
+
var basicFieldProps = {
|
|
16
|
+
name: string({ minLength: 1 }),
|
|
17
|
+
title: optional(union(string(), dictionary(string()))),
|
|
18
|
+
info: optional(union(string(), dictionary(string()))),
|
|
19
|
+
required: defaultTo(boolean(), false),
|
|
20
|
+
if: optional(string()),
|
|
21
|
+
class: optional(string()),
|
|
22
|
+
};
|
|
23
|
+
var staticField = object(__assign({ type: enumerate('static') }, basicFieldProps), { allowExcessProperties: true });
|
|
24
|
+
var textField = object(__assign({ type: enumerate('text') }, basicFieldProps), { allowExcessProperties: true });
|
|
25
|
+
var longtextField = object(__assign({ type: enumerate('longtext') }, basicFieldProps), { allowExcessProperties: true });
|
|
26
|
+
var emailField = object(__assign({ type: enumerate('email') }, basicFieldProps), { allowExcessProperties: true });
|
|
27
|
+
var numberField = object(__assign({ type: enumerate('number') }, basicFieldProps), { allowExcessProperties: true });
|
|
28
|
+
var checkboxField = object(__assign(__assign({ type: enumerate('check') }, basicFieldProps), { items: array(object({
|
|
29
|
+
name: union(string(), dictionary(string())),
|
|
30
|
+
value: optional(string()),
|
|
31
|
+
})) }), { allowExcessProperties: true });
|
|
32
|
+
var singleCheckboxField = object(__assign(__assign({ type: enumerate('checkbox') }, basicFieldProps), { value: defaultTo(number(), 0) }), { allowExcessProperties: true });
|
|
33
|
+
var radioField = object(__assign(__assign({ type: enumerate('radio') }, basicFieldProps), { items: array(object({
|
|
34
|
+
name: union(string(), dictionary(string())),
|
|
35
|
+
value: optional(string()),
|
|
36
|
+
})) }), { allowExcessProperties: true });
|
|
37
|
+
var singleRadioField = object(__assign(__assign({ type: enumerate('radiobutton') }, basicFieldProps), { itemval: optional(string()) }), { allowExcessProperties: true });
|
|
38
|
+
var selectField = object(__assign(__assign({ type: enumerate('dropdown') }, basicFieldProps), { items: array(object({
|
|
39
|
+
name: union(string(), dictionary(string())),
|
|
40
|
+
value: optional(string()),
|
|
41
|
+
})) }), { allowExcessProperties: true });
|
|
42
|
+
export var field = union(staticField, textField, longtextField, emailField, numberField, checkboxField, singleCheckboxField, radioField, singleRadioField, selectField);
|
|
43
|
+
export var parseField = apiValidator(field);
|
|
44
|
+
//# sourceMappingURL=field.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"field.js","sourceRoot":"","sources":["../../src/models/field.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,OAAO,EACL,KAAK,EACL,MAAM,EACN,MAAM,EACN,QAAQ,EACR,SAAS,EACT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K,CACV,MAAM,CAAC;QACL,IAAI,EAAE,KAAK,CAAC,MAAM,EAAE,EAAE,UAAU,CAAC,MAAM,EAAE,CAAC,CAAC;QAC3C,KAAK,EAAE,QAAQ,CAAC,MAAM,EAAE,CAAC;KAC1B,CAAC,CACH,KAEH,EAAE,qBAAqB,EAAE,IAAI,EAAE,CAChC,CAAA;AAED,MAAM,CAAC,IAAM,KAAK,GAAG,KAAK,CACxB,WAAW,EACX,SAAS,EACT,aAAa,EACb,UAAU,EACV,WAAW,EACX,aAAa,EACb,mBAAmB,EACnB,UAAU,EACV,gBAAgB,EAChB,WAAW,CACZ,CAAA;AAED,MAAM,CAAC,IAAM,UAAU,GAAG,YAAY,CAAC,KAAK,CAAC,CAAA"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export type { AccessToken } from './access-token';
|
|
2
|
+
export { Attendee } from './attendee';
|
|
3
|
+
export type { CheckinCounts } from './checkin-counts';
|
|
4
|
+
export type { Checkin, CheckinsJSON, Checkins } from './checkins';
|
|
5
|
+
export type { Event } from './event';
|
|
6
|
+
export type { FieldGroup, FieldLabels } from './field-group';
|
|
7
|
+
export { FieldGroups } from './field-group';
|
|
8
|
+
export type { FieldValue } from './field-value';
|
|
9
|
+
export type { StaticField, TextField, EmailField, NumberField, CheckboxField, SingleCheckboxField, RadioField, SingleRadioField, SelectField, Field, } from './field';
|
|
10
|
+
export { Instance } from './instance';
|
|
11
|
+
export type { Invite } from './invite';
|
|
12
|
+
export type { MetaField } from './meta-field';
|
|
13
|
+
export type { User } from './user';
|
|
14
|
+
export type { Variable } from './variable';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/models/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAA;AAKrC,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAA;AAc3C,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAA"}
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import { ValidatorReturnType } from 'fefe';
|
|
2
|
+
import { APIResult } from '../lib';
|
|
3
|
+
import { Attendee } from './attendee';
|
|
4
|
+
import { Invite } from './invite';
|
|
5
|
+
import { MetaField } from './meta-field';
|
|
6
|
+
export declare type InstanceJSON = {
|
|
7
|
+
name: string;
|
|
8
|
+
title: string;
|
|
9
|
+
description: string;
|
|
10
|
+
checkins: string[];
|
|
11
|
+
thumbnail: boolean;
|
|
12
|
+
url: {
|
|
13
|
+
domain: string;
|
|
14
|
+
rootPath: string;
|
|
15
|
+
};
|
|
16
|
+
registration: {
|
|
17
|
+
start: string | null;
|
|
18
|
+
end: string | null;
|
|
19
|
+
closed: boolean;
|
|
20
|
+
canEdit: boolean;
|
|
21
|
+
editEnd: string | null;
|
|
22
|
+
};
|
|
23
|
+
guestNameFields: string[];
|
|
24
|
+
metaFields: Record<string, MetaField>;
|
|
25
|
+
};
|
|
26
|
+
export declare class Instance {
|
|
27
|
+
name: string;
|
|
28
|
+
title: string;
|
|
29
|
+
description: string;
|
|
30
|
+
checkinTags: string[];
|
|
31
|
+
hasTumbnail: boolean;
|
|
32
|
+
url: {
|
|
33
|
+
domain: string;
|
|
34
|
+
rootPath: string;
|
|
35
|
+
};
|
|
36
|
+
registration: {
|
|
37
|
+
start: Date | null;
|
|
38
|
+
end: Date | null;
|
|
39
|
+
closed: boolean;
|
|
40
|
+
canEdit: boolean;
|
|
41
|
+
editEnd: Date | null;
|
|
42
|
+
};
|
|
43
|
+
guestNameFields: string[];
|
|
44
|
+
metaFields: Record<string, MetaField>;
|
|
45
|
+
constructor(rawInstance: RawInstance);
|
|
46
|
+
toJSON(): InstanceJSON;
|
|
47
|
+
isRegistrationClosed(): boolean;
|
|
48
|
+
canEditRegistration(): boolean;
|
|
49
|
+
formatName(guest: Attendee | Invite): string;
|
|
50
|
+
}
|
|
51
|
+
declare const rawInstance: import("fefe").Validator<import("fefe").ObjectResult<{
|
|
52
|
+
name: import("fefe").Validator<string, import("fefe").LeafError>;
|
|
53
|
+
title: import("fefe").Validator<string, import("fefe").LeafError>;
|
|
54
|
+
description: import("fefe").Validator<string, import("fefe").LeafError>;
|
|
55
|
+
checkins: import("fefe").Validator<string[], import("fefe").FefeError>;
|
|
56
|
+
thumbnail: import("fefe").Validator<boolean, import("fefe").LeafError>;
|
|
57
|
+
url: import("fefe").Validator<import("fefe").ObjectResult<{
|
|
58
|
+
domain: import("fefe").Validator<string, import("fefe").LeafError>;
|
|
59
|
+
rootPath: import("fefe").Validator<string, import("fefe").LeafError>;
|
|
60
|
+
}>, import("fefe").FefeError>;
|
|
61
|
+
registration: import("fefe").Validator<import("fefe").ObjectResult<{
|
|
62
|
+
start: import("fefe").Validator<Date | null, import("fefe").FefeError>;
|
|
63
|
+
end: import("fefe").Validator<Date | null, import("fefe").FefeError>;
|
|
64
|
+
closed: import("fefe").Validator<boolean, import("fefe").LeafError>;
|
|
65
|
+
canEdit: import("fefe").Validator<boolean, import("fefe").FefeError>;
|
|
66
|
+
editEnd: import("fefe").Validator<Date | null, import("fefe").FefeError>;
|
|
67
|
+
}>, import("fefe").FefeError>;
|
|
68
|
+
guestNameFields: import("fefe").Validator<string[], import("fefe").FefeError>;
|
|
69
|
+
metaFields: (value: unknown) => import("fefe").Result<import("./_helpers").Dictionary<import("fefe").ObjectResult<{
|
|
70
|
+
type: import("fefe").Validator<"text" | "checkbox" | "list" | "textfield", import("fefe").LeafError>;
|
|
71
|
+
values: import("fefe").Validator<string[] | null, import("fefe").FefeError>;
|
|
72
|
+
default: import("fefe").Validator<string | null, import("fefe").FefeError>;
|
|
73
|
+
}>>, import("fefe").FefeError>;
|
|
74
|
+
}>, import("fefe").FefeError>;
|
|
75
|
+
declare type RawInstance = ValidatorReturnType<typeof rawInstance>;
|
|
76
|
+
export declare const parseInstance: (value: unknown) => APIResult<Instance>;
|
|
77
|
+
export declare const parseInstanceList: (value: unknown) => APIResult<Instance[]>;
|
|
78
|
+
export {};
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
import { array, boolean, object, parseDate, pipe, string, defaultTo, } from 'fefe';
|
|
2
|
+
import { apiValidator, success } from '../lib';
|
|
3
|
+
import { metaField } from './meta-field';
|
|
4
|
+
import { dictionary, maybe } from './_helpers';
|
|
5
|
+
var Instance = /** @class */ (function () {
|
|
6
|
+
function Instance(rawInstance) {
|
|
7
|
+
this.name = rawInstance.name;
|
|
8
|
+
this.title = rawInstance.title;
|
|
9
|
+
this.description = rawInstance.description;
|
|
10
|
+
this.checkinTags = rawInstance.checkins;
|
|
11
|
+
this.hasTumbnail = rawInstance.thumbnail;
|
|
12
|
+
this.url = rawInstance.url;
|
|
13
|
+
this.registration = rawInstance.registration;
|
|
14
|
+
this.guestNameFields = rawInstance.guestNameFields;
|
|
15
|
+
this.metaFields = rawInstance.metaFields;
|
|
16
|
+
}
|
|
17
|
+
Instance.prototype.toJSON = function () {
|
|
18
|
+
var _a, _b, _c, _d, _e, _f;
|
|
19
|
+
return {
|
|
20
|
+
name: this.name,
|
|
21
|
+
title: this.title,
|
|
22
|
+
description: this.description,
|
|
23
|
+
checkins: this.checkinTags,
|
|
24
|
+
thumbnail: this.hasTumbnail,
|
|
25
|
+
url: this.url,
|
|
26
|
+
registration: {
|
|
27
|
+
start: (_b = (_a = this.registration.start) === null || _a === void 0 ? void 0 : _a.toISOString()) !== null && _b !== void 0 ? _b : null,
|
|
28
|
+
end: (_d = (_c = this.registration.end) === null || _c === void 0 ? void 0 : _c.toISOString()) !== null && _d !== void 0 ? _d : null,
|
|
29
|
+
closed: this.registration.closed,
|
|
30
|
+
canEdit: this.registration.canEdit,
|
|
31
|
+
editEnd: (_f = (_e = this.registration.editEnd) === null || _e === void 0 ? void 0 : _e.toISOString()) !== null && _f !== void 0 ? _f : null,
|
|
32
|
+
},
|
|
33
|
+
guestNameFields: this.guestNameFields,
|
|
34
|
+
metaFields: this.metaFields,
|
|
35
|
+
};
|
|
36
|
+
};
|
|
37
|
+
Instance.prototype.isRegistrationClosed = function () {
|
|
38
|
+
var _a = this.registration, closed = _a.closed, start = _a.start, end = _a.end;
|
|
39
|
+
if (closed)
|
|
40
|
+
return true;
|
|
41
|
+
var now = new Date();
|
|
42
|
+
if (start !== null && now < start)
|
|
43
|
+
return true;
|
|
44
|
+
if (end !== null && now >= end)
|
|
45
|
+
return true;
|
|
46
|
+
return false;
|
|
47
|
+
};
|
|
48
|
+
Instance.prototype.canEditRegistration = function () {
|
|
49
|
+
var _a = this.registration, canEdit = _a.canEdit, editEnd = _a.editEnd;
|
|
50
|
+
if (!canEdit)
|
|
51
|
+
return false;
|
|
52
|
+
if (editEnd === null)
|
|
53
|
+
return true;
|
|
54
|
+
var now = new Date();
|
|
55
|
+
return editEnd < now;
|
|
56
|
+
};
|
|
57
|
+
Instance.prototype.formatName = function (guest) {
|
|
58
|
+
if (this.guestNameFields.length === 0) {
|
|
59
|
+
// just use the first value we can find
|
|
60
|
+
return Object.values(guest.userdata).slice(0, 1).join('');
|
|
61
|
+
}
|
|
62
|
+
return this.guestNameFields
|
|
63
|
+
.map(function (fieldKey) { var _a; return (_a = guest.userdata[fieldKey]) !== null && _a !== void 0 ? _a : ''; })
|
|
64
|
+
.join(' ');
|
|
65
|
+
};
|
|
66
|
+
return Instance;
|
|
67
|
+
}());
|
|
68
|
+
export { Instance };
|
|
69
|
+
var rawInstance = object({
|
|
70
|
+
name: string(),
|
|
71
|
+
title: string(),
|
|
72
|
+
description: string(),
|
|
73
|
+
checkins: array(string()),
|
|
74
|
+
thumbnail: boolean(),
|
|
75
|
+
url: object({
|
|
76
|
+
domain: string(),
|
|
77
|
+
rootPath: string(),
|
|
78
|
+
}),
|
|
79
|
+
registration: object({
|
|
80
|
+
start: maybe(pipe(string()).pipe(parseDate({ iso: true }))),
|
|
81
|
+
end: maybe(pipe(string()).pipe(parseDate({ iso: true }))),
|
|
82
|
+
closed: boolean(),
|
|
83
|
+
canEdit: defaultTo(boolean(), false),
|
|
84
|
+
editEnd: defaultTo(maybe(pipe(string()).pipe(parseDate({ iso: true }))), null),
|
|
85
|
+
}),
|
|
86
|
+
guestNameFields: array(string()),
|
|
87
|
+
metaFields: dictionary(metaField),
|
|
88
|
+
}, { allowExcessProperties: true });
|
|
89
|
+
var rawInstanceList = object({ instances: array(rawInstance) });
|
|
90
|
+
var parseRawInstance = apiValidator(rawInstance);
|
|
91
|
+
var parseRawInstanceList = apiValidator(rawInstanceList);
|
|
92
|
+
export var parseInstance = function (value) {
|
|
93
|
+
var result = parseRawInstance(value);
|
|
94
|
+
if (!result.success)
|
|
95
|
+
return result;
|
|
96
|
+
return success(new Instance(result.data));
|
|
97
|
+
};
|
|
98
|
+
export var parseInstanceList = function (value) {
|
|
99
|
+
var result = parseRawInstanceList(value);
|
|
100
|
+
if (!result.success)
|
|
101
|
+
return result;
|
|
102
|
+
return success(result.data.instances.map(function (rawInstance) { return new Instance(rawInstance); }));
|
|
103
|
+
};
|
|
104
|
+
//# sourceMappingURL=instance.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"instance.js","sourceRoot":"","sources":["../../src/models/instance.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,EACL,OAAO,EACP,MAAM,EACN,SAAS,EACT,IAAI,EACJ,MAAM,EACN,SAAS,GAEV,MAAM,MAAM,CAAA;AACb,OAAO,EAAa,YAAY,EAAE,OAAO,EAAE,MAAM,QAAQ,CAAA;AAGzD,OAAO,EAAE,SAAS,EAAa,MAAM,cAAc,CAAA;AACnD,OAAO,EAAE,UAAU,EAAE,KAAK,EAAE,MAAM,YAAY,CAAA;AAoB9C;IAiBE,kBAAY,WAAwB;QAClC,IAAI,CAAC,IAAI,GAAG,WAAW,CAAC,IAAI,CAAA;QAC5B,IAAI,CAAC,KAAK,GAAG,WAAW,CAAC,KAAK,CAAA;QAC9B,IAAI,CAAC,WAAW,GAAG,WAAW,CAAC,WAAW,CAAA;QAC1C,IAAI,CAAC,WAAW,GAAG,WAAW,C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AC,IAAI,CAAC,CAAC,CAAA;AAC3C,CAAC,CAAA;AAED,MAAM,CAAC,IAAM,iBAAiB,GAAG,UAAC,KAAc;IAC9C,IAAM,MAAM,GAAG,oBAAoB,CAAC,KAAK,CAAC,CAAA;IAC1C,IAAI,CAAC,MAAM,CAAC,OAAO;QAAE,OAAO,MAAM,CAAA;IAClC,OAAO,OAAO,CACZ,MAAM,CAAC,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,UAAC,WAAW,IAAK,OAAA,IAAI,QAAQ,CAAC,WAAW,CAAC,EAAzB,CAAyB,CAAC,CACtE,CAAA;AACH,CAAC,CAAA"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { ValidatorReturnType } from 'fefe';
|
|
2
|
+
declare const invite: import("fefe").Validator<import("fefe").ObjectResult<{
|
|
3
|
+
auth: import("fefe").Validator<string, import("fefe").LeafError>;
|
|
4
|
+
count: import("fefe").Validator<number, import("fefe").LeafError>;
|
|
5
|
+
limit: import("fefe").Validator<number, import("fefe").LeafError>;
|
|
6
|
+
tags: import("fefe").Validator<string[], import("fefe").FefeError>;
|
|
7
|
+
userdata: (value: unknown) => import("fefe").Result<import("./_helpers").Dictionary<string | number | string[] | null>, import("fefe").FefeError>;
|
|
8
|
+
metadata: (value: unknown) => import("fefe").Result<import("./_helpers").Dictionary<string>, import("fefe").FefeError>;
|
|
9
|
+
expires: import("fefe").Validator<Date | null, import("fefe").FefeError>;
|
|
10
|
+
language: import("fefe").Validator<string | null, import("fefe").FefeError>;
|
|
11
|
+
}>, import("fefe").FefeError>;
|
|
12
|
+
export declare const parseInvite: import("../lib").APIValidator<import("fefe").ObjectResult<{
|
|
13
|
+
auth: import("fefe").Validator<string, import("fefe").LeafError>;
|
|
14
|
+
count: import("fefe").Validator<number, import("fefe").LeafError>;
|
|
15
|
+
limit: import("fefe").Validator<number, import("fefe").LeafError>;
|
|
16
|
+
tags: import("fefe").Validator<string[], import("fefe").FefeError>;
|
|
17
|
+
userdata: (value: unknown) => import("fefe").Result<import("./_helpers").Dictionary<string | number | string[] | null>, import("fefe").FefeError>;
|
|
18
|
+
metadata: (value: unknown) => import("fefe").Result<import("./_helpers").Dictionary<string>, import("fefe").FefeError>;
|
|
19
|
+
expires: import("fefe").Validator<Date | null, import("fefe").FefeError>;
|
|
20
|
+
language: import("fefe").Validator<string | null, import("fefe").FefeError>;
|
|
21
|
+
}>>;
|
|
22
|
+
export declare const parseInviteList: import("../lib").APIValidator<import("fefe").ObjectResult<{
|
|
23
|
+
auth: import("fefe").Validator<string, import("fefe").LeafError>;
|
|
24
|
+
count: import("fefe").Validator<number, import("fefe").LeafError>;
|
|
25
|
+
limit: import("fefe").Validator<number, import("fefe").LeafError>;
|
|
26
|
+
tags: import("fefe").Validator<string[], import("fefe").FefeError>;
|
|
27
|
+
userdata: (value: unknown) => import("fefe").Result<import("./_helpers").Dictionary<string | number | string[] | null>, import("fefe").FefeError>;
|
|
28
|
+
metadata: (value: unknown) => import("fefe").Result<import("./_helpers").Dictionary<string>, import("fefe").FefeError>;
|
|
29
|
+
expires: import("fefe").Validator<Date | null, import("fefe").FefeError>;
|
|
30
|
+
language: import("fefe").Validator<string | null, import("fefe").FefeError>;
|
|
31
|
+
}>[]>;
|
|
32
|
+
export declare type Invite = ValidatorReturnType<typeof invite>;
|
|
33
|
+
export {};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { array, number, object, parseDate, pipe, string, } from 'fefe';
|
|
2
|
+
import { apiValidator } from '../lib';
|
|
3
|
+
import { rawFieldValue } from './field-value';
|
|
4
|
+
import { dictionary, maybe, toString } from './_helpers';
|
|
5
|
+
var invite = object({
|
|
6
|
+
auth: string(),
|
|
7
|
+
count: number(),
|
|
8
|
+
limit: number(),
|
|
9
|
+
tags: array(string()),
|
|
10
|
+
userdata: dictionary(rawFieldValue),
|
|
11
|
+
metadata: dictionary(toString),
|
|
12
|
+
expires: maybe(pipe(string()).pipe(parseDate({ iso: true }))),
|
|
13
|
+
language: maybe(string()),
|
|
14
|
+
}, { allowExcessProperties: true });
|
|
15
|
+
var inviteList = array(invite);
|
|
16
|
+
export var parseInvite = apiValidator(invite);
|
|
17
|
+
export var parseInviteList = apiValidator(inviteList);
|
|
18
|
+
//# sourceMappingURL=invite.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"invite.js","sourceRoot":"","sources":["../../src/models/invite.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,EACL,MAAM,EACN,MAAM,EACN,SAAS,EACT,IAAI,EACJ,MAAM,GAEP,MAAM,MAAM,CAAA;AACb,OAAO,EAAE,YAAY,EAAE,MAAM,QAAQ,CAAA;AACrC,OAAO,EAAE,aAAa,EAAE,MAAM,eAAe,CAAA;AAC7C,OAAO,EAAE,UAAU,EAAE,KAAK,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAA;AAExD,IAAM,MAAM,GAAG,MAAM,CACnB;IACE,IAAI,EAAE,MAAM,EAAE;IACd,KAAK,EAAE,MAAM,EAAE;IACf,KAAK,EAAE,MAAM,EAAE;IACf,IAAI,EAAE,KAAK,CAAC,MAAM,EAAE,CAAC;IACrB,QAAQ,EAAE,UAAU,CAAC,aAAa,CAAC;IACnC,QAAQ,EAAE,UAAU,CAAC,QAAQ,CAAC;IAC9B,OAAO,EAAE,KAAK,CAAC,IAAI,CAAC,MAAM,EAAE,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,EAAE,GAAG,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC;IAC7D,QAAQ,EAAE,KAAK,CAAC,MAAM,EAAE,CAAC;CAC1B,EACD,EAAE,qBAAqB,EAAE,IAAI,EAAE,CAChC,CAAA;AACD,IAAM,UAAU,GAAG,KAAK,CAAC,MAAM,CAAC,CAAA;AAChC,MAAM,CAAC,IAAM,WAAW,GAAG,YAAY,CAAC,MAAM,CAAC,CAAA;AAC/C,MAAM,CAAC,IAAM,eAAe,GAAG,YAAY,CAAC,UAAU,CAAC,CAAA"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { ValidatorReturnType } from 'fefe';
|
|
2
|
+
export declare const metaField: import("fefe").Validator<import("fefe").ObjectResult<{
|
|
3
|
+
type: import("fefe").Validator<"text" | "checkbox" | "list" | "textfield", import("fefe").LeafError>;
|
|
4
|
+
values: import("fefe").Validator<string[] | null, import("fefe").FefeError>;
|
|
5
|
+
default: import("fefe").Validator<string | null, import("fefe").FefeError>;
|
|
6
|
+
}>, import("fefe").FefeError>;
|
|
7
|
+
export declare type MetaField = ValidatorReturnType<typeof metaField>;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { array, enumerate, object, optional, string, } from 'fefe';
|
|
2
|
+
import { maybe } from './_helpers';
|
|
3
|
+
export var metaField = object({
|
|
4
|
+
type: enumerate('checkbox', 'list', 'text', 'textfield'),
|
|
5
|
+
values: maybe(optional(array(string()))),
|
|
6
|
+
default: maybe(optional(string())),
|
|
7
|
+
}, { allowExcessProperties: true });
|
|
8
|
+
//# sourceMappingURL=meta-field.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"meta-field.js","sourceRoot":"","sources":["../../src/models/meta-field.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,EACL,SAAS,EACT,MAAM,EACN,QAAQ,EACR,MAAM,GAEP,MAAM,MAAM,CAAA;AAEb,OAAO,EAAE,KAAK,EAAE,MAAM,YAAY,CAAA;AAElC,MAAM,CAAC,IAAM,SAAS,GAAG,MAAM,CAC7B;IACE,IAAI,EAAE,SAAS,CAAC,UAAU,EAAE,MAAM,EAAE,MAAM,EAAE,WAAW,CAAC;IACxD,MAAM,EAAE,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC;IACxC,OAAO,EAAE,KAAK,CAAC,QAAQ,CAAC,MAAM,EAAE,CAAC,CAAC;CACnC,EACD,EAAE,qBAAqB,EAAE,IAAI,EAAE,CAChC,CAAA"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { ValidatorReturnType } from 'fefe';
|
|
2
|
+
export declare const user: import("fefe").Validator<import("fefe").ObjectResult<{
|
|
3
|
+
name: import("fefe").Validator<string, import("fefe").LeafError>;
|
|
4
|
+
timeout: import("fefe").Validator<number, import("fefe").LeafError>;
|
|
5
|
+
userdata: (value: unknown) => import("fefe").Result<import("./_helpers").Dictionary<unknown>, import("fefe").FefeError>;
|
|
6
|
+
permissions: import("fefe").Validator<import("./_helpers").Dictionary<string[]>, import("fefe").FefeError> & {
|
|
7
|
+
optional: true;
|
|
8
|
+
};
|
|
9
|
+
}>, import("fefe").FefeError>;
|
|
10
|
+
export declare type User = ValidatorReturnType<typeof user>;
|
|
11
|
+
export declare const parseUser: import("../lib").APIValidator<import("fefe").ObjectResult<{
|
|
12
|
+
name: import("fefe").Validator<string, import("fefe").LeafError>;
|
|
13
|
+
timeout: import("fefe").Validator<number, import("fefe").LeafError>;
|
|
14
|
+
userdata: (value: unknown) => import("fefe").Result<import("./_helpers").Dictionary<unknown>, import("fefe").FefeError>;
|
|
15
|
+
permissions: import("fefe").Validator<import("./_helpers").Dictionary<string[]>, import("fefe").FefeError> & {
|
|
16
|
+
optional: true;
|
|
17
|
+
};
|
|
18
|
+
}>>;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { array, number, object, string, optional, } from 'fefe';
|
|
2
|
+
import { apiValidator } from '../lib';
|
|
3
|
+
import { unknown, dictionary } from './_helpers';
|
|
4
|
+
export var user = object({
|
|
5
|
+
name: string(),
|
|
6
|
+
timeout: number(),
|
|
7
|
+
userdata: dictionary(unknown()),
|
|
8
|
+
permissions: optional(dictionary(array(string()))),
|
|
9
|
+
}, { allowExcessProperties: true });
|
|
10
|
+
export var parseUser = apiValidator(user);
|
|
11
|
+
//# sourceMappingURL=user.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"user.js","sourceRoot":"","sources":["../../src/models/user.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,EACL,MAAM,EACN,MAAM,EACN,MAAM,EACN,QAAQ,GAET,MAAM,MAAM,CAAA;AACb,OAAO,EAAE,YAAY,EAAE,MAAM,QAAQ,CAAA;AACrC,OAAO,EAAE,OAAO,EAAE,UAAU,EAAE,MAAM,YAAY,CAAA;AAEhD,MAAM,CAAC,IAAM,IAAI,GAAG,MAAM,CACxB;IACE,IAAI,EAAE,MAAM,EAAE;IACd,OAAO,EAAE,MAAM,EAAE;IACjB,QAAQ,EAAE,UAAU,CAAC,OAAO,EAAE,CAAC;IAC/B,WAAW,EAAE,QAAQ,CAAC,UAAU,CAAC,KAAK,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC;CACnD,EACD,EAAE,qBAAqB,EAAE,IAAI,EAAE,CAChC,CAAA;AAGD,MAAM,CAAC,IAAM,SAAS,GAAG,YAAY,CAAC,IAAI,CAAC,CAAA"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { ValidatorReturnType } from 'fefe';
|
|
2
|
+
declare const variable: import("fefe").Validator<{
|
|
3
|
+
name: string;
|
|
4
|
+
title: string;
|
|
5
|
+
value: string;
|
|
6
|
+
isPrivate: boolean;
|
|
7
|
+
} & {} & {
|
|
8
|
+
variableType: "text";
|
|
9
|
+
}, import("fefe").FefeError>;
|
|
10
|
+
export declare type Variable = ValidatorReturnType<typeof variable>;
|
|
11
|
+
export declare const parseVariable: import("../lib").APIValidator<{
|
|
12
|
+
name: string;
|
|
13
|
+
title: string;
|
|
14
|
+
value: string;
|
|
15
|
+
isPrivate: boolean;
|
|
16
|
+
} & {} & {
|
|
17
|
+
variableType: "text";
|
|
18
|
+
}>;
|
|
19
|
+
export declare const parseVariableList: import("../lib").APIValidator<({
|
|
20
|
+
name: string;
|
|
21
|
+
title: string;
|
|
22
|
+
value: string;
|
|
23
|
+
isPrivate: boolean;
|
|
24
|
+
} & {} & {
|
|
25
|
+
variableType: "text";
|
|
26
|
+
})[]>;
|
|
27
|
+
export {};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { array, boolean, discriminatedUnion, string, } from 'fefe';
|
|
2
|
+
import { apiValidator } from '../lib';
|
|
3
|
+
var variable = discriminatedUnion('variableType', {
|
|
4
|
+
text: {
|
|
5
|
+
name: string(),
|
|
6
|
+
title: string(),
|
|
7
|
+
value: string(),
|
|
8
|
+
isPrivate: boolean(),
|
|
9
|
+
},
|
|
10
|
+
// number: { name: string(), title: string(), value: number() },
|
|
11
|
+
}, { allowExcessProperties: true });
|
|
12
|
+
var variableList = array(variable);
|
|
13
|
+
export var parseVariable = apiValidator(variable);
|
|
14
|
+
export var parseVariableList = apiValidator(variableList);
|
|
15
|
+
//# sourceMappingURL=variable.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"variable.js","sourceRoot":"","sources":["../../src/models/variable.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,EACL,OAAO,EACP,kBAAkB,EAClB,MAAM,GAEP,MAAM,MAAM,CAAA;AACb,OAAO,EAAE,YAAY,EAAE,MAAM,QAAQ,CAAA;AAErC,IAAM,QAAQ,GAAG,kBAAkB,CACjC,cAAc,EACd;IACE,IAAI,EAAE;QACJ,IAAI,EAAE,MAAM,EAAE;QACd,KAAK,EAAE,MAAM,EAAE;QACf,KAAK,EAAE,MAAM,EAAE;QACf,SAAS,EAAE,OAAO,EAAE;KACrB;IACD,gEAAgE;CACjE,EACD,EAAE,qBAAqB,EAAE,IAAI,EAAE,CAChC,CAAA;AAED,IAAM,YAAY,GAAG,KAAK,CAAC,QAAQ,CAAC,CAAA;AAGpC,MAAM,CAAC,IAAM,aAAa,GAAG,YAAY,CAAC,QAAQ,CAAC,CAAA;AACnD,MAAM,CAAC,IAAM,iBAAiB,GAAG,YAAY,CAAC,YAAY,CAAC,CAAA"}
|
|
@@ -7,7 +7,7 @@ declare const _default: ComponentMeta<React.FunctionComponent<{
|
|
|
7
7
|
rsvpCount: number;
|
|
8
8
|
} | {
|
|
9
9
|
checkins: Checkin[];
|
|
10
|
-
response: "
|
|
10
|
+
response: "no-response" | "negative-repsone";
|
|
11
11
|
}>>;
|
|
12
12
|
export default _default;
|
|
13
13
|
export declare const SingleResponse: ComponentStory<React.FunctionComponent<{
|
|
@@ -16,7 +16,7 @@ export declare const SingleResponse: ComponentStory<React.FunctionComponent<{
|
|
|
16
16
|
rsvpCount: number;
|
|
17
17
|
} | {
|
|
18
18
|
checkins: Checkin[];
|
|
19
|
-
response: "
|
|
19
|
+
response: "no-response" | "negative-repsone";
|
|
20
20
|
}>>;
|
|
21
21
|
export declare const Decline: ComponentStory<React.FunctionComponent<{
|
|
22
22
|
checkins: Checkin[];
|
|
@@ -24,7 +24,7 @@ export declare const Decline: ComponentStory<React.FunctionComponent<{
|
|
|
24
24
|
rsvpCount: number;
|
|
25
25
|
} | {
|
|
26
26
|
checkins: Checkin[];
|
|
27
|
-
response: "
|
|
27
|
+
response: "no-response" | "negative-repsone";
|
|
28
28
|
}>>;
|
|
29
29
|
export declare const NoResponse: ComponentStory<React.FunctionComponent<{
|
|
30
30
|
checkins: Checkin[];
|
|
@@ -32,7 +32,7 @@ export declare const NoResponse: ComponentStory<React.FunctionComponent<{
|
|
|
32
32
|
rsvpCount: number;
|
|
33
33
|
} | {
|
|
34
34
|
checkins: Checkin[];
|
|
35
|
-
response: "
|
|
35
|
+
response: "no-response" | "negative-repsone";
|
|
36
36
|
}>>;
|
|
37
37
|
export declare const MultipleResponses: ComponentStory<React.FunctionComponent<{
|
|
38
38
|
checkins: Checkin[];
|
|
@@ -40,7 +40,7 @@ export declare const MultipleResponses: ComponentStory<React.FunctionComponent<{
|
|
|
40
40
|
rsvpCount: number;
|
|
41
41
|
} | {
|
|
42
42
|
checkins: Checkin[];
|
|
43
|
-
response: "
|
|
43
|
+
response: "no-response" | "negative-repsone";
|
|
44
44
|
}>>;
|
|
45
45
|
export declare const CheckinAndResponse: ComponentStory<React.FunctionComponent<{
|
|
46
46
|
checkins: Checkin[];
|
|
@@ -48,7 +48,7 @@ export declare const CheckinAndResponse: ComponentStory<React.FunctionComponent<
|
|
|
48
48
|
rsvpCount: number;
|
|
49
49
|
} | {
|
|
50
50
|
checkins: Checkin[];
|
|
51
|
-
response: "
|
|
51
|
+
response: "no-response" | "negative-repsone";
|
|
52
52
|
}>>;
|
|
53
53
|
export declare const MultipleCheckinsAndResponse: ComponentStory<React.FunctionComponent<{
|
|
54
54
|
checkins: Checkin[];
|
|
@@ -56,7 +56,7 @@ export declare const MultipleCheckinsAndResponse: ComponentStory<React.FunctionC
|
|
|
56
56
|
rsvpCount: number;
|
|
57
57
|
} | {
|
|
58
58
|
checkins: Checkin[];
|
|
59
|
-
response: "
|
|
59
|
+
response: "no-response" | "negative-repsone";
|
|
60
60
|
}>>;
|
|
61
61
|
export declare const CheckinsWithDecline: ComponentStory<React.FunctionComponent<{
|
|
62
62
|
checkins: Checkin[];
|
|
@@ -64,7 +64,7 @@ export declare const CheckinsWithDecline: ComponentStory<React.FunctionComponent
|
|
|
64
64
|
rsvpCount: number;
|
|
65
65
|
} | {
|
|
66
66
|
checkins: Checkin[];
|
|
67
|
-
response: "
|
|
67
|
+
response: "no-response" | "negative-repsone";
|
|
68
68
|
}>>;
|
|
69
69
|
export declare const CheckinWithoutResponse: ComponentStory<React.FunctionComponent<{
|
|
70
70
|
checkins: Checkin[];
|
|
@@ -72,7 +72,7 @@ export declare const CheckinWithoutResponse: ComponentStory<React.FunctionCompon
|
|
|
72
72
|
rsvpCount: number;
|
|
73
73
|
} | {
|
|
74
74
|
checkins: Checkin[];
|
|
75
|
-
response: "
|
|
75
|
+
response: "no-response" | "negative-repsone";
|
|
76
76
|
}>>;
|
|
77
77
|
export declare const MultipleCheckins: ComponentStory<React.FunctionComponent<{
|
|
78
78
|
checkins: Checkin[];
|
|
@@ -80,5 +80,5 @@ export declare const MultipleCheckins: ComponentStory<React.FunctionComponent<{
|
|
|
80
80
|
rsvpCount: number;
|
|
81
81
|
} | {
|
|
82
82
|
checkins: Checkin[];
|
|
83
|
-
response: "
|
|
83
|
+
response: "no-response" | "negative-repsone";
|
|
84
84
|
}>>;
|
package/models.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './dist/models/index.js'
|
package/models.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './dist/models/index.js'
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dev-crew-berlin/enter-js-utils",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.4.1",
|
|
4
4
|
"description": "utils such as vaildation and other helpers to work with data from the enter app",
|
|
5
5
|
"files": [
|
|
6
6
|
"dist",
|
|
@@ -8,7 +8,11 @@
|
|
|
8
8
|
"lib.js",
|
|
9
9
|
"lib.d.ts",
|
|
10
10
|
"ui.js",
|
|
11
|
-
"ui.d.ts"
|
|
11
|
+
"ui.d.ts",
|
|
12
|
+
"api-client.js",
|
|
13
|
+
"api-client.d.ts",
|
|
14
|
+
"models.js",
|
|
15
|
+
"models.d.ts"
|
|
12
16
|
],
|
|
13
17
|
"type": "module",
|
|
14
18
|
"targets": {
|
|
@@ -23,6 +27,18 @@
|
|
|
23
27
|
"outputFormat": "esmodule",
|
|
24
28
|
"isLibrary": true,
|
|
25
29
|
"includeNodeModules": false
|
|
30
|
+
},
|
|
31
|
+
"api-client": {
|
|
32
|
+
"source": "src/api-client/index.ts",
|
|
33
|
+
"outputFormat": "esmodule",
|
|
34
|
+
"isLibrary": true,
|
|
35
|
+
"includeNodeModules": false
|
|
36
|
+
},
|
|
37
|
+
"models": {
|
|
38
|
+
"source": "src/models/index.ts",
|
|
39
|
+
"outputFormat": "esmodule",
|
|
40
|
+
"isLibrary": true,
|
|
41
|
+
"includeNodeModules": false
|
|
26
42
|
}
|
|
27
43
|
},
|
|
28
44
|
"scripts": {
|
|
@@ -62,6 +78,8 @@
|
|
|
62
78
|
"@types/node": "^17.0.38",
|
|
63
79
|
"@types/react": "^18.0.10",
|
|
64
80
|
"@types/react-dom": "^18.0.5",
|
|
81
|
+
"@typescript-eslint/eslint-plugin": "^5.27.0",
|
|
82
|
+
"@typescript-eslint/parser": "^5.27.0",
|
|
65
83
|
"babel-loader": "^8.2.5",
|
|
66
84
|
"eslint": "^8.16.0",
|
|
67
85
|
"eslint-config-prettier": "^8.5.0",
|
|
@@ -77,8 +95,8 @@
|
|
|
77
95
|
"react-dom": "^17.0.0 || ^18.1.0"
|
|
78
96
|
},
|
|
79
97
|
"dependencies": {
|
|
80
|
-
"
|
|
81
|
-
"
|
|
98
|
+
"fefe": "^3.2.0",
|
|
99
|
+
"fp-ts": "^2.12.1",
|
|
82
100
|
"styled-jsx": "^5.0.2"
|
|
83
101
|
}
|
|
84
102
|
}
|