@arbidocs/sdk 0.4.142 → 0.4.144

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.
@@ -1724,6 +1724,56 @@ declare namespace signatureRequests {
1724
1724
  export { type signatureRequests_CreateSignatureRequestOptions as CreateSignatureRequestOptions, type signatureRequests_SignatureField as SignatureField, type signatureRequests_SignatureRequest as SignatureRequest, type signatureRequests_SuggestedSignatureField as SuggestedSignatureField, signatureRequests_assignSuggestions as assignSuggestions, signatureRequests_createSignatureRequest as createSignatureRequest, signatureRequests_declineSignatureRequest as declineSignatureRequest, signatureRequests_getSignatureRequest as getSignatureRequest, signatureRequests_listDocumentSignatureRequests as listDocumentSignatureRequests, signatureRequests_listSignatureRequests as listSignatureRequests, signatureRequests_sendSignatureRequest as sendSignatureRequest, signatureRequests_suggestSignatureFields as suggestSignatureFields, signatureRequests_voidSignatureRequest as voidSignatureRequest };
1725
1725
  }
1726
1726
 
1727
+ /**
1728
+ * House templates — browser-safe functions.
1729
+ *
1730
+ * - A workspace's house template is one of its own documents: the workspace records its id as
1731
+ * `house_template_ext_id` (`PATCH /v1/workspace/`, owners only, as every workspace update).
1732
+ * - The deployment default is a .dotx/.docx the server holds: `GET /v1/deployment/house-template`
1733
+ * (any signed-in user; 404 when none is set), `PUT` (multipart `file`) and `DELETE` (deployment
1734
+ * admins only; `is_deployment_admin` on the current user).
1735
+ *
1736
+ * A server without house templates has no `house_template_ext_id` key on its workspaces
1737
+ * ({@link supportsHouseTemplates} is false): nothing here should be called then.
1738
+ */
1739
+
1740
+ type HouseTemplateCandidate = components['schemas']['HouseTemplateCandidate'];
1741
+ /** The deployment's default house template. */
1742
+ interface DeploymentHouseTemplate {
1743
+ bytes: Uint8Array;
1744
+ name: string;
1745
+ }
1746
+ /** Whether the server stores house templates (its workspaces carry the field). */
1747
+ declare function supportsHouseTemplates(workspace: object | null | undefined): boolean;
1748
+ /** The workspace's house template document, or null. */
1749
+ declare function workspaceHouseTemplateId(workspace: object | null | undefined): string | null;
1750
+ /** Whether the signed-in user may set the deployment default (absent on older servers). */
1751
+ declare function isDeploymentAdmin(user: object | null | undefined): boolean;
1752
+ /** The deployment default, or null when none is set. */
1753
+ declare function getDeploymentHouseTemplate(arbi: ArbiClient): Promise<DeploymentHouseTemplate | null>;
1754
+ /** Set the deployment default (`null` clears it). Deployment admins only. */
1755
+ declare function setDeploymentHouseTemplate(arbi: ArbiClient, file: Blob | null): Promise<void>;
1756
+ /** Point the open workspace at one of its documents as its house template (null clears it). */
1757
+ declare function setWorkspaceHouseTemplate(arbi: ArbiClient, documentId: string | null): Promise<void>;
1758
+ /**
1759
+ * The documents the open workspace may use as its house template: live, shared Word documents of
1760
+ * the workspace and of the deployment's public workspaces.
1761
+ */
1762
+ declare function listHouseTemplateCandidates(arbi: ArbiClient): Promise<HouseTemplateCandidate[]>;
1763
+
1764
+ type houseTemplate_DeploymentHouseTemplate = DeploymentHouseTemplate;
1765
+ type houseTemplate_HouseTemplateCandidate = HouseTemplateCandidate;
1766
+ declare const houseTemplate_getDeploymentHouseTemplate: typeof getDeploymentHouseTemplate;
1767
+ declare const houseTemplate_isDeploymentAdmin: typeof isDeploymentAdmin;
1768
+ declare const houseTemplate_listHouseTemplateCandidates: typeof listHouseTemplateCandidates;
1769
+ declare const houseTemplate_setDeploymentHouseTemplate: typeof setDeploymentHouseTemplate;
1770
+ declare const houseTemplate_setWorkspaceHouseTemplate: typeof setWorkspaceHouseTemplate;
1771
+ declare const houseTemplate_supportsHouseTemplates: typeof supportsHouseTemplates;
1772
+ declare const houseTemplate_workspaceHouseTemplateId: typeof workspaceHouseTemplateId;
1773
+ declare namespace houseTemplate {
1774
+ export { type houseTemplate_DeploymentHouseTemplate as DeploymentHouseTemplate, type houseTemplate_HouseTemplateCandidate as HouseTemplateCandidate, houseTemplate_getDeploymentHouseTemplate as getDeploymentHouseTemplate, houseTemplate_isDeploymentAdmin as isDeploymentAdmin, houseTemplate_listHouseTemplateCandidates as listHouseTemplateCandidates, houseTemplate_setDeploymentHouseTemplate as setDeploymentHouseTemplate, houseTemplate_setWorkspaceHouseTemplate as setWorkspaceHouseTemplate, houseTemplate_supportsHouseTemplates as supportsHouseTemplates, houseTemplate_workspaceHouseTemplateId as workspaceHouseTemplateId };
1775
+ }
1776
+
1727
1777
  /**
1728
1778
  * Workspace operations — list, create, delete, update, users, copy.
1729
1779
  */
@@ -11334,6 +11384,25 @@ declare class Arbi {
11334
11384
  stale: boolean;
11335
11385
  }>;
11336
11386
  };
11387
+ /**
11388
+ * The Word house template: a workspace's own (one of its documents), else the deployment's
11389
+ * default. Only on servers that store them (`supportsHouseTemplates(workspace)`).
11390
+ */
11391
+ readonly houseTemplates: {
11392
+ /** The deployment default, or null when none is set. */
11393
+ deployment: () => Promise<DeploymentHouseTemplate | null>;
11394
+ /** Set the deployment default (`null` clears it). Deployment admins only. */
11395
+ setDeployment: (file: Blob | null) => Promise<void>;
11396
+ /** Make a document of the open workspace its house template (`null` clears it). Owners only. */
11397
+ setWorkspace: (documentId: string | null) => Promise<void>;
11398
+ /** The documents the open workspace may use as its house template. */
11399
+ candidates: () => Promise<{
11400
+ doc_ext_id: string;
11401
+ workspace_ext_id: string;
11402
+ workspace_name: string;
11403
+ file_name: string;
11404
+ }[]>;
11405
+ };
11337
11406
  readonly facts: {
11338
11407
  create: (body: CreateFactRequest) => Promise<{
11339
11408
  text: string;
@@ -12333,4 +12402,4 @@ declare namespace identity {
12333
12402
  export { type identity_IdentityErrorCode as IdentityErrorCode, type identity_IdentityPurchase as IdentityPurchase, type identity_IdentityState as IdentityState, type identity_IdentityStatus as IdentityStatus, identity_acceptName as acceptName, identity_getStatus as getStatus, identity_identityErrorCode as identityErrorCode, identity_purchase as purchase, identity_refresh as refresh, identity_remove as remove, identity_startSession as startSession };
12334
12403
  }
12335
12404
 
12336
- export { type CommandDescriptor as $, ACCOUNT_VENDOR as A, type BookingConfirmation as B, type CalDavConnectBody as C, type CalendarAccount as D, type CalendarAccountKind as E, type CalendarCreateBody as F, type CalendarEvent as G, type CalendarKeys as H, type CalendarRead as I, type CalendarSettings as J, type CalendarSettingsBody as K, type CalendarUpdate as L, type CalendarWindow as M, type ChatAttachmentFile as N, type ChatAttachmentInput as O, type ChatCryptoContext as P, type ChatKeyRing as Q, type ChatKind as R, type ChatMemberKey as S, type ChatMemberResponse as T, type ChatMessageResponse as U, type ChatResponse as V, type ChatSession as W, type CitationSummary as X, type CitationToolSources as Y, type CliConfig as Z, type CliCredentials as _, type AccountSyncResult as a, type ProjectEventKind as a$, type ConfigStore as a0, type ConnectOptions as a1, type ConversationResponse as a2, type ConversationUsageResponse as a3, type CreateFactRequest as a4, type CreateFactsRequest as a5, type CreateWorkRequest as a6, type CreateWorkflowRequest as a7, DEFAULT_AI_USD_PER_GBP as a8, DOC_TERMINAL_STATUSES as a9, type IdentityState as aA, type IdentityStatus as aB, type ImportResult as aC, type InvitationRead as aD, type LinkedRun as aE, type ListAllOptions as aF, type ListEventsParams as aG, type ListFactsOptions as aH, type ListPaginatedOptions as aI, type MailAttachment as aJ, type MailDraftSSEEvent as aK, type MessageLevel as aL, type MessageMetadataPayload$1 as aM, type MessageQueuedEvent as aN, type OAuthAccountKind as aO, type OutputTokensDetails as aP, type OverlayItem as aQ, type OverlayLayerName as aR, type ParsedSlashCommand as aS, type PendingAuthResponse as aT, type PersonKey as aU, PlanStepsError as aV, type PlanWorkRequest as aW, type ProbeAnswerEvent as aX, type ProjectBudget as aY, type ProjectConversationUsageResponse as aZ, type ProjectDetails as a_, type DateTimeSpec as aa, type DecryptedChat as ab, type DecryptedChatMessage as ac, type DeferredInterjectionEvent as ad, type DocNameMap as ae, type DocumentAutomationAction as af, type DocumentListFields as ag, type DocumentListOrder as ah, type DocumentSelector as ai, type DocumentWaiter as aj, type DocumentWaiterOptions as ak, type EditScope as al, type EventCreateBody as am, type EventPatchBody as an, FLAT_TAG_KINDS as ao, type FactResponse as ap, type FactSearchRequest as aq, type FactSearchResponse as ar, type FeedCreateBody as as, type FeedLevel as at, type FindTimeParams as au, type FormattedWsMessage as av, type FreeBusyEntry as aw, type HolidayCountry as ax, type IdentityErrorCode as ay, type IdentityPurchase as az, type ActivityKind as b, type TagListQuery as b$, type ProjectEventResponse as b0, type ProjectInvoicesResponse as b1, type ProjectResponse as b2, type ProjectUpdateRequest as b3, type ProjectUsageResponse as b4, PublicBookingError as b5, type PublicBookingPage as b6, type QueryOptions as b7, type RaisedSignal as b8, type ReconnectOptions as b9, type ScopedTarget as bA, type SendBack as bB, type ShareRead as bC, type ShareRole as bD, type SkillSummary as bE, type SkippedFile as bF, type StepActionRequest as bG, type StepActivityEvent as bH, type StepAssignee as bI, type StepField as bJ, type StepFieldOption as bK, type StepFieldOptionTone as bL, type StepKind as bM, type StepPhase as bN, type StepSignal as bO, type StepSignalWhen as bP, type StepState as bQ, type StepStatus as bR, type SubmitBackgroundQueryOptions as bS, type SubscribeParams as bT, TAG_KINDS as bU, type TagChange as bV, type TagFieldDefinition as bW, type TagKind as bX, type TagKindField as bY, type TagKindSchema as bZ, type TagLinks as b_, type ReconnectableWsConnection as ba, type ResolvedCitation as bb, type ResolvedRecipient as bc, type RespondParams as bd, type RespondPartstat as be, type ResponseCompletedEvent as bf, type ResponseContentPartAddedEvent as bg, type ResponseCreatedEvent as bh, type ResponseFailedEvent as bi, type ResponseOutputItemAddedEvent as bj, type ResponseOutputItemDoneEvent as bk, type ResponseOutputTextDeltaEvent as bl, type ResponseOutputTextDoneEvent as bm, type ResponseUsage as bn, type RoomCreateBody as bo, type RoomQuery as bp, type RoomRead as bq, type RunProgress as br, type RunStep as bs, type RunWaitingOn as bt, type SSEEvent as bu, type SSEStreamCallbacks as bv, type SSEStreamResult as bw, type SSEStreamStartData as bx, STEP_FIELD_OPTION_TONES as by, SUPPORTED_EXTENSIONS as bz, type ActivityResponse as c, formatWsMessage as c$, type TagResponse as c0, type TaskPlan as c1, type TaskPlanStep as c2, type TimeSuggestion as c3, type TokenBudgetContext as c4, type UpdateConversationRequest as c5, type UpdateFactRequest as c6, type UpdateWorkflowRequest as c7, type UploadBatchResult as c8, type UploadDirectOptions as c9, buildRetrievalChunkTool as cA, buildRetrievalFullContextTool as cB, buildRetrievalTocTool as cC, calendar as cD, cancelPublicBooking as cE, chats as cF, connectWebSocket as cG, connectWithReconnect as cH, consumeSSEStream as cI, contacts as cJ, conversations as cK, countCitations as cL, createAuthenticatedClient as cM, createDocumentWaiter as cN, doctags as cO, documents as cP, facts as cQ, files as cR, filterSkills as cS, formatAgentStepLabel as cT, formatFileSize as cU, formatGbp as cV, formatGbpPerMillionTokens as cW, formatItemLabel as cX, formatStreamSummary as cY, formatUserName as cZ, formatWorkspaceChoices as c_, type UploadDirectResult as ca, type UploadOptions as cb, type UploadResult as cc, type UsageBreakdown as cd, type UserDailyUsageResponse as ce, type UserInfo as cf, type UserInputRequestEvent as cg, type UserMessageEvent as ch, WebSocketAuthError as ci, type WeeklyHoursSpec as cj, type WorkStatus as ck, type WorkflowAuthMode as cl, type WorkflowResponse as cm, type WorkflowRunHistoryResponse as cn, type WorkflowRunResponse as co, type WorkspaceContext as cp, type WsConnection as cq, account as cr, agentconfig as cs, agents as ct, assistant as cu, authenticatedFetch as cv, bookPublicSlot as cw, buildCitationChunkData as cx, buildDocNameMap as cy, buildFactsContextTool as cz, type AgentControlStateEvent as d, generateEncryptedWorkspaceKey as d0, generateNewWorkspaceKey as d1, getErrorCode as d2, getErrorMessage as d3, getPublicBookingPage as d4, getRawWorkspaceKey as d5, health as d6, identity as d7, identityErrorCode as d8, isSharedSkill as d9, tags as dA, uploadSkill as dB, usdToGbp as dC, work as dD, workflowSteps as dE, workflows as dF, workspaces as dG, mail as da, notifications as db, parseSSEEvents as dc, parseSlashCommand as dd, parseSlashTokenInProgress as de, performPasswordLogin as df, performSigningKeyLogin as dg, performSsoDeviceFlowLogin as dh, profile as di, projects as dj, requireData as dk, requireOk as dl, resolveAuth as dm, resolveCitations as dn, resolveWorkspace as dp, responses as dq, selectWorkspace as dr, selectWorkspaceById as ds, sessions as dt, settings as du, signatureRequests as dv, splitAppPasswords as dw, streamSSE as dx, stripCitationMarkdown as dy, summarizeCitations as dz, type AgentStepDeltaEvent as e, type AgentStepEvent as f, type AppPassword as g, type AppPasswordCreateBody as h, type AppPasswordCreated as i, Arbi as j, ArbiApiError as k, ArbiError as l, type ArbiErrorEvent as m, type ArbiHostSession as n, type ArbiOptions as o, ArbiSessionExpiredError as p, type ArtifactEvent as q, type AttendeeRead as r, type AuthContext as s, type AuthHeaders as t, type AuthMode as u, type AuthenticatedClient as v, type BookingPage as w, type BookingPageWriteBody as x, type BookingRequestBody as y, type CalDavProfile as z };
12405
+ export { type CommandDescriptor as $, ACCOUNT_VENDOR as A, type BookingConfirmation as B, type CalDavConnectBody as C, type CalendarAccount as D, type CalendarAccountKind as E, type CalendarCreateBody as F, type CalendarEvent as G, type CalendarKeys as H, type CalendarRead as I, type CalendarSettings as J, type CalendarSettingsBody as K, type CalendarUpdate as L, type CalendarWindow as M, type ChatAttachmentFile as N, type ChatAttachmentInput as O, type ChatCryptoContext as P, type ChatKeyRing as Q, type ChatKind as R, type ChatMemberKey as S, type ChatMemberResponse as T, type ChatMessageResponse as U, type ChatResponse as V, type ChatSession as W, type CitationSummary as X, type CitationToolSources as Y, type CliConfig as Z, type CliCredentials as _, type AccountSyncResult as a, type ProjectConversationUsageResponse as a$, type ConfigStore as a0, type ConnectOptions as a1, type ConversationResponse as a2, type ConversationUsageResponse as a3, type CreateFactRequest as a4, type CreateFactsRequest as a5, type CreateWorkRequest as a6, type CreateWorkflowRequest as a7, DEFAULT_AI_USD_PER_GBP as a8, DOC_TERMINAL_STATUSES as a9, type IdentityErrorCode as aA, type IdentityPurchase as aB, type IdentityState as aC, type IdentityStatus as aD, type ImportResult as aE, type InvitationRead as aF, type LinkedRun as aG, type ListAllOptions as aH, type ListEventsParams as aI, type ListFactsOptions as aJ, type ListPaginatedOptions as aK, type MailAttachment as aL, type MailDraftSSEEvent as aM, type MessageLevel as aN, type MessageMetadataPayload$1 as aO, type MessageQueuedEvent as aP, type OAuthAccountKind as aQ, type OutputTokensDetails as aR, type OverlayItem as aS, type OverlayLayerName as aT, type ParsedSlashCommand as aU, type PendingAuthResponse as aV, type PersonKey as aW, PlanStepsError as aX, type PlanWorkRequest as aY, type ProbeAnswerEvent as aZ, type ProjectBudget as a_, type DateTimeSpec as aa, type DecryptedChat as ab, type DecryptedChatMessage as ac, type DeferredInterjectionEvent as ad, type DeploymentHouseTemplate as ae, type DocNameMap as af, type DocumentAutomationAction as ag, type DocumentListFields as ah, type DocumentListOrder as ai, type DocumentSelector as aj, type DocumentWaiter as ak, type DocumentWaiterOptions as al, type EditScope as am, type EventCreateBody as an, type EventPatchBody as ao, FLAT_TAG_KINDS as ap, type FactResponse as aq, type FactSearchRequest as ar, type FactSearchResponse as as, type FeedCreateBody as at, type FeedLevel as au, type FindTimeParams as av, type FormattedWsMessage as aw, type FreeBusyEntry as ax, type HolidayCountry as ay, type HouseTemplateCandidate as az, type ActivityKind as b, type TagKindSchema as b$, type ProjectDetails as b0, type ProjectEventKind as b1, type ProjectEventResponse as b2, type ProjectInvoicesResponse as b3, type ProjectResponse as b4, type ProjectUpdateRequest as b5, type ProjectUsageResponse as b6, PublicBookingError as b7, type PublicBookingPage as b8, type QueryOptions as b9, STEP_FIELD_OPTION_TONES as bA, SUPPORTED_EXTENSIONS as bB, type ScopedTarget as bC, type SendBack as bD, type ShareRead as bE, type ShareRole as bF, type SkillSummary as bG, type SkippedFile as bH, type StepActionRequest as bI, type StepActivityEvent as bJ, type StepAssignee as bK, type StepField as bL, type StepFieldOption as bM, type StepFieldOptionTone as bN, type StepKind as bO, type StepPhase as bP, type StepSignal as bQ, type StepSignalWhen as bR, type StepState as bS, type StepStatus as bT, type SubmitBackgroundQueryOptions as bU, type SubscribeParams as bV, TAG_KINDS as bW, type TagChange as bX, type TagFieldDefinition as bY, type TagKind as bZ, type TagKindField as b_, type RaisedSignal as ba, type ReconnectOptions as bb, type ReconnectableWsConnection as bc, type ResolvedCitation as bd, type ResolvedRecipient as be, type RespondParams as bf, type RespondPartstat as bg, type ResponseCompletedEvent as bh, type ResponseContentPartAddedEvent as bi, type ResponseCreatedEvent as bj, type ResponseFailedEvent as bk, type ResponseOutputItemAddedEvent as bl, type ResponseOutputItemDoneEvent as bm, type ResponseOutputTextDeltaEvent as bn, type ResponseOutputTextDoneEvent as bo, type ResponseUsage as bp, type RoomCreateBody as bq, type RoomQuery as br, type RoomRead as bs, type RunProgress as bt, type RunStep as bu, type RunWaitingOn as bv, type SSEEvent as bw, type SSEStreamCallbacks as bx, type SSEStreamResult as by, type SSEStreamStartData as bz, type ActivityResponse as c, formatUserName as c$, type TagLinks as c0, type TagListQuery as c1, type TagResponse as c2, type TaskPlan as c3, type TaskPlanStep as c4, type TimeSuggestion as c5, type TokenBudgetContext as c6, type UpdateConversationRequest as c7, type UpdateFactRequest as c8, type UpdateWorkflowRequest as c9, buildDocNameMap as cA, buildFactsContextTool as cB, buildRetrievalChunkTool as cC, buildRetrievalFullContextTool as cD, buildRetrievalTocTool as cE, calendar as cF, cancelPublicBooking as cG, chats as cH, connectWebSocket as cI, connectWithReconnect as cJ, consumeSSEStream as cK, contacts as cL, conversations as cM, countCitations as cN, createAuthenticatedClient as cO, createDocumentWaiter as cP, doctags as cQ, documents as cR, facts as cS, files as cT, filterSkills as cU, formatAgentStepLabel as cV, formatFileSize as cW, formatGbp as cX, formatGbpPerMillionTokens as cY, formatItemLabel as cZ, formatStreamSummary as c_, type UploadBatchResult as ca, type UploadDirectOptions as cb, type UploadDirectResult as cc, type UploadOptions as cd, type UploadResult as ce, type UsageBreakdown as cf, type UserDailyUsageResponse as cg, type UserInfo as ch, type UserInputRequestEvent as ci, type UserMessageEvent as cj, WebSocketAuthError as ck, type WeeklyHoursSpec as cl, type WorkStatus as cm, type WorkflowAuthMode as cn, type WorkflowResponse as co, type WorkflowRunHistoryResponse as cp, type WorkflowRunResponse as cq, type WorkspaceContext as cr, type WsConnection as cs, account as ct, agentconfig as cu, agents as cv, assistant as cw, authenticatedFetch as cx, bookPublicSlot as cy, buildCitationChunkData as cz, type AgentControlStateEvent as d, formatWorkspaceChoices as d0, formatWsMessage as d1, generateEncryptedWorkspaceKey as d2, generateNewWorkspaceKey as d3, getErrorCode as d4, getErrorMessage as d5, getPublicBookingPage as d6, getRawWorkspaceKey as d7, health as d8, houseTemplate as d9, streamSSE as dA, stripCitationMarkdown as dB, summarizeCitations as dC, tags as dD, uploadSkill as dE, usdToGbp as dF, work as dG, workflowSteps as dH, workflows as dI, workspaces as dJ, identity as da, identityErrorCode as db, isSharedSkill as dc, mail as dd, notifications as de, parseSSEEvents as df, parseSlashCommand as dg, parseSlashTokenInProgress as dh, performPasswordLogin as di, performSigningKeyLogin as dj, performSsoDeviceFlowLogin as dk, profile as dl, projects as dm, requireData as dn, requireOk as dp, resolveAuth as dq, resolveCitations as dr, resolveWorkspace as ds, responses as dt, selectWorkspace as du, selectWorkspaceById as dv, sessions as dw, settings as dx, signatureRequests as dy, splitAppPasswords as dz, type AgentStepDeltaEvent as e, type AgentStepEvent as f, type AppPassword as g, type AppPasswordCreateBody as h, type AppPasswordCreated as i, Arbi as j, ArbiApiError as k, ArbiError as l, type ArbiErrorEvent as m, type ArbiHostSession as n, type ArbiOptions as o, ArbiSessionExpiredError as p, type ArtifactEvent as q, type AttendeeRead as r, type AuthContext as s, type AuthHeaders as t, type AuthMode as u, type AuthenticatedClient as v, type BookingPage as w, type BookingPageWriteBody as x, type BookingRequestBody as y, type CalDavProfile as z };
@@ -1724,6 +1724,56 @@ declare namespace signatureRequests {
1724
1724
  export { type signatureRequests_CreateSignatureRequestOptions as CreateSignatureRequestOptions, type signatureRequests_SignatureField as SignatureField, type signatureRequests_SignatureRequest as SignatureRequest, type signatureRequests_SuggestedSignatureField as SuggestedSignatureField, signatureRequests_assignSuggestions as assignSuggestions, signatureRequests_createSignatureRequest as createSignatureRequest, signatureRequests_declineSignatureRequest as declineSignatureRequest, signatureRequests_getSignatureRequest as getSignatureRequest, signatureRequests_listDocumentSignatureRequests as listDocumentSignatureRequests, signatureRequests_listSignatureRequests as listSignatureRequests, signatureRequests_sendSignatureRequest as sendSignatureRequest, signatureRequests_suggestSignatureFields as suggestSignatureFields, signatureRequests_voidSignatureRequest as voidSignatureRequest };
1725
1725
  }
1726
1726
 
1727
+ /**
1728
+ * House templates — browser-safe functions.
1729
+ *
1730
+ * - A workspace's house template is one of its own documents: the workspace records its id as
1731
+ * `house_template_ext_id` (`PATCH /v1/workspace/`, owners only, as every workspace update).
1732
+ * - The deployment default is a .dotx/.docx the server holds: `GET /v1/deployment/house-template`
1733
+ * (any signed-in user; 404 when none is set), `PUT` (multipart `file`) and `DELETE` (deployment
1734
+ * admins only; `is_deployment_admin` on the current user).
1735
+ *
1736
+ * A server without house templates has no `house_template_ext_id` key on its workspaces
1737
+ * ({@link supportsHouseTemplates} is false): nothing here should be called then.
1738
+ */
1739
+
1740
+ type HouseTemplateCandidate = components['schemas']['HouseTemplateCandidate'];
1741
+ /** The deployment's default house template. */
1742
+ interface DeploymentHouseTemplate {
1743
+ bytes: Uint8Array;
1744
+ name: string;
1745
+ }
1746
+ /** Whether the server stores house templates (its workspaces carry the field). */
1747
+ declare function supportsHouseTemplates(workspace: object | null | undefined): boolean;
1748
+ /** The workspace's house template document, or null. */
1749
+ declare function workspaceHouseTemplateId(workspace: object | null | undefined): string | null;
1750
+ /** Whether the signed-in user may set the deployment default (absent on older servers). */
1751
+ declare function isDeploymentAdmin(user: object | null | undefined): boolean;
1752
+ /** The deployment default, or null when none is set. */
1753
+ declare function getDeploymentHouseTemplate(arbi: ArbiClient): Promise<DeploymentHouseTemplate | null>;
1754
+ /** Set the deployment default (`null` clears it). Deployment admins only. */
1755
+ declare function setDeploymentHouseTemplate(arbi: ArbiClient, file: Blob | null): Promise<void>;
1756
+ /** Point the open workspace at one of its documents as its house template (null clears it). */
1757
+ declare function setWorkspaceHouseTemplate(arbi: ArbiClient, documentId: string | null): Promise<void>;
1758
+ /**
1759
+ * The documents the open workspace may use as its house template: live, shared Word documents of
1760
+ * the workspace and of the deployment's public workspaces.
1761
+ */
1762
+ declare function listHouseTemplateCandidates(arbi: ArbiClient): Promise<HouseTemplateCandidate[]>;
1763
+
1764
+ type houseTemplate_DeploymentHouseTemplate = DeploymentHouseTemplate;
1765
+ type houseTemplate_HouseTemplateCandidate = HouseTemplateCandidate;
1766
+ declare const houseTemplate_getDeploymentHouseTemplate: typeof getDeploymentHouseTemplate;
1767
+ declare const houseTemplate_isDeploymentAdmin: typeof isDeploymentAdmin;
1768
+ declare const houseTemplate_listHouseTemplateCandidates: typeof listHouseTemplateCandidates;
1769
+ declare const houseTemplate_setDeploymentHouseTemplate: typeof setDeploymentHouseTemplate;
1770
+ declare const houseTemplate_setWorkspaceHouseTemplate: typeof setWorkspaceHouseTemplate;
1771
+ declare const houseTemplate_supportsHouseTemplates: typeof supportsHouseTemplates;
1772
+ declare const houseTemplate_workspaceHouseTemplateId: typeof workspaceHouseTemplateId;
1773
+ declare namespace houseTemplate {
1774
+ export { type houseTemplate_DeploymentHouseTemplate as DeploymentHouseTemplate, type houseTemplate_HouseTemplateCandidate as HouseTemplateCandidate, houseTemplate_getDeploymentHouseTemplate as getDeploymentHouseTemplate, houseTemplate_isDeploymentAdmin as isDeploymentAdmin, houseTemplate_listHouseTemplateCandidates as listHouseTemplateCandidates, houseTemplate_setDeploymentHouseTemplate as setDeploymentHouseTemplate, houseTemplate_setWorkspaceHouseTemplate as setWorkspaceHouseTemplate, houseTemplate_supportsHouseTemplates as supportsHouseTemplates, houseTemplate_workspaceHouseTemplateId as workspaceHouseTemplateId };
1775
+ }
1776
+
1727
1777
  /**
1728
1778
  * Workspace operations — list, create, delete, update, users, copy.
1729
1779
  */
@@ -11334,6 +11384,25 @@ declare class Arbi {
11334
11384
  stale: boolean;
11335
11385
  }>;
11336
11386
  };
11387
+ /**
11388
+ * The Word house template: a workspace's own (one of its documents), else the deployment's
11389
+ * default. Only on servers that store them (`supportsHouseTemplates(workspace)`).
11390
+ */
11391
+ readonly houseTemplates: {
11392
+ /** The deployment default, or null when none is set. */
11393
+ deployment: () => Promise<DeploymentHouseTemplate | null>;
11394
+ /** Set the deployment default (`null` clears it). Deployment admins only. */
11395
+ setDeployment: (file: Blob | null) => Promise<void>;
11396
+ /** Make a document of the open workspace its house template (`null` clears it). Owners only. */
11397
+ setWorkspace: (documentId: string | null) => Promise<void>;
11398
+ /** The documents the open workspace may use as its house template. */
11399
+ candidates: () => Promise<{
11400
+ doc_ext_id: string;
11401
+ workspace_ext_id: string;
11402
+ workspace_name: string;
11403
+ file_name: string;
11404
+ }[]>;
11405
+ };
11337
11406
  readonly facts: {
11338
11407
  create: (body: CreateFactRequest) => Promise<{
11339
11408
  text: string;
@@ -12333,4 +12402,4 @@ declare namespace identity {
12333
12402
  export { type identity_IdentityErrorCode as IdentityErrorCode, type identity_IdentityPurchase as IdentityPurchase, type identity_IdentityState as IdentityState, type identity_IdentityStatus as IdentityStatus, identity_acceptName as acceptName, identity_getStatus as getStatus, identity_identityErrorCode as identityErrorCode, identity_purchase as purchase, identity_refresh as refresh, identity_remove as remove, identity_startSession as startSession };
12334
12403
  }
12335
12404
 
12336
- export { type CommandDescriptor as $, ACCOUNT_VENDOR as A, type BookingConfirmation as B, type CalDavConnectBody as C, type CalendarAccount as D, type CalendarAccountKind as E, type CalendarCreateBody as F, type CalendarEvent as G, type CalendarKeys as H, type CalendarRead as I, type CalendarSettings as J, type CalendarSettingsBody as K, type CalendarUpdate as L, type CalendarWindow as M, type ChatAttachmentFile as N, type ChatAttachmentInput as O, type ChatCryptoContext as P, type ChatKeyRing as Q, type ChatKind as R, type ChatMemberKey as S, type ChatMemberResponse as T, type ChatMessageResponse as U, type ChatResponse as V, type ChatSession as W, type CitationSummary as X, type CitationToolSources as Y, type CliConfig as Z, type CliCredentials as _, type AccountSyncResult as a, type ProjectEventKind as a$, type ConfigStore as a0, type ConnectOptions as a1, type ConversationResponse as a2, type ConversationUsageResponse as a3, type CreateFactRequest as a4, type CreateFactsRequest as a5, type CreateWorkRequest as a6, type CreateWorkflowRequest as a7, DEFAULT_AI_USD_PER_GBP as a8, DOC_TERMINAL_STATUSES as a9, type IdentityState as aA, type IdentityStatus as aB, type ImportResult as aC, type InvitationRead as aD, type LinkedRun as aE, type ListAllOptions as aF, type ListEventsParams as aG, type ListFactsOptions as aH, type ListPaginatedOptions as aI, type MailAttachment as aJ, type MailDraftSSEEvent as aK, type MessageLevel as aL, type MessageMetadataPayload$1 as aM, type MessageQueuedEvent as aN, type OAuthAccountKind as aO, type OutputTokensDetails as aP, type OverlayItem as aQ, type OverlayLayerName as aR, type ParsedSlashCommand as aS, type PendingAuthResponse as aT, type PersonKey as aU, PlanStepsError as aV, type PlanWorkRequest as aW, type ProbeAnswerEvent as aX, type ProjectBudget as aY, type ProjectConversationUsageResponse as aZ, type ProjectDetails as a_, type DateTimeSpec as aa, type DecryptedChat as ab, type DecryptedChatMessage as ac, type DeferredInterjectionEvent as ad, type DocNameMap as ae, type DocumentAutomationAction as af, type DocumentListFields as ag, type DocumentListOrder as ah, type DocumentSelector as ai, type DocumentWaiter as aj, type DocumentWaiterOptions as ak, type EditScope as al, type EventCreateBody as am, type EventPatchBody as an, FLAT_TAG_KINDS as ao, type FactResponse as ap, type FactSearchRequest as aq, type FactSearchResponse as ar, type FeedCreateBody as as, type FeedLevel as at, type FindTimeParams as au, type FormattedWsMessage as av, type FreeBusyEntry as aw, type HolidayCountry as ax, type IdentityErrorCode as ay, type IdentityPurchase as az, type ActivityKind as b, type TagListQuery as b$, type ProjectEventResponse as b0, type ProjectInvoicesResponse as b1, type ProjectResponse as b2, type ProjectUpdateRequest as b3, type ProjectUsageResponse as b4, PublicBookingError as b5, type PublicBookingPage as b6, type QueryOptions as b7, type RaisedSignal as b8, type ReconnectOptions as b9, type ScopedTarget as bA, type SendBack as bB, type ShareRead as bC, type ShareRole as bD, type SkillSummary as bE, type SkippedFile as bF, type StepActionRequest as bG, type StepActivityEvent as bH, type StepAssignee as bI, type StepField as bJ, type StepFieldOption as bK, type StepFieldOptionTone as bL, type StepKind as bM, type StepPhase as bN, type StepSignal as bO, type StepSignalWhen as bP, type StepState as bQ, type StepStatus as bR, type SubmitBackgroundQueryOptions as bS, type SubscribeParams as bT, TAG_KINDS as bU, type TagChange as bV, type TagFieldDefinition as bW, type TagKind as bX, type TagKindField as bY, type TagKindSchema as bZ, type TagLinks as b_, type ReconnectableWsConnection as ba, type ResolvedCitation as bb, type ResolvedRecipient as bc, type RespondParams as bd, type RespondPartstat as be, type ResponseCompletedEvent as bf, type ResponseContentPartAddedEvent as bg, type ResponseCreatedEvent as bh, type ResponseFailedEvent as bi, type ResponseOutputItemAddedEvent as bj, type ResponseOutputItemDoneEvent as bk, type ResponseOutputTextDeltaEvent as bl, type ResponseOutputTextDoneEvent as bm, type ResponseUsage as bn, type RoomCreateBody as bo, type RoomQuery as bp, type RoomRead as bq, type RunProgress as br, type RunStep as bs, type RunWaitingOn as bt, type SSEEvent as bu, type SSEStreamCallbacks as bv, type SSEStreamResult as bw, type SSEStreamStartData as bx, STEP_FIELD_OPTION_TONES as by, SUPPORTED_EXTENSIONS as bz, type ActivityResponse as c, formatWsMessage as c$, type TagResponse as c0, type TaskPlan as c1, type TaskPlanStep as c2, type TimeSuggestion as c3, type TokenBudgetContext as c4, type UpdateConversationRequest as c5, type UpdateFactRequest as c6, type UpdateWorkflowRequest as c7, type UploadBatchResult as c8, type UploadDirectOptions as c9, buildRetrievalChunkTool as cA, buildRetrievalFullContextTool as cB, buildRetrievalTocTool as cC, calendar as cD, cancelPublicBooking as cE, chats as cF, connectWebSocket as cG, connectWithReconnect as cH, consumeSSEStream as cI, contacts as cJ, conversations as cK, countCitations as cL, createAuthenticatedClient as cM, createDocumentWaiter as cN, doctags as cO, documents as cP, facts as cQ, files as cR, filterSkills as cS, formatAgentStepLabel as cT, formatFileSize as cU, formatGbp as cV, formatGbpPerMillionTokens as cW, formatItemLabel as cX, formatStreamSummary as cY, formatUserName as cZ, formatWorkspaceChoices as c_, type UploadDirectResult as ca, type UploadOptions as cb, type UploadResult as cc, type UsageBreakdown as cd, type UserDailyUsageResponse as ce, type UserInfo as cf, type UserInputRequestEvent as cg, type UserMessageEvent as ch, WebSocketAuthError as ci, type WeeklyHoursSpec as cj, type WorkStatus as ck, type WorkflowAuthMode as cl, type WorkflowResponse as cm, type WorkflowRunHistoryResponse as cn, type WorkflowRunResponse as co, type WorkspaceContext as cp, type WsConnection as cq, account as cr, agentconfig as cs, agents as ct, assistant as cu, authenticatedFetch as cv, bookPublicSlot as cw, buildCitationChunkData as cx, buildDocNameMap as cy, buildFactsContextTool as cz, type AgentControlStateEvent as d, generateEncryptedWorkspaceKey as d0, generateNewWorkspaceKey as d1, getErrorCode as d2, getErrorMessage as d3, getPublicBookingPage as d4, getRawWorkspaceKey as d5, health as d6, identity as d7, identityErrorCode as d8, isSharedSkill as d9, tags as dA, uploadSkill as dB, usdToGbp as dC, work as dD, workflowSteps as dE, workflows as dF, workspaces as dG, mail as da, notifications as db, parseSSEEvents as dc, parseSlashCommand as dd, parseSlashTokenInProgress as de, performPasswordLogin as df, performSigningKeyLogin as dg, performSsoDeviceFlowLogin as dh, profile as di, projects as dj, requireData as dk, requireOk as dl, resolveAuth as dm, resolveCitations as dn, resolveWorkspace as dp, responses as dq, selectWorkspace as dr, selectWorkspaceById as ds, sessions as dt, settings as du, signatureRequests as dv, splitAppPasswords as dw, streamSSE as dx, stripCitationMarkdown as dy, summarizeCitations as dz, type AgentStepDeltaEvent as e, type AgentStepEvent as f, type AppPassword as g, type AppPasswordCreateBody as h, type AppPasswordCreated as i, Arbi as j, ArbiApiError as k, ArbiError as l, type ArbiErrorEvent as m, type ArbiHostSession as n, type ArbiOptions as o, ArbiSessionExpiredError as p, type ArtifactEvent as q, type AttendeeRead as r, type AuthContext as s, type AuthHeaders as t, type AuthMode as u, type AuthenticatedClient as v, type BookingPage as w, type BookingPageWriteBody as x, type BookingRequestBody as y, type CalDavProfile as z };
12405
+ export { type CommandDescriptor as $, ACCOUNT_VENDOR as A, type BookingConfirmation as B, type CalDavConnectBody as C, type CalendarAccount as D, type CalendarAccountKind as E, type CalendarCreateBody as F, type CalendarEvent as G, type CalendarKeys as H, type CalendarRead as I, type CalendarSettings as J, type CalendarSettingsBody as K, type CalendarUpdate as L, type CalendarWindow as M, type ChatAttachmentFile as N, type ChatAttachmentInput as O, type ChatCryptoContext as P, type ChatKeyRing as Q, type ChatKind as R, type ChatMemberKey as S, type ChatMemberResponse as T, type ChatMessageResponse as U, type ChatResponse as V, type ChatSession as W, type CitationSummary as X, type CitationToolSources as Y, type CliConfig as Z, type CliCredentials as _, type AccountSyncResult as a, type ProjectConversationUsageResponse as a$, type ConfigStore as a0, type ConnectOptions as a1, type ConversationResponse as a2, type ConversationUsageResponse as a3, type CreateFactRequest as a4, type CreateFactsRequest as a5, type CreateWorkRequest as a6, type CreateWorkflowRequest as a7, DEFAULT_AI_USD_PER_GBP as a8, DOC_TERMINAL_STATUSES as a9, type IdentityErrorCode as aA, type IdentityPurchase as aB, type IdentityState as aC, type IdentityStatus as aD, type ImportResult as aE, type InvitationRead as aF, type LinkedRun as aG, type ListAllOptions as aH, type ListEventsParams as aI, type ListFactsOptions as aJ, type ListPaginatedOptions as aK, type MailAttachment as aL, type MailDraftSSEEvent as aM, type MessageLevel as aN, type MessageMetadataPayload$1 as aO, type MessageQueuedEvent as aP, type OAuthAccountKind as aQ, type OutputTokensDetails as aR, type OverlayItem as aS, type OverlayLayerName as aT, type ParsedSlashCommand as aU, type PendingAuthResponse as aV, type PersonKey as aW, PlanStepsError as aX, type PlanWorkRequest as aY, type ProbeAnswerEvent as aZ, type ProjectBudget as a_, type DateTimeSpec as aa, type DecryptedChat as ab, type DecryptedChatMessage as ac, type DeferredInterjectionEvent as ad, type DeploymentHouseTemplate as ae, type DocNameMap as af, type DocumentAutomationAction as ag, type DocumentListFields as ah, type DocumentListOrder as ai, type DocumentSelector as aj, type DocumentWaiter as ak, type DocumentWaiterOptions as al, type EditScope as am, type EventCreateBody as an, type EventPatchBody as ao, FLAT_TAG_KINDS as ap, type FactResponse as aq, type FactSearchRequest as ar, type FactSearchResponse as as, type FeedCreateBody as at, type FeedLevel as au, type FindTimeParams as av, type FormattedWsMessage as aw, type FreeBusyEntry as ax, type HolidayCountry as ay, type HouseTemplateCandidate as az, type ActivityKind as b, type TagKindSchema as b$, type ProjectDetails as b0, type ProjectEventKind as b1, type ProjectEventResponse as b2, type ProjectInvoicesResponse as b3, type ProjectResponse as b4, type ProjectUpdateRequest as b5, type ProjectUsageResponse as b6, PublicBookingError as b7, type PublicBookingPage as b8, type QueryOptions as b9, STEP_FIELD_OPTION_TONES as bA, SUPPORTED_EXTENSIONS as bB, type ScopedTarget as bC, type SendBack as bD, type ShareRead as bE, type ShareRole as bF, type SkillSummary as bG, type SkippedFile as bH, type StepActionRequest as bI, type StepActivityEvent as bJ, type StepAssignee as bK, type StepField as bL, type StepFieldOption as bM, type StepFieldOptionTone as bN, type StepKind as bO, type StepPhase as bP, type StepSignal as bQ, type StepSignalWhen as bR, type StepState as bS, type StepStatus as bT, type SubmitBackgroundQueryOptions as bU, type SubscribeParams as bV, TAG_KINDS as bW, type TagChange as bX, type TagFieldDefinition as bY, type TagKind as bZ, type TagKindField as b_, type RaisedSignal as ba, type ReconnectOptions as bb, type ReconnectableWsConnection as bc, type ResolvedCitation as bd, type ResolvedRecipient as be, type RespondParams as bf, type RespondPartstat as bg, type ResponseCompletedEvent as bh, type ResponseContentPartAddedEvent as bi, type ResponseCreatedEvent as bj, type ResponseFailedEvent as bk, type ResponseOutputItemAddedEvent as bl, type ResponseOutputItemDoneEvent as bm, type ResponseOutputTextDeltaEvent as bn, type ResponseOutputTextDoneEvent as bo, type ResponseUsage as bp, type RoomCreateBody as bq, type RoomQuery as br, type RoomRead as bs, type RunProgress as bt, type RunStep as bu, type RunWaitingOn as bv, type SSEEvent as bw, type SSEStreamCallbacks as bx, type SSEStreamResult as by, type SSEStreamStartData as bz, type ActivityResponse as c, formatUserName as c$, type TagLinks as c0, type TagListQuery as c1, type TagResponse as c2, type TaskPlan as c3, type TaskPlanStep as c4, type TimeSuggestion as c5, type TokenBudgetContext as c6, type UpdateConversationRequest as c7, type UpdateFactRequest as c8, type UpdateWorkflowRequest as c9, buildDocNameMap as cA, buildFactsContextTool as cB, buildRetrievalChunkTool as cC, buildRetrievalFullContextTool as cD, buildRetrievalTocTool as cE, calendar as cF, cancelPublicBooking as cG, chats as cH, connectWebSocket as cI, connectWithReconnect as cJ, consumeSSEStream as cK, contacts as cL, conversations as cM, countCitations as cN, createAuthenticatedClient as cO, createDocumentWaiter as cP, doctags as cQ, documents as cR, facts as cS, files as cT, filterSkills as cU, formatAgentStepLabel as cV, formatFileSize as cW, formatGbp as cX, formatGbpPerMillionTokens as cY, formatItemLabel as cZ, formatStreamSummary as c_, type UploadBatchResult as ca, type UploadDirectOptions as cb, type UploadDirectResult as cc, type UploadOptions as cd, type UploadResult as ce, type UsageBreakdown as cf, type UserDailyUsageResponse as cg, type UserInfo as ch, type UserInputRequestEvent as ci, type UserMessageEvent as cj, WebSocketAuthError as ck, type WeeklyHoursSpec as cl, type WorkStatus as cm, type WorkflowAuthMode as cn, type WorkflowResponse as co, type WorkflowRunHistoryResponse as cp, type WorkflowRunResponse as cq, type WorkspaceContext as cr, type WsConnection as cs, account as ct, agentconfig as cu, agents as cv, assistant as cw, authenticatedFetch as cx, bookPublicSlot as cy, buildCitationChunkData as cz, type AgentControlStateEvent as d, formatWorkspaceChoices as d0, formatWsMessage as d1, generateEncryptedWorkspaceKey as d2, generateNewWorkspaceKey as d3, getErrorCode as d4, getErrorMessage as d5, getPublicBookingPage as d6, getRawWorkspaceKey as d7, health as d8, houseTemplate as d9, streamSSE as dA, stripCitationMarkdown as dB, summarizeCitations as dC, tags as dD, uploadSkill as dE, usdToGbp as dF, work as dG, workflowSteps as dH, workflows as dI, workspaces as dJ, identity as da, identityErrorCode as db, isSharedSkill as dc, mail as dd, notifications as de, parseSSEEvents as df, parseSlashCommand as dg, parseSlashTokenInProgress as dh, performPasswordLogin as di, performSigningKeyLogin as dj, performSsoDeviceFlowLogin as dk, profile as dl, projects as dm, requireData as dn, requireOk as dp, resolveAuth as dq, resolveCitations as dr, resolveWorkspace as ds, responses as dt, selectWorkspace as du, selectWorkspaceById as dv, sessions as dw, settings as dx, signatureRequests as dy, splitAppPasswords as dz, type AgentStepDeltaEvent as e, type AgentStepEvent as f, type AppPassword as g, type AppPasswordCreateBody as h, type AppPasswordCreated as i, Arbi as j, ArbiApiError as k, ArbiError as l, type ArbiErrorEvent as m, type ArbiHostSession as n, type ArbiOptions as o, ArbiSessionExpiredError as p, type ArtifactEvent as q, type AttendeeRead as r, type AuthContext as s, type AuthHeaders as t, type AuthMode as u, type AuthenticatedClient as v, type BookingPage as w, type BookingPageWriteBody as x, type BookingRequestBody as y, type CalDavProfile as z };
package/dist/browser.cjs CHANGED
@@ -4851,6 +4851,76 @@ async function declineSignatureRequest(arbi, requestId, reason) {
4851
4851
  );
4852
4852
  }
4853
4853
 
4854
+ // src/operations/house-template.ts
4855
+ var house_template_exports = {};
4856
+ __export(house_template_exports, {
4857
+ getDeploymentHouseTemplate: () => getDeploymentHouseTemplate,
4858
+ isDeploymentAdmin: () => isDeploymentAdmin,
4859
+ listHouseTemplateCandidates: () => listHouseTemplateCandidates,
4860
+ setDeploymentHouseTemplate: () => setDeploymentHouseTemplate,
4861
+ setWorkspaceHouseTemplate: () => setWorkspaceHouseTemplate,
4862
+ supportsHouseTemplates: () => supportsHouseTemplates,
4863
+ workspaceHouseTemplateId: () => workspaceHouseTemplateId
4864
+ });
4865
+ function supportsHouseTemplates(workspace) {
4866
+ return !!workspace && "house_template_ext_id" in workspace;
4867
+ }
4868
+ function workspaceHouseTemplateId(workspace) {
4869
+ return workspace?.house_template_ext_id ?? null;
4870
+ }
4871
+ function isDeploymentAdmin(user) {
4872
+ return user?.is_deployment_admin === true;
4873
+ }
4874
+ function filenameOf(response) {
4875
+ const header = response.headers.get("Content-Disposition") ?? "";
4876
+ const star = /filename\*=UTF-8''([^;]+)/i.exec(header);
4877
+ if (star) return decodeURIComponent(star[1]);
4878
+ return /filename="?([^";]+)"?/i.exec(header)?.[1];
4879
+ }
4880
+ async function getDeploymentHouseTemplate(arbi) {
4881
+ const { data, error, response } = await arbi.fetch.GET("/v1/deployment/house-template", {
4882
+ parseAs: "arrayBuffer"
4883
+ });
4884
+ if (response.status === 404) return null;
4885
+ if (error || !data)
4886
+ throw new ArbiApiError("Could not read the deployment house template", error, response.status);
4887
+ return {
4888
+ bytes: new Uint8Array(data),
4889
+ name: filenameOf(response) ?? "House template.dotx"
4890
+ };
4891
+ }
4892
+ async function setDeploymentHouseTemplate(arbi, file) {
4893
+ if (!file) {
4894
+ requireOk(
4895
+ await arbi.fetch.DELETE("/v1/deployment/house-template"),
4896
+ "Could not clear the deployment house template"
4897
+ );
4898
+ return;
4899
+ }
4900
+ const form = new FormData();
4901
+ form.append("file", file);
4902
+ requireOk(
4903
+ await arbi.fetch.PUT("/v1/deployment/house-template", {
4904
+ // The schema types the multipart file as a string; the FormData is sent as is.
4905
+ body: form,
4906
+ bodySerializer: () => form
4907
+ }),
4908
+ "Could not set the deployment house template"
4909
+ );
4910
+ }
4911
+ async function setWorkspaceHouseTemplate(arbi, documentId) {
4912
+ requireData(
4913
+ await arbi.fetch.PATCH("/v1/workspace/", { body: { house_template_ext_id: documentId } }),
4914
+ "Could not set the house template"
4915
+ );
4916
+ }
4917
+ async function listHouseTemplateCandidates(arbi) {
4918
+ return requireData(
4919
+ await arbi.fetch.GET("/v1/workspace/house-template/candidates"),
4920
+ "Could not list the documents that can be the house template"
4921
+ );
4922
+ }
4923
+
4854
4924
  // src/operations/workspaces.ts
4855
4925
  var workspaces_exports = {};
4856
4926
  __export(workspaces_exports, {
@@ -9395,6 +9465,21 @@ var Arbi = class {
9395
9465
  void: (requestId) => voidSignatureRequest(this.requireClient(), requestId),
9396
9466
  decline: (requestId, reason) => declineSignatureRequest(this.requireClient(), requestId, reason)
9397
9467
  };
9468
+ // ── House templates ─────────────────────────────────────────────────
9469
+ /**
9470
+ * The Word house template: a workspace's own (one of its documents), else the deployment's
9471
+ * default. Only on servers that store them (`supportsHouseTemplates(workspace)`).
9472
+ */
9473
+ houseTemplates = {
9474
+ /** The deployment default, or null when none is set. */
9475
+ deployment: () => getDeploymentHouseTemplate(this.requireClient()),
9476
+ /** Set the deployment default (`null` clears it). Deployment admins only. */
9477
+ setDeployment: (file) => setDeploymentHouseTemplate(this.requireClient(), file),
9478
+ /** Make a document of the open workspace its house template (`null` clears it). Owners only. */
9479
+ setWorkspace: (documentId) => setWorkspaceHouseTemplate(this.requireClient(), documentId),
9480
+ /** The documents the open workspace may use as its house template. */
9481
+ candidates: () => listHouseTemplateCandidates(this.requireClient())
9482
+ };
9398
9483
  // ── Workspace facts ─────────────────────────────────────────────────
9399
9484
  facts = {
9400
9485
  create: (body) => createFact(this.requireClient(), body),
@@ -9491,6 +9576,7 @@ exports.getErrorMessage = getErrorMessage;
9491
9576
  exports.getPublicBookingPage = getPublicBookingPage;
9492
9577
  exports.getRawWorkspaceKey = getRawWorkspaceKey;
9493
9578
  exports.health = health_exports;
9579
+ exports.houseTemplates = house_template_exports;
9494
9580
  exports.identityErrorCode = identityErrorCode;
9495
9581
  exports.identityVerification = identity_exports;
9496
9582
  exports.mail = mail_exports;