# commonly-ts/trivious-sheets architecture

> Architecture diagram of the GitHub repository commonly-ts/trivious-sheets, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-27). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/commonly-ts/trivious-sheets
- Repository: https://github.com/commonly-ts/trivious-sheets

## Overview

Trivious Sheets is a small TypeScript wrapper for reading and writing Google Sheets with service-account credentials. A consumer imports the package entry point, creates a SheetsClient, and invokes operations such as appending rows or accessing data by key. The client formats A1 ranges and calls the Google Sheets API; it also supports keyed updates and adding cell notes. The sampled client source supports these operation and API relationships; no broader product subsystems are documented.

Main entry points: [`src/client.ts`](https://github.com/commonly-ts/trivious-sheets/blob/main/src/client.ts) (Keyed Access), [`src/utility/functions.ts`](https://github.com/commonly-ts/trivious-sheets/blob/main/src/utility/functions.ts) (Range Formatting), [`src/index.ts`](https://github.com/commonly-ts/trivious-sheets/blob/main/src/index.ts) (Package Entry), [`src/utility/errors.ts`](https://github.com/commonly-ts/trivious-sheets/blob/main/src/utility/errors.ts) (Lookup Error)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_api["Public API"]
  node_entry["Package Entry<br/>[index.ts]"]
  node_client["Sheets Client<br/>[client.ts]"]
end

subgraph group_operations["Sheet Operations"]
  node_append["Append Row<br/>[client.ts]"]
  node_keyed["Keyed Access<br/>[client.ts]"]
  node_notes["Cell Notes<br/>[client.ts]"]
end

subgraph group_support["Shared Utilities"]
  node_ranges["Range Formatting<br/>[functions.ts]"]
  node_errors["Lookup Error<br/>[errors.ts]"]
end

node_consumer(("Framework Consumer"))
node_sheets["Google Sheets API"]

node_consumer -->|"imports"| node_entry
node_entry -->|"exports"| node_client
node_consumer -->|"calls"| node_append
node_consumer -->|"calls"| node_keyed
node_consumer -->|"calls"| node_notes
node_append -->|"formats ranges"| node_ranges
node_append -->|"reads and appends"| node_sheets
node_keyed -->|"formats ranges"| node_ranges
node_keyed -->|"reads and updates"| node_sheets
node_keyed -->|"throws on missing key"| node_errors
node_notes -->|"formats ranges"| node_ranges
node_notes -->|"reads and updates notes"| node_sheets
node_notes -->|"throws on missing key"| node_errors

click node_entry "https://github.com/commonly-ts/trivious-sheets/blob/main/src/index.ts"
click node_client "https://github.com/commonly-ts/trivious-sheets/blob/main/src/client.ts"
click node_append "https://github.com/commonly-ts/trivious-sheets/blob/main/src/client.ts"
click node_keyed "https://github.com/commonly-ts/trivious-sheets/blob/main/src/client.ts"
click node_notes "https://github.com/commonly-ts/trivious-sheets/blob/main/src/client.ts"
click node_ranges "https://github.com/commonly-ts/trivious-sheets/blob/main/src/utility/functions.ts"
click node_errors "https://github.com/commonly-ts/trivious-sheets/blob/main/src/utility/errors.ts"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_entry,node_client toneBlue
class node_append,node_keyed,node_notes toneAmber
class node_ranges,node_errors,node_sheets toneMint
class node_consumer toneIndigo
```

## Components

### Public API

- [Package Entry](https://github.com/commonly-ts/trivious-sheets/blob/main/src/index.ts): `src/index.ts`
- [Sheets Client](https://github.com/commonly-ts/trivious-sheets/blob/main/src/client.ts): `src/client.ts`

### Sheet Operations

- [Append Row](https://github.com/commonly-ts/trivious-sheets/blob/main/src/client.ts): `src/client.ts`
- [Keyed Access](https://github.com/commonly-ts/trivious-sheets/blob/main/src/client.ts): `src/client.ts`
- [Cell Notes](https://github.com/commonly-ts/trivious-sheets/blob/main/src/client.ts): `src/client.ts`

### Shared Utilities

- [Range Formatting](https://github.com/commonly-ts/trivious-sheets/blob/main/src/utility/functions.ts): `src/utility/functions.ts`
- [Lookup Error](https://github.com/commonly-ts/trivious-sheets/blob/main/src/utility/errors.ts): `src/utility/errors.ts`

### Other components

- **Framework Consumer**
- **Google Sheets API**

## Connections

- Framework Consumer → Package Entry: imports
- Package Entry → Sheets Client: exports
- Framework Consumer → Append Row: calls
- Framework Consumer → Keyed Access: calls
- Framework Consumer → Cell Notes: calls
- Append Row → Range Formatting: formats ranges
- Append Row → Google Sheets API: reads and appends
- Keyed Access → Range Formatting: formats ranges
- Keyed Access → Google Sheets API: reads and updates
- Keyed Access → Lookup Error: throws on missing key
- Cell Notes → Range Formatting: formats ranges
- Cell Notes → Google Sheets API: reads and updates notes
- Cell Notes → Lookup Error: throws on missing key
