apify-client 3.0.0-beta.0 → 3.0.0-beta.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.
@@ -1,7 +1,9 @@
1
1
  import type { ApiClientSubResourceOptions } from '../base/api_client';
2
2
  import { ResourceClient } from '../base/resource_client';
3
- import type { Timezone } from '../timezones';
3
+ import type { Schedule, ScheduleAction } from '../models';
4
4
  import type { DistributiveOptional } from '../utils';
5
+ export type { Schedule, ScheduleAction, ScheduleActionRunActor, ScheduleActionRunActorTask, ScheduledActorRunInput, ScheduledActorRunOptions, } from '../models';
6
+ export { ScheduleActions } from '../models';
5
7
  /**
6
8
  * Client for managing a specific Schedule.
7
9
  *
@@ -59,36 +61,6 @@ export declare class ScheduleClient extends ResourceClient {
59
61
  */
60
62
  getLog(): Promise<string | undefined>;
61
63
  }
62
- /**
63
- * Represents a schedule for automated Actor or Task runs.
64
- *
65
- * Schedules use cron expressions to define when Actors or Tasks should run automatically.
66
- */
67
- export interface Schedule {
68
- id: string;
69
- userId: string;
70
- name: string;
71
- /**
72
- * @since Added in 2.6.1
73
- */
74
- title?: string;
75
- cronExpression: string;
76
- timezone: Timezone;
77
- isEnabled: boolean;
78
- isExclusive: boolean;
79
- description?: string;
80
- createdAt: Date;
81
- modifiedAt: Date;
82
- nextRunAt: string;
83
- lastRunAt: string;
84
- actions: ScheduleAction[];
85
- /**
86
- * @since Added in 2.9.4
87
- */
88
- notifications: {
89
- email: boolean;
90
- };
91
- }
92
64
  /**
93
65
  * Data for creating or updating a Schedule.
94
66
  * @since Added in 2.6.2
@@ -96,53 +68,3 @@ export interface Schedule {
96
68
  export type ScheduleCreateOrUpdateData = Partial<Pick<Schedule, 'name' | 'title' | 'cronExpression' | 'timezone' | 'isEnabled' | 'isExclusive' | 'description' | 'notifications'> & {
97
69
  actions: DistributiveOptional<ScheduleAction, 'id'>[];
98
70
  }>;
99
- /**
100
- * Types of actions that can be scheduled.
101
- */
102
- export declare enum ScheduleActions {
103
- RunActor = "RUN_ACTOR",
104
- RunActorTask = "RUN_ACTOR_TASK"
105
- }
106
- interface BaseScheduleAction<Type extends ScheduleActions> {
107
- id: string;
108
- type: Type;
109
- }
110
- /**
111
- * Union type representing all possible scheduled actions.
112
- */
113
- export type ScheduleAction = ScheduleActionRunActor | ScheduleActionRunActorTask;
114
- /**
115
- * Scheduled action to run an Actor.
116
- */
117
- export interface ScheduleActionRunActor extends BaseScheduleAction<ScheduleActions.RunActor> {
118
- actorId: string;
119
- runInput?: ScheduledActorRunInput;
120
- runOptions?: ScheduledActorRunOptions;
121
- }
122
- /**
123
- * Input configuration for a scheduled Actor run.
124
- */
125
- export interface ScheduledActorRunInput {
126
- body: string;
127
- contentType: string;
128
- }
129
- /**
130
- * Run options for a scheduled Actor run.
131
- */
132
- export interface ScheduledActorRunOptions {
133
- build: string;
134
- timeoutSecs: number;
135
- memoryMbytes: number;
136
- /**
137
- * @since Added in 2.19.0
138
- */
139
- restartOnError?: boolean;
140
- }
141
- /**
142
- * Scheduled action to run an Actor task.
143
- */
144
- export interface ScheduleActionRunActorTask extends BaseScheduleAction<ScheduleActions.RunActorTask> {
145
- actorTaskId: string;
146
- input?: string;
147
- }
148
- export {};
@@ -1,8 +1,10 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.ScheduleActions = exports.ScheduleClient = void 0;
3
+ exports.ScheduleClient = exports.ScheduleActions = void 0;
4
4
  const resource_client_1 = require("../base/resource_client");
5
5
  const utils_1 = require("../utils");
6
+ var models_1 = require("../models");
7
+ Object.defineProperty(exports, "ScheduleActions", { enumerable: true, get: function () { return models_1.ScheduleActions; } });
6
8
  /**
7
9
  * Client for managing a specific Schedule.
8
10
  *
@@ -87,11 +89,3 @@ class ScheduleClient extends resource_client_1.ResourceClient {
87
89
  }
88
90
  }
89
91
  exports.ScheduleClient = ScheduleClient;
90
- /**
91
- * Types of actions that can be scheduled.
92
- */
93
- var ScheduleActions;
94
- (function (ScheduleActions) {
95
- ScheduleActions["RunActor"] = "RUN_ACTOR";
96
- ScheduleActions["RunActorTask"] = "RUN_ACTOR_TASK";
97
- })(ScheduleActions || (exports.ScheduleActions = ScheduleActions = {}));
@@ -1,7 +1,8 @@
1
1
  import type { ApiClientSubResourceOptions } from '../base/api_client';
2
2
  import { ResourceCollectionClient } from '../base/resource_collection_client';
3
+ import type { ActorStoreList } from '../models';
3
4
  import type { PaginatedIterator, PaginationOptions } from '../utils';
4
- import type { ActorStats } from './actor';
5
+ export type { ActorStoreList, PricingInfo } from '../models';
5
6
  /**
6
7
  * Client for browsing Actors in the Apify Store.
7
8
  *
@@ -50,35 +51,6 @@ export declare class StoreCollectionClient extends ResourceCollectionClient {
50
51
  */
51
52
  list(options?: StoreCollectionListOptions): PaginatedIterator<ActorStoreList>;
52
53
  }
53
- /**
54
- * @since Added in 2.7.2
55
- */
56
- export interface PricingInfo {
57
- pricingModel: string;
58
- }
59
- /**
60
- * @since Added in 2.7.2
61
- */
62
- export interface ActorStoreList {
63
- id: string;
64
- name: string;
65
- username: string;
66
- title?: string;
67
- description?: string;
68
- stats: ActorStats;
69
- currentPricingInfo: PricingInfo;
70
- pictureUrl?: string;
71
- userPictureUrl?: string;
72
- /**
73
- * @since Added in 2.8.6
74
- */
75
- url: string;
76
- /**
77
- * A brief, LLM-generated readme summary
78
- * @since Added in 2.22.1
79
- */
80
- readmeSummary?: string;
81
- }
82
54
  /**
83
55
  * @since Added in 2.7.2
84
56
  */
@@ -1,10 +1,12 @@
1
1
  import type { ApiClientSubResourceOptions } from '../base/api_client';
2
2
  import { ResourceClient } from '../base/resource_client';
3
+ import type { Task, TaskPublicConfig } from '../models';
3
4
  import type { Dictionary } from '../utils';
4
- import type { ActorLastRunOptions, ActorRun, ActorStandby, ActorStartOptions } from './actor';
5
+ import type { ActorLastRunOptions, ActorRun, ActorStartOptions } from './actor';
5
6
  import { RunClient } from './run';
6
7
  import { RunCollectionClient } from './run_collection';
7
8
  import { WebhookCollectionClient } from './webhook_collection';
9
+ export type { Task, TaskOptions, TaskPublicConfig, TaskStats } from '../models';
8
10
  /**
9
11
  * Client for managing a specific Actor task.
10
12
  *
@@ -152,78 +154,6 @@ export declare class TaskClient extends ResourceClient {
152
154
  */
153
155
  webhooks(): WebhookCollectionClient;
154
156
  }
155
- /**
156
- * Represents an Actor task.
157
- *
158
- * Tasks are saved Actor configurations with input and settings that can be executed
159
- * repeatedly without having to specify the full input each time.
160
- */
161
- export interface Task {
162
- id: string;
163
- userId: string;
164
- actId: string;
165
- name: string;
166
- /**
167
- * @since Added in 2.6.1
168
- */
169
- title?: string;
170
- description?: string;
171
- username?: string;
172
- createdAt: Date;
173
- modifiedAt: Date;
174
- stats: TaskStats;
175
- options?: TaskOptions;
176
- input?: Dictionary | Dictionary[];
177
- /**
178
- * @since Added in 2.9.5
179
- */
180
- actorStandby?: Partial<ActorStandby>;
181
- /**
182
- * Whether the task is published on its public landing page. Derived from
183
- * `publicConfig.publishedAt` — set it on update to publish or unpublish the task.
184
- * @since Added in 2.25.0
185
- */
186
- isPublic?: boolean;
187
- /**
188
- * @since Added in 2.25.0
189
- */
190
- publicConfig?: TaskPublicConfig | null;
191
- }
192
- /**
193
- * Public-facing display configuration of a task's public landing page.
194
- *
195
- * The task is published when `publishedAt` is set and unpublished when it is `null`. The
196
- * `publishedAt` field is read-only - use {@apilink TaskClient.publish} and
197
- * {@apilink TaskClient.unpublish} to change the publication state.
198
- * @since Added in 2.25.0
199
- */
200
- export interface TaskPublicConfig {
201
- publishedAt: Date | null;
202
- seoTitle?: string | null;
203
- seoDescription?: string | null;
204
- categorization?: string | null;
205
- inputSchemaFields?: string[] | null;
206
- datasetName?: string | null;
207
- datasetView?: string | null;
208
- }
209
- /**
210
- * Statistics about Actor task usage.
211
- */
212
- export interface TaskStats {
213
- totalRuns: number;
214
- }
215
- /**
216
- * Configuration options for an Actor task.
217
- */
218
- export interface TaskOptions {
219
- build?: string;
220
- timeoutSecs?: number;
221
- memoryMbytes?: number;
222
- /**
223
- * @since Added in 2.19.0
224
- */
225
- restartOnError?: boolean;
226
- }
227
157
  /**
228
158
  * Fields that can be updated when modifying a Task.
229
159
  */
@@ -1,7 +1,9 @@
1
1
  import type { ApiClientSubResourceOptions } from '../base/api_client';
2
2
  import { ResourceCollectionClient } from '../base/resource_collection_client';
3
+ import type { TaskList } from '../models';
3
4
  import type { PaginatedIterator, PaginationOptions } from '../utils';
4
5
  import type { Task, TaskUpdateData } from './task';
6
+ export type { TaskList } from '../models';
5
7
  /**
6
8
  * Client for managing the collection of Actor tasks in your account.
7
9
  *
@@ -64,7 +66,6 @@ export declare class TaskCollectionClient extends ResourceCollectionClient {
64
66
  export interface TaskCollectionListOptions extends PaginationOptions {
65
67
  desc?: boolean;
66
68
  }
67
- export type TaskList = Omit<Task, 'options' | 'input'>;
68
69
  /**
69
70
  * @since Added in 2.3.0
70
71
  */
@@ -1,5 +1,8 @@
1
1
  import type { ApiClientSubResourceOptions } from '../base/api_client';
2
2
  import { ResourceClient } from '../base/resource_client';
3
+ import type { AccountAndUsageLimits, MonthlyUsage, User } from '../models';
4
+ export type { AccountAndUsageLimits, Current, DailyServiceUsage, EffectivePlatformFeature, EffectivePlatformFeatures, Limits, MonthlyUsage, MonthlyUsageCycle, PriceTier, ProxyGroup, ServiceUsage, UsageCycle, UsageItem, User, UserPlan, UserProfile, UserProxy, } from '../models';
5
+ export { PlatformFeature } from '../models';
3
6
  /**
4
7
  * Client for managing user account information.
5
8
  *
@@ -64,169 +67,6 @@ export declare class UserClient extends ResourceClient {
64
67
  */
65
68
  updateLimits(options: LimitsUpdateOptions): Promise<void>;
66
69
  }
67
- export interface User {
68
- username: string;
69
- profile: {
70
- bio?: string;
71
- name?: string;
72
- pictureUrl?: string;
73
- githubUsername?: string;
74
- websiteUrl?: string;
75
- twitterUsername?: string;
76
- };
77
- id?: string;
78
- email?: string;
79
- proxy?: UserProxy;
80
- plan?: UserPlan;
81
- /**
82
- * @since Added in 2.12.5
83
- */
84
- effectivePlatformFeatures?: EffectivePlatformFeatures;
85
- /**
86
- * @since Added in 2.12.5
87
- */
88
- createdAt?: Date;
89
- /**
90
- * @since Added in 2.12.5
91
- */
92
- isPaying?: boolean;
93
- }
94
- export interface UserProxy {
95
- password: string;
96
- groups: ProxyGroup[];
97
- }
98
- export interface ProxyGroup {
99
- name: string;
100
- description: string;
101
- availableCount: number;
102
- }
103
- export interface UserPlan {
104
- id: string;
105
- description: string;
106
- isEnabled: boolean;
107
- monthlyBasePriceUsd: number;
108
- monthlyUsageCreditsUsd: number;
109
- usageDiscountPercent: number;
110
- enabledPlatformFeatures: PlatformFeature[];
111
- maxMonthlyUsageUsd: number;
112
- maxActorMemoryGbytes: number;
113
- maxMonthlyActorComputeUnits: number;
114
- maxMonthlyResidentialProxyGbytes: number;
115
- maxMonthlyProxySerps: number;
116
- maxMonthlyExternalDataTransferGbytes: number;
117
- maxActorCount: number;
118
- maxActorTaskCount: number;
119
- dataRetentionDays: number;
120
- availableProxyGroups: Record<string, number>;
121
- teamAccountSeatCount: number;
122
- supportLevel: string;
123
- availableAddOns: unknown[];
124
- }
125
- export declare enum PlatformFeature {
126
- Actors = "ACTORS",
127
- Storage = "STORAGE",
128
- ProxySERPS = "PROXY_SERPS",
129
- Scheduler = "SCHEDULER",
130
- Webhooks = "WEBHOOKS",
131
- Proxy = "PROXY",
132
- ProxyExternalAccess = "PROXY_EXTERNAL_ACCESS"
133
- }
134
- interface EffectivePlatformFeature {
135
- isEnabled: boolean;
136
- disabledReason: string | null;
137
- disabledReasonType: string | null;
138
- isTrial: boolean;
139
- trialExpirationAt: Date | null;
140
- }
141
- interface EffectivePlatformFeatures {
142
- ACTORS: EffectivePlatformFeature;
143
- STORAGE: EffectivePlatformFeature;
144
- SCHEDULER: EffectivePlatformFeature;
145
- PROXY: EffectivePlatformFeature;
146
- PROXY_EXTERNAL_ACCESS: EffectivePlatformFeature;
147
- PROXY_RESIDENTIAL: EffectivePlatformFeature;
148
- PROXY_SERPS: EffectivePlatformFeature;
149
- WEBHOOKS: EffectivePlatformFeature;
150
- ACTORS_PUBLIC_ALL: EffectivePlatformFeature;
151
- ACTORS_PUBLIC_DEVELOPER: EffectivePlatformFeature;
152
- }
153
- /**
154
- * @since Added in 2.9.2
155
- */
156
- export interface MonthlyUsage {
157
- usageCycle: UsageCycle;
158
- monthlyServiceUsage: {
159
- [key: string]: MonthlyServiceUsageData;
160
- };
161
- dailyServiceUsages: DailyServiceUsage[];
162
- totalUsageCreditsUsdBeforeVolumeDiscount: number;
163
- totalUsageCreditsUsdAfterVolumeDiscount: number;
164
- }
165
- /**
166
- * @since Added in 2.9.2
167
- */
168
- export interface UsageCycle {
169
- startAt: Date;
170
- endAt: Date;
171
- }
172
- /** Monthly usage of a single service */
173
- interface MonthlyServiceUsageData {
174
- quantity: number;
175
- baseAmountUsd: number;
176
- baseUnitPriceUsd: number;
177
- amountAfterVolumeDiscountUsd: number;
178
- priceTiers: PriceTier[];
179
- }
180
- interface PriceTier {
181
- quantityAbove: number;
182
- discountPercent: number;
183
- tierQuantity: number;
184
- unitPriceUsd: number;
185
- priceUsd: number;
186
- }
187
- interface DailyServiceUsage {
188
- date: Date;
189
- serviceUsage: {
190
- [key: string]: DailyServiceUsageData;
191
- };
192
- totalUsageCreditsUsd: number;
193
- }
194
- /** Daily usage of a single service */
195
- interface DailyServiceUsageData {
196
- quantity: number;
197
- baseAmountUsd: number;
198
- }
199
- /**
200
- * @since Added in 2.9.2
201
- */
202
- export interface AccountAndUsageLimits {
203
- monthlyUsageCycle: MonthlyUsageCycle;
204
- limits: Limits;
205
- current: Current;
206
- }
207
- /**
208
- * @since Added in 2.9.2
209
- */
210
- export interface MonthlyUsageCycle {
211
- startAt: Date;
212
- endAt: Date;
213
- }
214
- /**
215
- * @since Added in 2.9.2
216
- */
217
- export interface Limits {
218
- maxMonthlyUsageUsd: number;
219
- maxMonthlyActorComputeUnits: number;
220
- maxMonthlyExternalDataTransferGbytes: number;
221
- maxMonthlyProxySerps: number;
222
- maxMonthlyResidentialProxyGbytes: number;
223
- maxActorMemoryGbytes: number;
224
- maxActorCount: number;
225
- maxActorTaskCount: number;
226
- maxConcurrentActorJobs: number;
227
- maxTeamAccountSeatCount: number;
228
- dataRetentionDays: number;
229
- }
230
70
  /**
231
71
  * @since Added in 2.10.0
232
72
  */
@@ -235,19 +75,3 @@ export type LimitsUpdateOptions = {
235
75
  } | {
236
76
  dataRetentionDays: number;
237
77
  };
238
- /**
239
- * @since Added in 2.9.2
240
- */
241
- export interface Current {
242
- monthlyUsageUsd: number;
243
- monthlyActorComputeUnits: number;
244
- monthlyExternalDataTransferGbytes: number;
245
- monthlyProxySerps: number;
246
- monthlyResidentialProxyGbytes: number;
247
- actorMemoryGbytes: number;
248
- actorCount: number;
249
- actorTaskCount: number;
250
- activeActorJobCount: number;
251
- teamAccountSeatCount: number;
252
- }
253
- export {};
@@ -1,8 +1,10 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.PlatformFeature = exports.UserClient = void 0;
3
+ exports.UserClient = exports.PlatformFeature = void 0;
4
4
  const resource_client_1 = require("../base/resource_client");
5
5
  const utils_1 = require("../utils");
6
+ var models_1 = require("../models");
7
+ Object.defineProperty(exports, "PlatformFeature", { enumerable: true, get: function () { return models_1.PlatformFeature; } });
6
8
  /**
7
9
  * Client for managing user account information.
8
10
  *
@@ -113,13 +115,3 @@ class UserClient extends resource_client_1.ResourceClient {
113
115
  }
114
116
  }
115
117
  exports.UserClient = UserClient;
116
- var PlatformFeature;
117
- (function (PlatformFeature) {
118
- PlatformFeature["Actors"] = "ACTORS";
119
- PlatformFeature["Storage"] = "STORAGE";
120
- PlatformFeature["ProxySERPS"] = "PROXY_SERPS";
121
- PlatformFeature["Scheduler"] = "SCHEDULER";
122
- PlatformFeature["Webhooks"] = "WEBHOOKS";
123
- PlatformFeature["Proxy"] = "PROXY";
124
- PlatformFeature["ProxyExternalAccess"] = "PROXY_EXTERNAL_ACCESS";
125
- })(PlatformFeature || (exports.PlatformFeature = PlatformFeature = {}));
@@ -1,8 +1,9 @@
1
- import type { WEBHOOK_EVENT_TYPES } from '@apify/consts';
2
1
  import type { ApiClientSubResourceOptions } from '../base/api_client';
3
2
  import { ResourceClient } from '../base/resource_client';
3
+ import type { Webhook, WebhookEventType } from '../models';
4
4
  import type { WebhookDispatch } from './webhook_dispatch';
5
5
  import { WebhookDispatchCollectionClient } from './webhook_dispatch_collection';
6
+ export type { Webhook, WebhookAnyRunOfActorCondition, WebhookAnyRunOfActorTaskCondition, WebhookCertainRunCondition, WebhookCondition, WebhookEventType, WebhookLastDispatch, WebhookStats, } from '../models';
6
7
  /**
7
8
  * Client for managing a specific webhook.
8
9
  *
@@ -72,43 +73,6 @@ export declare class WebhookClient extends ResourceClient {
72
73
  */
73
74
  dispatches(): WebhookDispatchCollectionClient;
74
75
  }
75
- /**
76
- * Represents a webhook for receiving notifications about Actor events.
77
- *
78
- * Webhooks send HTTP POST requests to specified URLs when certain events occur
79
- * (e.g., Actor run succeeds, fails, or times out).
80
- */
81
- export interface Webhook {
82
- id: string;
83
- userId: string;
84
- createdAt: Date;
85
- modifiedAt: Date;
86
- isAdHoc: boolean;
87
- eventTypes: WebhookEventType[];
88
- condition: WebhookCondition;
89
- ignoreSslErrors: boolean;
90
- doNotRetry: boolean;
91
- requestUrl: string;
92
- payloadTemplate: string;
93
- lastDispatch: string;
94
- stats: WebhookStats;
95
- /**
96
- * @since Added in 2.7.2
97
- */
98
- shouldInterpolateStrings: boolean;
99
- /**
100
- * @since Added in 2.9.4
101
- */
102
- isApifyIntegration?: boolean;
103
- /**
104
- * @since Added in 2.8.1
105
- */
106
- headersTemplate?: string;
107
- /**
108
- * @since Added in 2.8.1
109
- */
110
- description?: string;
111
- }
112
76
  export interface WebhookIdempotencyKey {
113
77
  idempotencyKey?: string;
114
78
  }
@@ -118,26 +82,3 @@ export interface WebhookIdempotencyKey {
118
82
  export type WebhookUpdateData = Partial<Pick<Webhook, 'isAdHoc' | 'condition' | 'ignoreSslErrors' | 'doNotRetry' | 'requestUrl' | 'payloadTemplate' | 'shouldInterpolateStrings' | 'isApifyIntegration' | 'headersTemplate' | 'description'> & {
119
83
  eventTypes: readonly WebhookEventType[];
120
84
  }> & WebhookIdempotencyKey;
121
- /**
122
- * Statistics about webhook usage.
123
- */
124
- export interface WebhookStats {
125
- totalDispatches: number;
126
- }
127
- /**
128
- * Event types that can trigger webhooks.
129
- */
130
- export type WebhookEventType = (typeof WEBHOOK_EVENT_TYPES)[keyof typeof WEBHOOK_EVENT_TYPES];
131
- /**
132
- * Condition that determines when a webhook should be triggered.
133
- */
134
- export type WebhookCondition = WebhookAnyRunOfActorCondition | WebhookAnyRunOfActorTaskCondition | WebhookCertainRunCondition;
135
- export interface WebhookAnyRunOfActorCondition {
136
- actorId: string;
137
- }
138
- export interface WebhookAnyRunOfActorTaskCondition {
139
- actorTaskId: string;
140
- }
141
- export interface WebhookCertainRunCondition {
142
- actorRunId: string;
143
- }
@@ -1,6 +1,8 @@
1
1
  import type { ApiClientSubResourceOptions } from '../base/api_client';
2
2
  import { ResourceClient } from '../base/resource_client';
3
- import type { Webhook, WebhookEventType } from './webhook';
3
+ import type { WebhookDispatch } from '../models';
4
+ export type { WebhookDispatch, WebhookDispatchCall, WebhookDispatchEventData, WebhookDispatchWebhookSummary, } from '../models';
5
+ export { WebhookDispatchStatus } from '../models';
4
6
  /**
5
7
  * Client for managing a specific webhook dispatch.
6
8
  *
@@ -32,38 +34,3 @@ export declare class WebhookDispatchClient extends ResourceClient {
32
34
  */
33
35
  get(): Promise<WebhookDispatch | undefined>;
34
36
  }
35
- export interface WebhookDispatch {
36
- id: string;
37
- userId: string;
38
- webhookId: string;
39
- createdAt: Date;
40
- status: WebhookDispatchStatus;
41
- eventType: WebhookEventType;
42
- calls: WebhookDispatchCall[];
43
- webhook: Pick<Webhook, 'requestUrl' | 'isAdHoc'>;
44
- /**
45
- * @since Added in 2.13.0
46
- */
47
- eventData: WebhookDispatchEventData | null;
48
- }
49
- export declare enum WebhookDispatchStatus {
50
- Active = "ACTIVE",
51
- Succeeded = "SUCCEEDED",
52
- Failed = "FAILED"
53
- }
54
- export interface WebhookDispatchCall {
55
- startedAt: Date;
56
- finishedAt: Date;
57
- errorMessage: string | null;
58
- responseStatus: number | null;
59
- responseBody: string | null;
60
- }
61
- /**
62
- * @since Added in 2.13.0
63
- */
64
- export interface WebhookDispatchEventData {
65
- actorRunId?: string;
66
- actorId?: string;
67
- actorTaskId?: string;
68
- actorBuildId?: string;
69
- }
@@ -1,7 +1,9 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.WebhookDispatchStatus = exports.WebhookDispatchClient = void 0;
3
+ exports.WebhookDispatchClient = exports.WebhookDispatchStatus = void 0;
4
4
  const resource_client_1 = require("../base/resource_client");
5
+ var models_1 = require("../models");
6
+ Object.defineProperty(exports, "WebhookDispatchStatus", { enumerable: true, get: function () { return models_1.WebhookDispatchStatus; } });
5
7
  /**
6
8
  * Client for managing a specific webhook dispatch.
7
9
  *
@@ -41,9 +43,3 @@ class WebhookDispatchClient extends resource_client_1.ResourceClient {
41
43
  }
42
44
  }
43
45
  exports.WebhookDispatchClient = WebhookDispatchClient;
44
- var WebhookDispatchStatus;
45
- (function (WebhookDispatchStatus) {
46
- WebhookDispatchStatus["Active"] = "ACTIVE";
47
- WebhookDispatchStatus["Succeeded"] = "SUCCEEDED";
48
- WebhookDispatchStatus["Failed"] = "FAILED";
49
- })(WebhookDispatchStatus || (exports.WebhookDispatchStatus = WebhookDispatchStatus = {}));
package/dist/utils.js CHANGED
@@ -92,10 +92,16 @@ function catchNotFoundOrThrow(err) {
92
92
  * If the field cannot be converted to Date, it is left as is.
93
93
  */
94
94
  function parseDateFields(input, shouldParseField = null, depth = 0) {
95
- // Don't go too deep to avoid stack overflows (especially if there is a circular reference). The depth of 3
96
- // corresponds to obj.data.someArrayField.[x].field and should be generally enough.
95
+ // Don't go too deep to avoid stack overflows (especially if there is a circular reference). The depth of 4
96
+ // corresponds to obj.items.[x].someArrayField.[y].field, which is what a list response looks like: it
97
+ // nests one level deeper than the single resource it wraps, because both the item array and the nested
98
+ // array spend a level.
99
+ //
100
+ // In a list response it also reaches one level into caller-owned blobs the API stores verbatim, so a
101
+ // listed request's `userData.foo.somethingAt` comes back as a `Date` rather than the string it was
102
+ // written as.
97
103
  // TODO: Consider removing this limitation. It might came across as an annoying surprise as it's not communicated.
98
- if (depth > 3) {
104
+ if (depth > 4) {
99
105
  return input;
100
106
  }
101
107
  if (Array.isArray(input))