(userId: string)
| 25 | const contactsConfig = await AppConfig.getContactsConfig(); |
| 26 | |
| 27 | async function getClient(userId: string) { |
| 28 | const client = await createDAVClient({ |
| 29 | serverUrl: contactsConfig.cardDavUrl, |
| 30 | credentials: {}, |
| 31 | authMethod: 'Custom', |
| 32 | // deno-lint-ignore require-await |
| 33 | authFunction: async () => { |
| 34 | return { |
| 35 | 'X-Remote-User': userId, |
| 36 | }; |
| 37 | }, |
| 38 | fetchOptions: { |
| 39 | timeout: 15_000, |
| 40 | }, |
| 41 | defaultAccountType: 'carddav', |
| 42 | rootUrl: `${contactsConfig.cardDavUrl}/`, |
| 43 | principalUrl: `${contactsConfig.cardDavUrl}/${userId}/`, |
| 44 | homeUrl: `${contactsConfig.cardDavUrl}/${userId}/`, |
| 45 | }); |
| 46 | |
| 47 | return client; |
| 48 | } |
| 49 | |
| 50 | export class ContactModel { |
| 51 | static async list( |
no test coverage detected