Skip to content

Commit 206bcb1

Browse files
Automatically update NodeJS SDK
1 parent 016d668 commit 206bcb1

330 files changed

Lines changed: 6728 additions & 288 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/resources/index.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
export * as streaks from "./streaks";
22
export * from "./streaks/types";
3-
export * as points from "./points";
43
export * as attributes from "./attributes";
54
export * as metrics from "./metrics";
65
export * as leaderboards from "./leaderboards";
6+
export * as points from "./points";
77
export * from "./attributes/client/requests";
88
export * from "./metrics/client/requests";
99
export * from "./leaderboards/client/requests";

api/resources/admin/resources/index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,13 +26,13 @@ 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.leaderboards = exports.metrics = exports.attributes = exports.points = exports.streaks = void 0;
29+
exports.points = exports.leaderboards = exports.metrics = exports.attributes = exports.streaks = void 0;
3030
exports.streaks = __importStar(require("./streaks"));
3131
__exportStar(require("./streaks/types"), exports);
32-
exports.points = __importStar(require("./points"));
3332
exports.attributes = __importStar(require("./attributes"));
3433
exports.metrics = __importStar(require("./metrics"));
3534
exports.leaderboards = __importStar(require("./leaderboards"));
35+
exports.points = __importStar(require("./points"));
3636
__exportStar(require("./attributes/client/requests"), exports);
3737
__exportStar(require("./metrics/client/requests"), exports);
3838
__exportStar(require("./leaderboards/client/requests"), exports);

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

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,10 @@
33
*/
44
import * as environments from "../../../../../../environments";
55
import * as core from "../../../../../../core";
6+
import { Systems } from "../resources/systems/client/Client";
67
import { Boosts } from "../resources/boosts/client/Client";
8+
import { Levels } from "../resources/levels/client/Client";
9+
import { Triggers } from "../resources/triggers/client/Client";
710
export declare namespace Points {
811
interface Options {
912
environment?: core.Supplier<environments.TrophyApiEnvironment | environments.TrophyApiEnvironmentUrls>;
@@ -17,6 +20,12 @@ export declare namespace Points {
1720
export declare class Points {
1821
protected readonly _options: Points.Options;
1922
constructor(_options: Points.Options);
23+
protected _systems: Systems | undefined;
24+
get systems(): Systems;
2025
protected _boosts: Boosts | undefined;
2126
get boosts(): Boosts;
27+
protected _levels: Levels | undefined;
28+
get levels(): Levels;
29+
protected _triggers: Triggers | undefined;
30+
get triggers(): Triggers;
2231
}

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

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,29 @@
44
*/
55
Object.defineProperty(exports, "__esModule", { value: true });
66
exports.Points = void 0;
7-
const Client_1 = require("../resources/boosts/client/Client");
7+
const Client_1 = require("../resources/systems/client/Client");
8+
const Client_2 = require("../resources/boosts/client/Client");
9+
const Client_3 = require("../resources/levels/client/Client");
10+
const Client_4 = require("../resources/triggers/client/Client");
811
class Points {
912
constructor(_options) {
1013
this._options = _options;
1114
}
15+
get systems() {
16+
var _a;
17+
return ((_a = this._systems) !== null && _a !== void 0 ? _a : (this._systems = new Client_1.Systems(this._options)));
18+
}
1219
get boosts() {
1320
var _a;
14-
return ((_a = this._boosts) !== null && _a !== void 0 ? _a : (this._boosts = new Client_1.Boosts(this._options)));
21+
return ((_a = this._boosts) !== null && _a !== void 0 ? _a : (this._boosts = new Client_2.Boosts(this._options)));
22+
}
23+
get levels() {
24+
var _a;
25+
return ((_a = this._levels) !== null && _a !== void 0 ? _a : (this._levels = new Client_3.Levels(this._options)));
26+
}
27+
get triggers() {
28+
var _a;
29+
return ((_a = this._triggers) !== null && _a !== void 0 ? _a : (this._triggers = new Client_4.Triggers(this._options)));
1530
}
1631
}
1732
exports.Points = Points;
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
export * from "./resources";
21
export * from "./client";
2+
export * from "./resources";

api/resources/admin/resources/points/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,5 +14,5 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
1414
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
1515
};
1616
Object.defineProperty(exports, "__esModule", { value: true });
17-
__exportStar(require("./resources"), exports);
1817
__exportStar(require("./client"), exports);
18+
__exportStar(require("./resources"), exports);

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

Lines changed: 68 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -18,38 +18,85 @@ export declare class Boosts {
1818
protected readonly _options: Boosts.Options;
1919
constructor(_options: Boosts.Options);
2020
/**
21-
* Create points boosts for multiple users.
22-
* @throws {@link TrophyApi.BadRequestError}
21+
* List points boosts for a system.
2322
* @throws {@link TrophyApi.UnauthorizedError}
2423
* @throws {@link TrophyApi.NotFoundError}
2524
* @throws {@link TrophyApi.UnprocessableEntityError}
2625
*
2726
* @example
28-
* await trophyApi.admin.points.boosts.create({
29-
* systemKey: "xp",
30-
* boosts: [{
31-
* userId: "user-123",
32-
* name: "Double XP Weekend",
33-
* start: "2024-01-01",
34-
* end: "2024-01-03",
35-
* multiplier: 2
36-
* }, {
37-
* userId: "user-456",
38-
* name: "Holiday Bonus",
39-
* start: "2024-12-25",
40-
* multiplier: 1.5,
41-
* rounding: TrophyApi.admin.points.CreatePointsBoostsRequestBoostsItemRounding.Up
42-
* }]
27+
* await trophyApi.admin.points.boosts.list("550e8400-e29b-41d4-a716-446655440000", {
28+
* limit: 1,
29+
* skip: 1
4330
* })
4431
*/
45-
create(request: TrophyApi.admin.points.CreatePointsBoostsRequest, requestOptions?: Boosts.RequestOptions): Promise<TrophyApi.CreatePointsBoostsResponse>;
32+
list(systemId: string, request?: TrophyApi.admin.points.BoostsListRequest, requestOptions?: Boosts.RequestOptions): Promise<TrophyApi.ListPointsBoostsResponse>;
33+
/**
34+
* Create points boosts.
35+
* @throws {@link TrophyApi.UnauthorizedError}
36+
* @throws {@link TrophyApi.NotFoundError}
37+
* @throws {@link TrophyApi.UnprocessableEntityError}
38+
*
39+
* @example
40+
* await trophyApi.admin.points.boosts.create("550e8400-e29b-41d4-a716-446655440000", [{
41+
* userId: "user-123",
42+
* name: "Double XP Weekend",
43+
* start: "2024-01-01",
44+
* end: "2024-01-03",
45+
* multiplier: 2
46+
* }])
47+
*
48+
* @example
49+
* await trophyApi.admin.points.boosts.create("550e8400-e29b-41d4-a716-446655440000", [{
50+
* name: "Global Holiday Bonus",
51+
* start: "2024-12-25",
52+
* multiplier: 1.5,
53+
* rounding: TrophyApi.CreatePointsBoostRequestItemRounding.Up
54+
* }])
55+
*
56+
* @example
57+
* await trophyApi.admin.points.boosts.create("550e8400-e29b-41d4-a716-446655440000", [{
58+
* name: "Premium User Boost",
59+
* start: "2024-01-01",
60+
* multiplier: 2,
61+
* userAttributes: [{
62+
* attributeId: "550e8400-e29b-41d4-a716-446655440000",
63+
* attributeValue: "premium"
64+
* }]
65+
* }])
66+
*/
67+
create(systemId: string, request: TrophyApi.CreatePointsBoostsRequest, requestOptions?: Boosts.RequestOptions): Promise<TrophyApi.CreatePointsBoostsResponse>;
4668
/**
4769
* Delete multiple points boosts by ID.
48-
* @throws {@link TrophyApi.BadRequestError}
4970
* @throws {@link TrophyApi.UnauthorizedError}
71+
* @throws {@link TrophyApi.NotFoundError}
72+
* @throws {@link TrophyApi.UnprocessableEntityError}
73+
*
74+
* @example
75+
* await trophyApi.admin.points.boosts.delete(undefined, {})
76+
*/
77+
delete(systemId: string, request?: TrophyApi.admin.points.BoostsDeleteRequest, requestOptions?: Boosts.RequestOptions): Promise<TrophyApi.DeletePointsBoostsResponse>;
78+
/**
79+
* Update multiple points boosts.
80+
* @throws {@link TrophyApi.UnauthorizedError}
81+
* @throws {@link TrophyApi.NotFoundError}
82+
* @throws {@link TrophyApi.UnprocessableEntityError}
83+
*
84+
* @example
85+
* await trophyApi.admin.points.boosts.update("550e8400-e29b-41d4-a716-446655440000", [{
86+
* id: "550e8400-e29b-41d4-a716-446655440000",
87+
* name: "Updated Boost Name",
88+
* multiplier: 3
89+
* }])
90+
*/
91+
update(systemId: string, request: TrophyApi.PatchPointsBoostsRequest, requestOptions?: Boosts.RequestOptions): Promise<TrophyApi.PatchPointsBoostsResponse>;
92+
/**
93+
* Get a single points boost by ID.
94+
* @throws {@link TrophyApi.UnauthorizedError}
95+
* @throws {@link TrophyApi.NotFoundError}
96+
* @throws {@link TrophyApi.UnprocessableEntityError}
5097
*
5198
* @example
52-
* await trophyApi.admin.points.boosts.delete({})
99+
* await trophyApi.admin.points.boosts.get("550e8400-e29b-41d4-a716-446655440000", "660f9500-f30c-42e5-b827-557766550001")
53100
*/
54-
delete(request?: TrophyApi.admin.points.BoostsDeleteRequest, requestOptions?: Boosts.RequestOptions): Promise<TrophyApi.DeletePointsBoostsResponse>;
101+
get(systemId: string, id: string, requestOptions?: Boosts.RequestOptions): Promise<TrophyApi.AdminPointsBoost>;
55102
}

0 commit comments

Comments
 (0)