How ramawaterfilter/auto-line-item-zero works
Auto Remove Line Item is a multi-store Shopify app for selecting orders in an inclusive date range, previewing eligible orders, and setting configured variant quantities to zero. Its standalone Worker serves the merchant UI and API, then queues discovery and order processing. Processing requires a BEFORE Sheets audit write, commits the Shopify edit, persists the result, and writes AFTER for reconciliation. The graph follows documented capabilities and visible call ownership; D1/Queue wiring and some subsystem details are documented in the README but not fully shown in source excerpts.
Main entry points: api.ts Authenticated API · processor.ts Discovery and processing · index.ts Worker router · auth.ts OAuth and sessions
Components 16
Merchant experience
- Worker router
src/index.ts - Admin interface
src/ui.ts - Browser client
src/ui-client.ts - UI styles
src/ui-styles.ts - Authenticated API
src/api.ts
Identity and safety
- OAuth and sessions
src/auth.ts - Token cryptography
src/crypto.ts - Audit safety gate
src/safety.ts
Job processing
- Date and job rules
src/core.ts - Discovery and processing
src/processor.ts - Cloudflare Queue
- D1 job state
External systems
- Shopify Admin API
src/shopify.ts - Audit writer
src/sheets.ts - Google Sheets
Other components
- Shopify merchant
Connections 26
- Shopify merchant → Worker router: uses app
README.md - Worker router → Admin interface: serves pages
src/index.ts - Admin interface → Browser client: embeds script
src/ui.ts - Admin interface → UI styles: embeds styles
src/ui.ts - Browser client → Authenticated API: calls endpoints
README.md - Worker router → Authenticated API: routes requests
src/index.ts - Worker router → OAuth and sessions: routes auth
src/index.ts - OAuth and sessions → Token cryptography: signs and encrypts
src/auth.ts - Authenticated API → OAuth and sessions: authenticates staff
src/api.ts - Authenticated API → Date and job rules: validates dates
src/api.ts - Authenticated API → Discovery and processing: refreshes jobs
src/api.ts - Authenticated API → Audit writer: validates audit sheet
src/api.ts - Authenticated API → D1 job state: stores jobs
README.md - Authenticated API → Cloudflare Queue: enqueues work
README.md - Worker router → Discovery and processing: dispatches messages
src/index.ts - Discovery and processing → D1 job state: reads and writes state
README.md - Discovery and processing → OAuth and sessions: gets access token
src/processor.ts - Discovery and processing → Shopify Admin API: discovers and edits
src/processor.ts - Discovery and processing → Audit safety gate: gates mutations
src/processor.ts - Discovery and processing → Audit writer: writes audit rows
README.md - Audit writer → Token cryptography: encodes credentials
src/sheets.ts - Audit writer → Google Sheets: writes audit tabs
README.md - Shopify Admin API → Date and job rules: uses error types
src/shopify.ts - OAuth and sessions → Shopify Admin API: exchanges tokens
README.md - OAuth and sessions → D1 job state: stores installations
README.md - Worker router → D1 job state: removes uninstalled shop
README.md