apify-client 2.25.1-beta.27 → 2.25.1-beta.28

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.
@@ -173,6 +173,7 @@ export declare class RunClient extends ResourceClient {
173
173
  * @param options.eventName - **Required.** Name of the event to charge for.
174
174
  * @param options.count - Number of times to charge the event. Default is 1.
175
175
  * @param options.idempotencyKey - Optional key to ensure the charge is not duplicated. If not provided, one is auto-generated.
176
+ * @param options.requestId - ID of the Server Actor request being charged, from the `X-Actor-Request-ID` header of the incoming request. Required for multi-tenant Server Actor runs.
176
177
  * @returns Empty response object.
177
178
  * @see https://docs.apify.com/api/v2/post-charge-run
178
179
  * @since Added in 2.11.0
@@ -339,6 +340,12 @@ export interface RunChargeOptions {
339
340
  count?: number;
340
341
  /** Defaults to runId-eventName-timestamp */
341
342
  idempotencyKey?: string;
343
+ /**
344
+ * ID of the Server Actor request being charged, taken from the `X-Actor-Request-ID` header of the incoming request.
345
+ * Required for multi-tenant Server Actor runs, where it maps the charge to the caller's account instead of the account that started the run.
346
+ * Ignored elsewhere.
347
+ */
348
+ requestId?: string;
342
349
  }
343
350
  /**
344
351
  * Options for waiting for a Run to finish.
@@ -253,6 +253,7 @@ class RunClient extends resource_client_1.ResourceClient {
253
253
  * @param options.eventName - **Required.** Name of the event to charge for.
254
254
  * @param options.count - Number of times to charge the event. Default is 1.
255
255
  * @param options.idempotencyKey - Optional key to ensure the charge is not duplicated. If not provided, one is auto-generated.
256
+ * @param options.requestId - ID of the Server Actor request being charged, from the `X-Actor-Request-ID` header of the incoming request. Required for multi-tenant Server Actor runs.
256
257
  * @returns Empty response object.
257
258
  * @see https://docs.apify.com/api/v2/post-charge-run
258
259
  * @since Added in 2.11.0
@@ -262,6 +263,7 @@ class RunClient extends resource_client_1.ResourceClient {
262
263
  eventName: ow_1.default.string,
263
264
  count: ow_1.default.optional.number,
264
265
  idempotencyKey: ow_1.default.optional.string,
266
+ requestId: ow_1.default.optional.string,
265
267
  }));
266
268
  const count = options.count ?? 1;
267
269
  /** To avoid duplicates during the same milisecond, doesn't need to by crypto-secure. */
@@ -273,6 +275,7 @@ class RunClient extends resource_client_1.ResourceClient {
273
275
  data: {
274
276
  eventName: options.eventName,
275
277
  count,
278
+ requestId: options.requestId,
276
279
  },
277
280
  headers: {
278
281
  [RUN_CHARGE_IDEMPOTENCY_HEADER]: idempotencyKey,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "apify-client",
3
- "version": "2.25.1-beta.27",
3
+ "version": "2.25.1-beta.28",
4
4
  "description": "Apify API client for JavaScript",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",