@ukwhatn/wikidot 4.3.1 → 4.4.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.cts CHANGED
@@ -199,6 +199,10 @@ interface AMCConfig {
199
199
  backoffFactor: number;
200
200
  /** Maximum concurrent requests */
201
201
  semaphoreLimit: number;
202
+ /** Batch size for amcRequestWithRetry */
203
+ retryBatchSize: number;
204
+ /** Maximum retry attempts for amcRequestWithRetry */
205
+ retryMaxRetries: number;
202
206
  }
203
207
  /** Default AMC configuration */
204
208
  declare const DEFAULT_AMC_CONFIG: AMCConfig;
@@ -422,10 +426,20 @@ interface SiteRef {
422
426
  * Execute AMC request
423
427
  */
424
428
  amcRequest(bodies: AMCRequestBody[]): WikidotResultAsync<AMCResponse[]>;
429
+ amcRequest(bodies: AMCRequestBody[], options: {
430
+ returnExceptions: true;
431
+ }): WikidotResultAsync<(AMCResponse | WikidotError)[]>;
425
432
  /**
426
433
  * Execute single AMC request
427
434
  */
428
435
  amcRequestSingle(body: AMCRequestBody): WikidotResultAsync<AMCResponse>;
436
+ /**
437
+ * Execute AMC request with partial failure tolerance
438
+ */
439
+ amcRequestWithRetry(bodies: AMCRequestBody[], options?: {
440
+ batchSize?: number;
441
+ maxRetries?: number;
442
+ }): WikidotResultAsync<(AMCResponse | null)[]>;
429
443
  }
430
444
  /**
431
445
  * Forum category reference interface
@@ -2058,9 +2072,24 @@ declare class Site {
2058
2072
  /**
2059
2073
  * Execute AMC request to this site
2060
2074
  * @param bodies - Request body array
2075
+ * @param options - Request options
2061
2076
  * @returns AMC response array
2062
2077
  */
2063
2078
  amcRequest(bodies: AMCRequestBody[]): WikidotResultAsync<AMCResponse[]>;
2079
+ amcRequest(bodies: AMCRequestBody[], options: {
2080
+ returnExceptions: true;
2081
+ }): WikidotResultAsync<(AMCResponse | WikidotError)[]>;
2082
+ /**
2083
+ * Execute AMC request with partial failure tolerance.
2084
+ * Requests are split into batches and failed requests are retried.
2085
+ * @param bodies - Request body array
2086
+ * @param options - Optional batch size and max retries
2087
+ * @returns AMC response array (null for permanently failed requests)
2088
+ */
2089
+ amcRequestWithRetry(bodies: AMCRequestBody[], options?: {
2090
+ batchSize?: number;
2091
+ maxRetries?: number;
2092
+ }): WikidotResultAsync<(AMCResponse | null)[]>;
2064
2093
  /**
2065
2094
  * Execute a single AMC request
2066
2095
  * @param body - Request body
package/dist/index.d.ts CHANGED
@@ -199,6 +199,10 @@ interface AMCConfig {
199
199
  backoffFactor: number;
200
200
  /** Maximum concurrent requests */
201
201
  semaphoreLimit: number;
202
+ /** Batch size for amcRequestWithRetry */
203
+ retryBatchSize: number;
204
+ /** Maximum retry attempts for amcRequestWithRetry */
205
+ retryMaxRetries: number;
202
206
  }
203
207
  /** Default AMC configuration */
204
208
  declare const DEFAULT_AMC_CONFIG: AMCConfig;
@@ -422,10 +426,20 @@ interface SiteRef {
422
426
  * Execute AMC request
423
427
  */
424
428
  amcRequest(bodies: AMCRequestBody[]): WikidotResultAsync<AMCResponse[]>;
429
+ amcRequest(bodies: AMCRequestBody[], options: {
430
+ returnExceptions: true;
431
+ }): WikidotResultAsync<(AMCResponse | WikidotError)[]>;
425
432
  /**
426
433
  * Execute single AMC request
427
434
  */
428
435
  amcRequestSingle(body: AMCRequestBody): WikidotResultAsync<AMCResponse>;
436
+ /**
437
+ * Execute AMC request with partial failure tolerance
438
+ */
439
+ amcRequestWithRetry(bodies: AMCRequestBody[], options?: {
440
+ batchSize?: number;
441
+ maxRetries?: number;
442
+ }): WikidotResultAsync<(AMCResponse | null)[]>;
429
443
  }
430
444
  /**
431
445
  * Forum category reference interface
@@ -2058,9 +2072,24 @@ declare class Site {
2058
2072
  /**
2059
2073
  * Execute AMC request to this site
2060
2074
  * @param bodies - Request body array
2075
+ * @param options - Request options
2061
2076
  * @returns AMC response array
2062
2077
  */
2063
2078
  amcRequest(bodies: AMCRequestBody[]): WikidotResultAsync<AMCResponse[]>;
2079
+ amcRequest(bodies: AMCRequestBody[], options: {
2080
+ returnExceptions: true;
2081
+ }): WikidotResultAsync<(AMCResponse | WikidotError)[]>;
2082
+ /**
2083
+ * Execute AMC request with partial failure tolerance.
2084
+ * Requests are split into batches and failed requests are retried.
2085
+ * @param bodies - Request body array
2086
+ * @param options - Optional batch size and max retries
2087
+ * @returns AMC response array (null for permanently failed requests)
2088
+ */
2089
+ amcRequestWithRetry(bodies: AMCRequestBody[], options?: {
2090
+ batchSize?: number;
2091
+ maxRetries?: number;
2092
+ }): WikidotResultAsync<(AMCResponse | null)[]>;
2064
2093
  /**
2065
2094
  * Execute a single AMC request
2066
2095
  * @param body - Request body