@singi-labs/sifa-sdk 0.19.58 → 0.19.60
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/dist/{index-CT-A3BEe.d.ts → index-IeuOpcIB.d.ts} +24 -1
- package/dist/{index-BeQbepFn.d.cts → index-syVBnrbI.d.cts} +24 -1
- package/dist/index.cjs +4 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +26 -7
- package/dist/index.d.ts +26 -7
- package/dist/index.js +7 -1
- package/dist/index.js.map +1 -1
- package/dist/jsonld/index.d.cts +1 -1
- package/dist/jsonld/index.d.ts +1 -1
- package/dist/logic/company-page-indexable.js.map +1 -1
- package/dist/logic/index.js.map +1 -1
- package/dist/{network-map-DHOOMSCP.d.cts → network-map-Bw_rIDtH.d.cts} +3 -3
- package/dist/{network-map-CKF7Yozc.d.ts → network-map-DUam4K3f.d.ts} +3 -3
- package/dist/{org-CelDIOiN.d.ts → org--5MN6Ev4.d.ts} +15 -3
- package/dist/{org-Bq3HbpLD.d.cts → org-B_0EMNuF.d.cts} +15 -3
- package/dist/{profile-summary-CD3-QflX.d.cts → profile-summary-CU4sWBzF.d.cts} +1 -1
- package/dist/{profile-summary-CyRzFe7f.d.ts → profile-summary-RT-roUtM.d.ts} +1 -1
- package/dist/query/fetchers/confirmations.js +16 -0
- package/dist/query/fetchers/confirmations.js.map +1 -1
- package/dist/query/fetchers/index.cjs +16 -0
- package/dist/query/fetchers/index.cjs.map +1 -1
- package/dist/query/fetchers/index.d.cts +6 -6
- package/dist/query/fetchers/index.d.ts +6 -6
- package/dist/query/fetchers/index.js +2 -0
- package/dist/query/fetchers/index.js.map +1 -1
- package/dist/query/hooks/index.cjs.map +1 -1
- package/dist/query/hooks/index.d.cts +4 -4
- package/dist/query/hooks/index.d.ts +4 -4
- package/dist/query/index.cjs +16 -0
- package/dist/query/index.cjs.map +1 -1
- package/dist/query/index.d.cts +9 -9
- package/dist/query/index.d.ts +9 -9
- package/dist/query/index.js +2 -0
- package/dist/query/index.js.map +1 -1
- package/dist/resume/index.d.cts +1 -1
- package/dist/resume/index.d.ts +1 -1
- package/dist/schemas/confirmation.js +8 -1
- package/dist/schemas/confirmation.js.map +1 -1
- package/dist/schemas/index.cjs +8 -1
- package/dist/schemas/index.cjs.map +1 -1
- package/dist/schemas/index.d.cts +1 -1
- package/dist/schemas/index.d.ts +1 -1
- package/dist/types/index.js.map +1 -1
- package/dist/{types-BHnGSJ3z.d.cts → types-BV-qBo9i.d.cts} +1 -1
- package/dist/{types-BKEBVobU.d.ts → types-Jb4KKbn9.d.ts} +1 -1
- package/dist/{use-org-notification-emails-BTR2Yxq8.d.cts → use-org-notification-emails-B8e4vgs-.d.cts} +3 -3
- package/dist/{use-org-notification-emails-DDIi6giD.d.ts → use-org-notification-emails-CbQ3Kz96.d.ts} +3 -3
- package/package.json +1 -1
|
@@ -36,6 +36,21 @@ async function fetchGivenConfirmations(config, options = {}) {
|
|
|
36
36
|
return { confirmations: [] };
|
|
37
37
|
}
|
|
38
38
|
}
|
|
39
|
+
async function fetchViewerPositionConfirmations(config, ownerDid, options = {}) {
|
|
40
|
+
const { cookieHeader, ...rest } = options;
|
|
41
|
+
const headers = { ...rest.headers ?? {} };
|
|
42
|
+
if (cookieHeader) headers.cookie = cookieHeader;
|
|
43
|
+
try {
|
|
44
|
+
const data = await apiFetch(
|
|
45
|
+
config,
|
|
46
|
+
`/api/confirmations/positions/${encodeURIComponent(ownerDid)}`,
|
|
47
|
+
{ cache: "no-store", credentials: "include", timeoutMs: 5e3, ...rest, headers }
|
|
48
|
+
);
|
|
49
|
+
return data?.positions ?? {};
|
|
50
|
+
} catch {
|
|
51
|
+
return {};
|
|
52
|
+
}
|
|
53
|
+
}
|
|
39
54
|
function createConfirmation(config, data, options = {}) {
|
|
40
55
|
return apiWriteCreate(config, "/api/confirmation", data, options);
|
|
41
56
|
}
|
|
@@ -50,6 +65,7 @@ export {
|
|
|
50
65
|
dismissConfirmation,
|
|
51
66
|
fetchGivenConfirmations,
|
|
52
67
|
fetchPendingConfirmations,
|
|
68
|
+
fetchViewerPositionConfirmations,
|
|
53
69
|
revokeConfirmation
|
|
54
70
|
};
|
|
55
71
|
//# sourceMappingURL=confirmations.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/query/fetchers/confirmations.ts"],"sourcesContent":["import {\n apiFetch,\n apiWrite,\n apiWriteCreate,\n type ApiFetchOptions,\n type CreateResult,\n type SifaApiConfig,\n type WriteResult,\n} from '../client.js';\n\n/** A claim naming the signed-in user that they have neither confirmed nor dismissed. */\nexport interface PendingConfirmation {\n /** DID of the person who wrote the claim. */\n claimerDid: string;\n /**\n * Claimer's handle, when the AppView has resolved one. Absent when they have\n * no Sifa profile: a claim can be written by any AT Protocol app, so the UI\n * needs a fallback for having no name to show.\n */\n claimerHandle?: string;\n claimerDisplayName?: string;\n claimerAvatar?: string;\n /** AT-URI of the record that names you. The confirm mutation needs a strongRef. */\n subjectUri: string;\n /**\n * CID of that record, when the AppView has it. Often absent, since a record\n * indexed from another app can arrive without one. Pass it through when\n * present; the AppView resolves it from the claimer's PDS when it is not.\n * Never substitute a different record's CID.\n */\n subjectCid?: string;\n relation: string;\n /** Name or title the subject record carries right now, for display and snapshotting. */\n subjectName: string;\n /** Role the claimer assigned you, for `projectMember`. Display only. */\n role?: string;\n title?: string;\n createdAt: string;\n}\n\nexport interface PendingConfirmationsPage {\n confirmations: PendingConfirmation[];\n cursor?: string;\n}\n\n/**\n * A confirmation the signed-in user has already given.\n *\n * This is an AppView READ shape, not a PDS record, so it is a hand-written\n * interface like {@link PendingConfirmation} and {@link PendingConfirmation}'s\n * siblings -- the Zod schemas in `../schemas` validate lexicon record writes,\n * not these read DTOs. Fields are additive and passed through verbatim.\n */\nexport interface GivenConfirmation {\n subjectUri: string;\n claimerDid: string;\n claimerHandle?: string;\n /** Claimer's display name (Sifa override wins), for naming them without a handle. */\n claimerDisplayName?: string;\n relation: string;\n /** The name as it stood when confirmed, so a rename shows as a difference. */\n subjectName: string;\n /** The name the record carries now. Absent when the claim no longer exists. */\n currentName?: string;\n /** The record changed materially after it was confirmed. */\n confirmedStale: boolean;\n /** They removed you from the record, or deleted it. Nothing left to withdraw. */\n claimWithdrawn: boolean;\n createdAt: string;\n}\n\n/** Body accepted by {@link createConfirmation}. */\nexport interface ConfirmationInput {\n subjectUri: string;\n subjectCid?: string;\n relation: string;\n /**\n * Snapshot of the subject's name at confirmation time. Stored in your own\n * repo, out of the claimer's reach, so a later rename is detectable.\n */\n subjectName?: string;\n}\n\n/** Body accepted by {@link dismissConfirmation} and {@link revokeConfirmation}. */\nexport interface ConfirmationSubjectInput {\n subjectUri: string;\n}\n\n/** Options for the read fetchers, adding the RSC cookie-forwarding escape hatch. */\nexport interface FetchConfirmationsOptions extends ApiFetchOptions {\n /**\n * Pass the caller's `Cookie` header on Next.js RSC server-side calls.\n * `credentials: 'include'` does NOT propagate browser cookies in RSC,\n * so authenticated server fetches must forward the header explicitly.\n */\n cookieHeader?: string;\n}\n\n/**\n * Claims awaiting the signed-in user's decision. Requires credentials -- the\n * AppView reads the subject DID from the session, not from a parameter, so\n * there is no way to read someone else's inbox.\n *\n * Returns an empty page on failure so a broken inbox degrades to \"nothing\n * pending\" rather than breaking the surface hosting it.\n */\nexport async function fetchPendingConfirmations(\n config: SifaApiConfig,\n options: FetchConfirmationsOptions = {},\n): Promise<PendingConfirmationsPage> {\n const { cookieHeader, ...rest } = options;\n const headers: Record<string, string> = { ...(rest.headers ?? {}) };\n if (cookieHeader) headers.cookie = cookieHeader;\n try {\n const data = await apiFetch<PendingConfirmationsPage>(config, '/api/confirmations/pending', {\n cache: 'no-store',\n credentials: 'include',\n timeoutMs: 5000,\n ...rest,\n headers,\n });\n return { confirmations: data?.confirmations ?? [], cursor: data?.cursor };\n } catch {\n return { confirmations: [] };\n }\n}\n\n/**\n * Confirmations the signed-in user has already given.\n *\n * The surface for changing your mind. Without it a confirmation is one-way in\n * practice: the inbox lists only claims you have not answered, so once answered\n * there is nowhere to see it, let alone withdraw it.\n *\n * Returns an empty list on failure, matching the pending inbox: a broken list\n * should not break the page hosting it.\n */\nexport async function fetchGivenConfirmations(\n config: SifaApiConfig,\n options: FetchConfirmationsOptions = {},\n): Promise<{ confirmations: GivenConfirmation[] }> {\n const { cookieHeader, ...rest } = options;\n const headers: Record<string, string> = { ...(rest.headers ?? {}) };\n if (cookieHeader) headers.cookie = cookieHeader;\n try {\n const data = await apiFetch<{ confirmations: GivenConfirmation[] }>(\n config,\n '/api/confirmations/mine',\n { cache: 'no-store', credentials: 'include', timeoutMs: 5000, ...rest, headers },\n );\n return { confirmations: data?.confirmations ?? [] };\n } catch {\n return { confirmations: [] };\n }\n}\n\n/**\n * Affirm that a record naming you is accurate, writing an `id.sifa.confirmation`\n * to your own PDS. Until this exists the claim renders as a bare handle with no\n * display name, avatar, or link back to you.\n *\n * Confirming does not put the claimer's record on your profile. That record\n * lives in their repository and they can rename it at will; keeping your own\n * entry is a separate, deliberate step.\n */\nexport function createConfirmation(\n config: SifaApiConfig,\n data: ConfirmationInput,\n options: ApiFetchOptions = {},\n): Promise<CreateResult> {\n return apiWriteCreate(config, '/api/confirmation', data, options);\n}\n\n/**\n * Take a claim out of the inbox without confirming it.\n *\n * This writes nothing to any PDS. A claim only gains your identity once you\n * have confirmed it, so declining is already the default state -- the dismissal\n * is a local flag that stops it reappearing, not a published rejection the\n * claimer can read.\n */\nexport function dismissConfirmation(\n config: SifaApiConfig,\n data: ConfirmationSubjectInput,\n options: ApiFetchOptions = {},\n): Promise<WriteResult> {\n return apiWrite(config, '/api/confirmation/dismiss', 'POST', { body: data, ...options });\n}\n\n/**\n * Withdraw a confirmation you previously gave, deleting the record from your\n * PDS. The claim reverts to rendering as a bare handle.\n *\n * The usual reason is drift: the claimer renamed the project or changed the\n * role after you confirmed, so what you affirmed is no longer what is shown.\n * Also writes a dismissal, or the still-live claim returns to your inbox.\n */\nexport function revokeConfirmation(\n config: SifaApiConfig,\n data: ConfirmationSubjectInput,\n options: ApiFetchOptions = {},\n): Promise<WriteResult> {\n return apiWrite(config, '/api/confirmation/revoke', 'POST', { body: data, ...options });\n}\n"],"mappings":";AAAA;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,OAKK;AAkGP,eAAsB,0BACpB,QACA,UAAqC,CAAC,GACH;AACnC,QAAM,EAAE,cAAc,GAAG,KAAK,IAAI;AAClC,QAAM,UAAkC,EAAE,GAAI,KAAK,WAAW,CAAC,EAAG;AAClE,MAAI,aAAc,SAAQ,SAAS;AACnC,MAAI;AACF,UAAM,OAAO,MAAM,SAAmC,QAAQ,8BAA8B;AAAA,MAC1F,OAAO;AAAA,MACP,aAAa;AAAA,MACb,WAAW;AAAA,MACX,GAAG;AAAA,MACH;AAAA,IACF,CAAC;AACD,WAAO,EAAE,eAAe,MAAM,iBAAiB,CAAC,GAAG,QAAQ,MAAM,OAAO;AAAA,EAC1E,QAAQ;AACN,WAAO,EAAE,eAAe,CAAC,EAAE;AAAA,EAC7B;AACF;AAYA,eAAsB,wBACpB,QACA,UAAqC,CAAC,GACW;AACjD,QAAM,EAAE,cAAc,GAAG,KAAK,IAAI;AAClC,QAAM,UAAkC,EAAE,GAAI,KAAK,WAAW,CAAC,EAAG;AAClE,MAAI,aAAc,SAAQ,SAAS;AACnC,MAAI;AACF,UAAM,OAAO,MAAM;AAAA,MACjB;AAAA,MACA;AAAA,MACA,EAAE,OAAO,YAAY,aAAa,WAAW,WAAW,KAAM,GAAG,MAAM,QAAQ;AAAA,IACjF;AACA,WAAO,EAAE,eAAe,MAAM,iBAAiB,CAAC,EAAE;AAAA,EACpD,QAAQ;AACN,WAAO,EAAE,eAAe,CAAC,EAAE;AAAA,EAC7B;AACF;AAWO,SAAS,mBACd,QACA,MACA,UAA2B,CAAC,GACL;AACvB,SAAO,eAAe,QAAQ,qBAAqB,MAAM,OAAO;AAClE;AAUO,SAAS,oBACd,QACA,MACA,UAA2B,CAAC,GACN;AACtB,SAAO,SAAS,QAAQ,6BAA6B,QAAQ,EAAE,MAAM,MAAM,GAAG,QAAQ,CAAC;AACzF;AAUO,SAAS,mBACd,QACA,MACA,UAA2B,CAAC,GACN;AACtB,SAAO,SAAS,QAAQ,4BAA4B,QAAQ,EAAE,MAAM,MAAM,GAAG,QAAQ,CAAC;AACxF;","names":[]}
|
|
1
|
+
{"version":3,"sources":["../../../src/query/fetchers/confirmations.ts"],"sourcesContent":["import {\n apiFetch,\n apiWrite,\n apiWriteCreate,\n type ApiFetchOptions,\n type CreateResult,\n type SifaApiConfig,\n type WriteResult,\n} from '../client.js';\nimport type { PositionViewerConfirmation } from '../../types/index.js';\n\n/** A claim naming the signed-in user that they have neither confirmed nor dismissed. */\nexport interface PendingConfirmation {\n /** DID of the person who wrote the claim. */\n claimerDid: string;\n /**\n * Claimer's handle, when the AppView has resolved one. Absent when they have\n * no Sifa profile: a claim can be written by any AT Protocol app, so the UI\n * needs a fallback for having no name to show.\n */\n claimerHandle?: string;\n claimerDisplayName?: string;\n claimerAvatar?: string;\n /** AT-URI of the record that names you. The confirm mutation needs a strongRef. */\n subjectUri: string;\n /**\n * CID of that record, when the AppView has it. Often absent, since a record\n * indexed from another app can arrive without one. Pass it through when\n * present; the AppView resolves it from the claimer's PDS when it is not.\n * Never substitute a different record's CID.\n */\n subjectCid?: string;\n relation: string;\n /** Name or title the subject record carries right now, for display and snapshotting. */\n subjectName: string;\n /** Role the claimer assigned you, for `projectMember`. Display only. */\n role?: string;\n title?: string;\n createdAt: string;\n}\n\nexport interface PendingConfirmationsPage {\n confirmations: PendingConfirmation[];\n cursor?: string;\n}\n\n/**\n * A confirmation the signed-in user has already given.\n *\n * This is an AppView READ shape, not a PDS record, so it is a hand-written\n * interface like {@link PendingConfirmation} and {@link PendingConfirmation}'s\n * siblings -- the Zod schemas in `../schemas` validate lexicon record writes,\n * not these read DTOs. Fields are additive and passed through verbatim.\n */\nexport interface GivenConfirmation {\n subjectUri: string;\n claimerDid: string;\n claimerHandle?: string;\n /** Claimer's display name (Sifa override wins), for naming them without a handle. */\n claimerDisplayName?: string;\n relation: string;\n /** The name as it stood when confirmed, so a rename shows as a difference. */\n subjectName: string;\n /** The name the record carries now. Absent when the claim no longer exists. */\n currentName?: string;\n /** The record changed materially after it was confirmed. */\n confirmedStale: boolean;\n /** They removed you from the record, or deleted it. Nothing left to withdraw. */\n claimWithdrawn: boolean;\n createdAt: string;\n}\n\n/** Body accepted by {@link createConfirmation}. */\nexport interface ConfirmationInput {\n subjectUri: string;\n subjectCid?: string;\n relation: string;\n /**\n * Snapshot of the subject's name at confirmation time. Stored in your own\n * repo, out of the claimer's reach, so a later rename is detectable.\n */\n subjectName?: string;\n}\n\n/** Body accepted by {@link dismissConfirmation} and {@link revokeConfirmation}. */\nexport interface ConfirmationSubjectInput {\n subjectUri: string;\n}\n\n/** Options for the read fetchers, adding the RSC cookie-forwarding escape hatch. */\nexport interface FetchConfirmationsOptions extends ApiFetchOptions {\n /**\n * Pass the caller's `Cookie` header on Next.js RSC server-side calls.\n * `credentials: 'include'` does NOT propagate browser cookies in RSC,\n * so authenticated server fetches must forward the header explicitly.\n */\n cookieHeader?: string;\n}\n\n/**\n * Claims awaiting the signed-in user's decision. Requires credentials -- the\n * AppView reads the subject DID from the session, not from a parameter, so\n * there is no way to read someone else's inbox.\n *\n * Returns an empty page on failure so a broken inbox degrades to \"nothing\n * pending\" rather than breaking the surface hosting it.\n */\nexport async function fetchPendingConfirmations(\n config: SifaApiConfig,\n options: FetchConfirmationsOptions = {},\n): Promise<PendingConfirmationsPage> {\n const { cookieHeader, ...rest } = options;\n const headers: Record<string, string> = { ...(rest.headers ?? {}) };\n if (cookieHeader) headers.cookie = cookieHeader;\n try {\n const data = await apiFetch<PendingConfirmationsPage>(config, '/api/confirmations/pending', {\n cache: 'no-store',\n credentials: 'include',\n timeoutMs: 5000,\n ...rest,\n headers,\n });\n return { confirmations: data?.confirmations ?? [], cursor: data?.cursor };\n } catch {\n return { confirmations: [] };\n }\n}\n\n/**\n * Confirmations the signed-in user has already given.\n *\n * The surface for changing your mind. Without it a confirmation is one-way in\n * practice: the inbox lists only claims you have not answered, so once answered\n * there is nowhere to see it, let alone withdraw it.\n *\n * Returns an empty list on failure, matching the pending inbox: a broken list\n * should not break the page hosting it.\n */\nexport async function fetchGivenConfirmations(\n config: SifaApiConfig,\n options: FetchConfirmationsOptions = {},\n): Promise<{ confirmations: GivenConfirmation[] }> {\n const { cookieHeader, ...rest } = options;\n const headers: Record<string, string> = { ...(rest.headers ?? {}) };\n if (cookieHeader) headers.cookie = cookieHeader;\n try {\n const data = await apiFetch<{ confirmations: GivenConfirmation[] }>(\n config,\n '/api/confirmations/mine',\n { cache: 'no-store', credentials: 'include', timeoutMs: 5000, ...rest, headers },\n );\n return { confirmations: data?.confirmations ?? [] };\n } catch {\n return { confirmations: [] };\n }\n}\n\n/**\n * What the signed-in viewer can do with each of someone's positions, keyed by\n * position rkey: `available` (they have a reason to know it and can confirm)\n * or `confirmed` (they already did and can withdraw). Positions with neither\n * are absent.\n *\n * The viewer-scoped half of `ProfilePosition.viewerConfirmation`, for a caller\n * that fetches the profile itself viewer-neutral (for example to share a\n * cache). Returns an empty map on failure, so the confirm action degrades to\n * not being offered.\n */\nexport async function fetchViewerPositionConfirmations(\n config: SifaApiConfig,\n ownerDid: string,\n options: FetchConfirmationsOptions = {},\n): Promise<Record<string, PositionViewerConfirmation>> {\n const { cookieHeader, ...rest } = options;\n const headers: Record<string, string> = { ...(rest.headers ?? {}) };\n if (cookieHeader) headers.cookie = cookieHeader;\n try {\n const data = await apiFetch<{ positions?: Record<string, PositionViewerConfirmation> }>(\n config,\n `/api/confirmations/positions/${encodeURIComponent(ownerDid)}`,\n { cache: 'no-store', credentials: 'include', timeoutMs: 5000, ...rest, headers },\n );\n return data?.positions ?? {};\n } catch {\n return {};\n }\n}\n\n/**\n * Affirm that a record naming you is accurate, writing an `id.sifa.confirmation`\n * to your own PDS. Until this exists the claim renders as a bare handle with no\n * display name, avatar, or link back to you.\n *\n * Confirming does not put the claimer's record on your profile. That record\n * lives in their repository and they can rename it at will; keeping your own\n * entry is a separate, deliberate step.\n */\nexport function createConfirmation(\n config: SifaApiConfig,\n data: ConfirmationInput,\n options: ApiFetchOptions = {},\n): Promise<CreateResult> {\n return apiWriteCreate(config, '/api/confirmation', data, options);\n}\n\n/**\n * Take a claim out of the inbox without confirming it.\n *\n * This writes nothing to any PDS. A claim only gains your identity once you\n * have confirmed it, so declining is already the default state -- the dismissal\n * is a local flag that stops it reappearing, not a published rejection the\n * claimer can read.\n */\nexport function dismissConfirmation(\n config: SifaApiConfig,\n data: ConfirmationSubjectInput,\n options: ApiFetchOptions = {},\n): Promise<WriteResult> {\n return apiWrite(config, '/api/confirmation/dismiss', 'POST', { body: data, ...options });\n}\n\n/**\n * Withdraw a confirmation you previously gave, deleting the record from your\n * PDS. The claim reverts to rendering as a bare handle.\n *\n * The usual reason is drift: the claimer renamed the project or changed the\n * role after you confirmed, so what you affirmed is no longer what is shown.\n * Also writes a dismissal, or the still-live claim returns to your inbox.\n */\nexport function revokeConfirmation(\n config: SifaApiConfig,\n data: ConfirmationSubjectInput,\n options: ApiFetchOptions = {},\n): Promise<WriteResult> {\n return apiWrite(config, '/api/confirmation/revoke', 'POST', { body: data, ...options });\n}\n"],"mappings":";AAAA;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,OAKK;AAmGP,eAAsB,0BACpB,QACA,UAAqC,CAAC,GACH;AACnC,QAAM,EAAE,cAAc,GAAG,KAAK,IAAI;AAClC,QAAM,UAAkC,EAAE,GAAI,KAAK,WAAW,CAAC,EAAG;AAClE,MAAI,aAAc,SAAQ,SAAS;AACnC,MAAI;AACF,UAAM,OAAO,MAAM,SAAmC,QAAQ,8BAA8B;AAAA,MAC1F,OAAO;AAAA,MACP,aAAa;AAAA,MACb,WAAW;AAAA,MACX,GAAG;AAAA,MACH;AAAA,IACF,CAAC;AACD,WAAO,EAAE,eAAe,MAAM,iBAAiB,CAAC,GAAG,QAAQ,MAAM,OAAO;AAAA,EAC1E,QAAQ;AACN,WAAO,EAAE,eAAe,CAAC,EAAE;AAAA,EAC7B;AACF;AAYA,eAAsB,wBACpB,QACA,UAAqC,CAAC,GACW;AACjD,QAAM,EAAE,cAAc,GAAG,KAAK,IAAI;AAClC,QAAM,UAAkC,EAAE,GAAI,KAAK,WAAW,CAAC,EAAG;AAClE,MAAI,aAAc,SAAQ,SAAS;AACnC,MAAI;AACF,UAAM,OAAO,MAAM;AAAA,MACjB;AAAA,MACA;AAAA,MACA,EAAE,OAAO,YAAY,aAAa,WAAW,WAAW,KAAM,GAAG,MAAM,QAAQ;AAAA,IACjF;AACA,WAAO,EAAE,eAAe,MAAM,iBAAiB,CAAC,EAAE;AAAA,EACpD,QAAQ;AACN,WAAO,EAAE,eAAe,CAAC,EAAE;AAAA,EAC7B;AACF;AAaA,eAAsB,iCACpB,QACA,UACA,UAAqC,CAAC,GACe;AACrD,QAAM,EAAE,cAAc,GAAG,KAAK,IAAI;AAClC,QAAM,UAAkC,EAAE,GAAI,KAAK,WAAW,CAAC,EAAG;AAClE,MAAI,aAAc,SAAQ,SAAS;AACnC,MAAI;AACF,UAAM,OAAO,MAAM;AAAA,MACjB;AAAA,MACA,gCAAgC,mBAAmB,QAAQ,CAAC;AAAA,MAC5D,EAAE,OAAO,YAAY,aAAa,WAAW,WAAW,KAAM,GAAG,MAAM,QAAQ;AAAA,IACjF;AACA,WAAO,MAAM,aAAa,CAAC;AAAA,EAC7B,QAAQ;AACN,WAAO,CAAC;AAAA,EACV;AACF;AAWO,SAAS,mBACd,QACA,MACA,UAA2B,CAAC,GACL;AACvB,SAAO,eAAe,QAAQ,qBAAqB,MAAM,OAAO;AAClE;AAUO,SAAS,oBACd,QACA,MACA,UAA2B,CAAC,GACN;AACtB,SAAO,SAAS,QAAQ,6BAA6B,QAAQ,EAAE,MAAM,MAAM,GAAG,QAAQ,CAAC;AACzF;AAUO,SAAS,mBACd,QACA,MACA,UAA2B,CAAC,GACN;AACtB,SAAO,SAAS,QAAQ,4BAA4B,QAAQ,EAAE,MAAM,MAAM,GAAG,QAAQ,CAAC;AACxF;","names":[]}
|
|
@@ -550,6 +550,21 @@ async function fetchGivenConfirmations(config, options = {}) {
|
|
|
550
550
|
return { confirmations: [] };
|
|
551
551
|
}
|
|
552
552
|
}
|
|
553
|
+
async function fetchViewerPositionConfirmations(config, ownerDid, options = {}) {
|
|
554
|
+
const { cookieHeader, ...rest } = options;
|
|
555
|
+
const headers = { ...rest.headers ?? {} };
|
|
556
|
+
if (cookieHeader) headers.cookie = cookieHeader;
|
|
557
|
+
try {
|
|
558
|
+
const data = await apiFetch(
|
|
559
|
+
config,
|
|
560
|
+
`/api/confirmations/positions/${encodeURIComponent(ownerDid)}`,
|
|
561
|
+
{ cache: "no-store", credentials: "include", timeoutMs: 5e3, ...rest, headers }
|
|
562
|
+
);
|
|
563
|
+
return data?.positions ?? {};
|
|
564
|
+
} catch {
|
|
565
|
+
return {};
|
|
566
|
+
}
|
|
567
|
+
}
|
|
553
568
|
function createConfirmation(config, data, options = {}) {
|
|
554
569
|
return apiWriteCreate(config, "/api/confirmation", data, options);
|
|
555
570
|
}
|
|
@@ -2194,6 +2209,7 @@ exports.fetchSuggestionCount = fetchSuggestionCount;
|
|
|
2194
2209
|
exports.fetchSuggestions = fetchSuggestions;
|
|
2195
2210
|
exports.fetchTalks = fetchTalks;
|
|
2196
2211
|
exports.fetchUnlinkedPositions = fetchUnlinkedPositions;
|
|
2212
|
+
exports.fetchViewerPositionConfirmations = fetchViewerPositionConfirmations;
|
|
2197
2213
|
exports.fetchWipePreview = fetchWipePreview;
|
|
2198
2214
|
exports.followUser = followUser;
|
|
2199
2215
|
exports.getAdminReviewQueues = getAdminReviewQueues;
|