Skip to content

Commit e138093

Browse files
fix: add missing 'effectivePlatformFeatures', 'createdAt', 'isPaying' to User interface (#691)
Prerequisite apify/apify-docs#1569 was merged Questions: 1. The string -> Date conversion happens automatically for all types, right? So no need to do anything? 2. Do we use explicit `T | null` anywhere if the API returns the type or null? Seems we like to do `T?` rather
1 parent 0fe0895 commit e138093

File tree

1 file changed

+26
-1
lines changed

1 file changed

+26
-1
lines changed

src/resource_clients/user.ts

Lines changed: 26 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,8 @@ export class UserClient extends ResourceClient {
8383
}
8484

8585
//
86-
// Response interface for /users/:userId
86+
// Response interface for /users/:userId and /users/me
87+
// Using token will return private user data
8788
//
8889

8990
export interface User {
@@ -102,6 +103,9 @@ export interface User {
102103
email?: string;
103104
proxy?: UserProxy;
104105
plan?: UserPlan;
106+
effectivePlatformFeatures?: EffectivePlatformFeatures;
107+
createdAt?: Date;
108+
isPaying?: boolean;
105109
}
106110

107111
export interface UserProxy {
@@ -148,6 +152,27 @@ export enum PlatformFeature {
148152
ProxyExternalAccess = 'PROXY_EXTERNAL_ACCESS',
149153
}
150154

155+
interface EffectivePlatformFeature {
156+
isEnabled: boolean;
157+
disabledReason: string | null;
158+
disabledReasonType: string | null;
159+
isTrial: boolean;
160+
trialExpirationAt: Date | null;
161+
}
162+
163+
interface EffectivePlatformFeatures {
164+
ACTORS: EffectivePlatformFeature;
165+
STORAGE: EffectivePlatformFeature;
166+
SCHEDULER: EffectivePlatformFeature;
167+
PROXY: EffectivePlatformFeature;
168+
PROXY_EXTERNAL_ACCESS: EffectivePlatformFeature;
169+
PROXY_RESIDENTIAL: EffectivePlatformFeature;
170+
PROXY_SERPS: EffectivePlatformFeature;
171+
WEBHOOKS: EffectivePlatformFeature;
172+
ACTORS_PUBLIC_ALL: EffectivePlatformFeature;
173+
ACTORS_PUBLIC_DEVELOPER: EffectivePlatformFeature;
174+
}
175+
151176
//
152177
// Response interface for /users/:userId/usage/monthly
153178
//

0 commit comments

Comments
 (0)