diff --git a/CHANGELOG.md b/CHANGELOG.md index 13da22d..74df1ab 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,19 @@ Notable changes to `@wirecat/attio-cli`. One section per version, newest first. +## 0.2.0 — 19.11.2026 + +### Changed — may break callers + +- **`attio sync` copies only the people and companies your deals name**, as bitrix24-cli does. Attio adds a + person and a company for every address in your mail, and a full copy held thousands you never sell to. Every other + one is still found by `people list` and `organizations list`, which read Attio live. + +### Fixed + +- **A workspace with Attio's Deals object turned off syncs**, and `sync` names that as a gap. It failed with + `not_found` before. + ## 0.1.0 — 18.11.2026 ### Added diff --git a/README.md b/README.md index cb76a8b..80c38cc 100644 --- a/README.md +++ b/README.md @@ -47,8 +47,8 @@ Agent: (runs attio work changes list change:won "at>=7d") ## Why attio -- **A copy of your CRM on your computer.** `sync` copies your deals, people and companies into a local store. Lists, - the pipeline board and search answer from it with no request to Attio, also offline. +- **A copy of your CRM on your computer.** `sync` copies your deals and the people and companies on them into a local + store. Lists, the pipeline board and search answer from it with no request to Attio, also offline. - **A permission on every action.** Each command and each Attio API operation has its own level: allow, ask, read only or deny. `WCATTIO_READ_ONLY=1` stops every write. - **The token stays in your system keyring.** It never appears in output, errors or run records, and is never taken @@ -68,7 +68,7 @@ a terminal: npm install -g @wirecat/attio-cli attio skill install # the agent skill, for Claude Code, Codex, Gemini CLI and OpenClaw attio work session start # paste your Attio access token -attio work sync # copy your deals, people and companies +attio work sync # copy your deals and their people and companies attio work deals list status:open ``` @@ -167,8 +167,9 @@ More: [using attio](https://github.com/WireCatLabs/attio-cli/blob/main/docs/usag - **An access token.** A workspace admin makes it in Attio. It is kept in the system keyring, or in a private file on a computer without one. -- **A local copy.** `sync` copies the workspace's deals, people and companies, with the stages of Attio's deal - pipeline, into the WireCat local store. Attio cannot list only what changed, so each sync reads every record. +- **A local copy.** `sync` copies the workspace's deals and the people and companies they name, with the stages of + Attio's deal pipeline, into the WireCat local store. Attio cannot list only what changed, so each sync reads every + record. - **Live where it matters.** `people`, `organizations` and `users` ask Attio each time, so they show the newest data. - **Made for scripts.** `--json` prints one JSON value for every command, and an error comes as JSON with a code to branch on. diff --git a/contracts/wirecat.json b/contracts/wirecat.json index 81f48a4..b7acd78 100644 --- a/contracts/wirecat.json +++ b/contracts/wirecat.json @@ -2301,7 +2301,7 @@ "--json" ], "lastShape": "runs", - "what": "your deals, people and companies", + "what": "your deals and their clients", "note": null }, "storeInfo": null, @@ -2316,6 +2316,24 @@ "app": "attio-cli", "env": "WCATTIO" }, - "settings": null + "settings": null, + "accountRemove": { + "signOut": [ + "{profile}", + "session", + "end", + "--record", + "--json" + ], + "remove": null, + "removes": [ + "signIn" + ], + "keeps": [ + "settings", + "data", + "listed" + ] + } } } diff --git a/docs/commands.md b/docs/commands.md index c0975d6..8cdf1ea 100644 --- a/docs/commands.md +++ b/docs/commands.md @@ -1968,7 +1968,7 @@ attio api self-list ## `attio sync` -bring the CRM's copy in the local store up to date: pipelines, companies, contacts, deals and leads that changed since the last sync, or everything with --rescan; a run stops before its deadline or --max-pages and the next one goes on from there. With the activities setting on, also the activities and tasks on the deals and leads it keeps. Then each deal or lead that moved into a stage the stage-tasks setting names opens a local task, once per move +bring the CRM's copy in the local store up to date: pipelines, companies, contacts, deals and leads that changed since the last sync, or everything with --rescan; a run stops before its deadline or --max-pages and the next one goes on from there **Changes something on this computer only.** diff --git a/docs/dev/live-checks.txt b/docs/dev/live-checks.txt index ec2c9fc..432fa81 100644 --- a/docs/dev/live-checks.txt +++ b/docs/dev/live-checks.txt @@ -2,3 +2,4 @@ 0.0.0 9fb9e9b4c7b130c230ec470b6997eb98ae980cab 2026-11-18 scripts/live.sh v2:bcecdc6c78f330e20db1ae5121dea074362ec207c91002b2fef2ae12d9252e37 0.0.0 566a4c49762f2a040aedea214d599f6901adfc49 2026-11-18 scripts/live.sh v2:801aaeff341e47af83c63f58dd20a61343e5034469ec3275b6bcc157d4492789 0.1.0 e50bb05bb98123226a9a885a3ec65c9977b33e15 2026-11-18 scripts/live.sh v2:6955831e23adf6de8d6be01900945c9c2bf64d4a6c0b5785dacf689deb65cbe9 +0.2.0 1513a2caa1c5933137f1af42b5395880bcbe177d 2026-11-18 scripts/live.sh v2:2dfc209ec1e1767b3de3a3454a9ffdbdf63395678935f24670188b512d072f94 diff --git a/docs/index.md b/docs/index.md index 4d58e42..c3120e1 100644 --- a/docs/index.md +++ b/docs/index.md @@ -93,8 +93,8 @@ Agent: (runs attio work changes list change:won "at>=7d") ## How it works -- **A copy on your computer.** `sync` puts your deals, people and companies into the WireCat local store, the one - file on your computer that every WireCat tool shares. Lists, the pipeline and search read it, also offline. +- **A copy on your computer.** `sync` puts your deals and the people and companies on them into the WireCat local store, + the one file on your computer that every WireCat tool shares. Lists, the pipeline and search read it, also offline. - **Sign-in with an access token.** It is kept in the system keyring, or in a private file on a computer without one. - **Made for scripts and agents.** `--json` gives a JSON answer, and an error comes with a code to branch on. [MCP](mcp.md) @@ -114,7 +114,7 @@ Or in a terminal: npm install -g @wirecat/attio-cli attio skill install # teaches Claude Code, Codex and Gemini CLI to use attio attio work session start # paste the Attio access token when it asks -attio work sync # copy your deals, people and companies +attio work sync # copy your deals and their people and companies attio work deals list status:open ``` diff --git a/docs/installation.md b/docs/installation.md index ba80f2a..9387141 100644 --- a/docs/installation.md +++ b/docs/installation.md @@ -83,7 +83,7 @@ does not land in your shell history. ```sh attio work session status --check # asks Attio which workspace the token belongs to -attio work sync # copies your deals, people and companies +attio work sync # copies your deals and their people and companies attio work deals list status:open ``` diff --git a/docs/security.md b/docs/security.md index 5547892..aa62b70 100644 --- a/docs/security.md +++ b/docs/security.md @@ -38,10 +38,10 @@ agent asks. Attio's tokens do not expire, so delete one you no longer use. ## What the copy holds -`sync` stores the workspace's deals, people and companies in the WireCat local store on this computer, where every -WireCat tool can read them: a deal's stage, amount, company, people and owner, and a person's name, e-mails, phones -and job title. Each record keeps its current values only. `people` and `organizations` read Attio live and add -nothing to the copy. +`sync` stores the workspace's deals, and the people and companies they name, in the WireCat local store on this +computer, where every WireCat tool can read them: a deal's stage, amount, company, people and owner, and a person's +name, e-mails, phones and job title. Each record keeps its current values only. `people` and `organizations` read Attio +live and add nothing to the copy. Text from Attio, such as deal titles, names and attribute values, reaches an agent marked `untrusted`, so the agent reads it as data, not as an instruction. diff --git a/package.json b/package.json index 4f09763..705f7c5 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@wirecat/attio-cli", - "version": "0.1.0", + "version": "0.2.0", "description": "Attio CRM: people and companies, searchable with your other WireCat data", "license": "Apache-2.0", "author": "Viacheslav Ptsarev", @@ -60,8 +60,8 @@ "source:check": "node --experimental-strip-types scripts/source-check.ts" }, "dependencies": { - "@wirecat/cli-base": "0.118.0", - "@wirecat/cli-core": "0.700.0", + "@wirecat/cli-base": "0.119.0", + "@wirecat/cli-core": "0.703.0", "commander": "15.0.0", "valibot": "1.5.0" }, diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 5a7b65d..248f60f 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -13,11 +13,11 @@ importers: .: dependencies: '@wirecat/cli-base': - specifier: 0.118.0 - version: 0.118.0(commander@15.0.0)(esbuild@0.28.2)(typescript@7.0.2)(vitest@5.0.5) + specifier: 0.119.0 + version: 0.119.0(commander@15.0.0)(esbuild@0.28.2)(typescript@7.0.2)(vitest@5.0.5) '@wirecat/cli-core': - specifier: 0.700.0 - version: 0.700.0(@wirecat/cli-base@0.118.0(commander@15.0.0)(esbuild@0.28.2)(typescript@7.0.2)(vitest@5.0.5))(commander@15.0.0)(typescript@7.0.2)(zod@4.6.7) + specifier: 0.703.0 + version: 0.703.0(@wirecat/cli-base@0.119.0(commander@15.0.0)(esbuild@0.28.2)(typescript@7.0.2)(vitest@5.0.5))(commander@15.0.0)(typescript@7.0.2)(zod@4.6.7) commander: specifier: 15.0.0 version: 15.0.0 @@ -1188,8 +1188,8 @@ packages: '@wasm-audio-decoders/opus-ml@0.0.3': resolution: {integrity: sha512-SEeTmk0eb3q5etJA/NHCRWW6BivTx9tqvNTmG0kg2ynuATEQRUZnwQE6Ibvl1BBvqIGHqI57+qyJMWmJBwb5XQ==} - '@wirecat/cli-base@0.118.0': - resolution: {integrity: sha512-J++xrZeoL7BBZ7yZOQW1l/L0ScXnTzuwvy693gR+9ig7WXQl1b0QRqxWT6B6/I0RZHMsKs+lWb3P6ZK4XmhFDw==} + '@wirecat/cli-base@0.119.0': + resolution: {integrity: sha512-1j1es80chzH3O7Lazco3H92v0B70nu8yGdOM9xnUUv7iYBHuD4scTQeOcFadUcdS3K4jSwkhGKYa5vpDqgV3pA==} engines: {node: '>=22'} hasBin: true peerDependencies: @@ -1216,8 +1216,8 @@ packages: '@wirecat/cli-core-sqlite@1.1.0': resolution: {integrity: sha512-GpGlh/dAIX/nblBYCdT6DfWSLFxav9mxxeELQAfEuw+QZdT9unKxbi5xa02s/s4JS1P7n0PQx2sCABj4FlMRNw==} - '@wirecat/cli-core@0.700.0': - resolution: {integrity: sha512-7r/mH9KqkR0cZr6rZpdp/oV91L0wvhuVMV8r9iUIQ/FZdV59o6jP+MWEWJz8j9oq9ckDXalCgIlNe1cE/L6juA==} + '@wirecat/cli-core@0.703.0': + resolution: {integrity: sha512-QBEeHU9vD7yyf8WqQhuuiIz0oLu+5PCGhuhBrAjJKfLeNlal4dKg/4a/Cd3A9ZwOxC2OHjfVKrv+0c3Ys0moKg==} engines: {node: ^22.16.0 || >=24} hasBin: true peerDependencies: @@ -3346,7 +3346,7 @@ snapshots: dependencies: '@wasm-audio-decoders/common': 9.0.7 - '@wirecat/cli-base@0.118.0(commander@15.0.0)(esbuild@0.28.2)(typescript@7.0.2)(vitest@5.0.5)': + '@wirecat/cli-base@0.119.0(commander@15.0.0)(esbuild@0.28.2)(typescript@7.0.2)(vitest@5.0.5)': dependencies: '@valibot/to-json-schema': 1.8.0(valibot@1.5.0(typescript@7.0.2)) cli-table3: 0.6.5 @@ -3366,7 +3366,7 @@ snapshots: '@wirecat/cli-core-sqlite@1.1.0': {} - '@wirecat/cli-core@0.700.0(@wirecat/cli-base@0.118.0(commander@15.0.0)(esbuild@0.28.2)(typescript@7.0.2)(vitest@5.0.5))(commander@15.0.0)(typescript@7.0.2)(zod@4.6.7)': + '@wirecat/cli-core@0.703.0(@wirecat/cli-base@0.119.0(commander@15.0.0)(esbuild@0.28.2)(typescript@7.0.2)(vitest@5.0.5))(commander@15.0.0)(typescript@7.0.2)(zod@4.6.7)': dependencies: '@anthropic-ai/sdk': 1.3.0(zod@4.6.7) '@bomb.sh/tab': 0.0.22(commander@15.0.0) @@ -3376,7 +3376,7 @@ snapshots: '@valibot/to-json-schema': 1.8.0(valibot@1.5.0(typescript@7.0.2)) '@wasm-audio-decoders/flac': 0.2.11 '@wasm-audio-decoders/ogg-vorbis': 0.1.20 - '@wirecat/cli-base': 0.118.0(commander@15.0.0)(esbuild@0.28.2)(typescript@7.0.2)(vitest@5.0.5) + '@wirecat/cli-base': 0.119.0(commander@15.0.0)(esbuild@0.28.2)(typescript@7.0.2)(vitest@5.0.5) '@wirecat/cli-core-onnx': 1.2.0 '@wirecat/cli-core-sqlite': 1.1.0 '@xmldom/xmldom': 0.9.12 diff --git a/scripts/live.sh b/scripts/live.sh index 8191387..a30801b 100755 --- a/scripts/live.sh +++ b/scripts/live.sh @@ -37,9 +37,10 @@ node -e ' const sync = JSON.parse(require("fs").readFileSync(process.argv[1], "utf8")) const item = sync.item ?? {} if (item.provider !== "attio") throw new Error(`not an attio sync: ${JSON.stringify(sync).slice(0, 200)}`) - const kinds = (item.synced ?? []).filter((one) => one.error === undefined && one.saved > 0).map((one) => one.kind) - for (const kind of ["person", "organization"]) - if (!kinds.includes(kind)) throw new Error(`no ${kind} saved: ${JSON.stringify(item.synced).slice(0, 300)}`) + // People and companies are copied only as a deal names them, so a workspace with no deals saves none. + const failed = (item.synced ?? []).filter((one) => one.error !== undefined) + if (failed.length || !(item.synced ?? []).length) + throw new Error(`sync failed: ${JSON.stringify(item.synced).slice(0, 300)}`) ' "$work/sync.json" # Totals only: the record is public, the workspace's data is not. "${cli[@]}" live pipelines list --json >"$work/pipelines.json" @@ -51,6 +52,8 @@ node -e ' const kinds = synced.map((one) => `${one.kind} ${one.error ? `error ${one.error.code ?? one.error}` : one.saved}`) const stages = (read("pipelines").items ?? []).map((one) => (one.stages ?? []).length) const live = ["people", "organizations"].map((name) => `${name} ${(read(name).items ?? []).length}`) + for (const name of ["people", "organizations"]) + if (!(read(name).items ?? []).length) throw new Error(`no ${name} listed live`) process.stdout.write(`synced: ${kinds.join(", ")}; pipelines: ${stages.length} with ${stages.join("+")} stages; live: ${live.join(", ")}\n`) ' "$work" "${cli[@]}" live doctor --json >/dev/null diff --git a/src/attio-map.test.ts b/src/attio-map.test.ts index 04aa1f6..1c19659 100644 --- a/src/attio-map.test.ts +++ b/src/attio-map.test.ts @@ -75,13 +75,15 @@ const source = (calls: { operation: string; body: unknown }[] = []) => return request.path.identifier === "deals" && !Number(request.query.offset) ? { data: [{ api_slug: "priority", title: "Priority", type: "select", is_system_attribute: false }] } : { data: [] } + // A person or a company is copied as a deal names it, each read by id. + if (operation === "getV2ObjectsByObjectRecordsByRecordId") return { data: RECORDS[String(request.path.object)] } expect(operation).toBe("postV2ObjectsByObjectRecordsQuery") return { data: Number(body?.offset) ? [] : [RECORDS[String(request.path.object)]] } }, ...HOOK_OPTIONS, }) -it("maps an Attio person", async () => { +it("copies the person a deal names, mapped from Attio", async () => { const page = await source().changes("person", null) expect("items" in page && page.items).toEqual([ expect.objectContaining({ @@ -128,7 +130,7 @@ it("reads Attio's one deal pipeline: won where it celebrates, lost by the title" ]) }) -it("maps an Attio company with its domain and team", async () => { +it("copies the company a deal names, with its domain and team", async () => { const page = await source().changes("organization", null) expect("items" in page && page.items).toEqual([ expect.objectContaining({ diff --git a/src/crm-options.test.ts b/src/crm-options.test.ts index 8214c87..9105816 100644 --- a/src/crm-options.test.ts +++ b/src/crm-options.test.ts @@ -55,9 +55,7 @@ it("every option of the CRM commands runs against the fake workspace", async () ["pipelines", "show", "Deals"], ["pipelines", "show", "Deals", "--since-time", "2026-01-01", "--until-time", "2026-12-31"], ["people", "list", "--limit", "1", "--page", "2"], - // Words go through Attio's filter `$or`, which its API description leaves out (an open object): src/attio-map.test.ts - // checks that search. - ["people", "list", "--format", "csv"], + ["people", "list", "name", "--format", "csv"], ["people", "show", refs.person], ["organizations", "list", "--limit", "1", "--page", "1"], ["organizations", "list", "--format", "csv"], diff --git a/src/generated/definitions.ts b/src/generated/definitions.ts index 6105526..e74a693 100644 --- a/src/generated/definitions.ts +++ b/src/generated/definitions.ts @@ -5367,6 +5367,9 @@ export const definitions: Readonly> = { type: "object", properties: {}, required: [], + additionalProperties: { + type: "unknown", + }, }, filter_view_id: { description: @@ -16564,6 +16567,9 @@ export const definitions: Readonly> = { type: "object", properties: {}, required: [], + additionalProperties: { + type: "unknown", + }, }, { type: "string", @@ -18358,6 +18364,9 @@ export const definitions: Readonly> = { type: "object", properties: {}, required: [], + additionalProperties: { + type: "unknown", + }, }, sorts: { description: @@ -28562,6 +28571,9 @@ export const definitions: Readonly> = { type: "object", properties: {}, required: [], + additionalProperties: { + type: "unknown", + }, }, filter_view_id: { description: @@ -39756,6 +39768,9 @@ export const definitions: Readonly> = { type: "object", properties: {}, required: [], + additionalProperties: { + type: "unknown", + }, }, { type: "string", diff --git a/src/generated/schemas.ts b/src/generated/schemas.ts index e631d81..4322f6b 100644 --- a/src/generated/schemas.ts +++ b/src/generated/schemas.ts @@ -2675,7 +2675,7 @@ export const PostV2ObjectsByObjectRecordsQueryRequest: v.GenericSchema< unknown, T.PostV2ObjectsByObjectRecordsQueryRequest > = v.looseObject({ - filter: v.optional(v.looseObject({})), + filter: v.optional(v.record(v.string(), v.unknown())), filter_view_id: v.optional(v.string()), sorts: v.optional( v.array( @@ -8193,7 +8193,7 @@ export const PutV2ObjectsByObjectRecordsByRecordIdAttributesByAttributeValuesReq values: v.pipe( v.array( v.looseObject({ - value: v.union([v.looseObject({}), v.string(), number(), v.boolean()]), + value: v.union([v.record(v.string(), v.unknown()), v.string(), number(), v.boolean()]), active_from: v.string(), active_until: v.nullable(v.string()), }), @@ -9050,7 +9050,7 @@ export const PostV2ActivitiesByActivityRecordsQueryRequest: v.GenericSchema< unknown, T.PostV2ActivitiesByActivityRecordsQueryRequest > = v.looseObject({ - filter: v.optional(v.looseObject({})), + filter: v.optional(v.record(v.string(), v.unknown())), sorts: v.optional( v.array( v.union([ @@ -13951,7 +13951,7 @@ export const DeleteV2ListsByListViewsByViewIdResponse: v.GenericSchema< export const PostV2ListsByListEntriesQueryRequest: v.GenericSchema = v.looseObject({ - filter: v.optional(v.looseObject({})), + filter: v.optional(v.record(v.string(), v.unknown())), filter_view_id: v.optional(v.string()), sorts: v.optional( v.array( @@ -19461,7 +19461,7 @@ export const PutV2ListsByListEntriesByEntryIdAttributesByAttributeValuesRequest: values: v.pipe( v.array( v.looseObject({ - value: v.union([v.looseObject({}), v.string(), number(), v.boolean()]), + value: v.union([v.record(v.string(), v.unknown()), v.string(), number(), v.boolean()]), active_from: v.string(), active_until: v.nullable(v.string()), }), diff --git a/src/generated/types.ts b/src/generated/types.ts index 6f69ecf..0cce692 100644 --- a/src/generated/types.ts +++ b/src/generated/types.ts @@ -2968,7 +2968,7 @@ export type PatchV2ByTargetByIdentifierAttributesByAttributeStatusesByStatusResp export type PostV2ObjectsByObjectRecordsQueryRequest = { /** An object used to filter results to a subset of results. Cannot be used together with `filter_view_id`. See the [full guide to filtering and sorting here](/rest-api/guides/filtering-and-sorting). */ - filter?: Record + filter?: { [key: string]: unknown } /** UUID of a saved view on this object or list. When set, results are filtered using that view's filter configuration. Cannot be used together with `filter`. Note: sorts, limits, and offsets are applied independently and are not taken from the view. All attributes are returned regardless of which attributes are visible in the view. */ filter_view_id?: string /** An object used to sort results. See the [full guide to filtering and sorting here](/rest-api/guides/filtering-and-sorting). */ @@ -9374,7 +9374,7 @@ export type PutV2ObjectsByObjectRecordsByRecordIdAttributesByAttributeValuesRequ /** The complete value history to write, replacing any existing values. Values may be supplied in any order. Gaps between intervals are allowed. At least one value is required, and a maximum of 400 values may be written in one request. */ values: Array<{ /** The value itself, in the same form accepted when updating a record or list entry. For complete documentation on values for all attribute types, please see our [attribute type docs](/docs/attribute-types). */ - value: Record | string | number | boolean + value: { [key: string]: unknown } | string | number | boolean /** An RFC 3339 timestamp for when this value became active. May not be in the future. */ active_from: string /** An RFC 3339 timestamp for when this value stopped being active, or `null` if it is still active. Must be after `active_from` and may not be in the future. This key is required: omitting it is almost always a mistake in a migration. */ @@ -10372,7 +10372,7 @@ export type PostV2ObjectsRecordsSearchResponse = { export type PostV2ActivitiesByActivityRecordsQueryRequest = { /** An object used to filter results to a subset of results. Cannot be used together with `filter_view_id`. See the [full guide to filtering and sorting here](/rest-api/guides/filtering-and-sorting). */ - filter?: Record + filter?: { [key: string]: unknown } /** An object used to sort results. See the [full guide to filtering and sorting here](/rest-api/guides/filtering-and-sorting). */ sorts?: Array< | { @@ -16064,7 +16064,7 @@ export type DeleteV2ListsByListViewsByViewIdResponse = Record export type PostV2ListsByListEntriesQueryRequest = { /** An object used to filter results to a subset of results. Cannot be used together with `filter_view_id`. See the [full guide to filtering and sorting here](/rest-api/guides/filtering-and-sorting). */ - filter?: Record + filter?: { [key: string]: unknown } /** UUID of a saved view on this object or list. When set, results are filtered using that view's filter configuration. Cannot be used together with `filter`. Note: sorts, limits, and offsets are applied independently and are not taken from the view. All attributes are returned regardless of which attributes are visible in the view. */ filter_view_id?: string /** An object used to sort results. See the [full guide to filtering and sorting here](/rest-api/guides/filtering-and-sorting). */ @@ -22473,7 +22473,7 @@ export type PutV2ListsByListEntriesByEntryIdAttributesByAttributeValuesRequest = /** The complete value history to write, replacing any existing values. Values may be supplied in any order. Gaps between intervals are allowed. At least one value is required, and a maximum of 400 values may be written in one request. */ values: Array<{ /** The value itself, in the same form accepted when updating a record or list entry. For complete documentation on values for all attribute types, please see our [attribute type docs](/docs/attribute-types). */ - value: Record | string | number | boolean + value: { [key: string]: unknown } | string | number | boolean /** An RFC 3339 timestamp for when this value became active. May not be in the future. */ active_from: string /** An RFC 3339 timestamp for when this value stopped being active, or `null` if it is still active. Must be after `active_from` and may not be in the future. This key is required: omitting it is almost always a mistake in a migration. */ diff --git a/src/generated/wirecat-config.ts b/src/generated/wirecat-config.ts index 3eaed17..46fe858 100644 --- a/src/generated/wirecat-config.ts +++ b/src/generated/wirecat-config.ts @@ -44,6 +44,7 @@ export const SOURCE: Readonly> & { current: "active_until", }, }, + linked: true, search: { operation: "postV2ObjectsByObjectRecordsQuery", path: { @@ -106,6 +107,7 @@ export const SOURCE: Readonly> & { current: "active_until", }, }, + linked: true, search: { operation: "postV2ObjectsByObjectRecordsQuery", path: { @@ -191,6 +193,9 @@ export const SOURCE: Readonly> & { current: "active_until", }, }, + optional: { + message: "the Deals object is off in this Attio workspace; an admin turns it on in its settings", + }, map: { externalId: "id.record_id", title: "values.name.0.value", diff --git a/src/identity.ts b/src/identity.ts index 87b96b4..9f74f98 100644 --- a/src/identity.ts +++ b/src/identity.ts @@ -22,7 +22,7 @@ export const DESKTOP = { // app.attio.com is only Attio's OAuth sign-in page, which the API description names; requests go to api.attio.com. hosts: ["api.attio.com", "app.attio.com"], tagline: "Attio deals, people and companies for your agent", - syncs: "your deals, people and companies", + syncs: "your deals and their clients", signIn: { gives: "Lets your agent read your Attio deals, people and companies and call the Attio API.", asks: diff --git a/src/version.ts b/src/version.ts index 8500465..78dbb32 100644 --- a/src/version.ts +++ b/src/version.ts @@ -1 +1 @@ -export const VERSION = "0.1.0" +export const VERSION = "0.2.0" diff --git a/wirecat.config.ts b/wirecat.config.ts index 178c10d..d459e78 100644 --- a/wirecat.config.ts +++ b/wirecat.config.ts @@ -33,8 +33,11 @@ export default defineCli({ provider: "attio", kinds: ["organization", "person", "deal"], entities: { + // Only the clients a deal names are copied, as Bitrix24's are: Attio adds a person and a company for every + // address in the owner's mail. The rest are read live. organization: { ...records("companies"), + linked: true, search: { operation: QUERY, path: { object: "companies" }, @@ -50,6 +53,7 @@ export default defineCli({ }, person: { ...records("people"), + linked: true, search: { operation: QUERY, path: { object: "people" }, @@ -78,6 +82,7 @@ export default defineCli({ }, deal: { ...records("deals"), + optional: { message: "the Deals object is off in this Attio workspace; an admin turns it on in its settings" }, map: { externalId: "id.record_id", title: "values.name.0.value",