@tappify/extension-sdk 2.0.0 → 2.1.0-beta.1
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 +208 -0
- package/dist/chunk-2CY5HVY7.mjs +59 -0
- package/dist/chunk-2CY5HVY7.mjs.map +1 -0
- package/dist/{chunk-2DBSVKAU.cjs → chunk-6HETNZJY.cjs} +1 -1
- package/dist/chunk-6HETNZJY.cjs.map +1 -0
- package/dist/{chunk-PYJMJF44.cjs → chunk-7YKH4LZN.cjs} +9 -2
- package/dist/chunk-7YKH4LZN.cjs.map +1 -0
- package/dist/{chunk-RMUWRESK.cjs → chunk-A74HCO6T.cjs} +31 -18
- package/dist/chunk-A74HCO6T.cjs.map +1 -0
- package/dist/chunk-BPCGXXMD.cjs +781 -0
- package/dist/chunk-BPCGXXMD.cjs.map +1 -0
- package/dist/chunk-EB5XWQAU.cjs +132 -0
- package/dist/chunk-EB5XWQAU.cjs.map +1 -0
- package/dist/{chunk-5AAPD5WV.cjs → chunk-GAUZYBXE.cjs} +11 -11
- package/dist/chunk-GAUZYBXE.cjs.map +1 -0
- package/dist/chunk-J5LGTIGS.mjs +10 -0
- package/dist/chunk-J5LGTIGS.mjs.map +1 -0
- package/dist/{chunk-ZT35X7KL.mjs → chunk-KZ5NGFUP.mjs} +22 -9
- package/dist/chunk-KZ5NGFUP.mjs.map +1 -0
- package/dist/chunk-NN263PGQ.cjs +70 -0
- package/dist/chunk-NN263PGQ.cjs.map +1 -0
- package/dist/{chunk-3YWVYA42.cjs → chunk-O357OJXL.cjs} +14 -18
- package/dist/chunk-O357OJXL.cjs.map +1 -0
- package/dist/chunk-ONJMPO3P.cjs +59 -0
- package/dist/chunk-ONJMPO3P.cjs.map +1 -0
- package/dist/{chunk-OPPYEA7F.cjs → chunk-PRCZMOLD.cjs} +3 -3
- package/dist/chunk-PRCZMOLD.cjs.map +1 -0
- package/dist/chunk-Q7SFCCGT.cjs +10 -0
- package/dist/chunk-Q7SFCCGT.cjs.map +1 -0
- package/dist/{chunk-QHM7XNRK.mjs → chunk-QA5AL3VZ.mjs} +2 -2
- package/dist/{chunk-QHM7XNRK.mjs.map → chunk-QA5AL3VZ.mjs.map} +1 -1
- package/dist/chunk-QJMZRV7A.mjs +132 -0
- package/dist/chunk-QJMZRV7A.mjs.map +1 -0
- package/dist/{chunk-CSTYBKZC.mjs → chunk-QXD7WVKK.mjs} +1 -1
- package/dist/chunk-QXD7WVKK.mjs.map +1 -0
- package/dist/{chunk-4C5Z3CIK.mjs → chunk-RBIQT75L.mjs} +2 -2
- package/dist/chunk-RBIQT75L.mjs.map +1 -0
- package/dist/{chunk-MNDVYPEP.mjs → chunk-SGCYEEXD.mjs} +9 -2
- package/dist/chunk-SGCYEEXD.mjs.map +1 -0
- package/dist/{chunk-BDCX6LRQ.mjs → chunk-SGEYDV3K.mjs} +3 -3
- package/dist/chunk-SGEYDV3K.mjs.map +1 -0
- package/dist/{chunk-IGK2AP6J.mjs → chunk-SLGOHIBL.mjs} +13 -17
- package/dist/chunk-SLGOHIBL.mjs.map +1 -0
- package/dist/chunk-SWG7CNTZ.mjs +781 -0
- package/dist/chunk-SWG7CNTZ.mjs.map +1 -0
- package/dist/{chunk-7KIKOH5H.cjs → chunk-VV7ELNRW.cjs} +3 -3
- package/dist/chunk-VV7ELNRW.cjs.map +1 -0
- package/dist/chunk-Z43DPNZ6.mjs +70 -0
- package/dist/chunk-Z43DPNZ6.mjs.map +1 -0
- package/dist/client-CV1qzQgx.d.cts +25 -0
- package/dist/client-CnlSHDWE.d.ts +25 -0
- package/dist/codegen.cjs.map +1 -1
- package/dist/codegen.d.cts +40 -7
- package/dist/codegen.d.ts +40 -7
- package/dist/codegen.mjs.map +1 -1
- package/dist/{constants-DJ_KgZpN.d.cts → constants-BAimnqOK.d.cts} +41 -8
- package/dist/{constants-DJ_KgZpN.d.ts → constants-BAimnqOK.d.ts} +41 -8
- package/dist/{context-Ml7k_V14.d.ts → context-Cr93B05o.d.ts} +5 -4
- package/dist/{context-Dt6xh_5t.d.cts → context-DJ3REtdT.d.cts} +5 -4
- package/dist/{errors-COsBh7kd.d.cts → errors-Cqh0wrqt.d.cts} +3 -2
- package/dist/{errors-COsBh7kd.d.ts → errors-Cqh0wrqt.d.ts} +3 -2
- package/dist/host.cjs +5 -4
- package/dist/host.cjs.map +1 -1
- package/dist/host.d.cts +5 -5
- package/dist/host.d.ts +5 -5
- package/dist/host.mjs +4 -3
- package/dist/host.mjs.map +1 -1
- package/dist/index.cjs +9 -656
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +69 -627
- package/dist/index.d.ts +69 -627
- package/dist/index.mjs +5 -652
- package/dist/index.mjs.map +1 -1
- package/dist/manifest.cjs +138 -85
- package/dist/manifest.cjs.map +1 -1
- package/dist/manifest.d.cts +93 -12
- package/dist/manifest.d.ts +93 -12
- package/dist/manifest.mjs +125 -72
- package/dist/manifest.mjs.map +1 -1
- package/dist/server.cjs +15 -66
- 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 +10 -61
- package/dist/server.mjs.map +1 -1
- package/dist/testing/index.cjs +73 -750
- package/dist/testing/index.cjs.map +1 -1
- package/dist/testing/index.d.cts +30 -11
- package/dist/testing/index.d.ts +30 -11
- package/dist/testing/index.mjs +89 -766
- package/dist/testing/index.mjs.map +1 -1
- package/dist/testing/jest.cjs +6 -5
- package/dist/testing/jest.cjs.map +1 -1
- package/dist/testing/jest.mjs +3 -2
- package/dist/testing/jest.mjs.map +1 -1
- package/dist/testing/vitest.cjs +6 -5
- package/dist/testing/vitest.cjs.map +1 -1
- package/dist/testing/vitest.d.cts +10 -0
- package/dist/testing/vitest.d.ts +10 -0
- package/dist/testing/vitest.mjs +3 -2
- package/dist/testing/vitest.mjs.map +1 -1
- package/dist/{types-DrpQSv_2.d.cts → types-BYGcp5pZ.d.ts} +4 -3
- package/dist/{types-DDAGLpov.d.ts → types-I1JOZyI_.d.cts} +4 -3
- package/dist/ui/styles.css +740 -0
- package/dist/ui.cjs +1018 -0
- package/dist/ui.cjs.map +1 -0
- package/dist/ui.d.cts +231 -0
- package/dist/ui.d.ts +231 -0
- package/dist/ui.mjs +1018 -0
- package/dist/ui.mjs.map +1 -0
- package/dist/vite-preview-bootstrap.cjs +66 -0
- package/dist/vite-preview-bootstrap.cjs.map +1 -0
- package/dist/vite-preview-bootstrap.d.cts +15 -0
- package/dist/vite-preview-bootstrap.d.ts +15 -0
- package/dist/vite-preview-bootstrap.mjs +66 -0
- package/dist/vite-preview-bootstrap.mjs.map +1 -0
- package/dist/vite-preview.cjs +876 -0
- package/dist/vite-preview.cjs.map +1 -0
- package/dist/vite-preview.d.cts +9 -0
- package/dist/vite-preview.d.ts +9 -0
- package/dist/vite-preview.mjs +876 -0
- package/dist/vite-preview.mjs.map +1 -0
- package/dist/vite.cjs +316 -59
- package/dist/vite.cjs.map +1 -1
- package/dist/vite.d.cts +51 -8
- package/dist/vite.d.ts +51 -8
- package/dist/vite.mjs +308 -53
- package/dist/vite.mjs.map +1 -1
- package/dist/work-events-DB3WR468.d.ts +547 -0
- package/dist/work-events-Dxe7Djdy.d.cts +547 -0
- package/package.json +19 -2
- package/schema/extension-v2.json +432 -121
- package/dist/chunk-2DBSVKAU.cjs.map +0 -1
- package/dist/chunk-3YWVYA42.cjs.map +0 -1
- package/dist/chunk-4C5Z3CIK.mjs.map +0 -1
- package/dist/chunk-5AAPD5WV.cjs.map +0 -1
- package/dist/chunk-7KIKOH5H.cjs.map +0 -1
- package/dist/chunk-BDCX6LRQ.mjs.map +0 -1
- package/dist/chunk-CSTYBKZC.mjs.map +0 -1
- package/dist/chunk-IGK2AP6J.mjs.map +0 -1
- package/dist/chunk-MNDVYPEP.mjs.map +0 -1
- package/dist/chunk-OPPYEA7F.cjs.map +0 -1
- package/dist/chunk-PYJMJF44.cjs.map +0 -1
- package/dist/chunk-RMUWRESK.cjs.map +0 -1
- package/dist/chunk-ZT35X7KL.mjs.map +0 -1
- package/dist/handler-CZIlZ5vu.d.ts +0 -227
- package/dist/handler-kU9Jf36K.d.cts +0 -227
- package/dist/styles.css +0 -367
package/dist/codegen.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/codegen/generate.ts","../src/client/errors.ts"],"sourcesContent":["import { compile } from 'json-schema-to-typescript';\nimport { dirname, join } from 'node:path';\nimport { TapError } from '../client/errors';\nimport type {\n CredentialField,\n ExtensionManifest,\n JsonSchema,\n} from '../manifest/types';\n\nexport const GENERATED_HEADER = `/* eslint-disable */\n/**\n * Generated by \\`tappify extension types\\`. Do not edit by hand.\n * Re-run the command after changing tappify.extension.json or any schema it points at.\n */`;\n\nexport interface RegistrySnapshot {\n events: { name: string; payload?: JsonSchema }[];\n}\n\nexport interface GenerateTypesOptions {\n manifest: ExtensionManifest;\n registrySnapshot?: RegistrySnapshot;\n readSchemaFile?(path: string): JsonSchema;\n /**\n * The extension root. A `$ref` inside a schema file resolves against that\n * file's own directory under it, the way the host and the Tap Store read\n * it; without a root the process directory stands in.\n */\n cwd?: string;\n}\n\nconst STYLE = {\n bracketSpacing: true,\n printWidth: 80,\n semi: true,\n singleQuote: true,\n tabWidth: 2,\n trailingComma: 'all',\n useTabs: false,\n} as const;\n\nfunction pascal(value: string): string {\n return value\n .split(/[^A-Za-z0-9]+/)\n .filter(part => part !== '')\n .map(part => part.charAt(0).toUpperCase() + part.slice(1))\n .join('');\n}\n\ninterface Emitter {\n declare(preferredName: string, schema: JsonSchema): Promise<string>;\n declarations(): string[];\n}\n\ninterface ResolvedSchema {\n schema: JsonSchema;\n /** Where the schema's own nested `$ref`s resolve from. */\n cwd?: string;\n}\n\nfunction createEmitter(\n resolveSchema: (schema: JsonSchema) => ResolvedSchema,\n): Emitter {\n const used = new Set<string>();\n const blocks: string[] = [];\n\n return {\n async declare(preferredName, schema) {\n let name = pascal(preferredName);\n let suffix = 2;\n while (used.has(name)) {\n name = `${pascal(preferredName)}${String(suffix)}`;\n suffix += 1;\n }\n used.add(name);\n\n const resolved = resolveSchema(schema);\n const input: Parameters<typeof compile>[0] = {\n ...resolved.schema,\n title: name,\n };\n\n const text = await compile(input, name, {\n bannerComment: '',\n additionalProperties: false,\n declareExternallyReferenced: true,\n enableConstEnums: false,\n format: true,\n style: STYLE,\n unknownAny: true,\n ...(resolved.cwd === undefined ? {} : { cwd: resolved.cwd }),\n });\n\n blocks.push(text.trim());\n return name;\n },\n declarations() {\n return blocks;\n },\n };\n}\n\nfunction credentialSchema(fields: CredentialField[]): JsonSchema {\n const properties: Record<string, JsonSchema> = {};\n const required: string[] = [];\n\n for (const field of fields) {\n const property: JsonSchema =\n field.type === 'select' && field.options\n ? { type: 'string', enum: field.options }\n : { type: 'string' };\n if (field.help !== undefined) property.description = field.help;\n properties[field.name] = property;\n if (field.required) required.push(field.name);\n }\n\n return { type: 'object', properties, required, additionalProperties: false };\n}\n\nexport async function generateTypes(\n options: GenerateTypesOptions,\n): Promise<string> {\n const { manifest, registrySnapshot } = options;\n const contributes = manifest.contributes;\n\n const resolveSchema = (schema: JsonSchema): ResolvedSchema => {\n const ref = schema.$ref;\n if (typeof ref !== 'string' || ref.startsWith('#')) {\n return { schema, cwd: options.cwd };\n }\n if (options.readSchemaFile === undefined) {\n throw new TapError(\n 'TAP_SCHEMA_UNRESOLVED',\n `The manifest points at the schema file \"${ref}\", but this call passed no readSchemaFile. Run \\`tappify extension types\\`, which reads schema files from the extension directory, or supply readSchemaFile.`,\n );\n }\n return {\n schema: options.readSchemaFile(ref),\n cwd:\n options.cwd === undefined ? undefined : dirname(join(options.cwd, ref)),\n };\n };\n\n const emitter = createEmitter(resolveSchema);\n const augmentations: string[] = [];\n\n const storageEntries = Object.entries(contributes.storage ?? {});\n if (storageEntries.length > 0) {\n const lines: string[] = [];\n for (const [name, collection] of storageEntries) {\n const typeName = await emitter.declare(name, collection.schema);\n const kind = collection.singleton === true ? 'singleton' : 'collection';\n lines.push(\n ` '${name}': { kind: '${kind}'; scope: '${collection.scope}'; document: ${typeName} };`,\n );\n }\n augmentations.push(` interface TapStorageMap {\\n${lines.join('\\n')}\\n }`);\n }\n\n const procedureEntries = Object.entries(manifest.server?.procedures ?? {});\n if (procedureEntries.length > 0) {\n const lines: string[] = [];\n for (const [name, declaration] of procedureEntries) {\n const inputName = await emitter.declare(\n `${name}Input`,\n declaration.input,\n );\n const outputName = await emitter.declare(\n `${name}Output`,\n declaration.output,\n );\n lines.push(\n ` '${name}': { input: ${inputName}; output: ${outputName} };`,\n );\n }\n augmentations.push(\n ` interface TapProcedureMap {\\n${lines.join('\\n')}\\n }`,\n );\n }\n\n const actions = contributes.ai?.actions ?? [];\n if (actions.length > 0) {\n const lines: string[] = [];\n for (const action of actions) {\n const name = await emitter.declare(`${action.id}Input`, action.input);\n lines.push(` '${action.id}': { input: ${name} };`);\n }\n augmentations.push(` interface TapActionMap {\\n${lines.join('\\n')}\\n }`);\n }\n\n const tools = contributes.ai?.tools ?? [];\n if (tools.length > 0) {\n const lines: string[] = [];\n for (const tool of tools) {\n const name = await emitter.declare(`${tool.id}Input`, tool.input);\n lines.push(` '${tool.id}': { input: ${name} };`);\n }\n augmentations.push(` interface TapToolMap {\\n${lines.join('\\n')}\\n }`);\n }\n\n const prompts = (contributes.ai?.prompts ?? []).filter(\n prompt => prompt.input !== undefined,\n );\n if (prompts.length > 0) {\n const lines: string[] = [];\n for (const prompt of prompts) {\n const name = await emitter.declare(\n `${prompt.id}PromptInput`,\n prompt.input ?? { type: 'object' },\n );\n lines.push(` '${prompt.id}': { input: ${name} };`);\n }\n augmentations.push(` interface TapPromptMap {\\n${lines.join('\\n')}\\n }`);\n }\n\n const webhooks = contributes.webhooks ?? [];\n if (webhooks.length > 0) {\n const lines: string[] = [];\n for (const webhook of webhooks) {\n const name = await emitter.declare(\n `${webhook.event}Payload`,\n webhook.payload,\n );\n lines.push(` '${webhook.event}': ${name};`);\n }\n augmentations.push(` interface TapWebhookMap {\\n${lines.join('\\n')}\\n }`);\n }\n\n if (registrySnapshot !== undefined && registrySnapshot.events.length > 0) {\n const lines: string[] = [];\n for (const event of registrySnapshot.events) {\n const name = await emitter.declare(\n `${event.name}Event`,\n event.payload ?? { type: 'object' },\n );\n lines.push(` '${event.name}': ${name};`);\n }\n augmentations.push(\n ` interface TapHostEventMap {\\n${lines.join('\\n')}\\n }`,\n );\n }\n\n const telemetry = manifest.telemetry ?? [];\n if (telemetry.length > 0) {\n const lines = telemetry.map(name => ` '${name}': true;`);\n augmentations.push(\n ` interface TapTelemetryEvents {\\n${lines.join('\\n')}\\n }`,\n );\n }\n\n if (contributes.settings) {\n const name = await emitter.declare('Settings', contributes.settings.schema);\n augmentations.push(` interface TapSettings extends ${name} {}`);\n }\n\n const credentialFields = contributes.connector?.auth?.fields ?? [];\n if (credentialFields.length > 0) {\n const name = await emitter.declare(\n 'Credentials',\n credentialSchema(credentialFields),\n );\n augmentations.push(` interface TapCredentials extends ${name} {}`);\n }\n\n const declarations = emitter.declarations();\n const module =\n augmentations.length === 0\n ? \"declare module '@tappify/extension-sdk' {}\"\n : `declare module '@tappify/extension-sdk' {\\n${augmentations.join('\\n\\n')}\\n}`;\n\n return [\n GENERATED_HEADER,\n '',\n ...(declarations.length > 0 ? [declarations.join('\\n\\n'), ''] : []),\n module,\n '',\n 'export {};',\n '',\n ].join('\\n');\n}\n","/** Every code a `TapError` the SDK raises carries. */\nexport type TapErrorCode =\n | 'TAP_OUTSIDE_HOST'\n | 'TAP_SCOPE_MISSING'\n | 'TAP_UNKNOWN_COLLECTION'\n | 'TAP_UNKNOWN_PROCEDURE'\n | 'TAP_NO_PORTAL'\n | 'TAP_NO_QUERY_CLIENT'\n | 'TAP_MANIFEST_INVALID'\n | 'TAP_ENTRY_MISSING'\n | 'TAP_STYLES_UNRESOLVED'\n | 'TAP_SCHEMA_UNRESOLVED'\n | 'TAP_TOKEN_MISSING'\n | 'TAP_TOKEN_INVALID'\n | 'TAP_TOKEN_AUDIENCE'\n | 'TAP_EVENT_ID_MISSING'\n | 'TAP_BODY_INVALID'\n | 'TAP_BODY_TOO_LARGE'\n | 'TAP_ROUTE_UNKNOWN'\n | 'TAP_HANDLER_MISSING'\n | 'TAP_INTERNAL_ERROR'\n | 'TAP_WEBHOOK_REJECTED'\n | 'TAP_TEST_TARGET_INVALID';\n\n/**\n * The same codes as `TapErrorCode`, as an array to iterate or check membership\n * against at runtime.\n */\nexport const TAP_ERROR_CODES: readonly TapErrorCode[] = [\n 'TAP_OUTSIDE_HOST',\n 'TAP_SCOPE_MISSING',\n 'TAP_UNKNOWN_COLLECTION',\n 'TAP_UNKNOWN_PROCEDURE',\n 'TAP_NO_PORTAL',\n 'TAP_NO_QUERY_CLIENT',\n 'TAP_MANIFEST_INVALID',\n 'TAP_ENTRY_MISSING',\n 'TAP_STYLES_UNRESOLVED',\n 'TAP_SCHEMA_UNRESOLVED',\n 'TAP_TOKEN_MISSING',\n 'TAP_TOKEN_INVALID',\n 'TAP_TOKEN_AUDIENCE',\n 'TAP_EVENT_ID_MISSING',\n 'TAP_BODY_INVALID',\n 'TAP_BODY_TOO_LARGE',\n 'TAP_ROUTE_UNKNOWN',\n 'TAP_HANDLER_MISSING',\n 'TAP_INTERNAL_ERROR',\n 'TAP_WEBHOOK_REJECTED',\n 'TAP_TEST_TARGET_INVALID',\n];\n\nconst CODE_SET = new Set<string>(TAP_ERROR_CODES);\n\n/**\n * The error the SDK and the host raise when a call cannot be served at all.\n *\n * @remarks\n * The SDK throws it for a mount outside the host (`TAP_OUTSIDE_HOST`), a\n * collection or procedure the manifest does not declare\n * (`TAP_UNKNOWN_COLLECTION`, `TAP_UNKNOWN_PROCEDURE`), a missing portal or query\n * client, a token the server rejected, and a misused testing helper. The host\n * turns a refused read or write into `TAP_SCOPE_MISSING`. Branch on `code`, which\n * is stable; the message is prose and changes. An error your own server raised is\n * a `TapServerError` instead.\n *\n * @example\n * ```tsx\n * import { TapError, TapErrorState, useTapQuery } from '@tappify/extension-sdk';\n *\n * function Revenue() {\n * const revenue = useTapQuery({\n * kind: 'revenue',\n * range: { from: '2026-09-01', to: '2026-09-08' },\n * });\n * if (TapError.is(revenue.error) && revenue.error.code === 'TAP_SCOPE_MISSING') {\n * return <TapErrorState title=\"Revenue is not shared with this extension\" />;\n * }\n * return <span>{revenue.data?.mrr ?? 0}</span>;\n * }\n * ```\n */\nexport class TapError extends Error {\n readonly code: TapErrorCode;\n\n constructor(code: TapErrorCode, message: string) {\n super(message);\n this.name = 'TapError';\n this.code = code;\n }\n\n /**\n * Narrows an unknown value to a `TapError`, by name and by a code it\n * recognises, so it holds across module instances.\n */\n static is(value: unknown): value is TapError {\n return (\n value instanceof Error &&\n value.name === 'TapError' &&\n 'code' in value &&\n typeof value.code === 'string' &&\n CODE_SET.has(value.code)\n );\n }\n}\n\n/**\n * The error a vendor server throws to answer a Tappify call with a code and a\n * message the owner sees.\n *\n * @remarks\n * `createTappifyHandler` catches it and answers `{ error: { code, message } }`\n * with `status`, or 400 when no status was given; the host relays both to the\n * calling mount, where they arrive as the `error` of `useTapServer`. Pick a code\n * of your own and keep it stable — the SDK's own codes are `SERVER_ERROR_CODES` —\n * and write the message for the owner, who reads it on screen.\n *\n * @example\n * ```ts\n * import { TapServerError } from '@tappify/extension-sdk/server';\n *\n * function assertRange(days: number) {\n * if (days > 0) return;\n * throw new TapServerError(\n * 'RANGE_TOO_SHORT',\n * 'getSummary needs a range of at least one day. Widen the date picker, then retry.',\n * 400,\n * );\n * }\n * ```\n */\nexport class TapServerError extends Error {\n readonly code: string;\n readonly status: number | undefined;\n\n constructor(code: string, message: string, status?: number) {\n super(message);\n this.name = 'TapServerError';\n this.code = code;\n this.status = status;\n }\n\n /** The wire body the handler answers with, without the status. */\n toJSON(): { error: { code: string; message: string } } {\n return { error: { code: this.code, message: this.message } };\n }\n\n /**\n * Narrows an unknown value to a `TapServerError` by name and by carrying a\n * string `code`, so it holds across module instances.\n */\n static is(value: unknown): value is TapServerError {\n return (\n value instanceof Error &&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AAI,iBAAiB,SAAS,GAAG;AAC/B,UAAM,OAAO,MAAM,QAAQ;AAAA,MACzB;AAAA,MACA,iBAAiB,gBAAgB;AAAA,IACnC;AACA,kBAAc,KAAK,sCAAsC,IAAI,KAAK;AAAA,EACpE;AAEA,QAAM,eAAe,QAAQ,aAAa;AAC1C,QAAM,SACJ,cAAc,WAAW,IACrB,+CACA;AAAA,EAA8C,cAAc,KAAK,MAAM,CAAC;AAAA;AAE9E,SAAO;AAAA,IACL;AAAA,IACA;AAAA,IACA,GAAI,aAAa,SAAS,IAAI,CAAC,aAAa,KAAK,MAAM,GAAG,EAAE,IAAI,CAAC;AAAA,IACjE;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF,EAAE,KAAK,IAAI;AACb;","names":[]}
|
|
1
|
+
{"version":3,"sources":["../src/codegen/generate.ts","../src/client/errors.ts"],"sourcesContent":["import { compile } from 'json-schema-to-typescript';\nimport { dirname, join } from 'node:path';\nimport { TapError } from '../client/errors';\nimport type {\n CredentialField,\n ExtensionManifest,\n JsonSchema,\n} from '../manifest/types';\n\nexport const GENERATED_HEADER = `/* eslint-disable */\n/**\n * Generated by \\`tappify extension types\\`. Do not edit by hand.\n * Re-run the command after changing tappify.extension.json or any schema it points at.\n */`;\n\nexport interface RegistrySnapshot {\n events: { name: string; payload?: JsonSchema }[];\n}\n\nexport interface GenerateTypesOptions {\n manifest: ExtensionManifest;\n registrySnapshot?: RegistrySnapshot;\n readSchemaFile?(path: string): JsonSchema;\n /**\n * The extension root. A `$ref` inside a schema file resolves against that\n * file's own directory under it, the way the host and the Tap Store read\n * it; without a root the process directory stands in.\n */\n cwd?: string;\n}\n\nconst STYLE = {\n bracketSpacing: true,\n printWidth: 80,\n semi: true,\n singleQuote: true,\n tabWidth: 2,\n trailingComma: 'all',\n useTabs: false,\n} as const;\n\nfunction pascal(value: string): string {\n return value\n .split(/[^A-Za-z0-9]+/)\n .filter(part => part !== '')\n .map(part => part.charAt(0).toUpperCase() + part.slice(1))\n .join('');\n}\n\ninterface Emitter {\n declare(preferredName: string, schema: JsonSchema): Promise<string>;\n declarations(): string[];\n}\n\ninterface ResolvedSchema {\n schema: JsonSchema;\n /** Where the schema's own nested `$ref`s resolve from. */\n cwd?: string;\n}\n\nfunction createEmitter(\n resolveSchema: (schema: JsonSchema) => ResolvedSchema,\n): Emitter {\n const used = new Set<string>();\n const blocks: string[] = [];\n\n return {\n async declare(preferredName, schema) {\n let name = pascal(preferredName);\n let suffix = 2;\n while (used.has(name)) {\n name = `${pascal(preferredName)}${String(suffix)}`;\n suffix += 1;\n }\n used.add(name);\n\n const resolved = resolveSchema(schema);\n const input: Parameters<typeof compile>[0] = {\n ...resolved.schema,\n title: name,\n };\n\n const text = await compile(input, name, {\n bannerComment: '',\n additionalProperties: false,\n declareExternallyReferenced: true,\n enableConstEnums: false,\n format: true,\n style: STYLE,\n unknownAny: true,\n ...(resolved.cwd === undefined ? {} : { cwd: resolved.cwd }),\n });\n\n blocks.push(text.trim());\n return name;\n },\n declarations() {\n return blocks;\n },\n };\n}\n\nfunction credentialSchema(fields: CredentialField[]): JsonSchema {\n const properties: Record<string, JsonSchema> = {};\n const required: string[] = [];\n\n for (const field of fields) {\n const property: JsonSchema =\n field.type === 'select' && field.options\n ? { type: 'string', enum: field.options }\n : { type: 'string' };\n if (field.help !== undefined) property.description = field.help;\n properties[field.name] = property;\n if (field.required) required.push(field.name);\n }\n\n return { type: 'object', properties, required, additionalProperties: false };\n}\n\nexport async function generateTypes(\n options: GenerateTypesOptions,\n): Promise<string> {\n const { manifest, registrySnapshot } = options;\n const contributes = manifest.contributes;\n\n const resolveSchema = (schema: JsonSchema): ResolvedSchema => {\n const ref = schema.$ref;\n if (typeof ref !== 'string' || ref.startsWith('#')) {\n return { schema, cwd: options.cwd };\n }\n if (options.readSchemaFile === undefined) {\n throw new TapError(\n 'TAP_SCHEMA_UNRESOLVED',\n `The manifest points at the schema file \"${ref}\", but this call passed no readSchemaFile. Run \\`tappify extension types\\`, which reads schema files from the extension directory, or supply readSchemaFile.`,\n );\n }\n return {\n schema: options.readSchemaFile(ref),\n cwd:\n options.cwd === undefined ? undefined : dirname(join(options.cwd, ref)),\n };\n };\n\n const emitter = createEmitter(resolveSchema);\n const augmentations: string[] = [];\n\n const storageEntries = Object.entries(contributes.storage ?? {});\n if (storageEntries.length > 0) {\n const lines: string[] = [];\n for (const [name, collection] of storageEntries) {\n const typeName = await emitter.declare(name, collection.schema);\n const kind = collection.singleton === true ? 'singleton' : 'collection';\n lines.push(\n ` '${name}': { kind: '${kind}'; scope: '${collection.scope}'; document: ${typeName} };`,\n );\n }\n augmentations.push(` interface TapStorageMap {\\n${lines.join('\\n')}\\n }`);\n }\n\n const procedureEntries = Object.entries(manifest.server?.procedures ?? {});\n if (procedureEntries.length > 0) {\n const lines: string[] = [];\n for (const [name, declaration] of procedureEntries) {\n const inputName = await emitter.declare(\n `${name}Input`,\n declaration.input,\n );\n const outputName = await emitter.declare(\n `${name}Output`,\n declaration.output,\n );\n lines.push(\n ` '${name}': { input: ${inputName}; output: ${outputName} };`,\n );\n }\n augmentations.push(\n ` interface TapProcedureMap {\\n${lines.join('\\n')}\\n }`,\n );\n }\n\n const actions = contributes.ai?.actions ?? [];\n if (actions.length > 0) {\n const lines: string[] = [];\n for (const action of actions) {\n const name = await emitter.declare(`${action.id}Input`, action.input);\n lines.push(` '${action.id}': { input: ${name} };`);\n }\n augmentations.push(` interface TapActionMap {\\n${lines.join('\\n')}\\n }`);\n }\n\n const tools = contributes.ai?.tools ?? [];\n if (tools.length > 0) {\n const lines: string[] = [];\n for (const tool of tools) {\n const name = await emitter.declare(`${tool.id}Input`, tool.input);\n lines.push(` '${tool.id}': { input: ${name} };`);\n }\n augmentations.push(` interface TapToolMap {\\n${lines.join('\\n')}\\n }`);\n }\n\n const prompts = (contributes.ai?.prompts ?? []).filter(\n prompt => prompt.input !== undefined,\n );\n if (prompts.length > 0) {\n const lines: string[] = [];\n for (const prompt of prompts) {\n const name = await emitter.declare(\n `${prompt.id}PromptInput`,\n prompt.input ?? { type: 'object' },\n );\n lines.push(` '${prompt.id}': { input: ${name} };`);\n }\n augmentations.push(` interface TapPromptMap {\\n${lines.join('\\n')}\\n }`);\n }\n\n const webhooks = contributes.webhooks ?? [];\n if (webhooks.length > 0) {\n const lines: string[] = [];\n for (const webhook of webhooks) {\n const name = await emitter.declare(\n `${webhook.event}Payload`,\n webhook.payload,\n );\n lines.push(` '${webhook.event}': ${name};`);\n }\n augmentations.push(` interface TapWebhookMap {\\n${lines.join('\\n')}\\n }`);\n }\n\n if (registrySnapshot !== undefined && registrySnapshot.events.length > 0) {\n const lines: string[] = [];\n for (const event of registrySnapshot.events) {\n const name = await emitter.declare(\n `${event.name}Event`,\n event.payload ?? { type: 'object' },\n );\n lines.push(` '${event.name}': ${name};`);\n }\n augmentations.push(\n ` interface TapHostEventMap {\\n${lines.join('\\n')}\\n }`,\n );\n }\n\n const telemetry = manifest.telemetry ?? [];\n if (telemetry.length > 0) {\n const lines = telemetry.map(name => ` '${name}': true;`);\n augmentations.push(\n ` interface TapTelemetryEvents {\\n${lines.join('\\n')}\\n }`,\n );\n }\n\n if (contributes.settings) {\n const name = await emitter.declare('Settings', contributes.settings.schema);\n augmentations.push(` interface TapSettings extends ${name} {}`);\n }\n\n const credentialFields = contributes.connector?.auth?.fields ?? [];\n if (credentialFields.length > 0) {\n const name = await emitter.declare(\n 'Credentials',\n credentialSchema(credentialFields),\n );\n augmentations.push(` interface TapCredentials extends ${name} {}`);\n }\n\n const declarations = emitter.declarations();\n const module =\n augmentations.length === 0\n ? \"declare module '@tappify/extension-sdk' {}\"\n : `declare module '@tappify/extension-sdk' {\\n${augmentations.join('\\n\\n')}\\n}`;\n\n return [\n GENERATED_HEADER,\n '',\n ...(declarations.length > 0 ? [declarations.join('\\n\\n'), ''] : []),\n module,\n '',\n 'export {};',\n '',\n ].join('\\n');\n}\n","/** Every code a `TapError` the SDK raises carries. */\nexport type TapErrorCode =\n | 'TAP_OUTSIDE_HOST'\n | 'TAP_SCOPE_MISSING'\n | 'TAP_UNKNOWN_COLLECTION'\n | 'TAP_UNKNOWN_PROCEDURE'\n | 'TAP_NO_PORTAL'\n | 'TAP_NO_QUERY_CLIENT'\n | 'TAP_MANIFEST_INVALID'\n | 'TAP_ENTRY_MISSING'\n | 'TAP_STYLES_UNRESOLVED'\n | 'TAP_SCHEMA_UNRESOLVED'\n | 'TAP_TOKEN_MISSING'\n | 'TAP_TOKEN_INVALID'\n | 'TAP_TOKEN_AUDIENCE'\n | 'TAP_EVENT_ID_MISSING'\n | 'TAP_BODY_INVALID'\n | 'TAP_BODY_TOO_LARGE'\n | 'TAP_ROUTE_UNKNOWN'\n | 'TAP_HANDLER_MISSING'\n | 'TAP_INTERNAL_ERROR'\n | 'TAP_WEBHOOK_REJECTED'\n | 'TAP_TEST_TARGET_INVALID';\n\n/**\n * The same codes as `TapErrorCode`, as an array to iterate or check membership\n * against at runtime.\n */\nexport const TAP_ERROR_CODES: readonly TapErrorCode[] = [\n 'TAP_OUTSIDE_HOST',\n 'TAP_SCOPE_MISSING',\n 'TAP_UNKNOWN_COLLECTION',\n 'TAP_UNKNOWN_PROCEDURE',\n 'TAP_NO_PORTAL',\n 'TAP_NO_QUERY_CLIENT',\n 'TAP_MANIFEST_INVALID',\n 'TAP_ENTRY_MISSING',\n 'TAP_STYLES_UNRESOLVED',\n 'TAP_SCHEMA_UNRESOLVED',\n 'TAP_TOKEN_MISSING',\n 'TAP_TOKEN_INVALID',\n 'TAP_TOKEN_AUDIENCE',\n 'TAP_EVENT_ID_MISSING',\n 'TAP_BODY_INVALID',\n 'TAP_BODY_TOO_LARGE',\n 'TAP_ROUTE_UNKNOWN',\n 'TAP_HANDLER_MISSING',\n 'TAP_INTERNAL_ERROR',\n 'TAP_WEBHOOK_REJECTED',\n 'TAP_TEST_TARGET_INVALID',\n];\n\nconst CODE_SET = new Set<string>(TAP_ERROR_CODES);\n\n/**\n * The error the SDK and the host raise when a call cannot be served at all.\n *\n * @remarks\n * The SDK throws it for a mount outside the host (`TAP_OUTSIDE_HOST`), a\n * collection or procedure the manifest does not declare\n * (`TAP_UNKNOWN_COLLECTION`, `TAP_UNKNOWN_PROCEDURE`), a missing portal or query\n * client, a token the server rejected, and a misused testing helper. The host\n * turns a refused read or write into `TAP_SCOPE_MISSING`. Branch on `code`, which\n * is stable; the message is prose and changes. An error your own server raised is\n * a `TapServerError` instead.\n *\n * @example\n * ```tsx\n * import { TapError, useTapQuery } from '@tappify/extension-sdk';\n * import { ErrorState } from '@tappify/extension-sdk/ui';\n *\n * function Revenue() {\n * const revenue = useTapQuery({\n * kind: 'revenue',\n * range: { from: '2026-09-01', to: '2026-09-08' },\n * });\n * if (TapError.is(revenue.error) && revenue.error.code === 'TAP_SCOPE_MISSING') {\n * return <ErrorState title=\"Revenue is not shared with this extension\" />;\n * }\n * return <span>{revenue.data?.mrr ?? 0}</span>;\n * }\n * ```\n */\nexport class TapError extends Error {\n readonly code: TapErrorCode;\n\n constructor(code: TapErrorCode, message: string) {\n super(message);\n this.name = 'TapError';\n this.code = code;\n }\n\n /**\n * Narrows an unknown value to a `TapError`, by name and by a code it\n * recognises, so it holds across module instances.\n */\n static is(value: unknown): value is TapError {\n return (\n value instanceof Error &&\n value.name === 'TapError' &&\n 'code' in value &&\n typeof value.code === 'string' &&\n CODE_SET.has(value.code)\n );\n }\n}\n\n/**\n * The error a vendor server throws to answer a Tappify call with a code and a\n * message the owner sees.\n *\n * @remarks\n * `createTappifyHandler` catches it and answers `{ error: { code, message } }`\n * with `status`, or 400 when no status was given; the host relays both to the\n * calling mount, where they arrive as the `error` of `useTapServer`. Pick a code\n * of your own and keep it stable — the SDK's own codes are `SERVER_ERROR_CODES` —\n * and write the message for the owner, who reads it on screen.\n *\n * @example\n * ```ts\n * import { TapServerError } from '@tappify/extension-sdk/server';\n *\n * function assertRange(days: number) {\n * if (days > 0) return;\n * throw new TapServerError(\n * 'RANGE_TOO_SHORT',\n * 'getSummary needs a range of at least one day. Widen the date picker, then retry.',\n * 400,\n * );\n * }\n * ```\n */\nexport class TapServerError extends Error {\n readonly code: string;\n readonly status: number | undefined;\n\n constructor(code: string, message: string, status?: number) {\n super(message);\n this.name = 'TapServerError';\n this.code = code;\n this.status = status;\n }\n\n /** The wire body the handler answers with, without the status. */\n toJSON(): { error: { code: string; message: string } } {\n return { error: { code: this.code, message: this.message } };\n }\n\n /**\n * Narrows an unknown value to a `TapServerError` by name and by carrying a\n * string `code`, so it holds across module instances.\n */\n static is(value: unknown): value is TapServerError {\n return (\n value instanceof Error &&\n value.name === 'TapServerError' &&\n 'code' in value &&\n typeof value.code === 'string'\n );\n }\n}\n"],"mappings":";AAAA,SAAS,eAAe;AACxB,SAAS,SAAS,YAAY;;;AC2BvB,IAAM,kBAA2C;AAAA,EACtD;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF;AAEA,IAAM,WAAW,IAAI,IAAY,eAAe;AA+BzC,IAAM,WAAN,cAAuB,MAAM;AAAA,EAGlC,YAAY,MAAoB,SAAiB;AAC/C,UAAM,OAAO;AACb,SAAK,OAAO;AACZ,SAAK,OAAO;AAAA,EACd;AAAA;AAAA;AAAA;AAAA;AAAA,EAMA,OAAO,GAAG,OAAmC;AAC3C,WACE,iBAAiB,SACjB,MAAM,SAAS,cACf,UAAU,SACV,OAAO,MAAM,SAAS,YACtB,SAAS,IAAI,MAAM,IAAI;AAAA,EAE3B;AACF;;;ADhGO,IAAM,mBAAmB;AAAA;AAAA;AAAA;AAAA;AAsBhC,IAAM,QAAQ;AAAA,EACZ,gBAAgB;AAAA,EAChB,YAAY;AAAA,EACZ,MAAM;AAAA,EACN,aAAa;AAAA,EACb,UAAU;AAAA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AAG;AACxB,UAAM,QAAQ,UAAU,IAAI,UAAQ,QAAQ,IAAI,UAAU;AAC1D,kBAAc;AAAA,MACZ;AAAA,EAAqC,MAAM,KAAK,IAAI,CAAC;AAAA;AAAA,IACvD;AAAA,EACF;AAEA,MAAI,YAAY,UAAU;AACxB,UAAM,OAAO,MAAM,QAAQ,QAAQ,YAAY,YAAY,SAAS,MAAM;AAC1E,kBAAc,KAAK,mCAAmC,IAAI,KAAK;AAAA,EACjE;AAEA,QAAM,mBAAmB,YAAY,WAAW,MAAM,UAAU,CAAC;AACjE,MAAI,iBAAiB,SAAS,GAAG;AAC/B,UAAM,OAAO,MAAM,QAAQ;AAAA,MACzB;AAAA,MACA,iBAAiB,gBAAgB;AAAA,IACnC;AACA,kBAAc,KAAK,sCAAsC,IAAI,KAAK;AAAA,EACpE;AAEA,QAAM,eAAe,QAAQ,aAAa;AAC1C,QAAM,SACJ,cAAc,WAAW,IACrB,+CACA;AAAA,EAA8C,cAAc,KAAK,MAAM,CAAC;AAAA;AAE9E,SAAO;AAAA,IACL;AAAA,IACA;AAAA,IACA,GAAI,aAAa,SAAS,IAAI,CAAC,aAAa,KAAK,MAAM,GAAG,EAAE,IAAI,CAAC;AAAA,IACjE;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF,EAAE,KAAK,IAAI;AACb;","names":[]}
|
|
@@ -163,26 +163,53 @@ interface AiContribution {
|
|
|
163
163
|
prompts?: PromptDeclaration[];
|
|
164
164
|
context?: ContextDeclaration[];
|
|
165
165
|
}
|
|
166
|
+
type WorkDirection = 'none' | 'to_provider' | 'from_provider' | 'two-way';
|
|
167
|
+
type WorkAuth = {
|
|
168
|
+
method: 'oauth';
|
|
169
|
+
provider: string;
|
|
170
|
+
scopes: string[];
|
|
171
|
+
} | {
|
|
172
|
+
method: 'api_key';
|
|
173
|
+
fields: CredentialField[];
|
|
174
|
+
};
|
|
166
175
|
interface WorkContribution {
|
|
167
176
|
kind: 'tracker' | 'docs' | 'chat';
|
|
168
|
-
|
|
177
|
+
creates: ('issue' | 'page' | 'message')[];
|
|
178
|
+
identity: 'install' | 'user';
|
|
179
|
+
comments: 'two-way' | 'none' | {
|
|
180
|
+
direction: WorkDirection;
|
|
181
|
+
supportsEdits: false;
|
|
182
|
+
supportsDeletes: false;
|
|
183
|
+
};
|
|
184
|
+
status?: {
|
|
185
|
+
direction: WorkDirection;
|
|
186
|
+
webhook?: string;
|
|
187
|
+
map?: Record<'open' | 'in_progress' | 'done', string[]>;
|
|
188
|
+
};
|
|
189
|
+
attachments: ('image' | 'link')[];
|
|
190
|
+
auth: WorkAuth;
|
|
191
|
+
/** @deprecated resolved dynamically by describe_container */
|
|
192
|
+
container?: {
|
|
169
193
|
label: string;
|
|
170
194
|
list: string;
|
|
171
195
|
};
|
|
172
|
-
|
|
173
|
-
fields
|
|
196
|
+
/** @deprecated resolved dynamically by describe_container */
|
|
197
|
+
fields?: {
|
|
174
198
|
priority?: string[];
|
|
175
199
|
labels?: boolean;
|
|
176
200
|
assignee?: boolean;
|
|
177
201
|
required: string[];
|
|
178
202
|
};
|
|
179
|
-
|
|
203
|
+
}
|
|
204
|
+
/** @deprecated Migrate to WorkContribution during the SDK v2 compatibility window. */
|
|
205
|
+
interface LegacyWorkContribution extends Omit<WorkContribution, 'auth' | 'container' | 'fields' | 'comments' | 'status'> {
|
|
206
|
+
container: NonNullable<WorkContribution['container']>;
|
|
207
|
+
fields: NonNullable<WorkContribution['fields']>;
|
|
180
208
|
comments: 'two-way' | 'none';
|
|
181
209
|
status?: {
|
|
182
210
|
webhook: string;
|
|
183
211
|
map: Record<'open' | 'in_progress' | 'done', string[]>;
|
|
184
212
|
};
|
|
185
|
-
identity: 'user' | 'install';
|
|
186
213
|
}
|
|
187
214
|
interface ExtensionListing {
|
|
188
215
|
longDescription?: string;
|
|
@@ -215,7 +242,7 @@ interface ExtensionManifest {
|
|
|
215
242
|
connector?: ConnectorContribution;
|
|
216
243
|
webhooks?: WebhookContribution[];
|
|
217
244
|
ai?: AiContribution;
|
|
218
|
-
work?: WorkContribution;
|
|
245
|
+
work?: WorkContribution | LegacyWorkContribution;
|
|
219
246
|
};
|
|
220
247
|
server?: {
|
|
221
248
|
baseUrl: string;
|
|
@@ -277,6 +304,12 @@ declare const SCOPES: readonly [{
|
|
|
277
304
|
readonly description: "Review text, ratings and replies";
|
|
278
305
|
readonly requiresSecurityReview: false;
|
|
279
306
|
readonly requiresJustification: false;
|
|
307
|
+
}, {
|
|
308
|
+
readonly key: "review.threads:read";
|
|
309
|
+
readonly label: "Read Review threads";
|
|
310
|
+
readonly description: "Review threads, comments, screenshot descriptors, build context and safe device context";
|
|
311
|
+
readonly requiresSecurityReview: false;
|
|
312
|
+
readonly requiresJustification: false;
|
|
280
313
|
}, {
|
|
281
314
|
readonly key: "crashes:read";
|
|
282
315
|
readonly label: "Read crash data";
|
|
@@ -340,7 +373,7 @@ declare const SCOPES: readonly [{
|
|
|
340
373
|
}, {
|
|
341
374
|
readonly key: "work:sync";
|
|
342
375
|
readonly label: "Sync work items";
|
|
343
|
-
readonly description: "
|
|
376
|
+
readonly description: "Sync comments and status on created work items";
|
|
344
377
|
readonly requiresSecurityReview: false;
|
|
345
378
|
readonly requiresJustification: true;
|
|
346
379
|
}, {
|
|
@@ -446,4 +479,4 @@ declare const findPage: (key: string) => PageDefinition | undefined;
|
|
|
446
479
|
declare const findTable: (key: string) => TableDefinition | undefined;
|
|
447
480
|
declare const slotsForPage: (page: string) => readonly SlotId[];
|
|
448
481
|
|
|
449
|
-
export {
|
|
482
|
+
export { type StorageCollection as $, type ActionDeclaration as A, type BannerContribution as B, CARD_KEYS as C, type DataQueryKind as D, type ExtensionManifest as E, type PageDefinition as F, type ProcedureDeclaration as G, type HostEventName as H, type PromptDeclaration as I, type JsonSchema as J, KINDS as K, type LegacyWorkContribution as L, type ManifestValidation as M, SCOPES as N, SCOPE_KEYS as O, PAGES as P, QUERY_SCOPES as Q, type RowActionContribution as R, type ScopeKey as S, SERVED_SDK_MAJORS as T, type UiContributionRef as U, SLOTS as V, type ScopeDefinition as W, type ScopeEntry as X, type SeriesContribution as Y, type SettingsContribution as Z, type SkillDeclaration as _, type HostPage as a, TABLES as a0, TABLE_KEYS as a1, type TabContribution as a2, type TableDefinition as a3, type ToolDeclaration as a4, type WebhookContribution as a5, type WidgetContribution as a6, type WorkAuth as a7, type WorkContribution as a8, type WorkDirection as a9, findPage as aa, findScope as ab, findTable as ac, slotsForPage as ad, type SlotId as b, type ExposableKind as c, type ManifestIssue as d, type AiContribution as e, CATEGORIES as f, CHARTS as g, type ConnectorAuth as h, type ConnectorContribution as i, type ContextDeclaration as j, type ContributionKind as k, type CredentialField as l, type DimensionDeclaration as m, EVENTS as n, type ExtensionCategory as o, type ExtensionInstallScope as p, type ExtensionListing as q, type ExtensionVisibility as r, type HostChart as s, type HostTable as t, type KnowledgeDeclaration as u, type MarkerContribution as v, type MentionDeclaration as w, type MetricDeclaration as x, PAGE_KEYS as y, type PageContribution as z };
|
|
@@ -163,26 +163,53 @@ interface AiContribution {
|
|
|
163
163
|
prompts?: PromptDeclaration[];
|
|
164
164
|
context?: ContextDeclaration[];
|
|
165
165
|
}
|
|
166
|
+
type WorkDirection = 'none' | 'to_provider' | 'from_provider' | 'two-way';
|
|
167
|
+
type WorkAuth = {
|
|
168
|
+
method: 'oauth';
|
|
169
|
+
provider: string;
|
|
170
|
+
scopes: string[];
|
|
171
|
+
} | {
|
|
172
|
+
method: 'api_key';
|
|
173
|
+
fields: CredentialField[];
|
|
174
|
+
};
|
|
166
175
|
interface WorkContribution {
|
|
167
176
|
kind: 'tracker' | 'docs' | 'chat';
|
|
168
|
-
|
|
177
|
+
creates: ('issue' | 'page' | 'message')[];
|
|
178
|
+
identity: 'install' | 'user';
|
|
179
|
+
comments: 'two-way' | 'none' | {
|
|
180
|
+
direction: WorkDirection;
|
|
181
|
+
supportsEdits: false;
|
|
182
|
+
supportsDeletes: false;
|
|
183
|
+
};
|
|
184
|
+
status?: {
|
|
185
|
+
direction: WorkDirection;
|
|
186
|
+
webhook?: string;
|
|
187
|
+
map?: Record<'open' | 'in_progress' | 'done', string[]>;
|
|
188
|
+
};
|
|
189
|
+
attachments: ('image' | 'link')[];
|
|
190
|
+
auth: WorkAuth;
|
|
191
|
+
/** @deprecated resolved dynamically by describe_container */
|
|
192
|
+
container?: {
|
|
169
193
|
label: string;
|
|
170
194
|
list: string;
|
|
171
195
|
};
|
|
172
|
-
|
|
173
|
-
fields
|
|
196
|
+
/** @deprecated resolved dynamically by describe_container */
|
|
197
|
+
fields?: {
|
|
174
198
|
priority?: string[];
|
|
175
199
|
labels?: boolean;
|
|
176
200
|
assignee?: boolean;
|
|
177
201
|
required: string[];
|
|
178
202
|
};
|
|
179
|
-
|
|
203
|
+
}
|
|
204
|
+
/** @deprecated Migrate to WorkContribution during the SDK v2 compatibility window. */
|
|
205
|
+
interface LegacyWorkContribution extends Omit<WorkContribution, 'auth' | 'container' | 'fields' | 'comments' | 'status'> {
|
|
206
|
+
container: NonNullable<WorkContribution['container']>;
|
|
207
|
+
fields: NonNullable<WorkContribution['fields']>;
|
|
180
208
|
comments: 'two-way' | 'none';
|
|
181
209
|
status?: {
|
|
182
210
|
webhook: string;
|
|
183
211
|
map: Record<'open' | 'in_progress' | 'done', string[]>;
|
|
184
212
|
};
|
|
185
|
-
identity: 'user' | 'install';
|
|
186
213
|
}
|
|
187
214
|
interface ExtensionListing {
|
|
188
215
|
longDescription?: string;
|
|
@@ -215,7 +242,7 @@ interface ExtensionManifest {
|
|
|
215
242
|
connector?: ConnectorContribution;
|
|
216
243
|
webhooks?: WebhookContribution[];
|
|
217
244
|
ai?: AiContribution;
|
|
218
|
-
work?: WorkContribution;
|
|
245
|
+
work?: WorkContribution | LegacyWorkContribution;
|
|
219
246
|
};
|
|
220
247
|
server?: {
|
|
221
248
|
baseUrl: string;
|
|
@@ -277,6 +304,12 @@ declare const SCOPES: readonly [{
|
|
|
277
304
|
readonly description: "Review text, ratings and replies";
|
|
278
305
|
readonly requiresSecurityReview: false;
|
|
279
306
|
readonly requiresJustification: false;
|
|
307
|
+
}, {
|
|
308
|
+
readonly key: "review.threads:read";
|
|
309
|
+
readonly label: "Read Review threads";
|
|
310
|
+
readonly description: "Review threads, comments, screenshot descriptors, build context and safe device context";
|
|
311
|
+
readonly requiresSecurityReview: false;
|
|
312
|
+
readonly requiresJustification: false;
|
|
280
313
|
}, {
|
|
281
314
|
readonly key: "crashes:read";
|
|
282
315
|
readonly label: "Read crash data";
|
|
@@ -340,7 +373,7 @@ declare const SCOPES: readonly [{
|
|
|
340
373
|
}, {
|
|
341
374
|
readonly key: "work:sync";
|
|
342
375
|
readonly label: "Sync work items";
|
|
343
|
-
readonly description: "
|
|
376
|
+
readonly description: "Sync comments and status on created work items";
|
|
344
377
|
readonly requiresSecurityReview: false;
|
|
345
378
|
readonly requiresJustification: true;
|
|
346
379
|
}, {
|
|
@@ -446,4 +479,4 @@ declare const findPage: (key: string) => PageDefinition | undefined;
|
|
|
446
479
|
declare const findTable: (key: string) => TableDefinition | undefined;
|
|
447
480
|
declare const slotsForPage: (page: string) => readonly SlotId[];
|
|
448
481
|
|
|
449
|
-
export {
|
|
482
|
+
export { type StorageCollection as $, type ActionDeclaration as A, type BannerContribution as B, CARD_KEYS as C, type DataQueryKind as D, type ExtensionManifest as E, type PageDefinition as F, type ProcedureDeclaration as G, type HostEventName as H, type PromptDeclaration as I, type JsonSchema as J, KINDS as K, type LegacyWorkContribution as L, type ManifestValidation as M, SCOPES as N, SCOPE_KEYS as O, PAGES as P, QUERY_SCOPES as Q, type RowActionContribution as R, type ScopeKey as S, SERVED_SDK_MAJORS as T, type UiContributionRef as U, SLOTS as V, type ScopeDefinition as W, type ScopeEntry as X, type SeriesContribution as Y, type SettingsContribution as Z, type SkillDeclaration as _, type HostPage as a, TABLES as a0, TABLE_KEYS as a1, type TabContribution as a2, type TableDefinition as a3, type ToolDeclaration as a4, type WebhookContribution as a5, type WidgetContribution as a6, type WorkAuth as a7, type WorkContribution as a8, type WorkDirection as a9, findPage as aa, findScope as ab, findTable as ac, slotsForPage as ad, type SlotId as b, type ExposableKind as c, type ManifestIssue as d, type AiContribution as e, CATEGORIES as f, CHARTS as g, type ConnectorAuth as h, type ConnectorContribution as i, type ContextDeclaration as j, type ContributionKind as k, type CredentialField as l, type DimensionDeclaration as m, EVENTS as n, type ExtensionCategory as o, type ExtensionInstallScope as p, type ExtensionListing as q, type ExtensionVisibility as r, type HostChart as s, type HostTable as t, type KnowledgeDeclaration as u, type MarkerContribution as v, type MentionDeclaration as w, type MetricDeclaration as x, PAGE_KEYS as y, type PageContribution as z };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Context } from 'react';
|
|
2
|
-
import { T as Tap } from './types-
|
|
2
|
+
import { T as Tap } from './types-BYGcp5pZ.js';
|
|
3
3
|
|
|
4
4
|
declare const TapContext: Context<Tap | null>;
|
|
5
5
|
/**
|
|
@@ -13,14 +13,15 @@ declare const TapContext: Context<Tap | null>;
|
|
|
13
13
|
*
|
|
14
14
|
* @example
|
|
15
15
|
* ```tsx
|
|
16
|
-
* import {
|
|
16
|
+
* import { useTap } from '@tappify/extension-sdk';
|
|
17
|
+
* import { Button } from '@tappify/extension-sdk/ui';
|
|
17
18
|
*
|
|
18
19
|
* function CopyId() {
|
|
19
20
|
* const tap = useTap();
|
|
20
21
|
* return (
|
|
21
|
-
* <
|
|
22
|
+
* <Button onClick={() => void tap.ui.copy(tap.project.id)}>
|
|
22
23
|
* Copy project id
|
|
23
|
-
* </
|
|
24
|
+
* </Button>
|
|
24
25
|
* );
|
|
25
26
|
* }
|
|
26
27
|
* ```
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Context } from 'react';
|
|
2
|
-
import { T as Tap } from './types-
|
|
2
|
+
import { T as Tap } from './types-I1JOZyI_.cjs';
|
|
3
3
|
|
|
4
4
|
declare const TapContext: Context<Tap | null>;
|
|
5
5
|
/**
|
|
@@ -13,14 +13,15 @@ declare const TapContext: Context<Tap | null>;
|
|
|
13
13
|
*
|
|
14
14
|
* @example
|
|
15
15
|
* ```tsx
|
|
16
|
-
* import {
|
|
16
|
+
* import { useTap } from '@tappify/extension-sdk';
|
|
17
|
+
* import { Button } from '@tappify/extension-sdk/ui';
|
|
17
18
|
*
|
|
18
19
|
* function CopyId() {
|
|
19
20
|
* const tap = useTap();
|
|
20
21
|
* return (
|
|
21
|
-
* <
|
|
22
|
+
* <Button onClick={() => void tap.ui.copy(tap.project.id)}>
|
|
22
23
|
* Copy project id
|
|
23
|
-
* </
|
|
24
|
+
* </Button>
|
|
24
25
|
* );
|
|
25
26
|
* }
|
|
26
27
|
* ```
|
|
@@ -19,7 +19,8 @@ declare const TAP_ERROR_CODES: readonly TapErrorCode[];
|
|
|
19
19
|
*
|
|
20
20
|
* @example
|
|
21
21
|
* ```tsx
|
|
22
|
-
* import { TapError,
|
|
22
|
+
* import { TapError, useTapQuery } from '@tappify/extension-sdk';
|
|
23
|
+
* import { ErrorState } from '@tappify/extension-sdk/ui';
|
|
23
24
|
*
|
|
24
25
|
* function Revenue() {
|
|
25
26
|
* const revenue = useTapQuery({
|
|
@@ -27,7 +28,7 @@ declare const TAP_ERROR_CODES: readonly TapErrorCode[];
|
|
|
27
28
|
* range: { from: '2026-09-01', to: '2026-09-08' },
|
|
28
29
|
* });
|
|
29
30
|
* if (TapError.is(revenue.error) && revenue.error.code === 'TAP_SCOPE_MISSING') {
|
|
30
|
-
* return <
|
|
31
|
+
* return <ErrorState title="Revenue is not shared with this extension" />;
|
|
31
32
|
* }
|
|
32
33
|
* return <span>{revenue.data?.mrr ?? 0}</span>;
|
|
33
34
|
* }
|
|
@@ -19,7 +19,8 @@ declare const TAP_ERROR_CODES: readonly TapErrorCode[];
|
|
|
19
19
|
*
|
|
20
20
|
* @example
|
|
21
21
|
* ```tsx
|
|
22
|
-
* import { TapError,
|
|
22
|
+
* import { TapError, useTapQuery } from '@tappify/extension-sdk';
|
|
23
|
+
* import { ErrorState } from '@tappify/extension-sdk/ui';
|
|
23
24
|
*
|
|
24
25
|
* function Revenue() {
|
|
25
26
|
* const revenue = useTapQuery({
|
|
@@ -27,7 +28,7 @@ declare const TAP_ERROR_CODES: readonly TapErrorCode[];
|
|
|
27
28
|
* range: { from: '2026-09-01', to: '2026-09-08' },
|
|
28
29
|
* });
|
|
29
30
|
* if (TapError.is(revenue.error) && revenue.error.code === 'TAP_SCOPE_MISSING') {
|
|
30
|
-
* return <
|
|
31
|
+
* return <ErrorState title="Revenue is not shared with this extension" />;
|
|
31
32
|
* }
|
|
32
33
|
* return <span>{revenue.data?.mrr ?? 0}</span>;
|
|
33
34
|
* }
|
package/dist/host.cjs
CHANGED
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
2
|
|
|
3
3
|
|
|
4
|
-
var
|
|
4
|
+
var _chunkVV7ELNRWcjs = require('./chunk-VV7ELNRW.cjs');
|
|
5
5
|
|
|
6
6
|
|
|
7
|
-
var
|
|
8
|
-
require('./chunk-
|
|
7
|
+
var _chunkPRCZMOLDcjs = require('./chunk-PRCZMOLD.cjs');
|
|
8
|
+
require('./chunk-6HETNZJY.cjs');
|
|
9
|
+
require('./chunk-Q7SFCCGT.cjs');
|
|
9
10
|
|
|
10
11
|
// src/host/collect-styles.ts
|
|
11
12
|
function collectStyles(remoteModule) {
|
|
@@ -20,5 +21,5 @@ function collectStyles(remoteModule) {
|
|
|
20
21
|
|
|
21
22
|
|
|
22
23
|
|
|
23
|
-
exports.TapContext =
|
|
24
|
+
exports.TapContext = _chunkPRCZMOLDcjs.TapContext; exports.TapHostProvider = _chunkVV7ELNRWcjs.TapHostProvider; exports.collectStyles = collectStyles; exports.createHostQueryClient = _chunkVV7ELNRWcjs.createHostQueryClient;
|
|
24
25
|
//# sourceMappingURL=host.cjs.map
|
package/dist/host.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["/
|
|
1
|
+
{"version":3,"sources":["/home/runner/work/extension-sdk/extension-sdk/dist/host.cjs","../src/host/collect-styles.ts"],"names":[],"mappings":"AAAA;AACE;AACA;AACF,wDAA6B;AAC7B;AACE;AACF,wDAA6B;AAC7B,gCAA6B;AAC7B,gCAA6B;AAC7B;AACA;ACVO,SAAS,aAAA,CAAc,YAAA,EAAiC;AAC7D,EAAA,GAAA,CAAI,OAAO,aAAA,IAAiB,SAAA,GAAY,aAAA,IAAiB,IAAA,EAAM,OAAO,CAAC,CAAA;AACvE,EAAA,GAAA,CAAI,CAAA,CAAE,SAAA,GAAY,YAAA,CAAA,EAAe,OAAO,CAAC,CAAA;AAEzC,EAAA,MAAM,OAAA,EAAS,YAAA,CAAa,MAAA;AAC5B,EAAA,GAAA,CAAI,CAAC,KAAA,CAAM,OAAA,CAAQ,MAAM,CAAA,EAAG,OAAO,CAAC,CAAA;AAEpC,EAAA,OAAO,MAAA,CAAO,MAAA,CAAO,CAAC,KAAA,EAAA,GAA2B,OAAO,MAAA,IAAU,QAAQ,CAAA;AAC5E;ADUA;AACE;AACA;AACA;AACA;AACF,+NAAC","file":"/home/runner/work/extension-sdk/extension-sdk/dist/host.cjs","sourcesContent":[null,"export function collectStyles(remoteModule: unknown): string[] {\n if (typeof remoteModule !== 'object' || remoteModule === null) return [];\n if (!('styles' in remoteModule)) return [];\n\n const styles = remoteModule.styles;\n if (!Array.isArray(styles)) return [];\n\n return styles.filter((entry): entry is string => typeof entry === 'string');\n}\n"]}
|
package/dist/host.d.cts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
export { T as TapContext } from './context-
|
|
2
|
-
import { T as Tap } from './types-
|
|
3
|
-
export { A as ActionId, k as ActionInput, P as PromptId, l as PromptInput, m as TapActionMap, n as TapActionRun, o as TapApp, p as TapChangeKey, q as TapChatCard, r as TapCollection, s as TapComparisonSide, t as TapConfirmOptions, u as TapCrashIssue, v as TapCrashesResult, w as TapCredentialValues, x as TapCredentials, y as TapDateRange, a as TapFilters, z as TapFormatters, B as TapHostEventMap, c as TapHostEvents, C as TapInternals, D as TapKeyword, E as TapKeywordsResult, F as TapListing, G as TapListingResult, H as TapPageProps, I as TapPath, J as TapPlatform, K as TapPlatformFilter, g as TapProcedureInput, L as TapProcedureMap, f as TapProcedureName, h as TapProcedureOutput, M as TapProcedures, N as TapProjectResult, O as TapPromptMap, d as TapQuery, Q as TapRelease, e as TapResult, R as TapRevenueResult, S as TapReview, U as TapReviewsResult, V as TapRowActionProps, W as TapSeriesMetric, X as TapSeriesPoint, Y as TapSeriesResult, Z as TapSettings, _ as TapSettingsProps, $ as TapSettingsValues, a0 as TapSingleton, j as TapSingletonDocument, i as TapSingletonName, b as TapSize, a1 as TapStorage, a2 as TapStorageMap, a3 as TapTabProps, a4 as TapTableColumn, a5 as TapTelemetryEvents, a6 as TapToastTone, a7 as TapToolMap, a8 as TapWebhookMap, a9 as TapWidgetProps, aa as TelemetryEvent, ab as ToolId, ac as ToolInput, ad as WebhookName, ae as WebhookPayload } from './types-
|
|
1
|
+
export { T as TapContext } from './context-DJ3REtdT.cjs';
|
|
2
|
+
import { T as Tap } from './types-I1JOZyI_.cjs';
|
|
3
|
+
export { A as ActionId, k as ActionInput, P as PromptId, l as PromptInput, m as TapActionMap, n as TapActionRun, o as TapApp, p as TapChangeKey, q as TapChatCard, r as TapCollection, s as TapComparisonSide, t as TapConfirmOptions, u as TapCrashIssue, v as TapCrashesResult, w as TapCredentialValues, x as TapCredentials, y as TapDateRange, a as TapFilters, z as TapFormatters, B as TapHostEventMap, c as TapHostEvents, C as TapInternals, D as TapKeyword, E as TapKeywordsResult, F as TapListing, G as TapListingResult, H as TapPageProps, I as TapPath, J as TapPlatform, K as TapPlatformFilter, g as TapProcedureInput, L as TapProcedureMap, f as TapProcedureName, h as TapProcedureOutput, M as TapProcedures, N as TapProjectResult, O as TapPromptMap, d as TapQuery, Q as TapRelease, e as TapResult, R as TapRevenueResult, S as TapReview, U as TapReviewsResult, V as TapRowActionProps, W as TapSeriesMetric, X as TapSeriesPoint, Y as TapSeriesResult, Z as TapSettings, _ as TapSettingsProps, $ as TapSettingsValues, a0 as TapSingleton, j as TapSingletonDocument, i as TapSingletonName, b as TapSize, a1 as TapStorage, a2 as TapStorageMap, a3 as TapTabProps, a4 as TapTableColumn, a5 as TapTelemetryEvents, a6 as TapToastTone, a7 as TapToolMap, a8 as TapWebhookMap, a9 as TapWidgetProps, aa as TelemetryEvent, ab as ToolId, ac as ToolInput, ad as WebhookName, ae as WebhookPayload } from './types-I1JOZyI_.cjs';
|
|
4
4
|
import { QueryClient } from '@tanstack/react-query';
|
|
5
5
|
import { ReactNode, ReactElement } from 'react';
|
|
6
|
-
export { D as DataQueryKind, H as HostEventName, a as HostPage, S as ScopeKey, b as SlotId } from './constants-
|
|
6
|
+
export { D as DataQueryKind, H as HostEventName, a as HostPage, S as ScopeKey, b as SlotId } from './constants-BAimnqOK.cjs';
|
|
7
7
|
|
|
8
8
|
declare function collectStyles(remoteModule: unknown): string[];
|
|
9
9
|
|
|
@@ -12,7 +12,7 @@ interface TapHostProviderProps {
|
|
|
12
12
|
children: ReactNode;
|
|
13
13
|
/**
|
|
14
14
|
* A host that already renders a QueryClientProvider leaves this out; a
|
|
15
|
-
* standalone host such as the
|
|
15
|
+
* standalone host such as the local preview passes one from
|
|
16
16
|
* `createHostQueryClient()` so the data hooks find a client.
|
|
17
17
|
*/
|
|
18
18
|
queryClient?: QueryClient;
|
package/dist/host.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
export { T as TapContext } from './context-
|
|
2
|
-
import { T as Tap } from './types-
|
|
3
|
-
export { A as ActionId, k as ActionInput, P as PromptId, l as PromptInput, m as TapActionMap, n as TapActionRun, o as TapApp, p as TapChangeKey, q as TapChatCard, r as TapCollection, s as TapComparisonSide, t as TapConfirmOptions, u as TapCrashIssue, v as TapCrashesResult, w as TapCredentialValues, x as TapCredentials, y as TapDateRange, a as TapFilters, z as TapFormatters, B as TapHostEventMap, c as TapHostEvents, C as TapInternals, D as TapKeyword, E as TapKeywordsResult, F as TapListing, G as TapListingResult, H as TapPageProps, I as TapPath, J as TapPlatform, K as TapPlatformFilter, g as TapProcedureInput, L as TapProcedureMap, f as TapProcedureName, h as TapProcedureOutput, M as TapProcedures, N as TapProjectResult, O as TapPromptMap, d as TapQuery, Q as TapRelease, e as TapResult, R as TapRevenueResult, S as TapReview, U as TapReviewsResult, V as TapRowActionProps, W as TapSeriesMetric, X as TapSeriesPoint, Y as TapSeriesResult, Z as TapSettings, _ as TapSettingsProps, $ as TapSettingsValues, a0 as TapSingleton, j as TapSingletonDocument, i as TapSingletonName, b as TapSize, a1 as TapStorage, a2 as TapStorageMap, a3 as TapTabProps, a4 as TapTableColumn, a5 as TapTelemetryEvents, a6 as TapToastTone, a7 as TapToolMap, a8 as TapWebhookMap, a9 as TapWidgetProps, aa as TelemetryEvent, ab as ToolId, ac as ToolInput, ad as WebhookName, ae as WebhookPayload } from './types-
|
|
1
|
+
export { T as TapContext } from './context-Cr93B05o.js';
|
|
2
|
+
import { T as Tap } from './types-BYGcp5pZ.js';
|
|
3
|
+
export { A as ActionId, k as ActionInput, P as PromptId, l as PromptInput, m as TapActionMap, n as TapActionRun, o as TapApp, p as TapChangeKey, q as TapChatCard, r as TapCollection, s as TapComparisonSide, t as TapConfirmOptions, u as TapCrashIssue, v as TapCrashesResult, w as TapCredentialValues, x as TapCredentials, y as TapDateRange, a as TapFilters, z as TapFormatters, B as TapHostEventMap, c as TapHostEvents, C as TapInternals, D as TapKeyword, E as TapKeywordsResult, F as TapListing, G as TapListingResult, H as TapPageProps, I as TapPath, J as TapPlatform, K as TapPlatformFilter, g as TapProcedureInput, L as TapProcedureMap, f as TapProcedureName, h as TapProcedureOutput, M as TapProcedures, N as TapProjectResult, O as TapPromptMap, d as TapQuery, Q as TapRelease, e as TapResult, R as TapRevenueResult, S as TapReview, U as TapReviewsResult, V as TapRowActionProps, W as TapSeriesMetric, X as TapSeriesPoint, Y as TapSeriesResult, Z as TapSettings, _ as TapSettingsProps, $ as TapSettingsValues, a0 as TapSingleton, j as TapSingletonDocument, i as TapSingletonName, b as TapSize, a1 as TapStorage, a2 as TapStorageMap, a3 as TapTabProps, a4 as TapTableColumn, a5 as TapTelemetryEvents, a6 as TapToastTone, a7 as TapToolMap, a8 as TapWebhookMap, a9 as TapWidgetProps, aa as TelemetryEvent, ab as ToolId, ac as ToolInput, ad as WebhookName, ae as WebhookPayload } from './types-BYGcp5pZ.js';
|
|
4
4
|
import { QueryClient } from '@tanstack/react-query';
|
|
5
5
|
import { ReactNode, ReactElement } from 'react';
|
|
6
|
-
export { D as DataQueryKind, H as HostEventName, a as HostPage, S as ScopeKey, b as SlotId } from './constants-
|
|
6
|
+
export { D as DataQueryKind, H as HostEventName, a as HostPage, S as ScopeKey, b as SlotId } from './constants-BAimnqOK.js';
|
|
7
7
|
|
|
8
8
|
declare function collectStyles(remoteModule: unknown): string[];
|
|
9
9
|
|
|
@@ -12,7 +12,7 @@ interface TapHostProviderProps {
|
|
|
12
12
|
children: ReactNode;
|
|
13
13
|
/**
|
|
14
14
|
* A host that already renders a QueryClientProvider leaves this out; a
|
|
15
|
-
* standalone host such as the
|
|
15
|
+
* standalone host such as the local preview passes one from
|
|
16
16
|
* `createHostQueryClient()` so the data hooks find a client.
|
|
17
17
|
*/
|
|
18
18
|
queryClient?: QueryClient;
|
package/dist/host.mjs
CHANGED
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import {
|
|
2
2
|
TapHostProvider,
|
|
3
3
|
createHostQueryClient
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-RBIQT75L.mjs";
|
|
5
5
|
import {
|
|
6
6
|
TapContext
|
|
7
|
-
} from "./chunk-
|
|
8
|
-
import "./chunk-
|
|
7
|
+
} from "./chunk-QA5AL3VZ.mjs";
|
|
8
|
+
import "./chunk-QXD7WVKK.mjs";
|
|
9
|
+
import "./chunk-J5LGTIGS.mjs";
|
|
9
10
|
|
|
10
11
|
// src/host/collect-styles.ts
|
|
11
12
|
function collectStyles(remoteModule) {
|
package/dist/host.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/host/collect-styles.ts"],"sourcesContent":["export function collectStyles(remoteModule: unknown): string[] {\n if (typeof remoteModule !== 'object' || remoteModule === null) return [];\n if (!('styles' in remoteModule)) return [];\n\n const styles = remoteModule.styles;\n if (!Array.isArray(styles)) return [];\n\n return styles.filter((entry): entry is string => typeof entry === 'string');\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"sources":["../src/host/collect-styles.ts"],"sourcesContent":["export function collectStyles(remoteModule: unknown): string[] {\n if (typeof remoteModule !== 'object' || remoteModule === null) return [];\n if (!('styles' in remoteModule)) return [];\n\n const styles = remoteModule.styles;\n if (!Array.isArray(styles)) return [];\n\n return styles.filter((entry): entry is string => typeof entry === 'string');\n}\n"],"mappings":";;;;;;;;;;;AAAO,SAAS,cAAc,cAAiC;AAC7D,MAAI,OAAO,iBAAiB,YAAY,iBAAiB,KAAM,QAAO,CAAC;AACvE,MAAI,EAAE,YAAY,cAAe,QAAO,CAAC;AAEzC,QAAM,SAAS,aAAa;AAC5B,MAAI,CAAC,MAAM,QAAQ,MAAM,EAAG,QAAO,CAAC;AAEpC,SAAO,OAAO,OAAO,CAAC,UAA2B,OAAO,UAAU,QAAQ;AAC5E;","names":[]}
|