diff --git a/package-lock.json b/package-lock.json index f159951..d832ba9 100644 --- a/package-lock.json +++ b/package-lock.json @@ -9,7 +9,7 @@ "version": "0.0.1", "dependencies": { "@tanstack/react-query": "^5.83.0", - "attio": "0.0.1-experimental.20250813.2", + "attio": "0.0.1-experimental.20250829.2", "event-target-polyfill": "^0.0.4", "match-sorter": "8.0.3", "react": "19.0.0", @@ -1285,9 +1285,9 @@ "license": "MIT" }, "node_modules/attio": { - "version": "0.0.1-experimental.20250813.2", - "resolved": "https://registry.npmjs.org/attio/-/attio-0.0.1-experimental.20250813.2.tgz", - "integrity": "sha512-/nDDrbX7Qo1YYDPJPvdrf+RVqZ0P13KpDT/4CqFthW8KDxD6wMAKAw51p+rToBEBxzGwsEYYrHR5eNRriFSJsw==", + "version": "0.0.1-experimental.20250829.2", + "resolved": "https://registry.npmjs.org/attio/-/attio-0.0.1-experimental.20250829.2.tgz", + "integrity": "sha512-Glb7GSplL8RuPgCxZZptdseUqORoqO6dINsP1wJJ6iFqLqYbGSA+ArQxFEUMLKrx2DtPRCCHgEYwrYApcSXBCQ==", "dependencies": { "@attio/fetchable-npm": "npm:@attio/fetchable@0.0.1-experimental.4", "@babel/code-frame": "^7.27.1", @@ -1318,7 +1318,7 @@ "tiny-cursor": "^2.0.0", "tmp-promise": "^3.0.3", "ts-morph": "^24.0.0", - "typescript": "5.6.3", + "typescript": "5.9.2", "zod": "^3.25.64" }, "bin": { @@ -1355,9 +1355,9 @@ } }, "node_modules/attio/node_modules/typescript": { - "version": "5.6.3", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.6.3.tgz", - "integrity": "sha512-hjcS1mhfuyi4WW8IWtjP7brDrG2cuDZukyrYrSauoXGNgx0S7zceP07adYkJycEr56BOUTNPzbInooiN3fn1qw==", + "version": "5.9.2", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.9.2.tgz", + "integrity": "sha512-CWBzXQrc/qOkhidw1OzBTQuYRbfyxDXJMVJ1XNwUHGROVmuaeiEm3OslpZ1RV96d7SKKjZKrSJu3+t/xlw3R9A==", "license": "Apache-2.0", "bin": { "tsc": "bin/tsc", diff --git a/package.json b/package.json index f815692..86e105f 100644 --- a/package.json +++ b/package.json @@ -22,7 +22,7 @@ }, "dependencies": { "@tanstack/react-query": "^5.83.0", - "attio": "0.0.1-experimental.20250813.2", + "attio": "0.0.1-experimental.20250829.2", "event-target-polyfill": "^0.0.4", "match-sorter": "8.0.3", "react": "19.0.0", diff --git a/src/app.ts b/src/app.ts new file mode 100644 index 0000000..03f8809 --- /dev/null +++ b/src/app.ts @@ -0,0 +1,34 @@ +import type {App} from "attio/client" + +import {companyLogCustomerRequestAction} from "./record/actions/company-log-customer-request-action" +import {companyViewCompanyAction} from "./record/actions/company-view-company-action" +import {dealLogCustomerRequestAction} from "./record/actions/deal-log-customer-request-action" +import {personLogCustomerRequestAction} from "./record/actions/person-log-customer-request-action" +import {companyCustomerRequestCount} from "./record/widgets/company-customer-request-count-widget" +import {customerRequestTextSelectionCallInsightAction} from "./text-selection/customer-request-call-insight-action" +import {customerRequestTextSelectionCallSummaryAction} from "./text-selection/customer-request-call-summary-action" +import {customerRequestTranscriptSelectionAction} from "./text-selection/customer-request-transcript-action" + +export const app: App = { + record: { + actions: [ + companyLogCustomerRequestAction, + companyViewCompanyAction, + dealLogCustomerRequestAction, + personLogCustomerRequestAction, + ], + bulkActions: [], + widgets: [companyCustomerRequestCount], + }, + callRecording: { + insight: { + textActions: [customerRequestTextSelectionCallInsightAction], + }, + summary: { + textActions: [customerRequestTextSelectionCallSummaryAction], + }, + transcript: { + textActions: [customerRequestTranscriptSelectionAction], + }, + }, +} diff --git a/src/record/actions/company-log-customer-request-action.tsx b/src/record/actions/company-log-customer-request-action.tsx index c002ecf..d534050 100644 --- a/src/record/actions/company-log-customer-request-action.tsx +++ b/src/record/actions/company-log-customer-request-action.tsx @@ -1,10 +1,10 @@ -import type {RecordAction} from "attio/client" +import type {App} from "attio/client" import {showDialog} from "attio/client" import {LogCustomerRequestDialog} from "../../components/log-customer-request-dialog" import ensureConnection from "../../utils/ensure-connection.server" import {ensureCustomerRequestsEnabled} from "../../utils/ensure-customer-requests-enabled" -export const recordAction: RecordAction = { +export const companyLogCustomerRequestAction: App.Record.Action = { id: "company-log-customer-request-action", onTrigger: async ({recordId}) => { await ensureConnection() diff --git a/src/record/actions/company-view-company-action.tsx b/src/record/actions/company-view-company-action.tsx index 37ff79d..d730806 100644 --- a/src/record/actions/company-view-company-action.tsx +++ b/src/record/actions/company-view-company-action.tsx @@ -1,8 +1,8 @@ -import {showToast, type RecordAction} from "attio/client" - +import type {App} from "attio/client" +import {showToast} from "attio/client" import {viewCompanyInLinear} from "../../utils/view-company-in-linear" -export const recordAction: RecordAction = { +export const companyViewCompanyAction: App.Record.Action = { id: "company-view-company-action", onTrigger: async ({recordId}) => { await viewCompanyInLinear(recordId).catch((error) => { diff --git a/src/record/actions/deal-log-customer-request-action.tsx b/src/record/actions/deal-log-customer-request-action.tsx index 580af69..672873d 100644 --- a/src/record/actions/deal-log-customer-request-action.tsx +++ b/src/record/actions/deal-log-customer-request-action.tsx @@ -1,11 +1,11 @@ -import type {RecordAction} from "attio/client" +import type {App} from "attio/client" import {runQuery, showDialog, showToast} from "attio/client" import {LogCustomerRequestDialog} from "../../components/log-customer-request-dialog" import GetCompanyIdByDealId from "../../graphql/get-company-id-by-deal-id.graphql" import ensureConnection from "../../utils/ensure-connection.server" import {ensureCustomerRequestsEnabled} from "../../utils/ensure-customer-requests-enabled" -export const recordAction: RecordAction = { +export const dealLogCustomerRequestAction: App.Record.Action = { id: "deal-log-customer-request-action", onTrigger: async ({recordId}) => { await ensureConnection() diff --git a/src/record/actions/person-log-customer-request-action.tsx b/src/record/actions/person-log-customer-request-action.tsx index 4881d7f..1a1d7f4 100644 --- a/src/record/actions/person-log-customer-request-action.tsx +++ b/src/record/actions/person-log-customer-request-action.tsx @@ -1,11 +1,11 @@ -import type {RecordAction} from "attio/client" +import type {App} from "attio/client" import {runQuery, showDialog, showToast} from "attio/client" import {LogCustomerRequestDialog} from "../../components/log-customer-request-dialog" import GetCompanyByPersonId from "../../graphql/get-company-id-by-person-id.graphql" import ensureConnection from "../../utils/ensure-connection.server" import {ensureCustomerRequestsEnabled} from "../../utils/ensure-customer-requests-enabled" -export const recordAction: RecordAction = { +export const personLogCustomerRequestAction: App.Record.Action = { id: "person-log-customer-request-action", onTrigger: async ({recordId}) => { await ensureConnection() diff --git a/src/record/widgets/company-customer-request-count-widget.tsx b/src/record/widgets/company-customer-request-count-widget.tsx index 114aa2c..36ba2bb 100644 --- a/src/record/widgets/company-customer-request-count-widget.tsx +++ b/src/record/widgets/company-customer-request-count-widget.tsx @@ -1,10 +1,10 @@ -import type {RecordWidget} from "attio/client" import {runQuery, showToast, Widget} from "attio/client" import React from "react" import "event-target-polyfill" import "yet-another-abortcontroller-polyfill" import {QueryClient, QueryClientProvider, useSuspenseQuery} from "@tanstack/react-query" +import type {App} from "attio/client" import GetCompanyById from "../../graphql/get-company-by-id.graphql" import {createCustomerUrl} from "../../linear/customers/create-customer-url" import getCustomerByCompanyRecordId from "../../linear/customers/get-customer-by-company-record-id.server" @@ -59,7 +59,7 @@ const LoadingWidget = ({recordId}: {recordId: string}) => { ) } -export const recordWidget: RecordWidget = { +export const companyCustomerRequestCount: App.Record.Widget = { id: "company-customer-request-count", label: "Customer requests", color: "#5e6ad2", diff --git a/src/text-selection/customer-request-call-insight-action.tsx b/src/text-selection/customer-request-call-insight-action.tsx index c1ebf29..5d37cd7 100644 --- a/src/text-selection/customer-request-call-insight-action.tsx +++ b/src/text-selection/customer-request-call-insight-action.tsx @@ -1,7 +1,8 @@ -import {type CallRecordingInsightTextSelectionAction, showDialog} from "attio/client" +import type {App} from "attio/client" +import {showDialog} from "attio/client" import {LogCustomerRequestDialog} from "../components/log-customer-request-dialog" -export const callRecordingInsightTextSelectionAction: CallRecordingInsightTextSelectionAction = { +export const customerRequestTextSelectionCallInsightAction: App.CallRecording.Insight.TextAction = { id: "customer-request-text-selection-call-insight-action", label: "Log customer request", onTrigger: async ({markdown}) => { diff --git a/src/text-selection/customer-request-call-summary-action.tsx b/src/text-selection/customer-request-call-summary-action.tsx index fe7fe21..60b91c6 100644 --- a/src/text-selection/customer-request-call-summary-action.tsx +++ b/src/text-selection/customer-request-call-summary-action.tsx @@ -1,7 +1,8 @@ -import {type CallRecordingSummaryTextSelectionAction, showDialog} from "attio/client" +import type {App} from "attio/client" +import {showDialog} from "attio/client" import {LogCustomerRequestDialog} from "../components/log-customer-request-dialog" -export const callRecordingSummaryTextSelectionAction: CallRecordingSummaryTextSelectionAction = { +export const customerRequestTextSelectionCallSummaryAction: App.CallRecording.Summary.TextAction = { id: "customer-request-text-selection-call-summary-action", label: "Log customer request", onTrigger: async ({markdown}) => { diff --git a/src/text-selection/customer-request-transcript-action.tsx b/src/text-selection/customer-request-transcript-action.tsx index 66e7397..45d2fe3 100644 --- a/src/text-selection/customer-request-transcript-action.tsx +++ b/src/text-selection/customer-request-transcript-action.tsx @@ -1,31 +1,31 @@ -import {type CallRecordingTranscriptTextSelectionAction, showDialog} from "attio/client" +import type {App} from "attio/client" +import {showDialog} from "attio/client" import {LogCustomerRequestDialog} from "../components/log-customer-request-dialog" -export const callRecordingTranscriptTextSelectionAction: CallRecordingTranscriptTextSelectionAction = - { - id: "customer-request-transcript-selection-action", - label: "Log customer request", - onTrigger: async ({ - transcript, - url, - }: { - transcript: {speaker: string; text: string}[] - url: string - }) => { - await showDialog({ - title: "Log customer request", - Dialog: ({hideDialog}: {hideDialog: () => void}) => { - const quote = transcript - .map(({speaker, text}) => `> **${speaker}**: ${text}`) - .join("\n> \n") - return ( - - ) - }, - }) - }, - } +export const customerRequestTranscriptSelectionAction: App.CallRecording.Transcript.TextAction = { + id: "customer-request-transcript-selection-action", + label: "Log customer request", + onTrigger: async ({ + transcript, + url, + }: { + transcript: {speaker: string; text: string}[] + url: string + }) => { + await showDialog({ + title: "Log customer request", + Dialog: ({hideDialog}: {hideDialog: () => void}) => { + const quote = transcript + .map(({speaker, text}) => `> **${speaker}**: ${text}`) + .join("\n> \n") + return ( + + ) + }, + }) + }, +}