@proteos/sdk 0.88.0 → 0.90.0
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/{chunk-KX4VIMIJ.js → chunk-DXF354K4.js} +7 -2
- package/dist/chunk-DXF354K4.js.map +1 -0
- package/dist/{chunk-4BBHU3XA.cjs → chunk-SUS4QR63.cjs} +7 -2
- package/dist/chunk-SUS4QR63.cjs.map +1 -0
- package/dist/index.cjs +192 -124
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +216 -8
- package/dist/index.d.ts +216 -8
- package/dist/index.js +70 -2
- package/dist/index.js.map +1 -1
- package/dist/meta/index.cjs +96 -96
- package/dist/meta/index.d.cts +1 -1
- package/dist/meta/index.d.ts +1 -1
- package/dist/meta/index.js +1 -1
- package/dist/{types-D38dRFU7.d.cts → types-BbiiuHnH.d.cts} +1 -1
- package/dist/{types-D38dRFU7.d.ts → types-BbiiuHnH.d.ts} +1 -1
- package/package.json +1 -1
- package/src/agent/index.ts +2 -0
- package/src/agent/session-types.ts +23 -0
- package/src/agent/sessions.ts +14 -0
- package/src/agent/types.ts +6 -3
- package/src/auth/platform-entities.ts +5 -0
- package/src/auth/users.ts +2 -0
- package/src/connector/types.ts +4 -0
- package/src/conversation/index.ts +65 -0
- package/src/conversation/types.ts +106 -0
- package/src/data/index.ts +5 -0
- package/src/data/queries.ts +90 -1
- package/src/index.ts +16 -0
- package/src/meta/layout/control-registry.json +6 -1
- package/dist/chunk-4BBHU3XA.cjs.map +0 -1
- package/dist/chunk-KX4VIMIJ.js.map +0 -1
|
@@ -6567,4 +6567,4 @@ declare function isCurrentUserDefault(value: unknown): value is CurrentUserDefau
|
|
|
6567
6567
|
/** Only the identity-valued attribute types can carry the sentinel. */
|
|
6568
6568
|
declare function acceptsCurrentUserDefault(type: AttributeType): boolean;
|
|
6569
6569
|
|
|
6570
|
-
export { type
|
|
6570
|
+
export { type CreatePageExtensionRequest as $, type AuditFields as A, ColumnSchema as B, CURRENT_USER as C, type ComparisonOperator as D, type Component as E, type FileRef as F, ComponentSchema as G, type ComponentService as H, type ContactAddressAttributeKind as I, type ContactAddressAttributeMeta as J, ContactAddressAttributeMetaSchema as K, type ListOptions as L, type ContactBindingDuplicatePolicy as M, type CreateAppConfigurationRequest as N, type CreateAppRequest as O, PageIterator as P, type CreateComponentRequest as Q, type RequestOptions as R, type CreateDesignReferenceRequest as S, type CreateEntityExtensionRequest as T, type UserRef as U, type CreateEntityRequest as V, type CreateListExtensionRequest as W, type CreateListRequest as X, type CreateListViewRequest as Y, type CreateMenuConfigurationExtensionRequest as Z, type CreateMenuConfigurationRequest as _, type Attribute as a, MENU_CONFIGURATION_EXTENSION_ANCHOR_ITEMS as a$, type CreatePageRequest as a0, type CreateVariableRequest as a1, type CurrencyAttributeMeta as a2, CurrencyAttributeMetaSchema as a3, type CurrencySymbolSide as a4, type CurrencyValue as a5, type CurrentUserDefault as a6, DEFAULT_OPTIONS as a7, DEFAULT_PAGE_SIZE as a8, DONE as a9, type ListAppConfigurationsOptions as aA, type ListAppsOptions as aB, type ListComponentsOptions as aC, type ListDesignReferencesOptions as aD, type ListEntitiesOptions as aE, type ListEntityExtensionsOptions as aF, type ListExtension as aG, type ListExtensionColumnPlacement as aH, ListExtensionColumnPlacementSchema as aI, ListExtensionSchema as aJ, type ListExtensionService as aK, type ListFn as aL, type ListListExtensionsOptions as aM, type ListListViewsOptions as aN, type ListListsOptions as aO, type ListMenuConfigurationExtensionsOptions as aP, type ListMenuConfigurationsOptions as aQ, type ListModulesOptions as aR, type ListPageExtensionsOptions as aS, type ListPagesOptions as aT, ListSchema as aU, type ListService as aV, type ListVariablesOptions as aW, type ListView as aX, ListViewSchema as aY, type ListViewService as aZ, type LogicalOperator as a_, type DeployModuleRequest as aa, type DesignReference as ab, type DesignReferenceContent as ac, DesignReferenceSchema as ad, type DesignReferenceService as ae, type Done as af, type Entity as ag, type EntityContactBinding as ah, EntityContactBindingSchema as ai, type EntityExtension as aj, EntityExtensionSchema as ak, type EntityExtensionService as al, EntitySchema as am, type EntityService as an, type EntityWithSchema as ao, EntityWithSchemaSchema as ap, type EnumAttributeMeta as aq, type EnumValue as ar, type ExtensionPosition as as, ExtensionPositionSchema as at, type FileAttributeMeta as au, FileRefSchema as av, type FilterElement as aw, FilterElementSchema as ax, FilterGroupSchema as ay, type List as az, type ListResult as b, type UpdateEntityExtensionRequest as b$, type MenuConfiguration as b0, type MenuConfigurationExtension as b1, type MenuConfigurationExtensionPlacement as b2, MenuConfigurationExtensionPlacementSchema as b3, type MenuConfigurationExtensionPosition as b4, MenuConfigurationExtensionPositionSchema as b5, MenuConfigurationExtensionSchema as b6, type MenuConfigurationExtensionService as b7, MenuConfigurationSchema as b8, type MenuConfigurationService as b9, type PageExtensionService as bA, type PageLayout as bB, PageLayoutSchema as bC, type PageMode as bD, PageSchema as bE, type PageService as bF, type PageType as bG, type PublicPageComponent as bH, type PublicPageResponse as bI, type RecordPageBinding as bJ, RecordPageBindingSchema as bK, type RelationAttributeMeta as bL, RelationAttributeMetaSchema as bM, type ResolvedClientOptions as bN, ResponseMetaSchema as bO, type SortConfig as bP, SortConfigSchema as bQ, type SortDirection as bR, type Timestamps as bS, type TokenProvider as bT, type TriggerPageBinding as bU, TriggerPageBindingSchema as bV, type TriggerPhase as bW, type UpdateAppConfigurationRequest as bX, type UpdateAppRequest as bY, type UpdateComponentRequest as bZ, type UpdateDesignReferenceRequest as b_, type MenuItem as ba, MenuItemSchema as bb, MenuItemType as bc, MetaClient as bd, type MetaListOptions as be, type Module as bf, ModuleSchema as bg, type ModuleService as bh, type ModuleStatus as bi, type OnDeleteAction as bj, OnDeleteActionSchema as bk, PAGE_ACTION_MATCH_MAX_LIMIT as bl, PAGE_EXTENSION_ANCHOR_MAIN as bm, PAGE_EXTENSION_ANCHOR_SIDE_PANEL as bn, PLATFORM_ATTRIBUTE_NAMES as bo, PLATFORM_USER_ID as bp, type Page as bq, type PageActionIntent as br, type PageActionKind as bs, type PageActionMatch as bt, PageActionMatchSchema as bu, PageActionSchema as bv, type PageExtension as bw, type PageExtensionPlacement as bx, PageExtensionPlacementSchema as by, PageExtensionSchema as bz, ProteosClient as c, type LengthValue as c$, type UpdateEntityRequest as c0, type UpdateListExtensionRequest as c1, type UpdateListRequest as c2, type UpdateListViewRequest as c3, type UpdateMenuConfigurationExtensionRequest as c4, type UpdateMenuConfigurationRequest as c5, type UpdatePageExtensionRequest as c6, type UpdatePageRequest as c7, type UpdateVariableRequest as c8, UserRefSchema as c9, type AttributeMeta as cA, BUILT_IN_CONTROLS as cB, type BuiltInControlSlug as cC, CALENDAR_MAX_OVERLAY_USERS as cD, CALENDAR_VIEW_KINDS as cE, type CalendarElement as cF, type CalendarViewKind as cG, type CardElement as cH, type ColumnElement as cI, type CommonProps as cJ, type ComponentElement as cK, type ControlBucket as cL, type DatetimeAttributeMeta as cM, type DatetimeFormat as cN, type DividerElement as cO, type FieldElement as cP, FileAttributeMetaSchema as cQ, type LayoutAlign as cR, type LayoutElement as cS, LayoutElementSchema as cT, LayoutElementType as cU, type LayoutGap as cV, type LayoutJustify as cW, type LayoutStep as cX, LayoutStepSchema as cY, type LayoutTab as cZ, LayoutTabSchema as c_, type UserType as ca, type Variable as cb, VariableSchema as cc, type VariableService as cd, acceptsCurrentUserDefault as ce, allCurrencyCodes as cf, bundleVersionOf as cg, createIterator as ch, createListResultSchema as ci, currencyLabel as cj, currencySymbol as ck, currencySymbolSide as cl, formatAmount as cm, formatMoney as cn, isCurrentUser as co, isCurrentUserDefault as cp, isPlatformAttributeName as cq, localeNumberSeparators as cr, parseAmount as cs, parseContactAddressMeta as ct, parseCurrencyMeta as cu, parseFileMeta as cv, parseRelationMeta as cw, platformAttributes as cx, resolveOptions as cy, type AttributeForLookup as cz, type PrincipalRef as d, LengthValueSchema as d0, type ListElement as d1, type NumberAttributeMeta as d2, type ObjectAttributeMeta as d3, PAGE_BACKGROUND_COLOR_RE as d4, PAGE_BACKGROUND_TOKENS as d5, PAGE_HEADERS as d6, type PageBackgroundToken as d7, type PageHeader as d8, type PageLayoutSidePanel as d9, UserAttributeMetaSchema as dA, type WorkflowTriggerElement as dB, isBuiltInControl as dC, isLengthValue as dD, isPageBackground as dE, isReservedAttributeName as dF, isStyleSizeValue as dG, isTitleQueryable as dH, lookupCompatibleControls as dI, lookupControls as dJ, lookupPrimaryControl as dK, parsePrincipalMeta as dL, parseUserMeta as dM, titleTemplateVariables as dN, PageLayoutSidePanelSchema as da, type PageStyle as db, PageStyleSchema as dc, type PrincipalAttributeMeta as dd, type PrincipalType as de, RECORD_TITLE_FIELD as df, type RecordFilterElement as dg, type RelatedListElement as dh, type RelatedRecordElement as di, type ResponsiveSizing as dj, type RowElement as dk, type SchedulingPickerElement as dl, type SectionElement as dm, type SizeValue as dn, SizeValueSchema as dp, type SizingProps as dq, type StepperElement as dr, type StringAttributeMeta as ds, type StringFormat as dt, type StyleSizeValue as du, StyleSizeValueSchema as dv, type TabsElement as dw, type TextElement as dx, type TextVariant as dy, type UserAttributeMeta as dz, type PageAction as e, type FilterGroup as f, type ResponseMeta as g, type PublicAccessOperation as h, type App as i, type AppConfiguration as j, AppConfigurationSchema as k, type AppConfigurationService as l, type AppHome as m, AppHomeSchema as n, type AppHomeType as o, AppSchema as p, type AppService as q, type ArrayAttributeMeta as r, type AttributeAccessRule as s, type AttributeRestrictions as t, AttributeSchema as u, type AttributeType as v, AuditFieldsSchema as w, CURRENT_USER_DEFAULT as x, type ClientOptions as y, type Column as z };
|
package/package.json
CHANGED
package/src/agent/index.ts
CHANGED
|
@@ -78,6 +78,29 @@ export interface Session extends AuditFields {
|
|
|
78
78
|
ended_by: UserRef | null
|
|
79
79
|
}
|
|
80
80
|
|
|
81
|
+
/**
|
|
82
|
+
* What a session's preview shows: `serving` at `url`; `no_module` when the
|
|
83
|
+
* session's sandbox holds no module to preview yet; `not_started` when the
|
|
84
|
+
* session has no sandbox yet (its first message creates one).
|
|
85
|
+
*/
|
|
86
|
+
export type SessionPreviewStatus = 'serving' | 'no_module' | 'not_started'
|
|
87
|
+
|
|
88
|
+
/**
|
|
89
|
+
* The live preview of the module an agent works on in its session's sandbox
|
|
90
|
+
* (sessions on the `sandbox` runtime), as a page to show in a frame.
|
|
91
|
+
*/
|
|
92
|
+
export interface SessionPreview {
|
|
93
|
+
status: SessionPreviewStatus
|
|
94
|
+
/**
|
|
95
|
+
* The preview's address; null unless `status` is `serving`. The address is
|
|
96
|
+
* the whole credential: whoever has it sees the preview until `expires_at`,
|
|
97
|
+
* so show it to the session's owner only and do not store it.
|
|
98
|
+
*/
|
|
99
|
+
url: string | null
|
|
100
|
+
/** When `url` stops working (RFC 3339); null without one. */
|
|
101
|
+
expires_at: string | null
|
|
102
|
+
}
|
|
103
|
+
|
|
81
104
|
// ---------------------------------------------------------------------------
|
|
82
105
|
// Event types (the discriminant)
|
|
83
106
|
// ---------------------------------------------------------------------------
|
package/src/agent/sessions.ts
CHANGED
|
@@ -17,6 +17,7 @@ import type {
|
|
|
17
17
|
SessionDeltaStreamOptions,
|
|
18
18
|
SessionEvent,
|
|
19
19
|
SessionEventsOptions,
|
|
20
|
+
SessionPreview,
|
|
20
21
|
SessionStreamOptions,
|
|
21
22
|
StartVoiceRequest,
|
|
22
23
|
StartVoiceResponse,
|
|
@@ -108,6 +109,15 @@ export interface SessionService {
|
|
|
108
109
|
* `running`. The next `user.message` reopens an ended session.
|
|
109
110
|
*/
|
|
110
111
|
end(id: string): Promise<Session>
|
|
112
|
+
/**
|
|
113
|
+
* Makes the live preview of what the session's agent builds in its sandbox
|
|
114
|
+
* reachable for the caller's browser and returns where it is. Starts the
|
|
115
|
+
* session's sandbox when it is stopped; every call returns a new address.
|
|
116
|
+
* Only the person who started the session may call it.
|
|
117
|
+
* @throws {ProteosError} 400 `session_preview_unavailable` for a session
|
|
118
|
+
* that is not on the `sandbox` runtime; 403 `sandbox_session_owner_only`.
|
|
119
|
+
*/
|
|
120
|
+
openPreview(id: string): Promise<SessionPreview>
|
|
111
121
|
/**
|
|
112
122
|
* Convenience: appends a `user.tool_result` answering a client tool the agent
|
|
113
123
|
* called (an `agent.tool_use` with `tool_kind: 'client'`). `toolUseId` is that
|
|
@@ -273,6 +283,10 @@ export class SessionServiceImpl implements SessionService {
|
|
|
273
283
|
return this.client.request<Session>('POST', `${SESSIONS_BASE_PATH}/${id}/end`)
|
|
274
284
|
}
|
|
275
285
|
|
|
286
|
+
async openPreview(id: string): Promise<SessionPreview> {
|
|
287
|
+
return this.client.request<SessionPreview>('POST', `${SESSIONS_BASE_PATH}/${id}/preview`)
|
|
288
|
+
}
|
|
289
|
+
|
|
276
290
|
async submitToolResult(
|
|
277
291
|
id: string,
|
|
278
292
|
input: { toolUseId: string; result: ResultBlock[]; outcome?: 'success' | 'error' },
|
package/src/agent/types.ts
CHANGED
|
@@ -49,10 +49,13 @@ export interface ModelConfig {
|
|
|
49
49
|
* turn going through restarts and gives the session a sandbox (long-running
|
|
50
50
|
* work; Anthropic Managed Agents today). `embedded` runs the loop inside the
|
|
51
51
|
* agent service: replies stream while the model writes them, and there is no
|
|
52
|
-
* sandbox.
|
|
53
|
-
*
|
|
52
|
+
* sandbox. `sandbox` runs a coding agent inside a sandbox that belongs to the
|
|
53
|
+
* session, as the person who owns the session and on that person's own model
|
|
54
|
+
* credential (Claude Code today). The value names the kind of runtime, not the
|
|
55
|
+
* vendor behind it, and `embedded` is about where the loop runs, not about
|
|
56
|
+
* where the chat is shown.
|
|
54
57
|
*/
|
|
55
|
-
export type AgentRuntime = 'durable' | 'embedded'
|
|
58
|
+
export type AgentRuntime = 'durable' | 'embedded' | 'sandbox'
|
|
56
59
|
|
|
57
60
|
/**
|
|
58
61
|
* A configured persona: a system prompt + model config + the skills, tools,
|
|
@@ -51,6 +51,10 @@ export const PLATFORM_ENTITIES: readonly PlatformEntity[] = [
|
|
|
51
51
|
// list/get drafts; write = propose, reject and (with the entity's own
|
|
52
52
|
// write/delete) approve.
|
|
53
53
|
{ slug: 'record-drafts', name: 'Record Drafts' },
|
|
54
|
+
// Stored SQL queries — what the Reports tab saves and shares. Scoped by
|
|
55
|
+
// default: a member with no grant reaches their own queries and those
|
|
56
|
+
// shared with them; the unscoped grant reaches every query in the org.
|
|
57
|
+
{ slug: 'queries', name: 'Queries' },
|
|
54
58
|
// Storage (storage-service)
|
|
55
59
|
{ slug: 'files', name: 'Files' },
|
|
56
60
|
// Automation (function-service)
|
|
@@ -103,6 +107,7 @@ export const PLATFORM_ENTITIES: readonly PlatformEntity[] = [
|
|
|
103
107
|
// Outbound send constraints (windows, connection limits, frequency caps) +
|
|
104
108
|
// their preset catalog.
|
|
105
109
|
{ slug: 'sending-rules', name: 'Sending Rules' },
|
|
110
|
+
{ slug: 'email-signatures', name: 'Email Signatures' },
|
|
106
111
|
// The channel_action ledger: acts through a connection that are neither a
|
|
107
112
|
// message nor a reaction (LinkedIn invitations, profile visits, InMail).
|
|
108
113
|
{ slug: 'channel-actions', name: 'Channel Actions' },
|
package/src/auth/users.ts
CHANGED
|
@@ -161,6 +161,8 @@ export interface UserService {
|
|
|
161
161
|
/**
|
|
162
162
|
* Deletes (revokes) an API key. Other services may keep accepting the key
|
|
163
163
|
* for up to their verification-cache TTL (~60s).
|
|
164
|
+
* Unlike create and list, it also works when the request is authenticated
|
|
165
|
+
* with an API key, so a key can revoke itself.
|
|
164
166
|
*
|
|
165
167
|
* @param userId - User ID, or `'me'` for the calling user
|
|
166
168
|
* @param keyId - API key ID
|
package/src/connector/types.ts
CHANGED
|
@@ -63,6 +63,8 @@ export interface Connector {
|
|
|
63
63
|
title: string
|
|
64
64
|
description?: string
|
|
65
65
|
icon?: string
|
|
66
|
+
/** Brand logo: an https URL or an app-relative path; `icon` is the fallback. */
|
|
67
|
+
logo_url?: string
|
|
66
68
|
credential_kind: CredentialKind
|
|
67
69
|
/** Every kind a connection may use; absent/empty = exactly [credential_kind]. */
|
|
68
70
|
supported_credential_kinds?: CredentialKind[]
|
|
@@ -168,6 +170,8 @@ export interface ListConnectorConnectionsQuery {
|
|
|
168
170
|
connector_key?: string
|
|
169
171
|
scope?: ConnectionScope
|
|
170
172
|
status?: ConnectionStatus
|
|
173
|
+
/** Only one user's personal connections: a user id, or `me` for the caller. */
|
|
174
|
+
owner?: string
|
|
171
175
|
}
|
|
172
176
|
|
|
173
177
|
export interface ListResponse<T> {
|
|
@@ -48,6 +48,7 @@ import type {
|
|
|
48
48
|
CreateConversationTagRequest,
|
|
49
49
|
CreateConversationTagSetRequest,
|
|
50
50
|
CreateConversationTypeRequest,
|
|
51
|
+
CreateEmailSignatureRequest,
|
|
51
52
|
CreateGlossaryTermRequest,
|
|
52
53
|
CreateSendingRuleRequest,
|
|
53
54
|
CreateToneProfileSetupRequest,
|
|
@@ -58,6 +59,7 @@ import type {
|
|
|
58
59
|
EmailDomainStatus,
|
|
59
60
|
EmailHealth,
|
|
60
61
|
EmailSender,
|
|
62
|
+
EmailSignature,
|
|
61
63
|
EmailSuppression,
|
|
62
64
|
EmailSuppressionKind,
|
|
63
65
|
EvaluateConversationTagsRequest,
|
|
@@ -86,6 +88,7 @@ import type {
|
|
|
86
88
|
ListConversationTagSetsQuery,
|
|
87
89
|
ListConversationTagsQuery,
|
|
88
90
|
ListConversationTypesQuery,
|
|
91
|
+
ListEmailSignaturesQuery,
|
|
89
92
|
ListGlossaryTermsQuery,
|
|
90
93
|
ListMeetingBotsQuery,
|
|
91
94
|
ListMessagesQuery,
|
|
@@ -103,12 +106,14 @@ import type {
|
|
|
103
106
|
MergeContactsRequest,
|
|
104
107
|
Message,
|
|
105
108
|
MessageDraftVersions,
|
|
109
|
+
MessageSignature,
|
|
106
110
|
MintCallTokenRequest,
|
|
107
111
|
MistranscribedTerm,
|
|
108
112
|
PerformChannelActionRequest,
|
|
109
113
|
PhoneNumber,
|
|
110
114
|
Reaction,
|
|
111
115
|
RecordPermissionEventRequest,
|
|
116
|
+
ResolveEmailSignatureQuery,
|
|
112
117
|
ResolveToneProfileQuery,
|
|
113
118
|
RespondChannelActionRequest,
|
|
114
119
|
Room,
|
|
@@ -139,6 +144,7 @@ import type {
|
|
|
139
144
|
UpdateConversationTagSetRequest,
|
|
140
145
|
UpdateConversationTypeRequest,
|
|
141
146
|
UpdateDraftRequest,
|
|
147
|
+
UpdateEmailSignatureRequest,
|
|
142
148
|
UpdateGlossaryTermRequest,
|
|
143
149
|
UpdatePhoneNumberRequest,
|
|
144
150
|
UpdateSendingRuleRequest,
|
|
@@ -170,6 +176,7 @@ export class ConversationClient {
|
|
|
170
176
|
readonly conversationFilters: ConversationFilterService
|
|
171
177
|
/** Outbound send constraints: windows, connection limits, frequency caps + presets. */
|
|
172
178
|
readonly sendingRules: SendingRuleService
|
|
179
|
+
readonly emailSignatures: EmailSignatureService
|
|
173
180
|
/**
|
|
174
181
|
* Channel actions: acts performed through a connection that are neither a
|
|
175
182
|
* message nor a reaction — LinkedIn invitations, profile visits, InMail.
|
|
@@ -217,6 +224,7 @@ export class ConversationClient {
|
|
|
217
224
|
this.agentListeners = new AgentListenerServiceImpl(client)
|
|
218
225
|
this.conversationFilters = new ConversationFilterServiceImpl(client)
|
|
219
226
|
this.sendingRules = new SendingRuleServiceImpl(client)
|
|
227
|
+
this.emailSignatures = new EmailSignatureServiceImpl(client)
|
|
220
228
|
this.channelActions = new ChannelActionServiceImpl(client)
|
|
221
229
|
this.channelEvents = new ChannelEventServiceImpl(client)
|
|
222
230
|
this.glossaryTerms = new GlossaryTermServiceImpl(client)
|
|
@@ -2172,6 +2180,63 @@ class SendingRuleServiceImpl implements SendingRuleService {
|
|
|
2172
2180
|
}
|
|
2173
2181
|
}
|
|
2174
2182
|
|
|
2183
|
+
/**
|
|
2184
|
+
* Email signatures: the block an email send adds below the body and above
|
|
2185
|
+
* the quote. A send, draft or draft edit picks one with its `signature`
|
|
2186
|
+
* field; without it the default applies.
|
|
2187
|
+
*/
|
|
2188
|
+
export interface EmailSignatureService {
|
|
2189
|
+
list(query?: ListEmailSignaturesQuery): Promise<ListResponse<EmailSignature>>
|
|
2190
|
+
get(id: string): Promise<EmailSignature>
|
|
2191
|
+
create(request: CreateEmailSignatureRequest): Promise<EmailSignature>
|
|
2192
|
+
update(id: string, request: UpdateEmailSignatureRequest): Promise<EmailSignature>
|
|
2193
|
+
delete(id: string): Promise<void>
|
|
2194
|
+
/** The default signature an email would get; `data` is null when none applies. */
|
|
2195
|
+
resolve(query?: ResolveEmailSignatureQuery): Promise<{ data: MessageSignature | null }>
|
|
2196
|
+
}
|
|
2197
|
+
|
|
2198
|
+
class EmailSignatureServiceImpl implements EmailSignatureService {
|
|
2199
|
+
constructor(private readonly client: ProteosClient) {}
|
|
2200
|
+
|
|
2201
|
+
list(query: ListEmailSignaturesQuery = {}): Promise<ListResponse<EmailSignature>> {
|
|
2202
|
+
return this.client.requestWithQuery('GET', `${CONVERSATION_BASE_PATH}/email-signatures`, query)
|
|
2203
|
+
}
|
|
2204
|
+
|
|
2205
|
+
get(id: string): Promise<EmailSignature> {
|
|
2206
|
+
return this.client.request(
|
|
2207
|
+
'GET',
|
|
2208
|
+
`${CONVERSATION_BASE_PATH}/email-signatures/${encodeURIComponent(id)}`,
|
|
2209
|
+
)
|
|
2210
|
+
}
|
|
2211
|
+
|
|
2212
|
+
create(request: CreateEmailSignatureRequest): Promise<EmailSignature> {
|
|
2213
|
+
return this.client.request('POST', `${CONVERSATION_BASE_PATH}/email-signatures`, request)
|
|
2214
|
+
}
|
|
2215
|
+
|
|
2216
|
+
update(id: string, request: UpdateEmailSignatureRequest): Promise<EmailSignature> {
|
|
2217
|
+
return this.client.request(
|
|
2218
|
+
'PATCH',
|
|
2219
|
+
`${CONVERSATION_BASE_PATH}/email-signatures/${encodeURIComponent(id)}`,
|
|
2220
|
+
request,
|
|
2221
|
+
)
|
|
2222
|
+
}
|
|
2223
|
+
|
|
2224
|
+
async delete(id: string): Promise<void> {
|
|
2225
|
+
await this.client.request(
|
|
2226
|
+
'DELETE',
|
|
2227
|
+
`${CONVERSATION_BASE_PATH}/email-signatures/${encodeURIComponent(id)}`,
|
|
2228
|
+
)
|
|
2229
|
+
}
|
|
2230
|
+
|
|
2231
|
+
resolve(query: ResolveEmailSignatureQuery = {}): Promise<{ data: MessageSignature | null }> {
|
|
2232
|
+
return this.client.requestWithQuery(
|
|
2233
|
+
'GET',
|
|
2234
|
+
`${CONVERSATION_BASE_PATH}/email-signatures/resolve`,
|
|
2235
|
+
query,
|
|
2236
|
+
)
|
|
2237
|
+
}
|
|
2238
|
+
}
|
|
2239
|
+
|
|
2175
2240
|
/**
|
|
2176
2241
|
* Channel actions — the ledger of acts performed through a connection that
|
|
2177
2242
|
* are neither a message nor a reaction (LinkedIn invitations, profile visits,
|
|
@@ -58,6 +58,8 @@ export type ConnectorKey =
|
|
|
58
58
|
| 'aircall'
|
|
59
59
|
| 'webhook-cti'
|
|
60
60
|
| 'sendgrid'
|
|
61
|
+
| 'microsoft-teams'
|
|
62
|
+
| 'platform-email'
|
|
61
63
|
|
|
62
64
|
/**
|
|
63
65
|
* Telephony lifecycle of one phone call, carried in the call conversation's
|
|
@@ -365,6 +367,11 @@ export interface Connection {
|
|
|
365
367
|
supports_reactions: boolean
|
|
366
368
|
/** The capability descriptor; absent when unsupported. */
|
|
367
369
|
reactions?: ReactionCapability
|
|
370
|
+
/**
|
|
371
|
+
* Computed on read: the connector sends a message's html block as the
|
|
372
|
+
* body's html part, so a composer can offer rich formatting.
|
|
373
|
+
*/
|
|
374
|
+
supports_html: boolean
|
|
368
375
|
/**
|
|
369
376
|
* Computed on read like reactions: the channel actions the connector
|
|
370
377
|
* performs through this connection (invitation, profile_visit, inmail, …).
|
|
@@ -543,6 +550,16 @@ export interface Message {
|
|
|
543
550
|
tone_profile_id?: string
|
|
544
551
|
/** The reviewer took the quoted previous message off this reply. */
|
|
545
552
|
is_quote_removed?: boolean
|
|
553
|
+
/** The signature chosen for this email. Absent means the default that applies when it is sent. May no longer resolve. */
|
|
554
|
+
signature_id?: string
|
|
555
|
+
/** This email goes out without a signature. */
|
|
556
|
+
is_signature_removed?: boolean
|
|
557
|
+
/**
|
|
558
|
+
* The signature the email carries below the body and above the quote. On a
|
|
559
|
+
* sent message, the snapshot of what went out. On a single draft read, what
|
|
560
|
+
* a send would add now. Never part of `content`.
|
|
561
|
+
*/
|
|
562
|
+
signature?: MessageSignature
|
|
546
563
|
/** The platform wrote this message (a send or a draft): its content is what the person wrote, without the quote the email carried. Absent on mail imported from the mailbox. */
|
|
547
564
|
is_sent_from_platform?: boolean
|
|
548
565
|
/** The newest entry in this draft's history; absent until its first change. */
|
|
@@ -737,6 +754,12 @@ export interface InstallConnectionResponse {
|
|
|
737
754
|
export interface SendMessageRequest {
|
|
738
755
|
/** Records the tone a draft was written in. Stored by draft; send ignores it. */
|
|
739
756
|
tone_profile_id?: string
|
|
757
|
+
/**
|
|
758
|
+
* The email signature: `default` (or omitted) for the default that applies,
|
|
759
|
+
* `none` for no signature, or a signature id. Added below the body at send,
|
|
760
|
+
* never part of `content`. Ignored on every channel but email.
|
|
761
|
+
*/
|
|
762
|
+
signature?: SignatureChoice
|
|
740
763
|
/** Reply mode: send into this existing conversation. */
|
|
741
764
|
conversation_id?: string
|
|
742
765
|
/**
|
|
@@ -853,6 +876,11 @@ export interface UpdateDraftRequest {
|
|
|
853
876
|
is_quote_removed?: boolean
|
|
854
877
|
/** Replaces the tone recorded on the draft. Omit to keep it. */
|
|
855
878
|
tone_profile_id?: string
|
|
879
|
+
/**
|
|
880
|
+
* Replaces the draft's signature choice. Omit to keep it. The response then
|
|
881
|
+
* carries the `signature` the draft now resolves to.
|
|
882
|
+
*/
|
|
883
|
+
signature?: SignatureChoice
|
|
856
884
|
/** What this edit is in the draft's history. Defaults to `edited`. */
|
|
857
885
|
version_kind?: Exclude<MessageDraftVersionKind, 'drafted'>
|
|
858
886
|
/** The reviewer's prompt behind a redraft. */
|
|
@@ -2443,6 +2471,8 @@ export type ContactAddressKind =
|
|
|
2443
2471
|
| 'email'
|
|
2444
2472
|
| 'phone'
|
|
2445
2473
|
| 'slack'
|
|
2474
|
+
/** A Microsoft Teams user's Entra object id (lowercase GUID), scoped to the tenant. */
|
|
2475
|
+
| 'teams'
|
|
2446
2476
|
/** LinkedIn's stable profile id (ACoAA… / ACwAA… / AE…) — what sending needs. */
|
|
2447
2477
|
| 'linkedin_id'
|
|
2448
2478
|
/** The `/in/<slug>` public identifier — what humans and records hold. */
|
|
@@ -3237,6 +3267,82 @@ export interface ListConversationBriefsQuery extends PaginationQuery {
|
|
|
3237
3267
|
sort?: 'asc' | 'desc'
|
|
3238
3268
|
}
|
|
3239
3269
|
|
|
3270
|
+
/** Which emails a default signature is picked for. */
|
|
3271
|
+
export type EmailSignatureAppliesTo = 'all' | 'new' | 'reply'
|
|
3272
|
+
|
|
3273
|
+
/** A send's, draft's or draft edit's pick of a signature: the default, none, or a signature id. */
|
|
3274
|
+
export type SignatureChoice = 'default' | 'none' | (string & {})
|
|
3275
|
+
|
|
3276
|
+
/**
|
|
3277
|
+
* The block an email send adds below what the person wrote and above the
|
|
3278
|
+
* quote. Belongs to one person (`owned_by`) or, without one, to the
|
|
3279
|
+
* organisation; `connection_id` ties it to one mailbox. Among the defaults a
|
|
3280
|
+
* send picks the sending mailbox's, then the sender's own, then the
|
|
3281
|
+
* organisation's.
|
|
3282
|
+
*/
|
|
3283
|
+
export interface EmailSignature {
|
|
3284
|
+
id: string
|
|
3285
|
+
org_id: string
|
|
3286
|
+
name: string
|
|
3287
|
+
/** Sanitized like every stored email html. */
|
|
3288
|
+
html: string
|
|
3289
|
+
/** The plain-text part; derived from `html` unless `is_text_custom`. */
|
|
3290
|
+
text: string
|
|
3291
|
+
is_text_custom: boolean
|
|
3292
|
+
/** The person it belongs to; absent for the organisation. */
|
|
3293
|
+
owned_by?: UserRef
|
|
3294
|
+
/** The mailbox it is tied to; absent for every mailbox. */
|
|
3295
|
+
connection_id?: string
|
|
3296
|
+
is_default: boolean
|
|
3297
|
+
applies_to: EmailSignatureAppliesTo
|
|
3298
|
+
created_at: string
|
|
3299
|
+
created_by: UserRef
|
|
3300
|
+
updated_at: string
|
|
3301
|
+
updated_by: UserRef
|
|
3302
|
+
}
|
|
3303
|
+
|
|
3304
|
+
/** A signature as one email carries it. */
|
|
3305
|
+
export interface MessageSignature {
|
|
3306
|
+
id: string
|
|
3307
|
+
name: string
|
|
3308
|
+
html: string
|
|
3309
|
+
text: string
|
|
3310
|
+
}
|
|
3311
|
+
|
|
3312
|
+
export interface CreateEmailSignatureRequest {
|
|
3313
|
+
name: string
|
|
3314
|
+
/** `html` or `text` is required. */
|
|
3315
|
+
html?: string
|
|
3316
|
+
/** Left empty, it is derived from `html`. */
|
|
3317
|
+
text?: string
|
|
3318
|
+
/** Empty or omitted makes it the organisation's. */
|
|
3319
|
+
owned_by_id?: string
|
|
3320
|
+
/** Empty or omitted makes it apply to every mailbox. */
|
|
3321
|
+
connection_id?: string
|
|
3322
|
+
/** Defaults to false. Becoming the default takes the flag off the others of the same owner, mailbox and kind. */
|
|
3323
|
+
is_default?: boolean
|
|
3324
|
+
/** Defaults to `all`. */
|
|
3325
|
+
applies_to?: EmailSignatureAppliesTo
|
|
3326
|
+
}
|
|
3327
|
+
|
|
3328
|
+
/** Omitted fields keep what is stored. `text` sent empty goes back to being derived. */
|
|
3329
|
+
export type UpdateEmailSignatureRequest = Partial<CreateEmailSignatureRequest>
|
|
3330
|
+
|
|
3331
|
+
export interface ListEmailSignaturesQuery extends PaginationQuery {
|
|
3332
|
+
owned_by_id?: string
|
|
3333
|
+
/** true: the organisation's own; false: everyone's personal ones. */
|
|
3334
|
+
is_organisation?: boolean
|
|
3335
|
+
connection_id?: string
|
|
3336
|
+
is_default?: boolean
|
|
3337
|
+
}
|
|
3338
|
+
|
|
3339
|
+
export interface ResolveEmailSignatureQuery {
|
|
3340
|
+
connection_id?: string
|
|
3341
|
+
/** Whose personal default counts; the caller when omitted. */
|
|
3342
|
+
owned_by_id?: string
|
|
3343
|
+
is_reply?: boolean
|
|
3344
|
+
}
|
|
3345
|
+
|
|
3240
3346
|
export interface SendingRule {
|
|
3241
3347
|
id: string
|
|
3242
3348
|
org_id: string
|
package/src/data/index.ts
CHANGED
|
@@ -43,12 +43,17 @@ export type { EntityIndexService } from './entity-indexes.js'
|
|
|
43
43
|
// Re-export service interfaces
|
|
44
44
|
// Re-export types
|
|
45
45
|
export type {
|
|
46
|
+
CreateQueryRequest,
|
|
47
|
+
ListQueriesQuery,
|
|
48
|
+
Query,
|
|
49
|
+
QueryBuilder,
|
|
46
50
|
QueryExecuteMeta,
|
|
47
51
|
QueryExecuteResponse,
|
|
48
52
|
QueryRow,
|
|
49
53
|
QueryService,
|
|
50
54
|
QueryValidateMeta,
|
|
51
55
|
QueryValidateResponse,
|
|
56
|
+
UpdateQueryRequest,
|
|
52
57
|
} from './queries.js'
|
|
53
58
|
export type { RecordDraftService } from './record-drafts.js'
|
|
54
59
|
export type { RecordDuplicateService, RecordService } from './records.js'
|
package/src/data/queries.ts
CHANGED
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
import type { ProteosClient } from '../client.js'
|
|
2
|
+
import type { FilterGroup } from '../meta/filters.js'
|
|
3
|
+
import type { ListResult, UserRef } from '../types/common.js'
|
|
2
4
|
|
|
3
5
|
const QUERY_BASE_PATH = '/data/v1/query'
|
|
6
|
+
const QUERIES_BASE_PATH = '/data/v1/queries'
|
|
4
7
|
|
|
5
8
|
/**
|
|
6
9
|
* A single row from a query result. Keys match the result-set columns
|
|
@@ -38,7 +41,58 @@ export interface QueryValidateResponse {
|
|
|
38
41
|
}
|
|
39
42
|
|
|
40
43
|
/**
|
|
41
|
-
*
|
|
44
|
+
* The visual editor's state for a {@link Query}: the entity it reads, the
|
|
45
|
+
* selected column paths (relation fields are prefixed with the foreign-key
|
|
46
|
+
* attribute, e.g. `accountId.name`) and the filter. It only reopens the
|
|
47
|
+
* editor — `sql` is what runs.
|
|
48
|
+
*/
|
|
49
|
+
export interface QueryBuilder {
|
|
50
|
+
entity_slug: string
|
|
51
|
+
columns: string[]
|
|
52
|
+
filter?: FilterGroup
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
/**
|
|
56
|
+
* A stored SQL query. Running it is `execute(query.sql)` as the viewer, so a
|
|
57
|
+
* query never carries data access with it. `created_by` is the owner;
|
|
58
|
+
* everyone else reaches it through a share on the `queries` slug.
|
|
59
|
+
*/
|
|
60
|
+
export interface Query {
|
|
61
|
+
id: string
|
|
62
|
+
org_id: string
|
|
63
|
+
name: string
|
|
64
|
+
sql: string
|
|
65
|
+
/** Absent for a query that was never built visually. */
|
|
66
|
+
builder?: QueryBuilder
|
|
67
|
+
/** Whether the caller may update this query. Computed per request. */
|
|
68
|
+
can_write: boolean
|
|
69
|
+
created_at: string
|
|
70
|
+
created_by: UserRef
|
|
71
|
+
updated_at: string
|
|
72
|
+
updated_by: UserRef
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
export interface CreateQueryRequest {
|
|
76
|
+
name: string
|
|
77
|
+
sql: string
|
|
78
|
+
builder?: QueryBuilder
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
/** An absent field keeps its value. */
|
|
82
|
+
export interface UpdateQueryRequest {
|
|
83
|
+
name?: string
|
|
84
|
+
sql?: string
|
|
85
|
+
builder?: QueryBuilder
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
export interface ListQueriesQuery {
|
|
89
|
+
page?: number
|
|
90
|
+
page_size?: number
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
/**
|
|
94
|
+
* Service for the query endpoints of the data-service: running raw SQL and
|
|
95
|
+
* storing queries to run again.
|
|
42
96
|
*
|
|
43
97
|
* Accepts SELECT-only Postgres SQL with bare attribute references; the
|
|
44
98
|
* server rewrites bare attributes into JSONB accessors against the
|
|
@@ -49,6 +103,17 @@ export interface QueryService {
|
|
|
49
103
|
execute(sql: string): Promise<QueryExecuteResponse>
|
|
50
104
|
/** Parses + authorizes the SQL without running it. */
|
|
51
105
|
validate(sql: string): Promise<QueryValidateResponse>
|
|
106
|
+
|
|
107
|
+
/** The caller's own queries and those shared with them, ordered by name. */
|
|
108
|
+
list(query?: ListQueriesQuery): Promise<ListResult<Query>>
|
|
109
|
+
/** 404 `query_not_found` when the caller cannot see the query. */
|
|
110
|
+
get(id: string): Promise<Query>
|
|
111
|
+
/** Stores the query; the caller becomes its owner. Nothing is executed. */
|
|
112
|
+
create(request: CreateQueryRequest): Promise<Query>
|
|
113
|
+
/** 403 `queries_write_not_permitted` when the caller can only read it. */
|
|
114
|
+
update(id: string, request: UpdateQueryRequest): Promise<Query>
|
|
115
|
+
/** Deletes the query and its shares. */
|
|
116
|
+
delete(id: string): Promise<void>
|
|
52
117
|
}
|
|
53
118
|
|
|
54
119
|
export class QueryServiceImpl implements QueryService {
|
|
@@ -63,4 +128,28 @@ export class QueryServiceImpl implements QueryService {
|
|
|
63
128
|
sql,
|
|
64
129
|
})
|
|
65
130
|
}
|
|
131
|
+
|
|
132
|
+
async list(query: ListQueriesQuery = {}): Promise<ListResult<Query>> {
|
|
133
|
+
return this.client.requestWithQuery<ListResult<Query>>('GET', QUERIES_BASE_PATH, query)
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
async get(id: string): Promise<Query> {
|
|
137
|
+
return this.client.request<Query>('GET', `${QUERIES_BASE_PATH}/${encodeURIComponent(id)}`)
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
async create(request: CreateQueryRequest): Promise<Query> {
|
|
141
|
+
return this.client.request<Query>('POST', QUERIES_BASE_PATH, request)
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
async update(id: string, request: UpdateQueryRequest): Promise<Query> {
|
|
145
|
+
return this.client.request<Query>(
|
|
146
|
+
'PATCH',
|
|
147
|
+
`${QUERIES_BASE_PATH}/${encodeURIComponent(id)}`,
|
|
148
|
+
request,
|
|
149
|
+
)
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
async delete(id: string): Promise<void> {
|
|
153
|
+
await this.client.request<void>('DELETE', `${QUERIES_BASE_PATH}/${encodeURIComponent(id)}`)
|
|
154
|
+
}
|
|
66
155
|
}
|