Skip to content

Claude optims#258

Draft
Plopix wants to merge 21 commits intomainfrom
claude-optims
Draft

Claude optims#258
Plopix wants to merge 21 commits intomainfrom
claude-optims

Conversation

@Plopix
Copy link
Member

@Plopix Plopix commented Mar 13, 2026

No description provided.

Plopix added 21 commits March 12, 2026 16:43
The onFolder helper in create-catalogue-fetcher.ts produced a field
named 'chidlren' instead of 'children' in generated GraphQL queries,
causing incorrect query results for folder children.
The outer try/catch in the `post` function was a no-op that added
visual noise and misleadingly suggested error handling was happening.
The file contained 543 lines of entirely commented-out code,
replaced by the modules in src/core/pim/subscriptions/.
Git history preserves it if ever needed.
…drater

The query object construction used `{ ...{ ...productListQuery } }` which
is functionally identical to `{ ...productListQuery }`. Simplified to
remove the unnecessary nesting.
…alization

The `results` variable was typed as `{ [key: string]: any }` but initialized
as `[]`. While JS allows property assignment on arrays, this is misleading.
Changed to `{}` to match the declared type and actual usage.
The module field pointed to ./dist/index.mjs which doesn't exist.
The build outputs ./dist/index.js for ESM. This mismatch could cause
import failures in bundlers (Webpack, Rollup) that use the module field.
…gging

Stack traces and error.name now correctly show 'JSApiClientCallError'
instead of generic 'Error', making it easier to identify API client
errors in logs and error handlers.
… API caller

The `RequestInit | any | undefined` union types collapsed to `any`, defeating
TypeScript's type checking for all library consumers. Introduced a focused
GrabOptions type covering method, headers, and body, and updated all signatures.
Add .env to .gitignore and create .env.example with placeholder values
to prevent accidental credential commits.
Adds a console.warn when the fallback auth path is reached with empty
accessTokenId and accessTokenSecret, helping developers catch missing
auth configuration early instead of getting cryptic 401/403 errors.
Uses a WeakSet to ensure the warning fires only once per config object.
Replace fragile split-based parsing with a regex that extracts the
dur= value per the Server-Timing spec, avoiding garbage results from
non-standard header formats.
…es in fetchers/managers

Replace abbreviations like OO, OOI, OC, OSC, OP with readable names
(OrderExtra, OrderItemExtra, CustomerExtra, SubscriptionContractExtra,
PaymentExtra) across order, customer, and subscription modules for
better IDE tooltip readability.
Enables `using client = createClient({...})` syntax (TypeScript 5.2+)
so HTTP/2 connections are automatically closed when the scope exits.
Added `esnext.disposable` to tsconfig lib and implemented Symbol.dispose
on both ClientInterface and MassClientInterface.
Add optional `timeout` field (in milliseconds) to CreateClientOptions.
When configured, requests that exceed the timeout are automatically
aborted using AbortSignal.timeout(). Works for both fetch and HTTP/2
code paths. Default is no timeout (backward compatible).
- Replace Promise<any> with Promise<MassCallResults> (Record<string, unknown>)
- Replace any in afterRequest callback with Record<string, unknown>
- Replace any for exception in onFailure with unknown
- Type buildStandardPromise return as { key: string; result: unknown } | undefined
- Fix typo: situaion → situation in changeIncrementFor parameter
…d approach

The five identical enqueue methods (catalogueApi, discoveryApi, pimApi, nextPimApi, shopCartApi)
differed only in their key prefix and caller reference. Replaced with Object.fromEntries
to eliminate ~20 lines of boilerplate while preserving the public API and types.
Add 38 unit tests covering create-api-caller, create-grabber, and
create-mass-call-client without requiring API credentials or network
access. Tests cover: authentication headers, successful responses,
HTTP errors, GraphQL errors, Core Next wrapped errors, 204 handling,
profiling, mass call batching, retry logic, and adaptive concurrency.
Cover HTTP error codes (400-503), GraphQL errors in 200 responses,
Core Next wrapped errors, network failures, timeout scenarios,
malformed JSON responses, 204 No Content, and JSApiClientCallError
property validation.
Runs build and unit tests across Node.js 20, 22, and 24 on every
pull request and push to main, so broken code is caught before merge.
Add comprehensive JSDoc with @param, @returns, and @example tags to
12 exported factory functions for better IDE discoverability.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant