@beabee/beabee-common 1.10.3 → 1.10.5

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.
@@ -43,7 +43,7 @@ exports.calloutResponseFilters = {
43
43
  type: "date",
44
44
  },
45
45
  answers: {
46
- type: "custom",
46
+ type: "text",
47
47
  nullable: true,
48
48
  },
49
49
  };
@@ -31,7 +31,7 @@ const startOf = {
31
31
  m: startOfMinute_1.default,
32
32
  s: startOfSecond_1.default,
33
33
  };
34
- const relativeDate = /\$now(?<units>\(((y|M|d|h|m|s):(-?\d+),?)+\))?/;
34
+ const relativeDate = /^\$now(?<units>\(((y|M|d|h|m|s):(-?\d+),?)+\))?$/;
35
35
  const relativeUnit = /(y|M|d|h|m|s):(-?\d+)/g;
36
36
  // Matches the different parts of an ISO 8601 date. Note we don't validate the
37
37
  // pattern properly as that is handled by parseISO, we just want to know which
@@ -40,7 +40,7 @@ export const calloutResponseFilters = {
40
40
  type: "date",
41
41
  },
42
42
  answers: {
43
- type: "custom",
43
+ type: "text",
44
44
  nullable: true,
45
45
  },
46
46
  };
@@ -25,7 +25,7 @@ const startOf = {
25
25
  m: startOfMinute,
26
26
  s: startOfSecond,
27
27
  };
28
- const relativeDate = /\$now(?<units>\(((y|M|d|h|m|s):(-?\d+),?)+\))?/;
28
+ const relativeDate = /^\$now(?<units>\(((y|M|d|h|m|s):(-?\d+),?)+\))?$/;
29
29
  const relativeUnit = /(y|M|d|h|m|s):(-?\d+)/g;
30
30
  // Matches the different parts of an ISO 8601 date. Note we don't validate the
31
31
  // pattern properly as that is handled by parseISO, we just want to know which
@@ -40,4 +40,4 @@ export declare enum PaymentStatus {
40
40
  Cancelled = "cancelled"
41
41
  }
42
42
  export declare const RoleTypes: readonly ["member", "admin", "superadmin"];
43
- export type RoleType = typeof RoleTypes[number];
43
+ export type RoleType = (typeof RoleTypes)[number];
@@ -1,43 +1,43 @@
1
1
  import { ItemStatus } from "../data";
2
2
  export declare const calloutFilters: {
3
- title: {
4
- type: "text";
3
+ readonly title: {
4
+ readonly type: "text";
5
5
  };
6
- status: {
7
- type: "enum";
8
- options: ItemStatus[];
6
+ readonly status: {
7
+ readonly type: "enum";
8
+ readonly options: readonly [ItemStatus.Draft, ItemStatus.Scheduled, ItemStatus.Open, ItemStatus.Ended];
9
9
  };
10
- answeredBy: {
11
- type: "contact";
10
+ readonly answeredBy: {
11
+ readonly type: "contact";
12
12
  };
13
- starts: {
14
- type: "date";
13
+ readonly starts: {
14
+ readonly type: "date";
15
15
  };
16
- expires: {
17
- type: "date";
16
+ readonly expires: {
17
+ readonly type: "date";
18
18
  };
19
- hidden: {
20
- type: "boolean";
19
+ readonly hidden: {
20
+ readonly type: "boolean";
21
21
  };
22
22
  };
23
23
  export type CalloutFilterName = keyof typeof calloutFilters;
24
24
  export declare const calloutResponseFilters: {
25
- contact: {
26
- type: "contact";
27
- nullable: true;
25
+ readonly contact: {
26
+ readonly type: "contact";
27
+ readonly nullable: true;
28
28
  };
29
- callout: {
30
- type: "text";
29
+ readonly callout: {
30
+ readonly type: "text";
31
31
  };
32
- createdAt: {
33
- type: "date";
32
+ readonly createdAt: {
33
+ readonly type: "date";
34
34
  };
35
- updatedAt: {
36
- type: "date";
35
+ readonly updatedAt: {
36
+ readonly type: "date";
37
37
  };
38
- answers: {
39
- type: "custom";
40
- nullable: true;
38
+ readonly answers: {
39
+ readonly type: "text";
40
+ readonly nullable: true;
41
41
  };
42
42
  };
43
43
  export type CalloutResponseFilterName = keyof typeof calloutResponseFilters;
@@ -1,61 +1,61 @@
1
1
  import { ContributionPeriod, ContributionType, NewsletterStatus } from "../data";
2
2
  export declare const contactFilters: {
3
- firstname: {
4
- type: "text";
3
+ readonly firstname: {
4
+ readonly type: "text";
5
5
  };
6
- lastname: {
7
- type: "text";
6
+ readonly lastname: {
7
+ readonly type: "text";
8
8
  };
9
- email: {
10
- type: "text";
9
+ readonly email: {
10
+ readonly type: "text";
11
11
  };
12
- joined: {
13
- type: "date";
12
+ readonly joined: {
13
+ readonly type: "date";
14
14
  };
15
- lastSeen: {
16
- type: "date";
15
+ readonly lastSeen: {
16
+ readonly type: "date";
17
17
  };
18
- contributionCancelled: {
19
- type: "date";
18
+ readonly contributionCancelled: {
19
+ readonly type: "date";
20
20
  };
21
- contributionType: {
22
- type: "enum";
23
- options: ContributionType[];
21
+ readonly contributionType: {
22
+ readonly type: "enum";
23
+ readonly options: readonly [ContributionType.Automatic, ContributionType.Gift, ContributionType.Manual, ContributionType.None];
24
24
  };
25
- contributionMonthlyAmount: {
26
- type: "number";
25
+ readonly contributionMonthlyAmount: {
26
+ readonly type: "number";
27
27
  };
28
- contributionPeriod: {
29
- type: "enum";
30
- options: ContributionPeriod[];
28
+ readonly contributionPeriod: {
29
+ readonly type: "enum";
30
+ readonly options: readonly [ContributionPeriod.Monthly, ContributionPeriod.Annually];
31
31
  };
32
- deliveryOptIn: {
33
- type: "boolean";
32
+ readonly deliveryOptIn: {
33
+ readonly type: "boolean";
34
34
  };
35
- newsletterStatus: {
36
- type: "enum";
37
- options: NewsletterStatus[];
35
+ readonly newsletterStatus: {
36
+ readonly type: "enum";
37
+ readonly options: readonly [NewsletterStatus.Subscribed, NewsletterStatus.Unsubscribed, NewsletterStatus.Cleaned, NewsletterStatus.None];
38
38
  };
39
- activePermission: {
40
- type: "enum";
41
- options: readonly ["member", "admin", "superadmin"];
39
+ readonly activePermission: {
40
+ readonly type: "enum";
41
+ readonly options: readonly ["member", "admin", "superadmin"];
42
42
  };
43
- activeMembership: {
44
- type: "boolean";
43
+ readonly activeMembership: {
44
+ readonly type: "boolean";
45
45
  };
46
- membershipStarts: {
47
- type: "date";
46
+ readonly membershipStarts: {
47
+ readonly type: "date";
48
48
  };
49
- membershipExpires: {
50
- type: "date";
49
+ readonly membershipExpires: {
50
+ readonly type: "date";
51
51
  };
52
- manualPaymentSource: {
53
- type: "text";
54
- nullable: true;
52
+ readonly manualPaymentSource: {
53
+ readonly type: "text";
54
+ readonly nullable: true;
55
55
  };
56
- tags: {
57
- type: "array";
58
- nullable: true;
56
+ readonly tags: {
57
+ readonly type: "array";
58
+ readonly nullable: true;
59
59
  };
60
60
  };
61
61
  export type ContactFilterName = keyof typeof contactFilters;
@@ -53,33 +53,33 @@ export declare const nullableOperators: {
53
53
  };
54
54
  type OperatorsByType = Record<FilterType, Partial<Record<RuleOperator, RuleOperatorParams>>>;
55
55
  export declare const operatorsByType: {
56
- text: {
57
- begins_with: {
56
+ readonly text: {
57
+ readonly begins_with: {
58
58
  args: number;
59
59
  };
60
- ends_with: {
60
+ readonly ends_with: {
61
61
  args: number;
62
62
  };
63
- not_begins_with: {
63
+ readonly not_begins_with: {
64
64
  args: number;
65
65
  };
66
- not_ends_with: {
66
+ readonly not_ends_with: {
67
67
  args: number;
68
68
  };
69
- contains: {
69
+ readonly contains: {
70
70
  args: number;
71
71
  };
72
- not_contains: {
72
+ readonly not_contains: {
73
73
  args: number;
74
74
  };
75
- equal: {
75
+ readonly equal: {
76
76
  args: number;
77
77
  };
78
- not_equal: {
78
+ readonly not_equal: {
79
79
  args: number;
80
80
  };
81
81
  };
82
- date: {
82
+ readonly date: {
83
83
  between: {
84
84
  args: number;
85
85
  };
@@ -105,7 +105,7 @@ export declare const operatorsByType: {
105
105
  args: number;
106
106
  };
107
107
  };
108
- number: {
108
+ readonly number: {
109
109
  between: {
110
110
  args: number;
111
111
  };
@@ -131,12 +131,12 @@ export declare const operatorsByType: {
131
131
  args: number;
132
132
  };
133
133
  };
134
- boolean: {
135
- equal: {
134
+ readonly boolean: {
135
+ readonly equal: {
136
136
  args: number;
137
137
  };
138
138
  };
139
- array: {
139
+ readonly array: {
140
140
  contains: {
141
141
  args: number;
142
142
  };
@@ -144,7 +144,7 @@ export declare const operatorsByType: {
144
144
  args: number;
145
145
  };
146
146
  };
147
- enum: {
147
+ readonly enum: {
148
148
  equal: {
149
149
  args: number;
150
150
  };
@@ -152,7 +152,7 @@ export declare const operatorsByType: {
152
152
  args: number;
153
153
  };
154
154
  };
155
- contact: {
155
+ readonly contact: {
156
156
  equal: {
157
157
  args: number;
158
158
  };
@@ -160,47 +160,47 @@ export declare const operatorsByType: {
160
160
  args: number;
161
161
  };
162
162
  };
163
- custom: {
164
- between: {
163
+ readonly custom: {
164
+ readonly between: {
165
165
  args: number;
166
166
  };
167
- not_between: {
167
+ readonly not_between: {
168
168
  args: number;
169
169
  };
170
- less: {
170
+ readonly less: {
171
171
  args: number;
172
172
  };
173
- greater: {
173
+ readonly greater: {
174
174
  args: number;
175
175
  };
176
- less_or_equal: {
176
+ readonly less_or_equal: {
177
177
  args: number;
178
178
  };
179
- greater_or_equal: {
179
+ readonly greater_or_equal: {
180
180
  args: number;
181
181
  };
182
- equal: {
182
+ readonly equal: {
183
183
  args: number;
184
184
  };
185
- not_equal: {
185
+ readonly not_equal: {
186
186
  args: number;
187
187
  };
188
- begins_with: {
188
+ readonly begins_with: {
189
189
  args: number;
190
190
  };
191
- ends_with: {
191
+ readonly ends_with: {
192
192
  args: number;
193
193
  };
194
- not_begins_with: {
194
+ readonly not_begins_with: {
195
195
  args: number;
196
196
  };
197
- not_ends_with: {
197
+ readonly not_ends_with: {
198
198
  args: number;
199
199
  };
200
- contains: {
200
+ readonly contains: {
201
201
  args: number;
202
202
  };
203
- not_contains: {
203
+ readonly not_contains: {
204
204
  args: number;
205
205
  };
206
206
  };
@@ -1,27 +1,27 @@
1
1
  import { ItemStatus } from "../data";
2
2
  export declare const noticeFilters: {
3
- createdAt: {
4
- type: "date";
3
+ readonly createdAt: {
4
+ readonly type: "date";
5
5
  };
6
- updatedAt: {
7
- type: "date";
6
+ readonly updatedAt: {
7
+ readonly type: "date";
8
8
  };
9
- name: {
10
- type: "text";
9
+ readonly name: {
10
+ readonly type: "text";
11
11
  };
12
- expires: {
13
- type: "date";
14
- nullable: true;
12
+ readonly expires: {
13
+ readonly type: "date";
14
+ readonly nullable: true;
15
15
  };
16
- enabled: {
17
- type: "boolean";
16
+ readonly enabled: {
17
+ readonly type: "boolean";
18
18
  };
19
- text: {
20
- type: "text";
19
+ readonly text: {
20
+ readonly type: "text";
21
21
  };
22
- status: {
23
- type: "enum";
24
- options: ItemStatus[];
22
+ readonly status: {
23
+ readonly type: "enum";
24
+ readonly options: readonly [ItemStatus.Draft, ItemStatus.Scheduled, ItemStatus.Open, ItemStatus.Ended];
25
25
  };
26
26
  };
27
27
  export type NoticeFilterName = keyof typeof noticeFilters;
@@ -1,9 +1,9 @@
1
1
  export declare const paymentFilters: {
2
- contact: {
3
- type: "contact";
2
+ readonly contact: {
3
+ readonly type: "contact";
4
4
  };
5
- chargeDate: {
6
- type: "date";
5
+ readonly chargeDate: {
6
+ readonly type: "date";
7
7
  };
8
8
  };
9
9
  export type PaymentFilterName = keyof typeof paymentFilters;
@@ -1,5 +1,5 @@
1
1
  declare const dateUnits: readonly ["s", "m", "h", "d", "M", "y"];
2
- type DateUnit = typeof dateUnits[number];
2
+ type DateUnit = (typeof dateUnits)[number];
3
3
  export declare function parseDate(value: string, now?: Date): [Date, DateUnit];
4
4
  export declare function getMinDateUnit(units: [DateUnit, ...DateUnit[]]): DateUnit;
5
5
  export declare function getMinDateUnit(units: DateUnit[]): DateUnit | undefined;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@beabee/beabee-common",
3
- "version": "1.10.3",
3
+ "version": "1.10.5",
4
4
  "description": "",
5
5
  "main": "./dist/cjs/index.js",
6
6
  "module": "./dist/esm/index.js",