@tappify/extension-sdk 2.1.0-beta.2 → 2.1.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/README.md +18 -54
- package/dist/{chunk-6HETNZJY.cjs → chunk-2DBSVKAU.cjs} +1 -1
- package/dist/{chunk-6HETNZJY.cjs.map → chunk-2DBSVKAU.cjs.map} +1 -1
- package/dist/{chunk-O357OJXL.cjs → chunk-3YWVYA42.cjs} +18 -14
- package/dist/chunk-3YWVYA42.cjs.map +1 -0
- package/dist/{chunk-GAUZYBXE.cjs → chunk-5AAPD5WV.cjs} +11 -11
- package/dist/chunk-5AAPD5WV.cjs.map +1 -0
- package/dist/{chunk-SGEYDV3K.mjs → chunk-BDCX6LRQ.mjs} +3 -3
- package/dist/chunk-BDCX6LRQ.mjs.map +1 -0
- package/dist/{chunk-KZ5NGFUP.mjs → chunk-C3YNVHBP.mjs} +7 -20
- package/dist/chunk-C3YNVHBP.mjs.map +1 -0
- package/dist/{chunk-QXD7WVKK.mjs → chunk-CSTYBKZC.mjs} +1 -1
- package/dist/chunk-CSTYBKZC.mjs.map +1 -0
- package/dist/{chunk-SWG7CNTZ.mjs → chunk-CTSZ5D7S.mjs} +5 -9
- package/dist/chunk-CTSZ5D7S.mjs.map +1 -0
- package/dist/chunk-EW54H7CR.cjs +722 -0
- package/dist/chunk-EW54H7CR.cjs.map +1 -0
- package/dist/chunk-EX3NFXDK.mjs +722 -0
- package/dist/chunk-EX3NFXDK.mjs.map +1 -0
- package/dist/{chunk-A74HCO6T.cjs → chunk-G7XZSN2Q.cjs} +18 -31
- package/dist/chunk-G7XZSN2Q.cjs.map +1 -0
- package/dist/{chunk-RBIQT75L.mjs → chunk-GG3IX52W.mjs} +2 -2
- package/dist/{chunk-SLGOHIBL.mjs → chunk-IGK2AP6J.mjs} +17 -13
- package/dist/chunk-IGK2AP6J.mjs.map +1 -0
- package/dist/{chunk-VV7ELNRW.cjs → chunk-JMUK3K47.cjs} +3 -3
- package/dist/{chunk-VV7ELNRW.cjs.map → chunk-JMUK3K47.cjs.map} +1 -1
- package/dist/{chunk-SGCYEEXD.mjs → chunk-MNDVYPEP.mjs} +2 -9
- package/dist/chunk-MNDVYPEP.mjs.map +1 -0
- package/dist/{chunk-BPCGXXMD.cjs → chunk-NFUPPCX4.cjs} +18 -22
- package/dist/chunk-NFUPPCX4.cjs.map +1 -0
- package/dist/{chunk-PRCZMOLD.cjs → chunk-OPPYEA7F.cjs} +3 -3
- package/dist/{chunk-PRCZMOLD.cjs.map → chunk-OPPYEA7F.cjs.map} +1 -1
- package/dist/{chunk-7YKH4LZN.cjs → chunk-PYJMJF44.cjs} +2 -9
- package/dist/chunk-PYJMJF44.cjs.map +1 -0
- package/dist/{chunk-QA5AL3VZ.mjs → chunk-QHM7XNRK.mjs} +2 -2
- package/dist/{chunk-QA5AL3VZ.mjs.map → chunk-QHM7XNRK.mjs.map} +1 -1
- package/dist/codegen.cjs.map +1 -1
- package/dist/codegen.d.cts +7 -43
- package/dist/codegen.d.ts +7 -43
- package/dist/codegen.mjs.map +1 -1
- package/dist/{constants-Bh759FUI.d.cts → constants-DJ_KgZpN.d.cts} +8 -44
- package/dist/{constants-Bh759FUI.d.ts → constants-DJ_KgZpN.d.ts} +8 -44
- package/dist/{context-mr8R5CNt.d.ts → context-Dt6xh_5t.d.cts} +4 -5
- package/dist/{context-DI0EJCRD.d.cts → context-Ml7k_V14.d.ts} +4 -5
- package/dist/{errors-Cqh0wrqt.d.ts → errors-COsBh7kd.d.cts} +2 -3
- package/dist/{errors-Cqh0wrqt.d.cts → errors-COsBh7kd.d.ts} +2 -3
- package/dist/handler-CZIlZ5vu.d.ts +227 -0
- package/dist/handler-kU9Jf36K.d.cts +227 -0
- package/dist/host.cjs +4 -4
- package/dist/host.d.cts +4 -4
- package/dist/host.d.ts +4 -4
- package/dist/host.mjs +3 -3
- package/dist/index.cjs +34 -5
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +627 -69
- package/dist/index.d.ts +627 -69
- package/dist/index.mjs +33 -4
- package/dist/manifest.cjs +24 -136
- package/dist/manifest.cjs.map +1 -1
- package/dist/manifest.d.cts +12 -97
- package/dist/manifest.d.ts +12 -97
- package/dist/manifest.mjs +10 -122
- package/dist/manifest.mjs.map +1 -1
- package/dist/server.cjs +66 -14
- package/dist/server.cjs.map +1 -1
- package/dist/server.d.cts +6 -6
- package/dist/server.d.ts +6 -6
- package/dist/server.mjs +61 -9
- package/dist/server.mjs.map +1 -1
- package/dist/styles.css +367 -0
- package/dist/testing/index.cjs +13 -72
- package/dist/testing/index.cjs.map +1 -1
- package/dist/testing/index.d.cts +10 -29
- package/dist/testing/index.d.ts +10 -29
- package/dist/testing/index.mjs +13 -72
- package/dist/testing/index.mjs.map +1 -1
- package/dist/testing/jest.cjs +5 -5
- package/dist/testing/jest.mjs +2 -2
- package/dist/testing/vitest.cjs +5 -5
- package/dist/testing/vitest.cjs.map +1 -1
- package/dist/testing/vitest.d.cts +0 -10
- package/dist/testing/vitest.d.ts +0 -10
- package/dist/testing/vitest.mjs +2 -2
- package/dist/testing/vitest.mjs.map +1 -1
- package/dist/{types-uGHrRaOj.d.ts → types-DDAGLpov.d.ts} +3 -4
- package/dist/{types-BdDaLnqs.d.cts → types-DrpQSv_2.d.cts} +3 -4
- package/dist/vite-preview.cjs +125 -294
- package/dist/vite-preview.cjs.map +1 -1
- package/dist/vite-preview.d.cts +24 -6
- package/dist/vite-preview.d.ts +24 -6
- package/dist/vite-preview.mjs +118 -287
- package/dist/vite-preview.mjs.map +1 -1
- package/dist/vite.cjs +24 -137
- package/dist/vite.cjs.map +1 -1
- package/dist/vite.d.cts +7 -43
- package/dist/vite.d.ts +7 -43
- package/dist/vite.mjs +18 -131
- package/dist/vite.mjs.map +1 -1
- package/package.json +2 -12
- package/schema/extension-v2.json +121 -440
- package/dist/chunk-2CY5HVY7.mjs +0 -59
- package/dist/chunk-2CY5HVY7.mjs.map +0 -1
- package/dist/chunk-7YKH4LZN.cjs.map +0 -1
- package/dist/chunk-A74HCO6T.cjs.map +0 -1
- package/dist/chunk-BPCGXXMD.cjs.map +0 -1
- package/dist/chunk-EB5XWQAU.cjs +0 -132
- package/dist/chunk-EB5XWQAU.cjs.map +0 -1
- package/dist/chunk-GAUZYBXE.cjs.map +0 -1
- package/dist/chunk-KZ5NGFUP.mjs.map +0 -1
- package/dist/chunk-O357OJXL.cjs.map +0 -1
- package/dist/chunk-ONJMPO3P.cjs +0 -59
- package/dist/chunk-ONJMPO3P.cjs.map +0 -1
- package/dist/chunk-QJMZRV7A.mjs +0 -132
- package/dist/chunk-QJMZRV7A.mjs.map +0 -1
- package/dist/chunk-QXD7WVKK.mjs.map +0 -1
- package/dist/chunk-SGCYEEXD.mjs.map +0 -1
- package/dist/chunk-SGEYDV3K.mjs.map +0 -1
- package/dist/chunk-SLGOHIBL.mjs.map +0 -1
- package/dist/chunk-SWG7CNTZ.mjs.map +0 -1
- package/dist/client-BO3kavn0.d.ts +0 -25
- package/dist/client-DE-vMgdO.d.cts +0 -25
- package/dist/ui/styles.css +0 -740
- package/dist/ui.cjs +0 -1018
- package/dist/ui.cjs.map +0 -1
- package/dist/ui.d.cts +0 -231
- package/dist/ui.d.ts +0 -231
- package/dist/ui.mjs +0 -1018
- package/dist/ui.mjs.map +0 -1
- package/dist/vite-preview-bootstrap.cjs +0 -66
- package/dist/vite-preview-bootstrap.cjs.map +0 -1
- package/dist/vite-preview-bootstrap.d.cts +0 -15
- package/dist/vite-preview-bootstrap.d.ts +0 -15
- package/dist/vite-preview-bootstrap.mjs +0 -66
- package/dist/vite-preview-bootstrap.mjs.map +0 -1
- package/dist/work-events-BlOVpK0k.d.ts +0 -547
- package/dist/work-events-D97EoqvS.d.cts +0 -547
- /package/dist/{chunk-RBIQT75L.mjs.map → chunk-GG3IX52W.mjs.map} +0 -0
|
@@ -1,547 +0,0 @@
|
|
|
1
|
-
import { JSONWebKeySet } from 'jose';
|
|
2
|
-
import { K as TapPlatformFilter, a as TapFilters, w as TapCredentialValues, $ as TapSettingsValues, ab as ToolId, ac as ToolInput, A as ActionId, k as ActionInput, f as TapProcedureName, g as TapProcedureInput, h as TapProcedureOutput, c as TapHostEvents } from './types-uGHrRaOj.js';
|
|
3
|
-
import { a9 as WorkContribution } from './constants-Bh759FUI.js';
|
|
4
|
-
|
|
5
|
-
/** The provider stage used by the manifest's legacy status mapping. */
|
|
6
|
-
type WorkStage = keyof NonNullable<NonNullable<WorkContribution['status']>['map']>;
|
|
7
|
-
/** JSON-safe values supplied for provider create fields. */
|
|
8
|
-
type WorkCreateFieldValues = Record<string, string | number | boolean | string[] | null>;
|
|
9
|
-
/** Logical mutation identity, stable across transport retries. */
|
|
10
|
-
interface WorkMutationInput {
|
|
11
|
-
idempotencyKey: string;
|
|
12
|
-
/** The source occurrence time as an ISO 8601 string. */
|
|
13
|
-
occurredAt: string;
|
|
14
|
-
}
|
|
15
|
-
/** A provider destination available to this install's credentials. */
|
|
16
|
-
interface WorkContainer {
|
|
17
|
-
id: string;
|
|
18
|
-
label: string;
|
|
19
|
-
url?: string;
|
|
20
|
-
parentId?: string;
|
|
21
|
-
}
|
|
22
|
-
/** An exact provider status and its normalized Review stage. */
|
|
23
|
-
interface WorkStatus {
|
|
24
|
-
id: string;
|
|
25
|
-
label: string;
|
|
26
|
-
/** Both open and in_progress represent an open Review thread. */
|
|
27
|
-
stage: WorkStage;
|
|
28
|
-
}
|
|
29
|
-
/** Provision or rotate the install's dedicated work-event callback. */
|
|
30
|
-
interface WorkConfigureInput extends WorkMutationInput {
|
|
31
|
-
callbackUrl: string;
|
|
32
|
-
/** Store encrypted with the install's provider webhook routing record. */
|
|
33
|
-
secret: string;
|
|
34
|
-
generation: number;
|
|
35
|
-
configurationRevision: number;
|
|
36
|
-
containerId: string;
|
|
37
|
-
itemTypeId: string;
|
|
38
|
-
fields: WorkCreateFieldValues;
|
|
39
|
-
openStatusId: string;
|
|
40
|
-
resolvedStatusId: string;
|
|
41
|
-
commentsEnabled: boolean;
|
|
42
|
-
}
|
|
43
|
-
/** Callback generation acknowledged by the provider and its webhook registrations. */
|
|
44
|
-
interface WorkConfigureResult {
|
|
45
|
-
generation: number;
|
|
46
|
-
configurationRevision: number;
|
|
47
|
-
registeredWebhookIds: string[];
|
|
48
|
-
}
|
|
49
|
-
/** Optional filters and pagination for destination discovery. */
|
|
50
|
-
interface WorkListContainersInput {
|
|
51
|
-
/** Opaque provider pagination token; pass through unchanged. */
|
|
52
|
-
cursor?: string;
|
|
53
|
-
query?: string;
|
|
54
|
-
parentId?: string;
|
|
55
|
-
}
|
|
56
|
-
/** One page of available provider destinations. */
|
|
57
|
-
interface WorkListContainersResult {
|
|
58
|
-
containers: WorkContainer[];
|
|
59
|
-
/** Omitted or null when no further page exists. */
|
|
60
|
-
cursor?: string | null;
|
|
61
|
-
}
|
|
62
|
-
/** The destination whose current workflow metadata the host needs. */
|
|
63
|
-
interface WorkDescribeContainerInput {
|
|
64
|
-
containerId: string;
|
|
65
|
-
}
|
|
66
|
-
/** A selectable provider item type within a destination. */
|
|
67
|
-
interface WorkItemType {
|
|
68
|
-
id: string;
|
|
69
|
-
label: string;
|
|
70
|
-
}
|
|
71
|
-
/** A create form field, including whether it is required and supported choices. */
|
|
72
|
-
interface WorkCreateField {
|
|
73
|
-
id: string;
|
|
74
|
-
label: string;
|
|
75
|
-
type: 'string' | 'number' | 'boolean' | 'string[]';
|
|
76
|
-
required: boolean;
|
|
77
|
-
options?: {
|
|
78
|
-
value: string;
|
|
79
|
-
label: string;
|
|
80
|
-
}[];
|
|
81
|
-
/** Restrict a field to these item types, when workflows differ. */
|
|
82
|
-
itemTypeIds?: string[];
|
|
83
|
-
}
|
|
84
|
-
/** Current create requirements and exact statuses for one destination. */
|
|
85
|
-
interface WorkDescribeContainerResult {
|
|
86
|
-
container: WorkContainer;
|
|
87
|
-
itemTypes: WorkItemType[];
|
|
88
|
-
createFields: WorkCreateField[];
|
|
89
|
-
statuses: WorkStatus[];
|
|
90
|
-
}
|
|
91
|
-
/** A short-lived screenshot URL; refreshed by the host for each retry. */
|
|
92
|
-
interface ReviewImageAttachmentDescriptor {
|
|
93
|
-
kind: 'image';
|
|
94
|
-
attachmentId: string;
|
|
95
|
-
url: string;
|
|
96
|
-
mediaType: string;
|
|
97
|
-
fileName: string;
|
|
98
|
-
}
|
|
99
|
-
/** A Tappify deep link that can be attached independently of a screenshot. */
|
|
100
|
-
interface ReviewLinkAttachmentDescriptor {
|
|
101
|
-
kind: 'link';
|
|
102
|
-
attachmentId: string;
|
|
103
|
-
url: string;
|
|
104
|
-
title?: string;
|
|
105
|
-
}
|
|
106
|
-
/** An image or link attached after the external item has been linked. */
|
|
107
|
-
type ReviewAttachmentDescriptor = ReviewImageAttachmentDescriptor | ReviewLinkAttachmentDescriptor;
|
|
108
|
-
/** Scope-approved snapshot used to create an item for a Review thread. */
|
|
109
|
-
interface ReviewThreadSource {
|
|
110
|
-
threadId: string;
|
|
111
|
-
projectId: string;
|
|
112
|
-
appId: string;
|
|
113
|
-
buildVersion: string | null;
|
|
114
|
-
buildNumber: string | null;
|
|
115
|
-
screenId: string;
|
|
116
|
-
screenName?: string;
|
|
117
|
-
/** Coordinates normalized to the screen's width and height. */
|
|
118
|
-
pin: {
|
|
119
|
-
x: number;
|
|
120
|
-
y: number;
|
|
121
|
-
};
|
|
122
|
-
firstComment: {
|
|
123
|
-
id: string;
|
|
124
|
-
body: string;
|
|
125
|
-
authorDisplayName: string;
|
|
126
|
-
createdAt: string;
|
|
127
|
-
};
|
|
128
|
-
device: Record<string, string | number | boolean | null>;
|
|
129
|
-
deepLink: string;
|
|
130
|
-
screenshot?: ReviewImageAttachmentDescriptor;
|
|
131
|
-
}
|
|
132
|
-
/** Create one provider item from the Review snapshot and owner-selected fields. */
|
|
133
|
-
interface WorkCreateInput extends WorkMutationInput {
|
|
134
|
-
containerId: string;
|
|
135
|
-
itemTypeId: string;
|
|
136
|
-
fields: WorkCreateFieldValues;
|
|
137
|
-
source: ReviewThreadSource;
|
|
138
|
-
}
|
|
139
|
-
/** Stable provider identity and display metadata persisted with the Review link. */
|
|
140
|
-
interface WorkItemLinkResult {
|
|
141
|
-
externalItemId: string;
|
|
142
|
-
displayKey: string;
|
|
143
|
-
url: string;
|
|
144
|
-
title: string;
|
|
145
|
-
status: WorkStatus;
|
|
146
|
-
providerVersion?: string;
|
|
147
|
-
updatedAt?: string;
|
|
148
|
-
}
|
|
149
|
-
/** Identity carried on operations for an existing Review-to-provider link. */
|
|
150
|
-
interface WorkLinkedItemInput {
|
|
151
|
-
linkId: string;
|
|
152
|
-
externalItemId: string;
|
|
153
|
-
threadId: string;
|
|
154
|
-
}
|
|
155
|
-
/** Attach one image or link without recreating the provider item. */
|
|
156
|
-
interface WorkAttachInput extends WorkMutationInput, WorkLinkedItemInput {
|
|
157
|
-
attachment: ReviewAttachmentDescriptor;
|
|
158
|
-
}
|
|
159
|
-
/** The attachment identity when the provider exposes one. */
|
|
160
|
-
interface WorkAttachResult {
|
|
161
|
-
externalAttachmentId?: string;
|
|
162
|
-
}
|
|
163
|
-
/** Append one Review comment to an existing provider item. */
|
|
164
|
-
interface WorkCommentInput extends WorkMutationInput, WorkLinkedItemInput {
|
|
165
|
-
commentId: string;
|
|
166
|
-
body: string;
|
|
167
|
-
authorDisplayName: string;
|
|
168
|
-
createdAt: string;
|
|
169
|
-
}
|
|
170
|
-
/** Provider comment identity and time used to suppress webhook echoes. */
|
|
171
|
-
interface WorkCommentResult {
|
|
172
|
-
externalCommentId: string;
|
|
173
|
-
createdAt: string;
|
|
174
|
-
providerVersion?: string;
|
|
175
|
-
}
|
|
176
|
-
/** Apply the owner's exact provider status for an open or resolved Review thread. */
|
|
177
|
-
interface WorkSetStatusInput extends WorkMutationInput, WorkLinkedItemInput {
|
|
178
|
-
tappifyStatus: 'open' | 'resolved';
|
|
179
|
-
/** The exact provider target selected in destination configuration. */
|
|
180
|
-
providerStatusId: string;
|
|
181
|
-
}
|
|
182
|
-
/** Resulting provider status and optional version used to suppress webhook echoes. */
|
|
183
|
-
interface WorkSetStatusResult {
|
|
184
|
-
status: WorkStatus;
|
|
185
|
-
providerVersion?: string;
|
|
186
|
-
updatedAt?: string;
|
|
187
|
-
}
|
|
188
|
-
/** Common identity for a fully hydrated provider signal. */
|
|
189
|
-
interface WorkHydratedEventBase {
|
|
190
|
-
externalItemId: string;
|
|
191
|
-
providerEventId: string;
|
|
192
|
-
dedupeKey: string;
|
|
193
|
-
occurredAt: string;
|
|
194
|
-
providerVersion?: string;
|
|
195
|
-
}
|
|
196
|
-
/** A complete append-only provider comment signal. */
|
|
197
|
-
interface WorkHydratedCommentCreatedEvent extends WorkHydratedEventBase {
|
|
198
|
-
type: 'comment.created';
|
|
199
|
-
comment: {
|
|
200
|
-
externalCommentId: string;
|
|
201
|
-
body: string;
|
|
202
|
-
author: {
|
|
203
|
-
id: string;
|
|
204
|
-
displayName: string;
|
|
205
|
-
};
|
|
206
|
-
createdAt: string;
|
|
207
|
-
};
|
|
208
|
-
}
|
|
209
|
-
/** A complete provider status-change signal. */
|
|
210
|
-
interface WorkHydratedStatusChangedEvent extends WorkHydratedEventBase {
|
|
211
|
-
type: 'status.changed';
|
|
212
|
-
status: WorkStatus;
|
|
213
|
-
}
|
|
214
|
-
/** A provider item deletion signal. */
|
|
215
|
-
interface WorkHydratedItemDeletedEvent extends WorkHydratedEventBase {
|
|
216
|
-
type: 'item.deleted';
|
|
217
|
-
}
|
|
218
|
-
/** Complete event content, with no opaque hydration reference remaining. */
|
|
219
|
-
type WorkHydratedEvent = WorkHydratedCommentCreatedEvent | WorkHydratedStatusChangedEvent | WorkHydratedItemDeletedEvent;
|
|
220
|
-
/** Resolve an opaque provider webhook reference using current install credentials. */
|
|
221
|
-
interface WorkHydrateEventInput extends WorkLinkedItemInput {
|
|
222
|
-
hydrateRef: string;
|
|
223
|
-
}
|
|
224
|
-
/** Fully normalized content fetched for an opaque provider webhook reference. */
|
|
225
|
-
interface WorkHydrateEventResult {
|
|
226
|
-
event: WorkHydratedEvent;
|
|
227
|
-
}
|
|
228
|
-
/** Clean up install-wide webhooks while provider credentials remain available. */
|
|
229
|
-
interface WorkDisconnectInput extends WorkMutationInput {
|
|
230
|
-
generation: number;
|
|
231
|
-
registeredWebhookIds: string[];
|
|
232
|
-
}
|
|
233
|
-
/** Provider webhook registrations successfully removed during cleanup. */
|
|
234
|
-
interface WorkDisconnectResult {
|
|
235
|
-
removedWebhookIds: string[];
|
|
236
|
-
}
|
|
237
|
-
/** Current host-to-extension work protocol. Legacy routes are excluded. */
|
|
238
|
-
interface WorkOperationMap {
|
|
239
|
-
configure: {
|
|
240
|
-
input: WorkConfigureInput;
|
|
241
|
-
output: WorkConfigureResult;
|
|
242
|
-
};
|
|
243
|
-
list_containers: {
|
|
244
|
-
input: WorkListContainersInput;
|
|
245
|
-
output: WorkListContainersResult;
|
|
246
|
-
};
|
|
247
|
-
describe_container: {
|
|
248
|
-
input: WorkDescribeContainerInput;
|
|
249
|
-
output: WorkDescribeContainerResult;
|
|
250
|
-
};
|
|
251
|
-
create: {
|
|
252
|
-
input: WorkCreateInput;
|
|
253
|
-
output: WorkItemLinkResult;
|
|
254
|
-
};
|
|
255
|
-
attach: {
|
|
256
|
-
input: WorkAttachInput;
|
|
257
|
-
output: WorkAttachResult;
|
|
258
|
-
};
|
|
259
|
-
comment: {
|
|
260
|
-
input: WorkCommentInput;
|
|
261
|
-
output: WorkCommentResult;
|
|
262
|
-
};
|
|
263
|
-
set_status: {
|
|
264
|
-
input: WorkSetStatusInput;
|
|
265
|
-
output: WorkSetStatusResult;
|
|
266
|
-
};
|
|
267
|
-
hydrate_event: {
|
|
268
|
-
input: WorkHydrateEventInput;
|
|
269
|
-
output: WorkHydrateEventResult;
|
|
270
|
-
};
|
|
271
|
-
disconnect: {
|
|
272
|
-
input: WorkDisconnectInput;
|
|
273
|
-
output: WorkDisconnectResult;
|
|
274
|
-
};
|
|
275
|
-
}
|
|
276
|
-
|
|
277
|
-
/** Which install made the call, as the token's claims name it. */
|
|
278
|
-
interface TappifyInstall {
|
|
279
|
-
/** The install id, which is the key to scope anything you store yourself by. */
|
|
280
|
-
id: string;
|
|
281
|
-
extensionId: string;
|
|
282
|
-
/** `null` for an install on the workspace rather than one project. */
|
|
283
|
-
projectId: string | null;
|
|
284
|
-
organizationId: string;
|
|
285
|
-
}
|
|
286
|
-
/** The project and the filter bar the call was made from. */
|
|
287
|
-
interface TappifyCallContext {
|
|
288
|
-
projectId: string | null;
|
|
289
|
-
/** The same value as `filters.platform`, hoisted for convenience. */
|
|
290
|
-
platform: TapPlatformFilter;
|
|
291
|
-
/** The range start, as `YYYY-MM-DD`, or an empty string when none was sent. */
|
|
292
|
-
from: string;
|
|
293
|
-
/** The range end, as `YYYY-MM-DD`, or an empty string when none was sent. */
|
|
294
|
-
to: string;
|
|
295
|
-
filters: TapFilters;
|
|
296
|
-
}
|
|
297
|
-
/**
|
|
298
|
-
* The install- and organization-scoped storage documents Tappify passes to the
|
|
299
|
-
* server on every call, keyed by collection name.
|
|
300
|
-
*/
|
|
301
|
-
type TappifyDocuments = Record<string, unknown> & {
|
|
302
|
-
/** The settings contribution's document, or `null` before it is first saved. */
|
|
303
|
-
settings?: TapSettingsValues | null;
|
|
304
|
-
};
|
|
305
|
-
/** The verified claims of an install token, as `verifyTappifyToken` returns them. */
|
|
306
|
-
interface TappifyClaims {
|
|
307
|
-
iss: string;
|
|
308
|
-
/** Always `ext:<extensionId>`, which is what the verifier checked. */
|
|
309
|
-
aud: string;
|
|
310
|
-
exp: number;
|
|
311
|
-
iat: number;
|
|
312
|
-
installId: string;
|
|
313
|
-
extensionId: string;
|
|
314
|
-
projectId: string | null;
|
|
315
|
-
organizationId: string;
|
|
316
|
-
/** The scopes the install granted, as strings. */
|
|
317
|
-
scopes: string[];
|
|
318
|
-
/** Present when the token carries one, naming the teammate behind the call. */
|
|
319
|
-
userId?: string;
|
|
320
|
-
}
|
|
321
|
-
/** The single argument every route handler receives. */
|
|
322
|
-
interface TappifyRequest<TInput = unknown, TEvent = unknown> {
|
|
323
|
-
install: TappifyInstall;
|
|
324
|
-
context: TappifyCallContext;
|
|
325
|
-
/**
|
|
326
|
-
* The call's `input`, or `{}` when the body carried none, and `undefined` on a
|
|
327
|
-
* context or events route, which take no input.
|
|
328
|
-
*/
|
|
329
|
-
input: TInput;
|
|
330
|
-
credentials: TapCredentialValues;
|
|
331
|
-
documents: TappifyDocuments;
|
|
332
|
-
/** The event payload on an events route, and `undefined` on every other. */
|
|
333
|
-
event: TEvent | undefined;
|
|
334
|
-
/** The idempotency key from `X-Tappify-Event-Id`; deduplicate writes on it. */
|
|
335
|
-
eventId: string;
|
|
336
|
-
claims: TappifyClaims;
|
|
337
|
-
/** The original request, for a header or the raw body. */
|
|
338
|
-
request: Request;
|
|
339
|
-
}
|
|
340
|
-
/**
|
|
341
|
-
* The signature every entry in `TappifyHandlerOptions` has: one argument, and a
|
|
342
|
-
* value or a promise of one.
|
|
343
|
-
*/
|
|
344
|
-
type TappifyRouteHandler<TInput = unknown, TOutput = unknown, TEvent = unknown> = (request: TappifyRequest<TInput, TEvent>) => TOutput | Promise<TOutput>;
|
|
345
|
-
/** What the `GET /tappify/health` route answers with. */
|
|
346
|
-
interface TappifyHealth {
|
|
347
|
-
/** Whether the server is ready to take calls; the publish check reads it. */
|
|
348
|
-
ok: boolean;
|
|
349
|
-
version?: string;
|
|
350
|
-
/** A line for the owner when the server is not ready. */
|
|
351
|
-
message?: string;
|
|
352
|
-
}
|
|
353
|
-
/** What Tappify asks a connector's metrics route for. */
|
|
354
|
-
interface MetricsInput {
|
|
355
|
-
projectId: string | null;
|
|
356
|
-
platform: TapPlatformFilter;
|
|
357
|
-
/** The metric keys to answer for, from the ones the manifest declares. */
|
|
358
|
-
metrics: string[];
|
|
359
|
-
from: string;
|
|
360
|
-
to: string;
|
|
361
|
-
}
|
|
362
|
-
/** One metric's answer inside a `MetricsResponse`. */
|
|
363
|
-
interface MetricsSeries {
|
|
364
|
-
/** The declared metric key this series answers for. */
|
|
365
|
-
metric: string;
|
|
366
|
-
/** Has to match the unit the manifest declares for that key. */
|
|
367
|
-
unit: 'count' | 'ratio' | 'currency' | 'seconds' | 'bytes';
|
|
368
|
-
/** One value per declared dimension, when the series is broken down. */
|
|
369
|
-
dimensions?: Record<string, string>;
|
|
370
|
-
/** `[timestamp, value]` pairs, oldest first. */
|
|
371
|
-
points: [string, number][];
|
|
372
|
-
}
|
|
373
|
-
/** What a connector's metrics route answers with: one series per asked metric. */
|
|
374
|
-
interface MetricsResponse {
|
|
375
|
-
series: MetricsSeries[];
|
|
376
|
-
}
|
|
377
|
-
/** What a mention route answers with: the items the owner can pick from. */
|
|
378
|
-
interface MentionItems {
|
|
379
|
-
items: {
|
|
380
|
-
id: string;
|
|
381
|
-
label: string;
|
|
382
|
-
}[];
|
|
383
|
-
}
|
|
384
|
-
/** What a context route answers with, for the owner's chat to read. */
|
|
385
|
-
interface ContextBlock {
|
|
386
|
-
/** A line of prose the assistant can use as it is. */
|
|
387
|
-
summary: string;
|
|
388
|
-
/** The numbers behind the summary, for the assistant to quote. */
|
|
389
|
-
data?: Record<string, unknown>;
|
|
390
|
-
}
|
|
391
|
-
/** The work-tracker operations a handler's `work` table can answer. */
|
|
392
|
-
type WorkOperation = keyof WorkOperationMap;
|
|
393
|
-
/** SDK v2 compatibility routes, excluded from the current work protocol. */
|
|
394
|
-
interface LegacyWorkHandlers {
|
|
395
|
-
/** @deprecated Implement set_status and use describe_container for status metadata. */
|
|
396
|
-
status?: TappifyRouteHandler<Record<string, unknown>, unknown>;
|
|
397
|
-
/** @deprecated Implement set_status to support both resolving and reopening. */
|
|
398
|
-
resolve?: TappifyRouteHandler<Record<string, unknown>, unknown>;
|
|
399
|
-
}
|
|
400
|
-
/** The second argument of `verifyTappifyToken`. */
|
|
401
|
-
interface VerifyTokenOptions {
|
|
402
|
-
/** The `id` from the manifest; the token's audience has to be `ext:<id>`. */
|
|
403
|
-
extensionId: string;
|
|
404
|
-
/** Where to fetch the signing keys. Defaults to `DEFAULT_JWKS_URL`. */
|
|
405
|
-
jwksUrl?: string;
|
|
406
|
-
/** A key set to verify against, which skips the fetch. For tests. */
|
|
407
|
-
jwks?: JSONWebKeySet;
|
|
408
|
-
}
|
|
409
|
-
/**
|
|
410
|
-
* The routes and settings `createTappifyHandler` builds a fetch handler from.
|
|
411
|
-
*
|
|
412
|
-
* @remarks
|
|
413
|
-
* The `tools`, `actions` and `procedures` tables are keyed by the names the
|
|
414
|
-
* augmentation `tappify extension types` writes, so a handler for an undeclared
|
|
415
|
-
* name does not compile. `events` is keyed by Tappify's own event catalogue and
|
|
416
|
-
* `work` by the fixed set of work operations; `mentions` and `context` take any id.
|
|
417
|
-
* A route Tappify calls with no handler registered answers 404 with
|
|
418
|
-
* `TAP_HANDLER_MISSING`. Export this object as well as the handler: the testing
|
|
419
|
-
* entry's `createTestClient` takes the options, not the built handler.
|
|
420
|
-
*/
|
|
421
|
-
interface TappifyHandlerOptions {
|
|
422
|
-
/** The `id` from the manifest, which the install token's audience has to match. */
|
|
423
|
-
extensionId: string;
|
|
424
|
-
/** Where to fetch the signing keys. Defaults to `DEFAULT_JWKS_URL`. */
|
|
425
|
-
jwksUrl?: string;
|
|
426
|
-
/** A key set to verify against, which skips the fetch. For tests. */
|
|
427
|
-
jwks?: JSONWebKeySet;
|
|
428
|
-
/** The prefix your framework mounts the handler under, such as `/api`. */
|
|
429
|
-
basePath?: string;
|
|
430
|
-
/** Answers `GET /tappify/health`. Left out, the route answers `{ ok: true }`. */
|
|
431
|
-
health?: () => TappifyHealth | Promise<TappifyHealth>;
|
|
432
|
-
/** Answers `POST /tappify/metrics` for a connector contribution. */
|
|
433
|
-
metrics?: TappifyRouteHandler<MetricsInput, MetricsResponse>;
|
|
434
|
-
/** One handler per declared tool, answering `POST /tappify/tools/<id>`. */
|
|
435
|
-
tools?: {
|
|
436
|
-
[T in ToolId]?: TappifyRouteHandler<ToolInput<T>, unknown>;
|
|
437
|
-
};
|
|
438
|
-
/** One handler per declared mention, answering `GET /tappify/mentions/<id>?q=`. */
|
|
439
|
-
mentions?: Record<string, TappifyRouteHandler<{
|
|
440
|
-
q: string;
|
|
441
|
-
}, MentionItems>>;
|
|
442
|
-
/** One handler per declared action, answering `POST /tappify/actions/<id>`. */
|
|
443
|
-
actions?: {
|
|
444
|
-
[A in ActionId]?: TappifyRouteHandler<ActionInput<A>, unknown>;
|
|
445
|
-
};
|
|
446
|
-
/** One handler per declared procedure, which is what `useTapServer` calls. */
|
|
447
|
-
procedures?: {
|
|
448
|
-
[N in TapProcedureName]?: TappifyRouteHandler<TapProcedureInput<N>, TapProcedureOutput<N>>;
|
|
449
|
-
};
|
|
450
|
-
/** One handler per declared context block, answering `GET /tappify/context/<id>`. */
|
|
451
|
-
context?: Record<string, TappifyRouteHandler<undefined, ContextBlock>>;
|
|
452
|
-
/** One handler per Tappify event you subscribe to; each answers 204. */
|
|
453
|
-
events?: {
|
|
454
|
-
[E in keyof TapHostEvents]?: TappifyRouteHandler<undefined, void, TapHostEvents[E]>;
|
|
455
|
-
};
|
|
456
|
-
/**
|
|
457
|
-
* One handler per work operation, answering `POST /tappify/work/<operation>`.
|
|
458
|
-
* If set_status is absent, a resolved target can invoke legacy resolve with
|
|
459
|
-
* id set to externalItemId. Its legacy result is returned unchanged; reopening
|
|
460
|
-
* needs set_status. Failures from a present set_status handler never fall back.
|
|
461
|
-
*/
|
|
462
|
-
work?: {
|
|
463
|
-
[O in keyof WorkOperationMap]?: TappifyRouteHandler<WorkOperationMap[O]['input'], WorkOperationMap[O]['output']>;
|
|
464
|
-
} & LegacyWorkHandlers;
|
|
465
|
-
}
|
|
466
|
-
|
|
467
|
-
/**
|
|
468
|
-
* What `createTappifyHandler` returns: a `fetch` handler, which is what Cloudflare
|
|
469
|
-
* Workers, Vercel and the two adapters all take.
|
|
470
|
-
*/
|
|
471
|
-
type TappifyFetchHandler = (request: Request) => Promise<Response>;
|
|
472
|
-
/**
|
|
473
|
-
* Builds the one `fetch` handler that answers every route Tappify calls on your
|
|
474
|
-
* server.
|
|
475
|
-
*
|
|
476
|
-
* @remarks
|
|
477
|
-
* It routes the paths under `/tappify`, minus `basePath` when your framework mounts
|
|
478
|
-
* it under a prefix, and hands each matched handler a `TappifyRequest`. Every
|
|
479
|
-
* route but `GET /tappify/health` needs a bearer install token, which it verifies
|
|
480
|
-
* with `verifyTappifyToken`, and an `X-Tappify-Event-Id` header; a missing token is
|
|
481
|
-
* 401 `TAP_TOKEN_MISSING`, a missing id 400 `TAP_EVENT_ID_MISSING`, an unknown path
|
|
482
|
-
* 404 `TAP_ROUTE_UNKNOWN` and a declared name with no handler 404
|
|
483
|
-
* `TAP_HANDLER_MISSING`. A body that is not JSON is 400 `TAP_BODY_INVALID` and one
|
|
484
|
-
* over 1 MB is 413 `TAP_BODY_TOO_LARGE`. A `TapServerError` a handler throws is
|
|
485
|
-
* answered with its own code and status, and a `TapError` other than the two token
|
|
486
|
-
* failures with its own code and 400; anything else becomes 500
|
|
487
|
-
* `TAP_INTERNAL_ERROR` with a fixed message, so an internal failure never reaches
|
|
488
|
-
* the owner. An events route answers 204 with no body, and every other route
|
|
489
|
-
* answers the handler's return value as JSON. Export the options object as well as
|
|
490
|
-
* the handler: `createTestClient` takes the options.
|
|
491
|
-
*
|
|
492
|
-
* @example
|
|
493
|
-
* ```ts
|
|
494
|
-
* import {
|
|
495
|
-
* createTappifyHandler,
|
|
496
|
-
* type TappifyHandlerOptions,
|
|
497
|
-
* } from '@tappify/extension-sdk/server';
|
|
498
|
-
*
|
|
499
|
-
* const handlerOptions: TappifyHandlerOptions = {
|
|
500
|
-
* extensionId: 'starter',
|
|
501
|
-
* health: () => ({ ok: true, version: '0.1.0' }),
|
|
502
|
-
* procedures: {
|
|
503
|
-
* getSummary: () => ({ installs: 1260, delta: 0.087, topKeyword: 'photo editor' }),
|
|
504
|
-
* },
|
|
505
|
-
* };
|
|
506
|
-
*
|
|
507
|
-
* const handler = createTappifyHandler(handlerOptions);
|
|
508
|
-
* ```
|
|
509
|
-
*/
|
|
510
|
-
declare function createTappifyHandler(options: TappifyHandlerOptions): TappifyFetchHandler;
|
|
511
|
-
|
|
512
|
-
/** An opaque provider signal to hydrate using current install credentials. */
|
|
513
|
-
interface WorkHydrationReferenceEvent extends WorkHydratedEventBase {
|
|
514
|
-
type: WorkHydratedEvent['type'];
|
|
515
|
-
/** A nonempty, short-lived reference resolved by the hydrate_event handler. */
|
|
516
|
-
hydrateRef: string;
|
|
517
|
-
/** Normalized comment content must not accompany a reference. */
|
|
518
|
-
comment?: never;
|
|
519
|
-
/** Normalized status content must not accompany a reference. */
|
|
520
|
-
status?: never;
|
|
521
|
-
}
|
|
522
|
-
/** Complete normalized content or an opaque reference, with stable retry identity. */
|
|
523
|
-
type WorkEvent = (WorkHydratedEvent & {
|
|
524
|
-
hydrateRef?: never;
|
|
525
|
-
}) | WorkHydrationReferenceEvent;
|
|
526
|
-
/** Install-specific delivery values provisioned through work configure. */
|
|
527
|
-
interface SendWorkEventOptions {
|
|
528
|
-
/** The exact provisioned callback URL; no production default is supplied. */
|
|
529
|
-
callbackUrl: string;
|
|
530
|
-
/** The per-install work-event signing secret provisioned with the callback. */
|
|
531
|
-
secret: string;
|
|
532
|
-
/** A transport for tests or a proxy; defaults to global fetch. */
|
|
533
|
-
fetch?: typeof fetch;
|
|
534
|
-
}
|
|
535
|
-
/**
|
|
536
|
-
* Sends one provider work event to the callback provisioned for this install.
|
|
537
|
-
*
|
|
538
|
-
* @remarks
|
|
539
|
-
* Pass the callbackUrl and secret received through configure unchanged. The
|
|
540
|
-
* event's required dedupeKey identifies the logical provider signal and must be
|
|
541
|
-
* reused on retries. Complete normalized content and an opaque hydrateRef are
|
|
542
|
-
* mutually exclusive. The exact serialized UTF-8 body is signed with HMAC-SHA-256.
|
|
543
|
-
* This callback is independent of declared alert and banner webhooks.
|
|
544
|
-
*/
|
|
545
|
-
declare function sendWorkEvent(event: WorkEvent, options: SendWorkEventOptions): Promise<void>;
|
|
546
|
-
|
|
547
|
-
export { type WorkSetStatusResult as $, type WorkDisconnectResult as A, type WorkEvent as B, type ContextBlock as C, type WorkHydrateEventInput as D, type WorkHydrateEventResult as E, type WorkHydratedCommentCreatedEvent as F, type WorkHydratedEvent as G, type WorkHydratedEventBase as H, type WorkHydratedItemDeletedEvent as I, type WorkHydratedStatusChangedEvent as J, type WorkHydrationReferenceEvent as K, type LegacyWorkHandlers as L, type MentionItems as M, type WorkItemLinkResult as N, type WorkItemType as O, type WorkLinkedItemInput as P, type WorkListContainersInput as Q, type ReviewAttachmentDescriptor as R, type SendWorkEventOptions as S, type TappifyFetchHandler as T, type WorkListContainersResult as U, type VerifyTokenOptions as V, type WorkAttachInput as W, type WorkMutationInput as X, type WorkOperation as Y, type WorkOperationMap as Z, type WorkSetStatusInput as _, type TappifyClaims as a, type WorkStage as a0, type WorkStatus as a1, createTappifyHandler as a2, sendWorkEvent as a3, type MetricsInput as b, type MetricsResponse as c, type MetricsSeries as d, type ReviewImageAttachmentDescriptor as e, type ReviewLinkAttachmentDescriptor as f, type ReviewThreadSource as g, type TappifyCallContext as h, type TappifyDocuments as i, type TappifyHandlerOptions as j, type TappifyHealth as k, type TappifyInstall as l, type TappifyRequest as m, type TappifyRouteHandler as n, type WorkAttachResult as o, type WorkCommentInput as p, type WorkCommentResult as q, type WorkConfigureInput as r, type WorkConfigureResult as s, type WorkContainer as t, type WorkCreateField as u, type WorkCreateFieldValues as v, type WorkCreateInput as w, type WorkDescribeContainerInput as x, type WorkDescribeContainerResult as y, type WorkDisconnectInput as z };
|