MCPcopy Create free account
hub / github.com/bewcloud/bewcloud / getClient

Function getClient

lib/models/contacts.ts:27–48  ·  view source on GitHub ↗
(userId: string)

Source from the content-addressed store, hash-verified

25const contactsConfig = await AppConfig.getContactsConfig();
26
27async 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
50export class ContactModel {
51 static async list(

Callers 6

listMethod · 0.70
createMethod · 0.70
updateMethod · 0.70
deleteMethod · 0.70
listAddressBooksMethod · 0.70
deleteAddressBookMethod · 0.70

Calls 1

createDAVClientFunction · 0.90

Tested by

no test coverage detected