{"_id":"@tines/apps","_rev":"7-3f97f5a174a39759a90682b232201385","name":"@tines/apps","dist-tags":{"bootstrap":"0.0.0-bootstrap.0","alpha":"0.0.0-alpha-20260724124510","latest":"1.3.0"},"versions":{"0.0.0-bootstrap.0":{"name":"@tines/apps","version":"0.0.0-bootstrap.0","license":"Apache-2.0","_id":"@tines/apps@0.0.0-bootstrap.0","maintainers":[{"name":"ngonzalez-tines","email":"ngonzalez@tines.io"},{"name":"stephen-mclean","email":"smclean@tines.io"}],"homepage":"https://github.com/tines/tines#readme","bugs":{"url":"https://github.com/tines/tines/issues"},"dist":{"shasum":"fabe52ccfa2746de1fa08db725e0e7e8e87d605c","tarball":"https://registry.npmjs.org/@tines/apps/-/apps-0.0.0-bootstrap.0.tgz","fileCount":2,"integrity":"sha512-YlK8qFRu2nrinIGMrhg+GVqvchecgOlAPx+MxZhrqJOTG3NBheoPSD7HSRvYiDgG3GUg7nulWLJnSosYcyObgg==","signatures":[{"sig":"MEQCIEyTbbtQngSze5iYLz5nua5oPJJDTRIgPmZn2EiUlU3kAiAaqU+wAbwtjalfYCY+qn80Gonyo3OwP9exn3fM/GjaQw==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":470},"_npmUser":{"name":"ngonzalez-tines","email":"ngonzalez@tines.io"},"repository":{"url":"git+https://github.com/tines/tines.git","type":"git","directory":"packages/apps"},"_npmVersion":"10.9.8","description":"Empty bootstrap package.","directories":{},"_nodeVersion":"22.23.1","publishConfig":{"access":"public","registry":"https://registry.npmjs.org"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/apps_0.0.0-bootstrap.0_1784816684020_0.32358789835860624","host":"s3://npm-registry-packages-npm-production"}},"0.0.0-alpha-20260724124510":{"name":"@tines/apps","version":"0.0.0-alpha-20260724124510","keywords":["tines","apps","sdk","automation","workflow","security"],"author":{"name":"Tines"},"license":"Apache-2.0","_id":"@tines/apps@0.0.0-alpha-20260724124510","maintainers":[{"name":"ngonzalez-tines","email":"ngonzalez@tines.io"},{"name":"stephen-mclean","email":"smclean@tines.io"}],"homepage":"https://www.tines.com/docs/apps","bugs":{"url":"https://github.com/tines/tines/issues"},"dist":{"shasum":"e79241a04433c71548a6975cda8fcca499916c5b","tarball":"https://registry.npmjs.org/@tines/apps/-/apps-0.0.0-alpha-20260724124510.tgz","fileCount":18,"integrity":"sha512-GgvlJsuPoJaXG11yEM8etiLiwpnIi++VODV9x121Y3AHOnF6v9fUo83F+5v+gdzMoprHvHIdegLD+8ZOs4OQgw==","signatures":[{"sig":"MEYCIQDPXw8wXCphLa6XH6qdu3X2ZrbghDepq+bGgpuQYTfnUgIhALjRNl7coNBIBqQCAzyrAmwK6iKqKuKvNNXoDO6RD693","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":37005},"main":"./dist/index.js","type":"module","_from":"file:package/tines-apps-0.0.0-alpha-20260724124510.tgz","types":"./dist/index.d.ts","module":"./dist/index.js","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"}},"scripts":{"test":"vitest run","build":"vite build","prepack":"vite build","fix:oxfmt":"yarn global:oxfmt .","check:tsgo":"yarn global:tsgo","fix:eslint":"yarn global:eslint --fix .","test:watch":"vitest watch","check:oxfmt":"yarn global:oxfmt --check .","check:cspell":"yarn global:cspell '**/*.{ts,tsx}'","check:eslint":"yarn global:eslint ."},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:937770bc-4092-4114-ae71-2df781c3c75b"}},"_resolved":"/home/runner/work/tines/tines/package/tines-apps-0.0.0-alpha-20260724124510.tgz","_integrity":"sha512-GgvlJsuPoJaXG11yEM8etiLiwpnIi++VODV9x121Y3AHOnF6v9fUo83F+5v+gdzMoprHvHIdegLD+8ZOs4OQgw==","repository":{"url":"git+https://github.com/tines/tines.git","type":"git","directory":"packages/apps"},"_npmVersion":"11.16.0","description":"Runtime SDK for Tines apps which includes typed hooks and helpers for interacting with Tines primitives, downloading files, and in-app routing.","directories":{},"sideEffects":false,"_nodeVersion":"24.18.0","publishConfig":{"access":"public","registry":"https://registry.npmjs.org"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"vite":"^7.0.8","jsdom":"^27.4.0","react":"^19.2.1","vitest":"^3.2.6","react-dom":"^19.2.1","typescript":"^6.0.3","vite-plugin-dts":"^4.5.4","react-router-dom":"^6.30.3","@testing-library/react":"^16.3.0"},"peerDependencies":{"react":"^19.2.1","react-router-dom":"^6.30.3"},"_npmOperationalInternal":{"tmp":"tmp/apps_0.0.0-alpha-20260724124510_1784897310646_0.5603855025360849","host":"s3://npm-registry-packages-npm-production"}},"1.0.0":{"name":"@tines/apps","version":"1.0.0","keywords":["tines","apps","sdk","automation","workflow","security"],"author":{"name":"Tines"},"license":"Apache-2.0","_id":"@tines/apps@1.0.0","maintainers":[{"name":"ngonzalez-tines","email":"ngonzalez@tines.io"},{"name":"stephen-mclean","email":"smclean@tines.io"},{"name":"nguyenma","email":"mnguyen@tines.io"}],"homepage":"https://www.tines.com/docs/apps","bugs":{"url":"https://github.com/tines/tines/issues"},"dist":{"shasum":"8bcdcfdf0a48de407ae35c6a5e7e84c308195000","tarball":"https://registry.npmjs.org/@tines/apps/-/apps-1.0.0.tgz","fileCount":18,"integrity":"sha512-icyWjs+MemTfAcanMmip6BQwfTQi/MNH8ZNzwGzIs8SDykSzCuZ2NxYt8XL3a4XmK+/7tq68+u5Pm+xmKE2bgw==","signatures":[{"sig":"MEYCIQCXpe0Y+NM7Rvqkndw3KGX5kP9hJ4wF5E53y4uDkWfdbAIhAIfS40nKLB6bZg5/3CLbUk1O4W+PWthSyFkld5qslfRd","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":36796},"main":"./dist/index.js","type":"module","_from":"file:package/tines-apps-1.0.0.tgz","types":"./dist/index.d.ts","module":"./dist/index.js","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"}},"scripts":{"test":"vitest run","build":"vite build","prepack":"vite build","fix:oxfmt":"yarn global:oxfmt .","test:watch":"vitest watch","check:oxfmt":"yarn global:oxfmt --check ."},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:d5e107ea-766b-4115-b3cb-35cdc940885f"}},"_resolved":"/home/runner/work/tines/tines/package/tines-apps-1.0.0.tgz","_integrity":"sha512-icyWjs+MemTfAcanMmip6BQwfTQi/MNH8ZNzwGzIs8SDykSzCuZ2NxYt8XL3a4XmK+/7tq68+u5Pm+xmKE2bgw==","repository":{"url":"git+https://github.com/tines/tines.git","type":"git","directory":"packages/apps"},"_npmVersion":"11.16.0","description":"Runtime SDK for Tines apps which includes typed hooks and helpers for interacting with Tines primitives, downloading files, and in-app routing.","directories":{},"sideEffects":false,"_nodeVersion":"24.18.0","publishConfig":{"access":"public","registry":"https://registry.npmjs.org"},"_hasShrinkwrap":false,"devDependencies":{"vite":"^7.0.8","jsdom":"^27.4.0","react":"^19.2.1","vitest":"^3.2.6","react-dom":"^19.2.1","typescript":"^6.0.3","vite-plugin-dts":"^4.5.4","react-router-dom":"^6.30.3","@testing-library/react":"^16.3.0"},"peerDependencies":{"react":"^19.2.1","react-router-dom":"^6.30.3"},"_npmOperationalInternal":{"tmp":"tmp/apps_1.0.0_1785952069213_0.4001328597903555","host":"s3://npm-registry-packages-npm-production"}},"1.1.0":{"name":"@tines/apps","version":"1.1.0","keywords":["tines","apps","sdk","automation","workflow","security"],"author":{"name":"Tines"},"license":"Apache-2.0","_id":"@tines/apps@1.1.0","maintainers":[{"name":"ngonzalez-tines","email":"ngonzalez@tines.io"},{"name":"stephen-mclean","email":"smclean@tines.io"},{"name":"nguyenma","email":"mnguyen@tines.io"}],"homepage":"https://www.tines.com/docs/apps","bugs":{"url":"https://github.com/tines/tines/issues"},"dist":{"shasum":"575c4bf24222649490692635b2a1bcbdb3615b97","tarball":"https://registry.npmjs.org/@tines/apps/-/apps-1.1.0.tgz","fileCount":21,"integrity":"sha512-KB+Lkz+82oa7uXxaIiJaxiqeb8pj6Cq7jBJoEkPtCPxocSJRMSfJExJIsnpTVd42fBlyr8JpvZbZtKcPDXxQJQ==","signatures":[{"sig":"MEQCIBBtb2Aev2QNWPjcfY+WY9TTOfvBfqYbElzFm2lMoLGxAiAXB2W4vfX8PS9sU9WxU4U6rtZToJR+sth9QlCKyY8oWQ==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":47048},"main":"./dist/index.js","type":"module","_from":"file:package/tines-apps-1.1.0.tgz","types":"./dist/index.d.ts","module":"./dist/index.js","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"}},"scripts":{"test":"vitest run","build":"vite build","prepack":"vite build","fix:oxfmt":"yarn global:oxfmt .","test:watch":"vitest watch","check:oxfmt":"yarn global:oxfmt --check ."},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:d5e107ea-766b-4115-b3cb-35cdc940885f"}},"_resolved":"/home/runner/work/tines/tines/package/tines-apps-1.1.0.tgz","_integrity":"sha512-KB+Lkz+82oa7uXxaIiJaxiqeb8pj6Cq7jBJoEkPtCPxocSJRMSfJExJIsnpTVd42fBlyr8JpvZbZtKcPDXxQJQ==","repository":{"url":"git+https://github.com/tines/tines.git","type":"git","directory":"packages/apps"},"_npmVersion":"11.16.0","description":"Runtime SDK for Tines apps which includes typed hooks and helpers for interacting with Tines primitives, downloading files, and in-app routing.","directories":{},"sideEffects":false,"_nodeVersion":"24.18.0","publishConfig":{"access":"public","registry":"https://registry.npmjs.org"},"_hasShrinkwrap":false,"devDependencies":{"vite":"^7.0.8","jsdom":"^27.4.0","react":"^19.2.1","vitest":"^3.2.6","react-dom":"^19.2.1","typescript":"^6.0.3","vite-plugin-dts":"^4.5.4","react-router-dom":"^6.30.3","@testing-library/react":"^16.3.0"},"peerDependencies":{"react":"^19.2.1","react-router-dom":"^6.30.3"},"_npmOperationalInternal":{"tmp":"tmp/apps_1.1.0_1785954334029_0.3699106418253817","host":"s3://npm-registry-packages-npm-production"}},"1.2.0":{"name":"@tines/apps","version":"1.2.0","keywords":["tines","apps","sdk","automation","workflow","security"],"author":{"name":"Tines"},"license":"Apache-2.0","_id":"@tines/apps@1.2.0","maintainers":[{"name":"ngonzalez-tines","email":"ngonzalez@tines.io"},{"name":"stephen-mclean","email":"smclean@tines.io"},{"name":"nguyenma","email":"mnguyen@tines.io"}],"homepage":"https://www.tines.com/docs/apps","bugs":{"url":"https://github.com/tines/tines/issues"},"dist":{"shasum":"e91f9e6c7108eef0a35adf7e93e7000dc090e889","tarball":"https://registry.npmjs.org/@tines/apps/-/apps-1.2.0.tgz","fileCount":22,"integrity":"sha512-9oCAja1YYyx0QJ4CPIJqqjvUgqasE1e3uYvdiQ8p5ncL8B/sukQuZQyrZAP62uuiykeUVHzn1IBTQcNxsiDQwQ==","signatures":[{"sig":"MEUCIEKcQKegsMoGnj3WIz0a1yPVQklyY/M7/Nhnk8MWjOHXAiEA0w/nwL5u4XsGGsqq8OVpJKphmZaFf/rqL9aHL240hx8=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":52840},"main":"./dist/index.js","type":"module","_from":"file:package/tines-apps-1.2.0.tgz","types":"./dist/index.d.ts","module":"./dist/index.js","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"}},"scripts":{"test":"vitest run","build":"vite build","prepack":"vite build","test:watch":"vitest watch"},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:0120279b-7301-43c6-9f86-41b231cea977"}},"_resolved":"/home/runner/work/tines/tines/package/tines-apps-1.2.0.tgz","_integrity":"sha512-9oCAja1YYyx0QJ4CPIJqqjvUgqasE1e3uYvdiQ8p5ncL8B/sukQuZQyrZAP62uuiykeUVHzn1IBTQcNxsiDQwQ==","repository":{"url":"git+https://github.com/tines/tines.git","type":"git","directory":"packages/apps"},"_npmVersion":"11.17.0","description":"Runtime SDK for Tines apps which includes typed hooks and helpers for interacting with Tines primitives, downloading files, and in-app routing.","directories":{},"sideEffects":false,"_nodeVersion":"24.19.0","publishConfig":{"access":"public","registry":"https://registry.npmjs.org"},"_hasShrinkwrap":false,"devDependencies":{"vite":"^7.0.8","jsdom":"^27.4.0","react":"^19.2.1","vitest":"^4.1.8","react-dom":"^19.2.1","typescript":"^6.0.3","vite-plugin-dts":"^4.5.4","react-router-dom":"^6.30.3","@testing-library/react":"^16.3.0"},"peerDependencies":{"react":"^19.2.1","react-router-dom":"^6.30.3"},"_npmOperationalInternal":{"tmp":"tmp/apps_1.2.0_1787071695483_0.5072750737796834","host":"s3://npm-registry-packages-npm-production"}},"1.3.0":{"name":"@tines/apps","version":"1.3.0","description":"Runtime SDK for Tines apps which includes typed hooks and helpers for interacting with Tines primitives, downloading files, and in-app routing.","keywords":["tines","apps","sdk","automation","workflow","security"],"homepage":"https://www.tines.com/docs/apps","repository":{"type":"git","url":"git+https://github.com/tines/tines.git","directory":"packages/apps"},"license":"Apache-2.0","author":{"name":"Tines"},"publishConfig":{"access":"public","registry":"https://registry.npmjs.org"},"type":"module","sideEffects":false,"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"},"./internal":{"types":"./dist/internal.d.ts","import":"./dist/internal.js"}},"main":"./dist/index.js","module":"./dist/index.js","types":"./dist/index.d.ts","scripts":{"build":"vite build","prepare":"vite build","prepack":"vite build","test":"vitest run","test:watch":"vitest watch"},"peerDependencies":{"react":"^19.2.1","react-router-dom":"^6.30.3"},"devDependencies":{"@testing-library/react":"^16.3.0","jsdom":"^27.4.0","react":"^19.2.1","react-dom":"^19.2.1","react-router-dom":"^6.30.3","typescript":"^6.0.3","vite":"^7.0.8","vite-plugin-dts":"^4.5.4","vitest":"^4.1.8"},"_id":"@tines/apps@1.3.0","bugs":{"url":"https://github.com/tines/tines/issues"},"_integrity":"sha512-S3jx3TyUjRDNXLiBOLqHJtlyKUQNARD5ErLNZNp3KzSG+spuOXeXP1RxB+vk18F9u//dn8MIE1hvPdaZiuzzHA==","_resolved":"/home/runner/work/tines/tines/package/tines-apps-1.3.0.tgz","_from":"file:package/tines-apps-1.3.0.tgz","_nodeVersion":"24.19.0","_npmVersion":"11.17.0","dist":{"integrity":"sha512-S3jx3TyUjRDNXLiBOLqHJtlyKUQNARD5ErLNZNp3KzSG+spuOXeXP1RxB+vk18F9u//dn8MIE1hvPdaZiuzzHA==","shasum":"6bc637f6f58eecfb941f9052b7127929a8409796","tarball":"https://registry.npmjs.org/@tines/apps/-/apps-1.3.0.tgz","fileCount":24,"unpackedSize":53426,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEQCIEXzPr3qa+Z8FBBfW1DCIkm6m1ivtuhHdPK3fsowH311AiB9AdgK7ldzdhxSeO796pK8oF9VL6FKpf7wDiu1cTLoTQ=="}]},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:0120279b-7301-43c6-9f86-41b231cea977"}},"directories":{},"maintainers":[{"name":"ngonzalez-tines","email":"ngonzalez@tines.io"},{"name":"stephen-mclean","email":"smclean@tines.io"},{"name":"nguyenma","email":"mnguyen@tines.io"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/apps_1.3.0_1787849892164_0.37141606764572455"},"_hasShrinkwrap":false}},"time":{"created":"2026-07-23T14:24:43.856Z","modified":"2026-08-27T16:58:12.496Z","0.0.0-bootstrap.0":"2026-07-23T14:24:44.148Z","0.0.0-alpha-20260724124510":"2026-07-24T12:48:30.787Z","1.0.0":"2026-08-05T17:47:49.355Z","1.1.0":"2026-08-05T18:25:34.177Z","1.2.0":"2026-08-18T16:48:15.651Z","1.3.0":"2026-08-27T16:58:12.314Z"},"bugs":{"url":"https://github.com/tines/tines/issues"},"author":{"name":"Tines"},"license":"Apache-2.0","homepage":"https://www.tines.com/docs/apps","keywords":["tines","apps","sdk","automation","workflow","security"],"repository":{"type":"git","url":"git+https://github.com/tines/tines.git","directory":"packages/apps"},"description":"Runtime SDK for Tines apps which includes typed hooks and helpers for interacting with Tines primitives, downloading files, and in-app routing.","maintainers":[{"name":"ngonzalez-tines","email":"ngonzalez@tines.io"},{"name":"stephen-mclean","email":"smclean@tines.io"},{"name":"nguyenma","email":"mnguyen@tines.io"}],"readme":"# @tines/apps\n\nThe runtime SDK for [Tines apps](https://www.tines.com/docs/apps). A Tines App runs inside a sandboxed iframe with no direct access to the network, cookies, or storage. This package is how your App talks to Tines. It wraps the underlying message protocol between the App and the host Tines frame in a small, typed surface of functions and React hooks.\n\nAdd it to your App's dependencies, along with its peer dependencies, pinning the versions you want:\n\n```json\n{\n  \"dependencies\": {\n    \"@tines/apps\": \"^1.0.0\",\n    \"react\": \"^19.2.1\",\n    \"react-router-dom\": \"^6.30.3\"\n  }\n}\n```\n\n`react` and `react-router-dom` are declared as peer dependencies, so your App controls their versions through its own `package.json`. The Tines host does not provide them for you.\n\n## Quick start\n\n```tsx\nimport { useCase, invokeEndpoint } from \"@tines/apps\";\n\nfunction CaseSummary({ caseId }: { caseId: string }) {\n  const { data, loading, error } = useCase(caseId);\n\n  if (loading) return <p>Loading…</p>;\n  if (error) return <p>Could not load case: {error.message}</p>;\n\n  return <h1>{data.name}</h1>;\n}\n```\n\nEvery helper resolves through the host frame, which performs the privileged work under the signed-in viewer's session and permissions. If the viewer is not allowed to see something, or the host cannot fulfil the request within 30 seconds, the call rejects.\n\n## API\n\n### Endpoints\n\nInvoke an [app endpoint](https://www.tines.com/docs/apps) and receive its response.\n\n```ts\ninvokeEndpoint(endpointGuid: string, input?: Record<string, unknown>): Promise<unknown>\n```\n\n```ts\nuseEndpoint<T = unknown>(\n  endpointGuid: string,\n  input?: Record<string, unknown>,\n): { data: T | undefined; loading: boolean; error: Error | undefined; refetch: () => void }\n```\n\n`useEndpoint` invokes on mount and re-invokes when `endpointGuid` or `input` change (compared by value). Call `refetch()` to invoke again on demand.\n\n### Cases\n\nFetch a case by its public `case_id`.\n\n```ts\ngetCase(caseId: string): Promise<TinesCase>\n```\n\n```ts\nuseCase(caseId: string): {\n  data: TinesCase | undefined;\n  loading: boolean;\n  error: Error | undefined;\n  refetch: () => void;\n}\n```\n\n### Resources\n\nFetch a resource by its public `id`.\n\n```ts\ngetResource(resourceId: string): Promise<TinesResource>\n```\n\n```ts\nuseResource(resourceId: string): {\n  data: TinesResource | undefined;\n  loading: boolean;\n  error: Error | undefined;\n  refetch: () => void;\n}\n```\n\n### Records\n\nFetch a single record by its `id`. Pass `resolveArtifacts` to expand artifact references and `includeChildren` to include child records.\n\n```ts\ngetRecord(recordId: string, options?: TinesRecordOptions): Promise<TinesRecord>\n```\n\n```ts\nuseRecord(recordId: string, options?: TinesRecordOptions): {\n  data: TinesRecord | undefined;\n  loading: boolean;\n  error: Error | undefined;\n  refetch: () => void;\n}\n```\n\nFetch a page of records for a record type, with optional filters, ordering, a created-at range, and pagination.\n\n```ts\ngetRecords<TRow = TinesRecordRow>(\n  recordTypeId: string,\n  options?: TinesRecordsOptions,\n): Promise<TinesRecordsResult<TRow>>\n```\n\n```ts\nuseRecords<TRow = TinesRecordRow>(\n  recordTypeId: string,\n  options?: TinesRecordsOptions,\n): {\n  data: TinesRecordsResult<TRow> | undefined;\n  loading: boolean;\n  error: Error | undefined;\n  refetch: () => void;\n}\n```\n\nEach row carries `id`, `updated_at`, `case_ids`, and `parent_record` alongside one entry per record type field, so pass your own `TRow` to describe the fields you expect. The result also includes the `record_type` and a `meta` object with `current_page`, `per_page`, `pages`, and `count`.\n\n```tsx\nimport { useRecords } from \"@tines/apps\";\n\ninterface IncidentRow {\n  severity: string;\n}\n\nfunction Incidents() {\n  const { data, loading } = useRecords<IncidentRow>(\"3\", {\n    filters: [{ fieldId: \"11\", operator: \"EQUAL\", value: \"high\" }],\n    orderFieldId: \"11\",\n    orderDirection: \"DESC\",\n    perPage: 20,\n  });\n\n  if (loading) return <p>Loading…</p>;\n\n  return (\n    <ul>\n      {data?.record_results.map((row) => (\n        <li key={row.id}>{row.severity}</li>\n      ))}\n    </ul>\n  );\n}\n```\n\nRun a grouped aggregation query over a record type:\n\n```ts\ngetRecordsQuery<TRow = TinesRecordsQueryRow>(\n  recordTypeId: string,\n  options: TinesRecordsQueryOptions,\n): Promise<TinesRecordsQueryResult<TRow>>\n```\n\n```ts\nuseRecordsQuery<TRow = TinesRecordsQueryRow>(\n  recordTypeId: string,\n  options: TinesRecordsQueryOptions,\n): {\n  data: TinesRecordsQueryResult<TRow> | undefined;\n  loading: boolean;\n  error: Error | undefined;\n  refetch: () => void;\n}\n```\n\n`options.aggregations` is required. Queries can also include filters, group-by fields, time ranges, a time zone, parent ids, ordering, a result limit, and test mode. The result contains flat `rows` keyed by group and aggregation names, plus metadata describing those columns.\n\nThe record hooks re-fetch when their id or options change (compared by value). Call `refetch()` to fetch again on demand.\n\n### Current viewer\n\nResolve the signed-in user viewing the app. The result is cached for the lifetime of the app, so repeated calls share a single round-trip.\n\n```ts\ngetCurrentUser(): Promise<AppCurrentUser | null>\n```\n\n```ts\nuseCurrentUser(): {\n  user: AppCurrentUser | null | undefined;\n  loading: boolean;\n  error: Error | undefined;\n}\n```\n\n`user` is `undefined` while the request is in flight and `null` when the viewer is anonymous.\n\n### File downloads\n\nPrompt viewers to download a file. The host shows a confirmation dialog before saving.\n\n```ts\ndownloadFile(filename: string, contents: string | Uint8Array): void\n```\n\n### Routing\n\n`TinesRouter` provides single-page navigation inside the app while keeping the browser URL in sync with the host frame, so deep links and back/forward work. Wrap your routes in it and use the re-exported `react-router-dom` primitives.\n\n```tsx\nimport { TinesRouter, Routes, Route, Link } from \"@tines/apps\";\n\nfunction App() {\n  return (\n    <TinesRouter>\n      <nav>\n        <Link to=\"/\">Home</Link>\n        <Link to=\"/settings\">Settings</Link>\n      </nav>\n      <Routes>\n        <Route path=\"/\" element={<Home />} />\n        <Route path=\"/settings\" element={<Settings />} />\n      </Routes>\n    </TinesRouter>\n  );\n}\n```\n\nRe-exported from `react-router-dom`: `Link`, `NavLink`, `Navigate`, `Outlet`, `Route`, `Routes`, `useLocation`, `useNavigate`, `useParams`, `useSearchParams`.\n\n### Types\n\nThe package exports TypeScript types for everything the helpers return, including `TinesCase` (and its `TinesCaseTask`, `TinesCaseSla`, `TinesCaseField`, and related shapes), `TinesResource`, `TinesRecord`, `TinesRecordsResult`, `TinesRecordsQueryResult` (and their filter, grouping, aggregation, and ordering shapes), and `AppCurrentUser`. See [`src/types.ts`](src/types.ts) for the full set.\n\n## Support\n\nTines customers can report issues or request help from the Tines customer success team. Product documentation is available at [tines.com/docs/apps](https://www.tines.com/docs/apps).\n\n## License\n\n[Apache-2.0](LICENSE).\n","readmeFilename":"README.md"}