Sharepoint List
@twonines/sharepoint-listv2026.09.22.1
01README
SharePoint list items via the Microsoft Graph API — read and write rows on the list surface (/sites/{site}/lists/...), not the document library. Authenticates as an Entra public client through the device code flow, so there is no client secret, and every call runs as the signed-in user. Methods: bootstrap, list_lists, get_list, list_items, list_changes, create_item, update_item, delete_item. list_changes diffs a list against a baseline it keeps itself, so it reports what moved column by column rather than which rows were merely touched.
02Behaviors
@twonines/sharepoint-listv2026.09.22.1mod.ts
Global Arguments
| Argument | Type | Description |
|---|---|---|
| tenantId | string | Entra tenant GUID (e.g. aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee) |
| clientId | string | Azure public client app registration ID |
| refreshToken | string | OAuth2 refresh token obtained via bootstrap. Re-run bootstrap if expired. |
| siteHostPath | string | Graph site locator in host:path form, e.g. contoso.sharepoint.com:/sites/Clients |
| scopes | string | Space-separated delegated scopes. Default includes Sites.ReadWrite.All; |
fn bootstrap()
Authenticate via device code flow. Displays a user code and
fn list_lists(includeHidden: boolean, maxPages: number)
Enumerate the lists on the configured site. Start here — the output
| Argument | Type | Description |
|---|---|---|
| includeHidden | boolean | Include hidden/system lists (Form Templates, Style Library, and the like) |
| maxPages | number | Cap on @odata.nextLink pages followed |
fn get_list(list: string, includeHidden: boolean, maxPages: number)
Fetch one list's column definitions. Run this before writing:
| Argument | Type | Description |
|---|---|---|
| list | string | List GUID, URL name, or display name |
| includeHidden | boolean | Include hidden columns in the output |
| maxPages | number | Cap on @odata.nextLink pages followed |
fn list_items(list: string, filter?: string, orderBy?: string, select?: string, top: number, maxPages: number)
Fetch items from a list, with column values expanded. Supports OData
| Argument | Type | Description |
|---|---|---|
| list | string | List GUID, URL name, or display name |
| filter? | string | OData $filter over fields, e.g. fields/Status eq 'Open'. |
| orderBy? | string | OData $orderby, e.g. fields/Created desc |
| select? | string | Comma-separated internal column names to return; omit for all columns |
| top | number | Page size requested from Graph |
| maxPages | number | Cap on @odata.nextLink pages followed |
fn list_changes(list: string, scopeColumn?: string, scopeValue?: string, filter?: string, trackFields?: array, ignoreFields: array, contextFields: array, summarizeColumn?: string, updateBaseline: boolean, top: number, maxPages: number)
What changed on a list since this method last ran. Diffs the list
| Argument | Type | Description |
|---|---|---|
| list | string | List GUID, URL name, or display name |
| scopeColumn? | string | Internal column name to scope the watch to, e.g. Status or |
| scopeValue? | string | Value scopeColumn must equal, matched exactly. Omit both to watch |
| filter? | string | Extra OData $filter, ANDed with the scope, e.g. |
| trackFields? | array | Internal column names to diff, to the exclusion of all others. |
| ignoreFields | array | Internal column names to add to the ignored set — for a column |
| contextFields | array | Internal column names whose current values ride along on every |
| summarizeColumn? | string | Internal column name to count the current population by, reported |
| updateBaseline | boolean | Whether a clean run replaces the baseline. False shows the same |
| top | number | Page size requested from Graph. Larger than list_items' default |
| maxPages | number | Cap on @odata.nextLink pages followed. A walk that hits this has |
fn create_item(list: string, fields: record)
Create one list item. Fields are keyed by INTERNAL column name — run
| Argument | Type | Description |
|---|---|---|
| list | string | List GUID, URL name, or display name |
| fields | record | Column values keyed by internal name, e.g. {"Title":"New row","Status":"Open"} |
fn update_item(list: string, itemId: string, fields: record)
Update one list item's fields (PATCH — only the columns you pass are
| Argument | Type | Description |
|---|---|---|
| list | string | List GUID, URL name, or display name |
| itemId | string | List item ID (from list_items output) |
| fields | record | Column values to set, keyed by internal name. Unlisted columns are left alone. |
fn delete_item(list: string, itemId: string, confirm: boolean)
Delete one list item. Requires confirm=true. The item's field values
| Argument | Type | Description |
|---|---|---|
| list | string | List GUID, URL name, or display name |
| itemId | string | List item ID (from list_items output) |
| confirm | boolean | Must be true. Guards against a delete run with the wrong itemId. |
Resources
lists(15m)— Lists on the configured SharePoint site
listSchema(15m)— One list's column definitions — the internal names writes must use
listItems(15m)— Items from a SharePoint list
itemWrite(infinite)— Result of a create, update, or delete against a single list item
listChanges(infinite)— What changed on one list since the previous list_changes run — rows
listBaseline(infinite)— The population and column values as of the last clean list_changes
bootstrap(infinite)— Device code flow authentication result
03Previous Versions
2026.09.11.1
04Stats
A
93 / 100
Downloads
31
Archive size
64.3 KB
- Has README or module doc2/2earned
- README has a code example1/1earned
- README is substantive1/1earned
- Most symbols documented1/1earned
- No slow types (deprecated)1/1earned
- Dependencies pass trust audit2/2earned
- Has description1/1earned
- Platform support declared (or universal)2/2earned
- License1/2partial
no SPDX license declared
- Verified public repository2/2earned
05Platforms
06Labels