@beabee/beabee-common 1.19.5 → 1.19.7

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.
Files changed (220) hide show
  1. package/README.md +41 -0
  2. package/dist/cjs/data/index.cjs +87 -0
  3. package/dist/cjs/error/InvalidRule.cjs +35 -0
  4. package/dist/cjs/error/index.cjs +22 -0
  5. package/dist/cjs/index.cjs +28 -0
  6. package/dist/cjs/search/api-keys.cjs +35 -0
  7. package/dist/cjs/search/callouts.cjs +131 -0
  8. package/dist/cjs/search/contacts.cjs +105 -0
  9. package/dist/cjs/search/index.cjs +32 -0
  10. package/dist/cjs/search/notices.cjs +61 -0
  11. package/dist/cjs/search/operators.cjs +89 -0
  12. package/dist/cjs/search/payments.cjs +51 -0
  13. package/dist/cjs/types/api-key-filter-name.cjs +16 -0
  14. package/dist/cjs/types/array-filter-args.cjs +16 -0
  15. package/dist/cjs/types/base-callout-component-schema.cjs +16 -0
  16. package/dist/cjs/types/base-filter-args.cjs +16 -0
  17. package/dist/cjs/types/base-validated-rule.cjs +16 -0
  18. package/dist/cjs/types/callout-component-schema.cjs +16 -0
  19. package/dist/cjs/types/callout-filter-name.cjs +16 -0
  20. package/dist/cjs/types/callout-form-schema.cjs +16 -0
  21. package/dist/cjs/types/callout-navigation-schema.cjs +16 -0
  22. package/dist/cjs/types/callout-response-answer-address.cjs +16 -0
  23. package/dist/cjs/types/callout-response-answer-file-upload.cjs +16 -0
  24. package/dist/cjs/types/callout-response-answer.cjs +16 -0
  25. package/dist/cjs/types/callout-response-answers.cjs +16 -0
  26. package/dist/cjs/types/callout-response-comment-filter-name.cjs +16 -0
  27. package/dist/cjs/types/callout-response-filter-name.cjs +16 -0
  28. package/dist/cjs/types/callout-slide-schema.cjs +16 -0
  29. package/dist/cjs/types/callout-tag-filter-name.cjs +16 -0
  30. package/dist/cjs/types/content-callout-component-schema.cjs +16 -0
  31. package/dist/cjs/types/date-unit.cjs +16 -0
  32. package/dist/cjs/types/duration.cjs +16 -0
  33. package/dist/cjs/types/enum-filter-args.cjs +16 -0
  34. package/dist/cjs/types/feeable.cjs +16 -0
  35. package/dist/cjs/types/filter-args.cjs +16 -0
  36. package/dist/cjs/types/filter-type.cjs +16 -0
  37. package/dist/cjs/types/filters.cjs +16 -0
  38. package/dist/cjs/types/index.cjs +120 -0
  39. package/dist/cjs/types/input-callout-component-schema.cjs +16 -0
  40. package/dist/cjs/types/input-file-callout-component-schema.cjs +16 -0
  41. package/dist/cjs/types/nestable-callout-component-schema.cjs +16 -0
  42. package/dist/cjs/types/notice-filter-name.cjs +16 -0
  43. package/dist/cjs/types/operators-by-type.cjs +16 -0
  44. package/dist/cjs/types/other-filter-args.cjs +16 -0
  45. package/dist/cjs/types/paginated-query.cjs +16 -0
  46. package/dist/cjs/types/paginated.cjs +16 -0
  47. package/dist/cjs/types/payment-filter-name.cjs +16 -0
  48. package/dist/cjs/types/radio-callout-component-schema.cjs +16 -0
  49. package/dist/cjs/types/role-type.cjs +16 -0
  50. package/dist/cjs/types/rule-group.cjs +16 -0
  51. package/dist/cjs/types/rule-operator.cjs +16 -0
  52. package/dist/cjs/types/rule-opperator-params.cjs +16 -0
  53. package/dist/cjs/types/rule-value.cjs +16 -0
  54. package/dist/cjs/types/rule.cjs +16 -0
  55. package/dist/cjs/types/select-callout-component-schema.cjs +16 -0
  56. package/dist/cjs/types/stripe-fee-country.cjs +16 -0
  57. package/dist/cjs/types/unit-matches.cjs +16 -0
  58. package/dist/cjs/types/validated-boolean-rule.cjs +16 -0
  59. package/dist/cjs/types/validated-number-rule.cjs +16 -0
  60. package/dist/cjs/types/validated-rule-group.cjs +16 -0
  61. package/dist/cjs/types/validated-rule-value.cjs +16 -0
  62. package/dist/cjs/types/validated-rule.cjs +16 -0
  63. package/dist/cjs/types/validated-string-rule.cjs +16 -0
  64. package/dist/cjs/utils/callouts.cjs +137 -0
  65. package/dist/cjs/utils/date.cjs +87 -0
  66. package/dist/cjs/utils/index.cjs +28 -0
  67. package/dist/cjs/utils/payments.cjs +53 -0
  68. package/dist/cjs/utils/rules.cjs +109 -0
  69. package/dist/esm/data/index.js +57 -50
  70. package/dist/esm/error/InvalidRule.js +10 -7
  71. package/dist/esm/error/index.js +1 -2
  72. package/dist/esm/index.js +4 -7
  73. package/dist/esm/search/api-keys.js +10 -7
  74. package/dist/esm/search/callouts.js +100 -94
  75. package/dist/esm/search/contacts.js +83 -74
  76. package/dist/esm/search/index.js +6 -64
  77. package/dist/esm/search/notices.js +36 -33
  78. package/dist/esm/search/operators.js +62 -0
  79. package/dist/esm/search/payments.js +26 -23
  80. package/dist/esm/types/api-key-filter-name.js +0 -0
  81. package/dist/esm/types/array-filter-args.js +0 -0
  82. package/dist/esm/types/base-callout-component-schema.js +0 -0
  83. package/dist/esm/types/base-filter-args.js +0 -0
  84. package/dist/esm/types/base-validated-rule.js +0 -0
  85. package/dist/esm/types/callout-component-schema.js +0 -0
  86. package/dist/esm/types/callout-filter-name.js +0 -0
  87. package/dist/esm/types/callout-form-schema.js +0 -0
  88. package/dist/esm/types/callout-navigation-schema.js +0 -0
  89. package/dist/esm/types/callout-response-answer-address.js +0 -0
  90. package/dist/esm/types/callout-response-answer-file-upload.js +0 -0
  91. package/dist/esm/types/callout-response-answer.js +0 -0
  92. package/dist/esm/types/callout-response-answers.js +0 -0
  93. package/dist/esm/types/callout-response-comment-filter-name.js +0 -0
  94. package/dist/esm/types/callout-response-filter-name.js +0 -0
  95. package/dist/esm/types/callout-slide-schema.js +0 -0
  96. package/dist/esm/types/callout-tag-filter-name.js +0 -0
  97. package/dist/esm/types/content-callout-component-schema.js +0 -0
  98. package/dist/esm/types/date-unit.js +0 -0
  99. package/dist/esm/types/duration.js +0 -0
  100. package/dist/esm/types/enum-filter-args.js +0 -0
  101. package/dist/esm/types/feeable.js +0 -0
  102. package/dist/esm/types/filter-args.js +0 -0
  103. package/dist/esm/types/filter-type.js +0 -0
  104. package/dist/esm/types/filters.js +0 -0
  105. package/dist/esm/types/index.js +50 -0
  106. package/dist/esm/types/input-callout-component-schema.js +0 -0
  107. package/dist/esm/types/input-file-callout-component-schema.js +0 -0
  108. package/dist/esm/types/nestable-callout-component-schema.js +0 -0
  109. package/dist/esm/types/notice-filter-name.js +0 -0
  110. package/dist/esm/types/operators-by-type.js +0 -0
  111. package/dist/esm/types/other-filter-args.js +0 -0
  112. package/dist/esm/types/paginated-query.js +0 -0
  113. package/dist/esm/types/paginated.js +0 -0
  114. package/dist/esm/types/payment-filter-name.js +0 -0
  115. package/dist/esm/types/radio-callout-component-schema.js +0 -0
  116. package/dist/esm/types/role-type.js +0 -0
  117. package/dist/esm/types/rule-group.js +0 -0
  118. package/dist/esm/types/rule-operator.js +0 -0
  119. package/dist/esm/types/rule-opperator-params.js +0 -0
  120. package/dist/esm/types/rule-value.js +0 -0
  121. package/dist/esm/types/rule.js +0 -0
  122. package/dist/esm/types/select-callout-component-schema.js +0 -0
  123. package/dist/esm/types/stripe-fee-country.js +0 -0
  124. package/dist/esm/types/unit-matches.js +0 -0
  125. package/dist/esm/types/validated-boolean-rule.js +0 -0
  126. package/dist/esm/types/validated-number-rule.js +0 -0
  127. package/dist/esm/types/validated-rule-group.js +0 -0
  128. package/dist/esm/types/validated-rule-value.js +0 -0
  129. package/dist/esm/types/validated-rule.js +0 -0
  130. package/dist/esm/types/validated-string-rule.js +0 -0
  131. package/dist/esm/utils/callouts.js +91 -93
  132. package/dist/esm/utils/date.js +56 -56
  133. package/dist/esm/utils/index.js +4 -0
  134. package/dist/esm/utils/payments.js +25 -23
  135. package/dist/esm/utils/rules.js +75 -58
  136. package/dist/types/data/index.d.ts +0 -4
  137. package/dist/types/error/InvalidRule.d.ts +2 -2
  138. package/dist/types/error/index.d.ts +1 -2
  139. package/dist/types/index.d.ts +5 -7
  140. package/dist/types/search/api-keys.d.ts +0 -1
  141. package/dist/types/search/callouts.d.ts +1 -5
  142. package/dist/types/search/contacts.d.ts +3 -2
  143. package/dist/types/search/index.d.ts +6 -194
  144. package/dist/types/search/notices.d.ts +1 -2
  145. package/dist/types/search/operators.d.ts +128 -0
  146. package/dist/types/search/payments.d.ts +1 -2
  147. package/dist/types/types/api-key-filter-name.d.ts +2 -0
  148. package/dist/types/types/array-filter-args.d.ts +5 -0
  149. package/dist/types/types/base-callout-component-schema.d.ts +9 -0
  150. package/dist/types/types/base-filter-args.d.ts +5 -0
  151. package/dist/types/types/base-validated-rule.d.ts +9 -0
  152. package/dist/types/types/callout-component-schema.d.ts +2 -0
  153. package/dist/types/types/callout-filter-name.d.ts +2 -0
  154. package/dist/types/types/callout-form-schema.d.ts +4 -0
  155. package/dist/types/types/callout-navigation-schema.d.ts +6 -0
  156. package/dist/types/types/callout-response-answer-address.d.ts +9 -0
  157. package/dist/types/types/callout-response-answer-file-upload.d.ts +3 -0
  158. package/dist/types/types/callout-response-answer.d.ts +2 -0
  159. package/dist/types/types/callout-response-answers.d.ts +5 -0
  160. package/dist/types/types/callout-response-comment-filter-name.d.ts +2 -0
  161. package/dist/types/types/callout-response-filter-name.d.ts +2 -0
  162. package/dist/types/types/callout-slide-schema.d.ts +7 -0
  163. package/dist/types/types/callout-tag-filter-name.d.ts +2 -0
  164. package/dist/types/types/content-callout-component-schema.d.ts +5 -0
  165. package/dist/types/types/date-unit.d.ts +2 -0
  166. package/dist/types/types/duration.d.ts +1 -0
  167. package/dist/types/types/enum-filter-args.d.ts +5 -0
  168. package/dist/types/types/feeable.d.ts +6 -0
  169. package/dist/types/types/filter-args.d.ts +2 -0
  170. package/dist/types/types/filter-type.d.ts +1 -0
  171. package/dist/types/types/filters.d.ts +2 -0
  172. package/dist/types/types/index.d.ts +50 -0
  173. package/dist/types/types/input-callout-component-schema.d.ts +6 -0
  174. package/dist/types/types/input-file-callout-component-schema.d.ts +5 -0
  175. package/dist/types/types/nestable-callout-component-schema.d.ts +6 -0
  176. package/dist/types/types/notice-filter-name.d.ts +2 -0
  177. package/dist/types/types/operators-by-type.d.ts +2 -0
  178. package/dist/types/types/other-filter-args.d.ts +4 -0
  179. package/dist/types/types/paginated-query.d.ts +8 -0
  180. package/dist/types/types/paginated.d.ts +6 -0
  181. package/dist/types/types/payment-filter-name.d.ts +2 -0
  182. package/dist/types/types/radio-callout-component-schema.d.ts +10 -0
  183. package/dist/types/types/role-type.d.ts +2 -0
  184. package/dist/types/types/rule-group.d.ts +5 -0
  185. package/dist/types/types/rule-operator.d.ts +2 -0
  186. package/dist/types/types/rule-opperator-params.d.ts +3 -0
  187. package/dist/types/types/rule-value.d.ts +1 -0
  188. package/dist/types/types/rule.d.ts +6 -0
  189. package/dist/types/types/select-callout-component-schema.d.ts +11 -0
  190. package/dist/types/types/stripe-fee-country.d.ts +1 -0
  191. package/dist/types/types/unit-matches.d.ts +2 -0
  192. package/dist/types/types/validated-boolean-rule.d.ts +2 -0
  193. package/dist/types/types/validated-number-rule.d.ts +2 -0
  194. package/dist/types/types/validated-rule-group.d.ts +5 -0
  195. package/dist/types/types/validated-rule-value.d.ts +2 -0
  196. package/dist/types/types/validated-rule.d.ts +2 -0
  197. package/dist/types/types/validated-string-rule.d.ts +2 -0
  198. package/dist/types/utils/callouts.d.ts +1 -3
  199. package/dist/types/utils/date.d.ts +3 -3
  200. package/dist/types/utils/index.d.ts +4 -0
  201. package/dist/types/utils/payments.d.ts +1 -7
  202. package/dist/types/utils/rules.d.ts +1 -1
  203. package/package.json +31 -12
  204. package/dist/cjs/data/callouts.js +0 -2
  205. package/dist/cjs/data/index.js +0 -67
  206. package/dist/cjs/error/InvalidRule.js +0 -11
  207. package/dist/cjs/error/index.js +0 -8
  208. package/dist/cjs/index.js +0 -23
  209. package/dist/cjs/search/api-keys.js +0 -11
  210. package/dist/cjs/search/callouts.js +0 -101
  211. package/dist/cjs/search/contacts.js +0 -78
  212. package/dist/cjs/search/index.js +0 -81
  213. package/dist/cjs/search/notices.js +0 -37
  214. package/dist/cjs/search/payments.js +0 -27
  215. package/dist/cjs/utils/callouts.js +0 -118
  216. package/dist/cjs/utils/date.js +0 -77
  217. package/dist/cjs/utils/payments.js +0 -31
  218. package/dist/cjs/utils/rules.js +0 -69
  219. package/dist/esm/data/callouts.js +0 -1
  220. package/dist/types/data/callouts.d.ts +0 -70
@@ -1,194 +1,6 @@
1
- export declare const ruleOperators: readonly ["equal", "not_equal", "less", "less_or_equal", "greater", "greater_or_equal", "between", "not_between", "begins_with", "not_begins_with", "contains", "not_contains", "ends_with", "not_ends_with", "is_empty", "is_not_empty"];
2
- export type RuleOperator = (typeof ruleOperators)[number];
3
- export type RuleValue = string | number | boolean;
4
- export interface Rule {
5
- field: string;
6
- operator: RuleOperator;
7
- value: RuleValue[];
8
- }
9
- export interface RuleGroup {
10
- condition: "AND" | "OR";
11
- rules: (RuleGroup | Rule)[];
12
- }
13
- export type ValidatedRuleValue<T extends FilterType> = T extends "number" ? number : T extends "boolean" ? boolean : string;
14
- interface BaseValidatedRule<T extends FilterType, F extends string> {
15
- type: T;
16
- field: F;
17
- nullable: boolean;
18
- operator: keyof (typeof operatorsByType)[T];
19
- value: ValidatedRuleValue<T>[];
20
- }
21
- type ValidatedNumberRule<Field extends string> = BaseValidatedRule<"number", Field>;
22
- type ValidatedStringRule<Field extends string> = BaseValidatedRule<Exclude<FilterType, "number" | "boolean">, Field>;
23
- type ValidatedBooleanRule<Field extends string> = BaseValidatedRule<"boolean", Field>;
24
- export type ValidatedRule<Field extends string> = ValidatedNumberRule<Field> | ValidatedStringRule<Field> | ValidatedBooleanRule<Field>;
25
- export interface ValidatedRuleGroup<Field extends string> {
26
- condition: "AND" | "OR";
27
- rules: (ValidatedRuleGroup<Field> | ValidatedRule<Field>)[];
28
- }
29
- export type FilterType = "text" | "blob" | "date" | "number" | "boolean" | "array" | "enum" | "contact";
30
- interface BaseFilterArgs {
31
- type: FilterType;
32
- nullable?: boolean;
33
- }
34
- export interface ArrayFilterArgs<T extends readonly string[] | undefined> extends BaseFilterArgs {
35
- type: "array";
36
- options?: T;
37
- }
38
- export interface EnumFilterArgs<T extends readonly string[]> extends BaseFilterArgs {
39
- type: "enum";
40
- options: T;
41
- }
42
- export interface OtherFilterArgs extends BaseFilterArgs {
43
- type: Exclude<FilterType, "array" | "enum">;
44
- }
45
- export type FilterArgs = ArrayFilterArgs<readonly string[] | undefined> | EnumFilterArgs<readonly string[]> | OtherFilterArgs;
46
- export type Filters<T extends string = string> = Record<T, FilterArgs>;
47
- export interface RuleOperatorParams {
48
- args: number;
49
- }
50
- export declare const nullableOperators: {
51
- is_empty: {
52
- args: number;
53
- };
54
- is_not_empty: {
55
- args: number;
56
- };
57
- };
58
- type OperatorsByType = Record<FilterType, Partial<Record<RuleOperator, RuleOperatorParams>>>;
59
- export declare const operatorsByType: {
60
- readonly text: {
61
- readonly begins_with: {
62
- args: number;
63
- };
64
- readonly ends_with: {
65
- args: number;
66
- };
67
- readonly not_begins_with: {
68
- args: number;
69
- };
70
- readonly not_ends_with: {
71
- args: number;
72
- };
73
- readonly contains: {
74
- args: number;
75
- };
76
- readonly not_contains: {
77
- args: number;
78
- };
79
- readonly equal: {
80
- args: number;
81
- };
82
- readonly not_equal: {
83
- args: number;
84
- };
85
- };
86
- readonly blob: {
87
- contains: {
88
- args: number;
89
- };
90
- not_contains: {
91
- args: number;
92
- };
93
- };
94
- readonly date: {
95
- between: {
96
- args: number;
97
- };
98
- not_between: {
99
- args: number;
100
- };
101
- less: {
102
- args: number;
103
- };
104
- greater: {
105
- args: number;
106
- };
107
- less_or_equal: {
108
- args: number;
109
- };
110
- greater_or_equal: {
111
- args: number;
112
- };
113
- equal: {
114
- args: number;
115
- };
116
- not_equal: {
117
- args: number;
118
- };
119
- };
120
- readonly number: {
121
- between: {
122
- args: number;
123
- };
124
- not_between: {
125
- args: number;
126
- };
127
- less: {
128
- args: number;
129
- };
130
- greater: {
131
- args: number;
132
- };
133
- less_or_equal: {
134
- args: number;
135
- };
136
- greater_or_equal: {
137
- args: number;
138
- };
139
- equal: {
140
- args: number;
141
- };
142
- not_equal: {
143
- args: number;
144
- };
145
- };
146
- readonly boolean: {
147
- readonly equal: {
148
- args: number;
149
- };
150
- };
151
- readonly array: {
152
- contains: {
153
- args: number;
154
- };
155
- not_contains: {
156
- args: number;
157
- };
158
- };
159
- readonly enum: {
160
- equal: {
161
- args: number;
162
- };
163
- not_equal: {
164
- args: number;
165
- };
166
- };
167
- readonly contact: {
168
- equal: {
169
- args: number;
170
- };
171
- not_equal: {
172
- args: number;
173
- };
174
- };
175
- };
176
- export declare const operatorsByTypeMap: OperatorsByType;
177
- export interface Paginated<T> {
178
- items: T[];
179
- offset: number;
180
- count: number;
181
- total: number;
182
- }
183
- export interface PaginatedQuery {
184
- limit?: number;
185
- offset?: number;
186
- sort?: string;
187
- order?: "ASC" | "DESC";
188
- rules?: RuleGroup;
189
- }
190
- export * from "./api-keys";
191
- export * from "./callouts";
192
- export * from "./contacts";
193
- export * from "./notices";
194
- export * from "./payments";
1
+ export * from "./api-keys.ts";
2
+ export * from "./callouts.ts";
3
+ export * from "./contacts.ts";
4
+ export * from "./notices.ts";
5
+ export * from "./operators.ts";
6
+ export * from "./payments.ts";
@@ -1,4 +1,4 @@
1
- import { ItemStatus } from "../data";
1
+ import { ItemStatus } from "../data/index.ts";
2
2
  export declare const noticeFilters: {
3
3
  readonly id: {
4
4
  readonly type: "text";
@@ -27,4 +27,3 @@ export declare const noticeFilters: {
27
27
  readonly options: readonly [ItemStatus.Draft, ItemStatus.Scheduled, ItemStatus.Open, ItemStatus.Ended];
28
28
  };
29
29
  };
30
- export type NoticeFilterName = keyof typeof noticeFilters;
@@ -0,0 +1,128 @@
1
+ import type { OperatorsByType } from "../types/index.ts";
2
+ export declare const nullableOperators: {
3
+ is_empty: {
4
+ args: number;
5
+ };
6
+ is_not_empty: {
7
+ args: number;
8
+ };
9
+ };
10
+ export declare const operatorsByType: {
11
+ readonly text: {
12
+ readonly begins_with: {
13
+ args: number;
14
+ };
15
+ readonly ends_with: {
16
+ args: number;
17
+ };
18
+ readonly not_begins_with: {
19
+ args: number;
20
+ };
21
+ readonly not_ends_with: {
22
+ args: number;
23
+ };
24
+ readonly contains: {
25
+ args: number;
26
+ };
27
+ readonly not_contains: {
28
+ args: number;
29
+ };
30
+ readonly equal: {
31
+ args: number;
32
+ };
33
+ readonly not_equal: {
34
+ args: number;
35
+ };
36
+ };
37
+ readonly blob: {
38
+ contains: {
39
+ args: number;
40
+ };
41
+ not_contains: {
42
+ args: number;
43
+ };
44
+ };
45
+ readonly date: {
46
+ between: {
47
+ args: number;
48
+ };
49
+ not_between: {
50
+ args: number;
51
+ };
52
+ less: {
53
+ args: number;
54
+ };
55
+ greater: {
56
+ args: number;
57
+ };
58
+ less_or_equal: {
59
+ args: number;
60
+ };
61
+ greater_or_equal: {
62
+ args: number;
63
+ };
64
+ equal: {
65
+ args: number;
66
+ };
67
+ not_equal: {
68
+ args: number;
69
+ };
70
+ };
71
+ readonly number: {
72
+ between: {
73
+ args: number;
74
+ };
75
+ not_between: {
76
+ args: number;
77
+ };
78
+ less: {
79
+ args: number;
80
+ };
81
+ greater: {
82
+ args: number;
83
+ };
84
+ less_or_equal: {
85
+ args: number;
86
+ };
87
+ greater_or_equal: {
88
+ args: number;
89
+ };
90
+ equal: {
91
+ args: number;
92
+ };
93
+ not_equal: {
94
+ args: number;
95
+ };
96
+ };
97
+ readonly boolean: {
98
+ readonly equal: {
99
+ args: number;
100
+ };
101
+ };
102
+ readonly array: {
103
+ contains: {
104
+ args: number;
105
+ };
106
+ not_contains: {
107
+ args: number;
108
+ };
109
+ };
110
+ readonly enum: {
111
+ equal: {
112
+ args: number;
113
+ };
114
+ not_equal: {
115
+ args: number;
116
+ };
117
+ };
118
+ readonly contact: {
119
+ equal: {
120
+ args: number;
121
+ };
122
+ not_equal: {
123
+ args: number;
124
+ };
125
+ };
126
+ };
127
+ export declare const operatorsByTypeMap: OperatorsByType;
128
+ export declare const ruleOperators: readonly ["equal", "not_equal", "less", "less_or_equal", "greater", "greater_or_equal", "between", "not_between", "begins_with", "not_begins_with", "contains", "not_contains", "ends_with", "not_ends_with", "is_empty", "is_not_empty"];
@@ -1,4 +1,4 @@
1
- import { PaymentStatus } from "../data";
1
+ import { PaymentStatus } from "../data/index.ts";
2
2
  export declare const paymentFilters: {
3
3
  readonly id: {
4
4
  readonly type: "text";
@@ -17,4 +17,3 @@ export declare const paymentFilters: {
17
17
  readonly options: readonly [PaymentStatus.Successful, PaymentStatus.Pending, PaymentStatus.Failed, PaymentStatus.Cancelled];
18
18
  };
19
19
  };
20
- export type PaymentFilterName = keyof typeof paymentFilters;
@@ -0,0 +1,2 @@
1
+ import type { apiKeyFilters } from "../search/api-keys.ts";
2
+ export type ApiKeyFilterName = keyof typeof apiKeyFilters;
@@ -0,0 +1,5 @@
1
+ import type { BaseFilterArgs } from "./index.ts";
2
+ export interface ArrayFilterArgs<T extends readonly string[] | undefined> extends BaseFilterArgs {
3
+ type: "array";
4
+ options?: T;
5
+ }
@@ -0,0 +1,9 @@
1
+ export interface BaseCalloutComponentSchema {
2
+ id: string;
3
+ type: string;
4
+ key: string;
5
+ label?: string;
6
+ input?: boolean;
7
+ adminOnly?: boolean;
8
+ [key: string]: unknown;
9
+ }
@@ -0,0 +1,5 @@
1
+ import type { FilterType } from "./index.ts";
2
+ export interface BaseFilterArgs {
3
+ type: FilterType;
4
+ nullable?: boolean;
5
+ }
@@ -0,0 +1,9 @@
1
+ import type { FilterType, ValidatedRuleValue } from "./index.ts";
2
+ import type { operatorsByType } from "../search/operators.ts";
3
+ export interface BaseValidatedRule<T extends FilterType, F extends string> {
4
+ type: T;
5
+ field: F;
6
+ nullable: boolean;
7
+ operator: keyof (typeof operatorsByType)[T];
8
+ value: ValidatedRuleValue<T>[];
9
+ }
@@ -0,0 +1,2 @@
1
+ import type { ContentCalloutComponentSchema, InputCalloutComponentSchema, NestableCalloutComponentSchema, RadioCalloutComponentSchema, SelectCalloutComponentSchema } from "./index.ts";
2
+ export type CalloutComponentSchema = ContentCalloutComponentSchema | SelectCalloutComponentSchema | RadioCalloutComponentSchema | InputCalloutComponentSchema | NestableCalloutComponentSchema;
@@ -0,0 +1,2 @@
1
+ import type { calloutFilters } from "../search/callouts.ts";
2
+ export type CalloutFilterName = keyof typeof calloutFilters;
@@ -0,0 +1,4 @@
1
+ import type { CalloutSlideSchema } from "./index.ts";
2
+ export interface CalloutFormSchema {
3
+ slides: CalloutSlideSchema[];
4
+ }
@@ -0,0 +1,6 @@
1
+ export interface CalloutNavigationSchema {
2
+ prevText: string;
3
+ nextText: string;
4
+ nextSlideId: string;
5
+ submitText: string;
6
+ }
@@ -0,0 +1,9 @@
1
+ export interface CalloutResponseAnswerAddress {
2
+ formatted_address: string;
3
+ geometry: {
4
+ location: {
5
+ lat: number;
6
+ lng: number;
7
+ };
8
+ };
9
+ }
@@ -0,0 +1,3 @@
1
+ export interface CalloutResponseAnswerFileUpload {
2
+ url: string;
3
+ }
@@ -0,0 +1,2 @@
1
+ import type { CalloutResponseAnswerAddress, CalloutResponseAnswerFileUpload } from "./index.ts";
2
+ export type CalloutResponseAnswer = string | boolean | number | null | undefined | Record<string, boolean> | CalloutResponseAnswerAddress | CalloutResponseAnswerFileUpload;
@@ -0,0 +1,5 @@
1
+ import type { CalloutResponseAnswer } from "./index.ts";
2
+ /**
3
+ * Answers are grouped by slide key: {[slideId]: {[componentKey]: answer | answer[]}}
4
+ */
5
+ export type CalloutResponseAnswers = Record<string, Record<string, CalloutResponseAnswer | CalloutResponseAnswer[]> | undefined>;
@@ -0,0 +1,2 @@
1
+ import type { calloutResponseCommentFilters } from "../search/callouts.ts";
2
+ export type CalloutResponseCommentFilterName = keyof typeof calloutResponseCommentFilters;
@@ -0,0 +1,2 @@
1
+ import { calloutResponseFilters } from "../search/callouts.ts";
2
+ export type CalloutResponseFilterName = keyof typeof calloutResponseFilters;
@@ -0,0 +1,7 @@
1
+ import type { CalloutComponentSchema, CalloutNavigationSchema } from "./index.ts";
2
+ export interface CalloutSlideSchema {
3
+ id: string;
4
+ title: string;
5
+ components: CalloutComponentSchema[];
6
+ navigation: CalloutNavigationSchema;
7
+ }
@@ -0,0 +1,2 @@
1
+ import type { calloutTagFilters } from "../search/callouts.ts";
2
+ export type CalloutTagFilterName = keyof typeof calloutTagFilters;
@@ -0,0 +1,5 @@
1
+ import { BaseCalloutComponentSchema } from "./index.ts";
2
+ export interface ContentCalloutComponentSchema extends BaseCalloutComponentSchema {
3
+ type: "content";
4
+ input: false;
5
+ }
@@ -0,0 +1,2 @@
1
+ import type { dateUnits } from "../utils/date.ts";
2
+ export type DateUnit = (typeof dateUnits)[number];
@@ -0,0 +1 @@
1
+ export type { Duration } from "date-fns";
@@ -0,0 +1,5 @@
1
+ import type { BaseFilterArgs } from "./index.ts";
2
+ export interface EnumFilterArgs<T extends readonly string[]> extends BaseFilterArgs {
3
+ type: "enum";
4
+ options: T;
5
+ }
@@ -0,0 +1,6 @@
1
+ import type { ContributionPeriod, PaymentMethod } from "../data/index.ts";
2
+ export interface Feeable {
3
+ amount: number;
4
+ period: ContributionPeriod;
5
+ paymentMethod: PaymentMethod;
6
+ }
@@ -0,0 +1,2 @@
1
+ import type { ArrayFilterArgs, EnumFilterArgs, OtherFilterArgs } from "./index.ts";
2
+ export type FilterArgs = ArrayFilterArgs<readonly string[] | undefined> | EnumFilterArgs<readonly string[]> | OtherFilterArgs;
@@ -0,0 +1 @@
1
+ export type FilterType = "text" | "blob" | "date" | "number" | "boolean" | "array" | "enum" | "contact";
@@ -0,0 +1,2 @@
1
+ import { FilterArgs } from "../types/index.ts";
2
+ export type Filters<T extends string = string> = Record<T, FilterArgs>;
@@ -0,0 +1,50 @@
1
+ export * from "./api-key-filter-name.ts";
2
+ export * from "./array-filter-args.ts";
3
+ export * from "./base-callout-component-schema.ts";
4
+ export * from "./base-filter-args.ts";
5
+ export * from "./base-validated-rule.ts";
6
+ export * from "./callout-component-schema.ts";
7
+ export * from "./callout-filter-name.ts";
8
+ export * from "./callout-form-schema.ts";
9
+ export * from "./callout-navigation-schema.ts";
10
+ export * from "./callout-response-answer-address.ts";
11
+ export * from "./callout-response-answer-file-upload.ts";
12
+ export * from "./callout-response-answer.ts";
13
+ export * from "./callout-response-answers.ts";
14
+ export * from "./callout-response-comment-filter-name.ts";
15
+ export * from "./callout-response-filter-name.ts";
16
+ export * from "./callout-slide-schema.ts";
17
+ export * from "./callout-tag-filter-name.ts";
18
+ export * from "./content-callout-component-schema.ts";
19
+ export * from "./date-unit.ts";
20
+ export * from "./duration.ts";
21
+ export * from "./enum-filter-args.ts";
22
+ export * from "./feeable.ts";
23
+ export * from "./filter-args.ts";
24
+ export * from "./filter-type.ts";
25
+ export * from "./filters.ts";
26
+ export * from "./input-callout-component-schema.ts";
27
+ export * from "./input-file-callout-component-schema.ts";
28
+ export * from "./nestable-callout-component-schema.ts";
29
+ export * from "./notice-filter-name.ts";
30
+ export * from "./operators-by-type.ts";
31
+ export * from "./other-filter-args.ts";
32
+ export * from "./paginated-query.ts";
33
+ export * from "./paginated.ts";
34
+ export * from "./payment-filter-name.ts";
35
+ export * from "./radio-callout-component-schema.ts";
36
+ export * from "./role-type.ts";
37
+ export * from "./rule-group.ts";
38
+ export * from "./rule-operator.ts";
39
+ export * from "./rule-opperator-params.ts";
40
+ export * from "./rule-value.ts";
41
+ export * from "./rule.ts";
42
+ export * from "./select-callout-component-schema.ts";
43
+ export * from "./stripe-fee-country.ts";
44
+ export * from "./unit-matches.ts";
45
+ export * from "./validated-boolean-rule.ts";
46
+ export * from "./validated-number-rule.ts";
47
+ export * from "./validated-rule-group.ts";
48
+ export * from "./validated-rule-value.ts";
49
+ export * from "./validated-rule.ts";
50
+ export * from "./validated-string-rule.ts";
@@ -0,0 +1,6 @@
1
+ import type { BaseCalloutComponentSchema } from "./index.ts";
2
+ export interface InputCalloutComponentSchema extends BaseCalloutComponentSchema {
3
+ type: "address" | "button" | "checkbox" | "email" | "file" | "number" | "password" | "textfield" | "textarea" | "content" | "phoneNumber" | "currency" | "datetime" | "time" | "url" | "signature";
4
+ input: true;
5
+ placeholder?: string;
6
+ }
@@ -0,0 +1,5 @@
1
+ import type { InputCalloutComponentSchema } from "./index.ts";
2
+ export interface InputFileCalloutComponentSchema extends InputCalloutComponentSchema {
3
+ type: "file";
4
+ filePattern: string;
5
+ }
@@ -0,0 +1,6 @@
1
+ import type { BaseCalloutComponentSchema, CalloutComponentSchema } from "./index.ts";
2
+ export interface NestableCalloutComponentSchema extends BaseCalloutComponentSchema {
3
+ type: "panel" | "well" | "tabs";
4
+ input: false;
5
+ components: CalloutComponentSchema[];
6
+ }
@@ -0,0 +1,2 @@
1
+ import { noticeFilters } from "../search/notices.ts";
2
+ export type NoticeFilterName = keyof typeof noticeFilters;
@@ -0,0 +1,2 @@
1
+ import type { FilterType, RuleOperator, RuleOperatorParams } from "./index.ts";
2
+ export type OperatorsByType = Record<FilterType, Partial<Record<RuleOperator, RuleOperatorParams>>>;
@@ -0,0 +1,4 @@
1
+ import type { BaseFilterArgs, FilterType } from "./index.ts";
2
+ export interface OtherFilterArgs extends BaseFilterArgs {
3
+ type: Exclude<FilterType, "array" | "enum">;
4
+ }
@@ -0,0 +1,8 @@
1
+ import type { RuleGroup } from "./index.ts";
2
+ export interface PaginatedQuery {
3
+ limit?: number;
4
+ offset?: number;
5
+ sort?: string;
6
+ order?: "ASC" | "DESC";
7
+ rules?: RuleGroup;
8
+ }
@@ -0,0 +1,6 @@
1
+ export interface Paginated<T> {
2
+ items: T[];
3
+ offset: number;
4
+ count: number;
5
+ total: number;
6
+ }
@@ -0,0 +1,2 @@
1
+ import { paymentFilters } from "../search/payments.ts";
2
+ export type PaymentFilterName = keyof typeof paymentFilters;
@@ -0,0 +1,10 @@
1
+ import type { BaseCalloutComponentSchema } from "./index.ts";
2
+ export interface RadioCalloutComponentSchema extends BaseCalloutComponentSchema {
3
+ type: "radio" | "selectboxes";
4
+ input: true;
5
+ values: {
6
+ label: string;
7
+ value: string;
8
+ nextSlideId: string;
9
+ }[];
10
+ }
@@ -0,0 +1,2 @@
1
+ import type { RoleTypes } from "../search/contacts.ts";
2
+ export type RoleType = (typeof RoleTypes)[number];
@@ -0,0 +1,5 @@
1
+ import type { Rule } from "./index.ts";
2
+ export interface RuleGroup {
3
+ condition: "AND" | "OR";
4
+ rules: (RuleGroup | Rule)[];
5
+ }
@@ -0,0 +1,2 @@
1
+ import type { ruleOperators } from "../search/index.ts";
2
+ export type RuleOperator = (typeof ruleOperators)[number];
@@ -0,0 +1,3 @@
1
+ export interface RuleOperatorParams {
2
+ args: number;
3
+ }
@@ -0,0 +1 @@
1
+ export type RuleValue = string | number | boolean;
@@ -0,0 +1,6 @@
1
+ import { RuleOperator, RuleValue } from "./index.ts";
2
+ export interface Rule {
3
+ field: string;
4
+ operator: RuleOperator;
5
+ value: RuleValue[];
6
+ }