Skip to content

Commit

Permalink
fix: fields ending in At are Date objects (apify#230)
Browse files Browse the repository at this point in the history
  • Loading branch information
vladfrangu authored Feb 10, 2022
1 parent b0184c9 commit 69eb874
Show file tree
Hide file tree
Showing 11 changed files with 30 additions and 29 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
2.2.0 / 2022/02/XX
===================
- Added support for the (for now experimental) `view` parameter to the dataset items endpoints
- For TypeScript users, the type for the fields that end in `At` (ex.: `createdAt`) have been correctly typed as a Date object instead of a string

2.1.0 / 2022/01/26
===================
Expand Down
12 changes: 6 additions & 6 deletions src/resource_clients/actor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -220,8 +220,8 @@ export interface Actor {
restartOnError?: boolean;
isPublic: boolean;
isAnonymouslyRunnable?: boolean;
createdAt: string;
modifiedAt: string;
createdAt: Date;
modifiedAt: Date;
stats: ActorStats;
versions: ActorVersion[];
defaultRunOptions: ActorDefaultRunOptions;
Expand All @@ -240,7 +240,7 @@ export interface ActorStats {
totalUsers30Days: number;
totalUsers90Days: number;
totalMetamorphs: number;
lastRunStartedAt: string;
lastRunStartedAt: Date;
}

export interface ActorDefaultRunOptions {
Expand All @@ -261,7 +261,7 @@ export interface ActorTaggedBuilds {
export interface ActorTaggedBuild {
buildId?: string;
buildNumber?: string;
finishedAt?: string;
finishedAt?: Date;
}

export type ActorUpdateOptions = Pick<Actor, 'name' | 'isPublic' | 'versions' | 'description' | 'title' | 'restartOnError'>
Expand Down Expand Up @@ -313,8 +313,8 @@ export interface ActorRun {
actId: string;
userId: string;
actorTaskId?: string;
startedAt: string;
finishedAt: string;
startedAt: Date;
finishedAt: Date;
status: typeof ACT_JOB_TERMINAL_STATUSES[number];
meta: ActorRunMeta;
stats: ActorRunStats;
Expand Down
4 changes: 2 additions & 2 deletions src/resource_clients/actor_collection.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,8 @@ export interface ActorCollectionListOptions {

export interface ActorCollectionListItem {
id: string;
createdAt: string;
modifiedAt: string;
createdAt: Date;
modifiedAt: Date;
name: string;
username: string;
}
Expand Down
4 changes: 2 additions & 2 deletions src/resource_clients/build.ts
Original file line number Diff line number Diff line change
Expand Up @@ -86,8 +86,8 @@ export interface Build {
id: string;
actId: string;
userId: string;
startedAt: string;
finishedAt?: string;
startedAt: Date;
finishedAt?: Date;
status: typeof ACT_JOB_TERMINAL_STATUSES[number];
meta: BuildMeta;
stats?: BuildStats;
Expand Down
6 changes: 3 additions & 3 deletions src/resource_clients/dataset.ts
Original file line number Diff line number Diff line change
Expand Up @@ -144,9 +144,9 @@ export interface Dataset {
id: string;
name?: string;
userId: string;
createdAt: string;
modifiedAt: string;
accessedAt: string;
createdAt: Date;
modifiedAt: Date;
accessedAt: Date;
itemCount: number;
cleanItemCount: number;
actId?: string;
Expand Down
6 changes: 3 additions & 3 deletions src/resource_clients/key_value_store.ts
Original file line number Diff line number Diff line change
Expand Up @@ -183,9 +183,9 @@ export interface KeyValueStore {
id: string;
name?: string;
userId: string;
createdAt: string;
modifiedAt: string;
accessedAt: string;
createdAt: Date;
modifiedAt: Date;
accessedAt: Date;
actId?: string;
actRunId?: string;
stats?: KeyValueStoreStats;
Expand Down
8 changes: 4 additions & 4 deletions src/resource_clients/request_queue.ts
Original file line number Diff line number Diff line change
Expand Up @@ -274,9 +274,9 @@ export interface RequestQueue {
id: string;
name?: string;
userId: string;
createdAt: string;
modifiedAt: string;
accessedAt: string;
createdAt: Date;
modifiedAt: Date;
accessedAt: Date;
expireAt?: string;
totalRequestCount: number;
handledRequestCount: number;
Expand Down Expand Up @@ -305,7 +305,7 @@ export interface RequestQueueClientListHeadOptions {

export interface RequestQueueClientListHeadResult {
limit: number;
queueModifiedAt: string;
queueModifiedAt: Date;
hadMultipleClients: boolean;
items: RequestQueueClientListItem[];
}
Expand Down
4 changes: 2 additions & 2 deletions src/resource_clients/schedule.ts
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,8 @@ export interface Schedule {
isEnabled: boolean;
isExclusive: boolean;
description?: string;
createdAt: string;
modifiedAt: string;
createdAt: Date;
modifiedAt: Date;
nextRunAt: string;
lastRunAt: string;
actions: ScheduleAction[];
Expand Down
4 changes: 2 additions & 2 deletions src/resource_clients/task.ts
Original file line number Diff line number Diff line change
Expand Up @@ -189,8 +189,8 @@ export interface Task {
name: string;
description?: string;
username?: string;
createdAt: string;
modifiedAt: string;
createdAt: Date;
modifiedAt: Date;
stats: TaskStats;
options?: TaskOptions;
input?: Dictionary | Dictionary[];
Expand Down
4 changes: 2 additions & 2 deletions src/resource_clients/webhook.ts
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,8 @@ export class WebhookClient extends ResourceClient {
export interface Webhook {
id: string;
userId: string;
createdAt: string;
modifiedAt: string;
createdAt: Date;
modifiedAt: Date;
isAdHoc: boolean;
eventTypes: WebhookEventType[];
condition: WebhookCondition;
Expand Down
6 changes: 3 additions & 3 deletions src/resource_clients/webhook_dispatch.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ export interface WebhookDispatch {
id: string;
userId: string;
webhookId: string;
createdAt: string;
createdAt: Date;
status: WebhookDispatchStatus;
eventType: WebhookEventType;
calls: WebhookDispatchCall[];
Expand All @@ -39,8 +39,8 @@ export enum WebhookDispatchStatus {
}

export interface WebhookDispatchCall {
startedAt: string;
finishedAt: string;
startedAt: Date;
finishedAt: Date;
errorMessage: string | null;
responseStatus: number | null;
responseBody: string | null;
Expand Down

0 comments on commit 69eb874

Please sign in to comment.