Skip to content

Commit 016d668

Browse files
Automatically update NodeJS SDK
1 parent bcb876e commit 016d668

100 files changed

Lines changed: 2110 additions & 115 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

api/resources/admin/client/Client.d.ts

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,10 @@
33
*/
44
import * as environments from "../../../../environments";
55
import * as core from "../../../../core";
6-
import { Streaks } from "../resources/streaks/client/Client";
76
import { Attributes } from "../resources/attributes/client/Client";
87
import { Metrics } from "../resources/metrics/client/Client";
8+
import { Leaderboards } from "../resources/leaderboards/client/Client";
9+
import { Streaks } from "../resources/streaks/client/Client";
910
import { Points } from "../resources/points/client/Client";
1011
export declare namespace Admin {
1112
interface Options {
@@ -20,12 +21,14 @@ export declare namespace Admin {
2021
export declare class Admin {
2122
protected readonly _options: Admin.Options;
2223
constructor(_options: Admin.Options);
23-
protected _streaks: Streaks | undefined;
24-
get streaks(): Streaks;
2524
protected _attributes: Attributes | undefined;
2625
get attributes(): Attributes;
2726
protected _metrics: Metrics | undefined;
2827
get metrics(): Metrics;
28+
protected _leaderboards: Leaderboards | undefined;
29+
get leaderboards(): Leaderboards;
30+
protected _streaks: Streaks | undefined;
31+
get streaks(): Streaks;
2932
protected _points: Points | undefined;
3033
get points(): Points;
3134
}

api/resources/admin/client/Client.js

Lines changed: 16 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -4,29 +4,34 @@
44
*/
55
Object.defineProperty(exports, "__esModule", { value: true });
66
exports.Admin = void 0;
7-
const Client_1 = require("../resources/streaks/client/Client");
8-
const Client_2 = require("../resources/attributes/client/Client");
9-
const Client_3 = require("../resources/metrics/client/Client");
10-
const Client_4 = require("../resources/points/client/Client");
7+
const Client_1 = require("../resources/attributes/client/Client");
8+
const Client_2 = require("../resources/metrics/client/Client");
9+
const Client_3 = require("../resources/leaderboards/client/Client");
10+
const Client_4 = require("../resources/streaks/client/Client");
11+
const Client_5 = require("../resources/points/client/Client");
1112
class Admin {
1213
constructor(_options) {
1314
this._options = _options;
1415
}
15-
get streaks() {
16-
var _a;
17-
return ((_a = this._streaks) !== null && _a !== void 0 ? _a : (this._streaks = new Client_1.Streaks(this._options)));
18-
}
1916
get attributes() {
2017
var _a;
21-
return ((_a = this._attributes) !== null && _a !== void 0 ? _a : (this._attributes = new Client_2.Attributes(this._options)));
18+
return ((_a = this._attributes) !== null && _a !== void 0 ? _a : (this._attributes = new Client_1.Attributes(this._options)));
2219
}
2320
get metrics() {
2421
var _a;
25-
return ((_a = this._metrics) !== null && _a !== void 0 ? _a : (this._metrics = new Client_3.Metrics(this._options)));
22+
return ((_a = this._metrics) !== null && _a !== void 0 ? _a : (this._metrics = new Client_2.Metrics(this._options)));
23+
}
24+
get leaderboards() {
25+
var _a;
26+
return ((_a = this._leaderboards) !== null && _a !== void 0 ? _a : (this._leaderboards = new Client_3.Leaderboards(this._options)));
27+
}
28+
get streaks() {
29+
var _a;
30+
return ((_a = this._streaks) !== null && _a !== void 0 ? _a : (this._streaks = new Client_4.Streaks(this._options)));
2631
}
2732
get points() {
2833
var _a;
29-
return ((_a = this._points) !== null && _a !== void 0 ? _a : (this._points = new Client_4.Points(this._options)));
34+
return ((_a = this._points) !== null && _a !== void 0 ? _a : (this._points = new Client_5.Points(this._options)));
3035
}
3136
}
3237
exports.Admin = Admin;

api/resources/admin/resources/attributes/client/Client.d.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ export declare class Attributes {
3030
*/
3131
list(request?: TrophyApi.admin.AttributesListRequest, requestOptions?: Attributes.RequestOptions): Promise<TrophyApi.ListAttributesResponse>;
3232
/**
33-
* Create attributes in bulk.
33+
* Create attributes.
3434
* @throws {@link TrophyApi.UnauthorizedError}
3535
* @throws {@link TrophyApi.UnprocessableEntityError}
3636
*
@@ -47,7 +47,7 @@ export declare class Attributes {
4747
*/
4848
create(request: TrophyApi.CreateAttributesRequest, requestOptions?: Attributes.RequestOptions): Promise<TrophyApi.CreateAttributesResponse>;
4949
/**
50-
* Delete attributes in bulk by ID.
50+
* Delete attributes by ID.
5151
* @throws {@link TrophyApi.UnauthorizedError}
5252
* @throws {@link TrophyApi.UnprocessableEntityError}
5353
*
@@ -56,7 +56,7 @@ export declare class Attributes {
5656
*/
5757
delete(request?: TrophyApi.admin.AttributesDeleteRequest, requestOptions?: Attributes.RequestOptions): Promise<TrophyApi.DeleteAttributesResponse>;
5858
/**
59-
* Update attributes in bulk by ID.
59+
* Update attributes by ID.
6060
* @throws {@link TrophyApi.UnauthorizedError}
6161
* @throws {@link TrophyApi.UnprocessableEntityError}
6262
*

api/resources/admin/resources/attributes/client/Client.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ class Attributes {
131131
});
132132
}
133133
/**
134-
* Create attributes in bulk.
134+
* Create attributes.
135135
* @throws {@link TrophyApi.UnauthorizedError}
136136
* @throws {@link TrophyApi.UnprocessableEntityError}
137137
*
@@ -209,7 +209,7 @@ class Attributes {
209209
});
210210
}
211211
/**
212-
* Delete attributes in bulk by ID.
212+
* Delete attributes by ID.
213213
* @throws {@link TrophyApi.UnauthorizedError}
214214
* @throws {@link TrophyApi.UnprocessableEntityError}
215215
*
@@ -289,7 +289,7 @@ class Attributes {
289289
});
290290
}
291291
/**
292-
* Update attributes in bulk by ID.
292+
* Update attributes by ID.
293293
* @throws {@link TrophyApi.UnauthorizedError}
294294
* @throws {@link TrophyApi.UnprocessableEntityError}
295295
*

api/resources/admin/resources/index.d.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@ export * from "./streaks/types";
33
export * as points from "./points";
44
export * as attributes from "./attributes";
55
export * as metrics from "./metrics";
6-
export * from "./streaks/client/requests";
6+
export * as leaderboards from "./leaderboards";
77
export * from "./attributes/client/requests";
88
export * from "./metrics/client/requests";
9+
export * from "./leaderboards/client/requests";
10+
export * from "./streaks/client/requests";

api/resources/admin/resources/index.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,12 +26,14 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
2626
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
2727
};
2828
Object.defineProperty(exports, "__esModule", { value: true });
29-
exports.metrics = exports.attributes = exports.points = exports.streaks = void 0;
29+
exports.leaderboards = exports.metrics = exports.attributes = exports.points = exports.streaks = void 0;
3030
exports.streaks = __importStar(require("./streaks"));
3131
__exportStar(require("./streaks/types"), exports);
3232
exports.points = __importStar(require("./points"));
3333
exports.attributes = __importStar(require("./attributes"));
3434
exports.metrics = __importStar(require("./metrics"));
35-
__exportStar(require("./streaks/client/requests"), exports);
35+
exports.leaderboards = __importStar(require("./leaderboards"));
3636
__exportStar(require("./attributes/client/requests"), exports);
3737
__exportStar(require("./metrics/client/requests"), exports);
38+
__exportStar(require("./leaderboards/client/requests"), exports);
39+
__exportStar(require("./streaks/client/requests"), exports);
Lines changed: 94 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,94 @@
1+
/**
2+
* This file was auto-generated by Fern from our API Definition.
3+
*/
4+
import * as environments from "../../../../../../environments";
5+
import * as core from "../../../../../../core";
6+
import * as TrophyApi from "../../../../..";
7+
export declare namespace Leaderboards {
8+
interface Options {
9+
environment?: core.Supplier<environments.TrophyApiEnvironment | environments.TrophyApiEnvironmentUrls>;
10+
apiKey: core.Supplier<string>;
11+
}
12+
interface RequestOptions {
13+
timeoutInSeconds?: number;
14+
maxRetries?: number;
15+
}
16+
}
17+
export declare class Leaderboards {
18+
protected readonly _options: Leaderboards.Options;
19+
constructor(_options: Leaderboards.Options);
20+
/**
21+
* List leaderboards.
22+
* @throws {@link TrophyApi.UnauthorizedError}
23+
* @throws {@link TrophyApi.UnprocessableEntityError}
24+
*
25+
* @example
26+
* await trophyApi.admin.leaderboards.list({
27+
* limit: 1,
28+
* skip: 1
29+
* })
30+
*/
31+
list(request?: TrophyApi.admin.LeaderboardsListRequest, requestOptions?: Leaderboards.RequestOptions): Promise<TrophyApi.ListLeaderboardsResponse>;
32+
/**
33+
* Create leaderboards. Maximum 100 leaderboards per request.
34+
* @throws {@link TrophyApi.UnauthorizedError}
35+
* @throws {@link TrophyApi.UnprocessableEntityError}
36+
*
37+
* @example
38+
* await trophyApi.admin.leaderboards.create([{
39+
* name: "Revenue Champions",
40+
* key: "revenue-champions",
41+
* status: TrophyApi.CreateLeaderboardRequestItemStatus.Inactive,
42+
* rankBy: TrophyApi.CreateLeaderboardRequestItemRankBy.Metric,
43+
* metricId: "550e8400-e29b-41d4-a716-446655440000",
44+
* maxParticipants: 100,
45+
* start: "2026-04-20",
46+
* breakdownAttributes: ["550e8400-e29b-41d4-a716-446655440010"],
47+
* runUnit: TrophyApi.CreateLeaderboardRequestItemRunUnit.Month,
48+
* runInterval: 1
49+
* }, {
50+
* name: "Streak Legends",
51+
* key: "streak-legends",
52+
* status: TrophyApi.CreateLeaderboardRequestItemStatus.Scheduled,
53+
* rankBy: TrophyApi.CreateLeaderboardRequestItemRankBy.Streak,
54+
* start: "2026-04-27"
55+
* }])
56+
*/
57+
create(request: TrophyApi.CreateLeaderboardsRequest, requestOptions?: Leaderboards.RequestOptions): Promise<TrophyApi.CreateLeaderboardsResponse>;
58+
/**
59+
* Delete leaderboards by ID.
60+
* @throws {@link TrophyApi.UnauthorizedError}
61+
* @throws {@link TrophyApi.UnprocessableEntityError}
62+
*/
63+
delete(request?: TrophyApi.admin.LeaderboardsDeleteRequest, requestOptions?: Leaderboards.RequestOptions): Promise<TrophyApi.DeleteLeaderboardsResponse>;
64+
/**
65+
* Update leaderboards by ID. Updating `status` behaves the same as activating, scheduling, deactivating, or finishing a leaderboard in the dashboard.
66+
* @throws {@link TrophyApi.UnauthorizedError}
67+
* @throws {@link TrophyApi.UnprocessableEntityError}
68+
*
69+
* @example
70+
* await trophyApi.admin.leaderboards.update([{
71+
* id: "550e8400-e29b-41d4-a716-446655440100",
72+
* name: "Monthly Revenue Champions",
73+
* description: "Ranked by monthly revenue",
74+
* status: TrophyApi.UpdateLeaderboardRequestItemStatus.Active
75+
* }, {
76+
* id: "550e8400-e29b-41d4-a716-446655440101",
77+
* status: TrophyApi.UpdateLeaderboardRequestItemStatus.Finished
78+
* }])
79+
*/
80+
update(request: TrophyApi.UpdateLeaderboardsRequest, requestOptions?: Leaderboards.RequestOptions): Promise<TrophyApi.UpdateLeaderboardsResponse>;
81+
/**
82+
* Get a leaderboard by ID.
83+
* @throws {@link TrophyApi.UnauthorizedError}
84+
* @throws {@link TrophyApi.NotFoundError}
85+
* @throws {@link TrophyApi.UnprocessableEntityError}
86+
*
87+
* @example
88+
* await trophyApi.admin.leaderboards.get("550e8400-e29b-41d4-a716-446655440100")
89+
*
90+
* @example
91+
* await trophyApi.admin.leaderboards.get("550e8400-e29b-41d4-a716-446655440100")
92+
*/
93+
get(id: string, requestOptions?: Leaderboards.RequestOptions): Promise<TrophyApi.AdminLeaderboard>;
94+
}

0 commit comments

Comments
 (0)