Draft
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.