Skip to content

Commit 4e6bf72

Browse files
Automatically update staging NodeJS SDK
1 parent 6405e82 commit 4e6bf72

86 files changed

Lines changed: 1783 additions & 9 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: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
*/
44
import * as environments from "../../../../environments";
55
import * as core from "../../../../core";
6+
import { Leaderboards } from "../resources/leaderboards/client/Client";
67
import { Streaks } from "../resources/streaks/client/Client";
78
import { Attributes } from "../resources/attributes/client/Client";
89
import { Metrics } from "../resources/metrics/client/Client";
@@ -20,6 +21,8 @@ export declare namespace Admin {
2021
export declare class Admin {
2122
protected readonly _options: Admin.Options;
2223
constructor(_options: Admin.Options);
24+
protected _leaderboards: Leaderboards | undefined;
25+
get leaderboards(): Leaderboards;
2326
protected _streaks: Streaks | undefined;
2427
get streaks(): Streaks;
2528
protected _attributes: Attributes | undefined;

api/resources/admin/client/Client.js

Lines changed: 13 additions & 8 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/leaderboards/client/Client");
8+
const Client_2 = require("../resources/streaks/client/Client");
9+
const Client_3 = require("../resources/attributes/client/Client");
10+
const Client_4 = require("../resources/metrics/client/Client");
11+
const Client_5 = require("../resources/points/client/Client");
1112
class Admin {
1213
constructor(_options) {
1314
this._options = _options;
1415
}
16+
get leaderboards() {
17+
var _a;
18+
return ((_a = this._leaderboards) !== null && _a !== void 0 ? _a : (this._leaderboards = new Client_1.Leaderboards(this._options)));
19+
}
1520
get streaks() {
1621
var _a;
17-
return ((_a = this._streaks) !== null && _a !== void 0 ? _a : (this._streaks = new Client_1.Streaks(this._options)));
22+
return ((_a = this._streaks) !== null && _a !== void 0 ? _a : (this._streaks = new Client_2.Streaks(this._options)));
1823
}
1924
get attributes() {
2025
var _a;
21-
return ((_a = this._attributes) !== null && _a !== void 0 ? _a : (this._attributes = new Client_2.Attributes(this._options)));
26+
return ((_a = this._attributes) !== null && _a !== void 0 ? _a : (this._attributes = new Client_3.Attributes(this._options)));
2227
}
2328
get metrics() {
2429
var _a;
25-
return ((_a = this._metrics) !== null && _a !== void 0 ? _a : (this._metrics = new Client_3.Metrics(this._options)));
30+
return ((_a = this._metrics) !== null && _a !== void 0 ? _a : (this._metrics = new Client_4.Metrics(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;
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
export * as streaks from "./streaks";
22
export * from "./streaks/types";
33
export * as points from "./points";
4+
export * as leaderboards from "./leaderboards";
45
export * as attributes from "./attributes";
56
export * as metrics from "./metrics";
7+
export * from "./leaderboards/client/requests";
68
export * from "./streaks/client/requests";
79
export * from "./attributes/client/requests";
810
export * from "./metrics/client/requests";

api/resources/admin/resources/index.js

Lines changed: 3 additions & 1 deletion
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.metrics = exports.attributes = exports.leaderboards = exports.points = exports.streaks = void 0;
3030
exports.streaks = __importStar(require("./streaks"));
3131
__exportStar(require("./streaks/types"), exports);
3232
exports.points = __importStar(require("./points"));
33+
exports.leaderboards = __importStar(require("./leaderboards"));
3334
exports.attributes = __importStar(require("./attributes"));
3435
exports.metrics = __importStar(require("./metrics"));
36+
__exportStar(require("./leaderboards/client/requests"), exports);
3537
__exportStar(require("./streaks/client/requests"), exports);
3638
__exportStar(require("./attributes/client/requests"), exports);
3739
__exportStar(require("./metrics/client/requests"), exports);
Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
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+
* Create leaderboards in bulk. Maximum 100 leaderboards per request.
22+
* @throws {@link TrophyApi.UnauthorizedError}
23+
* @throws {@link TrophyApi.UnprocessableEntityError}
24+
*
25+
* @example
26+
* await trophyApi.admin.leaderboards.create([{
27+
* name: "Revenue Champions",
28+
* key: "revenue-champions",
29+
* status: TrophyApi.CreateLeaderboardRequestItemStatus.Inactive,
30+
* rankBy: TrophyApi.CreateLeaderboardRequestItemRankBy.Metric,
31+
* metricId: "550e8400-e29b-41d4-a716-446655440000",
32+
* maxParticipants: 100,
33+
* start: "2026-04-20",
34+
* breakdownAttributes: ["550e8400-e29b-41d4-a716-446655440010"],
35+
* runUnit: TrophyApi.CreateLeaderboardRequestItemRunUnit.Month,
36+
* runInterval: 1
37+
* }, {
38+
* name: "Streak Legends",
39+
* key: "streak-legends",
40+
* status: TrophyApi.CreateLeaderboardRequestItemStatus.Active,
41+
* rankBy: TrophyApi.CreateLeaderboardRequestItemRankBy.Streak,
42+
* start: "2026-04-20"
43+
* }])
44+
*/
45+
create(request: TrophyApi.CreateLeaderboardsRequest, requestOptions?: Leaderboards.RequestOptions): Promise<TrophyApi.CreateLeaderboardsResponse>;
46+
/**
47+
* Delete leaderboards in bulk by ID.
48+
* @throws {@link TrophyApi.UnauthorizedError}
49+
* @throws {@link TrophyApi.UnprocessableEntityError}
50+
*/
51+
delete(request?: TrophyApi.admin.LeaderboardsDeleteRequest, requestOptions?: Leaderboards.RequestOptions): Promise<TrophyApi.DeleteLeaderboardsResponse>;
52+
/**
53+
* Update leaderboards in bulk by ID. Updating `status` behaves the same as activating, deactivating, or finishing a leaderboard in the dashboard.
54+
* @throws {@link TrophyApi.UnauthorizedError}
55+
* @throws {@link TrophyApi.UnprocessableEntityError}
56+
*
57+
* @example
58+
* await trophyApi.admin.leaderboards.update([{
59+
* id: "550e8400-e29b-41d4-a716-446655440100",
60+
* name: "Monthly Revenue Champions",
61+
* description: "Ranked by monthly revenue",
62+
* status: TrophyApi.UpdateLeaderboardRequestItemStatus.Active
63+
* }, {
64+
* id: "550e8400-e29b-41d4-a716-446655440101",
65+
* status: TrophyApi.UpdateLeaderboardRequestItemStatus.Inactive
66+
* }])
67+
*/
68+
update(request: TrophyApi.UpdateLeaderboardsRequest, requestOptions?: Leaderboards.RequestOptions): Promise<TrophyApi.UpdateLeaderboardsResponse>;
69+
}

0 commit comments

Comments
 (0)