@dev-crew-berlin/enter-js-utils 0.54.1 → 0.60.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.
@@ -2,13 +2,13 @@ import { components } from '../generated/api-schema';
2
2
  import { Checkin } from './checkin';
3
3
  import { Checkins } from './checkins';
4
4
  import { FieldValue } from './field-value';
5
- export declare type AttendeeJSON = components['schemas']['PublicAttendee'];
5
+ export declare type AttendeeJSON = components['schemas']['PublicAttendee-Output'];
6
6
  export declare class Attendee {
7
7
  id: string;
8
8
  userdata: Record<string, FieldValue>;
9
9
  tags: string[];
10
- language?: string;
11
- time?: Date;
10
+ language: string | null;
11
+ time: Date;
12
12
  rsvp: Record<string, number | null>;
13
13
  checkin: Record<string, Checkins>;
14
14
  companions: {
@@ -17,12 +17,12 @@ export declare class Attendee {
17
17
  isCompanion: true;
18
18
  mainGuestId: string;
19
19
  };
20
- payment?: {
20
+ payment: {
21
21
  paid: boolean;
22
22
  provider: components['schemas']['Payment']['provider'];
23
23
  amount: number;
24
24
  testmode: boolean;
25
- };
25
+ } | null;
26
26
  deleted: boolean;
27
27
  constructor(args: AttendeeJSON | string);
28
28
  /**
@@ -3,15 +3,18 @@ import { Checkins } from './checkins';
3
3
  export class Attendee {
4
4
  userdata = {};
5
5
  tags = [];
6
+ language = null;
6
7
  rsvp = {};
7
8
  checkin = {};
8
9
  companions = {
9
10
  isCompanion: false
10
11
  };
12
+ payment = null;
11
13
  deleted = false;
12
14
  constructor(args) {
13
15
  if (typeof args === 'string') {
14
16
  this.id = args;
17
+ this.time = new Date();
15
18
  return;
16
19
  }
17
20
  const json = args;
@@ -19,7 +22,7 @@ export class Attendee {
19
22
  this.userdata = json.userdata;
20
23
  this.tags = json.tags;
21
24
  this.language = json.language;
22
- this.time = json.time ? new Date(json.time) : undefined;
25
+ this.time = new Date(json.time);
23
26
  this.rsvp = json.rsvp;
24
27
  this.checkin = Object.fromEntries(new Map(Object.entries(json.checkin).map(([checkinTag, checkin]) => [checkinTag, new Checkins(checkin)])));
25
28
  this.companions = json.companions;
@@ -6,8 +6,7 @@ export class Checkin {
6
6
  toJSON() {
7
7
  return {
8
8
  id: this.id,
9
- time: this.time.toISOString(),
10
- main: false
9
+ time: this.time.toISOString()
11
10
  };
12
11
  }
13
12
  }
@@ -1,6 +1,6 @@
1
1
  import { components } from '../generated/api-schema';
2
2
  import { Checkin } from './checkin';
3
- export declare type CheckinsJSON = components['schemas']['Checkins'];
3
+ export declare type CheckinsJSON = components['schemas']['Checkins-Output'];
4
4
  export declare class Checkins {
5
5
  checkins: Checkin[];
6
6
  deleted: string[];
@@ -3,7 +3,9 @@ export declare type AttendeeCreatedEvent = components['schemas']['AttendeeCreate
3
3
  export declare type AttendeeUpdatedEvent = components['schemas']['AttendeeUpdatedEvent'];
4
4
  export declare type AttendeeRespondedEvent = components['schemas']['AttendeeRespondedEvent'];
5
5
  export declare type AttendeeDeletedEvent = components['schemas']['AttendeeDeletedEvent'];
6
+ export declare type AttendeeAuthCodeRequestedEvent = components['schemas']['AttendeeAuthCodeRequested'];
7
+ export declare type EmailUnsubscribedEvent = components['schemas']['EmailUnsubscribedEvent'];
6
8
  export declare type CheckinCreatedEvent = components['schemas']['CheckinCreatedEvent'];
7
9
  export declare type CheckinDeletedEvent = components['schemas']['CheckinDeletedEvent'];
8
10
  export declare type PaymentPaidEvent = components['schemas']['PaymentPaidEvent'];
9
- export declare type Event = components['schemas']['EventList'][number];
11
+ export declare type Event = components['schemas']['RootModel_list_Annotated_Union_AttendeeCreatedEvent__AttendeeUpdatedEvent__AttendeeRespondedEvent__AttendeeAuthCodeRequested__EmailUnsubscribedEvent__AttendeeDeletedEvent__CheckinCreatedEvent__CheckinDeletedEvent__PaymentPaidEvent___FieldInfo_annotation_NoneType__required_True__discriminator__event_____'][number];
@@ -1,7 +1,7 @@
1
1
  import { components } from '../generated/api-schema';
2
2
  import { Field } from './field';
3
3
  export declare type Dictionary<T> = Record<string, T>;
4
- export declare type FieldGroupJSON = components['schemas']['FieldGroup'];
4
+ export declare type FieldGroupJSON = components['schemas']['FieldGroup-Output'];
5
5
  export declare type FieldGroup = Omit<FieldGroupJSON, 'questions'>;
6
6
  export declare class FieldGroups {
7
7
  private _groups;
@@ -1 +1,2 @@
1
- export declare type FieldValue = string | number | string[] | boolean | null;
1
+ import { components } from '../generated/api-schema';
2
+ export declare type FieldValue = components['schemas']['PublicAttendee-Output']['userdata'][string];
@@ -1,28 +1,28 @@
1
1
  import { components } from '../generated/api-schema';
2
- export declare type StaticField = components['schemas']['StaticField'] & {
2
+ export declare type StaticField = components['schemas']['StaticField-Output'] & {
3
3
  group: string;
4
4
  };
5
- export declare type TextField = components['schemas']['TextField'] & {
5
+ export declare type TextField = components['schemas']['TextField-Output'] & {
6
6
  group: string;
7
7
  };
8
- export declare type EmailField = components['schemas']['EmailField'] & {
8
+ export declare type EmailField = components['schemas']['EmailField-Output'] & {
9
9
  group: string;
10
10
  };
11
- export declare type NumberField = components['schemas']['NumberField'] & {
11
+ export declare type NumberField = components['schemas']['NumberField-Output'] & {
12
12
  group: string;
13
13
  };
14
- export declare type CheckboxField = components['schemas']['CheckboxGroupField'] & {
14
+ export declare type CheckboxField = components['schemas']['CheckboxGroupField-Output'] & {
15
15
  group: string;
16
16
  };
17
- export declare type SingleCheckboxField = components['schemas']['CheckboxField'] & {
17
+ export declare type ToggleField = components['schemas']['CheckboxField-Output'] & {
18
18
  group: string;
19
19
  };
20
- export declare type RadioField = components['schemas']['RadioButtonGroupField'] & {
20
+ export declare type RadioField = components['schemas']['RadioButtonGroupField-Output'] & {
21
21
  group: string;
22
22
  };
23
- export declare type SelectField = components['schemas']['DropdownField'] & {
23
+ export declare type SelectField = components['schemas']['DropdownField-Output'] & {
24
24
  group: string;
25
25
  };
26
- export declare type Field = components['schemas']['FieldGroup']['questions'][number] & {
26
+ export declare type Field = components['schemas']['FieldGroup-Output']['questions'][number] & {
27
27
  group: string;
28
28
  };
@@ -5,11 +5,11 @@ export { Checkin } from './checkin';
5
5
  export type { CheckinJSON } from './checkin';
6
6
  export { Checkins } from './checkins';
7
7
  export type { CheckinsJSON } from './checkins';
8
- export type { Event, AttendeeUpdatedEvent, AttendeeCreatedEvent, AttendeeRespondedEvent, AttendeeDeletedEvent, CheckinCreatedEvent, CheckinDeletedEvent, PaymentPaidEvent, } from './event';
8
+ export type { Event, AttendeeUpdatedEvent, AttendeeCreatedEvent, AttendeeRespondedEvent, AttendeeDeletedEvent, AttendeeAuthCodeRequestedEvent, EmailUnsubscribedEvent, CheckinCreatedEvent, CheckinDeletedEvent, PaymentPaidEvent, } from './event';
9
9
  export type { FieldGroup, FieldGroupJSON } from './field-group';
10
10
  export { FieldGroups } from './field-group';
11
11
  export type { FieldValue } from './field-value';
12
- export type { StaticField, TextField, EmailField, NumberField, CheckboxField, SingleCheckboxField, RadioField, SelectField, Field, } from './field';
12
+ export type { StaticField, TextField, EmailField, NumberField, CheckboxField, ToggleField, RadioField, SelectField, Field, } from './field';
13
13
  export { Instance } from './instance';
14
14
  export type { InstanceJSON } from './instance';
15
15
  export type { Permission } from './permission';
@@ -26,11 +26,11 @@ export class Instance {
26
26
  thumbnail: this.hasTumbnail,
27
27
  frontend: this.frontend,
28
28
  registration: {
29
- start: this.registration.start?.toISOString(),
30
- end: this.registration.end?.toISOString(),
29
+ start: this.registration.start?.toISOString() ?? null,
30
+ end: this.registration.end?.toISOString() ?? null,
31
31
  closed: this.registration.closed,
32
32
  canEdit: this.registration.canEdit,
33
- editEnd: this.registration.editEnd?.toISOString(),
33
+ editEnd: this.registration.editEnd?.toISOString() ?? null,
34
34
  allowRegistrationWithAuthCode: this.registration.allowRegistrationWithAuthCode
35
35
  },
36
36
  guestNameFields: this.guestNameFields,
@@ -25,7 +25,8 @@ const mainGuest = new Attendee({
25
25
  userdata: {
26
26
  name: 'Max Mustermann'
27
27
  },
28
- deleted: false
28
+ deleted: false,
29
+ payment: null
29
30
  });
30
31
  const Template = args => /*#__PURE__*/React.createElement(CompanionInfo, args);
31
32
  export const WithMainGuestFound = Template.bind({});
@@ -26,7 +26,8 @@ const attendee = new Attendee({
26
26
  userdata: {
27
27
  name: 'Max Mustermann'
28
28
  },
29
- deleted: false
29
+ deleted: false,
30
+ payment: null
30
31
  });
31
32
  const attendeeWithMultipleTags = new Attendee({
32
33
  id: 'my-attendee-2',
@@ -43,7 +44,8 @@ const attendeeWithMultipleTags = new Attendee({
43
44
  userdata: {
44
45
  name: 'Max Mustermann'
45
46
  },
46
- deleted: false
47
+ deleted: false,
48
+ payment: null
47
49
  });
48
50
  const companion = new Attendee({
49
51
  id: 'my-companion',
@@ -61,7 +63,8 @@ const companion = new Attendee({
61
63
  userdata: {
62
64
  name: 'John Doe'
63
65
  },
64
- deleted: false
66
+ deleted: false,
67
+ payment: null
65
68
  });
66
69
  const tagColors = {
67
70
  VIP: theme.colors.enterPink,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dev-crew-berlin/enter-js-utils",
3
- "version": "0.54.1",
3
+ "version": "0.60.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",