Skip to content

Commit b3168b5

Browse files
Automatically update NodeJS SDK
1 parent 943cae4 commit b3168b5

313 files changed

Lines changed: 5677 additions & 103 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.

‎BaseClient.js‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ function normalizeClientOptions(options) {
4545
"X-Fern-Language": "JavaScript",
4646
"X-Fern-Runtime": core.RUNTIME.type,
4747
"X-Fern-Runtime-Version": core.RUNTIME.version,
48-
"X-SDK-VERSION": (_a = options === null || options === void 0 ? void 0 : options.sdkVersion) !== null && _a !== void 0 ? _a : "1.27.0",
48+
"X-SDK-VERSION": (_a = options === null || options === void 0 ? void 0 : options.sdkVersion) !== null && _a !== void 0 ? _a : "1.28.0",
4949
"Tenant-ID": options === null || options === void 0 ? void 0 : options.tenantId,
5050
}, options === null || options === void 0 ? void 0 : options.headers);
5151
return Object.assign(Object.assign({}, options), { logging: core.logging.createLogger(options === null || options === void 0 ? void 0 : options.logging), headers });

‎Client.d.ts‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import { AdminClient } from "./api/resources/admin/client/Client";
33
import { LeaderboardsClient } from "./api/resources/leaderboards/client/Client";
44
import { MetricsClient } from "./api/resources/metrics/client/Client";
55
import { PointsClient } from "./api/resources/points/client/Client";
6+
import { RewardsClient } from "./api/resources/rewards/client/Client";
67
import { StreaksClient } from "./api/resources/streaks/client/Client";
78
import { UsersClient } from "./api/resources/users/client/Client";
89
import type { BaseClientOptions, BaseRequestOptions } from "./BaseClient";
@@ -16,6 +17,7 @@ export declare namespace TrophyApiClient {
1617
export declare class TrophyApiClient {
1718
protected readonly _options: NormalizedClientOptionsWithAuth<TrophyApiClient.Options>;
1819
protected _achievements: AchievementsClient | undefined;
20+
protected _rewards: RewardsClient | undefined;
1921
protected _metrics: MetricsClient | undefined;
2022
protected _users: UsersClient | undefined;
2123
protected _streaks: StreaksClient | undefined;
@@ -24,6 +26,7 @@ export declare class TrophyApiClient {
2426
protected _admin: AdminClient | undefined;
2527
constructor(options: TrophyApiClient.Options);
2628
get achievements(): AchievementsClient;
29+
get rewards(): RewardsClient;
2730
get metrics(): MetricsClient;
2831
get users(): UsersClient;
2932
get streaks(): StreaksClient;

‎Client.js‎

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,9 @@ const Client_2 = require("./api/resources/admin/client/Client");
4949
const Client_3 = require("./api/resources/leaderboards/client/Client");
5050
const Client_4 = require("./api/resources/metrics/client/Client");
5151
const Client_5 = require("./api/resources/points/client/Client");
52-
const Client_6 = require("./api/resources/streaks/client/Client");
53-
const Client_7 = require("./api/resources/users/client/Client");
52+
const Client_6 = require("./api/resources/rewards/client/Client");
53+
const Client_7 = require("./api/resources/streaks/client/Client");
54+
const Client_8 = require("./api/resources/users/client/Client");
5455
const BaseClient_1 = require("./BaseClient");
5556
const core = __importStar(require("./core"));
5657
const environments = __importStar(require("./environments"));
@@ -62,17 +63,21 @@ class TrophyApiClient {
6263
var _a;
6364
return ((_a = this._achievements) !== null && _a !== void 0 ? _a : (this._achievements = new Client_1.AchievementsClient(this._options)));
6465
}
66+
get rewards() {
67+
var _a;
68+
return ((_a = this._rewards) !== null && _a !== void 0 ? _a : (this._rewards = new Client_6.RewardsClient(this._options)));
69+
}
6570
get metrics() {
6671
var _a;
6772
return ((_a = this._metrics) !== null && _a !== void 0 ? _a : (this._metrics = new Client_4.MetricsClient(this._options)));
6873
}
6974
get users() {
7075
var _a;
71-
return ((_a = this._users) !== null && _a !== void 0 ? _a : (this._users = new Client_7.UsersClient(this._options)));
76+
return ((_a = this._users) !== null && _a !== void 0 ? _a : (this._users = new Client_8.UsersClient(this._options)));
7277
}
7378
get streaks() {
7479
var _a;
75-
return ((_a = this._streaks) !== null && _a !== void 0 ? _a : (this._streaks = new Client_6.StreaksClient(this._options)));
80+
return ((_a = this._streaks) !== null && _a !== void 0 ? _a : (this._streaks = new Client_7.StreaksClient(this._options)));
7681
}
7782
get points() {
7883
var _a;

‎api/errors/ConflictError.d.ts‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
import type * as core from "../../core";
2+
import * as errors from "../../errors/index";
3+
import type * as TrophyApi from "../index";
4+
export declare class ConflictError extends errors.TrophyApiError {
5+
constructor(body: TrophyApi.ErrorBody, rawResponse?: core.RawResponse);
6+
}

‎api/errors/ConflictError.js‎

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
"use strict";
2+
// This file was auto-generated by Fern from our API Definition.
3+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
4+
if (k2 === undefined) k2 = k;
5+
var desc = Object.getOwnPropertyDescriptor(m, k);
6+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
7+
desc = { enumerable: true, get: function() { return m[k]; } };
8+
}
9+
Object.defineProperty(o, k2, desc);
10+
}) : (function(o, m, k, k2) {
11+
if (k2 === undefined) k2 = k;
12+
o[k2] = m[k];
13+
}));
14+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
15+
Object.defineProperty(o, "default", { enumerable: true, value: v });
16+
}) : function(o, v) {
17+
o["default"] = v;
18+
});
19+
var __importStar = (this && this.__importStar) || (function () {
20+
var ownKeys = function(o) {
21+
ownKeys = Object.getOwnPropertyNames || function (o) {
22+
var ar = [];
23+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
24+
return ar;
25+
};
26+
return ownKeys(o);
27+
};
28+
return function (mod) {
29+
if (mod && mod.__esModule) return mod;
30+
var result = {};
31+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
32+
__setModuleDefault(result, mod);
33+
return result;
34+
};
35+
})();
36+
Object.defineProperty(exports, "__esModule", { value: true });
37+
exports.ConflictError = void 0;
38+
const errors = __importStar(require("../../errors/index"));
39+
class ConflictError extends errors.TrophyApiError {
40+
constructor(body, rawResponse) {
41+
super({
42+
message: "ConflictError",
43+
statusCode: 409,
44+
body: body,
45+
rawResponse: rawResponse,
46+
});
47+
Object.setPrototypeOf(this, new.target.prototype);
48+
if (Error.captureStackTrace) {
49+
Error.captureStackTrace(this, this.constructor);
50+
}
51+
this.name = "ConflictError";
52+
}
53+
}
54+
exports.ConflictError = ConflictError;

‎api/errors/index.d.ts‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
export * from "./BadRequestError";
2+
export * from "./ConflictError";
23
export * from "./ForbiddenError";
34
export * from "./NotFoundError";
45
export * from "./UnauthorizedError";

‎api/errors/index.js‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
1515
};
1616
Object.defineProperty(exports, "__esModule", { value: true });
1717
__exportStar(require("./BadRequestError"), exports);
18+
__exportStar(require("./ConflictError"), exports);
1819
__exportStar(require("./ForbiddenError"), exports);
1920
__exportStar(require("./NotFoundError"), exports);
2021
__exportStar(require("./UnauthorizedError"), exports);

‎api/resources/achievements/client/Client.js‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ class AchievementsClient {
8282
};
8383
const _authRequest = yield this._options.authProvider.getAuthRequest();
8484
const _headers = (0, headers_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_1.mergeOnlyDefinedHeaders)({
85-
"X-SDK-VERSION": (_d = (_b = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.sdkVersion) !== null && _b !== void 0 ? _b : (_c = this._options) === null || _c === void 0 ? void 0 : _c.sdkVersion) !== null && _d !== void 0 ? _d : "1.27.0",
85+
"X-SDK-VERSION": (_d = (_b = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.sdkVersion) !== null && _b !== void 0 ? _b : (_c = this._options) === null || _c === void 0 ? void 0 : _c.sdkVersion) !== null && _d !== void 0 ? _d : "1.28.0",
8686
"Tenant-ID": (_e = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.tenantId) !== null && _e !== void 0 ? _e : (_f = this._options) === null || _f === void 0 ? void 0 : _f.tenantId,
8787
}), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
8888
const _response = yield core.fetcher({
@@ -157,7 +157,7 @@ class AchievementsClient {
157157
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p;
158158
const _authRequest = yield this._options.authProvider.getAuthRequest();
159159
const _headers = (0, headers_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_1.mergeOnlyDefinedHeaders)({
160-
"X-SDK-VERSION": (_d = (_b = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.sdkVersion) !== null && _b !== void 0 ? _b : (_c = this._options) === null || _c === void 0 ? void 0 : _c.sdkVersion) !== null && _d !== void 0 ? _d : "1.27.0",
160+
"X-SDK-VERSION": (_d = (_b = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.sdkVersion) !== null && _b !== void 0 ? _b : (_c = this._options) === null || _c === void 0 ? void 0 : _c.sdkVersion) !== null && _d !== void 0 ? _d : "1.28.0",
161161
"Tenant-ID": (_e = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.tenantId) !== null && _e !== void 0 ? _e : (_f = this._options) === null || _f === void 0 ? void 0 : _f.tenantId,
162162
}), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
163163
const _response = yield core.fetcher({

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import { EnvironmentsClient } from "../resources/environments/client/Client";
77
import { LeaderboardsClient } from "../resources/leaderboards/client/Client";
88
import { MetricsClient } from "../resources/metrics/client/Client";
99
import { PointsClient } from "../resources/points/client/Client";
10+
import { RewardsClient } from "../resources/rewards/client/Client";
1011
import { SettingsClient } from "../resources/settings/client/Client";
1112
import { StreaksClient } from "../resources/streaks/client/Client";
1213
import { TenantsClient } from "../resources/tenants/client/Client";
@@ -17,6 +18,7 @@ export declare class AdminClient {
1718
protected readonly _options: NormalizedClientOptionsWithAuth<AdminClient.Options>;
1819
protected _attributes: AttributesClient | undefined;
1920
protected _achievements: AchievementsClient | undefined;
21+
protected _rewards: RewardsClient | undefined;
2022
protected _metrics: MetricsClient | undefined;
2123
protected _leaderboards: LeaderboardsClient | undefined;
2224
protected _streaks: StreaksClient | undefined;
@@ -28,6 +30,7 @@ export declare class AdminClient {
2830
constructor(options: AdminClient.Options);
2931
get attributes(): AttributesClient;
3032
get achievements(): AchievementsClient;
33+
get rewards(): RewardsClient;
3134
get metrics(): MetricsClient;
3235
get leaderboards(): LeaderboardsClient;
3336
get streaks(): StreaksClient;

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

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,10 @@ const Client_4 = require("../resources/environments/client/Client");
1010
const Client_5 = require("../resources/leaderboards/client/Client");
1111
const Client_6 = require("../resources/metrics/client/Client");
1212
const Client_7 = require("../resources/points/client/Client");
13-
const Client_8 = require("../resources/settings/client/Client");
14-
const Client_9 = require("../resources/streaks/client/Client");
15-
const Client_10 = require("../resources/tenants/client/Client");
13+
const Client_8 = require("../resources/rewards/client/Client");
14+
const Client_9 = require("../resources/settings/client/Client");
15+
const Client_10 = require("../resources/streaks/client/Client");
16+
const Client_11 = require("../resources/tenants/client/Client");
1617
class AdminClient {
1718
constructor(options) {
1819
this._options = (0, BaseClient_1.normalizeClientOptionsWithAuth)(options);
@@ -25,6 +26,10 @@ class AdminClient {
2526
var _a;
2627
return ((_a = this._achievements) !== null && _a !== void 0 ? _a : (this._achievements = new Client_1.AchievementsClient(this._options)));
2728
}
29+
get rewards() {
30+
var _a;
31+
return ((_a = this._rewards) !== null && _a !== void 0 ? _a : (this._rewards = new Client_8.RewardsClient(this._options)));
32+
}
2833
get metrics() {
2934
var _a;
3035
return ((_a = this._metrics) !== null && _a !== void 0 ? _a : (this._metrics = new Client_6.MetricsClient(this._options)));
@@ -35,11 +40,11 @@ class AdminClient {
3540
}
3641
get streaks() {
3742
var _a;
38-
return ((_a = this._streaks) !== null && _a !== void 0 ? _a : (this._streaks = new Client_9.StreaksClient(this._options)));
43+
return ((_a = this._streaks) !== null && _a !== void 0 ? _a : (this._streaks = new Client_10.StreaksClient(this._options)));
3944
}
4045
get settings() {
4146
var _a;
42-
return ((_a = this._settings) !== null && _a !== void 0 ? _a : (this._settings = new Client_8.SettingsClient(this._options)));
47+
return ((_a = this._settings) !== null && _a !== void 0 ? _a : (this._settings = new Client_9.SettingsClient(this._options)));
4348
}
4449
get applicationApiKeys() {
4550
var _a;
@@ -51,7 +56,7 @@ class AdminClient {
5156
}
5257
get tenants() {
5358
var _a;
54-
return ((_a = this._tenants) !== null && _a !== void 0 ? _a : (this._tenants = new Client_10.TenantsClient(this._options)));
59+
return ((_a = this._tenants) !== null && _a !== void 0 ? _a : (this._tenants = new Client_11.TenantsClient(this._options)));
5560
}
5661
get points() {
5762
var _a;

0 commit comments

Comments
 (0)