File tree 4 files changed +19
-6
lines changed
4 files changed +19
-6
lines changed Original file line number Diff line number Diff line change
1
+ ---
2
+ " @squarecloud/api " : patch
3
+ ---
4
+
5
+ Deprecate ` SquareCloudAPI#users ` in favor of ` SquareCloudAPI#user ` . Deprecated property will be removed in the the next major version.
Original file line number Diff line number Diff line change @@ -14,8 +14,8 @@ export class SquareCloudAPI extends TypedEventEmitter<ClientEvents> {
14
14
15
15
/** The applications module */
16
16
public readonly applications = new ApplicationsModule ( this ) ;
17
- /** The users module */
18
- public readonly users = new UserModule ( this ) ;
17
+ /** The user module */
18
+ public readonly user = new UserModule ( this ) ;
19
19
/** The global cache service */
20
20
public readonly cache = new GlobalCacheService ( ) ;
21
21
@@ -30,6 +30,14 @@ export class SquareCloudAPI extends TypedEventEmitter<ClientEvents> {
30
30
assertString ( apiKey , "API_KEY" ) ;
31
31
this . api = new APIService ( apiKey ) ;
32
32
}
33
+
34
+ /** @deprecated Use SquareCloudAPI#user instead. */
35
+ get users ( ) {
36
+ console . warn (
37
+ "[SquareCloudAPI] The 'users' property is deprecated and will be removed in the next major version. Use SquareCloudAPI#user instead." ,
38
+ ) ;
39
+ return this . user ;
40
+ }
33
41
}
34
42
35
43
export * from "./structures" ;
Original file line number Diff line number Diff line change @@ -78,7 +78,7 @@ export class BaseApplication {
78
78
/** @deprecated Use `Application#backups` instead */
79
79
get backup ( ) {
80
80
console . warn (
81
- "Application# backup is deprecated. Use Application#backups instead." ,
81
+ "[SquareCloudAPI] The ' backup' property is deprecated and will be removed in the the next major version . Use Application#backups instead." ,
82
82
) ;
83
83
return this . backups ;
84
84
}
Original file line number Diff line number Diff line change @@ -6,7 +6,7 @@ test("UserModule", async (t) => {
6
6
const client = new SquareCloudAPI ( process . env . SQUARE_API_KEY ) ;
7
7
8
8
await t . test ( "should get user information" , async ( ) => {
9
- const user = await client . users . get ( ) ;
9
+ const user = await client . user . get ( ) ;
10
10
11
11
assert . ok ( user ) ;
12
12
assert . ok ( user . id ) ;
@@ -17,7 +17,7 @@ test("UserModule", async (t) => {
17
17
} ) ;
18
18
19
19
await t . test ( "should update cache on user fetch" , async ( ) => {
20
- const firstUser = await client . users . get ( ) ;
20
+ const firstUser = await client . user . get ( ) ;
21
21
const cachedUser = client . cache . get ( "user" ) ;
22
22
23
23
assert . strictEqual ( cachedUser ?. id , firstUser . id ) ;
@@ -34,7 +34,7 @@ test("UserModule", async (t) => {
34
34
emitted = true ;
35
35
} ) ;
36
36
37
- await client . users . get ( ) ;
37
+ await client . user . get ( ) ;
38
38
assert . ok ( emitted , "userUpdate event should have been emitted" ) ;
39
39
} ) ;
40
40
} ) ;
You can’t perform that action at this time.
0 commit comments