@urbit/api: update contact pokes

This commit is contained in:
Liam Fitzgerald 2021-06-09 12:33:41 +10:00
parent 2f70a433bd
commit d8b8fb3a5f
No known key found for this signature in database
GPG Key ID: D390E12C61D1CFFB

View File

@ -1,5 +1,5 @@
import { Path, Patp, Poke, resourceAsPath } from "../lib";
import { Path, Patp, Poke, resourceAsPath, Scry } from "../lib";
import {
Contact,
ContactUpdateAdd,
@ -38,7 +38,7 @@ export const removeContact = (ship: Patp): Poke<ContactUpdateRemove> =>
export const share = (recipient: Patp, version: number = CONTACT_UPDATE_VERSION): Poke<ContactShare> => ({
app: "contact-push-hook",
mark: `contact-update-${version}`,
mark: "contact-share",
json: { share: recipient },
});
@ -94,3 +94,16 @@ export const retrieve = (
}
};
}
export const fetchIsAllowed = (
entity: string,
name: string,
ship: string,
personal: boolean
): Scry => {
const isPersonal = personal ? 'true' : 'false';
return {
app: 'contact-store',
path: `/is-allowed/${entity}/${name}/${ship}/${isPersonal}`
}
};