apify-client 3.0.0-beta.74 → 3.0.0-beta.76
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/generated/api.d.ts
CHANGED
|
@@ -735,14 +735,14 @@ export interface paths {
|
|
|
735
735
|
* Actor run and returns an object that contains all the details about the
|
|
736
736
|
* resurrected run.
|
|
737
737
|
*
|
|
738
|
-
* Only finished runs, i.e. runs with status `
|
|
738
|
+
* Only finished runs, i.e. runs with status `SUCCEEDED`, `FAILED`, `ABORTED`
|
|
739
739
|
* and `TIMED-OUT` can be resurrected.
|
|
740
740
|
* Run status will be updated to RUNNING and its container will be restarted
|
|
741
741
|
* with the same storages
|
|
742
742
|
* (the same behaviour as when the run gets migrated to the new server).
|
|
743
743
|
*
|
|
744
744
|
* For more information, see the [Actor
|
|
745
|
-
* docs](https://docs.apify.com/platform/actors/running/runs-and-builds#
|
|
745
|
+
* docs](https://docs.apify.com/platform/actors/running/runs-and-builds#resurrect-a-finished-run).
|
|
746
746
|
*/
|
|
747
747
|
post: operations["actor_run_resurrect_post"];
|
|
748
748
|
delete?: never;
|
|
@@ -2614,11 +2614,11 @@ export interface paths {
|
|
|
2614
2614
|
/**
|
|
2615
2615
|
* Resurrect Actor run
|
|
2616
2616
|
* @description Resurrects a finished Actor run and returns an object that contains all the details about the resurrected run.
|
|
2617
|
-
* Only finished runs,
|
|
2617
|
+
* Only finished runs, that is, runs with status `SUCCEEDED`, `FAILED`, `ABORTED` and `TIMED-OUT` can be resurrected.
|
|
2618
2618
|
* Run status will be updated to RUNNING and its container will be restarted with the same storages
|
|
2619
2619
|
* (the same behaviour as when the run gets migrated to the new server).
|
|
2620
2620
|
*
|
|
2621
|
-
* For more information, see the [Actor docs](https://docs.apify.com/platform/actors/running/runs-and-builds#
|
|
2621
|
+
* For more information, see the [Actor docs](https://docs.apify.com/platform/actors/running/runs-and-builds#resurrect-a-finished-run).
|
|
2622
2622
|
*/
|
|
2623
2623
|
post: operations["PostResurrectRun"];
|
|
2624
2624
|
delete?: never;
|
|
@@ -2638,15 +2638,9 @@ export interface paths {
|
|
|
2638
2638
|
put?: never;
|
|
2639
2639
|
/**
|
|
2640
2640
|
* Charge events in Actor run
|
|
2641
|
-
* @description Charge for events in the run of your [pay
|
|
2641
|
+
* @description Charge for events in the run of your [pay-per-event Actor](https://docs.apify.com/actors/monetize/pay-per-event).
|
|
2642
2642
|
* The event you are charging for must be one of the configured events in your Actor. If the Actor is not set up as pay per event, or if the event is not configured,
|
|
2643
2643
|
* the endpoint will return an error. The endpoint must be called from the Actor run itself, with the same API token that the run was started with.
|
|
2644
|
-
*
|
|
2645
|
-
* :::info Learn more about pay-per-event pricing
|
|
2646
|
-
*
|
|
2647
|
-
* For more details about pay-per-event (PPE) pricing, refer to our [PPE documentation](https://docs.apify.com/actors/publishing/monetize/pay-per-event).
|
|
2648
|
-
*
|
|
2649
|
-
* :::
|
|
2650
2644
|
*/
|
|
2651
2645
|
post: operations["PostChargeRun"];
|
|
2652
2646
|
delete?: never;
|
|
@@ -7629,6 +7623,11 @@ export interface components {
|
|
|
7629
7623
|
eventName: string;
|
|
7630
7624
|
/** @example 1 */
|
|
7631
7625
|
count: number;
|
|
7626
|
+
/**
|
|
7627
|
+
* @description 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, where it identifies the request the charge belongs to.
|
|
7628
|
+
* @example 7Hs2kQw9LxP4mN1vB
|
|
7629
|
+
*/
|
|
7630
|
+
requestId?: string;
|
|
7632
7631
|
};
|
|
7633
7632
|
/**
|
|
7634
7633
|
* @example ownedByMe
|
|
@@ -4896,6 +4896,7 @@ export declare const UpdateRunRequest: () => z.ZodObject<{
|
|
|
4896
4896
|
export declare const ChargeRunRequest: () => z.ZodObject<{
|
|
4897
4897
|
eventName: z.ZodString;
|
|
4898
4898
|
count: z.ZodInt;
|
|
4899
|
+
requestId: z.ZodOptional<z.ZodString>;
|
|
4899
4900
|
}, z.core.$loose>;
|
|
4900
4901
|
export declare const StorageOwnership: () => z.ZodUnion<[z.ZodEnum<{
|
|
4901
4902
|
ownedByMe: "ownedByMe";
|
|
@@ -1087,6 +1087,7 @@ export const UpdateRunRequest = lazySchema(() => z.looseObject({
|
|
|
1087
1087
|
export const ChargeRunRequest = lazySchema(() => z.looseObject({
|
|
1088
1088
|
eventName: z.string(),
|
|
1089
1089
|
count: z.int(),
|
|
1090
|
+
requestId: z.string().optional(),
|
|
1090
1091
|
}));
|
|
1091
1092
|
export const StorageOwnership = lazySchema(() => z.enum(["ownedByMe", "sharedWithMe"]).or(z.string()));
|
|
1092
1093
|
export const ListOfKeyValueStores = lazySchema(() => PaginationResponse().extend({
|
|
@@ -186,6 +186,7 @@ export declare class RunClient extends ResourceClient {
|
|
|
186
186
|
* @param options.eventName - **Required.** Name of the event to charge for.
|
|
187
187
|
* @param options.count - Number of times to charge the event. Default is 1.
|
|
188
188
|
* @param options.idempotencyKey - Optional key to ensure the charge is not duplicated. If not provided, one is auto-generated.
|
|
189
|
+
* @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.
|
|
189
190
|
* @param options.timeoutSecs - Timeout for the API request. Default is `'short'`.
|
|
190
191
|
* @returns Empty response object.
|
|
191
192
|
* @see https://docs.apify.com/api/v2/post-charge-run
|
|
@@ -411,6 +412,12 @@ export interface RunChargeOptions extends TimeoutOptions {
|
|
|
411
412
|
count?: number;
|
|
412
413
|
/** Defaults to runId-eventName-timestamp */
|
|
413
414
|
idempotencyKey?: string;
|
|
415
|
+
/**
|
|
416
|
+
* ID of the Server Actor request being charged, taken from the `X-Actor-Request-ID` header of the incoming request.
|
|
417
|
+
* 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.
|
|
418
|
+
* Ignored elsewhere.
|
|
419
|
+
*/
|
|
420
|
+
requestId?: string;
|
|
414
421
|
}
|
|
415
422
|
/**
|
|
416
423
|
* Options for waiting for a Run to finish.
|
|
@@ -32,6 +32,7 @@ const chargeOptionsSchema = z.strictObject({
|
|
|
32
32
|
eventName: z.string(),
|
|
33
33
|
count: z.number().default(1),
|
|
34
34
|
idempotencyKey: z.string().optional(),
|
|
35
|
+
requestId: z.string().optional(),
|
|
35
36
|
...timeoutOptionsShape,
|
|
36
37
|
});
|
|
37
38
|
const waitForFinishOptionsSchema = z.strictObject({ waitSecs: z.number().optional(), ...timeoutOptionsShape });
|
|
@@ -294,13 +295,14 @@ export class RunClient extends ResourceClient {
|
|
|
294
295
|
* @param options.eventName - **Required.** Name of the event to charge for.
|
|
295
296
|
* @param options.count - Number of times to charge the event. Default is 1.
|
|
296
297
|
* @param options.idempotencyKey - Optional key to ensure the charge is not duplicated. If not provided, one is auto-generated.
|
|
298
|
+
* @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.
|
|
297
299
|
* @param options.timeoutSecs - Timeout for the API request. Default is `'short'`.
|
|
298
300
|
* @returns Empty response object.
|
|
299
301
|
* @see https://docs.apify.com/api/v2/post-charge-run
|
|
300
302
|
* @since Added in 2.11.0
|
|
301
303
|
*/
|
|
302
304
|
async charge(options) {
|
|
303
|
-
const { eventName, count, idempotencyKey: providedIdempotencyKey, timeoutSecs = 'short', signal, } = parseArgument(options, chargeOptionsSchema, 'RunChargeOptions');
|
|
305
|
+
const { eventName, count, idempotencyKey: providedIdempotencyKey, timeoutSecs = 'short', requestId, signal, } = parseArgument(options, chargeOptionsSchema, 'RunChargeOptions');
|
|
304
306
|
/** To avoid duplicates during the same milisecond, doesn't need to by crypto-secure. */
|
|
305
307
|
const randomSuffix = (Math.random() + 1).toString(36).slice(3, 8);
|
|
306
308
|
const idempotencyKey = providedIdempotencyKey ?? `${this.id}-${eventName}-${Date.now()}-${randomSuffix}`;
|
|
@@ -310,6 +312,7 @@ export class RunClient extends ResourceClient {
|
|
|
310
312
|
data: {
|
|
311
313
|
eventName,
|
|
312
314
|
count,
|
|
315
|
+
requestId,
|
|
313
316
|
},
|
|
314
317
|
headers: {
|
|
315
318
|
[RUN_CHARGE_IDEMPOTENCY_HEADER]: idempotencyKey,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "apify-client",
|
|
3
|
-
"version": "3.0.0-beta.
|
|
3
|
+
"version": "3.0.0-beta.76",
|
|
4
4
|
"description": "Apify API client for JavaScript",
|
|
5
5
|
"engines": {
|
|
6
6
|
"node": ">=22.13.0"
|
|
@@ -59,7 +59,7 @@
|
|
|
59
59
|
],
|
|
60
60
|
"apify": {
|
|
61
61
|
"openapiSpec": {
|
|
62
|
-
"version": "v2-2026-10-
|
|
62
|
+
"version": "v2-2026-10-22T124802Z"
|
|
63
63
|
}
|
|
64
64
|
},
|
|
65
65
|
"dependencies": {
|
|
@@ -92,8 +92,8 @@
|
|
|
92
92
|
"esbuild": "0.28.2",
|
|
93
93
|
"express": "^5.2.1",
|
|
94
94
|
"oxfmt": "0.73.0",
|
|
95
|
-
"oxlint": "1.
|
|
96
|
-
"oxlint-tsgolint": "7.0.
|
|
95
|
+
"oxlint": "1.89.0",
|
|
96
|
+
"oxlint-tsgolint": "7.0.2005",
|
|
97
97
|
"puppeteer": "^25.12.0",
|
|
98
98
|
"rimraf": "^6.1.3",
|
|
99
99
|
"rolldown": "^1.2.11",
|
|
@@ -106,7 +106,7 @@
|
|
|
106
106
|
"devEngines": {
|
|
107
107
|
"packageManager": {
|
|
108
108
|
"name": "pnpm",
|
|
109
|
-
"version": "12.
|
|
109
|
+
"version": "12.15.0",
|
|
110
110
|
"onFail": "warn"
|
|
111
111
|
}
|
|
112
112
|
},
|