@sockethub/platform-carddav 1.0.0-alpha.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.
@@ -0,0 +1,608 @@
1
+ export declare const PlatformCardDavSchema: {
2
+ name: string;
3
+ version: string;
4
+ contextUrl: string;
5
+ contextVersion: string;
6
+ schemaVersion: string;
7
+ messages: {
8
+ required: string[];
9
+ properties: {
10
+ type: {
11
+ enum: string[];
12
+ };
13
+ actor: {
14
+ type: string;
15
+ required: string[];
16
+ additionalProperties: boolean;
17
+ properties: {
18
+ id: {
19
+ type: string;
20
+ minLength: number;
21
+ maxLength: number;
22
+ };
23
+ type: {
24
+ enum: string[];
25
+ };
26
+ };
27
+ };
28
+ target: {
29
+ type: string;
30
+ required: string[];
31
+ additionalProperties: boolean;
32
+ properties: {
33
+ id: {
34
+ type: string;
35
+ format: string;
36
+ maxLength: number;
37
+ };
38
+ type: {
39
+ enum: string[];
40
+ };
41
+ };
42
+ };
43
+ object: {
44
+ oneOf: ({
45
+ type: string;
46
+ additionalProperties: boolean;
47
+ properties: {
48
+ type: {
49
+ const: string;
50
+ };
51
+ text: {
52
+ type: string;
53
+ minLength: number;
54
+ maxLength: number;
55
+ };
56
+ fields: {
57
+ type: string;
58
+ uniqueItems: boolean;
59
+ maxItems: number;
60
+ items: {
61
+ enum: string[];
62
+ };
63
+ };
64
+ limit: {
65
+ type: string;
66
+ minimum: number;
67
+ maximum: number;
68
+ };
69
+ };
70
+ } | {
71
+ type: string;
72
+ required: string[];
73
+ additionalProperties: boolean;
74
+ properties: {
75
+ id: {
76
+ type: string;
77
+ format: string;
78
+ maxLength: number;
79
+ };
80
+ type: {
81
+ const: string;
82
+ };
83
+ etag: {
84
+ type: string;
85
+ minLength: number;
86
+ maxLength: number;
87
+ };
88
+ };
89
+ })[];
90
+ };
91
+ };
92
+ };
93
+ messageConstraints: {
94
+ oneOf: ({
95
+ properties: {
96
+ type: {
97
+ const: string;
98
+ };
99
+ object?: undefined;
100
+ };
101
+ required: string[];
102
+ not: {
103
+ anyOf: {
104
+ required: string[];
105
+ }[];
106
+ };
107
+ } | {
108
+ properties: {
109
+ type: {
110
+ const: string;
111
+ };
112
+ object: {
113
+ type: string;
114
+ additionalProperties: boolean;
115
+ properties: {
116
+ type: {
117
+ const: string;
118
+ };
119
+ text: {
120
+ type: string;
121
+ minLength: number;
122
+ maxLength: number;
123
+ };
124
+ fields: {
125
+ type: string;
126
+ uniqueItems: boolean;
127
+ maxItems: number;
128
+ items: {
129
+ enum: string[];
130
+ };
131
+ };
132
+ limit: {
133
+ type: string;
134
+ minimum: number;
135
+ maximum: number;
136
+ };
137
+ };
138
+ };
139
+ };
140
+ required: string[];
141
+ not?: undefined;
142
+ } | {
143
+ properties: {
144
+ type: {
145
+ const: string;
146
+ };
147
+ object: {
148
+ type: string;
149
+ required: string[];
150
+ additionalProperties: boolean;
151
+ properties: {
152
+ id: {
153
+ type: string;
154
+ format: string;
155
+ maxLength: number;
156
+ };
157
+ type: {
158
+ const: string;
159
+ };
160
+ etag: {
161
+ type: string;
162
+ minLength: number;
163
+ maxLength: number;
164
+ };
165
+ };
166
+ };
167
+ };
168
+ required: string[];
169
+ not?: undefined;
170
+ })[];
171
+ };
172
+ credentials: {
173
+ required: string[];
174
+ properties: {
175
+ object: {
176
+ oneOf: ({
177
+ type: string;
178
+ required: string[];
179
+ additionalProperties: boolean;
180
+ properties: {
181
+ type: {
182
+ const: string;
183
+ };
184
+ url: {
185
+ type: string;
186
+ format: string;
187
+ pattern: string;
188
+ maxLength: number;
189
+ };
190
+ username: {
191
+ type: string;
192
+ minLength: number;
193
+ maxLength: number;
194
+ };
195
+ password: {
196
+ type: string;
197
+ minLength: number;
198
+ maxLength: number;
199
+ };
200
+ token?: undefined;
201
+ };
202
+ } | {
203
+ type: string;
204
+ required: string[];
205
+ additionalProperties: boolean;
206
+ properties: {
207
+ type: {
208
+ const: string;
209
+ };
210
+ url: {
211
+ type: string;
212
+ format: string;
213
+ pattern: string;
214
+ maxLength: number;
215
+ };
216
+ token: {
217
+ type: string;
218
+ minLength: number;
219
+ maxLength: number;
220
+ };
221
+ username?: undefined;
222
+ password?: undefined;
223
+ };
224
+ })[];
225
+ };
226
+ };
227
+ };
228
+ responses: {
229
+ oneOf: ({
230
+ type: string;
231
+ required: string[];
232
+ additionalProperties: boolean;
233
+ properties: {
234
+ "@context": {
235
+ type: string;
236
+ items: {
237
+ type: string;
238
+ };
239
+ };
240
+ id: {
241
+ type: string[];
242
+ };
243
+ type: {
244
+ const: string;
245
+ enum?: undefined;
246
+ };
247
+ summary: {
248
+ type: string;
249
+ };
250
+ totalItems: {
251
+ type: string;
252
+ minimum: number;
253
+ };
254
+ items: {
255
+ type: string;
256
+ items: {
257
+ oneOf: ({
258
+ required: string[];
259
+ type: string;
260
+ additionalProperties: boolean;
261
+ properties: {
262
+ id: {
263
+ type: string;
264
+ format: string;
265
+ maxLength: number;
266
+ };
267
+ etag: {
268
+ type: string;
269
+ minLength: number;
270
+ maxLength: number;
271
+ };
272
+ uid: {
273
+ type: string;
274
+ minLength: number;
275
+ maxLength: number;
276
+ };
277
+ type: {
278
+ const: string;
279
+ };
280
+ name: {
281
+ type: string;
282
+ minLength: number;
283
+ maxLength: number;
284
+ };
285
+ givenName: {
286
+ type: string;
287
+ maxLength: number;
288
+ };
289
+ additionalNames: {
290
+ type: string;
291
+ maxItems: number;
292
+ items: {
293
+ type: string;
294
+ maxLength: number;
295
+ };
296
+ };
297
+ familyName: {
298
+ type: string;
299
+ maxLength: number;
300
+ };
301
+ honorificPrefixes: {
302
+ type: string;
303
+ maxItems: number;
304
+ items: {
305
+ type: string;
306
+ maxLength: number;
307
+ };
308
+ };
309
+ honorificSuffixes: {
310
+ type: string;
311
+ maxItems: number;
312
+ items: {
313
+ type: string;
314
+ maxLength: number;
315
+ };
316
+ };
317
+ nickname: {
318
+ type: string;
319
+ maxLength: number;
320
+ };
321
+ emails: {
322
+ type: string;
323
+ maxItems: number;
324
+ items: {
325
+ type: string;
326
+ required: string[];
327
+ additionalProperties: boolean;
328
+ properties: {
329
+ value: {
330
+ type: string;
331
+ minLength: number;
332
+ maxLength: number;
333
+ };
334
+ types: {
335
+ type: string;
336
+ uniqueItems: boolean;
337
+ maxItems: number;
338
+ items: {
339
+ type: string;
340
+ minLength: number;
341
+ maxLength: number;
342
+ pattern: string;
343
+ };
344
+ };
345
+ preferred: {
346
+ type: string;
347
+ };
348
+ };
349
+ };
350
+ };
351
+ telephones: {
352
+ type: string;
353
+ maxItems: number;
354
+ items: {
355
+ type: string;
356
+ required: string[];
357
+ additionalProperties: boolean;
358
+ properties: {
359
+ value: {
360
+ type: string;
361
+ minLength: number;
362
+ maxLength: number;
363
+ };
364
+ types: {
365
+ type: string;
366
+ uniqueItems: boolean;
367
+ maxItems: number;
368
+ items: {
369
+ type: string;
370
+ minLength: number;
371
+ maxLength: number;
372
+ pattern: string;
373
+ };
374
+ };
375
+ preferred: {
376
+ type: string;
377
+ };
378
+ };
379
+ };
380
+ };
381
+ addresses: {
382
+ type: string;
383
+ maxItems: number;
384
+ items: {
385
+ type: string;
386
+ additionalProperties: boolean;
387
+ properties: {
388
+ types: {
389
+ type: string;
390
+ uniqueItems: boolean;
391
+ maxItems: number;
392
+ items: {
393
+ type: string;
394
+ minLength: number;
395
+ maxLength: number;
396
+ pattern: string;
397
+ };
398
+ };
399
+ preferred: {
400
+ type: string;
401
+ };
402
+ postOfficeBox: {
403
+ type: string;
404
+ maxLength: number;
405
+ };
406
+ extendedAddress: {
407
+ type: string;
408
+ maxLength: number;
409
+ };
410
+ street: {
411
+ type: string;
412
+ maxLength: number;
413
+ };
414
+ locality: {
415
+ type: string;
416
+ maxLength: number;
417
+ };
418
+ region: {
419
+ type: string;
420
+ maxLength: number;
421
+ };
422
+ postalCode: {
423
+ type: string;
424
+ maxLength: number;
425
+ };
426
+ country: {
427
+ type: string;
428
+ maxLength: number;
429
+ };
430
+ };
431
+ };
432
+ };
433
+ organization: {
434
+ type: string;
435
+ maxLength: number;
436
+ };
437
+ title: {
438
+ type: string;
439
+ maxLength: number;
440
+ };
441
+ role: {
442
+ type: string;
443
+ maxLength: number;
444
+ };
445
+ urls: {
446
+ type: string;
447
+ maxItems: number;
448
+ items: {
449
+ type: string;
450
+ required: string[];
451
+ additionalProperties: boolean;
452
+ properties: {
453
+ value: {
454
+ type: string;
455
+ minLength: number;
456
+ maxLength: number;
457
+ };
458
+ types: {
459
+ type: string;
460
+ uniqueItems: boolean;
461
+ maxItems: number;
462
+ items: {
463
+ type: string;
464
+ minLength: number;
465
+ maxLength: number;
466
+ pattern: string;
467
+ };
468
+ };
469
+ preferred: {
470
+ type: string;
471
+ };
472
+ };
473
+ };
474
+ };
475
+ photoUrls: {
476
+ type: string;
477
+ maxItems: number;
478
+ items: {
479
+ type: string;
480
+ format: string;
481
+ pattern: string;
482
+ maxLength: number;
483
+ };
484
+ };
485
+ note: {
486
+ type: string;
487
+ maxLength: number;
488
+ };
489
+ birthday: {
490
+ type: string;
491
+ minLength: number;
492
+ maxLength: number;
493
+ pattern: string;
494
+ };
495
+ vcardVersion: {
496
+ enum: string[];
497
+ };
498
+ updateSupported: {
499
+ type: string;
500
+ };
501
+ };
502
+ } | {
503
+ type: string;
504
+ required: string[];
505
+ additionalProperties: boolean;
506
+ properties: {
507
+ id: {
508
+ type: string;
509
+ format: string;
510
+ maxLength: number;
511
+ };
512
+ type: {
513
+ const: string;
514
+ };
515
+ name: {
516
+ type: string;
517
+ };
518
+ description: {
519
+ type: string;
520
+ };
521
+ };
522
+ })[];
523
+ };
524
+ };
525
+ actor?: undefined;
526
+ target?: undefined;
527
+ object?: undefined;
528
+ };
529
+ } | {
530
+ type: string;
531
+ required: string[];
532
+ additionalProperties: boolean;
533
+ properties: {
534
+ "@context": {
535
+ type: string;
536
+ items: {
537
+ type: string;
538
+ };
539
+ };
540
+ id: {
541
+ type: string;
542
+ };
543
+ type: {
544
+ enum: string[];
545
+ const?: undefined;
546
+ };
547
+ actor: {
548
+ type: string;
549
+ required: string[];
550
+ additionalProperties: boolean;
551
+ properties: {
552
+ id: {
553
+ type: string;
554
+ minLength: number;
555
+ maxLength: number;
556
+ };
557
+ type: {
558
+ enum: string[];
559
+ };
560
+ };
561
+ };
562
+ target: {
563
+ type: string;
564
+ required: string[];
565
+ additionalProperties: boolean;
566
+ properties: {
567
+ id: {
568
+ type: string;
569
+ format: string;
570
+ maxLength: number;
571
+ };
572
+ type: {
573
+ enum: string[];
574
+ };
575
+ };
576
+ };
577
+ object: {
578
+ type: string;
579
+ required: string[];
580
+ additionalProperties: boolean;
581
+ properties: {
582
+ id: {
583
+ type: string;
584
+ format: string;
585
+ maxLength: number;
586
+ };
587
+ type: {
588
+ const: string;
589
+ };
590
+ uid: {
591
+ type: string;
592
+ minLength: number;
593
+ maxLength: number;
594
+ };
595
+ etag: {
596
+ type: string;
597
+ minLength: number;
598
+ maxLength: number;
599
+ };
600
+ };
601
+ };
602
+ summary?: undefined;
603
+ totalItems?: undefined;
604
+ items?: undefined;
605
+ };
606
+ })[];
607
+ };
608
+ };
@@ -0,0 +1,81 @@
1
+ export interface CardDavCredentials {
2
+ object: {
3
+ type: "credentials";
4
+ url: string;
5
+ username: string;
6
+ password: string;
7
+ } | {
8
+ type: "credentials";
9
+ url: string;
10
+ token: string;
11
+ };
12
+ }
13
+ export interface AddressBookDescription {
14
+ id: string;
15
+ type: "addressBook";
16
+ name: string;
17
+ description?: string;
18
+ }
19
+ export interface ContactValue {
20
+ value: string;
21
+ types?: string[];
22
+ preferred?: boolean;
23
+ }
24
+ export interface ContactAddress {
25
+ types?: string[];
26
+ preferred?: boolean;
27
+ postOfficeBox?: string;
28
+ extendedAddress?: string;
29
+ street?: string;
30
+ locality?: string;
31
+ region?: string;
32
+ postalCode?: string;
33
+ country?: string;
34
+ }
35
+ export interface PreservedVCardProperty {
36
+ /** Unfolded vCard content line retained verbatim for safe round-tripping. */
37
+ raw: string;
38
+ }
39
+ export interface ContactInput {
40
+ id?: string;
41
+ etag?: string;
42
+ type: "person";
43
+ uid?: string;
44
+ name: string;
45
+ givenName?: string;
46
+ additionalNames?: string[];
47
+ familyName?: string;
48
+ honorificPrefixes?: string[];
49
+ honorificSuffixes?: string[];
50
+ nickname?: string;
51
+ emails?: ContactValue[];
52
+ telephones?: ContactValue[];
53
+ addresses?: ContactAddress[];
54
+ organization?: string;
55
+ title?: string;
56
+ role?: string;
57
+ urls?: ContactValue[];
58
+ photoUrls?: string[];
59
+ note?: string;
60
+ birthday?: string;
61
+ }
62
+ export interface Contact extends ContactInput {
63
+ id: string;
64
+ uid: string;
65
+ etag?: string;
66
+ vcardVersion: "3.0" | "4.0";
67
+ updateSupported: boolean;
68
+ /** Internal non-enumerable data reloaded from the authoritative resource. */
69
+ preservedProperties?: PreservedVCardProperty[];
70
+ }
71
+ export interface ContactQuery {
72
+ type?: "contactQuery";
73
+ text?: string;
74
+ fields?: Array<"name" | "email" | "telephone" | "organization">;
75
+ limit?: number;
76
+ }
77
+ export interface DeleteInput {
78
+ id: string;
79
+ type: "person";
80
+ etag: string;
81
+ }
@@ -0,0 +1,6 @@
1
+ import type { Contact, ContactInput, PreservedVCardProperty } from "./types.js";
2
+ export declare function parseVCard(body: string, id: string, etag?: string): Contact;
3
+ export declare function buildVCard(input: ContactInput, preserved?: PreservedVCardProperty[]): {
4
+ uid: string;
5
+ body: string;
6
+ };