@opencxh/domain 1.171.0 → 1.172.2
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/entities/activity/blocks.d.ts +30 -30
- package/dist/entities/activity/catalog.d.ts +63 -86
- package/dist/entities/activity/descriptor.d.ts +31 -32
- package/dist/entities/activity/index.d.ts +2 -2
- package/dist/entities/activity/preview.d.ts +7 -7
- package/dist/entities/activity/resolve.d.ts +37 -38
- package/dist/entities/activity/types.d.ts +34 -34
- package/dist/entities/ai-account/types.d.ts +3 -3
- package/dist/entities/ai-account/vendors.d.ts +25 -32
- package/dist/entities/ai-budget/types.d.ts +12 -8
- package/dist/entities/ai-conversation/types.d.ts +12 -12
- package/dist/entities/ai-profile/types.d.ts +21 -26
- package/dist/entities/ai-settings/types.d.ts +12 -13
- package/dist/entities/analytics/dashboard.d.ts +1 -1
- package/dist/entities/analytics/index.d.ts +4 -4
- package/dist/entities/analytics/source.d.ts +1 -1
- package/dist/entities/analytics/usage.d.ts +23 -28
- package/dist/entities/artifact/blocks.d.ts +54 -69
- package/dist/entities/artifact/markdown.d.ts +2 -3
- package/dist/entities/artifact/types.d.ts +47 -55
- package/dist/entities/assignment/types.d.ts +74 -88
- package/dist/entities/calendar-event/types.d.ts +1 -1
- package/dist/entities/channel/index.d.ts +1 -1
- package/dist/entities/channel/signature.d.ts +8 -9
- package/dist/entities/communication/index.d.ts +1 -1
- package/dist/entities/communication/message-template.d.ts +1 -1
- package/dist/entities/company/types.d.ts +1 -1
- package/dist/entities/contact/index.d.ts +1 -1
- package/dist/entities/contact/provider.d.ts +2 -1
- package/dist/entities/contact/types.d.ts +1 -10
- package/dist/entities/custom-field-def/types.d.ts +14 -14
- package/dist/entities/external-identity/types.d.ts +45 -50
- package/dist/entities/interaction/index.d.ts +1 -1
- package/dist/entities/interaction/types.d.ts +44 -47
- package/dist/entities/live-lens/types.d.ts +39 -44
- package/dist/entities/mcp/types.d.ts +53 -57
- package/dist/entities/memory/alias.d.ts +7 -7
- package/dist/entities/memory/browse.d.ts +21 -21
- package/dist/entities/memory/ingest.d.ts +26 -17
- package/dist/entities/memory/item.d.ts +53 -58
- package/dist/entities/memory/kind.d.ts +26 -26
- package/dist/entities/memory/query.d.ts +49 -51
- package/dist/entities/playbook/actor.d.ts +20 -19
- package/dist/entities/playbook/assignment.d.ts +54 -63
- package/dist/entities/playbook/index.d.ts +2 -2
- package/dist/entities/playbook/labels.d.ts +4 -4
- package/dist/entities/playbook/trigger-vars.d.ts +14 -15
- package/dist/entities/playbook/types.d.ts +173 -303
- package/dist/entities/resource-reminder/types.d.ts +8 -9
- package/dist/entities/scope/actor.d.ts +16 -0
- package/dist/entities/{note → scope}/index.d.ts +1 -0
- package/dist/entities/scope/scope.test.d.ts +1 -0
- package/dist/entities/scope/types.d.ts +53 -0
- package/dist/entities/task/types.d.ts +1 -1
- package/dist/entities/time-entry/duration.d.ts +11 -11
- package/dist/entities/time-entry/types.d.ts +60 -60
- package/dist/entities/time-entry/work-type.d.ts +21 -24
- package/dist/entities/topic/examples.d.ts +26 -27
- package/dist/entities/topic/scope.d.ts +11 -12
- package/dist/entities/topic/types.d.ts +28 -28
- package/dist/entities/user/types.d.ts +24 -28
- package/dist/entities/webhook/types.d.ts +6 -6
- package/dist/entities/work/keys.d.ts +25 -26
- package/dist/entities/work/ladder.d.ts +48 -52
- package/dist/entities/work/types.d.ts +109 -115
- package/dist/index.cjs +6 -6
- package/dist/index.d.ts +29 -33
- package/dist/index.js +1391 -1254
- package/dist/platform/account.d.ts +34 -38
- package/dist/platform/ai-tools.d.ts +48 -52
- package/dist/platform/api.d.ts +9 -8
- package/dist/platform/author.d.ts +7 -9
- package/dist/platform/capabilities.d.ts +3 -3
- package/dist/platform/communication.d.ts +163 -204
- package/dist/platform/context.d.ts +8 -8
- package/dist/platform/identity.d.ts +16 -19
- package/dist/platform/kernel.d.ts +1 -1
- package/dist/platform/manifest.d.ts +2 -2
- package/dist/platform/media.d.ts +13 -15
- package/dist/platform/permission.d.ts +39 -0
- package/dist/platform/permission.test.d.ts +1 -0
- package/dist/platform/presence.d.ts +30 -30
- package/dist/platform/provider.d.ts +14 -76
- package/dist/platform/resource-source.d.ts +43 -45
- package/dist/platform/resource.d.ts +17 -23
- package/dist/platform/scope.d.ts +36 -62
- package/dist/platform/services.d.ts +4 -4
- package/dist/platform/settings.d.ts +0 -14
- package/dist/platform/storage.d.ts +2 -2
- package/dist/platform/sync-source.d.ts +196 -216
- package/dist/platform/transcript-cadence.d.ts +37 -41
- package/dist/platform/ui.d.ts +6 -6
- package/dist/text/endpoint.d.ts +11 -27
- package/package.json +3 -5
- package/dist/entities/note/types.d.ts +0 -14
- package/dist/entities/shopify/index.d.ts +0 -1
- package/dist/entities/shopify/types.d.ts +0 -79
- package/dist/platform/lifecycle.d.ts +0 -13
- package/dist/platform/reactive.d.ts +0 -13
- package/dist/platform/sdk.d.ts +0 -182
- package/dist/platform/service-registry.d.ts +0 -13
|
@@ -1,36 +1,36 @@
|
|
|
1
1
|
import { ActivityText } from './descriptor';
|
|
2
2
|
/**
|
|
3
|
-
*
|
|
3
|
+
* The blocks a declared timeline row is built from.
|
|
4
4
|
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
* (`apps/slack/server/src/thread/context-blocks.ts`).
|
|
8
|
-
*
|
|
9
|
-
*
|
|
5
|
+
* Borrowed from Slack's Block Kit: the same names and the same grammar, so anyone who once built a
|
|
6
|
+
* Slack app recognizes them — and we already write Block Kit ourselves
|
|
7
|
+
* (`apps/slack/server/src/thread/context-blocks.ts`). But not the whole catalog: Block Kit now
|
|
8
|
+
* counts 21 block types, the input-field half of which is a complete form system we already have
|
|
9
|
+
* in `ui-kit`'s `Form`.
|
|
10
10
|
*
|
|
11
|
-
*
|
|
12
|
-
*
|
|
13
|
-
*
|
|
14
|
-
*
|
|
11
|
+
* The separation that makes that possible: **the blocks describe the inside of the row, the
|
|
12
|
+
* descriptor semantics the outside.** Alignment on `direction`, the avatar, the grouping of
|
|
13
|
+
* consecutive bubbles and the timestamp stay with the host — Block Kit has no notion of those,
|
|
14
|
+
* because there a message is a standalone card.
|
|
15
15
|
*/
|
|
16
|
-
/**
|
|
16
|
+
/** Semantic colour. No free colours, so dark mode and the tokens keep working. */
|
|
17
17
|
export type ActivityTone = "info" | "success" | "warning" | "destructive";
|
|
18
18
|
export interface ActivityBadge {
|
|
19
19
|
text: ActivityText;
|
|
20
20
|
tone?: ActivityTone;
|
|
21
21
|
}
|
|
22
22
|
export interface ActivityAction {
|
|
23
|
-
/**
|
|
23
|
+
/** Stable within the row; routes the click and lets the host redraw one button. */
|
|
24
24
|
action_id: string;
|
|
25
25
|
text: ActivityText;
|
|
26
26
|
/**
|
|
27
|
-
*
|
|
27
|
+
* The route the click goes to, `"<app>.<scope>.<route>"`.
|
|
28
28
|
*
|
|
29
|
-
*
|
|
30
|
-
*
|
|
29
|
+
* Note: `sdk.http.invoke` turns every `.` into a URL `/`. An id with dots therefore belongs in
|
|
30
|
+
* {@link params} and not in the action itself.
|
|
31
31
|
*/
|
|
32
32
|
invoke: string;
|
|
33
|
-
/**
|
|
33
|
+
/** Paths into the activity; the host reads them out and sends them as the body. */
|
|
34
34
|
params?: Record<string, string>;
|
|
35
35
|
style?: "primary" | "secondary" | "destructive";
|
|
36
36
|
}
|
|
@@ -48,12 +48,12 @@ export type ActivityBlock = {
|
|
|
48
48
|
block_id?: string;
|
|
49
49
|
type: "section";
|
|
50
50
|
text?: ActivityText;
|
|
51
|
-
/**
|
|
51
|
+
/** Two-column key/value. */
|
|
52
52
|
fields?: {
|
|
53
53
|
label: ActivityText;
|
|
54
54
|
value: ActivityText;
|
|
55
55
|
}[];
|
|
56
|
-
/**
|
|
56
|
+
/** The right-hand slot. A badge for now — a button belongs in `actions`. */
|
|
57
57
|
accessory?: ActivityBadge;
|
|
58
58
|
} | {
|
|
59
59
|
block_id?: string;
|
|
@@ -70,9 +70,9 @@ export type ActivityBlock = {
|
|
|
70
70
|
alt: string;
|
|
71
71
|
}
|
|
72
72
|
/**
|
|
73
|
-
*
|
|
74
|
-
*
|
|
75
|
-
*
|
|
73
|
+
* One row per item. Came in while converting `ProposedActionCard`: that one shows a line per
|
|
74
|
+
* proposed action, and `section.fields` is a grid that cannot do it. Ticket lines and order
|
|
75
|
+
* lines run into the same thing.
|
|
76
76
|
*/
|
|
77
77
|
| {
|
|
78
78
|
block_id?: string;
|
|
@@ -83,27 +83,27 @@ export type ActivityBlock = {
|
|
|
83
83
|
type: "actions";
|
|
84
84
|
elements: ActivityAction[];
|
|
85
85
|
}
|
|
86
|
-
/**
|
|
86
|
+
/** Switch on only; the host draws `activity.attachments` and handles the downloading. */
|
|
87
87
|
| {
|
|
88
88
|
block_id?: string;
|
|
89
89
|
type: "attachments";
|
|
90
90
|
};
|
|
91
91
|
/**
|
|
92
|
-
*
|
|
93
|
-
*
|
|
92
|
+
* A timeline row of fifty blocks breaks the feed. Slack allows 50 per message; a row in a list
|
|
93
|
+
* tolerates fewer, because it sits among dozens of others.
|
|
94
94
|
*/
|
|
95
95
|
export declare const MAX_BLOCKS = 10;
|
|
96
96
|
export declare const MAX_FIELDS = 10;
|
|
97
97
|
export declare const MAX_LIST_ITEMS = 10;
|
|
98
98
|
export declare const MAX_ACTIONS = 5;
|
|
99
99
|
/**
|
|
100
|
-
*
|
|
100
|
+
* Prunes a declared block list down to something the feed can safely draw.
|
|
101
101
|
*
|
|
102
|
-
*
|
|
103
|
-
*
|
|
104
|
-
*
|
|
102
|
+
* Refusing instead of truncating would make the whole row disappear over one bad block; this
|
|
103
|
+
* keeps the rest. Runs while composing the catalog, so a wrong declaration is reported once
|
|
104
|
+
* instead of on every render.
|
|
105
105
|
*
|
|
106
|
-
* `onDrop`
|
|
107
|
-
*
|
|
106
|
+
* `onDrop` is told what fell away — silent pruning makes "why is my button missing?"
|
|
107
|
+
* unanswerable.
|
|
108
108
|
*/
|
|
109
109
|
export declare function normalizeBlocks(blocks: unknown, onDrop?: (reason: string) => void): ActivityBlock[];
|
|
@@ -1,99 +1,79 @@
|
|
|
1
1
|
import { Activity, ActivityType } from './types';
|
|
2
2
|
/**
|
|
3
|
-
*
|
|
3
|
+
* Single source of truth for what an activity type *means* and how it reads as text.
|
|
4
4
|
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
*
|
|
12
|
-
* Daarnaast werd de kanaalsoort geraden uit het type-voorvoegsel (`startsWith("EMAIL")`),
|
|
13
|
-
* op de server én — als losse regex — in de playbook-editor.
|
|
14
|
-
*
|
|
15
|
-
* Deze catalogus is bewust een platte declaratie en geen gedragslaag: hij beantwoordt
|
|
16
|
-
* vragen over een type, hij voert niets uit. De tekstfuncties zijn letterlijk verplaatst
|
|
17
|
-
* uit `preview.ts` en `TimelineEvent.tsx`, niet herschreven — de uitvoer is byte-identiek.
|
|
5
|
+
* "Is this a real message?" used to live in six places (summarize, lastMessagePreview,
|
|
6
|
+
* attentionScore, reply-to-interaction, analytics rollup, playbook dry-run), each with a
|
|
7
|
+
* slightly different list — a forgotten spot failed *silently*. Channel kind was guessed
|
|
8
|
+
* from the type prefix (`startsWith("EMAIL")`), on the server and as a regex in the
|
|
9
|
+
* playbook editor. Deliberately a flat declaration, not a behavior layer: it answers
|
|
10
|
+
* questions about a type, executes nothing. The text functions were moved verbatim from
|
|
11
|
+
* `preview.ts` and `TimelineEvent.tsx` — output is byte-identical.
|
|
18
12
|
*/
|
|
19
13
|
/**
|
|
20
|
-
*
|
|
21
|
-
*
|
|
22
|
-
* - `
|
|
23
|
-
* - `
|
|
24
|
-
* - `
|
|
25
|
-
* - `event` — een gebeurtenis zonder eigen inhoud (gesprek gestart, status gewijzigd).
|
|
14
|
+
* What kind of thing is this on the timeline?
|
|
15
|
+
* - `message` — to/from the counterparty, with a readable body.
|
|
16
|
+
* - `note` — internal text, visible to colleagues but not the counterparty.
|
|
17
|
+
* - `artifact` — attached content that is not a message (file, transcript).
|
|
18
|
+
* - `event` — an occurrence without content of its own (call started, status changed).
|
|
26
19
|
*/
|
|
27
20
|
export type ActivityShape = "message" | "note" | "artifact" | "event";
|
|
28
|
-
/**
|
|
21
|
+
/** Channel kind; previously guessed from the type prefix. */
|
|
29
22
|
export type ActivityChannelKind = "mail" | "chat" | "voice" | "video";
|
|
30
|
-
/**
|
|
23
|
+
/** The arm of the `Activity` union for exactly this type. */
|
|
31
24
|
type ActivityOf<T extends ActivityType> = Extract<Activity, {
|
|
32
25
|
type: T;
|
|
33
26
|
}>;
|
|
34
27
|
interface ActivityTypeInfo<T extends ActivityType = ActivityType> {
|
|
35
28
|
shape: ActivityShape;
|
|
36
29
|
channelKind?: ActivityChannelKind;
|
|
37
|
-
/** Lucide
|
|
30
|
+
/** Lucide icon name, shared by web and mobile. */
|
|
38
31
|
icon: string;
|
|
39
32
|
/**
|
|
40
|
-
*
|
|
41
|
-
*
|
|
33
|
+
* Can a human reply to it? An internal note carries text but is not a replyable
|
|
34
|
+
* message — hence its own flag, not derived from `shape`.
|
|
42
35
|
*/
|
|
43
36
|
replyable?: boolean;
|
|
44
|
-
/**
|
|
37
|
+
/** Counts as an in-/outbound message in the analytics rollup. */
|
|
45
38
|
countsAs?: "inbound_message" | "outbound_message";
|
|
46
39
|
/**
|
|
47
|
-
*
|
|
48
|
-
*
|
|
49
|
-
* leesbare inhoud.
|
|
40
|
+
* Carries human-written text worth feeding to a model. Broader than
|
|
41
|
+
* `shape === "message"`: a transcript is an artifact but still readable content.
|
|
50
42
|
*/
|
|
51
43
|
carriesText?: boolean;
|
|
52
|
-
/**
|
|
44
|
+
/** Written by the engine itself; must not open a new playbook run. */
|
|
53
45
|
playbookAuthored?: boolean;
|
|
54
46
|
/**
|
|
55
|
-
*
|
|
56
|
-
*
|
|
57
|
-
*
|
|
58
|
-
*
|
|
59
|
-
*
|
|
60
|
-
* `event` — het verschil zit in de betekenis, niet in de vorm.
|
|
61
|
-
*
|
|
62
|
-
* Bewust hier en niet als lijstje in de app die de vraag stelt: dat is precies hoe "is dit een
|
|
63
|
-
* bericht?" zes keer los kwam te staan.
|
|
47
|
+
* Did actual contact happen — was there a conversation? Not derivable from messages
|
|
48
|
+
* alone: an answered phone call is a full case with zero messages, a missed call is
|
|
49
|
+
* the opposite. Its own flag, not derived from `shape` — both are `event`; the
|
|
50
|
+
* difference is meaning, not form. Deliberately declared here, not as a list in the
|
|
51
|
+
* asking app: that is exactly how "is this a message?" ended up in six places.
|
|
64
52
|
*/
|
|
65
53
|
connected?: boolean;
|
|
66
54
|
/**
|
|
67
|
-
*
|
|
68
|
-
*
|
|
69
|
-
*
|
|
70
|
-
* playbook hangen. Dit zijn exact de vijf die de builder tot nu toe hardcodeerde, nu op
|
|
71
|
-
* de plek waar een app zijn eigen type er ook aan toe kan voegen.
|
|
55
|
+
* Appears in the playbook/webhook trigger picker. Not every type is a sensible start
|
|
56
|
+
* signal; these are exactly the five the builder used to hardcode, now in the place
|
|
57
|
+
* where an app can add its own type too.
|
|
72
58
|
*/
|
|
73
59
|
triggerable?: boolean;
|
|
74
60
|
/**
|
|
75
|
-
*
|
|
76
|
-
* {@link triggerable}
|
|
61
|
+
* Translation key for the name in a picker. Only needed once a type is
|
|
62
|
+
* {@link triggerable}.
|
|
77
63
|
*/
|
|
78
64
|
displayNameKey?: string;
|
|
79
65
|
/**
|
|
80
|
-
*
|
|
81
|
-
*
|
|
82
|
-
*
|
|
83
|
-
*
|
|
84
|
-
* als een helpdesk-app die `helpdesk:TicketActivity` meebrengt. Zou dit een aparte
|
|
85
|
-
* lijst in de comms-app zijn, dan zou dat pad alleen door vreemde apps gedragen worden
|
|
86
|
-
* en zouden de gaten erin pas bij de eerste externe bouwer opvallen.
|
|
87
|
-
*
|
|
88
|
-
* Spiegelt `TransportConfig.ui.canvas`, dat op dezelfde manier naar
|
|
89
|
-
* `communication:CallCanvas` wijst.
|
|
66
|
+
* Custom feed component, as `"<app>:<Resource>"`. Deliberately the same field an
|
|
67
|
+
* external app sets in its descriptor: our own rich types run through exactly the
|
|
68
|
+
* resolver a foreign `helpdesk:TicketActivity` would, so gaps surface before the
|
|
69
|
+
* first external builder hits them. Mirrors `TransportConfig.ui.canvas`.
|
|
90
70
|
*/
|
|
91
71
|
component?: `${string}:${string}`;
|
|
92
|
-
/**
|
|
72
|
+
/** Inbox-list line. Moved from `preview.ts`. */
|
|
93
73
|
snippet?: (activity: ActivityOf<T>) => string;
|
|
94
|
-
/**
|
|
74
|
+
/** Timeline line. Moved from `TimelineEvent.tsx`. */
|
|
95
75
|
timeline?: (activity: ActivityOf<T>, authorName: string) => string;
|
|
96
|
-
/**
|
|
76
|
+
/** Join button on the timeline line. Moved from `TimelineEvent.tsx`. */
|
|
97
77
|
joinUrl?: (activity: ActivityOf<T>) => string | undefined;
|
|
98
78
|
}
|
|
99
79
|
export declare function stripHtml(input: string): string;
|
|
@@ -101,54 +81,51 @@ type Catalog = {
|
|
|
101
81
|
[T in ActivityType]: ActivityTypeInfo<T>;
|
|
102
82
|
};
|
|
103
83
|
export declare const ACTIVITY_CATALOG: Catalog;
|
|
104
|
-
/**
|
|
84
|
+
/** Unknown types (from an app that has not declared its type yet) return `undefined`. */
|
|
105
85
|
export declare function activityTypeInfo(type: string): ActivityTypeInfo | undefined;
|
|
106
|
-
/** Lucide
|
|
86
|
+
/** Lucide icon name; `circle` for unknown types. */
|
|
107
87
|
export declare function activityIconOf(type: string): string;
|
|
108
|
-
/** `mail` | `chat` | `voice` | `video`,
|
|
88
|
+
/** `mail` | `chat` | `voice` | `video`, or `undefined` for a lifecycle event. */
|
|
109
89
|
export declare function channelKindOf(type: string): ActivityChannelKind | undefined;
|
|
110
90
|
/**
|
|
111
|
-
*
|
|
112
|
-
* "
|
|
91
|
+
* Does this shape carry a message or internal note — human-written text that counts as
|
|
92
|
+
* "the conversation"? Excludes transcripts: text, but not messages.
|
|
113
93
|
*
|
|
114
|
-
*
|
|
115
|
-
*
|
|
116
|
-
* `ActivityTypeRegistry.isMessage`
|
|
117
|
-
*
|
|
118
|
-
* precies hoe er twaalf hardgecodeerde typelijstjes door de codebase zijn ontstaan.
|
|
94
|
+
* Keyed on the **shape**, not the type, so exactly one definition of "is this a message"
|
|
95
|
+
* exists. {@link isMessageType} answers it for the built-in types;
|
|
96
|
+
* `ActivityTypeRegistry.isMessage` for app-declared ones. Without that split each would
|
|
97
|
+
* have grown its own copy of the rule — how the hardcoded type lists arose before.
|
|
119
98
|
*/
|
|
120
99
|
export declare function isMessageShape(shape: ActivityShape | undefined): boolean;
|
|
121
|
-
/**
|
|
100
|
+
/** See {@link isMessageShape}. For the built-in types. */
|
|
122
101
|
export declare function isMessageType(type: string): boolean;
|
|
123
|
-
/**
|
|
102
|
+
/** Can a human reply to it? Not to notes — those go nowhere. */
|
|
124
103
|
export declare function isReplyableType(type: string): boolean;
|
|
125
104
|
/**
|
|
126
|
-
*
|
|
127
|
-
* {@link isMessageType},
|
|
105
|
+
* Readable content for a model: messages, notes, and transcripts. Broader than
|
|
106
|
+
* {@link isMessageType}, and that difference is deliberate — see the playbook dry-run.
|
|
128
107
|
*/
|
|
129
108
|
export declare function carriesText(type: string): boolean;
|
|
130
|
-
/**
|
|
109
|
+
/** Counts as an in- or outbound message in the analytics rollup. */
|
|
131
110
|
export declare function messageCountsAs(type: string): "inbound_message" | "outbound_message" | undefined;
|
|
132
|
-
/**
|
|
111
|
+
/** Written by the playbook engine itself; must not open a new run. */
|
|
133
112
|
export declare function isPlaybookAuthoredType(type: string): boolean;
|
|
134
|
-
/**
|
|
113
|
+
/** Did this type establish actual contact? See {@link ActivityTypeInfo.connected}. */
|
|
135
114
|
export declare function isConnectedType(type: string): boolean;
|
|
136
115
|
/**
|
|
137
|
-
*
|
|
138
|
-
*
|
|
139
|
-
*
|
|
140
|
-
*
|
|
141
|
-
* transcript van een externe provider mee zodra die app zijn type declareert, zonder dat hier een
|
|
142
|
-
* naam bij hoeft.
|
|
116
|
+
* Transcript-like artifact — attached content that carries readable text. Not a new
|
|
117
|
+
* list but a combination of two existing catalog answers (`FILE_UPLOADED` carries no
|
|
118
|
+
* text), so an external provider's transcript counts as soon as its app declares the
|
|
119
|
+
* type, without adding a name here.
|
|
143
120
|
*/
|
|
144
121
|
export declare function isTranscriptType(type: string): boolean;
|
|
145
|
-
/**
|
|
122
|
+
/** The inbox-list line, or `""` when the type has none. */
|
|
146
123
|
export declare function activitySnippet(activity: Activity): string;
|
|
147
124
|
/**
|
|
148
|
-
*
|
|
149
|
-
*
|
|
125
|
+
* The timeline line. Falls back to the de-underscored type — what the feed does today
|
|
126
|
+
* for any type without its own text.
|
|
150
127
|
*/
|
|
151
128
|
export declare function activityTimelineText(activity: Activity, authorName: string): string;
|
|
152
|
-
/**
|
|
129
|
+
/** Join link on the timeline line, when the type carries one. */
|
|
153
130
|
export declare function activityJoinUrl(activity: Activity): string | undefined;
|
|
154
131
|
export {};
|
|
@@ -2,27 +2,26 @@ import { LocaleBundle } from '../analytics/dashboard';
|
|
|
2
2
|
import { ActivityBlock } from './blocks';
|
|
3
3
|
import { ActivityChannelKind, ActivityShape } from './catalog';
|
|
4
4
|
/**
|
|
5
|
-
*
|
|
5
|
+
* What an app declares about its own activity kind.
|
|
6
6
|
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
7
|
+
* The JSON counterpart of `ActivityTypeInfo`: the same questions, but over the wire. Where the
|
|
8
|
+
* built-in catalog uses functions for its texts, a declared type uses a translation key plus
|
|
9
|
+
* parameters — a function does not survive an HTTP hop, and a literal sentence cannot be
|
|
10
|
+
* translated.
|
|
11
11
|
*/
|
|
12
12
|
/**
|
|
13
|
-
*
|
|
13
|
+
* A piece of text in a descriptor.
|
|
14
14
|
*
|
|
15
|
-
*
|
|
15
|
+
* Two shapes, because there are two kinds of text:
|
|
16
16
|
*
|
|
17
|
-
* - **chrome** —
|
|
18
|
-
*
|
|
19
|
-
*
|
|
20
|
-
*
|
|
21
|
-
*
|
|
22
|
-
* vertalen, dus een pad naar de waarde in de activity.
|
|
17
|
+
* - **chrome** — written by the app ("Ticket #{number} created"). Translatable, so a key with
|
|
18
|
+
* parameters. The placeholders sit *inside* the translated sentence, so word order may differ
|
|
19
|
+
* per language; gluing the text around them is exactly what breaks.
|
|
20
|
+
* - **data** — typed by a person (the ticket's subject). Nothing to translate, so a path to the
|
|
21
|
+
* value in the activity.
|
|
23
22
|
*
|
|
24
|
-
* `format`
|
|
25
|
-
* renderer
|
|
23
|
+
* `format` decides whether the view takes the text as plain text or runs it through the rich
|
|
24
|
+
* renderer. Never guessed: it sits on the text object itself.
|
|
26
25
|
*/
|
|
27
26
|
export type ActivityText = string | {
|
|
28
27
|
key: string;
|
|
@@ -33,55 +32,55 @@ export type ActivityText = string | {
|
|
|
33
32
|
format?: "plain" | "rich";
|
|
34
33
|
};
|
|
35
34
|
export interface ActivityTypeDescriptor {
|
|
36
|
-
/**
|
|
35
|
+
/** Flat and app-prefixed, e.g. `HELPDESK_TICKET_ADDED`. */
|
|
37
36
|
type: string;
|
|
38
|
-
/**
|
|
37
|
+
/** Translation key for this type's name (pickers, filters). */
|
|
39
38
|
displayNameKey: string;
|
|
40
|
-
/** Lucide
|
|
39
|
+
/** Lucide icon name; works on web and native. */
|
|
41
40
|
icon?: string;
|
|
42
41
|
shape: ActivityShape;
|
|
43
42
|
channelKind?: ActivityChannelKind;
|
|
44
43
|
replyable?: boolean;
|
|
45
44
|
countsAs?: "inbound_message" | "outbound_message";
|
|
46
45
|
carriesText?: boolean;
|
|
47
|
-
/**
|
|
46
|
+
/** Appears in the trigger picker of playbooks and webhooks. */
|
|
48
47
|
triggerable?: boolean;
|
|
49
48
|
/**
|
|
50
|
-
*
|
|
51
|
-
*
|
|
49
|
+
* The line for the inbox list, the search index and the assistant. **Always plain text**,
|
|
50
|
+
* regardless of how the row looks: markup here leaks into places that cannot render markup.
|
|
52
51
|
*/
|
|
53
52
|
text?: ActivityText;
|
|
54
53
|
/**
|
|
55
|
-
*
|
|
56
|
-
*
|
|
54
|
+
* Declarative blocks for the feed. Renders on web and mobile, because no bundle is involved —
|
|
55
|
+
* and the host keeps the alignment, the avatar and the timestamp.
|
|
57
56
|
*/
|
|
58
57
|
render?: ActivityBlock[];
|
|
59
58
|
/**
|
|
60
|
-
*
|
|
61
|
-
*
|
|
59
|
+
* Own component for the feed, `"<app>:<Resource>"`. **Web only**: native has no module
|
|
60
|
+
* federation, so there the row falls back to {@link render} or {@link text}.
|
|
62
61
|
*/
|
|
63
62
|
component?: `${string}:${string}`;
|
|
64
63
|
}
|
|
65
|
-
/**
|
|
64
|
+
/** What the comms app returns to the client: the declared types plus their translations. */
|
|
66
65
|
export interface ActivityTypeCatalog {
|
|
67
66
|
types: ActivityTypeDescriptor[];
|
|
68
67
|
locales: LocaleBundle;
|
|
69
68
|
}
|
|
70
|
-
/**
|
|
69
|
+
/** What an `activity-source` returns on `GET /provider/activity-types/describe`. */
|
|
71
70
|
export interface ActivityTypeSourceDescription {
|
|
72
71
|
types: ActivityTypeDescriptor[];
|
|
73
72
|
locales?: LocaleBundle;
|
|
74
73
|
}
|
|
75
|
-
/**
|
|
74
|
+
/** Reads `payload.number` / `author.name` from an object; returns "" when the path is absent. */
|
|
76
75
|
export declare function readPath(source: unknown, path: string): string;
|
|
77
76
|
/**
|
|
78
|
-
*
|
|
77
|
+
* Resolves an `ActivityText` against an activity.
|
|
79
78
|
*
|
|
80
|
-
*
|
|
81
|
-
*
|
|
79
|
+
* Returns `null` when there is nothing to show, so the caller can fall back instead of drawing an
|
|
80
|
+
* empty line.
|
|
82
81
|
*/
|
|
83
82
|
export declare function resolveActivityText(text: ActivityText | undefined, activity: unknown, translate: (key: string, params?: Record<string, string>) => string): string | null;
|
|
84
|
-
/**
|
|
83
|
+
/** The parameters an `ActivityText` reads from the activity — for a stored preview. */
|
|
85
84
|
export declare function activityTextParams(text: ActivityText | undefined, activity: unknown): {
|
|
86
85
|
key: string;
|
|
87
86
|
params: Record<string, string>;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
export * from './types';
|
|
2
1
|
export * from './blocks';
|
|
3
2
|
export * from './catalog';
|
|
4
3
|
export * from './descriptor';
|
|
5
|
-
export * from './resolve';
|
|
6
4
|
export * from './preview';
|
|
5
|
+
export * from './resolve';
|
|
7
6
|
export * from './seen';
|
|
8
7
|
export * from './timestamp';
|
|
8
|
+
export * from './types';
|
|
@@ -2,14 +2,14 @@ import { ActivityPreview } from '../interaction/types';
|
|
|
2
2
|
import { ActivityTypeDescriptor } from './descriptor';
|
|
3
3
|
import { Activity } from './types';
|
|
4
4
|
/**
|
|
5
|
-
*
|
|
5
|
+
* The line under the sender in the inbox list.
|
|
6
6
|
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
7
|
+
* The per-type text itself lives in {@link ACTIVITY_CATALOG}, not here: the same question was
|
|
8
|
+
* answered separately in six places and drifted apart. Only what is really about the *preview*
|
|
9
|
+
* stays here — the length limit and the fields that land on the interaction.
|
|
10
10
|
*
|
|
11
|
-
* `descriptor` is
|
|
12
|
-
*
|
|
13
|
-
*
|
|
11
|
+
* `descriptor` is there for types an app brought itself. Those carry a translation key instead of
|
|
12
|
+
* a sentence, and that key is stored along: the preview is computed once server-side, but every
|
|
13
|
+
* reader has their own language.
|
|
14
14
|
*/
|
|
15
15
|
export declare function buildActivityPreview(activity: Activity, descriptor?: ActivityTypeDescriptor): ActivityPreview;
|