@voyant-travel/identity-react 0.119.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/LICENSE +201 -0
- package/README.md +39 -0
- package/dist/client.d.ts +14 -0
- package/dist/client.d.ts.map +1 -0
- package/dist/client.js +58 -0
- package/dist/components/address-dialog.d.ts +11 -0
- package/dist/components/address-dialog.d.ts.map +1 -0
- package/dist/components/address-dialog.js +130 -0
- package/dist/components/contact-point-dialog.d.ts +11 -0
- package/dist/components/contact-point-dialog.d.ts.map +1 -0
- package/dist/components/contact-point-dialog.js +78 -0
- package/dist/components/entity-ref-picker.d.ts +21 -0
- package/dist/components/entity-ref-picker.d.ts.map +1 -0
- package/dist/components/entity-ref-picker.js +38 -0
- package/dist/components/identity-page.d.ts +20 -0
- package/dist/components/identity-page.d.ts.map +1 -0
- package/dist/components/identity-page.js +230 -0
- package/dist/components/named-contact-dialog.d.ts +11 -0
- package/dist/components/named-contact-dialog.d.ts.map +1 -0
- package/dist/components/named-contact-dialog.js +101 -0
- package/dist/hooks/index.d.ts +7 -0
- package/dist/hooks/index.d.ts.map +1 -0
- package/dist/hooks/index.js +6 -0
- package/dist/hooks/use-address-mutation.d.ts +72 -0
- package/dist/hooks/use-address-mutation.d.ts.map +1 -0
- package/dist/hooks/use-address-mutation.js +40 -0
- package/dist/hooks/use-addresses.d.ts +31 -0
- package/dist/hooks/use-addresses.d.ts.map +1 -0
- package/dist/hooks/use-addresses.js +12 -0
- package/dist/hooks/use-contact-point-mutation.d.ts +51 -0
- package/dist/hooks/use-contact-point-mutation.d.ts.map +1 -0
- package/dist/hooks/use-contact-point-mutation.js +40 -0
- package/dist/hooks/use-contact-points.d.ts +24 -0
- package/dist/hooks/use-contact-points.d.ts.map +1 -0
- package/dist/hooks/use-contact-points.js +12 -0
- package/dist/hooks/use-named-contact-mutation.d.ts +54 -0
- package/dist/hooks/use-named-contact-mutation.d.ts.map +1 -0
- package/dist/hooks/use-named-contact-mutation.js +40 -0
- package/dist/hooks/use-named-contacts.d.ts +25 -0
- package/dist/hooks/use-named-contacts.d.ts.map +1 -0
- package/dist/hooks/use-named-contacts.js +12 -0
- package/dist/i18n/en.d.ts +193 -0
- package/dist/i18n/en.d.ts.map +1 -0
- package/dist/i18n/en.js +192 -0
- package/dist/i18n/index.d.ts +5 -0
- package/dist/i18n/index.d.ts.map +1 -0
- package/dist/i18n/index.js +3 -0
- package/dist/i18n/messages.d.ts +161 -0
- package/dist/i18n/messages.d.ts.map +1 -0
- package/dist/i18n/messages.js +1 -0
- package/dist/i18n/provider.d.ts +408 -0
- package/dist/i18n/provider.d.ts.map +1 -0
- package/dist/i18n/provider.js +44 -0
- package/dist/i18n/ro.d.ts +193 -0
- package/dist/i18n/ro.d.ts.map +1 -0
- package/dist/i18n/ro.js +192 -0
- package/dist/index.d.ts +7 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +6 -0
- package/dist/provider.d.ts +2 -0
- package/dist/provider.d.ts.map +1 -0
- package/dist/provider.js +1 -0
- package/dist/query-keys.d.ts +40 -0
- package/dist/query-keys.d.ts.map +1 -0
- package/dist/query-keys.js +12 -0
- package/dist/query-options.d.ts +489 -0
- package/dist/query-options.d.ts.map +1 -0
- package/dist/query-options.js +63 -0
- package/dist/schemas.d.ts +278 -0
- package/dist/schemas.d.ts.map +1 -0
- package/dist/schemas.js +52 -0
- package/dist/ui.d.ts +7 -0
- package/dist/ui.d.ts.map +1 -0
- package/dist/ui.js +6 -0
- package/package.json +146 -0
- package/src/styles.css +11 -0
|
@@ -0,0 +1,489 @@
|
|
|
1
|
+
import { type FetchWithValidationOptions } from "./client.js";
|
|
2
|
+
import type { UseAddressesOptions } from "./hooks/use-addresses.js";
|
|
3
|
+
import type { UseContactPointsOptions } from "./hooks/use-contact-points.js";
|
|
4
|
+
import type { UseNamedContactsOptions } from "./hooks/use-named-contacts.js";
|
|
5
|
+
export declare function getContactPointsQueryOptions(client: FetchWithValidationOptions, options?: UseContactPointsOptions): import("@tanstack/react-query").OmitKeyof<import("@tanstack/react-query").UseQueryOptions<{
|
|
6
|
+
data: {
|
|
7
|
+
entityType: string;
|
|
8
|
+
entityId: string;
|
|
9
|
+
kind: "other" | "email" | "phone" | "mobile" | "website" | "whatsapp" | "sms" | "fax" | "social";
|
|
10
|
+
value: string;
|
|
11
|
+
isPrimary: boolean;
|
|
12
|
+
id: string;
|
|
13
|
+
label: string | null;
|
|
14
|
+
normalizedValue: string | null;
|
|
15
|
+
notes: string | null;
|
|
16
|
+
createdAt: string;
|
|
17
|
+
updatedAt: string;
|
|
18
|
+
metadata?: Record<string, unknown> | null | undefined;
|
|
19
|
+
}[];
|
|
20
|
+
total: number;
|
|
21
|
+
limit: number;
|
|
22
|
+
offset: number;
|
|
23
|
+
}, Error, {
|
|
24
|
+
data: {
|
|
25
|
+
entityType: string;
|
|
26
|
+
entityId: string;
|
|
27
|
+
kind: "other" | "email" | "phone" | "mobile" | "website" | "whatsapp" | "sms" | "fax" | "social";
|
|
28
|
+
value: string;
|
|
29
|
+
isPrimary: boolean;
|
|
30
|
+
id: string;
|
|
31
|
+
label: string | null;
|
|
32
|
+
normalizedValue: string | null;
|
|
33
|
+
notes: string | null;
|
|
34
|
+
createdAt: string;
|
|
35
|
+
updatedAt: string;
|
|
36
|
+
metadata?: Record<string, unknown> | null | undefined;
|
|
37
|
+
}[];
|
|
38
|
+
total: number;
|
|
39
|
+
limit: number;
|
|
40
|
+
offset: number;
|
|
41
|
+
}, readonly ["identity", "contact-points", import("./query-keys.js").ContactPointsListFilters]>, "queryFn"> & {
|
|
42
|
+
queryFn?: import("@tanstack/react-query").QueryFunction<{
|
|
43
|
+
data: {
|
|
44
|
+
entityType: string;
|
|
45
|
+
entityId: string;
|
|
46
|
+
kind: "other" | "email" | "phone" | "mobile" | "website" | "whatsapp" | "sms" | "fax" | "social";
|
|
47
|
+
value: string;
|
|
48
|
+
isPrimary: boolean;
|
|
49
|
+
id: string;
|
|
50
|
+
label: string | null;
|
|
51
|
+
normalizedValue: string | null;
|
|
52
|
+
notes: string | null;
|
|
53
|
+
createdAt: string;
|
|
54
|
+
updatedAt: string;
|
|
55
|
+
metadata?: Record<string, unknown> | null | undefined;
|
|
56
|
+
}[];
|
|
57
|
+
total: number;
|
|
58
|
+
limit: number;
|
|
59
|
+
offset: number;
|
|
60
|
+
}, readonly ["identity", "contact-points", import("./query-keys.js").ContactPointsListFilters], never> | undefined;
|
|
61
|
+
} & {
|
|
62
|
+
queryKey: readonly ["identity", "contact-points", import("./query-keys.js").ContactPointsListFilters] & {
|
|
63
|
+
[dataTagSymbol]: {
|
|
64
|
+
data: {
|
|
65
|
+
entityType: string;
|
|
66
|
+
entityId: string;
|
|
67
|
+
kind: "other" | "email" | "phone" | "mobile" | "website" | "whatsapp" | "sms" | "fax" | "social";
|
|
68
|
+
value: string;
|
|
69
|
+
isPrimary: boolean;
|
|
70
|
+
id: string;
|
|
71
|
+
label: string | null;
|
|
72
|
+
normalizedValue: string | null;
|
|
73
|
+
notes: string | null;
|
|
74
|
+
createdAt: string;
|
|
75
|
+
updatedAt: string;
|
|
76
|
+
metadata?: Record<string, unknown> | null | undefined;
|
|
77
|
+
}[];
|
|
78
|
+
total: number;
|
|
79
|
+
limit: number;
|
|
80
|
+
offset: number;
|
|
81
|
+
};
|
|
82
|
+
[dataTagErrorSymbol]: Error;
|
|
83
|
+
};
|
|
84
|
+
};
|
|
85
|
+
export declare function getContactPointQueryOptions(client: FetchWithValidationOptions, id: string): import("@tanstack/react-query").OmitKeyof<import("@tanstack/react-query").UseQueryOptions<{
|
|
86
|
+
entityType: string;
|
|
87
|
+
entityId: string;
|
|
88
|
+
kind: "other" | "email" | "phone" | "mobile" | "website" | "whatsapp" | "sms" | "fax" | "social";
|
|
89
|
+
value: string;
|
|
90
|
+
isPrimary: boolean;
|
|
91
|
+
id: string;
|
|
92
|
+
label: string | null;
|
|
93
|
+
normalizedValue: string | null;
|
|
94
|
+
notes: string | null;
|
|
95
|
+
createdAt: string;
|
|
96
|
+
updatedAt: string;
|
|
97
|
+
metadata?: Record<string, unknown> | null | undefined;
|
|
98
|
+
}, Error, {
|
|
99
|
+
entityType: string;
|
|
100
|
+
entityId: string;
|
|
101
|
+
kind: "other" | "email" | "phone" | "mobile" | "website" | "whatsapp" | "sms" | "fax" | "social";
|
|
102
|
+
value: string;
|
|
103
|
+
isPrimary: boolean;
|
|
104
|
+
id: string;
|
|
105
|
+
label: string | null;
|
|
106
|
+
normalizedValue: string | null;
|
|
107
|
+
notes: string | null;
|
|
108
|
+
createdAt: string;
|
|
109
|
+
updatedAt: string;
|
|
110
|
+
metadata?: Record<string, unknown> | null | undefined;
|
|
111
|
+
}, readonly ["identity", "contact-points", string]>, "queryFn"> & {
|
|
112
|
+
queryFn?: import("@tanstack/react-query").QueryFunction<{
|
|
113
|
+
entityType: string;
|
|
114
|
+
entityId: string;
|
|
115
|
+
kind: "other" | "email" | "phone" | "mobile" | "website" | "whatsapp" | "sms" | "fax" | "social";
|
|
116
|
+
value: string;
|
|
117
|
+
isPrimary: boolean;
|
|
118
|
+
id: string;
|
|
119
|
+
label: string | null;
|
|
120
|
+
normalizedValue: string | null;
|
|
121
|
+
notes: string | null;
|
|
122
|
+
createdAt: string;
|
|
123
|
+
updatedAt: string;
|
|
124
|
+
metadata?: Record<string, unknown> | null | undefined;
|
|
125
|
+
}, readonly ["identity", "contact-points", string], never> | undefined;
|
|
126
|
+
} & {
|
|
127
|
+
queryKey: readonly ["identity", "contact-points", string] & {
|
|
128
|
+
[dataTagSymbol]: {
|
|
129
|
+
entityType: string;
|
|
130
|
+
entityId: string;
|
|
131
|
+
kind: "other" | "email" | "phone" | "mobile" | "website" | "whatsapp" | "sms" | "fax" | "social";
|
|
132
|
+
value: string;
|
|
133
|
+
isPrimary: boolean;
|
|
134
|
+
id: string;
|
|
135
|
+
label: string | null;
|
|
136
|
+
normalizedValue: string | null;
|
|
137
|
+
notes: string | null;
|
|
138
|
+
createdAt: string;
|
|
139
|
+
updatedAt: string;
|
|
140
|
+
metadata?: Record<string, unknown> | null | undefined;
|
|
141
|
+
};
|
|
142
|
+
[dataTagErrorSymbol]: Error;
|
|
143
|
+
};
|
|
144
|
+
};
|
|
145
|
+
export declare function getAddressesQueryOptions(client: FetchWithValidationOptions, options?: UseAddressesOptions): import("@tanstack/react-query").OmitKeyof<import("@tanstack/react-query").UseQueryOptions<{
|
|
146
|
+
data: {
|
|
147
|
+
entityType: string;
|
|
148
|
+
entityId: string;
|
|
149
|
+
label: "service" | "other" | "primary" | "legal" | "billing" | "shipping" | "mailing" | "meeting";
|
|
150
|
+
isPrimary: boolean;
|
|
151
|
+
id: string;
|
|
152
|
+
fullText: string | null;
|
|
153
|
+
line1: string | null;
|
|
154
|
+
line2: string | null;
|
|
155
|
+
city: string | null;
|
|
156
|
+
region: string | null;
|
|
157
|
+
postalCode: string | null;
|
|
158
|
+
country: string | null;
|
|
159
|
+
latitude: number | null;
|
|
160
|
+
longitude: number | null;
|
|
161
|
+
timezone: string | null;
|
|
162
|
+
notes: string | null;
|
|
163
|
+
createdAt: string;
|
|
164
|
+
updatedAt: string;
|
|
165
|
+
metadata?: Record<string, unknown> | null | undefined;
|
|
166
|
+
}[];
|
|
167
|
+
total: number;
|
|
168
|
+
limit: number;
|
|
169
|
+
offset: number;
|
|
170
|
+
}, Error, {
|
|
171
|
+
data: {
|
|
172
|
+
entityType: string;
|
|
173
|
+
entityId: string;
|
|
174
|
+
label: "service" | "other" | "primary" | "legal" | "billing" | "shipping" | "mailing" | "meeting";
|
|
175
|
+
isPrimary: boolean;
|
|
176
|
+
id: string;
|
|
177
|
+
fullText: string | null;
|
|
178
|
+
line1: string | null;
|
|
179
|
+
line2: string | null;
|
|
180
|
+
city: string | null;
|
|
181
|
+
region: string | null;
|
|
182
|
+
postalCode: string | null;
|
|
183
|
+
country: string | null;
|
|
184
|
+
latitude: number | null;
|
|
185
|
+
longitude: number | null;
|
|
186
|
+
timezone: string | null;
|
|
187
|
+
notes: string | null;
|
|
188
|
+
createdAt: string;
|
|
189
|
+
updatedAt: string;
|
|
190
|
+
metadata?: Record<string, unknown> | null | undefined;
|
|
191
|
+
}[];
|
|
192
|
+
total: number;
|
|
193
|
+
limit: number;
|
|
194
|
+
offset: number;
|
|
195
|
+
}, readonly ["identity", "addresses", import("./query-keys.js").AddressesListFilters]>, "queryFn"> & {
|
|
196
|
+
queryFn?: import("@tanstack/react-query").QueryFunction<{
|
|
197
|
+
data: {
|
|
198
|
+
entityType: string;
|
|
199
|
+
entityId: string;
|
|
200
|
+
label: "service" | "other" | "primary" | "legal" | "billing" | "shipping" | "mailing" | "meeting";
|
|
201
|
+
isPrimary: boolean;
|
|
202
|
+
id: string;
|
|
203
|
+
fullText: string | null;
|
|
204
|
+
line1: string | null;
|
|
205
|
+
line2: string | null;
|
|
206
|
+
city: string | null;
|
|
207
|
+
region: string | null;
|
|
208
|
+
postalCode: string | null;
|
|
209
|
+
country: string | null;
|
|
210
|
+
latitude: number | null;
|
|
211
|
+
longitude: number | null;
|
|
212
|
+
timezone: string | null;
|
|
213
|
+
notes: string | null;
|
|
214
|
+
createdAt: string;
|
|
215
|
+
updatedAt: string;
|
|
216
|
+
metadata?: Record<string, unknown> | null | undefined;
|
|
217
|
+
}[];
|
|
218
|
+
total: number;
|
|
219
|
+
limit: number;
|
|
220
|
+
offset: number;
|
|
221
|
+
}, readonly ["identity", "addresses", import("./query-keys.js").AddressesListFilters], never> | undefined;
|
|
222
|
+
} & {
|
|
223
|
+
queryKey: readonly ["identity", "addresses", import("./query-keys.js").AddressesListFilters] & {
|
|
224
|
+
[dataTagSymbol]: {
|
|
225
|
+
data: {
|
|
226
|
+
entityType: string;
|
|
227
|
+
entityId: string;
|
|
228
|
+
label: "service" | "other" | "primary" | "legal" | "billing" | "shipping" | "mailing" | "meeting";
|
|
229
|
+
isPrimary: boolean;
|
|
230
|
+
id: string;
|
|
231
|
+
fullText: string | null;
|
|
232
|
+
line1: string | null;
|
|
233
|
+
line2: string | null;
|
|
234
|
+
city: string | null;
|
|
235
|
+
region: string | null;
|
|
236
|
+
postalCode: string | null;
|
|
237
|
+
country: string | null;
|
|
238
|
+
latitude: number | null;
|
|
239
|
+
longitude: number | null;
|
|
240
|
+
timezone: string | null;
|
|
241
|
+
notes: string | null;
|
|
242
|
+
createdAt: string;
|
|
243
|
+
updatedAt: string;
|
|
244
|
+
metadata?: Record<string, unknown> | null | undefined;
|
|
245
|
+
}[];
|
|
246
|
+
total: number;
|
|
247
|
+
limit: number;
|
|
248
|
+
offset: number;
|
|
249
|
+
};
|
|
250
|
+
[dataTagErrorSymbol]: Error;
|
|
251
|
+
};
|
|
252
|
+
};
|
|
253
|
+
export declare function getAddressQueryOptions(client: FetchWithValidationOptions, id: string): import("@tanstack/react-query").OmitKeyof<import("@tanstack/react-query").UseQueryOptions<{
|
|
254
|
+
entityType: string;
|
|
255
|
+
entityId: string;
|
|
256
|
+
label: "service" | "other" | "primary" | "legal" | "billing" | "shipping" | "mailing" | "meeting";
|
|
257
|
+
isPrimary: boolean;
|
|
258
|
+
id: string;
|
|
259
|
+
fullText: string | null;
|
|
260
|
+
line1: string | null;
|
|
261
|
+
line2: string | null;
|
|
262
|
+
city: string | null;
|
|
263
|
+
region: string | null;
|
|
264
|
+
postalCode: string | null;
|
|
265
|
+
country: string | null;
|
|
266
|
+
latitude: number | null;
|
|
267
|
+
longitude: number | null;
|
|
268
|
+
timezone: string | null;
|
|
269
|
+
notes: string | null;
|
|
270
|
+
createdAt: string;
|
|
271
|
+
updatedAt: string;
|
|
272
|
+
metadata?: Record<string, unknown> | null | undefined;
|
|
273
|
+
}, Error, {
|
|
274
|
+
entityType: string;
|
|
275
|
+
entityId: string;
|
|
276
|
+
label: "service" | "other" | "primary" | "legal" | "billing" | "shipping" | "mailing" | "meeting";
|
|
277
|
+
isPrimary: boolean;
|
|
278
|
+
id: string;
|
|
279
|
+
fullText: string | null;
|
|
280
|
+
line1: string | null;
|
|
281
|
+
line2: string | null;
|
|
282
|
+
city: string | null;
|
|
283
|
+
region: string | null;
|
|
284
|
+
postalCode: string | null;
|
|
285
|
+
country: string | null;
|
|
286
|
+
latitude: number | null;
|
|
287
|
+
longitude: number | null;
|
|
288
|
+
timezone: string | null;
|
|
289
|
+
notes: string | null;
|
|
290
|
+
createdAt: string;
|
|
291
|
+
updatedAt: string;
|
|
292
|
+
metadata?: Record<string, unknown> | null | undefined;
|
|
293
|
+
}, readonly ["identity", "addresses", string]>, "queryFn"> & {
|
|
294
|
+
queryFn?: import("@tanstack/react-query").QueryFunction<{
|
|
295
|
+
entityType: string;
|
|
296
|
+
entityId: string;
|
|
297
|
+
label: "service" | "other" | "primary" | "legal" | "billing" | "shipping" | "mailing" | "meeting";
|
|
298
|
+
isPrimary: boolean;
|
|
299
|
+
id: string;
|
|
300
|
+
fullText: string | null;
|
|
301
|
+
line1: string | null;
|
|
302
|
+
line2: string | null;
|
|
303
|
+
city: string | null;
|
|
304
|
+
region: string | null;
|
|
305
|
+
postalCode: string | null;
|
|
306
|
+
country: string | null;
|
|
307
|
+
latitude: number | null;
|
|
308
|
+
longitude: number | null;
|
|
309
|
+
timezone: string | null;
|
|
310
|
+
notes: string | null;
|
|
311
|
+
createdAt: string;
|
|
312
|
+
updatedAt: string;
|
|
313
|
+
metadata?: Record<string, unknown> | null | undefined;
|
|
314
|
+
}, readonly ["identity", "addresses", string], never> | undefined;
|
|
315
|
+
} & {
|
|
316
|
+
queryKey: readonly ["identity", "addresses", string] & {
|
|
317
|
+
[dataTagSymbol]: {
|
|
318
|
+
entityType: string;
|
|
319
|
+
entityId: string;
|
|
320
|
+
label: "service" | "other" | "primary" | "legal" | "billing" | "shipping" | "mailing" | "meeting";
|
|
321
|
+
isPrimary: boolean;
|
|
322
|
+
id: string;
|
|
323
|
+
fullText: string | null;
|
|
324
|
+
line1: string | null;
|
|
325
|
+
line2: string | null;
|
|
326
|
+
city: string | null;
|
|
327
|
+
region: string | null;
|
|
328
|
+
postalCode: string | null;
|
|
329
|
+
country: string | null;
|
|
330
|
+
latitude: number | null;
|
|
331
|
+
longitude: number | null;
|
|
332
|
+
timezone: string | null;
|
|
333
|
+
notes: string | null;
|
|
334
|
+
createdAt: string;
|
|
335
|
+
updatedAt: string;
|
|
336
|
+
metadata?: Record<string, unknown> | null | undefined;
|
|
337
|
+
};
|
|
338
|
+
[dataTagErrorSymbol]: Error;
|
|
339
|
+
};
|
|
340
|
+
};
|
|
341
|
+
export declare function getNamedContactsQueryOptions(client: FetchWithValidationOptions, options?: UseNamedContactsOptions): import("@tanstack/react-query").OmitKeyof<import("@tanstack/react-query").UseQueryOptions<{
|
|
342
|
+
data: {
|
|
343
|
+
entityType: string;
|
|
344
|
+
entityId: string;
|
|
345
|
+
role: "other" | "primary" | "legal" | "operations" | "general" | "reservations" | "front_desk" | "sales" | "emergency" | "accounting";
|
|
346
|
+
name: string;
|
|
347
|
+
isPrimary: boolean;
|
|
348
|
+
id: string;
|
|
349
|
+
title: string | null;
|
|
350
|
+
email: string | null;
|
|
351
|
+
phone: string | null;
|
|
352
|
+
notes: string | null;
|
|
353
|
+
createdAt: string;
|
|
354
|
+
updatedAt: string;
|
|
355
|
+
metadata?: Record<string, unknown> | null | undefined;
|
|
356
|
+
}[];
|
|
357
|
+
total: number;
|
|
358
|
+
limit: number;
|
|
359
|
+
offset: number;
|
|
360
|
+
}, Error, {
|
|
361
|
+
data: {
|
|
362
|
+
entityType: string;
|
|
363
|
+
entityId: string;
|
|
364
|
+
role: "other" | "primary" | "legal" | "operations" | "general" | "reservations" | "front_desk" | "sales" | "emergency" | "accounting";
|
|
365
|
+
name: string;
|
|
366
|
+
isPrimary: boolean;
|
|
367
|
+
id: string;
|
|
368
|
+
title: string | null;
|
|
369
|
+
email: string | null;
|
|
370
|
+
phone: string | null;
|
|
371
|
+
notes: string | null;
|
|
372
|
+
createdAt: string;
|
|
373
|
+
updatedAt: string;
|
|
374
|
+
metadata?: Record<string, unknown> | null | undefined;
|
|
375
|
+
}[];
|
|
376
|
+
total: number;
|
|
377
|
+
limit: number;
|
|
378
|
+
offset: number;
|
|
379
|
+
}, readonly ["identity", "named-contacts", import("./query-keys.js").NamedContactsListFilters]>, "queryFn"> & {
|
|
380
|
+
queryFn?: import("@tanstack/react-query").QueryFunction<{
|
|
381
|
+
data: {
|
|
382
|
+
entityType: string;
|
|
383
|
+
entityId: string;
|
|
384
|
+
role: "other" | "primary" | "legal" | "operations" | "general" | "reservations" | "front_desk" | "sales" | "emergency" | "accounting";
|
|
385
|
+
name: string;
|
|
386
|
+
isPrimary: boolean;
|
|
387
|
+
id: string;
|
|
388
|
+
title: string | null;
|
|
389
|
+
email: string | null;
|
|
390
|
+
phone: string | null;
|
|
391
|
+
notes: string | null;
|
|
392
|
+
createdAt: string;
|
|
393
|
+
updatedAt: string;
|
|
394
|
+
metadata?: Record<string, unknown> | null | undefined;
|
|
395
|
+
}[];
|
|
396
|
+
total: number;
|
|
397
|
+
limit: number;
|
|
398
|
+
offset: number;
|
|
399
|
+
}, readonly ["identity", "named-contacts", import("./query-keys.js").NamedContactsListFilters], never> | undefined;
|
|
400
|
+
} & {
|
|
401
|
+
queryKey: readonly ["identity", "named-contacts", import("./query-keys.js").NamedContactsListFilters] & {
|
|
402
|
+
[dataTagSymbol]: {
|
|
403
|
+
data: {
|
|
404
|
+
entityType: string;
|
|
405
|
+
entityId: string;
|
|
406
|
+
role: "other" | "primary" | "legal" | "operations" | "general" | "reservations" | "front_desk" | "sales" | "emergency" | "accounting";
|
|
407
|
+
name: string;
|
|
408
|
+
isPrimary: boolean;
|
|
409
|
+
id: string;
|
|
410
|
+
title: string | null;
|
|
411
|
+
email: string | null;
|
|
412
|
+
phone: string | null;
|
|
413
|
+
notes: string | null;
|
|
414
|
+
createdAt: string;
|
|
415
|
+
updatedAt: string;
|
|
416
|
+
metadata?: Record<string, unknown> | null | undefined;
|
|
417
|
+
}[];
|
|
418
|
+
total: number;
|
|
419
|
+
limit: number;
|
|
420
|
+
offset: number;
|
|
421
|
+
};
|
|
422
|
+
[dataTagErrorSymbol]: Error;
|
|
423
|
+
};
|
|
424
|
+
};
|
|
425
|
+
export declare function getNamedContactQueryOptions(client: FetchWithValidationOptions, id: string): import("@tanstack/react-query").OmitKeyof<import("@tanstack/react-query").UseQueryOptions<{
|
|
426
|
+
entityType: string;
|
|
427
|
+
entityId: string;
|
|
428
|
+
role: "other" | "primary" | "legal" | "operations" | "general" | "reservations" | "front_desk" | "sales" | "emergency" | "accounting";
|
|
429
|
+
name: string;
|
|
430
|
+
isPrimary: boolean;
|
|
431
|
+
id: string;
|
|
432
|
+
title: string | null;
|
|
433
|
+
email: string | null;
|
|
434
|
+
phone: string | null;
|
|
435
|
+
notes: string | null;
|
|
436
|
+
createdAt: string;
|
|
437
|
+
updatedAt: string;
|
|
438
|
+
metadata?: Record<string, unknown> | null | undefined;
|
|
439
|
+
}, Error, {
|
|
440
|
+
entityType: string;
|
|
441
|
+
entityId: string;
|
|
442
|
+
role: "other" | "primary" | "legal" | "operations" | "general" | "reservations" | "front_desk" | "sales" | "emergency" | "accounting";
|
|
443
|
+
name: string;
|
|
444
|
+
isPrimary: boolean;
|
|
445
|
+
id: string;
|
|
446
|
+
title: string | null;
|
|
447
|
+
email: string | null;
|
|
448
|
+
phone: string | null;
|
|
449
|
+
notes: string | null;
|
|
450
|
+
createdAt: string;
|
|
451
|
+
updatedAt: string;
|
|
452
|
+
metadata?: Record<string, unknown> | null | undefined;
|
|
453
|
+
}, readonly ["identity", "named-contacts", string]>, "queryFn"> & {
|
|
454
|
+
queryFn?: import("@tanstack/react-query").QueryFunction<{
|
|
455
|
+
entityType: string;
|
|
456
|
+
entityId: string;
|
|
457
|
+
role: "other" | "primary" | "legal" | "operations" | "general" | "reservations" | "front_desk" | "sales" | "emergency" | "accounting";
|
|
458
|
+
name: string;
|
|
459
|
+
isPrimary: boolean;
|
|
460
|
+
id: string;
|
|
461
|
+
title: string | null;
|
|
462
|
+
email: string | null;
|
|
463
|
+
phone: string | null;
|
|
464
|
+
notes: string | null;
|
|
465
|
+
createdAt: string;
|
|
466
|
+
updatedAt: string;
|
|
467
|
+
metadata?: Record<string, unknown> | null | undefined;
|
|
468
|
+
}, readonly ["identity", "named-contacts", string], never> | undefined;
|
|
469
|
+
} & {
|
|
470
|
+
queryKey: readonly ["identity", "named-contacts", string] & {
|
|
471
|
+
[dataTagSymbol]: {
|
|
472
|
+
entityType: string;
|
|
473
|
+
entityId: string;
|
|
474
|
+
role: "other" | "primary" | "legal" | "operations" | "general" | "reservations" | "front_desk" | "sales" | "emergency" | "accounting";
|
|
475
|
+
name: string;
|
|
476
|
+
isPrimary: boolean;
|
|
477
|
+
id: string;
|
|
478
|
+
title: string | null;
|
|
479
|
+
email: string | null;
|
|
480
|
+
phone: string | null;
|
|
481
|
+
notes: string | null;
|
|
482
|
+
createdAt: string;
|
|
483
|
+
updatedAt: string;
|
|
484
|
+
metadata?: Record<string, unknown> | null | undefined;
|
|
485
|
+
};
|
|
486
|
+
[dataTagErrorSymbol]: Error;
|
|
487
|
+
};
|
|
488
|
+
};
|
|
489
|
+
//# sourceMappingURL=query-options.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"query-options.d.ts","sourceRoot":"","sources":["../src/query-options.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,0BAA0B,EAAuB,MAAM,aAAa,CAAA;AAClF,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAA;AACnE,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,+BAA+B,CAAA;AAC5E,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,+BAA+B,CAAA;AAqB5E,wBAAgB,4BAA4B,CAC1C,MAAM,EAAE,0BAA0B,EAClC,OAAO,GAAE,uBAA4B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAYtC;AAED,wBAAgB,2BAA2B,CAAC,MAAM,EAAE,0BAA0B,EAAE,EAAE,EAAE,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAYzF;AAED,wBAAgB,wBAAwB,CACtC,MAAM,EAAE,0BAA0B,EAClC,OAAO,GAAE,mBAAwB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAYlC;AAED,wBAAgB,sBAAsB,CAAC,MAAM,EAAE,0BAA0B,EAAE,EAAE,EAAE,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAYpF;AAED,wBAAgB,4BAA4B,CAC1C,MAAM,EAAE,0BAA0B,EAClC,OAAO,GAAE,uBAA4B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAYtC;AAED,wBAAgB,2BAA2B,CAAC,MAAM,EAAE,0BAA0B,EAAE,EAAE,EAAE,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAYzF"}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { queryOptions } from "@tanstack/react-query";
|
|
3
|
+
import { fetchWithValidation } from "./client.js";
|
|
4
|
+
import { identityQueryKeys } from "./query-keys.js";
|
|
5
|
+
import { addressListResponse, addressSingleResponse, contactPointListResponse, contactPointSingleResponse, namedContactListResponse, namedContactSingleResponse, } from "./schemas.js";
|
|
6
|
+
function toQueryString(filters) {
|
|
7
|
+
const params = new URLSearchParams();
|
|
8
|
+
for (const [key, value] of Object.entries(filters)) {
|
|
9
|
+
if (value === undefined || value === null || value === "")
|
|
10
|
+
continue;
|
|
11
|
+
params.set(key, String(value));
|
|
12
|
+
}
|
|
13
|
+
const qs = params.toString();
|
|
14
|
+
return qs ? `?${qs}` : "";
|
|
15
|
+
}
|
|
16
|
+
export function getContactPointsQueryOptions(client, options = {}) {
|
|
17
|
+
const { enabled: _enabled = true, ...filters } = options;
|
|
18
|
+
return queryOptions({
|
|
19
|
+
queryKey: identityQueryKeys.contactPointsList(filters),
|
|
20
|
+
queryFn: () => fetchWithValidation(`/v1/identity/contact-points${toQueryString(filters)}`, contactPointListResponse, client),
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
export function getContactPointQueryOptions(client, id) {
|
|
24
|
+
return queryOptions({
|
|
25
|
+
queryKey: identityQueryKeys.contactPoint(id),
|
|
26
|
+
queryFn: async () => {
|
|
27
|
+
const { data } = await fetchWithValidation(`/v1/identity/contact-points/${id}`, contactPointSingleResponse, client);
|
|
28
|
+
return data;
|
|
29
|
+
},
|
|
30
|
+
});
|
|
31
|
+
}
|
|
32
|
+
export function getAddressesQueryOptions(client, options = {}) {
|
|
33
|
+
const { enabled: _enabled = true, ...filters } = options;
|
|
34
|
+
return queryOptions({
|
|
35
|
+
queryKey: identityQueryKeys.addressesList(filters),
|
|
36
|
+
queryFn: () => fetchWithValidation(`/v1/identity/addresses${toQueryString(filters)}`, addressListResponse, client),
|
|
37
|
+
});
|
|
38
|
+
}
|
|
39
|
+
export function getAddressQueryOptions(client, id) {
|
|
40
|
+
return queryOptions({
|
|
41
|
+
queryKey: identityQueryKeys.address(id),
|
|
42
|
+
queryFn: async () => {
|
|
43
|
+
const { data } = await fetchWithValidation(`/v1/identity/addresses/${id}`, addressSingleResponse, client);
|
|
44
|
+
return data;
|
|
45
|
+
},
|
|
46
|
+
});
|
|
47
|
+
}
|
|
48
|
+
export function getNamedContactsQueryOptions(client, options = {}) {
|
|
49
|
+
const { enabled: _enabled = true, ...filters } = options;
|
|
50
|
+
return queryOptions({
|
|
51
|
+
queryKey: identityQueryKeys.namedContactsList(filters),
|
|
52
|
+
queryFn: () => fetchWithValidation(`/v1/identity/named-contacts${toQueryString(filters)}`, namedContactListResponse, client),
|
|
53
|
+
});
|
|
54
|
+
}
|
|
55
|
+
export function getNamedContactQueryOptions(client, id) {
|
|
56
|
+
return queryOptions({
|
|
57
|
+
queryKey: identityQueryKeys.namedContact(id),
|
|
58
|
+
queryFn: async () => {
|
|
59
|
+
const { data } = await fetchWithValidation(`/v1/identity/named-contacts/${id}`, namedContactSingleResponse, client);
|
|
60
|
+
return data;
|
|
61
|
+
},
|
|
62
|
+
});
|
|
63
|
+
}
|