@tappify/extension-sdk 2.1.0-beta.1 → 2.1.0-beta.3

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.
Files changed (54) hide show
  1. package/dist/{chunk-QJMZRV7A.mjs → chunk-QQSCA6CC.mjs} +18 -6
  2. package/dist/chunk-QQSCA6CC.mjs.map +1 -0
  3. package/dist/{chunk-EB5XWQAU.cjs → chunk-SALMPL5V.cjs} +18 -6
  4. package/dist/chunk-SALMPL5V.cjs.map +1 -0
  5. package/dist/{client-CnlSHDWE.d.ts → client-BO3kavn0.d.ts} +1 -1
  6. package/dist/{client-CV1qzQgx.d.cts → client-DE-vMgdO.d.cts} +1 -1
  7. package/dist/codegen.d.cts +3 -0
  8. package/dist/codegen.d.ts +3 -0
  9. package/dist/{constants-BAimnqOK.d.cts → constants-Bh759FUI.d.cts} +4 -1
  10. package/dist/{constants-BAimnqOK.d.ts → constants-Bh759FUI.d.ts} +4 -1
  11. package/dist/{context-DJ3REtdT.d.cts → context-DI0EJCRD.d.cts} +1 -1
  12. package/dist/{context-Cr93B05o.d.ts → context-mr8R5CNt.d.ts} +1 -1
  13. package/dist/host.d.cts +4 -4
  14. package/dist/host.d.ts +4 -4
  15. package/dist/index.d.cts +4 -4
  16. package/dist/index.d.ts +4 -4
  17. package/dist/manifest.cjs +4 -1
  18. package/dist/manifest.cjs.map +1 -1
  19. package/dist/manifest.d.cts +6 -2
  20. package/dist/manifest.d.ts +6 -2
  21. package/dist/manifest.mjs +4 -1
  22. package/dist/manifest.mjs.map +1 -1
  23. package/dist/server.cjs +2 -2
  24. package/dist/server.d.cts +5 -5
  25. package/dist/server.d.ts +5 -5
  26. package/dist/server.mjs +1 -1
  27. package/dist/testing/index.cjs +2 -2
  28. package/dist/testing/index.d.cts +3 -3
  29. package/dist/testing/index.d.ts +3 -3
  30. package/dist/testing/index.mjs +1 -1
  31. package/dist/{types-I1JOZyI_.d.cts → types-BdDaLnqs.d.cts} +1 -1
  32. package/dist/{types-BYGcp5pZ.d.ts → types-uGHrRaOj.d.ts} +1 -1
  33. package/dist/ui.d.cts +1 -1
  34. package/dist/ui.d.ts +1 -1
  35. package/dist/vite-preview-bootstrap.d.cts +2 -2
  36. package/dist/vite-preview-bootstrap.d.ts +2 -2
  37. package/dist/vite-preview.cjs +1 -1
  38. package/dist/vite-preview.cjs.map +1 -1
  39. package/dist/vite-preview.d.cts +3 -3
  40. package/dist/vite-preview.d.ts +3 -3
  41. package/dist/vite-preview.mjs +1 -1
  42. package/dist/vite-preview.mjs.map +1 -1
  43. package/dist/vite.cjs +4 -1
  44. package/dist/vite.cjs.map +1 -1
  45. package/dist/vite.d.cts +3 -0
  46. package/dist/vite.d.ts +3 -0
  47. package/dist/vite.mjs +4 -1
  48. package/dist/vite.mjs.map +1 -1
  49. package/dist/{work-events-DB3WR468.d.ts → work-events-C5n497rx.d.ts} +40 -8
  50. package/dist/{work-events-Dxe7Djdy.d.cts → work-events-DSklu4t-.d.cts} +40 -8
  51. package/package.json +1 -1
  52. package/schema/extension-v2.json +8 -0
  53. package/dist/chunk-EB5XWQAU.cjs.map +0 -1
  54. package/dist/chunk-QJMZRV7A.mjs.map +0 -1
@@ -1,11 +1,30 @@
1
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-BYGcp5pZ.js';
3
- import { a8 as WorkContribution } from './constants-BAimnqOK.js';
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
4
 
5
5
  /** The provider stage used by the manifest's legacy status mapping. */
6
6
  type WorkStage = keyof NonNullable<NonNullable<WorkContribution['status']>['map']>;
7
7
  /** JSON-safe values supplied for provider create fields. */
8
8
  type WorkCreateFieldValues = Record<string, string | number | boolean | string[] | null>;
9
+ /** A person in the sending system; email is optional when unavailable. */
10
+ interface WorkPerson {
11
+ id: string;
12
+ displayName: string;
13
+ email?: string;
14
+ }
15
+ /** A structured person mention supplied with a Review comment. */
16
+ interface WorkMention {
17
+ person: WorkPerson;
18
+ }
19
+ /** Ordered provider comment content, including portable person mentions. */
20
+ type WorkRichTextSegment = {
21
+ type: 'text';
22
+ text: string;
23
+ } | {
24
+ type: 'user_mention';
25
+ person: WorkPerson;
26
+ fallback: string;
27
+ };
9
28
  /** Logical mutation identity, stable across transport retries. */
10
29
  interface WorkMutationInput {
11
30
  idempotencyKey: string;
@@ -122,6 +141,9 @@ interface ReviewThreadSource {
122
141
  firstComment: {
123
142
  id: string;
124
143
  body: string;
144
+ author: WorkPerson;
145
+ mentions: WorkMention[];
146
+ /** @deprecated Use author.displayName instead. */
125
147
  authorDisplayName: string;
126
148
  createdAt: string;
127
149
  };
@@ -164,6 +186,9 @@ interface WorkAttachResult {
164
186
  interface WorkCommentInput extends WorkMutationInput, WorkLinkedItemInput {
165
187
  commentId: string;
166
188
  body: string;
189
+ author: WorkPerson;
190
+ mentions: WorkMention[];
191
+ /** @deprecated Use author.displayName instead. */
167
192
  authorDisplayName: string;
168
193
  createdAt: string;
169
194
  }
@@ -198,13 +223,20 @@ interface WorkHydratedCommentCreatedEvent extends WorkHydratedEventBase {
198
223
  type: 'comment.created';
199
224
  comment: {
200
225
  externalCommentId: string;
226
+ /** Compatibility text; segment concatenation is authoritative when present. */
201
227
  body: string;
202
- author: {
203
- id: string;
204
- displayName: string;
205
- };
206
228
  createdAt: string;
207
- };
229
+ } & ({
230
+ author: WorkPerson;
231
+ /** Concatenate text and mention fallback values in order. */
232
+ segments: WorkRichTextSegment[];
233
+ } | {
234
+ /** Legacy authors cannot carry rich person data without segments. */
235
+ author: WorkPerson & {
236
+ email?: never;
237
+ };
238
+ segments?: never;
239
+ });
208
240
  }
209
241
  /** A complete provider status-change signal. */
210
242
  interface WorkHydratedStatusChangedEvent extends WorkHydratedEventBase {
@@ -544,4 +576,4 @@ interface SendWorkEventOptions {
544
576
  */
545
577
  declare function sendWorkEvent(event: WorkEvent, options: SendWorkEventOptions): Promise<void>;
546
578
 
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 };
579
+ export { type WorkPerson 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 WorkMention as X, type WorkMutationInput as Y, type WorkOperation as Z, type WorkOperationMap as _, type TappifyClaims as a, type WorkRichTextSegment as a0, type WorkSetStatusInput as a1, type WorkSetStatusResult as a2, type WorkStage as a3, type WorkStatus as a4, createTappifyHandler as a5, sendWorkEvent as a6, 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 };
@@ -1,11 +1,30 @@
1
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-I1JOZyI_.cjs';
3
- import { a8 as WorkContribution } from './constants-BAimnqOK.cjs';
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-BdDaLnqs.cjs';
3
+ import { a9 as WorkContribution } from './constants-Bh759FUI.cjs';
4
4
 
5
5
  /** The provider stage used by the manifest's legacy status mapping. */
6
6
  type WorkStage = keyof NonNullable<NonNullable<WorkContribution['status']>['map']>;
7
7
  /** JSON-safe values supplied for provider create fields. */
8
8
  type WorkCreateFieldValues = Record<string, string | number | boolean | string[] | null>;
9
+ /** A person in the sending system; email is optional when unavailable. */
10
+ interface WorkPerson {
11
+ id: string;
12
+ displayName: string;
13
+ email?: string;
14
+ }
15
+ /** A structured person mention supplied with a Review comment. */
16
+ interface WorkMention {
17
+ person: WorkPerson;
18
+ }
19
+ /** Ordered provider comment content, including portable person mentions. */
20
+ type WorkRichTextSegment = {
21
+ type: 'text';
22
+ text: string;
23
+ } | {
24
+ type: 'user_mention';
25
+ person: WorkPerson;
26
+ fallback: string;
27
+ };
9
28
  /** Logical mutation identity, stable across transport retries. */
10
29
  interface WorkMutationInput {
11
30
  idempotencyKey: string;
@@ -122,6 +141,9 @@ interface ReviewThreadSource {
122
141
  firstComment: {
123
142
  id: string;
124
143
  body: string;
144
+ author: WorkPerson;
145
+ mentions: WorkMention[];
146
+ /** @deprecated Use author.displayName instead. */
125
147
  authorDisplayName: string;
126
148
  createdAt: string;
127
149
  };
@@ -164,6 +186,9 @@ interface WorkAttachResult {
164
186
  interface WorkCommentInput extends WorkMutationInput, WorkLinkedItemInput {
165
187
  commentId: string;
166
188
  body: string;
189
+ author: WorkPerson;
190
+ mentions: WorkMention[];
191
+ /** @deprecated Use author.displayName instead. */
167
192
  authorDisplayName: string;
168
193
  createdAt: string;
169
194
  }
@@ -198,13 +223,20 @@ interface WorkHydratedCommentCreatedEvent extends WorkHydratedEventBase {
198
223
  type: 'comment.created';
199
224
  comment: {
200
225
  externalCommentId: string;
226
+ /** Compatibility text; segment concatenation is authoritative when present. */
201
227
  body: string;
202
- author: {
203
- id: string;
204
- displayName: string;
205
- };
206
228
  createdAt: string;
207
- };
229
+ } & ({
230
+ author: WorkPerson;
231
+ /** Concatenate text and mention fallback values in order. */
232
+ segments: WorkRichTextSegment[];
233
+ } | {
234
+ /** Legacy authors cannot carry rich person data without segments. */
235
+ author: WorkPerson & {
236
+ email?: never;
237
+ };
238
+ segments?: never;
239
+ });
208
240
  }
209
241
  /** A complete provider status-change signal. */
210
242
  interface WorkHydratedStatusChangedEvent extends WorkHydratedEventBase {
@@ -544,4 +576,4 @@ interface SendWorkEventOptions {
544
576
  */
545
577
  declare function sendWorkEvent(event: WorkEvent, options: SendWorkEventOptions): Promise<void>;
546
578
 
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 };
579
+ export { type WorkPerson 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 WorkMention as X, type WorkMutationInput as Y, type WorkOperation as Z, type WorkOperationMap as _, type TappifyClaims as a, type WorkRichTextSegment as a0, type WorkSetStatusInput as a1, type WorkSetStatusResult as a2, type WorkStage as a3, type WorkStatus as a4, createTappifyHandler as a5, sendWorkEvent as a6, 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 };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tappify/extension-sdk",
3
- "version": "2.1.0-beta.1",
3
+ "version": "2.1.0-beta.3",
4
4
  "description": "Build extensions that run inside Tappify",
5
5
  "author": "Tappify Team",
6
6
  "license": "MIT",
@@ -623,6 +623,14 @@
623
623
  "type": "string"
624
624
  },
625
625
  "description": "The scopes asked of the outside service. These are that service's scopes, not Tappify's."
626
+ },
627
+ "tokenRequestEncoding": {
628
+ "type": "string",
629
+ "enum": [
630
+ "form",
631
+ "json"
632
+ ],
633
+ "description": "The request body encoding for authorization-code and refresh token exchanges. When omitted, uses form encoding (application/x-www-form-urlencoded); json uses application/json."
626
634
  }
627
635
  },
628
636
  "required": [
@@ -1 +0,0 @@
1
- {"version":3,"sources":["/home/runner/work/extension-sdk/extension-sdk/dist/chunk-EB5XWQAU.cjs","../src/server/events.ts","../src/server/work-events.ts"],"names":[],"mappings":"AAAA;AACE;AACA;AACA;AACA;AACF,wDAA6B;AAC7B;AACE;AACF,wDAA6B;AAC7B;AACA;AC8BA,IAAM,iBAAA,EAAmB,wBAAA;AAEzB,SAAS,KAAA,CAAM,MAAA,EAA6B;AAC1C,EAAA,OAAO,KAAA,CAAM,IAAA,CAAK,IAAI,UAAA,CAAW,MAAM,CAAC,CAAA,CACrC,GAAA,CAAI,CAAA,IAAA,EAAA,GAAQ,IAAA,CAAK,QAAA,CAAS,EAAE,CAAA,CAAE,QAAA,CAAS,CAAA,EAAG,GAAG,CAAC,CAAA,CAC9C,IAAA,CAAK,EAAE,CAAA;AACZ;AAsBA,MAAA,SAAsB,WAAA,CACpB,MAAA,EACA,IAAA,EACiB;AACjB,EAAA,MAAM,QAAA,EAAU,IAAI,WAAA,CAAY,CAAA;AAChC,EAAA,MAAM,IAAA,EAAM,MAAM,MAAA,CAAO,MAAA,CAAO,SAAA;AAAA,IAC9B,KAAA;AAAA,IACA,OAAA,CAAQ,MAAA,CAAO,MAAM,CAAA;AAAA,IACrB,EAAE,IAAA,EAAM,MAAA,EAA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ACxD,EAAA,MAAM,IAAA,mBACJ,OAAA,CAAQ,QAAA,UACR,CAAA,mBAAA;AAE4B,EAAA;AACG,EAAA;AACvB,IAAA;AACC,IAAA;AACS,MAAA;AACO,MAAA;AACzB,IAAA;AACA,IAAA;AACD,EAAA;AAEiB,EAAA;AACQ,IAAA;AACd,IAAA;AACW,MAAA;AACQ,MAAA;AAClB,MAAA;AACX,IAAA;AACF,EAAA;AACF;ADhGmC;AACA;AElCgB;AACzB,EAAA;AAC1B;AAE+C;AAChB,EAAA;AAEN,EAAA;AAEd,IAAA;AAEa,EAAA;AACU,IAAA;AAC9B,EAAA;AAEO,IAAA;AAEqB,EAAA;AACF,EAAA;AACD,EAAA;AACT,EAAA;AACc,IAAA;AAEnB,EAAA;AACqB,IAAA;AACH,EAAA;AACC,IAAA;AAG5B,IAAA;AAKJ,EAAA;AAE8B,EAAA;AACJ,EAAA;AAGxB,EAAA;AAMJ;AAaE;AAGqB,EAAA;AACT,IAAA;AACR,MAAA;AACF,IAAA;AAC+B,EAAA;AACrB,IAAA;AACR,MAAA;AACF,IAAA;AAE+B,EAAA;AACT,EAAA;AACQ,EAAA;AACtB,IAAA;AACC,IAAA;AACS,MAAA;AACO,MAAA;AACzB,IAAA;AACA,IAAA;AACD,EAAA;AAEiB,EAAA;AACe,IAAA;AAC3B,IAAA;AACmB,MAAA;AACf,IAAA;AAER,IAAA;AACU,IAAA;AACW,MAAA;AACQ,MAAA;AAClB,MAAA;AACX,IAAA;AACF,EAAA;AACF;AFFmC;AACA;AACA;AACA;AACA;AACA","file":"/home/runner/work/extension-sdk/extension-sdk/dist/chunk-EB5XWQAU.cjs","sourcesContent":[null,"import { TapServerError } from '../client/errors';\nimport type { WebhookName, WebhookPayload } from '../client/types';\nimport { SERVER_ERROR_CODES } from './codes';\nimport { readRecord, readText } from './wire';\n\n/** The body `sendEvent` posts to Tappify, and the body the signature covers. */\nexport interface WebhookEnvelope {\n /** The declared webhook name. */\n event: string;\n /** The extension id the event came from. */\n source: string;\n /** When the event happened, as an ISO timestamp. */\n occurredAt: string;\n /** The build the event belongs to, when it belongs to one. */\n build?: string;\n /** The key Tappify deduplicates on, so a retry is not counted twice. */\n dedupeKey: string;\n payload: Record<string, unknown>;\n}\n\n/** The third argument of `sendEvent`. */\nexport interface SendEventOptions {\n /** Which install the event belongs to. */\n installId: string;\n extensionId: string;\n /** The inbound signing secret from the extension's Server page. */\n secret: string;\n /** A full url to post to, which replaces `baseUrl` and the built path. */\n endpoint?: string;\n /** The Tappify origin to build the path under. Defaults to production. */\n baseUrl?: string;\n /** Defaults to a fresh UUID, so give your own to make a retry idempotent. */\n dedupeKey?: string;\n build?: string;\n /** Defaults to now, in ISO form. */\n occurredAt?: string;\n /** A `fetch` of your own, for a test or a proxy. Defaults to the global one. */\n fetch?: typeof fetch;\n}\n\nconst DEFAULT_BASE_URL = 'https://api.tappify.ai';\n\nfunction toHex(buffer: ArrayBuffer): string {\n return Array.from(new Uint8Array(buffer))\n .map(byte => byte.toString(16).padStart(2, '0'))\n .join('');\n}\n\n/**\n * Returns the hex HMAC-SHA-256 of a raw body under a shared secret.\n *\n * @remarks\n * This is the value `sendEvent` sends as `X-Tappify-Signature`, computed over the\n * exact bytes of the body it posts. Call it directly only when you build the\n * request yourself, and sign the serialised string you send rather than\n * re-serialising the object, because a different key order is a different\n * signature. Uses Web Crypto, so it runs on Node, Cloudflare Workers and Vercel\n * alike.\n *\n * @example\n * ```ts\n * import { signWebhook } from '@tappify/extension-sdk/server';\n *\n * async function signed(body: string): Promise<Record<string, string>> {\n * return { 'x-tappify-signature': await signWebhook('whsec_test', body) };\n * }\n * ```\n */\nexport async function signWebhook(\n secret: string,\n body: string,\n): Promise<string> {\n const encoder = new TextEncoder();\n const key = await crypto.subtle.importKey(\n 'raw',\n encoder.encode(secret),\n { name: 'HMAC', hash: 'SHA-256' },\n false,\n ['sign'],\n );\n const signature = await crypto.subtle.sign('HMAC', key, encoder.encode(body));\n return toHex(signature);\n}\n\nasync function rejectionCode(response: Response): Promise<string | null> {\n try {\n const payload: unknown = await response.json();\n return readText(readRecord(payload, 'error'), 'code');\n } catch {\n return null;\n }\n}\n\n/**\n * Posts one of your declared webhook events to Tappify, signed with the install's\n * inbound secret.\n *\n * @remarks\n * The name and the payload are narrowed by the `TapWebhookMap` augmentation\n * `tappify extension types` writes. It builds the envelope, signs the serialised\n * body and posts it to the install's hook path under `baseUrl`, or to `endpoint`\n * when you give one. A response Tappify did not accept rejects with a\n * `TapServerError` whose `code` is always `TAP_WEBHOOK_REJECTED`, carrying the HTTP\n * status, and with Tappify's own code in the message text rather than in `code`;\n * the two usual causes are the wrong signing\n * secret and an event the manifest does not declare. Pass your own `dedupeKey` to\n * make a retry idempotent, because the default is a fresh UUID.\n *\n * @example\n * ```ts\n * import { sendEvent } from '@tappify/extension-sdk/server';\n *\n * async function reportAnomaly(installId: string, why: string): Promise<void> {\n * await sendEvent('anomaly.detected', { why }, {\n * installId,\n * extensionId: 'starter',\n * secret: process.env.TAPPIFY_INBOUND_SECRET ?? '',\n * dedupeKey: `anomaly-${installId}-${why}`,\n * });\n * }\n * ```\n */\nexport async function sendEvent<E extends WebhookName>(\n name: E,\n payload: WebhookPayload<E>,\n options: SendEventOptions,\n): Promise<void> {\n const envelope: WebhookEnvelope = {\n event: name,\n source: options.extensionId,\n occurredAt: options.occurredAt ?? new Date().toISOString(),\n dedupeKey: options.dedupeKey ?? crypto.randomUUID(),\n payload: { ...payload },\n };\n\n if (options.build !== undefined) envelope.build = options.build;\n\n const body = JSON.stringify(envelope);\n const signature = await signWebhook(options.secret, body);\n const url =\n options.endpoint ??\n `${options.baseUrl ?? DEFAULT_BASE_URL}/api/v1/extensions/hooks/${options.extensionId}/${options.installId}`;\n\n const send = options.fetch ?? fetch;\n const response = await send(url, {\n method: 'POST',\n headers: {\n 'content-type': 'application/json',\n 'x-tappify-signature': signature,\n },\n body,\n });\n\n if (!response.ok) {\n const rejection = await rejectionCode(response);\n throw new TapServerError(\n SERVER_ERROR_CODES.WEBHOOK_REJECTED,\n `Tappify answered ${String(response.status)}${rejection === null ? '' : ` (${rejection})`} for ${name}. Check the inbound signing secret on the extension's Server page, and that the event is declared under contributes.webhooks.`,\n response.status,\n );\n }\n}\n","import { TapServerError } from '../client/errors';\nimport { SERVER_ERROR_CODES } from './codes';\nimport { signWebhook } from './events';\nimport { readRecord, readText, readUnknown } from './wire';\nimport type { WorkHydratedEvent, WorkHydratedEventBase } from './work';\n\n/** An opaque provider signal to hydrate using current install credentials. */\nexport interface WorkHydrationReferenceEvent extends WorkHydratedEventBase {\n type: WorkHydratedEvent['type'];\n /** A nonempty, short-lived reference resolved by the hydrate_event handler. */\n hydrateRef: string;\n /** Normalized comment content must not accompany a reference. */\n comment?: never;\n /** Normalized status content must not accompany a reference. */\n status?: never;\n}\n\n/** Complete normalized content or an opaque reference, with stable retry identity. */\nexport type WorkEvent =\n | (WorkHydratedEvent & { hydrateRef?: never })\n | WorkHydrationReferenceEvent;\n\n/** Install-specific delivery values provisioned through work configure. */\nexport interface SendWorkEventOptions {\n /** The exact provisioned callback URL; no production default is supplied. */\n callbackUrl: string;\n /** The per-install work-event signing secret provisioned with the callback. */\n secret: string;\n /** A transport for tests or a proxy; defaults to global fetch. */\n fetch?: typeof fetch;\n}\n\nfunction nonempty(value: unknown): value is string {\n return typeof value === 'string' && value.trim().length > 0;\n}\n\nfunction validEvent(event: WorkEvent): boolean {\n const type = readText(event, 'type');\n if (\n !['comment.created', 'status.changed', 'item.deleted'].includes(type ?? '')\n )\n return false;\n if (\n !['externalItemId', 'providerEventId', 'occurredAt', 'dedupeKey'].every(\n key => nonempty(readUnknown(event, key)),\n )\n )\n return false;\n\n const reference = readUnknown(event, 'hydrateRef');\n const comment = readUnknown(event, 'comment');\n const status = readUnknown(event, 'status');\n if (reference !== undefined)\n return nonempty(reference) && comment === undefined && status === undefined;\n\n if (type === 'item.deleted')\n return comment === undefined && status === undefined;\n if (type === 'status.changed') {\n const normalized = readRecord(event, 'status');\n return (\n comment === undefined &&\n nonempty(normalized.id) &&\n nonempty(normalized.label) &&\n typeof normalized.stage === 'string' &&\n ['open', 'in_progress', 'done'].includes(normalized.stage)\n );\n }\n\n const normalized = readRecord(event, 'comment');\n const author = readRecord(normalized, 'author');\n return (\n status === undefined &&\n nonempty(normalized.externalCommentId) &&\n typeof normalized.body === 'string' &&\n nonempty(normalized.createdAt) &&\n nonempty(author.id) &&\n nonempty(author.displayName)\n );\n}\n\n/**\n * Sends one provider work event to the callback provisioned for this install.\n *\n * @remarks\n * Pass the callbackUrl and secret received through configure unchanged. The\n * event's required dedupeKey identifies the logical provider signal and must be\n * reused on retries. Complete normalized content and an opaque hydrateRef are\n * mutually exclusive. The exact serialized UTF-8 body is signed with HMAC-SHA-256.\n * This callback is independent of declared alert and banner webhooks.\n */\nexport async function sendWorkEvent(\n event: WorkEvent,\n options: SendWorkEventOptions,\n): Promise<void> {\n if (!validEvent(event))\n throw new TypeError(\n 'Invalid work event: provide complete normalized content or a nonempty hydrateRef, with routing and identity fields.',\n );\n if (!nonempty(options.callbackUrl))\n throw new TypeError(\n 'A work event requires the callbackUrl provisioned through configure.',\n );\n\n const body = JSON.stringify(event);\n const signature = await signWebhook(options.secret, body);\n const response = await (options.fetch ?? fetch)(options.callbackUrl, {\n method: 'POST',\n headers: {\n 'content-type': 'application/json',\n 'x-tappify-signature': signature,\n },\n body,\n });\n\n if (!response.ok) {\n let rejection: string | null = null;\n try {\n rejection = readText(readRecord(await response.json(), 'error'), 'code');\n } catch {\n // Proxies may return a non-JSON rejection body.\n }\n throw new TapServerError(\n SERVER_ERROR_CODES.WEBHOOK_REJECTED,\n `Tappify answered ${String(response.status)}${rejection === null ? '' : ` (${rejection})`} for work event ${event.type}. Check the callback URL and per-install work-event signing secret provisioned through configure.`,\n response.status,\n );\n }\n}\n"]}
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/server/events.ts","../src/server/work-events.ts"],"sourcesContent":["import { TapServerError } from '../client/errors';\nimport type { WebhookName, WebhookPayload } from '../client/types';\nimport { SERVER_ERROR_CODES } from './codes';\nimport { readRecord, readText } from './wire';\n\n/** The body `sendEvent` posts to Tappify, and the body the signature covers. */\nexport interface WebhookEnvelope {\n /** The declared webhook name. */\n event: string;\n /** The extension id the event came from. */\n source: string;\n /** When the event happened, as an ISO timestamp. */\n occurredAt: string;\n /** The build the event belongs to, when it belongs to one. */\n build?: string;\n /** The key Tappify deduplicates on, so a retry is not counted twice. */\n dedupeKey: string;\n payload: Record<string, unknown>;\n}\n\n/** The third argument of `sendEvent`. */\nexport interface SendEventOptions {\n /** Which install the event belongs to. */\n installId: string;\n extensionId: string;\n /** The inbound signing secret from the extension's Server page. */\n secret: string;\n /** A full url to post to, which replaces `baseUrl` and the built path. */\n endpoint?: string;\n /** The Tappify origin to build the path under. Defaults to production. */\n baseUrl?: string;\n /** Defaults to a fresh UUID, so give your own to make a retry idempotent. */\n dedupeKey?: string;\n build?: string;\n /** Defaults to now, in ISO form. */\n occurredAt?: string;\n /** A `fetch` of your own, for a test or a proxy. Defaults to the global one. */\n fetch?: typeof fetch;\n}\n\nconst DEFAULT_BASE_URL = 'https://api.tappify.ai';\n\nfunction toHex(buffer: ArrayBuffer): string {\n return Array.from(new Uint8Array(buffer))\n .map(byte => byte.toString(16).padStart(2, '0'))\n .join('');\n}\n\n/**\n * Returns the hex HMAC-SHA-256 of a raw body under a shared secret.\n *\n * @remarks\n * This is the value `sendEvent` sends as `X-Tappify-Signature`, computed over the\n * exact bytes of the body it posts. Call it directly only when you build the\n * request yourself, and sign the serialised string you send rather than\n * re-serialising the object, because a different key order is a different\n * signature. Uses Web Crypto, so it runs on Node, Cloudflare Workers and Vercel\n * alike.\n *\n * @example\n * ```ts\n * import { signWebhook } from '@tappify/extension-sdk/server';\n *\n * async function signed(body: string): Promise<Record<string, string>> {\n * return { 'x-tappify-signature': await signWebhook('whsec_test', body) };\n * }\n * ```\n */\nexport async function signWebhook(\n secret: string,\n body: string,\n): Promise<string> {\n const encoder = new TextEncoder();\n const key = await crypto.subtle.importKey(\n 'raw',\n encoder.encode(secret),\n { name: 'HMAC', hash: 'SHA-256' },\n false,\n ['sign'],\n );\n const signature = await crypto.subtle.sign('HMAC', key, encoder.encode(body));\n return toHex(signature);\n}\n\nasync function rejectionCode(response: Response): Promise<string | null> {\n try {\n const payload: unknown = await response.json();\n return readText(readRecord(payload, 'error'), 'code');\n } catch {\n return null;\n }\n}\n\n/**\n * Posts one of your declared webhook events to Tappify, signed with the install's\n * inbound secret.\n *\n * @remarks\n * The name and the payload are narrowed by the `TapWebhookMap` augmentation\n * `tappify extension types` writes. It builds the envelope, signs the serialised\n * body and posts it to the install's hook path under `baseUrl`, or to `endpoint`\n * when you give one. A response Tappify did not accept rejects with a\n * `TapServerError` whose `code` is always `TAP_WEBHOOK_REJECTED`, carrying the HTTP\n * status, and with Tappify's own code in the message text rather than in `code`;\n * the two usual causes are the wrong signing\n * secret and an event the manifest does not declare. Pass your own `dedupeKey` to\n * make a retry idempotent, because the default is a fresh UUID.\n *\n * @example\n * ```ts\n * import { sendEvent } from '@tappify/extension-sdk/server';\n *\n * async function reportAnomaly(installId: string, why: string): Promise<void> {\n * await sendEvent('anomaly.detected', { why }, {\n * installId,\n * extensionId: 'starter',\n * secret: process.env.TAPPIFY_INBOUND_SECRET ?? '',\n * dedupeKey: `anomaly-${installId}-${why}`,\n * });\n * }\n * ```\n */\nexport async function sendEvent<E extends WebhookName>(\n name: E,\n payload: WebhookPayload<E>,\n options: SendEventOptions,\n): Promise<void> {\n const envelope: WebhookEnvelope = {\n event: name,\n source: options.extensionId,\n occurredAt: options.occurredAt ?? new Date().toISOString(),\n dedupeKey: options.dedupeKey ?? crypto.randomUUID(),\n payload: { ...payload },\n };\n\n if (options.build !== undefined) envelope.build = options.build;\n\n const body = JSON.stringify(envelope);\n const signature = await signWebhook(options.secret, body);\n const url =\n options.endpoint ??\n `${options.baseUrl ?? DEFAULT_BASE_URL}/api/v1/extensions/hooks/${options.extensionId}/${options.installId}`;\n\n const send = options.fetch ?? fetch;\n const response = await send(url, {\n method: 'POST',\n headers: {\n 'content-type': 'application/json',\n 'x-tappify-signature': signature,\n },\n body,\n });\n\n if (!response.ok) {\n const rejection = await rejectionCode(response);\n throw new TapServerError(\n SERVER_ERROR_CODES.WEBHOOK_REJECTED,\n `Tappify answered ${String(response.status)}${rejection === null ? '' : ` (${rejection})`} for ${name}. Check the inbound signing secret on the extension's Server page, and that the event is declared under contributes.webhooks.`,\n response.status,\n );\n }\n}\n","import { TapServerError } from '../client/errors';\nimport { SERVER_ERROR_CODES } from './codes';\nimport { signWebhook } from './events';\nimport { readRecord, readText, readUnknown } from './wire';\nimport type { WorkHydratedEvent, WorkHydratedEventBase } from './work';\n\n/** An opaque provider signal to hydrate using current install credentials. */\nexport interface WorkHydrationReferenceEvent extends WorkHydratedEventBase {\n type: WorkHydratedEvent['type'];\n /** A nonempty, short-lived reference resolved by the hydrate_event handler. */\n hydrateRef: string;\n /** Normalized comment content must not accompany a reference. */\n comment?: never;\n /** Normalized status content must not accompany a reference. */\n status?: never;\n}\n\n/** Complete normalized content or an opaque reference, with stable retry identity. */\nexport type WorkEvent =\n | (WorkHydratedEvent & { hydrateRef?: never })\n | WorkHydrationReferenceEvent;\n\n/** Install-specific delivery values provisioned through work configure. */\nexport interface SendWorkEventOptions {\n /** The exact provisioned callback URL; no production default is supplied. */\n callbackUrl: string;\n /** The per-install work-event signing secret provisioned with the callback. */\n secret: string;\n /** A transport for tests or a proxy; defaults to global fetch. */\n fetch?: typeof fetch;\n}\n\nfunction nonempty(value: unknown): value is string {\n return typeof value === 'string' && value.trim().length > 0;\n}\n\nfunction validEvent(event: WorkEvent): boolean {\n const type = readText(event, 'type');\n if (\n !['comment.created', 'status.changed', 'item.deleted'].includes(type ?? '')\n )\n return false;\n if (\n !['externalItemId', 'providerEventId', 'occurredAt', 'dedupeKey'].every(\n key => nonempty(readUnknown(event, key)),\n )\n )\n return false;\n\n const reference = readUnknown(event, 'hydrateRef');\n const comment = readUnknown(event, 'comment');\n const status = readUnknown(event, 'status');\n if (reference !== undefined)\n return nonempty(reference) && comment === undefined && status === undefined;\n\n if (type === 'item.deleted')\n return comment === undefined && status === undefined;\n if (type === 'status.changed') {\n const normalized = readRecord(event, 'status');\n return (\n comment === undefined &&\n nonempty(normalized.id) &&\n nonempty(normalized.label) &&\n typeof normalized.stage === 'string' &&\n ['open', 'in_progress', 'done'].includes(normalized.stage)\n );\n }\n\n const normalized = readRecord(event, 'comment');\n const author = readRecord(normalized, 'author');\n return (\n status === undefined &&\n nonempty(normalized.externalCommentId) &&\n typeof normalized.body === 'string' &&\n nonempty(normalized.createdAt) &&\n nonempty(author.id) &&\n nonempty(author.displayName)\n );\n}\n\n/**\n * Sends one provider work event to the callback provisioned for this install.\n *\n * @remarks\n * Pass the callbackUrl and secret received through configure unchanged. The\n * event's required dedupeKey identifies the logical provider signal and must be\n * reused on retries. Complete normalized content and an opaque hydrateRef are\n * mutually exclusive. The exact serialized UTF-8 body is signed with HMAC-SHA-256.\n * This callback is independent of declared alert and banner webhooks.\n */\nexport async function sendWorkEvent(\n event: WorkEvent,\n options: SendWorkEventOptions,\n): Promise<void> {\n if (!validEvent(event))\n throw new TypeError(\n 'Invalid work event: provide complete normalized content or a nonempty hydrateRef, with routing and identity fields.',\n );\n if (!nonempty(options.callbackUrl))\n throw new TypeError(\n 'A work event requires the callbackUrl provisioned through configure.',\n );\n\n const body = JSON.stringify(event);\n const signature = await signWebhook(options.secret, body);\n const response = await (options.fetch ?? fetch)(options.callbackUrl, {\n method: 'POST',\n headers: {\n 'content-type': 'application/json',\n 'x-tappify-signature': signature,\n },\n body,\n });\n\n if (!response.ok) {\n let rejection: string | null = null;\n try {\n rejection = readText(readRecord(await response.json(), 'error'), 'code');\n } catch {\n // Proxies may return a non-JSON rejection body.\n }\n throw new TapServerError(\n SERVER_ERROR_CODES.WEBHOOK_REJECTED,\n `Tappify answered ${String(response.status)}${rejection === null ? '' : ` (${rejection})`} for work event ${event.type}. Check the callback URL and per-install work-event signing secret provisioned through configure.`,\n response.status,\n );\n }\n}\n"],"mappings":";;;;;;;;;;;AAwCA,IAAM,mBAAmB;AAEzB,SAAS,MAAM,QAA6B;AAC1C,SAAO,MAAM,KAAK,IAAI,WAAW,MAAM,CAAC,EACrC,IAAI,UAAQ,KAAK,SAAS,EAAE,EAAE,SAAS,GAAG,GAAG,CAAC,EAC9C,KAAK,EAAE;AACZ;AAsBA,eAAsB,YACpB,QACA,MACiB;AACjB,QAAM,UAAU,IAAI,YAAY;AAChC,QAAM,MAAM,MAAM,OAAO,OAAO;AAAA,IAC9B;AAAA,IACA,QAAQ,OAAO,MAAM;AAAA,IACrB,EAAE,MAAM,QAAQ,MAAM,UAAU;AAAA,IAChC;AAAA,IACA,CAAC,MAAM;AAAA,EACT;AACA,QAAM,YAAY,MAAM,OAAO,OAAO,KAAK,QAAQ,KAAK,QAAQ,OAAO,IAAI,CAAC;AAC5E,SAAO,MAAM,SAAS;AACxB;AAEA,eAAe,cAAc,UAA4C;AACvE,MAAI;AACF,UAAM,UAAmB,MAAM,SAAS,KAAK;AAC7C,WAAO,SAAS,WAAW,SAAS,OAAO,GAAG,MAAM;AAAA,EACtD,QAAQ;AACN,WAAO;AAAA,EACT;AACF;AA+BA,eAAsB,UACpB,MACA,SACA,SACe;AACf,QAAM,WAA4B;AAAA,IAChC,OAAO;AAAA,IACP,QAAQ,QAAQ;AAAA,IAChB,YAAY,QAAQ,eAAc,oBAAI,KAAK,GAAE,YAAY;AAAA,IACzD,WAAW,QAAQ,aAAa,OAAO,WAAW;AAAA,IAClD,SAAS,EAAE,GAAG,QAAQ;AAAA,EACxB;AAEA,MAAI,QAAQ,UAAU,OAAW,UAAS,QAAQ,QAAQ;AAE1D,QAAM,OAAO,KAAK,UAAU,QAAQ;AACpC,QAAM,YAAY,MAAM,YAAY,QAAQ,QAAQ,IAAI;AACxD,QAAM,MACJ,QAAQ,YACR,GAAG,QAAQ,WAAW,gBAAgB,4BAA4B,QAAQ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